winjs / react-winjs

React wrapper around WinJS's controls
MIT License
206 stars 47 forks source link

where can I get the proper `.d.ts` file? #31

Closed staxmanade closed 9 years ago

staxmanade commented 9 years ago

Hey @jdalton,

Ok silly question - especially since my username is behind all of the .d.ts nuget packages under*.Typings.DefinitelyTyped, but how can I get a specific version of the winjs.d.ts to run it through the winjs-control-apis tool?

jdalton commented 9 years ago

@rigdern Are you familiar with the winjs-control-apis tool?

staxmanade commented 9 years ago

I found a (maybe not the) winjs.d.ts required file, but tried running this

node ./main.js ../winjs/tests/TestLib/winjs.dev.d.ts

and got this error

Error: Unexpected type: null (line null)
    at new TypeError (/.../winjs/winjs-control-apis/tscore.js:14:9)
rigdern commented 9 years ago

The winjs.d.ts file is located at: https://github.com/winjs/winjs/blob/master/typings/winjs/winjs.d.ts

If you want it for a different version of WinJS, checkout the version of WinJS you want and the winjs.d.ts file will be located in the same spot (typings/winjs/winjs.d.ts).

@staxmanade The file you used is winjs.dev.d.ts which is different. This contains the API surface for private parts of WinJS that are used in our unit tests.

Out of curiosity, what's your interest in using the winjs-control-apis tool? We typically use it when we're ready to make react-winjs compatible with the latest version of WinJS (more info on our wiki).

staxmanade commented 9 years ago

@rigdern I'd prefer not to dig this deep into the libraries (yet), but in issue #28 @jdalton thought a PR could help move it along.

rigdern commented 9 years ago

I see. Here's what you need:

One option for you is to locally copy the MediaPlayer and ScrollViewer type definitions into the winjs.d.ts file and then run that thru winjs-control-apis.

One thing to watch out for is that winjs-control-apis ignores the MediaPlayer for historical reasons. You'll have to remove these lines so winjs-control-apis will output the API surface for MediaPlayer.

In the future, I think the ideal setup would be:

staxmanade commented 9 years ago

Thanks for the great detail @rigdern. If I get some time, I'll see where I get.

staxmanade commented 9 years ago

Closing this for now (as the original question about .d.ts was answered)