-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript definitions are out of date #102
Comments
The best way is to rewrite the package in Typescript but it requires a huge effort. If you only want to keep the definitions up to date, you can actually include definitions in your own package. You can do this by add {
"types": "./lib/main.d.ts"
} |
Rewrite in typescript 😛 Actually ts is superset of js and it has |
@akosyakov Would you be willing and/or interested in implementing a PoC of the JSDoc annotations? That sounds like a decent idea. |
Had a quick try at this, and immediately hit microsoft/TypeScript#7546. But it looks like this might finally be getting solved as a part of microsoft/TypeScript#30555? |
Yeah, I'm going to keep this open if someone that actually uses TS wants to have a go at it. With the following
If someone's interested in setting it up, a possible workflow to generate the d.ts files could be something like {
"compilerOptions": {
"outDir": "./ts/",
"strictNullChecks": false,
"lib": ["es2017"],
"module": "es6",
"target": "es6",
"allowJs": true,
"checkJs": true,
"types": []
},
"include": ["./src/**/*"]
} |
I don't think others are doing like this. One of the common ways is to just create Using JSDoc seems to very difficult to maintain. At that point, you may as well write it in TypeScript. |
Joining the party as I'm trying to use it on TypeScript, and for the time being I indeed have to work with either |
Ping @benjamingr, who said he might be interested in looking at this. |
Sure, is the context generating the type information? Would dts-gen not suffice for starters :] ? |
I've got background in Typescript and YAML, and this implementation interests me. I'd like to have a look at doing this by adding type annotations to the existing implementation, and having TSC generate the definitions file. Made some progress with the approach enabled by Babel 7 using @babel/preset-typescript for code generation, and tsc for error checking. But there are a few parts of the code I don't understand. I'll post them as separate questions. |
CC @ikatyang @ColinBradley
See also DefinitelyTyped/DefinitelyTyped#33780
The DefinitelyTyped TS definitions haven't been updated since the 1.0 release last fall, and the library's API has expanded a bit since then. With the next minor release I'll be deprecating some of the endpoints and adding new ones thanks to #99.
Any suggestions for how to make it easier to keep these definitions up to date?
The text was updated successfully, but these errors were encountered: