Skip to content
This repository has been archived by the owner on Oct 9, 2021. It is now read-only.

pastelmind/vhtml-types

Repository files navigation

vhtml-types

This package is deprecated. Please use @types/vhtml instead.

The following content has been preserved for historical purposes.

Introduction

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. 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!

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

About

TypeScript type definitions for vhtml

Resources

License

Stars

Watchers

Forks

Packages

No packages published