Added type definitions for @vimeo/player#15593
Conversation
|
@vimeo/player/index.d.ts Checklist
|
|
This should go in |
|
I tried as suggested. updated VSC Workspace to typescript 2.3.0. but scoped module is not found in my test.ts file. (with updated tsconfig to "baseUrl": "types" etc…). |
|
That feature won't be out until 2.3.1. This could either wait, or use |
af39298 to
adb91f5
Compare
waiting for typescript 2.3.1 for support of scoped packages
|
thanks for the help. hope now it is as needed. |
| // Project: https://github.com/vimeo/player.js | ||
| // Definitions by: Denis Yılmaz <https://github.com/denisyilmaz>, Felix Albert <[email protected]> | ||
| // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
| // TypeScript Version: 2.3.1 |
There was a problem hiding this comment.
This should just be 2.3, and we'll always use the greatest minor version.
| "dtslint": "Microsoft/dtslint#production", | ||
| "types-publisher": "Microsoft/types-publisher#production" | ||
| "types-publisher": "Microsoft/types-publisher#production", | ||
| "typescript": "^2.3.0-dev.20170418" |
| @@ -0,0 +1,456 @@ | |||
| import { Player } from '@vimeo/player' | |||
There was a problem hiding this comment.
This should be in types/vimeo__player/vimeo__player-tests.ts.
There was a problem hiding this comment.
sorry for confusion, just to be sure:
only the vimeo__player-tests.ts should be in the types/vimeo__player folder?
the vimeo__player/index.d.ts file stays in the main folder? It was suggested in a "contributor handbook", so I'm unsure whats the right way.
There was a problem hiding this comment.
Everything should go in types/vimeo__player.
and renaming tests file
|
travis failed: |
|
Yes, and be sure to run |
|
hm, with |
|
Looks like you're using an older version of dtslint, just reinstall. |
|
ok, reinstalled, but getting following error |
|
Upgrade your |
|
I'm sorry for my inability to fix this. Finally resolved all errors except for: |
|
Just add a |
needed untill typescript 2.3.1 is out.
| @@ -0,0 +1,107 @@ | |||
| // Type definitions for @vimeo/player 2.0 | |||
| // Project: https: //github.com/vimeo/player.js | |||
| // Definitions by: Denis Yılmaz <https: //github.com/denisyilmaz>, Felix Albert <[email protected]> | ||
| // Definitions: https: //github.com/DefinitelyTyped/DefinitelyTyped | ||
| // Project: https://github.com/vimeo/player.js | ||
| // Definitions by: Denis Yılmaz <mail@denisyilmaz.de>, Felix Albert <[email protected]> |
There was a problem hiding this comment.
Actually, a github username is better so we can notify you about issues and pull requests related to this package.
|
Thanks! |
|
Thanks a lot! |
|
It looks like module resolution for an import in your code resolved to a JS file and didn't find any declaration to resolve to. |
|
unfortunalty no. I'm importing the same way as in my test.ts file. |
|
ok, i looked at another type-definition and they made it like this:
declare module '@vimeo/player' {
export = Player;
}
declare module '@vimeo/player/dist/player' {
export = Player;
}you think that would fix the problem? |
|
What other type definition? ❓ |
|
in the @types/mapbox-gl they declare it this way |
|
Oh, thought you meant another definition for the same module. |
|
Oh, no sorry for confusion. :) i tried the traceResolution option, but it just shows the error in the component where I'm importing the "@vimeo/player" I'm nowhere declaring {
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es2015", "dom"],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"types": [
"node",
"clipboard",
"vimeo__player"
]
},
"files": [
"src/app/app.module.ts",
"src/main-aot.ts"
],
"angularCompilerOptions": {
"genDir": "aot",
"skipMetadataEmit" : true
}
} |
|
It looks like module resolution is correctly resolving it as a JS module, but only because it didn't find the types first. Are you sure you've correctly included those types? |
|
@rugdealer That looks like a run-time error, not a compile error. |
|
Actually we had similar problems with it. I think the problem could be found here https://github.com/vimeo/player.js#using-with-a-module-bundler >> window.Vimeo
The Vimeo-API Sets a global Vimeo Namespace in which the Player Class exist. Typings for Vimeo.Player would cause typescript compiler to fail with error, Typings for Player fail on runtime… |
Please fill in this template.
npm run lint package-name(ortscif notslint.jsonis present).If adding a new definition:
dts-gen --dt, not by basing it on an existing project.tslint.jsonshould be present, andtsconfig.jsonshould havenoImplicitAny,noImplicitThis, andstrictNullChecksset totrue.references #15571