0.1.0 • Published 3 years ago

@pastelmind/vhtml-types v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

vhtml-types

This project provides TypeScript type definitions (.d.ts) for vhtml. It generates type definitions for JSX by extracting and transforming interfaces from @types/react.

Installation and Usage

NOTE: This type definition has been submitted to DefinitelyTyped and is awaiting approval. The following instructions are meant to be a temporary measure.

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!

Building

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