1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class MyElement extends HTMLElement {
static get observedAttributes() {
return ['disabled'];
}
set disabled(val) {
this.__disabled = val;
}
get disabled() {
return this.__disabled;
}
fire() {
this.dispatchEvent(new Event('disabled-changed'));
}
}
Enter to Rename, Shift+Enter to Preview
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function myPlugin() {
// Write a custom plugin
return {
// Make sure to always give your plugins a name, this helps when debugging
name: 'my-plugin',
// Runs before analysis starts
initialize({ts, customElementsManifest, context}) {},
// Runs for all modules in a project, before continuing to the analyzePhase
collectPhase({ts, node, context}){},
// Runs for each module
analyzePhase({ts, node, moduleDoc, context}){},
// Runs for each module, after analyzing, all information about your module should now be available
moduleLinkPhase({moduleDoc, context}){},
// Runs after modules have been parsed and after post-processing
packageLinkPhase({customElementsManifest, context}){},
}
}
Enter to Rename, Shift+Enter to Preview
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
"schemaVersion": "1.0.0",
"readme": "",
"modules": [
{
"kind": "javascript-module",
"path": "src/my-element.js",
"declarations": [
{
"kind": "class",
"description": "",
"name": "MyElement",
"members": [
{
"kind": "field",
"name": "disabled"
},
{
"kind": "method",
"name": "fire"
}
],
"events": [
{
"name": "disabled-changed",
"type": {
"text": "Event"
}
}
],
"attributes": [
{
"name": "disabled"
}
],
"superclass": {
Enter to Rename, Shift+Enter to Preview