Skip to content

Commit 436c5a7

Browse files
author
Steve Orvell
committed
Add comments with spec links
1 parent 9995a9e commit 436c5a7

File tree

1 file changed

+12
-6
lines changed
  • packages/scoped-custom-element-registry/src

1 file changed

+12
-6
lines changed

packages/scoped-custom-element-registry/src/types.d.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,55 @@ export {};
22

33
declare global {
44
interface CustomElementRegistry {
5-
// This overload is for roots that use the global registry
5+
// https://html.spec.whatwg.org/multipage/custom-elements.html#dom-customelementregistry-initialize
66
initialize: (node: Node) => Node;
77
}
88

9+
// https://dom.spec.whatwg.org/#documentorshadowroot
910
interface ShadowRoot {
1011
readonly customElementRegistry: CustomElementRegistry | null;
1112
}
1213

14+
// https://dom.spec.whatwg.org/#documentorshadowroot
1315
interface Document {
1416
readonly customElementRegistry: CustomElementRegistry | null;
17+
// https://dom.spec.whatwg.org/#dom-document-createelement
1518
createElement<K extends keyof HTMLElementTagNameMap>(
1619
tagName: K,
1720
options?: ElementCreationOptions
1821
): HTMLElementTagNameMap[K];
19-
22+
// https://dom.spec.whatwg.org/#dom-document-createelementns
2023
createElementNS<K extends keyof HTMLElementTagNameMap>(
2124
namespace: string | null,
2225
tagName: K,
2326
options?: ElementCreationOptions
2427
): HTMLElementTagNameMap[K];
25-
28+
// https://dom.spec.whatwg.org/#dom-document-importnode
2629
importNode<T extends Node>(
2730
node: T,
2831
options?: boolean | ImportNodeOptions
2932
): T;
3033
}
3134

35+
// https://dom.spec.whatwg.org/#element
3236
interface Element {
3337
readonly customElementRegistry: CustomElementRegistry | null;
3438
}
3539

40+
// https://dom.spec.whatwg.org/#dictdef-shadowrootinit
3641
interface InitializeShadowRootInit {
3742
customElementRegistry?: CustomElementRegistry;
3843
}
3944

45+
// https://dom.spec.whatwg.org/#dictdef-importnodeoptions
4046
interface ImportNodeOptions {
4147
selfOnly?: boolean;
42-
['customElementRegistry']?: CustomElementRegistry;
48+
customElementRegistry?: CustomElementRegistry;
4349
}
44-
50+
// https://dom.spec.whatwg.org/#dictdef-elementcreationoptions
4551
interface ElementCreationOptions {
4652
is?: string;
47-
['customElementRegistry']?: CustomElementRegistry;
53+
customElementRegistry?: CustomElementRegistry;
4854
}
4955

5056
/*

0 commit comments

Comments
 (0)