f401c30a5e
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> |
||
---|---|---|
.circleci | ||
.vscode | ||
base | ||
src | ||
test | ||
.gitignore | ||
.npmignore | ||
.prettierrc.json | ||
.releaserc.json | ||
CONTRIBUTING.md | ||
README.md | ||
package.json | ||
tsconfig.json | ||
yarn.lock |
README.md
Electron TypeScript Definitions
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