@microsoft/fast-element 1.10.2 → 2.0.0-beta.3
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/.eslintrc.json +1 -12
- package/CHANGELOG.json +387 -1
- package/CHANGELOG.md +74 -2
- package/README.md +2 -2
- package/dist/dts/components/attributes.d.ts +4 -1
- package/dist/dts/components/controller.d.ts +12 -11
- package/dist/dts/components/fast-definitions.d.ts +10 -2
- package/dist/dts/components/fast-element.d.ts +12 -5
- package/dist/dts/context.d.ts +157 -0
- package/dist/dts/debug.d.ts +1 -0
- package/dist/dts/hooks.d.ts +20 -0
- package/dist/dts/index.d.ts +16 -15
- package/dist/dts/index.debug.d.ts +2 -0
- package/dist/dts/index.rollup.d.ts +2 -0
- package/dist/dts/index.rollup.debug.d.ts +3 -0
- package/dist/dts/interfaces.d.ts +145 -0
- package/dist/dts/metadata.d.ts +25 -0
- package/dist/dts/observation/arrays.d.ts +207 -0
- package/dist/dts/observation/behavior.d.ts +4 -4
- package/dist/dts/observation/notifier.d.ts +18 -18
- package/dist/dts/observation/observable.d.ts +56 -18
- package/dist/dts/observation/splice-strategies.d.ts +13 -0
- package/dist/dts/observation/update-queue.d.ts +40 -0
- package/dist/dts/platform.d.ts +18 -67
- package/dist/dts/polyfills.d.ts +8 -0
- package/dist/dts/styles/css-directive.d.ts +43 -5
- package/dist/dts/styles/css.d.ts +19 -3
- package/dist/dts/styles/element-styles.d.ts +42 -62
- package/dist/dts/templating/binding-signal.d.ts +38 -0
- package/dist/dts/templating/binding-two-way.d.ts +56 -0
- package/dist/dts/templating/binding.d.ts +233 -65
- package/dist/dts/templating/children.d.ts +18 -15
- package/dist/dts/templating/compiler.d.ts +46 -28
- package/dist/dts/templating/dom.d.ts +41 -0
- package/dist/dts/templating/html-directive.d.ts +181 -43
- package/dist/dts/templating/markup.d.ts +48 -0
- package/dist/dts/templating/node-observation.d.ts +45 -29
- package/dist/dts/templating/ref.d.ts +6 -12
- package/dist/dts/templating/repeat.d.ts +26 -14
- package/dist/dts/templating/slotted.d.ts +13 -14
- package/dist/dts/templating/template.d.ts +27 -21
- package/dist/dts/templating/view.d.ts +15 -22
- package/dist/{tsdoc-metadata.json → dts/tsdoc-metadata.json} +1 -1
- package/dist/dts/utilities.d.ts +40 -0
- package/dist/esm/components/attributes.js +25 -24
- package/dist/esm/components/controller.js +77 -57
- package/dist/esm/components/fast-definitions.js +16 -22
- package/dist/esm/components/fast-element.js +10 -2
- package/dist/esm/context.js +159 -0
- package/dist/esm/debug.js +30 -0
- package/dist/esm/hooks.js +32 -0
- package/dist/esm/index.debug.js +2 -0
- package/dist/esm/index.js +19 -14
- package/dist/esm/index.rollup.debug.js +3 -0
- package/dist/esm/index.rollup.js +2 -0
- package/dist/esm/interfaces.js +8 -1
- package/dist/esm/metadata.js +60 -0
- package/dist/esm/observation/arrays.js +269 -0
- package/dist/esm/observation/notifier.js +27 -35
- package/dist/esm/observation/observable.js +93 -68
- package/dist/esm/observation/{array-change-records.js → splice-strategies.js} +136 -62
- package/dist/esm/observation/update-queue.js +67 -0
- package/dist/esm/platform.js +36 -42
- package/dist/esm/polyfills.js +85 -0
- package/dist/esm/styles/css-directive.js +29 -13
- package/dist/esm/styles/css.js +27 -40
- package/dist/esm/styles/element-styles.js +65 -104
- package/dist/esm/templating/binding-signal.js +84 -0
- package/dist/esm/templating/binding-two-way.js +82 -0
- package/dist/esm/templating/binding.js +306 -153
- package/dist/esm/templating/children.js +33 -23
- package/dist/esm/templating/compiler.js +236 -152
- package/dist/esm/templating/dom.js +49 -0
- package/dist/esm/templating/html-directive.js +128 -40
- package/dist/esm/templating/markup.js +75 -0
- package/dist/esm/templating/node-observation.js +50 -45
- package/dist/esm/templating/ref.js +7 -16
- package/dist/esm/templating/repeat.js +39 -36
- package/dist/esm/templating/slotted.js +23 -20
- package/dist/esm/templating/template.js +51 -95
- package/dist/esm/templating/view.js +44 -43
- package/dist/esm/templating/when.js +2 -1
- package/dist/esm/utilities.js +139 -0
- package/dist/fast-element.api.json +11789 -5377
- package/dist/fast-element.d.ts +1178 -530
- package/dist/fast-element.debug.js +3722 -0
- package/dist/fast-element.debug.min.js +1 -0
- package/dist/fast-element.js +3484 -4033
- package/dist/fast-element.min.js +1 -1
- package/dist/fast-element.untrimmed.d.ts +2699 -0
- package/docs/api-report.md +472 -219
- package/docs/fast-element-2-changes.md +15 -0
- package/docs/guide/declaring-templates.md +4 -4
- package/docs/guide/defining-elements.md +2 -2
- package/docs/guide/next-steps.md +2 -2
- package/docs/guide/observables-and-state.md +1 -1
- package/docs/guide/using-directives.md +1 -1
- package/karma.conf.cjs +6 -17
- package/package.json +63 -15
- package/dist/dts/dom.d.ts +0 -112
- package/dist/dts/observation/array-change-records.d.ts +0 -48
- package/dist/dts/observation/array-observer.d.ts +0 -9
- package/dist/esm/dom.js +0 -207
- package/dist/esm/observation/array-observer.js +0 -177
package/docs/api-report.md
CHANGED
|
@@ -4,9 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
|
-
// @public
|
|
8
|
-
export const $global: Global;
|
|
9
|
-
|
|
10
7
|
// @public
|
|
11
8
|
export interface Accessor {
|
|
12
9
|
getValue(source: any): any;
|
|
@@ -15,14 +12,60 @@ export interface Accessor {
|
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
// @public
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
export type AddBehavior = (behavior: Behavior<HTMLElement>) => void;
|
|
16
|
+
|
|
17
|
+
// @public
|
|
18
|
+
export type AddViewBehaviorFactory = (factory: ViewBehaviorFactory) => string;
|
|
19
|
+
|
|
20
|
+
// Warning: (ae-internal-missing-underscore) The name "AdoptedStyleSheetsStrategy" should be prefixed with an underscore because the declaration is marked as @internal
|
|
21
|
+
//
|
|
22
|
+
// @internal
|
|
23
|
+
export class AdoptedStyleSheetsStrategy implements StyleStrategy {
|
|
24
|
+
constructor(styles: (string | CSSStyleSheet)[]);
|
|
25
|
+
// (undocumented)
|
|
26
|
+
addStylesTo(target: StyleTarget): void;
|
|
27
|
+
// (undocumented)
|
|
28
|
+
removeStylesFrom(target: StyleTarget): void;
|
|
29
|
+
// (undocumented)
|
|
30
|
+
readonly sheets: CSSStyleSheet[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// @public
|
|
34
|
+
export interface ArrayObserver extends SubscriberSet {
|
|
35
|
+
addSplice(splice: Splice): void;
|
|
36
|
+
flush(): void;
|
|
37
|
+
readonly lengthObserver: LengthObserver;
|
|
38
|
+
reset(oldCollection: any[] | undefined): void;
|
|
39
|
+
strategy: SpliceStrategy | null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// @public
|
|
43
|
+
export const ArrayObserver: Readonly<{
|
|
44
|
+
readonly enable: () => void;
|
|
45
|
+
}>;
|
|
46
|
+
|
|
47
|
+
// @public
|
|
48
|
+
export const Aspect: Readonly<{
|
|
49
|
+
readonly none: 0;
|
|
50
|
+
readonly attribute: 1;
|
|
51
|
+
readonly booleanAttribute: 2;
|
|
52
|
+
readonly property: 3;
|
|
53
|
+
readonly content: 4;
|
|
54
|
+
readonly tokenList: 5;
|
|
55
|
+
readonly event: 6;
|
|
56
|
+
readonly assign: (directive: Aspected, value?: string) => void;
|
|
57
|
+
}>;
|
|
58
|
+
|
|
59
|
+
// @public
|
|
60
|
+
export type Aspect = typeof Aspect[Exclude<keyof typeof Aspect, "assign" | "none">];
|
|
23
61
|
|
|
24
62
|
// @public
|
|
25
|
-
export
|
|
63
|
+
export interface Aspected {
|
|
64
|
+
aspectType: Aspect;
|
|
65
|
+
binding?: Binding;
|
|
66
|
+
sourceAspect: string;
|
|
67
|
+
targetAspect: string;
|
|
68
|
+
}
|
|
26
69
|
|
|
27
70
|
// @public
|
|
28
71
|
export function attr(config?: DecoratorAttributeConfiguration): (target: {}, property: string) => void;
|
|
@@ -52,60 +95,53 @@ export class AttributeDefinition implements Accessor {
|
|
|
52
95
|
onAttributeChangedCallback(element: HTMLElement, value: any): void;
|
|
53
96
|
readonly Owner: Function;
|
|
54
97
|
setValue(source: HTMLElement, newValue: any): void;
|
|
55
|
-
|
|
98
|
+
}
|
|
56
99
|
|
|
100
|
+
// Warning: (ae-forgotten-export) The symbol "reflectMode" needs to be exported by the entry point index.d.ts
|
|
101
|
+
// Warning: (ae-forgotten-export) The symbol "booleanMode" needs to be exported by the entry point index.d.ts
|
|
102
|
+
//
|
|
57
103
|
// @public
|
|
58
|
-
export type AttributeMode =
|
|
104
|
+
export type AttributeMode = typeof reflectMode | typeof booleanMode | "fromView";
|
|
59
105
|
|
|
60
106
|
// @public
|
|
61
|
-
export interface Behavior {
|
|
62
|
-
bind(source:
|
|
63
|
-
unbind(source:
|
|
107
|
+
export interface Behavior<TSource = any, TParent = any> {
|
|
108
|
+
bind(source: TSource, context: ExecutionContext<TParent>): void;
|
|
109
|
+
unbind(source: TSource, context: ExecutionContext<TParent>): void;
|
|
64
110
|
}
|
|
65
111
|
|
|
112
|
+
// @public
|
|
113
|
+
export function bind<T = any>(binding: Binding<T>, config?: BindingConfig | DefaultBindingOptions): CaptureType<T>;
|
|
114
|
+
|
|
66
115
|
// @public
|
|
67
116
|
export type Binding<TSource = any, TReturn = any, TParent = any> = (source: TSource, context: ExecutionContext<TParent>) => TReturn;
|
|
68
117
|
|
|
69
118
|
// @public
|
|
70
|
-
export
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
bind: typeof normalBind;
|
|
74
|
-
// @internal (undocumented)
|
|
75
|
-
binding: Binding;
|
|
76
|
-
// @internal (undocumented)
|
|
77
|
-
bindingObserver: BindingObserver | null;
|
|
78
|
-
// @internal (undocumented)
|
|
79
|
-
classVersions: Record<string, number>;
|
|
80
|
-
// @internal (undocumented)
|
|
81
|
-
context: ExecutionContext | null;
|
|
82
|
-
// @internal (undocumented)
|
|
83
|
-
handleChange(): void;
|
|
84
|
-
// @internal (undocumented)
|
|
85
|
-
handleEvent(event: Event): void;
|
|
86
|
-
// @internal (undocumented)
|
|
87
|
-
isBindingVolatile: boolean;
|
|
88
|
-
// @internal (undocumented)
|
|
89
|
-
source: unknown;
|
|
90
|
-
// @internal (undocumented)
|
|
91
|
-
target: any;
|
|
92
|
-
// @internal (undocumented)
|
|
93
|
-
targetName?: string;
|
|
94
|
-
// Warning: (ae-forgotten-export) The symbol "normalUnbind" needs to be exported by the entry point index.d.ts
|
|
95
|
-
unbind: typeof normalUnbind;
|
|
96
|
-
// Warning: (ae-forgotten-export) The symbol "updatePropertyTarget" needs to be exported by the entry point index.d.ts
|
|
97
|
-
//
|
|
98
|
-
// @internal (undocumented)
|
|
99
|
-
updateTarget: typeof updatePropertyTarget;
|
|
100
|
-
// @internal (undocumented)
|
|
101
|
-
version: number;
|
|
119
|
+
export interface BindingConfig<T = any> {
|
|
120
|
+
mode: BindingMode;
|
|
121
|
+
options: T;
|
|
102
122
|
}
|
|
103
123
|
|
|
104
124
|
// @public
|
|
105
|
-
export
|
|
106
|
-
|
|
107
|
-
|
|
125
|
+
export const BindingConfig: Readonly<{
|
|
126
|
+
define<T>(mode: BindingMode, defaultOptions: T): BindingConfig<T> & BindingConfigResolver<T>;
|
|
127
|
+
}>;
|
|
128
|
+
|
|
129
|
+
// @public
|
|
130
|
+
export type BindingConfigResolver<T> = (options: T) => BindingConfig<T>;
|
|
131
|
+
|
|
132
|
+
// @public
|
|
133
|
+
export type BindingMode = Record<Aspect, (directive: HTMLBindingDirective) => Pick<ViewBehaviorFactory, "createBehavior">>;
|
|
134
|
+
|
|
135
|
+
// @public
|
|
136
|
+
export const BindingMode: Readonly<{
|
|
137
|
+
define(UpdateType: typeof UpdateBinding, EventType?: typeof EventBinding): BindingMode;
|
|
138
|
+
}>;
|
|
139
|
+
|
|
140
|
+
// @public
|
|
141
|
+
export interface BindingObserver<TSource = any, TReturn = any, TParent = any> extends Notifier, Disposable {
|
|
142
|
+
observe(source: TSource, context?: ExecutionContext<TParent>): TReturn;
|
|
108
143
|
records(): IterableIterator<ObservationRecord>;
|
|
144
|
+
setMode(isAsync: boolean): void;
|
|
109
145
|
}
|
|
110
146
|
|
|
111
147
|
// @public
|
|
@@ -121,37 +157,45 @@ export interface CaptureType<TSource> {
|
|
|
121
157
|
}
|
|
122
158
|
|
|
123
159
|
// @public
|
|
124
|
-
export
|
|
160
|
+
export class ChangeBinding extends UpdateBinding {
|
|
161
|
+
constructor(directive: HTMLBindingDirective, updateTarget: UpdateTarget);
|
|
162
|
+
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
163
|
+
protected getObserver(target: Node): BindingObserver;
|
|
164
|
+
// @internal (undocumented)
|
|
165
|
+
handleChange(binding: Binding, observer: BindingObserver): void;
|
|
166
|
+
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
125
167
|
}
|
|
126
168
|
|
|
127
169
|
// @public
|
|
128
|
-
export
|
|
170
|
+
export interface ChildListDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, Omit<MutationObserverInit, "subtree" | "childList"> {
|
|
171
|
+
}
|
|
129
172
|
|
|
130
|
-
// Warning: (ae-forgotten-export) The symbol "NodeObservationBehavior" needs to be exported by the entry point index.d.ts
|
|
131
|
-
//
|
|
132
173
|
// @public
|
|
133
|
-
export
|
|
134
|
-
constructor(target: HTMLElement, options: ChildrenBehaviorOptions);
|
|
135
|
-
disconnect(): void;
|
|
136
|
-
protected getNodes(): ChildNode[];
|
|
137
|
-
observe(): void;
|
|
138
|
-
}
|
|
174
|
+
export function children<T = any>(propertyOrOptions: (keyof T & string) | ChildrenDirectiveOptions<keyof T & string>): CaptureType<T>;
|
|
139
175
|
|
|
140
176
|
// @public
|
|
141
|
-
export
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
hostBehaviorFactories: NodeBehaviorFactory[];
|
|
147
|
-
targetOffset: number;
|
|
148
|
-
viewBehaviorFactories: NodeBehaviorFactory[];
|
|
177
|
+
export class ChildrenDirective extends NodeObservationDirective<ChildrenDirectiveOptions> {
|
|
178
|
+
constructor(options: ChildrenDirectiveOptions);
|
|
179
|
+
disconnect(target: any): void;
|
|
180
|
+
getNodes(target: Element): Node[];
|
|
181
|
+
observe(target: any): void;
|
|
149
182
|
}
|
|
150
183
|
|
|
151
|
-
// Warning: (ae-incompatible-release-tags) The symbol "compileTemplate" is marked as @public, but its signature references "CompilationResult" which is marked as @beta
|
|
152
|
-
//
|
|
153
184
|
// @public
|
|
154
|
-
export
|
|
185
|
+
export type ChildrenDirectiveOptions<T = any> = ChildListDirectiveOptions<T> | SubtreeDirectiveOptions<T>;
|
|
186
|
+
|
|
187
|
+
// @public
|
|
188
|
+
export type CompilationStrategy = (
|
|
189
|
+
html: string | HTMLTemplateElement,
|
|
190
|
+
factories: Record<string, ViewBehaviorFactory>) => HTMLTemplateCompilationResult;
|
|
191
|
+
|
|
192
|
+
// @public
|
|
193
|
+
export const Compiler: {
|
|
194
|
+
setHTMLPolicy(policy: TrustedTypesPolicy): void;
|
|
195
|
+
compile<TSource = any, TParent = any>(html: string | HTMLTemplateElement, directives: Record<string, ViewBehaviorFactory>): HTMLTemplateCompilationResult<TSource, TParent>;
|
|
196
|
+
setDefaultStrategy(strategy: CompilationStrategy): void;
|
|
197
|
+
aggregate(parts: (string | ViewBehaviorFactory)[]): ViewBehaviorFactory;
|
|
198
|
+
};
|
|
155
199
|
|
|
156
200
|
// @public
|
|
157
201
|
export type ComposableStyles = string | ElementStyles | CSSStyleSheet;
|
|
@@ -162,115 +206,152 @@ export type Constructable<T = {}> = {
|
|
|
162
206
|
};
|
|
163
207
|
|
|
164
208
|
// @public
|
|
165
|
-
export
|
|
209
|
+
export type ConstructibleStyleStrategy = {
|
|
210
|
+
new (styles: (string | CSSStyleSheet)[]): StyleStrategy;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// @public
|
|
214
|
+
export class Controller<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier {
|
|
166
215
|
// @internal
|
|
167
|
-
constructor(element:
|
|
168
|
-
addBehaviors(behaviors: ReadonlyArray<Behavior
|
|
169
|
-
addStyles(styles: ElementStyles | HTMLStyleElement): void;
|
|
216
|
+
constructor(element: TElement, definition: FASTElementDefinition);
|
|
217
|
+
addBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>): void;
|
|
218
|
+
addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
170
219
|
readonly definition: FASTElementDefinition;
|
|
171
|
-
readonly element:
|
|
220
|
+
readonly element: TElement;
|
|
172
221
|
emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): void | boolean;
|
|
173
222
|
static forCustomElement(element: HTMLElement): Controller;
|
|
174
223
|
get isConnected(): boolean;
|
|
175
|
-
onAttributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
224
|
+
onAttributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
176
225
|
onConnectedCallback(): void;
|
|
177
226
|
onDisconnectedCallback(): void;
|
|
178
|
-
removeBehaviors(behaviors: ReadonlyArray<Behavior
|
|
179
|
-
removeStyles(styles: ElementStyles | HTMLStyleElement): void;
|
|
227
|
+
removeBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>, force?: boolean): void;
|
|
228
|
+
removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
180
229
|
get styles(): ElementStyles | null;
|
|
181
230
|
set styles(value: ElementStyles | null);
|
|
182
|
-
get template(): ElementViewTemplate | null;
|
|
183
|
-
set template(value: ElementViewTemplate | null);
|
|
184
|
-
readonly view: ElementView | null;
|
|
231
|
+
get template(): ElementViewTemplate<TElement> | null;
|
|
232
|
+
set template(value: ElementViewTemplate<TElement> | null);
|
|
233
|
+
readonly view: ElementView<TElement> | null;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// Warning: (ae-internal-missing-underscore) The name "createTypeRegistry" should be prefixed with an underscore because the declaration is marked as @internal
|
|
237
|
+
//
|
|
238
|
+
// @internal
|
|
239
|
+
export function createTypeRegistry<TDefinition extends TypeDefinition>(): TypeRegistry<TDefinition>;
|
|
240
|
+
|
|
241
|
+
// @public
|
|
242
|
+
export const css: CSSTemplateTag;
|
|
243
|
+
|
|
244
|
+
// @public
|
|
245
|
+
export interface CSSDirective {
|
|
246
|
+
createCSS(add: AddBehavior): ComposableStyles;
|
|
185
247
|
}
|
|
186
248
|
|
|
187
249
|
// @public
|
|
188
|
-
export
|
|
250
|
+
export const CSSDirective: Readonly<{
|
|
251
|
+
getForInstance: (object: any) => CSSDirectiveDefinition<Constructable<CSSDirective>> | undefined;
|
|
252
|
+
getByType: (key: Function) => CSSDirectiveDefinition<Constructable<CSSDirective>> | undefined;
|
|
253
|
+
define<TType extends Constructable<CSSDirective>>(type: any): TType;
|
|
254
|
+
}>;
|
|
255
|
+
|
|
256
|
+
// @public
|
|
257
|
+
export function cssDirective(): (type: Constructable<CSSDirective>) => void;
|
|
189
258
|
|
|
190
259
|
// @public
|
|
191
|
-
export
|
|
192
|
-
|
|
193
|
-
createCSS(): ComposableStyles;
|
|
260
|
+
export interface CSSDirectiveDefinition<TType extends Constructable<CSSDirective> = Constructable<CSSDirective>> {
|
|
261
|
+
readonly type: TType;
|
|
194
262
|
}
|
|
195
263
|
|
|
264
|
+
// @public @deprecated (undocumented)
|
|
265
|
+
export const cssPartial: (strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]) => CSSDirective;
|
|
266
|
+
|
|
196
267
|
// @public
|
|
197
|
-
export
|
|
268
|
+
export type CSSTemplateTag = ((strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]) => ElementStyles) & {
|
|
269
|
+
partial(strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]): CSSDirective;
|
|
270
|
+
};
|
|
198
271
|
|
|
199
272
|
// @public
|
|
200
|
-
export function customElement(nameOrDef: string | PartialFASTElementDefinition): (type:
|
|
273
|
+
export function customElement(nameOrDef: string | PartialFASTElementDefinition): (type: Constructable<HTMLElement>) => void;
|
|
201
274
|
|
|
202
275
|
// @public
|
|
203
276
|
export type DecoratorAttributeConfiguration = Omit<AttributeConfiguration, "property">;
|
|
204
277
|
|
|
205
278
|
// @public
|
|
206
|
-
export
|
|
279
|
+
export type DefaultBindingOptions = AddEventListenerOptions;
|
|
280
|
+
|
|
281
|
+
// @public
|
|
282
|
+
export interface Disposable {
|
|
283
|
+
dispose(): void;
|
|
284
|
+
}
|
|
207
285
|
|
|
208
286
|
// @public
|
|
209
287
|
export const DOM: Readonly<{
|
|
210
|
-
supportsAdoptedStyleSheets: boolean;
|
|
211
|
-
setHTMLPolicy(policy: TrustedTypesPolicy): void;
|
|
212
|
-
createHTML(html: string): string;
|
|
213
|
-
isMarker(node: Node): node is Comment;
|
|
214
|
-
extractDirectiveIndexFromMarker(node: Comment): number;
|
|
215
|
-
createInterpolationPlaceholder(index: number): string;
|
|
216
|
-
createCustomAttributePlaceholder(attributeName: string, index: number): string;
|
|
217
|
-
createBlockPlaceholder(index: number): string;
|
|
218
288
|
queueUpdate: (callable: Callable) => void;
|
|
289
|
+
nextUpdate: () => Promise<void>;
|
|
219
290
|
processUpdates: () => void;
|
|
220
|
-
nextUpdate(): Promise<void>;
|
|
221
291
|
setAttribute(element: HTMLElement, attributeName: string, value: any): void;
|
|
222
292
|
setBooleanAttribute(element: HTMLElement, attributeName: string, value: boolean): void;
|
|
223
|
-
removeChildNodes(parent: Node): void;
|
|
224
|
-
createTemplateWalker(fragment: DocumentFragment): TreeWalker;
|
|
225
293
|
}>;
|
|
226
294
|
|
|
227
295
|
// @public
|
|
228
|
-
export
|
|
296
|
+
export const elements: (selector?: string) => ElementsFilter;
|
|
229
297
|
|
|
230
298
|
// @public
|
|
231
299
|
export type ElementsFilter = (value: Node, index: number, array: Node[]) => boolean;
|
|
232
300
|
|
|
233
301
|
// @public
|
|
234
|
-
export
|
|
235
|
-
|
|
236
|
-
// @public
|
|
237
|
-
export abstract class ElementStyles {
|
|
302
|
+
export class ElementStyles {
|
|
303
|
+
constructor(styles: ReadonlyArray<ComposableStyles>);
|
|
238
304
|
// @internal (undocumented)
|
|
239
305
|
addStylesTo(target: StyleTarget): void;
|
|
240
|
-
|
|
241
|
-
abstract readonly behaviors: ReadonlyArray<Behavior> | null;
|
|
242
|
-
static readonly create: ElementStyleFactory;
|
|
306
|
+
readonly behaviors: ReadonlyArray<Behavior<HTMLElement>> | null;
|
|
243
307
|
// @internal (undocumented)
|
|
244
308
|
isAttachedTo(target: StyleTarget): boolean;
|
|
245
309
|
// @internal (undocumented)
|
|
246
310
|
removeStylesFrom(target: StyleTarget): void;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
311
|
+
static setDefaultStrategy(Strategy: ConstructibleStyleStrategy): void;
|
|
312
|
+
get strategy(): StyleStrategy;
|
|
313
|
+
// (undocumented)
|
|
314
|
+
readonly styles: ReadonlyArray<ComposableStyles>;
|
|
315
|
+
static readonly supportsAdoptedStyleSheets: boolean;
|
|
316
|
+
withBehaviors(...behaviors: Behavior<HTMLElement>[]): this;
|
|
317
|
+
withStrategy(Strategy: ConstructibleStyleStrategy): this;
|
|
250
318
|
}
|
|
251
319
|
|
|
252
320
|
// @public
|
|
253
|
-
export interface ElementView extends View {
|
|
321
|
+
export interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent> {
|
|
254
322
|
appendTo(node: Node): void;
|
|
255
323
|
}
|
|
256
324
|
|
|
257
325
|
// @public
|
|
258
|
-
export interface ElementViewTemplate {
|
|
259
|
-
create(hostBindingTarget: Element): ElementView
|
|
260
|
-
render(source:
|
|
326
|
+
export interface ElementViewTemplate<TSource = any, TParent = any> {
|
|
327
|
+
create(hostBindingTarget: Element): ElementView<TSource, TParent>;
|
|
328
|
+
render(source: TSource, host: Node, hostBindingTarget?: Element): ElementView<TSource, TParent>;
|
|
261
329
|
}
|
|
262
330
|
|
|
263
|
-
//
|
|
264
|
-
//
|
|
265
|
-
// @internal
|
|
331
|
+
// @public
|
|
266
332
|
export const emptyArray: readonly never[];
|
|
267
333
|
|
|
268
334
|
// @public
|
|
269
|
-
export
|
|
335
|
+
export class EventBinding {
|
|
336
|
+
constructor(directive: HTMLBindingDirective);
|
|
337
|
+
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
338
|
+
createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
|
|
339
|
+
// (undocumented)
|
|
340
|
+
readonly directive: HTMLBindingDirective;
|
|
341
|
+
// @internal (undocumented)
|
|
342
|
+
handleEvent(event: Event): void;
|
|
343
|
+
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
344
|
+
}
|
|
270
345
|
|
|
271
346
|
// @public
|
|
272
|
-
export class ExecutionContext<
|
|
347
|
+
export class ExecutionContext<TParentSource = any> {
|
|
348
|
+
static create(): ExecutionContext;
|
|
349
|
+
createChildContext<TParentSource>(parentSource: TParentSource): ExecutionContext<TParentSource>;
|
|
350
|
+
createItemContext(index: number, length: number): ExecutionContext<TParentSource>;
|
|
351
|
+
static readonly default: ExecutionContext<any>;
|
|
273
352
|
get event(): Event;
|
|
353
|
+
eventDetail<TDetail>(): TDetail;
|
|
354
|
+
eventTarget<TTarget extends EventTarget>(): TTarget;
|
|
274
355
|
index: number;
|
|
275
356
|
get isEven(): boolean;
|
|
276
357
|
get isFirst(): boolean;
|
|
@@ -278,10 +359,11 @@ export class ExecutionContext<TParent = any, TGrandparent = any> {
|
|
|
278
359
|
get isLast(): boolean;
|
|
279
360
|
get isOdd(): boolean;
|
|
280
361
|
length: number;
|
|
281
|
-
parent:
|
|
282
|
-
parentContext: ExecutionContext<
|
|
362
|
+
readonly parent: TParentSource;
|
|
363
|
+
readonly parentContext: ExecutionContext<TParentSource>;
|
|
283
364
|
// @internal
|
|
284
365
|
static setEvent(event: Event | null): void;
|
|
366
|
+
updatePosition(index: number, length: number): void;
|
|
285
367
|
}
|
|
286
368
|
|
|
287
369
|
// Warning: (ae-internal-missing-underscore) The name "FAST" should be prefixed with an underscore because the declaration is marked as @internal
|
|
@@ -290,10 +372,10 @@ export class ExecutionContext<TParent = any, TGrandparent = any> {
|
|
|
290
372
|
export const FAST: FASTGlobal;
|
|
291
373
|
|
|
292
374
|
// @public
|
|
293
|
-
export interface FASTElement {
|
|
375
|
+
export interface FASTElement extends HTMLElement {
|
|
294
376
|
$emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): boolean | void;
|
|
295
377
|
readonly $fastController: Controller;
|
|
296
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
378
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
297
379
|
connectedCallback(): void;
|
|
298
380
|
disconnectedCallback(): void;
|
|
299
381
|
}
|
|
@@ -304,17 +386,19 @@ export const FASTElement: (new () => HTMLElement & FASTElement) & {
|
|
|
304
386
|
new (): HTMLElement;
|
|
305
387
|
prototype: HTMLElement;
|
|
306
388
|
}>(BaseType: TBase): new () => InstanceType<TBase> & FASTElement;
|
|
307
|
-
define<TType extends
|
|
389
|
+
define<TType extends Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): TType;
|
|
390
|
+
metadata<TType_1 extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType_1, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType_1>;
|
|
308
391
|
};
|
|
309
392
|
|
|
310
393
|
// @public
|
|
311
|
-
export class FASTElementDefinition<TType extends
|
|
394
|
+
export class FASTElementDefinition<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> {
|
|
312
395
|
constructor(type: TType, nameOrConfig?: PartialFASTElementDefinition | string);
|
|
313
396
|
readonly attributeLookup: Record<string, AttributeDefinition>;
|
|
314
397
|
readonly attributes: ReadonlyArray<AttributeDefinition>;
|
|
315
398
|
define(registry?: CustomElementRegistry): this;
|
|
316
399
|
readonly elementOptions?: ElementDefinitionOptions;
|
|
317
|
-
static readonly
|
|
400
|
+
static readonly getByType: (key: Function) => FASTElementDefinition<Constructable<HTMLElement>> | undefined;
|
|
401
|
+
static readonly getForInstance: (object: any) => FASTElementDefinition<Constructable<HTMLElement>> | undefined;
|
|
318
402
|
get isDefined(): boolean;
|
|
319
403
|
readonly name: string;
|
|
320
404
|
readonly propertyLookup: Record<string, AttributeDefinition>;
|
|
@@ -328,69 +412,92 @@ export class FASTElementDefinition<TType extends Function = Function> {
|
|
|
328
412
|
//
|
|
329
413
|
// @internal
|
|
330
414
|
export interface FASTGlobal {
|
|
415
|
+
addMessages(messages: Record<number, string>): void;
|
|
416
|
+
error(code: number, ...args: any[]): Error;
|
|
331
417
|
getById<T>(id: string | number): T | null;
|
|
332
418
|
// (undocumented)
|
|
333
419
|
getById<T>(id: string | number, initialize: () => T): T;
|
|
334
420
|
readonly versions: string[];
|
|
421
|
+
warn(code: number, ...args: any[]): void;
|
|
335
422
|
}
|
|
336
423
|
|
|
337
|
-
// @public
|
|
338
|
-
export type Global = typeof globalThis & {
|
|
339
|
-
trustedTypes: TrustedTypes;
|
|
340
|
-
readonly FAST: FASTGlobal;
|
|
341
|
-
};
|
|
342
|
-
|
|
343
424
|
// @public
|
|
344
425
|
export function html<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]): ViewTemplate<TSource, TParent>;
|
|
345
426
|
|
|
346
427
|
// @public
|
|
347
|
-
export class HTMLBindingDirective
|
|
348
|
-
constructor(binding: Binding);
|
|
428
|
+
export class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, Aspected {
|
|
429
|
+
constructor(binding: Binding, mode: BindingMode, options: any);
|
|
430
|
+
aspectType: Aspect;
|
|
349
431
|
// (undocumented)
|
|
350
432
|
binding: Binding;
|
|
351
|
-
createBehavior(
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
433
|
+
createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
|
|
434
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
435
|
+
id: string;
|
|
436
|
+
// (undocumented)
|
|
437
|
+
mode: BindingMode;
|
|
438
|
+
nodeId: string;
|
|
439
|
+
// (undocumented)
|
|
440
|
+
options: any;
|
|
441
|
+
sourceAspect: string;
|
|
442
|
+
targetAspect: string;
|
|
443
|
+
}
|
|
356
444
|
|
|
357
445
|
// @public
|
|
358
|
-
export
|
|
359
|
-
|
|
360
|
-
abstract createPlaceholder(index: number): string;
|
|
361
|
-
targetIndex: number;
|
|
446
|
+
export interface HTMLDirective {
|
|
447
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
362
448
|
}
|
|
363
449
|
|
|
364
450
|
// @public
|
|
365
|
-
export
|
|
366
|
-
|
|
451
|
+
export const HTMLDirective: Readonly<{
|
|
452
|
+
getForInstance: (object: any) => HTMLDirectiveDefinition<Constructable<HTMLDirective>> | undefined;
|
|
453
|
+
getByType: (key: Function) => HTMLDirectiveDefinition<Constructable<HTMLDirective>> | undefined;
|
|
454
|
+
define<TType extends Constructable<HTMLDirective>>(type: TType, options?: PartialHTMLDirectiveDefinition): TType;
|
|
455
|
+
}>;
|
|
456
|
+
|
|
457
|
+
// @public
|
|
458
|
+
export function htmlDirective(options?: PartialHTMLDirectiveDefinition): (type: Constructable<HTMLDirective>) => void;
|
|
459
|
+
|
|
460
|
+
// @public
|
|
461
|
+
export interface HTMLDirectiveDefinition<TType extends Constructable<HTMLDirective> = Constructable<HTMLDirective>> extends Required<PartialHTMLDirectiveDefinition> {
|
|
462
|
+
readonly type: TType;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// @public
|
|
466
|
+
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any> {
|
|
467
|
+
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// @public
|
|
471
|
+
export class HTMLView<TSource = any, TParent = any> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent> {
|
|
472
|
+
constructor(fragment: DocumentFragment, factories: ReadonlyArray<ViewBehaviorFactory>, targets: ViewBehaviorTargets);
|
|
367
473
|
appendTo(node: Node): void;
|
|
368
|
-
bind(source:
|
|
369
|
-
context: ExecutionContext | null;
|
|
474
|
+
bind(source: TSource, context: ExecutionContext<TParent>): void;
|
|
475
|
+
context: ExecutionContext<TParent> | null;
|
|
370
476
|
dispose(): void;
|
|
371
477
|
static disposeContiguousBatch(views: SyntheticView[]): void;
|
|
372
478
|
firstChild: Node;
|
|
373
479
|
insertBefore(node: Node): void;
|
|
374
480
|
lastChild: Node;
|
|
375
481
|
remove(): void;
|
|
376
|
-
source:
|
|
482
|
+
source: TSource | null;
|
|
377
483
|
unbind(): void;
|
|
378
484
|
}
|
|
379
485
|
|
|
380
|
-
//
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
export const enum KernelServiceId {
|
|
384
|
-
// (undocumented)
|
|
385
|
-
contextEvent = 3,
|
|
386
|
-
// (undocumented)
|
|
387
|
-
elementRegistry = 4,
|
|
388
|
-
// (undocumented)
|
|
389
|
-
observable = 2,
|
|
390
|
-
// (undocumented)
|
|
391
|
-
updateQueue = 1
|
|
486
|
+
// @public
|
|
487
|
+
export interface LengthObserver extends Subscriber {
|
|
488
|
+
length: number;
|
|
392
489
|
}
|
|
393
490
|
|
|
491
|
+
// @public
|
|
492
|
+
export function lengthOf<T>(array: readonly T[]): number;
|
|
493
|
+
|
|
494
|
+
// @public
|
|
495
|
+
export const Markup: Readonly<{
|
|
496
|
+
interpolation: (id: string) => string;
|
|
497
|
+
attribute: (id: string) => string;
|
|
498
|
+
comment: (id: string) => string;
|
|
499
|
+
}>;
|
|
500
|
+
|
|
394
501
|
// Warning: (ae-internal-missing-underscore) The name "Mutable" should be prefixed with an underscore because the declaration is marked as @internal
|
|
395
502
|
//
|
|
396
503
|
// @internal
|
|
@@ -398,22 +505,28 @@ export type Mutable<T> = {
|
|
|
398
505
|
-readonly [P in keyof T]: T[P];
|
|
399
506
|
};
|
|
400
507
|
|
|
401
|
-
// @public
|
|
402
|
-
export interface NodeBehaviorFactory {
|
|
403
|
-
createBehavior(target: Node): Behavior;
|
|
404
|
-
targetIndex: number;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
508
|
// @public
|
|
408
509
|
export interface NodeBehaviorOptions<T = any> {
|
|
409
510
|
filter?: ElementsFilter;
|
|
410
511
|
property: T;
|
|
411
512
|
}
|
|
412
513
|
|
|
514
|
+
// @public
|
|
515
|
+
export abstract class NodeObservationDirective<T extends NodeBehaviorOptions> extends StatelessAttachedAttributeDirective<T> {
|
|
516
|
+
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
517
|
+
protected computeNodes(target: any): Node[];
|
|
518
|
+
protected abstract disconnect(target: any): void;
|
|
519
|
+
protected abstract getNodes(target: any): Node[];
|
|
520
|
+
protected getSource(target: Node): any;
|
|
521
|
+
protected abstract observe(target: any): void;
|
|
522
|
+
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
523
|
+
protected updateTarget(source: any, value: ReadonlyArray<any>): void;
|
|
524
|
+
}
|
|
525
|
+
|
|
413
526
|
// @public
|
|
414
527
|
export interface Notifier {
|
|
415
528
|
notify(args: any): void;
|
|
416
|
-
readonly
|
|
529
|
+
readonly subject: any;
|
|
417
530
|
subscribe(subscriber: Subscriber, propertyToWatch?: any): void;
|
|
418
531
|
unsubscribe(subscriber: Subscriber, propertyToUnwatch?: any): void;
|
|
419
532
|
}
|
|
@@ -424,14 +537,14 @@ export const nullableNumberConverter: ValueConverter;
|
|
|
424
537
|
// @public
|
|
425
538
|
export const Observable: Readonly<{
|
|
426
539
|
setArrayObserverFactory(factory: (collection: any[]) => Notifier): void;
|
|
427
|
-
getNotifier: (source: any) =>
|
|
540
|
+
getNotifier: <T extends Notifier = Notifier>(source: any) => T;
|
|
428
541
|
track(source: unknown, propertyName: string): void;
|
|
429
542
|
trackVolatile(): void;
|
|
430
543
|
notify(source: unknown, args: any): void;
|
|
431
544
|
defineProperty(target: {}, nameOrAccessor: string | Accessor): void;
|
|
432
545
|
getAccessors: (target: {}) => Accessor[];
|
|
433
|
-
binding<TSource = any, TReturn = any
|
|
434
|
-
isVolatileBinding<TSource_1 = any, TReturn_1 = any
|
|
546
|
+
binding<TSource = any, TReturn = any>(binding: Binding<TSource, TReturn, any>, initialSubscriber?: Subscriber, isVolatileBinding?: boolean): BindingObserver<TSource, TReturn, any>;
|
|
547
|
+
isVolatileBinding<TSource_1 = any, TReturn_1 = any>(binding: Binding<TSource_1, TReturn_1, any>): boolean;
|
|
435
548
|
}>;
|
|
436
549
|
|
|
437
550
|
// @public
|
|
@@ -443,6 +556,22 @@ export interface ObservationRecord {
|
|
|
443
556
|
propertySource: any;
|
|
444
557
|
}
|
|
445
558
|
|
|
559
|
+
// @public
|
|
560
|
+
export const onChange: BindingConfig<AddEventListenerOptions> & BindingConfigResolver<AddEventListenerOptions>;
|
|
561
|
+
|
|
562
|
+
// @public
|
|
563
|
+
export const oneTime: BindingConfig<AddEventListenerOptions> & BindingConfigResolver<AddEventListenerOptions>;
|
|
564
|
+
|
|
565
|
+
// @public
|
|
566
|
+
export class OneTimeBinding extends UpdateBinding {
|
|
567
|
+
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// @public
|
|
571
|
+
export const Parser: Readonly<{
|
|
572
|
+
parse(value: string, factories: Record<string, ViewBehaviorFactory>): (string | ViewBehaviorFactory)[] | null;
|
|
573
|
+
}>;
|
|
574
|
+
|
|
446
575
|
// @public
|
|
447
576
|
export interface PartialFASTElementDefinition {
|
|
448
577
|
readonly attributes?: (AttributeConfiguration | string)[];
|
|
@@ -453,43 +582,54 @@ export interface PartialFASTElementDefinition {
|
|
|
453
582
|
readonly template?: ElementViewTemplate;
|
|
454
583
|
}
|
|
455
584
|
|
|
585
|
+
// @public
|
|
586
|
+
export interface PartialHTMLDirectiveDefinition {
|
|
587
|
+
aspected?: boolean;
|
|
588
|
+
}
|
|
589
|
+
|
|
456
590
|
// @public
|
|
457
591
|
export class PropertyChangeNotifier implements Notifier {
|
|
458
|
-
constructor(
|
|
592
|
+
constructor(subject: any);
|
|
459
593
|
notify(propertyName: string): void;
|
|
460
|
-
readonly
|
|
594
|
+
readonly subject: any;
|
|
461
595
|
subscribe(subscriber: Subscriber, propertyToWatch?: string): void;
|
|
462
596
|
unsubscribe(subscriber: Subscriber, propertyToUnwatch?: string): void;
|
|
463
597
|
}
|
|
464
598
|
|
|
465
599
|
// @public
|
|
466
|
-
export
|
|
600
|
+
export const ref: <T = any>(propertyName: keyof T & string) => CaptureType<T>;
|
|
467
601
|
|
|
468
602
|
// @public
|
|
469
|
-
export class
|
|
470
|
-
|
|
471
|
-
bind(source: any): void;
|
|
603
|
+
export class RefDirective extends StatelessAttachedAttributeDirective<string> {
|
|
604
|
+
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
472
605
|
unbind(): void;
|
|
473
606
|
}
|
|
474
607
|
|
|
475
608
|
// @public
|
|
476
|
-
export function repeat<TSource = any,
|
|
609
|
+
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ViewTemplate | Binding<TSource, ViewTemplate>, options?: RepeatOptions): CaptureType<TSource>;
|
|
477
610
|
|
|
478
611
|
// @public
|
|
479
612
|
export class RepeatBehavior<TSource = any> implements Behavior, Subscriber {
|
|
480
613
|
constructor(location: Node, itemsBinding: Binding<TSource, any[]>, isItemsBindingVolatile: boolean, templateBinding: Binding<TSource, SyntheticViewTemplate>, isTemplateBindingVolatile: boolean, options: RepeatOptions);
|
|
481
614
|
bind(source: TSource, context: ExecutionContext): void;
|
|
482
|
-
// @internal (undocumented)
|
|
483
615
|
handleChange(source: any, args: Splice[]): void;
|
|
484
616
|
unbind(): void;
|
|
485
|
-
|
|
617
|
+
}
|
|
486
618
|
|
|
487
619
|
// @public
|
|
488
|
-
export class RepeatDirective<TSource = any>
|
|
620
|
+
export class RepeatDirective<TSource = any> implements HTMLDirective, ViewBehaviorFactory {
|
|
489
621
|
constructor(itemsBinding: Binding, templateBinding: Binding<TSource, SyntheticViewTemplate>, options: RepeatOptions);
|
|
490
|
-
createBehavior(
|
|
491
|
-
|
|
492
|
-
|
|
622
|
+
createBehavior(targets: ViewBehaviorTargets): RepeatBehavior<TSource>;
|
|
623
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
624
|
+
id: string;
|
|
625
|
+
// (undocumented)
|
|
626
|
+
readonly itemsBinding: Binding;
|
|
627
|
+
nodeId: string;
|
|
628
|
+
// (undocumented)
|
|
629
|
+
readonly options: RepeatOptions;
|
|
630
|
+
// (undocumented)
|
|
631
|
+
readonly templateBinding: Binding<TSource, SyntheticViewTemplate>;
|
|
632
|
+
}
|
|
493
633
|
|
|
494
634
|
// @public
|
|
495
635
|
export interface RepeatOptions {
|
|
@@ -498,61 +638,113 @@ export interface RepeatOptions {
|
|
|
498
638
|
}
|
|
499
639
|
|
|
500
640
|
// @public
|
|
501
|
-
export function slotted<T = any>(propertyOrOptions: (keyof T & string) |
|
|
641
|
+
export function slotted<T = any>(propertyOrOptions: (keyof T & string) | SlottedDirectiveOptions<keyof T & string>): CaptureType<T>;
|
|
502
642
|
|
|
503
643
|
// @public
|
|
504
|
-
export class
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
644
|
+
export class SlottedDirective extends NodeObservationDirective<SlottedDirectiveOptions> {
|
|
645
|
+
disconnect(target: EventSource): void;
|
|
646
|
+
getNodes(target: HTMLSlotElement): Node[];
|
|
647
|
+
// @internal (undocumented)
|
|
648
|
+
handleEvent(event: Event): void;
|
|
649
|
+
observe(target: EventSource): void;
|
|
509
650
|
}
|
|
510
651
|
|
|
511
652
|
// @public
|
|
512
|
-
export interface
|
|
653
|
+
export interface SlottedDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, AssignedNodesOptions {
|
|
513
654
|
}
|
|
514
655
|
|
|
515
656
|
// @public
|
|
516
|
-
export
|
|
657
|
+
export class Splice {
|
|
658
|
+
constructor(index: number, removed: any[], addedCount: number);
|
|
659
|
+
// (undocumented)
|
|
517
660
|
addedCount: number;
|
|
661
|
+
adjustTo(array: any[]): this;
|
|
662
|
+
// (undocumented)
|
|
518
663
|
index: number;
|
|
664
|
+
// (undocumented)
|
|
519
665
|
removed: any[];
|
|
666
|
+
reset?: boolean;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
// @public
|
|
670
|
+
export interface SpliceStrategy {
|
|
671
|
+
normalize(previous: unknown[] | undefined, current: unknown[], changes: Splice[] | undefined): readonly Splice[];
|
|
672
|
+
pop(array: any[], observer: ArrayObserver, pop: typeof Array.prototype.pop, args: any[]): any;
|
|
673
|
+
push(array: any[], observer: ArrayObserver, push: typeof Array.prototype.push, args: any[]): any;
|
|
674
|
+
reverse(array: any[], observer: ArrayObserver, reverse: typeof Array.prototype.reverse, args: any[]): any;
|
|
675
|
+
shift(array: any[], observer: ArrayObserver, shift: typeof Array.prototype.shift, args: any[]): any;
|
|
676
|
+
sort(array: any[], observer: ArrayObserver, sort: typeof Array.prototype.sort, args: any[]): any[];
|
|
677
|
+
splice(array: any[], observer: ArrayObserver, splice: typeof Array.prototype.splice, args: any[]): any;
|
|
678
|
+
readonly support: SpliceStrategySupport;
|
|
679
|
+
unshift(array: any[], observer: ArrayObserver, unshift: typeof Array.prototype.unshift, args: any[]): any[];
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
// @public
|
|
683
|
+
export const SpliceStrategy: Readonly<{
|
|
684
|
+
readonly reset: Splice[];
|
|
685
|
+
readonly setDefaultStrategy: (strategy: SpliceStrategy) => void;
|
|
686
|
+
}>;
|
|
687
|
+
|
|
688
|
+
// @public
|
|
689
|
+
export const SpliceStrategySupport: Readonly<{
|
|
690
|
+
readonly reset: 1;
|
|
691
|
+
readonly splice: 2;
|
|
692
|
+
readonly optimized: 3;
|
|
693
|
+
}>;
|
|
694
|
+
|
|
695
|
+
// @public
|
|
696
|
+
export type SpliceStrategySupport = typeof SpliceStrategySupport[keyof typeof SpliceStrategySupport];
|
|
697
|
+
|
|
698
|
+
// @public
|
|
699
|
+
export abstract class StatelessAttachedAttributeDirective<T> implements HTMLDirective, ViewBehaviorFactory, ViewBehavior {
|
|
700
|
+
constructor(options: T);
|
|
701
|
+
abstract bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
702
|
+
createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
|
|
703
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
704
|
+
id: string;
|
|
705
|
+
nodeId: string;
|
|
706
|
+
// (undocumented)
|
|
707
|
+
protected options: T;
|
|
708
|
+
abstract unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
// @public
|
|
712
|
+
export interface StyleStrategy {
|
|
713
|
+
addStylesTo(target: StyleTarget): void;
|
|
714
|
+
removeStylesFrom(target: StyleTarget): void;
|
|
520
715
|
}
|
|
521
716
|
|
|
522
717
|
// @public
|
|
523
718
|
export interface StyleTarget {
|
|
524
719
|
adoptedStyleSheets?: CSSStyleSheet[];
|
|
525
720
|
append(styles: HTMLStyleElement): void;
|
|
526
|
-
// @deprecated
|
|
527
|
-
prepend(styles: HTMLStyleElement): void;
|
|
528
721
|
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
|
|
529
722
|
removeChild(styles: HTMLStyleElement): void;
|
|
530
723
|
}
|
|
531
724
|
|
|
532
725
|
// @public
|
|
533
726
|
export interface Subscriber {
|
|
534
|
-
handleChange(
|
|
727
|
+
handleChange(subject: any, args: any): void;
|
|
535
728
|
}
|
|
536
729
|
|
|
537
730
|
// @public
|
|
538
731
|
export class SubscriberSet implements Notifier {
|
|
539
|
-
constructor(
|
|
732
|
+
constructor(subject: any, initialSubscriber?: Subscriber);
|
|
540
733
|
has(subscriber: Subscriber): boolean;
|
|
541
734
|
notify(args: any): void;
|
|
542
|
-
readonly
|
|
735
|
+
readonly subject: any;
|
|
543
736
|
subscribe(subscriber: Subscriber): void;
|
|
544
737
|
unsubscribe(subscriber: Subscriber): void;
|
|
545
738
|
}
|
|
546
739
|
|
|
547
740
|
// @public
|
|
548
|
-
export interface
|
|
741
|
+
export interface SubtreeDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, Omit<MutationObserverInit, "subtree" | "childList"> {
|
|
549
742
|
selector: string;
|
|
550
743
|
subtree: boolean;
|
|
551
744
|
}
|
|
552
745
|
|
|
553
746
|
// @public
|
|
554
|
-
export interface SyntheticView extends View {
|
|
555
|
-
dispose(): void;
|
|
747
|
+
export interface SyntheticView<TSource = any, TParent = any> extends View<TSource, TParent> {
|
|
556
748
|
readonly firstChild: Node;
|
|
557
749
|
insertBefore(node: Node): void;
|
|
558
750
|
readonly lastChild: Node;
|
|
@@ -561,17 +753,11 @@ export interface SyntheticView extends View {
|
|
|
561
753
|
|
|
562
754
|
// @public
|
|
563
755
|
export interface SyntheticViewTemplate<TSource = any, TParent = any> {
|
|
564
|
-
create(): SyntheticView
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
// @public
|
|
568
|
-
export abstract class TargetedHTMLDirective extends HTMLDirective {
|
|
569
|
-
createPlaceholder: (index: number) => string;
|
|
570
|
-
abstract targetName: string | undefined;
|
|
756
|
+
create(): SyntheticView<TSource, TParent>;
|
|
571
757
|
}
|
|
572
758
|
|
|
573
759
|
// @public
|
|
574
|
-
export type TemplateValue<
|
|
760
|
+
export type TemplateValue<TSource, TParent = any> = Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource>;
|
|
575
761
|
|
|
576
762
|
// @public
|
|
577
763
|
export type TrustedTypes = {
|
|
@@ -583,6 +769,57 @@ export type TrustedTypesPolicy = {
|
|
|
583
769
|
createHTML(html: string): string;
|
|
584
770
|
};
|
|
585
771
|
|
|
772
|
+
// Warning: (ae-internal-missing-underscore) The name "TypeDefinition" should be prefixed with an underscore because the declaration is marked as @internal
|
|
773
|
+
//
|
|
774
|
+
// @internal
|
|
775
|
+
export interface TypeDefinition {
|
|
776
|
+
// (undocumented)
|
|
777
|
+
type: Function;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
// Warning: (ae-internal-missing-underscore) The name "TypeRegistry" should be prefixed with an underscore because the declaration is marked as @internal
|
|
781
|
+
//
|
|
782
|
+
// @internal
|
|
783
|
+
export interface TypeRegistry<TDefinition extends TypeDefinition> {
|
|
784
|
+
// (undocumented)
|
|
785
|
+
getByType(key: Function): TDefinition | undefined;
|
|
786
|
+
// (undocumented)
|
|
787
|
+
getForInstance(object: any): TDefinition | undefined;
|
|
788
|
+
// (undocumented)
|
|
789
|
+
register(definition: TDefinition): boolean;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
// @public
|
|
793
|
+
export class UpdateBinding implements ViewBehavior {
|
|
794
|
+
constructor(directive: HTMLBindingDirective, updateTarget: UpdateTarget);
|
|
795
|
+
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
796
|
+
createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
|
|
797
|
+
// (undocumented)
|
|
798
|
+
readonly directive: HTMLBindingDirective;
|
|
799
|
+
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
800
|
+
// (undocumented)
|
|
801
|
+
protected updateTarget: UpdateTarget;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
// @public
|
|
805
|
+
export interface UpdateQueue {
|
|
806
|
+
enqueue(callable: Callable): void;
|
|
807
|
+
next(): Promise<void>;
|
|
808
|
+
process(): void;
|
|
809
|
+
setMode(isAsync: boolean): void;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
// @public
|
|
813
|
+
export const Updates: UpdateQueue;
|
|
814
|
+
|
|
815
|
+
// @public
|
|
816
|
+
export type UpdateTarget = (this: UpdateTargetThis, target: Node, aspect: string, value: any, source: any, context: ExecutionContext) => void;
|
|
817
|
+
|
|
818
|
+
// @public
|
|
819
|
+
export interface UpdateTargetThis {
|
|
820
|
+
directive: HTMLBindingDirective;
|
|
821
|
+
}
|
|
822
|
+
|
|
586
823
|
// @public
|
|
587
824
|
export interface ValueConverter {
|
|
588
825
|
fromView(value: any): any;
|
|
@@ -590,22 +827,39 @@ export interface ValueConverter {
|
|
|
590
827
|
}
|
|
591
828
|
|
|
592
829
|
// @public
|
|
593
|
-
export interface View {
|
|
594
|
-
bind(source:
|
|
595
|
-
readonly context: ExecutionContext | null;
|
|
596
|
-
|
|
597
|
-
readonly source: any | null;
|
|
830
|
+
export interface View<TSource = any, TParent = any> extends Disposable {
|
|
831
|
+
bind(source: TSource, context: ExecutionContext<TParent>): void;
|
|
832
|
+
readonly context: ExecutionContext<TParent> | null;
|
|
833
|
+
readonly source: TSource | null;
|
|
598
834
|
unbind(): void;
|
|
599
835
|
}
|
|
600
836
|
|
|
601
837
|
// @public
|
|
602
|
-
export
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
838
|
+
export interface ViewBehavior<TSource = any, TParent = any> {
|
|
839
|
+
bind(source: TSource, context: ExecutionContext<TParent>, targets: ViewBehaviorTargets): void;
|
|
840
|
+
unbind(source: TSource, context: ExecutionContext<TParent>, targets: ViewBehaviorTargets): void;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
// @public
|
|
844
|
+
export interface ViewBehaviorFactory {
|
|
845
|
+
createBehavior(targets: ViewBehaviorTargets): Behavior | ViewBehavior;
|
|
846
|
+
id: string;
|
|
847
|
+
nodeId: string;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
// @public
|
|
851
|
+
export type ViewBehaviorTargets = {
|
|
852
|
+
[id: string]: Node;
|
|
853
|
+
};
|
|
854
|
+
|
|
855
|
+
// @public
|
|
856
|
+
export class ViewTemplate<TSource = any, TParent = any> implements ElementViewTemplate<TSource, TParent>, SyntheticViewTemplate<TSource, TParent> {
|
|
857
|
+
constructor(html: string | HTMLTemplateElement, factories: Record<string, ViewBehaviorFactory>);
|
|
858
|
+
create(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
859
|
+
readonly factories: Record<string, ViewBehaviorFactory>;
|
|
606
860
|
readonly html: string | HTMLTemplateElement;
|
|
607
|
-
render(source: TSource, host: Node
|
|
608
|
-
|
|
861
|
+
render(source: TSource, host: Node, hostBindingTarget?: Element, context?: ExecutionContext): HTMLView<TSource, TParent>;
|
|
862
|
+
}
|
|
609
863
|
|
|
610
864
|
// @public
|
|
611
865
|
export function volatile(target: {}, name: string | Accessor, descriptor: PropertyDescriptor): PropertyDescriptor;
|
|
@@ -613,7 +867,6 @@ export function volatile(target: {}, name: string | Accessor, descriptor: Proper
|
|
|
613
867
|
// @public
|
|
614
868
|
export function when<TSource = any, TReturn = any>(binding: Binding<TSource, TReturn>, templateOrTemplateBinding: SyntheticViewTemplate | Binding<TSource, SyntheticViewTemplate>): CaptureType<TSource>;
|
|
615
869
|
|
|
616
|
-
|
|
617
870
|
// (No @packageDocumentation comment for this package)
|
|
618
871
|
|
|
619
872
|
```
|