Skip to content

Latest commit

 

History

History
65 lines (41 loc) · 2.2 KB

README.md

File metadata and controls

65 lines (41 loc) · 2.2 KB

Web Stub Generator

Generate JSDoc and JavaScript stub from WebIDL for IDE auto-completion and type checking.

Optimized for WebStorm.

Happy hacking!

Screenshots

Method auto completion Method auto completion

Params auto completion Params auto completion

Params type-sensitive completion Params type sensitive completion

Params validation Params type check

Usage

Download this package by npm install web-stub or git clone https://github.com/ranmocy/web-stub.git. Setup your IDE to add web-stub/js folder or any JS file under it to be a library.

Note: Do not include this folder to your production code. This is for IDE only.

WebStorm: WebStorm settings

Supported API

Dev

Install dependencies: npm install

To get WebIDL: node . update

To generate JS files from WebIDL: node .

To continuesly generate files: rvm 2.3 do rerun -p 'idl/*|main.js' -x -- node .

To test: node . all && if ! git diff-index --quiet HEAD; then exit 1; fi

Dependencies

Contribution

There are ways that you can contribute to this project:

  1. Create Issue if you found IDE have issue about the interface. Please find the minimal code snippet that can reproduce the issue. Better with a screenshot.
  2. Provide more WebIDL that is commonly used. Please attach the link to W3C definition website like https://www.w3.org/TR/IndexedDB/.
  3. Send pull request on main.js. It currently can not handle all cases of WebIDL. Please help me to support more WebIDLs.