Skip to content
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

Incorporate @types/stremio-addon-sdk for improved type safety #20

Open
sleeyax opened this issue Apr 6, 2024 · 0 comments
Open

Incorporate @types/stremio-addon-sdk for improved type safety #20

sleeyax opened this issue Apr 6, 2024 · 0 comments

Comments

@sleeyax
Copy link

sleeyax commented Apr 6, 2024

Finally a project using TypeScript! In case you didn't know, there's a @types/stremio-addon-sdk package which provides types for the manifest, catalog, stream etc. You can install it as a dev dependency: npm i -D @types/stremio-addon-sdk.

For example, the following bad any type:

const output: any = {

Could be typed with:

 const output: { streams: Stream[] }  = { };

See @types/stremio-addon-sdk/index.d.ts for the full type definitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant