diff --git a/README.md b/README.md index 34e3820..df71028 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,12 @@ const SPEC = { template: '', css: ':host { display: block; }', events: ['click'], - element: { input: 'input.name' }, // refs.input: HTMLInputElement | null - elements: { buttons: 'button' }, // refs.buttons: HTMLButtonElement[] + element: { + input: 'input.name', // refs.input: HTMLInputElement | null (from the tag) + thing: '.thing', // refs.thing: Element | null (no tag to go on) + card: ['.card', HTMLElement], // refs.card: HTMLElement | null (checked with instanceof) + }, + elements: { buttons: 'button' }, // refs.buttons: HTMLButtonElement[] props: { userId: number(), // user-id number | undefined min: number({ default: 1 }), // min number @@ -41,6 +45,7 @@ ExampleElement.observedAttributes; // readonly ('user-id' | 'min' | 'is-ready' | - **Codecs**: `string`, `number`, `enable`, `disable`, `choice([...])`, `json()`, `prop({ default, decode, encode })`. - **Shadow DOM**: `shadow` attaches a root and clones `template` into it; `css` is a shared adopted stylesheet. An existing declarative shadow root is used instead (and `shadow`/`template` are ignored). `root` is the shadow root (even when closed) or the element itself. - **Light DOM**: `template` is appended on first connect; `css` is added once per element type, as a `