-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add .d.ts
files for improved TypeScript support
#30
Comments
Already supports TypeScript, the lib just isn't written in it. That said: I do not plan on ever converting this library to TypeScript, at least not for now. My reasoning is aligned with that of the Svelte framework itself, which does the same thing (see here for a good article on that topic). And for option 2 can you be more specific on what you're proposing? It may be because I'm relatively new to TypeScript, but I can say that I'm using Also, please feel free to submit a PR as well! |
Fair enough, then something along the line of type file would be awesome.
This is awkward, with following {
"include": ["./**/*.ts", "./**/*.tsx", "django_core/static_src/components/index.ts"],
"exclude": ["node_modules", "postcss.config.cjs", "django_core/static"],
"compilerOptions": {
"lib": ["esnext", "DOM", "DOM.Iterable"],
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"moduleResolution": "Bundler",
"module": "esnext",
"target": "esnext",
"ignoreDeprecations": "5.0",
"skipLibCheck": false,
"sourceMap": true,
"strict": true,
"paths": {
"$functions": ["./django_core/static_src/functions/"],
"$functions/*": ["./django_core/static_src/functions/*"],
"$icons": ["./django_core/static_src/components/icons/"],
"$icons/*": ["./django_core/static_src/components/icons/*"],
"$components": ["./django_core/static_src/components/"],
"$components/*": ["./django_core/static_src/components/*"]
}
}
} So my proposal is to add a definition file. ( example from |
.d.ts
files for improved TypeScript support
See #33 (WIP) |
…nt a "newable" constructor type and also fixing the optional types by defining their defaults, so the generated .d.ts properly suffixes the "?" at the end of each optional field.
…nt a "newable" constructor type and also fixing the optional types by defining their defaults, so the generated .d.ts properly suffixes the "?" at the end of each optional field.
… custom type for 'component' to prevent any confusion with an actual Svelte type.
Describe the problem
It would be awesome if the project supports
types.d
file ( or maybe rewrite intypescript
? )Otherwise it's not possible to use this project in typescript based project ( well it's possible to use
@ts-ignore
, but you get the idea )`
Describe the proposed solution
The way i see it, there's 2 options
jsdoc
, it should be easier )types
files ( this is the approach that requires the least amount of work )Alternatives considered
Ignoring
types
in typescript fileImportance
would make my life easier
The text was updated successfully, but these errors were encountered: