Convert the Electron API JSON file to electron.d.ts
Перейти к файлу
Zeke Sikelianos b1be1a4806 rename the project 2017-03-29 13:02:24 -07:00
base rename the project 2017-03-29 13:02:24 -07:00
lib Setup for static properties (touchbar) 2017-03-25 12:56:35 +11:00
scripts standardize 2017-03-23 13:02:01 -07:00
test Whole bunch of fixes / changes 2017-03-24 08:48:48 -07:00
test-smoke 🔧 Fix issues in test/main.ts 2017-03-24 15:17:16 -07:00
vendor Whole bunch of fixes / changes 2017-03-24 08:48:48 -07:00
.gitignore Whole bunch of fixes / changes 2017-03-24 08:48:48 -07:00
.npmignore We need the base files 2016-11-03 18:21:44 +11:00
.travis.yml Whole bunch of fixes / changes 2017-03-24 08:48:48 -07:00
README.md rename the project 2017-03-29 13:02:24 -07:00
cli.js Allow inFile to be a commit reference in the electron docs 2016-11-16 17:00:22 +11:00
index.js make method names more clear; add comments 2017-03-02 16:51:38 -08:00
package.json rename the project 2017-03-29 13:02:24 -07:00
tslint.json 🙅 Exclude adjecant-overload-signature 2017-03-24 15:01:34 -07:00
yarn.lock 🔧 Use debug instead of console 2017-03-24 11:53:19 -07:00

README.md

electron-DefinitelyTyped Build Status

Parse Electron's JSON API documentation and spit out a typescript definition file

Installation

npm install electron-DefinitelyTyped --save

CLI Usage

To generate the definitions

electron-DefinitelyTyped --in=path/to/electron/api.json --out=path/to/electron.d.ts

Any warnings during the generation can normally be ignored unless it actually throws an error

Programmatic Usage

The module exports a function that parses a given API JSON object and returns an array of lines to create the definition file

const generateDefinitions = require('electron-DefinitelyTyped')
const apiPath = './vendor/electron/docs/api.json'

const definitionLines = generateDefinitions(require(apiPath))
// definitionLines will be an array of file lines

License

MIT