@joist/element 3.2.1 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joist/element",
3
- "version": "3.2.1",
3
+ "version": "3.4.0",
4
4
  "type": "module",
5
5
  "main": "./target/lib.js",
6
6
  "module": "./target/lib.js",
@@ -24,11 +24,11 @@ export declare function element<Target extends CustomElementConstructor>(Base: T
24
24
  click(): void;
25
25
  hidePopover(): void;
26
26
  showPopover(): void;
27
- togglePopover(force?: boolean | undefined): boolean;
28
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
29
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
30
- removeEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
31
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
27
+ togglePopover(force?: boolean): boolean;
28
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
29
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
30
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
31
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
32
32
  disconnectedCallback?(): void;
33
33
  readonly attributes: NamedNodeMap;
34
34
  readonly classList: DOMTokenList;
@@ -54,10 +54,10 @@ export declare function element<Target extends CustomElementConstructor>(Base: T
54
54
  slot: string;
55
55
  readonly tagName: string;
56
56
  attachShadow(init: ShadowRootInit): ShadowRoot;
57
- checkVisibility(options?: CheckVisibilityOptions | undefined): boolean;
58
- closest<K_2 extends keyof HTMLElementTagNameMap>(selector: K_2): HTMLElementTagNameMap[K_2] | null;
59
- closest<K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3] | null;
60
- closest<K_4 extends keyof MathMLElementTagNameMap>(selector: K_4): MathMLElementTagNameMap[K_4] | null;
57
+ checkVisibility(options?: CheckVisibilityOptions): boolean;
58
+ closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
59
+ closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;
60
+ closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K] | null;
61
61
  closest<E extends Element = Element>(selectors: string): E | null;
62
62
  computedStyleMap(): StylePropertyMapReadOnly;
63
63
  getAttribute(qualifiedName: string): string | null;
@@ -68,10 +68,10 @@ export declare function element<Target extends CustomElementConstructor>(Base: T
68
68
  getBoundingClientRect(): DOMRect;
69
69
  getClientRects(): DOMRectList;
70
70
  getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
71
- getElementsByTagName<K_5 extends keyof HTMLElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<HTMLElementTagNameMap[K_5]>;
72
- getElementsByTagName<K_6 extends keyof SVGElementTagNameMap>(qualifiedName: K_6): HTMLCollectionOf<SVGElementTagNameMap[K_6]>;
73
- getElementsByTagName<K_7 extends keyof MathMLElementTagNameMap>(qualifiedName: K_7): HTMLCollectionOf<MathMLElementTagNameMap[K_7]>;
74
- getElementsByTagName<K_8 extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K_8): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K_8]>;
71
+ getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
72
+ getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
73
+ getElementsByTagName<K extends keyof MathMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
74
+ getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
75
75
  getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
76
76
  getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
77
77
  getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
@@ -89,21 +89,22 @@ export declare function element<Target extends CustomElementConstructor>(Base: T
89
89
  removeAttribute(qualifiedName: string): void;
90
90
  removeAttributeNS(namespace: string | null, localName: string): void;
91
91
  removeAttributeNode(attr: Attr): Attr;
92
- requestFullscreen(options?: FullscreenOptions | undefined): Promise<void>;
92
+ requestFullscreen(options?: FullscreenOptions): Promise<void>;
93
93
  requestPointerLock(): void;
94
- scroll(options?: ScrollToOptions | undefined): void;
94
+ scroll(options?: ScrollToOptions): void;
95
95
  scroll(x: number, y: number): void;
96
- scrollBy(options?: ScrollToOptions | undefined): void;
96
+ scrollBy(options?: ScrollToOptions): void;
97
97
  scrollBy(x: number, y: number): void;
98
- scrollIntoView(arg?: boolean | ScrollIntoViewOptions | undefined): void;
99
- scrollTo(options?: ScrollToOptions | undefined): void;
98
+ scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
99
+ scrollTo(options?: ScrollToOptions): void;
100
100
  scrollTo(x: number, y: number): void;
101
101
  setAttribute(qualifiedName: string, value: string): void;
102
102
  setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
103
103
  setAttributeNode(attr: Attr): Attr | null;
104
104
  setAttributeNodeNS(attr: Attr): Attr | null;
105
+ setHTMLUnsafe(html: string): void;
105
106
  setPointerCapture(pointerId: number): void;
106
- toggleAttribute(qualifiedName: string, force?: boolean | undefined): boolean;
107
+ toggleAttribute(qualifiedName: string, force?: boolean): boolean;
107
108
  webkitMatchesSelector(selectors: string): boolean;
108
109
  readonly baseURI: string;
109
110
  readonly childNodes: NodeListOf<ChildNode>;
@@ -119,20 +120,20 @@ export declare function element<Target extends CustomElementConstructor>(Base: T
119
120
  readonly previousSibling: ChildNode | null;
120
121
  textContent: string | null;
121
122
  appendChild<T extends Node>(node: T): T;
122
- cloneNode(deep?: boolean | undefined): Node;
123
+ cloneNode(deep?: boolean): Node;
123
124
  compareDocumentPosition(other: Node): number;
124
125
  contains(other: Node | null): boolean;
125
- getRootNode(options?: GetRootNodeOptions | undefined): Node;
126
+ getRootNode(options?: GetRootNodeOptions): Node;
126
127
  hasChildNodes(): boolean;
127
- insertBefore<T_1 extends Node>(node: T_1, child: Node | null): T_1;
128
+ insertBefore<T extends Node>(node: T, child: Node | null): T;
128
129
  isDefaultNamespace(namespace: string | null): boolean;
129
130
  isEqualNode(otherNode: Node | null): boolean;
130
131
  isSameNode(otherNode: Node | null): boolean;
131
132
  lookupNamespaceURI(prefix: string | null): string | null;
132
133
  lookupPrefix(namespace: string | null): string | null;
133
134
  normalize(): void;
134
- removeChild<T_2 extends Node>(child: T_2): T_2;
135
- replaceChild<T_3 extends Node>(node: Node, child: T_3): T_3;
135
+ removeChild<T extends Node>(child: T): T;
136
+ replaceChild<T extends Node>(node: Node, child: T): T;
136
137
  readonly ELEMENT_NODE: 1;
137
138
  readonly ATTRIBUTE_NODE: 2;
138
139
  readonly TEXT_NODE: 3;
@@ -154,6 +155,8 @@ export declare function element<Target extends CustomElementConstructor>(Base: T
154
155
  dispatchEvent(event: Event): boolean;
155
156
  ariaAtomic: string | null;
156
157
  ariaAutoComplete: string | null;
158
+ ariaBrailleLabel: string | null;
159
+ ariaBrailleRoleDescription: string | null;
157
160
  ariaBusy: string | null;
158
161
  ariaChecked: string | null;
159
162
  ariaColCount: string | null;
@@ -191,12 +194,12 @@ export declare function element<Target extends CustomElementConstructor>(Base: T
191
194
  ariaValueNow: string | null;
192
195
  ariaValueText: string | null;
193
196
  role: string | null;
194
- animate(keyframes: PropertyIndexedKeyframes | Keyframe[] | null, options?: number | KeyframeAnimationOptions | undefined): Animation;
195
- getAnimations(options?: GetAnimationsOptions | undefined): Animation[];
196
- after(...nodes: (string | Node)[]): void;
197
- before(...nodes: (string | Node)[]): void;
197
+ animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;
198
+ getAnimations(options?: GetAnimationsOptions): Animation[];
199
+ after(...nodes: (Node | string)[]): void;
200
+ before(...nodes: (Node | string)[]): void;
198
201
  remove(): void;
199
- replaceWith(...nodes: (string | Node)[]): void;
202
+ replaceWith(...nodes: (Node | string)[]): void;
200
203
  innerHTML: string;
201
204
  readonly nextElementSibling: Element | null;
202
205
  readonly previousElementSibling: Element | null;
@@ -204,19 +207,19 @@ export declare function element<Target extends CustomElementConstructor>(Base: T
204
207
  readonly children: HTMLCollection;
205
208
  readonly firstElementChild: Element | null;
206
209
  readonly lastElementChild: Element | null;
207
- append(...nodes: (string | Node)[]): void;
208
- prepend(...nodes: (string | Node)[]): void;
209
- querySelector<K_9 extends keyof HTMLElementTagNameMap>(selectors: K_9): HTMLElementTagNameMap[K_9] | null;
210
- querySelector<K_10 extends keyof SVGElementTagNameMap>(selectors: K_10): SVGElementTagNameMap[K_10] | null;
211
- querySelector<K_11 extends keyof MathMLElementTagNameMap>(selectors: K_11): MathMLElementTagNameMap[K_11] | null;
212
- querySelector<K_12 extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K_12): HTMLElementDeprecatedTagNameMap[K_12] | null;
213
- querySelector<E_1 extends Element = Element>(selectors: string): E_1 | null;
214
- querySelectorAll<K_13 extends keyof HTMLElementTagNameMap>(selectors: K_13): NodeListOf<HTMLElementTagNameMap[K_13]>;
215
- querySelectorAll<K_14 extends keyof SVGElementTagNameMap>(selectors: K_14): NodeListOf<SVGElementTagNameMap[K_14]>;
216
- querySelectorAll<K_15 extends keyof MathMLElementTagNameMap>(selectors: K_15): NodeListOf<MathMLElementTagNameMap[K_15]>;
217
- querySelectorAll<K_16 extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K_16): NodeListOf<HTMLElementDeprecatedTagNameMap[K_16]>;
218
- querySelectorAll<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
219
- replaceChildren(...nodes: (string | Node)[]): void;
210
+ append(...nodes: (Node | string)[]): void;
211
+ prepend(...nodes: (Node | string)[]): void;
212
+ querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
213
+ querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
214
+ querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
215
+ querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null;
216
+ querySelector<E extends Element = Element>(selectors: string): E | null;
217
+ querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
218
+ querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
219
+ querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
220
+ querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
221
+ querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
222
+ replaceChildren(...nodes: (Node | string)[]): void;
220
223
  readonly assignedSlot: HTMLSlotElement | null;
221
224
  readonly attributeStyleMap: StylePropertyMap;
222
225
  readonly style: CSSStyleDeclaration;
@@ -287,7 +290,7 @@ export declare function element<Target extends CustomElementConstructor>(Base: T
287
290
  onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
288
291
  onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
289
292
  onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
290
- onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any) | null;
293
+ onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
291
294
  onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
292
295
  onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
293
296
  onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
@@ -322,10 +325,10 @@ export declare function element<Target extends CustomElementConstructor>(Base: T
322
325
  onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
323
326
  autofocus: boolean;
324
327
  readonly dataset: DOMStringMap;
325
- nonce?: string | undefined;
328
+ nonce?: string;
326
329
  tabIndex: number;
327
330
  blur(): void;
328
- focus(options?: FocusOptions | undefined): void;
331
+ focus(options?: FocusOptions): void;
329
332
  };
330
333
  observedAttributes: string[];
331
334
  } & Target;