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.
var html5 = require'idl4js'html5dom4 = 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.
- type: one of ["interface", "dictionary", "exception", "enum", "callback"]
- methods: a list of methods that appear on the prototype. Methods can have the following:
- returns: the type of value returned. If missing then the method doesn't return anything.
- args: a list of arguments by name -> type, in order.
- properties: a list of mutable properties by name -> type
- constants: A list of constant names and their values.
- defaults: For dictionaries, a list of dictionary members and their default values
- indexed: if an item is
indexedthen 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.
- keyed: similar to indexed, except the items are named instead of indexed. CSS properties are an example of this.
- construct: if an item is constructable via
Multiple accepted types in args lists are indicated as arrays.
An abbreviated version of
html5 also includes a few extras like ShadowDOM and XHR