Convert the Electron API JSON file to electron.d.ts
Перейти к файлу
dependabot[bot] f401c30a5e
build(deps): bump trim-off-newlines from 1.0.1 to 1.0.3 (#199)
Bumps [trim-off-newlines](https://github.com/stevemao/trim-off-newlines) from 1.0.1 to 1.0.3.
- [Release notes](https://github.com/stevemao/trim-off-newlines/releases)
- [Commits](https://github.com/stevemao/trim-off-newlines/compare/v1.0.1...v1.0.3)

---
updated-dependencies:
- dependency-name: trim-off-newlines
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-07 21:31:13 -06:00
.circleci build: reduce size of npm package 2021-08-25 14:35:13 -07:00
.vscode fix: dynamic params might be collections (#193) 2021-08-25 14:03:33 -07:00
base fix: only export value types for things that are actually exported 2021-04-17 19:21:18 -07:00
src fix: dynamic params might be collections (#193) 2021-08-25 14:03:33 -07:00
test refactor: use the new @electron/docs-parser module and rewrite in TS (#139) 2019-05-01 13:00:49 -07:00
.gitignore refactor: use the new @electron/docs-parser module and rewrite in TS (#139) 2019-05-01 13:00:49 -07:00
.npmignore fix: avoid leaking secrets (#93) 2018-02-12 11:29:16 -08:00
.prettierrc.json refactor: use the new @electron/docs-parser module and rewrite in TS (#139) 2019-05-01 13:00:49 -07:00
.releaserc.json build: migrate master->main 2021-08-25 13:49:12 -07:00
CONTRIBUTING.md build: migrate master->main 2021-08-25 13:49:12 -07:00
README.md build: migrate master->main 2021-08-25 13:49:12 -07:00
package.json build: reduce size of npm package 2021-08-25 14:35:13 -07:00
tsconfig.json fix: move docs-parser to dev-dep 2020-04-02 10:39:57 -07:00
yarn.lock build(deps): bump trim-off-newlines from 1.0.1 to 1.0.3 (#199) 2022-02-07 21:31:13 -06: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 --api=path/to/electron/api.json --out-dir=path/to/out/dir

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({ electronApi: require(apiPath) })
// definitionLines will be an strin representation of the definition file

License

MIT