@microsoft/fast-element 2.0.0-beta.2 → 2.0.0-beta.20
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/CHANGELOG.json +488 -0
- package/CHANGELOG.md +180 -1
- package/dist/dts/components/attributes.d.ts +15 -0
- package/dist/dts/components/{controller.d.ts → element-controller.d.ts} +74 -28
- package/dist/dts/components/fast-definitions.d.ts +41 -9
- package/dist/dts/components/fast-element.d.ts +14 -26
- package/dist/dts/components/hydration.d.ts +14 -0
- package/dist/{esm/observation/behavior.js → dts/components/install-hydration.d.ts} +0 -0
- package/dist/dts/context.d.ts +1 -1
- package/dist/dts/di/di.d.ts +894 -0
- package/dist/dts/dom-policy.d.ts +68 -0
- package/dist/dts/dom.d.ts +100 -0
- package/dist/dts/index.d.ts +5 -4
- package/dist/dts/index.rollup.d.ts +0 -1
- package/dist/dts/index.rollup.debug.d.ts +0 -1
- package/dist/dts/interfaces.d.ts +60 -79
- package/dist/dts/observation/observable.d.ts +99 -54
- package/dist/dts/pending-task.d.ts +20 -0
- package/dist/dts/platform.d.ts +7 -0
- package/dist/dts/polyfills.d.ts +0 -8
- package/dist/dts/state/exports.d.ts +3 -0
- package/dist/dts/state/reactive.d.ts +8 -0
- package/dist/dts/state/state.d.ts +141 -0
- package/dist/dts/state/visitor.d.ts +6 -0
- package/dist/dts/state/watch.d.ts +10 -0
- package/dist/dts/styles/css-directive.d.ts +2 -2
- package/dist/dts/styles/css.d.ts +0 -5
- package/dist/dts/styles/element-styles.d.ts +10 -17
- package/dist/dts/styles/host.d.ts +68 -0
- package/dist/dts/styles/style-strategy.d.ts +42 -0
- package/dist/dts/templating/binding-signal.d.ts +12 -27
- package/dist/dts/templating/binding-two-way.d.ts +22 -37
- package/dist/dts/templating/binding.d.ts +76 -208
- package/dist/dts/templating/children.d.ts +1 -1
- package/dist/dts/templating/compiler.d.ts +11 -13
- package/dist/dts/templating/html-directive.d.ts +91 -97
- package/dist/dts/templating/node-observation.d.ts +15 -6
- package/dist/dts/templating/ref.d.ts +7 -11
- package/dist/dts/templating/render.d.ts +296 -0
- package/dist/dts/templating/repeat.d.ts +23 -34
- package/dist/dts/templating/slotted.d.ts +1 -1
- package/dist/dts/templating/template.d.ts +92 -14
- package/dist/dts/templating/view.d.ts +81 -11
- package/dist/dts/templating/when.d.ts +3 -3
- package/dist/dts/testing/exports.d.ts +3 -0
- package/dist/dts/testing/fakes.d.ts +14 -0
- package/dist/dts/testing/fixture.d.ts +84 -0
- package/dist/dts/testing/timeout.d.ts +7 -0
- package/dist/dts/utilities.d.ts +53 -18
- package/dist/esm/components/attributes.js +28 -5
- package/dist/esm/components/{controller.js → element-controller.js} +239 -137
- package/dist/esm/components/fast-definitions.js +38 -30
- package/dist/esm/components/fast-element.js +27 -16
- package/dist/esm/components/hydration.js +35 -0
- package/dist/esm/components/install-hydration.js +2 -0
- package/dist/esm/context.js +5 -1
- package/dist/esm/debug.js +40 -5
- package/dist/esm/di/di.js +1430 -0
- package/dist/esm/dom-policy.js +337 -0
- package/dist/esm/dom.js +101 -0
- package/dist/esm/index.js +4 -2
- package/dist/esm/index.rollup.debug.js +3 -1
- package/dist/esm/index.rollup.js +3 -1
- package/dist/esm/interfaces.js +52 -0
- package/dist/esm/observation/arrays.js +303 -2
- package/dist/esm/observation/observable.js +88 -142
- package/dist/esm/observation/update-queue.js +2 -2
- package/dist/esm/pending-task.js +16 -0
- package/dist/esm/platform.js +27 -2
- package/dist/esm/polyfills.js +3 -61
- package/dist/esm/state/exports.js +3 -0
- package/dist/esm/state/reactive.js +34 -0
- package/dist/esm/state/state.js +148 -0
- package/dist/esm/state/visitor.js +28 -0
- package/dist/esm/state/watch.js +36 -0
- package/dist/esm/styles/css.js +4 -9
- package/dist/esm/styles/element-styles.js +14 -33
- package/dist/esm/styles/host.js +1 -0
- package/dist/esm/styles/style-strategy.js +1 -0
- package/dist/esm/templating/binding-signal.js +67 -62
- package/dist/esm/templating/binding-two-way.js +72 -39
- package/dist/esm/templating/binding.js +142 -286
- package/dist/esm/templating/children.js +8 -4
- package/dist/esm/templating/compiler.js +59 -43
- package/dist/esm/templating/html-directive.js +56 -75
- package/dist/esm/templating/node-observation.js +20 -13
- package/dist/esm/templating/ref.js +4 -12
- package/dist/esm/templating/render.js +402 -0
- package/dist/esm/templating/repeat.js +88 -75
- package/dist/esm/templating/template.js +132 -60
- package/dist/esm/templating/view.js +113 -29
- package/dist/esm/templating/when.js +5 -4
- package/dist/esm/testing/exports.js +3 -0
- package/dist/esm/testing/fakes.js +107 -0
- package/dist/esm/testing/fixture.js +86 -0
- package/dist/esm/testing/timeout.js +24 -0
- package/dist/esm/utilities.js +95 -95
- package/dist/fast-element.api.json +9487 -8326
- package/dist/fast-element.d.ts +847 -644
- package/dist/fast-element.debug.js +1993 -1166
- package/dist/fast-element.debug.min.js +1 -1
- package/dist/fast-element.js +1903 -1111
- package/dist/fast-element.min.js +1 -1
- package/dist/fast-element.untrimmed.d.ts +911 -701
- package/docs/api-report.md +329 -252
- package/package.json +38 -16
- package/dist/dts/hooks.d.ts +0 -20
- package/dist/dts/observation/behavior.d.ts +0 -19
- package/dist/dts/observation/splice-strategies.d.ts +0 -13
- package/dist/dts/templating/dom.d.ts +0 -41
- package/dist/esm/hooks.js +0 -32
- package/dist/esm/observation/splice-strategies.js +0 -400
- package/dist/esm/templating/dom.js +0 -49
|
@@ -40,6 +40,16 @@ export declare type AttributeConfiguration = {
|
|
|
40
40
|
mode?: AttributeMode;
|
|
41
41
|
converter?: ValueConverter;
|
|
42
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* Metadata used to configure a custom attribute's behavior.
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
export declare const AttributeConfiguration: Readonly<{
|
|
48
|
+
/**
|
|
49
|
+
* Locates all attribute configurations associated with a type.
|
|
50
|
+
*/
|
|
51
|
+
locate: (target: {}) => AttributeConfiguration[];
|
|
52
|
+
}>;
|
|
43
53
|
/**
|
|
44
54
|
* Metadata used to configure a custom attribute's behavior through a decorator.
|
|
45
55
|
* @public
|
|
@@ -52,6 +62,11 @@ export declare type DecoratorAttributeConfiguration = Omit<AttributeConfiguratio
|
|
|
52
62
|
* @public
|
|
53
63
|
*/
|
|
54
64
|
export declare const booleanConverter: ValueConverter;
|
|
65
|
+
/**
|
|
66
|
+
* A {@link ValueConverter} that converts to and from `boolean` values. `null`, `undefined`, `""`, and `void` values are converted to `null`.
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
export declare const nullableBooleanConverter: ValueConverter;
|
|
55
70
|
/**
|
|
56
71
|
* A {@link ValueConverter} that converts to and from `number` values.
|
|
57
72
|
* @remarks
|
|
@@ -1,21 +1,35 @@
|
|
|
1
|
-
import type { Behavior } from "../observation/behavior.js";
|
|
2
1
|
import { PropertyChangeNotifier } from "../observation/notifier.js";
|
|
3
|
-
import
|
|
2
|
+
import { ElementStyles } from "../styles/element-styles.js";
|
|
3
|
+
import type { HostBehavior, HostController } from "../styles/host.js";
|
|
4
|
+
import type { StyleStrategy, StyleTarget } from "../styles/style-strategy.js";
|
|
4
5
|
import type { ElementViewTemplate } from "../templating/template.js";
|
|
5
6
|
import type { ElementView } from "../templating/view.js";
|
|
6
7
|
import { FASTElementDefinition } from "./fast-definitions.js";
|
|
8
|
+
/**
|
|
9
|
+
* A type that instantiates an ElementController
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export interface ElementControllerStrategy {
|
|
13
|
+
new (element: HTMLElement, definition: FASTElementDefinition): ElementController;
|
|
14
|
+
}
|
|
7
15
|
/**
|
|
8
16
|
* Controls the lifecycle and rendering of a `FASTElement`.
|
|
9
17
|
* @public
|
|
10
18
|
*/
|
|
11
|
-
export declare class
|
|
19
|
+
export declare class ElementController<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier implements HostController<TElement> {
|
|
12
20
|
private boundObservables;
|
|
13
|
-
private behaviors;
|
|
14
21
|
private needsInitialization;
|
|
15
22
|
private hasExistingShadowRoot;
|
|
16
23
|
private _template;
|
|
17
|
-
private
|
|
18
|
-
|
|
24
|
+
private stage;
|
|
25
|
+
/**
|
|
26
|
+
* A guard against connecting behaviors multiple times
|
|
27
|
+
* during connect in scenarios where a behavior adds
|
|
28
|
+
* another behavior during it's connectedCallback
|
|
29
|
+
*/
|
|
30
|
+
private guardBehaviorConnection;
|
|
31
|
+
private behaviors;
|
|
32
|
+
private _mainStyles;
|
|
19
33
|
/**
|
|
20
34
|
* This allows Observable.getNotifier(...) to return the Controller
|
|
21
35
|
* when the notifier for the Controller itself is being requested. The
|
|
@@ -28,7 +42,7 @@ export declare class Controller<TElement extends HTMLElement = HTMLElement> exte
|
|
|
28
42
|
/**
|
|
29
43
|
* The element being controlled by this controller.
|
|
30
44
|
*/
|
|
31
|
-
readonly
|
|
45
|
+
readonly source: TElement;
|
|
32
46
|
/**
|
|
33
47
|
* The element definition that instructs this controller
|
|
34
48
|
* in how to handle rendering and other platform integrations.
|
|
@@ -45,7 +59,6 @@ export declare class Controller<TElement extends HTMLElement = HTMLElement> exte
|
|
|
45
59
|
* connected to the document.
|
|
46
60
|
*/
|
|
47
61
|
get isConnected(): boolean;
|
|
48
|
-
private setIsConnected;
|
|
49
62
|
/**
|
|
50
63
|
* Gets/sets the template used to render the component.
|
|
51
64
|
* @remarks
|
|
@@ -54,12 +67,11 @@ export declare class Controller<TElement extends HTMLElement = HTMLElement> exte
|
|
|
54
67
|
get template(): ElementViewTemplate<TElement> | null;
|
|
55
68
|
set template(value: ElementViewTemplate<TElement> | null);
|
|
56
69
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* This value can only be accurately read after connect but can be set at any time.
|
|
70
|
+
* The main set of styles used for the component, independent
|
|
71
|
+
* of any dynamically added styles.
|
|
60
72
|
*/
|
|
61
|
-
get
|
|
62
|
-
set
|
|
73
|
+
get mainStyles(): ElementStyles | null;
|
|
74
|
+
set mainStyles(value: ElementStyles | null);
|
|
63
75
|
/**
|
|
64
76
|
* Creates a Controller to control the specified element.
|
|
65
77
|
* @param element - The element to be controlled by this controller.
|
|
@@ -68,6 +80,17 @@ export declare class Controller<TElement extends HTMLElement = HTMLElement> exte
|
|
|
68
80
|
* @internal
|
|
69
81
|
*/
|
|
70
82
|
constructor(element: TElement, definition: FASTElementDefinition);
|
|
83
|
+
/**
|
|
84
|
+
* Adds the behavior to the component.
|
|
85
|
+
* @param behavior - The behavior to add.
|
|
86
|
+
*/
|
|
87
|
+
addBehavior(behavior: HostBehavior<TElement>): void;
|
|
88
|
+
/**
|
|
89
|
+
* Removes the behavior from the component.
|
|
90
|
+
* @param behavior - The behavior to remove.
|
|
91
|
+
* @param force - Forces removal even if this behavior was added more than once.
|
|
92
|
+
*/
|
|
93
|
+
removeBehavior(behavior: HostBehavior<TElement>, force?: boolean): void;
|
|
71
94
|
/**
|
|
72
95
|
* Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot.
|
|
73
96
|
* @param styles - The styles to add.
|
|
@@ -78,25 +101,14 @@ export declare class Controller<TElement extends HTMLElement = HTMLElement> exte
|
|
|
78
101
|
* @param styles - the styles to remove.
|
|
79
102
|
*/
|
|
80
103
|
removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
81
|
-
/**
|
|
82
|
-
* Adds behaviors to this element.
|
|
83
|
-
* @param behaviors - The behaviors to add.
|
|
84
|
-
*/
|
|
85
|
-
addBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>): void;
|
|
86
|
-
/**
|
|
87
|
-
* Removes behaviors from this element.
|
|
88
|
-
* @param behaviors - The behaviors to remove.
|
|
89
|
-
* @param force - Forces unbinding of behaviors.
|
|
90
|
-
*/
|
|
91
|
-
removeBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>, force?: boolean): void;
|
|
92
104
|
/**
|
|
93
105
|
* Runs connected lifecycle behavior on the associated element.
|
|
94
106
|
*/
|
|
95
|
-
|
|
107
|
+
connect(): void;
|
|
96
108
|
/**
|
|
97
109
|
* Runs disconnected lifecycle behavior on the associated element.
|
|
98
110
|
*/
|
|
99
|
-
|
|
111
|
+
disconnect(): void;
|
|
100
112
|
/**
|
|
101
113
|
* Runs the attribute changed callback for the associated element.
|
|
102
114
|
* @param name - The name of the attribute that changed.
|
|
@@ -113,7 +125,11 @@ export declare class Controller<TElement extends HTMLElement = HTMLElement> exte
|
|
|
113
125
|
* Only emits events if connected.
|
|
114
126
|
*/
|
|
115
127
|
emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): void | boolean;
|
|
116
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Opts out of JSON stringification.
|
|
130
|
+
* @internal
|
|
131
|
+
*/
|
|
132
|
+
toJSON: () => undefined;
|
|
117
133
|
private renderTemplate;
|
|
118
134
|
/**
|
|
119
135
|
* Locates or creates a controller for the specified element.
|
|
@@ -123,5 +139,35 @@ export declare class Controller<TElement extends HTMLElement = HTMLElement> exte
|
|
|
123
139
|
* registered either through the use of the {@link customElement}
|
|
124
140
|
* decorator or a call to `FASTElement.define`.
|
|
125
141
|
*/
|
|
126
|
-
static forCustomElement(element: HTMLElement):
|
|
142
|
+
static forCustomElement(element: HTMLElement): ElementController;
|
|
143
|
+
/**
|
|
144
|
+
* Sets the strategy that ElementController.forCustomElement uses to construct
|
|
145
|
+
* ElementController instances for an element.
|
|
146
|
+
* @param strategy - The strategy to use.
|
|
147
|
+
*/
|
|
148
|
+
static setStrategy(strategy: ElementControllerStrategy): void;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* https://wicg.github.io/construct-stylesheets/
|
|
152
|
+
* https://developers.google.com/web/updates/2019/02/constructable-stylesheets
|
|
153
|
+
*
|
|
154
|
+
* @internal
|
|
155
|
+
*/
|
|
156
|
+
export declare class AdoptedStyleSheetsStrategy implements StyleStrategy {
|
|
157
|
+
private static styleSheetCache;
|
|
158
|
+
/** @internal */
|
|
159
|
+
readonly sheets: CSSStyleSheet[];
|
|
160
|
+
constructor(styles: (string | CSSStyleSheet)[]);
|
|
161
|
+
addStylesTo(target: StyleTarget): void;
|
|
162
|
+
removeStylesFrom(target: StyleTarget): void;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* @internal
|
|
166
|
+
*/
|
|
167
|
+
export declare class StyleElementStrategy implements StyleStrategy {
|
|
168
|
+
private readonly styles;
|
|
169
|
+
private readonly styleClass;
|
|
170
|
+
constructor(styles: string[]);
|
|
171
|
+
addStylesTo(target: StyleTarget): void;
|
|
172
|
+
removeStylesFrom(target: StyleTarget): void;
|
|
127
173
|
}
|
|
@@ -2,6 +2,18 @@ import { Constructable } from "../interfaces.js";
|
|
|
2
2
|
import { ComposableStyles, ElementStyles } from "../styles/element-styles.js";
|
|
3
3
|
import type { ElementViewTemplate } from "../templating/template.js";
|
|
4
4
|
import { AttributeConfiguration, AttributeDefinition } from "./attributes.js";
|
|
5
|
+
/**
|
|
6
|
+
* Shadow root initialization options.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface ShadowRootOptions extends ShadowRootInit {
|
|
10
|
+
/**
|
|
11
|
+
* A registry that provides the custom elements visible
|
|
12
|
+
* from within this shadow root.
|
|
13
|
+
* @beta
|
|
14
|
+
*/
|
|
15
|
+
registry?: CustomElementRegistry;
|
|
16
|
+
}
|
|
5
17
|
/**
|
|
6
18
|
* Represents metadata configuration for a custom element.
|
|
7
19
|
* @public
|
|
@@ -25,19 +37,28 @@ export interface PartialFASTElementDefinition {
|
|
|
25
37
|
readonly attributes?: (AttributeConfiguration | string)[];
|
|
26
38
|
/**
|
|
27
39
|
* Options controlling the creation of the custom element's shadow DOM.
|
|
40
|
+
* @remarks
|
|
41
|
+
* If not provided, defaults to an open shadow root. Provide null
|
|
42
|
+
* to render to the associated template to the light DOM instead.
|
|
28
43
|
*/
|
|
29
|
-
readonly shadowOptions?: Partial<
|
|
44
|
+
readonly shadowOptions?: Partial<ShadowRootOptions> | null;
|
|
30
45
|
/**
|
|
31
46
|
* Options controlling how the custom element is defined with the platform.
|
|
32
47
|
*/
|
|
33
48
|
readonly elementOptions?: ElementDefinitionOptions;
|
|
49
|
+
/**
|
|
50
|
+
* The registry to register this component in by default.
|
|
51
|
+
* @remarks
|
|
52
|
+
* If not provided, defaults to the global registry.
|
|
53
|
+
*/
|
|
54
|
+
readonly registry?: CustomElementRegistry;
|
|
34
55
|
}
|
|
35
56
|
/**
|
|
36
57
|
* Defines metadata for a FASTElement.
|
|
37
58
|
* @public
|
|
38
59
|
*/
|
|
39
60
|
export declare class FASTElementDefinition<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> {
|
|
40
|
-
private
|
|
61
|
+
private platformDefined;
|
|
41
62
|
/**
|
|
42
63
|
* The type this element definition describes.
|
|
43
64
|
*/
|
|
@@ -73,18 +94,16 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
|
|
|
73
94
|
/**
|
|
74
95
|
* Options controlling the creation of the custom element's shadow DOM.
|
|
75
96
|
*/
|
|
76
|
-
readonly shadowOptions?:
|
|
97
|
+
readonly shadowOptions?: ShadowRootOptions;
|
|
77
98
|
/**
|
|
78
99
|
* Options controlling how the custom element is defined with the platform.
|
|
79
100
|
*/
|
|
80
|
-
readonly elementOptions
|
|
101
|
+
readonly elementOptions: ElementDefinitionOptions;
|
|
81
102
|
/**
|
|
82
|
-
*
|
|
83
|
-
* @param type - The type this definition is being created for.
|
|
84
|
-
* @param nameOrConfig - The name of the element to define or a config object
|
|
85
|
-
* that describes the element to define.
|
|
103
|
+
* The registry to register this component in by default.
|
|
86
104
|
*/
|
|
87
|
-
|
|
105
|
+
readonly registry: CustomElementRegistry;
|
|
106
|
+
private constructor();
|
|
88
107
|
/**
|
|
89
108
|
* Defines a custom element based on this definition.
|
|
90
109
|
* @param registry - The element registry to define the element in.
|
|
@@ -92,6 +111,19 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
|
|
|
92
111
|
* This operation is idempotent per registry.
|
|
93
112
|
*/
|
|
94
113
|
define(registry?: CustomElementRegistry): this;
|
|
114
|
+
/**
|
|
115
|
+
* Creates an instance of FASTElementDefinition.
|
|
116
|
+
* @param type - The type this definition is being created for.
|
|
117
|
+
* @param nameOrDef - The name of the element to define or a config object
|
|
118
|
+
* that describes the element to define.
|
|
119
|
+
*/
|
|
120
|
+
static compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
|
|
121
|
+
/**
|
|
122
|
+
* Registers a FASTElement base type.
|
|
123
|
+
* @param type - The type to register as a base type.
|
|
124
|
+
* @internal
|
|
125
|
+
*/
|
|
126
|
+
static registerBaseType(type: Function): void;
|
|
95
127
|
/**
|
|
96
128
|
* Gets the element definition associated with the specified type.
|
|
97
129
|
* @param type - The custom element type to retrieve the definition for.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { Constructable } from "../interfaces.js";
|
|
2
|
+
import { ElementController } from "./element-controller.js";
|
|
3
3
|
import { FASTElementDefinition, PartialFASTElementDefinition } from "./fast-definitions.js";
|
|
4
4
|
/**
|
|
5
5
|
* Represents a custom element based on the FASTElement infrastructure.
|
|
@@ -10,7 +10,7 @@ export interface FASTElement extends HTMLElement {
|
|
|
10
10
|
* The underlying controller that handles the lifecycle and rendering of
|
|
11
11
|
* this FASTElement.
|
|
12
12
|
*/
|
|
13
|
-
readonly $fastController:
|
|
13
|
+
readonly $fastController: ElementController;
|
|
14
14
|
/**
|
|
15
15
|
* Emits a custom HTML event.
|
|
16
16
|
* @param type - The type name of the event.
|
|
@@ -45,34 +45,21 @@ export interface FASTElement extends HTMLElement {
|
|
|
45
45
|
*/
|
|
46
46
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
47
47
|
}
|
|
48
|
+
declare function compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
|
|
49
|
+
declare function compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
|
|
50
|
+
declare function define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition): TType;
|
|
51
|
+
declare function define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): TType;
|
|
52
|
+
declare function from<TBase extends typeof HTMLElement>(BaseType: TBase): new () => InstanceType<TBase> & FASTElement;
|
|
48
53
|
/**
|
|
49
54
|
* A minimal base class for FASTElements that also provides
|
|
50
55
|
* static helpers for working with FASTElements.
|
|
51
56
|
* @public
|
|
52
57
|
*/
|
|
53
|
-
export declare const FASTElement:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*/
|
|
59
|
-
from<TBase extends {
|
|
60
|
-
new (): HTMLElement;
|
|
61
|
-
prototype: HTMLElement;
|
|
62
|
-
}>(BaseType: TBase): new () => InstanceType<TBase> & FASTElement;
|
|
63
|
-
/**
|
|
64
|
-
* Defines a platform custom element based on the provided type and definition.
|
|
65
|
-
* @param type - The custom element type to define.
|
|
66
|
-
* @param nameOrDef - The name of the element to define or a definition object
|
|
67
|
-
* that describes the element to define.
|
|
68
|
-
*/
|
|
69
|
-
define<TType extends Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): TType;
|
|
70
|
-
/**
|
|
71
|
-
* Defines metadata for a FASTElement which can be used to later define the element.
|
|
72
|
-
* IMPORTANT: This API will be renamed to "compose" in a future beta.
|
|
73
|
-
* @public
|
|
74
|
-
*/
|
|
75
|
-
metadata<TType_1 extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType_1, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType_1>;
|
|
58
|
+
export declare const FASTElement: {
|
|
59
|
+
new (): FASTElement;
|
|
60
|
+
define: typeof define;
|
|
61
|
+
compose: typeof compose;
|
|
62
|
+
from: typeof from;
|
|
76
63
|
};
|
|
77
64
|
/**
|
|
78
65
|
* Decorator: Defines a platform custom element based on `FASTElement`.
|
|
@@ -81,3 +68,4 @@ export declare const FASTElement: (new () => HTMLElement & FASTElement) & {
|
|
|
81
68
|
* @public
|
|
82
69
|
*/
|
|
83
70
|
export declare function customElement(nameOrDef: string | PartialFASTElementDefinition): (type: Constructable<HTMLElement>) => void;
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ElementController } from "./element-controller.js";
|
|
2
|
+
/**
|
|
3
|
+
* An ElementController capable of hydrating FAST elements from
|
|
4
|
+
* Declarative Shadow DOM.
|
|
5
|
+
*
|
|
6
|
+
* @beta
|
|
7
|
+
*/
|
|
8
|
+
export declare class HydratableElementController<TElement extends HTMLElement = HTMLElement> extends ElementController<TElement> {
|
|
9
|
+
private static hydrationObserver;
|
|
10
|
+
private static hydrationObserverHandler;
|
|
11
|
+
connect(): void;
|
|
12
|
+
disconnect(): void;
|
|
13
|
+
static install(): void;
|
|
14
|
+
}
|
|
File without changes
|
package/dist/dts/context.d.ts
CHANGED