https://github.com/unstubbable/declare-react-module
📜 Create TypeScript declaration files for React modules written in ES.Next.
https://github.com/unstubbable/declare-react-module
definitions es6 esnext react typescript
Last synced: about 1 month ago
JSON representation
📜 Create TypeScript declaration files for React modules written in ES.Next.
- Host: GitHub
- URL: https://github.com/unstubbable/declare-react-module
- Owner: unstubbable
- License: mit
- Created: 2017-04-18T20:14:55.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-13T09:09:41.000Z (about 7 years ago)
- Last Synced: 2025-05-13T02:11:37.407Z (about 1 month ago)
- Topics: definitions, es6, esnext, react, typescript
- Language: TypeScript
- Homepage:
- Size: 226 KB
- Stars: 7
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# declare-react-module
[![npm][npm-badge]][npm]
[![build][travis-ci-badge]][travis-ci]
[](https://codecov.io/gh/KingHenne/declare-react-module)
[![semantic-release][semantic-release-badge]][semantic-release]Create TypeScript declaration files for React modules written in
ES.Next ([stage 2](https://babeljs.io/docs/plugins/preset-stage-2/)).## Usage
### Locally
1. Install `declare-react-module` as a dev dependency:
```sh
npm install --save-dev declare-react-module
```2. Add a new entry to `"scripts"` in your `package.json`:
```json
{
"prepublish": "declare-react-module"
}
```This will create an `index.d.ts` file in your project root before publishing to npm.
### As a Global Script
1. Install `declare-react-module` as a global dependency:
```sh
npm install --global declare-react-module
```2. Run `declare-react-module` from the command line:
```sh
declare-react-module packages/my-package
# or
declare-react-module node_modules/some-module --outDir=./typings
```[npm]: https://www.npmjs.com/package/declare-react-module
[npm-badge]: https://img.shields.io/npm/v/declare-react-module.svg?maxAge=3600
[semantic-release]: https://github.com/semantic-release/semantic-release
[semantic-release-badge]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[travis-ci]: https://travis-ci.org/KingHenne/declare-react-module
[travis-ci-badge]: https://travis-ci.org/KingHenne/declare-react-module.svg?branch=master