-
Notifications
You must be signed in to change notification settings - Fork 51
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
preset not support for typescript #6
Comments
How about if PrimeVue/Tailwind starts supporting Typescript? |
Bumping this. Downloading a preset directory can be nice to customize styles of components, but it's unclear why it's necessary, especially considering all the files are raw JavaScript and not Vue files. On top of that, these component files do not come with type definitions, making actual customization difficult. Adding scoped EDIT - Workaround: I monkey patched a TS declaration file you can place inside your preset directory. // @/presets/index.d.ts (probably @/presets/lara/index.d.ts if you follow the docs to the letter)
import type { PrimeVuePTOptions } from "primevue/config";
import type { PassThrough } from "primevue/ts-helpers";
declare module "index.js" {
export = PassThrough<PrimeVuePTOptions>;
} Theoretically you can also do this to every import { CheckboxPassThroughOptions } from "primevue/checkbox";
import { PassThrough } from "primevue/ts-helpers";
export default {
// ...
} satisfies PassThrough<CheckboxPassThroughOptions>; Might make a PR when I have time with a starter project that employs this strategy. PrimeVue is a really good package, and these starter repos illustrate their vision in the package well, passing around the types just needs a bit of work is all. Hopefully this helps! |
When I use typescript vue 3 is not work for presset.
The text was updated successfully, but these errors were encountered: