webidl2-mozilla-experimental
v1.0.8
Published
This forked from https://github.com/w3c/webidl2.js
Downloads
3
Readme
webidl2-mozilla-compatible
This forked from https://github.com/w3c/webidl2.js
add some features for mozilla-webidl-file
https://dxr.mozilla.org/mozilla-central/source/dom/webidl/
exposed more internal APIs
Installation
npm install webidl2-mozilla-experimental
APIs
{ ExtendedAttributes: [Getter],
tokenise: [Getter],
Tokeniser: [Getter],
parse: [Getter],
parseByTokens: [Getter],
error: [Getter],
consume: [Getter],
callback: [Getter],
interface_: [Getter],
definition: [Getter],
partial: [Getter],
definitions: [Getter],
write: [Getter],
validate: [Getter],
Enum: [Getter],
Includes: [Getter],
Typedef: [Getter],
CallbackFunction: [Getter],
Interface: [Getter],
Mixin: [Getter],
Dictionary: [Getter],
Namespace: [Getter],
CallbackInterface: [Getter],
Constant: [Getter],
Container: [Getter],
Attribute: [Getter],
Operation: [Getter]
}
Options
enable-mozilla-namespaces-constants
enable-mozilla-bodyless-interface
enable-mozilla-attribute-sequence
{ enableMozillaNamespacesConstants:true, enableMozillaBodylessInterface:true, enableMozillaAttributeSequence:true }
Documentation
0.enable-mozilla-namespaces-constants
var wbidl2 = require("webidl2-mozilla-experimental")
var s =`namespace APZHitResultFlags {
const unsigned short INVISIBLE = 0;
};`
console.log(s)
var tree = webidl2.parse(s,{enableMozillaNamespacesConstants:true});
var d = JSON.parse(JSON.stringify(tree))
d[0]
d[0].members
var txt = webidl2.write(tree);
console.log(txt)
1.enable-mozilla-bodyless-interface
var s ="interface MozObserver;"
var tree = webidl2.parse(s,{enableMozillaBodylessInterface:true})
var d = JSON.parse(JSON.stringify(tree))
d
2.enable-mozilla-attribute-sequence
var s = `interface AccessibleNode {
readonly attribute sequence<DOMString> states;
};`
var tree = webidl3.parse(s,{
enableMozillaNamespacesConstants:true,
enableMozillaBodylessInterface:true,
enableMozillaAttributeSequence:true
})
var d = JSON.parse(JSON.stringify(tree))
d