This package is deprecated. Please use @types/vhtml instead.
The following content has been preserved for historical purposes.
This project provides TypeScript type definitions (.d.ts
) for vhtml. It generates type definitions for JSX by extracting and transforming interfaces from @types/react.
NOTE: This type definition has been submitted to DefinitelyTyped and is awaiting approval. The following instructions are meant to be a temporary measure. PR accepted!
First, install vhtml and vhtml-types.
npm install -D vhtml @pastelmind/vhtml-types
Next, add the following line to your tsconfig.json
:
{
"compilerOptions": {
"paths": {
// Add this
"vhtml": ["./node_modules/@pastelmind/vhtml-types"]
}
}
}
This allows you to use vhtml and enjoy the benefits of type-checking your JSX expressions.
Note: This type definition may clash with other libraries and frameworks that bring their own JSX type definitions, e.g. React. I have not tested what happens when both vhtml and React is use together. Use with caution!
First, install the necessary packages:
npm install
Then generate the type definitions for vhtml:
npm run build
Finally, test the generated type definitions:
npm run test