Gathering detailed insights and metrics for idl4js
Gathering detailed insights and metrics for idl4js
Gathering detailed insights and metrics for idl4js
Gathering detailed insights and metrics for idl4js
npm install idl4js
Typescript
Module System
NPM Version
77.3
Supply Chain
97.6
Quality
74.6
Maintenance
100
Vulnerability
99.6
License
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
The purpose of this project is simply to provide IDL definitions to JavaScript in a JavaScript friendly manner. IDL is converted to JSON, types are normalized to their JavaScript counterpart, and definitions are flattened down from multiple "implements", etc. The result is something that's actually usable and useful directly in JavaScript.
For regular usage, simply use the specific json files needed. If using from Node.js, install this module:
npm install idl4js
A function for each json file is exported that will load it for you.
1var html5 = require('idl4js').html5(), 2 dom4 = require('id4js').dom4();
At the top level is the definition type. The vast majority of definitions are interfaces. A handful are dictionaries which are exclusively used for initializing event objects. A smaller handful are enums.
indexed
then it will have numbered properties, an "item" method, and a length. The type of value is indicated, as well as whether the items are writable, deletable, and creatable.new
in JavaScript then it will have this property, which includes the name of the constructor and args.Arrays of items are listed with '...' after their name. This indicates that JavaScript Array type is either accepted or returned as opposed to some DOM Collection type.
Multiple accepted types in args lists are indicated as arrays.
An abbreviated version of Window
:
1{ 2 "Window": { 3 "type": "interface", 4 "inherits": ["EventTarget"], 5 "readonly": { 6 "window": "Window", 7 "self": "Window" 8 }, 9 "properties": { 10 "name": "String", 11 "status": "String", 12 "opener": "Window", 13 "onabort": "EventHandler", 14 }, 15 "methods": { 16 "close": {}, 17 "stop": {}, 18 "open": { 19 "returns": "Window", 20 "args": { 21 "url": "String", 22 "target": "String", 23 "features": "String", 24 "replace": "Boolean" 25 } 26 }, 27 "setTimeout": { 28 "returns": "Int32", 29 "args": { 30 "handler": ["Function", "String"], 31 "timeout": "Int32", 32 "arguments": "Any" 33 } 34 }, 35 "clearTimeout": { 36 "args": { 37 "handle": "Int32" 38 } 39 } 40 } 41 } 42}
html5 also includes a few extras like ShadowDOM and XHR
No vulnerabilities found.
No security vulnerabilities found.