Convert the Electron API JSON file to electron.d.ts
Перейти к файлу
Charles Kerr 20474866c0 Move project URL to electronjs.org (#100) 2018-05-11 11:21:55 -07:00
base Move project URL to electronjs.org (#100) 2018-05-11 11:21:55 -07:00
lib feat: add support for abstract TouchBarItem 2018-02-13 05:00:48 +11:00
test bump test timeout to 30 seconds 2017-11-20 08:30:49 -08:00
test-smoke sync menu.popup signature to breaking change in Electron 2.0 2018-02-20 11:31:09 -06:00
vendor aim ELECTRON_COMMIT at refactor-menu-popup branch 2018-02-20 13:28:18 -06:00
.gitignore fix: avoid leaking secrets (#93) 2018-02-12 11:29:16 -08:00
.npmignore fix: avoid leaking secrets (#93) 2018-02-12 11:29:16 -08:00
.travis.yml feat: set up semantic-release (#87) 2017-11-27 18:49:51 -08:00
README.md call it one point oh 2017-03-31 20:10:27 -07:00
cli.js Handle the possibility a function is in a multi-type literal 2017-11-08 17:30:50 +13:00
index.js Removed @deprecated on namespace Electron. 2017-09-22 18:28:59 +02:00
package-lock.json 1.2.11 2017-11-20 08:42:07 -08:00
package.json feat: set up semantic-release (#87) 2017-11-27 18:49:51 -08:00
tslint.json Changed `declare module "electron"` to export = Electron 2017-09-20 18:44:55 +02:00

README.md

Electron TypeScript Definitions Build Status

This module uses Electron's JSON API documentation to produce a TypeScript definition file for the Electron API.

Installation

npm install electron-typescript-definitions --save

CLI Usage

To generate the definitions

electron-typescript-definitions --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-typescript-definitions')
const apiPath = './vendor/electron/docs/api.json'

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

License

MIT