@microsoft/fast-element 1.10.2 → 2.0.0-beta.1
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 +321 -1
- package/CHANGELOG.md +52 -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 +8 -2
- package/dist/dts/components/fast-element.d.ts +5 -4
- 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 +144 -0
- package/dist/dts/observation/arrays.d.ts +207 -0
- package/dist/dts/observation/behavior.d.ts +5 -5
- package/dist/dts/observation/notifier.d.ts +18 -18
- package/dist/dts/observation/observable.d.ts +86 -29
- 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.d.ts +320 -64
- package/dist/dts/templating/children.d.ts +18 -15
- package/dist/dts/templating/compiler.d.ts +47 -28
- package/dist/dts/templating/dom.d.ts +41 -0
- package/dist/dts/templating/html-directive.d.ts +179 -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 +72 -14
- package/dist/dts/templating/slotted.d.ts +13 -14
- package/dist/dts/templating/template.d.ts +78 -23
- package/dist/dts/templating/view.d.ts +16 -23
- 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 +14 -22
- package/dist/esm/debug.js +29 -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/observation/arrays.js +269 -0
- package/dist/esm/observation/notifier.js +27 -35
- package/dist/esm/observation/observable.js +80 -107
- 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.js +465 -155
- package/dist/esm/templating/children.js +33 -23
- package/dist/esm/templating/compiler.js +235 -152
- package/dist/esm/templating/dom.js +49 -0
- package/dist/esm/templating/html-directive.js +125 -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 +38 -43
- package/dist/esm/templating/slotted.js +23 -20
- package/dist/esm/templating/template.js +71 -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 +13633 -5266
- package/dist/fast-element.d.ts +1434 -578
- package/dist/fast-element.debug.js +3824 -0
- package/dist/fast-element.debug.min.js +1 -0
- package/dist/fast-element.js +3574 -4020
- package/dist/fast-element.min.js +1 -1
- package/dist/fast-element.untrimmed.d.ts +2908 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/docs/api-report.md +590 -231
- 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 +46 -14
- 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
|
+
}>;
|
|
23
58
|
|
|
24
59
|
// @public
|
|
25
|
-
export type
|
|
60
|
+
export type Aspect = typeof Aspect[Exclude<keyof typeof Aspect, "assign" | "none">];
|
|
61
|
+
|
|
62
|
+
// @public
|
|
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, TContext extends ExecutionContext<TParent> = RootContext> {
|
|
108
|
+
bind(source: TSource, context: TContext): void;
|
|
109
|
+
unbind(source: TSource, context: TContext): void;
|
|
64
110
|
}
|
|
65
111
|
|
|
66
112
|
// @public
|
|
67
|
-
export
|
|
113
|
+
export function bind<T = any>(binding: Binding<T>, config?: BindingConfig | DefaultBindingOptions): CaptureType<T>;
|
|
68
114
|
|
|
69
115
|
// @public
|
|
70
|
-
export
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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;
|
|
116
|
+
export type Binding<TSource = any, TReturn = any, TContext extends ExecutionContext = ExecutionContext> = (source: TSource, context: TContext) => TReturn;
|
|
117
|
+
|
|
118
|
+
// @public
|
|
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,62 @@ 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 const child: <TChild = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TChild, TParent, ChildContext<TParent>>[]) => ChildViewTemplate<TChild, TParent>;
|
|
171
|
+
|
|
172
|
+
// @public
|
|
173
|
+
export interface ChildContext<TParentSource = any> extends RootContext {
|
|
174
|
+
createItemContext(index: number, length: number): ItemContext<TParentSource>;
|
|
175
|
+
readonly parent: TParentSource;
|
|
176
|
+
readonly parentContext: ChildContext<TParentSource>;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// @public
|
|
180
|
+
export interface ChildListDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, Omit<MutationObserverInit, "subtree" | "childList"> {
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// @public
|
|
184
|
+
export function children<T = any>(propertyOrOptions: (keyof T & string) | ChildrenDirectiveOptions<keyof T & string>): CaptureType<T>;
|
|
129
185
|
|
|
130
|
-
// Warning: (ae-forgotten-export) The symbol "NodeObservationBehavior" needs to be exported by the entry point index.d.ts
|
|
131
|
-
//
|
|
132
186
|
// @public
|
|
133
|
-
export class
|
|
134
|
-
constructor(
|
|
135
|
-
disconnect(): void;
|
|
136
|
-
|
|
137
|
-
observe(): void;
|
|
138
|
-
|
|
187
|
+
export class ChildrenDirective extends NodeObservationDirective<ChildrenDirectiveOptions> {
|
|
188
|
+
constructor(options: ChildrenDirectiveOptions);
|
|
189
|
+
disconnect(target: any): void;
|
|
190
|
+
getNodes(target: Element): Node[];
|
|
191
|
+
observe(target: any): void;
|
|
192
|
+
}
|
|
139
193
|
|
|
140
194
|
// @public
|
|
141
|
-
export type
|
|
195
|
+
export type ChildrenDirectiveOptions<T = any> = ChildListDirectiveOptions<T> | SubtreeDirectiveOptions<T>;
|
|
142
196
|
|
|
143
|
-
// @
|
|
144
|
-
export interface
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
viewBehaviorFactories: NodeBehaviorFactory[];
|
|
197
|
+
// @public
|
|
198
|
+
export interface ChildViewTemplate<TSource = any, TParent = any> {
|
|
199
|
+
create(): SyntheticView<TSource, TParent, ChildContext<TParent>>;
|
|
200
|
+
// (undocumented)
|
|
201
|
+
type: "child";
|
|
149
202
|
}
|
|
150
203
|
|
|
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
204
|
// @public
|
|
154
|
-
export
|
|
205
|
+
export type CompilationStrategy = (
|
|
206
|
+
html: string | HTMLTemplateElement,
|
|
207
|
+
factories: Record<string, ViewBehaviorFactory>) => HTMLTemplateCompilationResult;
|
|
208
|
+
|
|
209
|
+
// @public
|
|
210
|
+
export const Compiler: {
|
|
211
|
+
setHTMLPolicy(policy: TrustedTypesPolicy): void;
|
|
212
|
+
compile<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>>(html: string | HTMLTemplateElement, directives: Record<string, ViewBehaviorFactory>): HTMLTemplateCompilationResult<TSource, TParent, TContext>;
|
|
213
|
+
setDefaultStrategy(strategy: CompilationStrategy): void;
|
|
214
|
+
aggregate(parts: (string | ViewBehaviorFactory)[]): ViewBehaviorFactory;
|
|
215
|
+
};
|
|
155
216
|
|
|
156
217
|
// @public
|
|
157
218
|
export type ComposableStyles = string | ElementStyles | CSSStyleSheet;
|
|
@@ -162,127 +223,160 @@ export type Constructable<T = {}> = {
|
|
|
162
223
|
};
|
|
163
224
|
|
|
164
225
|
// @public
|
|
165
|
-
export
|
|
226
|
+
export type ConstructibleStyleStrategy = {
|
|
227
|
+
new (styles: (string | CSSStyleSheet)[]): StyleStrategy;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
// @public
|
|
231
|
+
export class Controller<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier {
|
|
166
232
|
// @internal
|
|
167
|
-
constructor(element:
|
|
168
|
-
addBehaviors(behaviors: ReadonlyArray<Behavior
|
|
169
|
-
addStyles(styles: ElementStyles | HTMLStyleElement): void;
|
|
233
|
+
constructor(element: TElement, definition: FASTElementDefinition);
|
|
234
|
+
addBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>): void;
|
|
235
|
+
addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
170
236
|
readonly definition: FASTElementDefinition;
|
|
171
|
-
readonly element:
|
|
237
|
+
readonly element: TElement;
|
|
172
238
|
emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): void | boolean;
|
|
173
239
|
static forCustomElement(element: HTMLElement): Controller;
|
|
174
240
|
get isConnected(): boolean;
|
|
175
|
-
onAttributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
241
|
+
onAttributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
176
242
|
onConnectedCallback(): void;
|
|
177
243
|
onDisconnectedCallback(): void;
|
|
178
|
-
removeBehaviors(behaviors: ReadonlyArray<Behavior
|
|
179
|
-
removeStyles(styles: ElementStyles | HTMLStyleElement): void;
|
|
244
|
+
removeBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>, force?: boolean): void;
|
|
245
|
+
removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
180
246
|
get styles(): ElementStyles | null;
|
|
181
247
|
set styles(value: ElementStyles | null);
|
|
182
|
-
get template(): ElementViewTemplate | null;
|
|
183
|
-
set template(value: ElementViewTemplate | null);
|
|
184
|
-
readonly view: ElementView | null;
|
|
248
|
+
get template(): ElementViewTemplate<TElement> | null;
|
|
249
|
+
set template(value: ElementViewTemplate<TElement> | null);
|
|
250
|
+
readonly view: ElementView<TElement> | null;
|
|
185
251
|
}
|
|
186
252
|
|
|
253
|
+
// Warning: (ae-internal-missing-underscore) The name "createTypeRegistry" should be prefixed with an underscore because the declaration is marked as @internal
|
|
254
|
+
//
|
|
255
|
+
// @internal
|
|
256
|
+
export function createTypeRegistry<TDefinition extends TypeDefinition>(): TypeRegistry<TDefinition>;
|
|
257
|
+
|
|
258
|
+
// @public
|
|
259
|
+
export const css: CSSTemplateTag;
|
|
260
|
+
|
|
261
|
+
// @public
|
|
262
|
+
export interface CSSDirective {
|
|
263
|
+
createCSS(add: AddBehavior): ComposableStyles;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// @public
|
|
267
|
+
export const CSSDirective: Readonly<{
|
|
268
|
+
getForInstance: (object: any) => CSSDirectiveDefinition<Constructable<CSSDirective>> | undefined;
|
|
269
|
+
getByType: (key: Function) => CSSDirectiveDefinition<Constructable<CSSDirective>> | undefined;
|
|
270
|
+
define<TType extends Constructable<CSSDirective>>(type: any): TType;
|
|
271
|
+
}>;
|
|
272
|
+
|
|
187
273
|
// @public
|
|
188
|
-
export function
|
|
274
|
+
export function cssDirective(): (type: Constructable<CSSDirective>) => void;
|
|
189
275
|
|
|
190
276
|
// @public
|
|
191
|
-
export
|
|
192
|
-
|
|
193
|
-
createCSS(): ComposableStyles;
|
|
277
|
+
export interface CSSDirectiveDefinition<TType extends Constructable<CSSDirective> = Constructable<CSSDirective>> {
|
|
278
|
+
readonly type: TType;
|
|
194
279
|
}
|
|
195
280
|
|
|
281
|
+
// @public @deprecated (undocumented)
|
|
282
|
+
export const cssPartial: (strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]) => CSSDirective;
|
|
283
|
+
|
|
196
284
|
// @public
|
|
197
|
-
export
|
|
285
|
+
export type CSSTemplateTag = ((strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]) => ElementStyles) & {
|
|
286
|
+
partial(strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]): CSSDirective;
|
|
287
|
+
};
|
|
198
288
|
|
|
199
289
|
// @public
|
|
200
|
-
export function customElement(nameOrDef: string | PartialFASTElementDefinition): (type:
|
|
290
|
+
export function customElement(nameOrDef: string | PartialFASTElementDefinition): (type: Constructable<HTMLElement>) => void;
|
|
201
291
|
|
|
202
292
|
// @public
|
|
203
293
|
export type DecoratorAttributeConfiguration = Omit<AttributeConfiguration, "property">;
|
|
204
294
|
|
|
205
295
|
// @public
|
|
206
|
-
export
|
|
296
|
+
export type DefaultBindingOptions = AddEventListenerOptions;
|
|
297
|
+
|
|
298
|
+
// @public
|
|
299
|
+
export type DefaultTwoWayBindingOptions = DefaultBindingOptions & {
|
|
300
|
+
changeEvent?: string;
|
|
301
|
+
fromView?: (value: any) => any;
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
// @public
|
|
305
|
+
export interface Disposable {
|
|
306
|
+
dispose(): void;
|
|
307
|
+
}
|
|
207
308
|
|
|
208
309
|
// @public
|
|
209
310
|
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
311
|
queueUpdate: (callable: Callable) => void;
|
|
312
|
+
nextUpdate: () => Promise<void>;
|
|
219
313
|
processUpdates: () => void;
|
|
220
|
-
nextUpdate(): Promise<void>;
|
|
221
314
|
setAttribute(element: HTMLElement, attributeName: string, value: any): void;
|
|
222
315
|
setBooleanAttribute(element: HTMLElement, attributeName: string, value: boolean): void;
|
|
223
|
-
removeChildNodes(parent: Node): void;
|
|
224
|
-
createTemplateWalker(fragment: DocumentFragment): TreeWalker;
|
|
225
316
|
}>;
|
|
226
317
|
|
|
227
318
|
// @public
|
|
228
|
-
export
|
|
319
|
+
export const elements: (selector?: string) => ElementsFilter;
|
|
229
320
|
|
|
230
321
|
// @public
|
|
231
322
|
export type ElementsFilter = (value: Node, index: number, array: Node[]) => boolean;
|
|
232
323
|
|
|
233
324
|
// @public
|
|
234
|
-
export
|
|
235
|
-
|
|
236
|
-
// @public
|
|
237
|
-
export abstract class ElementStyles {
|
|
325
|
+
export class ElementStyles {
|
|
326
|
+
constructor(styles: ReadonlyArray<ComposableStyles>);
|
|
238
327
|
// @internal (undocumented)
|
|
239
328
|
addStylesTo(target: StyleTarget): void;
|
|
240
|
-
|
|
241
|
-
abstract readonly behaviors: ReadonlyArray<Behavior> | null;
|
|
242
|
-
static readonly create: ElementStyleFactory;
|
|
329
|
+
readonly behaviors: ReadonlyArray<Behavior<HTMLElement>> | null;
|
|
243
330
|
// @internal (undocumented)
|
|
244
331
|
isAttachedTo(target: StyleTarget): boolean;
|
|
245
332
|
// @internal (undocumented)
|
|
246
333
|
removeStylesFrom(target: StyleTarget): void;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
334
|
+
static setDefaultStrategy(Strategy: ConstructibleStyleStrategy): void;
|
|
335
|
+
get strategy(): StyleStrategy;
|
|
336
|
+
// (undocumented)
|
|
337
|
+
readonly styles: ReadonlyArray<ComposableStyles>;
|
|
338
|
+
static readonly supportsAdoptedStyleSheets: boolean;
|
|
339
|
+
withBehaviors(...behaviors: Behavior<HTMLElement>[]): this;
|
|
340
|
+
withStrategy(Strategy: ConstructibleStyleStrategy): this;
|
|
250
341
|
}
|
|
251
342
|
|
|
252
343
|
// @public
|
|
253
|
-
export interface ElementView extends View {
|
|
344
|
+
export interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent, RootContext> {
|
|
254
345
|
appendTo(node: Node): void;
|
|
255
346
|
}
|
|
256
347
|
|
|
257
348
|
// @public
|
|
258
|
-
export interface ElementViewTemplate {
|
|
259
|
-
create(hostBindingTarget: Element): ElementView
|
|
260
|
-
render(source:
|
|
349
|
+
export interface ElementViewTemplate<TSource = any, TParent = any> {
|
|
350
|
+
create(hostBindingTarget: Element): ElementView<TSource, TParent>;
|
|
351
|
+
render(source: TSource, host: Node, hostBindingTarget?: Element): ElementView<TSource, TParent>;
|
|
352
|
+
// (undocumented)
|
|
353
|
+
type: "element";
|
|
261
354
|
}
|
|
262
355
|
|
|
263
|
-
//
|
|
264
|
-
//
|
|
265
|
-
// @internal
|
|
356
|
+
// @public
|
|
266
357
|
export const emptyArray: readonly never[];
|
|
267
358
|
|
|
268
359
|
// @public
|
|
269
|
-
export
|
|
360
|
+
export class EventBinding {
|
|
361
|
+
constructor(directive: HTMLBindingDirective);
|
|
362
|
+
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
363
|
+
createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
|
|
364
|
+
// (undocumented)
|
|
365
|
+
readonly directive: HTMLBindingDirective;
|
|
366
|
+
// @internal (undocumented)
|
|
367
|
+
handleEvent(event: Event): void;
|
|
368
|
+
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
369
|
+
}
|
|
270
370
|
|
|
271
371
|
// @public
|
|
272
|
-
export
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
length: number;
|
|
281
|
-
parent: TParent;
|
|
282
|
-
parentContext: ExecutionContext<TGrandparent>;
|
|
283
|
-
// @internal
|
|
284
|
-
static setEvent(event: Event | null): void;
|
|
285
|
-
}
|
|
372
|
+
export const ExecutionContext: Readonly<{
|
|
373
|
+
default: RootContext;
|
|
374
|
+
setEvent(event: Event | null): void;
|
|
375
|
+
create(): RootContext;
|
|
376
|
+
}>;
|
|
377
|
+
|
|
378
|
+
// @public
|
|
379
|
+
export type ExecutionContext<TParentSource = any> = RootContext | ChildContext<TParentSource> | ItemContext<TParentSource>;
|
|
286
380
|
|
|
287
381
|
// Warning: (ae-internal-missing-underscore) The name "FAST" should be prefixed with an underscore because the declaration is marked as @internal
|
|
288
382
|
//
|
|
@@ -290,10 +384,10 @@ export class ExecutionContext<TParent = any, TGrandparent = any> {
|
|
|
290
384
|
export const FAST: FASTGlobal;
|
|
291
385
|
|
|
292
386
|
// @public
|
|
293
|
-
export interface FASTElement {
|
|
387
|
+
export interface FASTElement extends HTMLElement {
|
|
294
388
|
$emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): boolean | void;
|
|
295
389
|
readonly $fastController: Controller;
|
|
296
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
390
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
297
391
|
connectedCallback(): void;
|
|
298
392
|
disconnectedCallback(): void;
|
|
299
393
|
}
|
|
@@ -304,17 +398,18 @@ export const FASTElement: (new () => HTMLElement & FASTElement) & {
|
|
|
304
398
|
new (): HTMLElement;
|
|
305
399
|
prototype: HTMLElement;
|
|
306
400
|
}>(BaseType: TBase): new () => InstanceType<TBase> & FASTElement;
|
|
307
|
-
define<TType extends
|
|
401
|
+
define<TType extends Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): TType;
|
|
308
402
|
};
|
|
309
403
|
|
|
310
404
|
// @public
|
|
311
|
-
export class FASTElementDefinition<TType extends
|
|
405
|
+
export class FASTElementDefinition<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> {
|
|
312
406
|
constructor(type: TType, nameOrConfig?: PartialFASTElementDefinition | string);
|
|
313
407
|
readonly attributeLookup: Record<string, AttributeDefinition>;
|
|
314
408
|
readonly attributes: ReadonlyArray<AttributeDefinition>;
|
|
315
409
|
define(registry?: CustomElementRegistry): this;
|
|
316
410
|
readonly elementOptions?: ElementDefinitionOptions;
|
|
317
|
-
static readonly
|
|
411
|
+
static readonly getByType: (key: Function) => FASTElementDefinition<Constructable<HTMLElement>> | undefined;
|
|
412
|
+
static readonly getForInstance: (object: any) => FASTElementDefinition<Constructable<HTMLElement>> | undefined;
|
|
318
413
|
get isDefined(): boolean;
|
|
319
414
|
readonly name: string;
|
|
320
415
|
readonly propertyLookup: Record<string, AttributeDefinition>;
|
|
@@ -328,69 +423,115 @@ export class FASTElementDefinition<TType extends Function = Function> {
|
|
|
328
423
|
//
|
|
329
424
|
// @internal
|
|
330
425
|
export interface FASTGlobal {
|
|
426
|
+
addMessages(messages: Record<number, string>): void;
|
|
427
|
+
error(code: number, ...args: any[]): Error;
|
|
331
428
|
getById<T>(id: string | number): T | null;
|
|
332
429
|
// (undocumented)
|
|
333
430
|
getById<T>(id: string | number, initialize: () => T): T;
|
|
334
431
|
readonly versions: string[];
|
|
432
|
+
warn(code: number, ...args: any[]): void;
|
|
335
433
|
}
|
|
336
434
|
|
|
337
435
|
// @public
|
|
338
|
-
export
|
|
339
|
-
trustedTypes: TrustedTypes;
|
|
340
|
-
readonly FAST: FASTGlobal;
|
|
341
|
-
};
|
|
436
|
+
export function html<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent, TContext>[]): ViewTemplate<TSource, TParent>;
|
|
342
437
|
|
|
343
438
|
// @public
|
|
344
|
-
export
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
export class HTMLBindingDirective extends TargetedHTMLDirective {
|
|
348
|
-
constructor(binding: Binding);
|
|
439
|
+
export class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, Aspected {
|
|
440
|
+
constructor(binding: Binding, mode: BindingMode, options: any);
|
|
441
|
+
aspectType: Aspect;
|
|
349
442
|
// (undocumented)
|
|
350
443
|
binding: Binding;
|
|
351
|
-
createBehavior(
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
444
|
+
createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
|
|
445
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
446
|
+
id: string;
|
|
447
|
+
// (undocumented)
|
|
448
|
+
mode: BindingMode;
|
|
449
|
+
nodeId: string;
|
|
450
|
+
// (undocumented)
|
|
451
|
+
options: any;
|
|
452
|
+
sourceAspect: string;
|
|
453
|
+
targetAspect: string;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// @public
|
|
457
|
+
export interface HTMLDirective {
|
|
458
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
459
|
+
}
|
|
356
460
|
|
|
357
461
|
// @public
|
|
358
|
-
export
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
462
|
+
export const HTMLDirective: Readonly<{
|
|
463
|
+
getForInstance: (object: any) => HTMLDirectiveDefinition<Constructable<HTMLDirective>> | undefined;
|
|
464
|
+
getByType: (key: Function) => HTMLDirectiveDefinition<Constructable<HTMLDirective>> | undefined;
|
|
465
|
+
define<TType extends Constructable<HTMLDirective>>(type: TType, options?: PartialHTMLDirectiveDefinition): TType;
|
|
466
|
+
}>;
|
|
467
|
+
|
|
468
|
+
// @public
|
|
469
|
+
export function htmlDirective(options?: PartialHTMLDirectiveDefinition): (type: Constructable<HTMLDirective>) => void;
|
|
470
|
+
|
|
471
|
+
// @public
|
|
472
|
+
export interface HTMLDirectiveDefinition<TType extends Constructable<HTMLDirective> = Constructable<HTMLDirective>> extends Required<PartialHTMLDirectiveDefinition> {
|
|
473
|
+
readonly type: TType;
|
|
362
474
|
}
|
|
363
475
|
|
|
364
476
|
// @public
|
|
365
|
-
export
|
|
366
|
-
|
|
477
|
+
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> {
|
|
478
|
+
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent, TContext>;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// @public
|
|
482
|
+
export class HTMLView<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent, TContext> {
|
|
483
|
+
constructor(fragment: DocumentFragment, factories: ReadonlyArray<ViewBehaviorFactory>, targets: ViewBehaviorTargets);
|
|
367
484
|
appendTo(node: Node): void;
|
|
368
|
-
bind(source:
|
|
369
|
-
context:
|
|
485
|
+
bind(source: TSource, context: TContext): void;
|
|
486
|
+
context: TContext | null;
|
|
370
487
|
dispose(): void;
|
|
371
488
|
static disposeContiguousBatch(views: SyntheticView[]): void;
|
|
372
489
|
firstChild: Node;
|
|
373
490
|
insertBefore(node: Node): void;
|
|
374
491
|
lastChild: Node;
|
|
375
492
|
remove(): void;
|
|
376
|
-
source:
|
|
493
|
+
source: TSource | null;
|
|
377
494
|
unbind(): void;
|
|
378
495
|
}
|
|
379
496
|
|
|
380
|
-
//
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
497
|
+
// @public
|
|
498
|
+
export const item: <TItem = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TItem, TParent, ItemContext<TParent>>[]) => ItemViewTemplate<TItem, TParent>;
|
|
499
|
+
|
|
500
|
+
// @public
|
|
501
|
+
export interface ItemContext<TParentSource = any> extends ChildContext<TParentSource> {
|
|
502
|
+
readonly index: number;
|
|
503
|
+
readonly isEven: boolean;
|
|
504
|
+
readonly isFirst: boolean;
|
|
505
|
+
readonly isInMiddle: boolean;
|
|
506
|
+
readonly isLast: boolean;
|
|
507
|
+
readonly isOdd: boolean;
|
|
508
|
+
readonly length: number;
|
|
509
|
+
updatePosition(index: number, length: number): void;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// @public
|
|
513
|
+
export interface ItemViewTemplate<TSource = any, TParent = any> {
|
|
514
|
+
create(): SyntheticView<TSource, TParent, ItemContext<TParent>>;
|
|
390
515
|
// (undocumented)
|
|
391
|
-
|
|
516
|
+
type: "item";
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
// @public
|
|
520
|
+
function length_2<T>(array: readonly T[]): number;
|
|
521
|
+
export { length_2 as length }
|
|
522
|
+
|
|
523
|
+
// @public
|
|
524
|
+
export interface LengthObserver extends Subscriber {
|
|
525
|
+
length: number;
|
|
392
526
|
}
|
|
393
527
|
|
|
528
|
+
// @public
|
|
529
|
+
export const Markup: Readonly<{
|
|
530
|
+
interpolation: (id: string) => string;
|
|
531
|
+
attribute: (id: string) => string;
|
|
532
|
+
comment: (id: string) => string;
|
|
533
|
+
}>;
|
|
534
|
+
|
|
394
535
|
// Warning: (ae-internal-missing-underscore) The name "Mutable" should be prefixed with an underscore because the declaration is marked as @internal
|
|
395
536
|
//
|
|
396
537
|
// @internal
|
|
@@ -398,22 +539,28 @@ export type Mutable<T> = {
|
|
|
398
539
|
-readonly [P in keyof T]: T[P];
|
|
399
540
|
};
|
|
400
541
|
|
|
401
|
-
// @public
|
|
402
|
-
export interface NodeBehaviorFactory {
|
|
403
|
-
createBehavior(target: Node): Behavior;
|
|
404
|
-
targetIndex: number;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
542
|
// @public
|
|
408
543
|
export interface NodeBehaviorOptions<T = any> {
|
|
409
544
|
filter?: ElementsFilter;
|
|
410
545
|
property: T;
|
|
411
546
|
}
|
|
412
547
|
|
|
548
|
+
// @public
|
|
549
|
+
export abstract class NodeObservationDirective<T extends NodeBehaviorOptions> extends StatelessAttachedAttributeDirective<T> {
|
|
550
|
+
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
551
|
+
protected computeNodes(target: any): Node[];
|
|
552
|
+
protected abstract disconnect(target: any): void;
|
|
553
|
+
protected abstract getNodes(target: any): Node[];
|
|
554
|
+
protected getSource(target: Node): any;
|
|
555
|
+
protected abstract observe(target: any): void;
|
|
556
|
+
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
557
|
+
protected updateTarget(source: any, value: ReadonlyArray<any>): void;
|
|
558
|
+
}
|
|
559
|
+
|
|
413
560
|
// @public
|
|
414
561
|
export interface Notifier {
|
|
415
562
|
notify(args: any): void;
|
|
416
|
-
readonly
|
|
563
|
+
readonly subject: any;
|
|
417
564
|
subscribe(subscriber: Subscriber, propertyToWatch?: any): void;
|
|
418
565
|
unsubscribe(subscriber: Subscriber, propertyToUnwatch?: any): void;
|
|
419
566
|
}
|
|
@@ -424,14 +571,14 @@ export const nullableNumberConverter: ValueConverter;
|
|
|
424
571
|
// @public
|
|
425
572
|
export const Observable: Readonly<{
|
|
426
573
|
setArrayObserverFactory(factory: (collection: any[]) => Notifier): void;
|
|
427
|
-
getNotifier: (source: any) =>
|
|
574
|
+
getNotifier: <T extends Notifier = Notifier>(source: any) => T;
|
|
428
575
|
track(source: unknown, propertyName: string): void;
|
|
429
576
|
trackVolatile(): void;
|
|
430
577
|
notify(source: unknown, args: any): void;
|
|
431
578
|
defineProperty(target: {}, nameOrAccessor: string | Accessor): void;
|
|
432
579
|
getAccessors: (target: {}) => Accessor[];
|
|
433
|
-
binding<TSource = any, TReturn = any
|
|
434
|
-
isVolatileBinding<TSource_1 = any, TReturn_1 = any
|
|
580
|
+
binding<TSource = any, TReturn = any>(binding: Binding<TSource, TReturn, ExecutionContext<any>>, initialSubscriber?: Subscriber, isVolatileBinding?: boolean): BindingObserver<TSource, TReturn, any>;
|
|
581
|
+
isVolatileBinding<TSource_1 = any, TReturn_1 = any>(binding: Binding<TSource_1, TReturn_1, ExecutionContext<any>>): boolean;
|
|
435
582
|
}>;
|
|
436
583
|
|
|
437
584
|
// @public
|
|
@@ -443,6 +590,22 @@ export interface ObservationRecord {
|
|
|
443
590
|
propertySource: any;
|
|
444
591
|
}
|
|
445
592
|
|
|
593
|
+
// @public
|
|
594
|
+
export const onChange: BindingConfig<AddEventListenerOptions> & BindingConfigResolver<AddEventListenerOptions>;
|
|
595
|
+
|
|
596
|
+
// @public
|
|
597
|
+
export const oneTime: BindingConfig<AddEventListenerOptions> & BindingConfigResolver<AddEventListenerOptions>;
|
|
598
|
+
|
|
599
|
+
// @public
|
|
600
|
+
export class OneTimeBinding extends UpdateBinding {
|
|
601
|
+
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// @public
|
|
605
|
+
export const Parser: Readonly<{
|
|
606
|
+
parse(value: string, factories: Record<string, ViewBehaviorFactory>): (string | ViewBehaviorFactory)[] | null;
|
|
607
|
+
}>;
|
|
608
|
+
|
|
446
609
|
// @public
|
|
447
610
|
export interface PartialFASTElementDefinition {
|
|
448
611
|
readonly attributes?: (AttributeConfiguration | string)[];
|
|
@@ -453,43 +616,88 @@ export interface PartialFASTElementDefinition {
|
|
|
453
616
|
readonly template?: ElementViewTemplate;
|
|
454
617
|
}
|
|
455
618
|
|
|
619
|
+
// @public
|
|
620
|
+
export interface PartialHTMLDirectiveDefinition {
|
|
621
|
+
aspected?: boolean;
|
|
622
|
+
}
|
|
623
|
+
|
|
456
624
|
// @public
|
|
457
625
|
export class PropertyChangeNotifier implements Notifier {
|
|
458
|
-
constructor(
|
|
626
|
+
constructor(subject: any);
|
|
459
627
|
notify(propertyName: string): void;
|
|
460
|
-
readonly
|
|
628
|
+
readonly subject: any;
|
|
461
629
|
subscribe(subscriber: Subscriber, propertyToWatch?: string): void;
|
|
462
630
|
unsubscribe(subscriber: Subscriber, propertyToUnwatch?: string): void;
|
|
463
631
|
}
|
|
464
632
|
|
|
465
633
|
// @public
|
|
466
|
-
export
|
|
634
|
+
export const ref: <T = any>(propertyName: keyof T & string) => CaptureType<T>;
|
|
467
635
|
|
|
468
636
|
// @public
|
|
469
|
-
export class
|
|
470
|
-
|
|
471
|
-
bind(source: any): void;
|
|
637
|
+
export class RefDirective extends StatelessAttachedAttributeDirective<string> {
|
|
638
|
+
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
472
639
|
unbind(): void;
|
|
473
640
|
}
|
|
474
641
|
|
|
475
642
|
// @public
|
|
476
|
-
export function repeat<TSource = any,
|
|
643
|
+
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ViewTemplate | Binding<TSource, ViewTemplate, RootContext>, options?: {
|
|
644
|
+
positioning: false;
|
|
645
|
+
} | {
|
|
646
|
+
recycle: true;
|
|
647
|
+
} | {
|
|
648
|
+
positioning: false;
|
|
649
|
+
recycle: false;
|
|
650
|
+
} | {
|
|
651
|
+
positioning: false;
|
|
652
|
+
recycle: true;
|
|
653
|
+
}): CaptureType<TSource>;
|
|
654
|
+
|
|
655
|
+
// @public
|
|
656
|
+
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ChildViewTemplate | Binding<TSource, ChildViewTemplate, ChildContext>, options?: {
|
|
657
|
+
positioning: false;
|
|
658
|
+
} | {
|
|
659
|
+
recycle: true;
|
|
660
|
+
} | {
|
|
661
|
+
positioning: false;
|
|
662
|
+
recycle: false;
|
|
663
|
+
} | {
|
|
664
|
+
positioning: false;
|
|
665
|
+
recycle: true;
|
|
666
|
+
}): CaptureType<TSource>;
|
|
667
|
+
|
|
668
|
+
// @public
|
|
669
|
+
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ItemViewTemplate | Binding<TSource, ItemViewTemplate, ItemContext>, options: {
|
|
670
|
+
positioning: true;
|
|
671
|
+
} | {
|
|
672
|
+
positioning: true;
|
|
673
|
+
recycle: true;
|
|
674
|
+
} | {
|
|
675
|
+
positioning: true;
|
|
676
|
+
recycle: false;
|
|
677
|
+
}): CaptureType<TSource>;
|
|
477
678
|
|
|
478
679
|
// @public
|
|
479
680
|
export class RepeatBehavior<TSource = any> implements Behavior, Subscriber {
|
|
480
681
|
constructor(location: Node, itemsBinding: Binding<TSource, any[]>, isItemsBindingVolatile: boolean, templateBinding: Binding<TSource, SyntheticViewTemplate>, isTemplateBindingVolatile: boolean, options: RepeatOptions);
|
|
481
682
|
bind(source: TSource, context: ExecutionContext): void;
|
|
482
|
-
// @internal (undocumented)
|
|
483
683
|
handleChange(source: any, args: Splice[]): void;
|
|
484
684
|
unbind(): void;
|
|
485
|
-
|
|
685
|
+
}
|
|
486
686
|
|
|
487
687
|
// @public
|
|
488
|
-
export class RepeatDirective<TSource = any>
|
|
688
|
+
export class RepeatDirective<TSource = any> implements HTMLDirective, ViewBehaviorFactory {
|
|
489
689
|
constructor(itemsBinding: Binding, templateBinding: Binding<TSource, SyntheticViewTemplate>, options: RepeatOptions);
|
|
490
|
-
createBehavior(
|
|
491
|
-
|
|
492
|
-
|
|
690
|
+
createBehavior(targets: ViewBehaviorTargets): RepeatBehavior<TSource>;
|
|
691
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
692
|
+
id: string;
|
|
693
|
+
// (undocumented)
|
|
694
|
+
readonly itemsBinding: Binding;
|
|
695
|
+
nodeId: string;
|
|
696
|
+
// (undocumented)
|
|
697
|
+
readonly options: RepeatOptions;
|
|
698
|
+
// (undocumented)
|
|
699
|
+
readonly templateBinding: Binding<TSource, SyntheticViewTemplate>;
|
|
700
|
+
}
|
|
493
701
|
|
|
494
702
|
// @public
|
|
495
703
|
export interface RepeatOptions {
|
|
@@ -498,61 +706,131 @@ export interface RepeatOptions {
|
|
|
498
706
|
}
|
|
499
707
|
|
|
500
708
|
// @public
|
|
501
|
-
export
|
|
709
|
+
export interface RootContext {
|
|
710
|
+
createChildContext<TParentSource>(source: TParentSource): ChildContext<TParentSource>;
|
|
711
|
+
readonly event: Event;
|
|
712
|
+
eventDetail<TDetail = any>(): TDetail;
|
|
713
|
+
eventTarget<TTarget extends EventTarget = EventTarget>(): TTarget;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
// @public
|
|
717
|
+
export const signal: <T = any>(options: string | Binding<T, any, ExecutionContext<any>>) => BindingConfig<string | Binding<T, any, ExecutionContext<any>>>;
|
|
502
718
|
|
|
503
719
|
// @public
|
|
504
|
-
export class
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
observe(): void;
|
|
720
|
+
export class SignalBinding extends UpdateBinding {
|
|
721
|
+
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
722
|
+
static send(signal: string): void;
|
|
723
|
+
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
509
724
|
}
|
|
510
725
|
|
|
511
726
|
// @public
|
|
512
|
-
export
|
|
727
|
+
export function slotted<T = any>(propertyOrOptions: (keyof T & string) | SlottedDirectiveOptions<keyof T & string>): CaptureType<T>;
|
|
728
|
+
|
|
729
|
+
// @public
|
|
730
|
+
export class SlottedDirective extends NodeObservationDirective<SlottedDirectiveOptions> {
|
|
731
|
+
disconnect(target: EventSource): void;
|
|
732
|
+
getNodes(target: HTMLSlotElement): Node[];
|
|
733
|
+
// @internal (undocumented)
|
|
734
|
+
handleEvent(event: Event): void;
|
|
735
|
+
observe(target: EventSource): void;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
// @public
|
|
739
|
+
export interface SlottedDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, AssignedNodesOptions {
|
|
513
740
|
}
|
|
514
741
|
|
|
515
742
|
// @public
|
|
516
|
-
export
|
|
743
|
+
export class Splice {
|
|
744
|
+
constructor(index: number, removed: any[], addedCount: number);
|
|
745
|
+
// (undocumented)
|
|
517
746
|
addedCount: number;
|
|
747
|
+
adjustTo(array: any[]): this;
|
|
748
|
+
// (undocumented)
|
|
518
749
|
index: number;
|
|
750
|
+
// (undocumented)
|
|
519
751
|
removed: any[];
|
|
752
|
+
reset?: boolean;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
// @public
|
|
756
|
+
export interface SpliceStrategy {
|
|
757
|
+
normalize(previous: unknown[] | undefined, current: unknown[], changes: Splice[] | undefined): readonly Splice[];
|
|
758
|
+
pop(array: any[], observer: ArrayObserver, pop: typeof Array.prototype.pop, args: any[]): any;
|
|
759
|
+
push(array: any[], observer: ArrayObserver, push: typeof Array.prototype.push, args: any[]): any;
|
|
760
|
+
reverse(array: any[], observer: ArrayObserver, reverse: typeof Array.prototype.reverse, args: any[]): any;
|
|
761
|
+
shift(array: any[], observer: ArrayObserver, shift: typeof Array.prototype.shift, args: any[]): any;
|
|
762
|
+
sort(array: any[], observer: ArrayObserver, sort: typeof Array.prototype.sort, args: any[]): any[];
|
|
763
|
+
splice(array: any[], observer: ArrayObserver, splice: typeof Array.prototype.splice, args: any[]): any;
|
|
764
|
+
readonly support: SpliceStrategySupport;
|
|
765
|
+
unshift(array: any[], observer: ArrayObserver, unshift: typeof Array.prototype.unshift, args: any[]): any[];
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// @public
|
|
769
|
+
export const SpliceStrategy: Readonly<{
|
|
770
|
+
readonly reset: Splice[];
|
|
771
|
+
readonly setDefaultStrategy: (strategy: SpliceStrategy) => void;
|
|
772
|
+
}>;
|
|
773
|
+
|
|
774
|
+
// @public
|
|
775
|
+
export const SpliceStrategySupport: Readonly<{
|
|
776
|
+
readonly reset: 1;
|
|
777
|
+
readonly splice: 2;
|
|
778
|
+
readonly optimized: 3;
|
|
779
|
+
}>;
|
|
780
|
+
|
|
781
|
+
// @public
|
|
782
|
+
export type SpliceStrategySupport = typeof SpliceStrategySupport[keyof typeof SpliceStrategySupport];
|
|
783
|
+
|
|
784
|
+
// @public
|
|
785
|
+
export abstract class StatelessAttachedAttributeDirective<T> implements HTMLDirective, ViewBehaviorFactory, ViewBehavior {
|
|
786
|
+
constructor(options: T);
|
|
787
|
+
abstract bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
788
|
+
createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
|
|
789
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
790
|
+
id: string;
|
|
791
|
+
nodeId: string;
|
|
792
|
+
// (undocumented)
|
|
793
|
+
protected options: T;
|
|
794
|
+
abstract unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
// @public
|
|
798
|
+
export interface StyleStrategy {
|
|
799
|
+
addStylesTo(target: StyleTarget): void;
|
|
800
|
+
removeStylesFrom(target: StyleTarget): void;
|
|
520
801
|
}
|
|
521
802
|
|
|
522
803
|
// @public
|
|
523
804
|
export interface StyleTarget {
|
|
524
805
|
adoptedStyleSheets?: CSSStyleSheet[];
|
|
525
806
|
append(styles: HTMLStyleElement): void;
|
|
526
|
-
// @deprecated
|
|
527
|
-
prepend(styles: HTMLStyleElement): void;
|
|
528
807
|
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
|
|
529
808
|
removeChild(styles: HTMLStyleElement): void;
|
|
530
809
|
}
|
|
531
810
|
|
|
532
811
|
// @public
|
|
533
812
|
export interface Subscriber {
|
|
534
|
-
handleChange(
|
|
813
|
+
handleChange(subject: any, args: any): void;
|
|
535
814
|
}
|
|
536
815
|
|
|
537
816
|
// @public
|
|
538
817
|
export class SubscriberSet implements Notifier {
|
|
539
|
-
constructor(
|
|
818
|
+
constructor(subject: any, initialSubscriber?: Subscriber);
|
|
540
819
|
has(subscriber: Subscriber): boolean;
|
|
541
820
|
notify(args: any): void;
|
|
542
|
-
readonly
|
|
821
|
+
readonly subject: any;
|
|
543
822
|
subscribe(subscriber: Subscriber): void;
|
|
544
823
|
unsubscribe(subscriber: Subscriber): void;
|
|
545
824
|
}
|
|
546
825
|
|
|
547
826
|
// @public
|
|
548
|
-
export interface
|
|
827
|
+
export interface SubtreeDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, Omit<MutationObserverInit, "subtree" | "childList"> {
|
|
549
828
|
selector: string;
|
|
550
829
|
subtree: boolean;
|
|
551
830
|
}
|
|
552
831
|
|
|
553
832
|
// @public
|
|
554
|
-
export interface SyntheticView extends View {
|
|
555
|
-
dispose(): void;
|
|
833
|
+
export interface SyntheticView<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> extends View<TSource, TParent, TContext> {
|
|
556
834
|
readonly firstChild: Node;
|
|
557
835
|
insertBefore(node: Node): void;
|
|
558
836
|
readonly lastChild: Node;
|
|
@@ -560,18 +838,14 @@ export interface SyntheticView extends View {
|
|
|
560
838
|
}
|
|
561
839
|
|
|
562
840
|
// @public
|
|
563
|
-
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;
|
|
841
|
+
export interface SyntheticViewTemplate<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> {
|
|
842
|
+
create(): SyntheticView<TSource, TParent, TContext>;
|
|
843
|
+
// (undocumented)
|
|
844
|
+
type: "synthetic";
|
|
571
845
|
}
|
|
572
846
|
|
|
573
847
|
// @public
|
|
574
|
-
export type TemplateValue<
|
|
848
|
+
export type TemplateValue<TSource, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> = Binding<TSource, any, TContext> | HTMLDirective | CaptureType<TSource>;
|
|
575
849
|
|
|
576
850
|
// @public
|
|
577
851
|
export type TrustedTypes = {
|
|
@@ -583,6 +857,74 @@ export type TrustedTypesPolicy = {
|
|
|
583
857
|
createHTML(html: string): string;
|
|
584
858
|
};
|
|
585
859
|
|
|
860
|
+
// @public
|
|
861
|
+
export const twoWay: BindingConfig<DefaultTwoWayBindingOptions> & BindingConfigResolver<DefaultTwoWayBindingOptions>;
|
|
862
|
+
|
|
863
|
+
// @public
|
|
864
|
+
export class TwoWayBinding extends ChangeBinding {
|
|
865
|
+
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
866
|
+
static configure(settings: TwoWaySettings): void;
|
|
867
|
+
// @internal (undocumented)
|
|
868
|
+
handleEvent(event: Event): void;
|
|
869
|
+
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
// @public
|
|
873
|
+
export interface TwoWaySettings {
|
|
874
|
+
determineChangeEvent(directive: HTMLBindingDirective, target: HTMLElement): string;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
// Warning: (ae-internal-missing-underscore) The name "TypeDefinition" should be prefixed with an underscore because the declaration is marked as @internal
|
|
878
|
+
//
|
|
879
|
+
// @internal
|
|
880
|
+
export interface TypeDefinition {
|
|
881
|
+
// (undocumented)
|
|
882
|
+
type: Function;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
// Warning: (ae-internal-missing-underscore) The name "TypeRegistry" should be prefixed with an underscore because the declaration is marked as @internal
|
|
886
|
+
//
|
|
887
|
+
// @internal
|
|
888
|
+
export interface TypeRegistry<TDefinition extends TypeDefinition> {
|
|
889
|
+
// (undocumented)
|
|
890
|
+
getByType(key: Function): TDefinition | undefined;
|
|
891
|
+
// (undocumented)
|
|
892
|
+
getForInstance(object: any): TDefinition | undefined;
|
|
893
|
+
// (undocumented)
|
|
894
|
+
register(definition: TDefinition): boolean;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
// @public
|
|
898
|
+
export class UpdateBinding implements ViewBehavior {
|
|
899
|
+
constructor(directive: HTMLBindingDirective, updateTarget: UpdateTarget);
|
|
900
|
+
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
901
|
+
createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
|
|
902
|
+
// (undocumented)
|
|
903
|
+
readonly directive: HTMLBindingDirective;
|
|
904
|
+
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
905
|
+
// (undocumented)
|
|
906
|
+
protected updateTarget: UpdateTarget;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
// @public
|
|
910
|
+
export interface UpdateQueue {
|
|
911
|
+
enqueue(callable: Callable): void;
|
|
912
|
+
next(): Promise<void>;
|
|
913
|
+
process(): void;
|
|
914
|
+
setMode(isAsync: boolean): void;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
// @public
|
|
918
|
+
export const Updates: UpdateQueue;
|
|
919
|
+
|
|
920
|
+
// @public
|
|
921
|
+
export type UpdateTarget = (this: UpdateTargetThis, target: Node, aspect: string, value: any, source: any, context: ExecutionContext) => void;
|
|
922
|
+
|
|
923
|
+
// @public
|
|
924
|
+
export interface UpdateTargetThis {
|
|
925
|
+
directive: HTMLBindingDirective;
|
|
926
|
+
}
|
|
927
|
+
|
|
586
928
|
// @public
|
|
587
929
|
export interface ValueConverter {
|
|
588
930
|
fromView(value: any): any;
|
|
@@ -590,22 +932,40 @@ export interface ValueConverter {
|
|
|
590
932
|
}
|
|
591
933
|
|
|
592
934
|
// @public
|
|
593
|
-
export interface View {
|
|
594
|
-
bind(source:
|
|
595
|
-
readonly context:
|
|
596
|
-
|
|
597
|
-
readonly source: any | null;
|
|
935
|
+
export interface View<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> extends Disposable {
|
|
936
|
+
bind(source: TSource, context: TContext): void;
|
|
937
|
+
readonly context: TContext | null;
|
|
938
|
+
readonly source: TSource | null;
|
|
598
939
|
unbind(): void;
|
|
599
940
|
}
|
|
600
941
|
|
|
601
942
|
// @public
|
|
602
|
-
export
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
943
|
+
export interface ViewBehavior<TSource = any, TParent = any> {
|
|
944
|
+
bind(source: TSource, context: ExecutionContext<TParent>, targets: ViewBehaviorTargets): void;
|
|
945
|
+
unbind(source: TSource, context: ExecutionContext<TParent>, targets: ViewBehaviorTargets): void;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
// @public
|
|
949
|
+
export interface ViewBehaviorFactory {
|
|
950
|
+
createBehavior(targets: ViewBehaviorTargets): Behavior | ViewBehavior;
|
|
951
|
+
id: string;
|
|
952
|
+
nodeId: string;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
// @public
|
|
956
|
+
export type ViewBehaviorTargets = {
|
|
957
|
+
[id: string]: Node;
|
|
958
|
+
};
|
|
959
|
+
|
|
960
|
+
// @public
|
|
961
|
+
export class ViewTemplate<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext> implements ElementViewTemplate<TSource, TParent>, SyntheticViewTemplate<TSource, TParent, TContext> {
|
|
962
|
+
constructor(html: string | HTMLTemplateElement, factories: Record<string, ViewBehaviorFactory>);
|
|
963
|
+
create(hostBindingTarget?: Element): HTMLView<TSource, TParent, TContext>;
|
|
964
|
+
readonly factories: Record<string, ViewBehaviorFactory>;
|
|
606
965
|
readonly html: string | HTMLTemplateElement;
|
|
607
|
-
render(source: TSource, host: Node
|
|
608
|
-
|
|
966
|
+
render(source: TSource, host: Node, hostBindingTarget?: Element, context?: TContext): HTMLView<TSource, TParent, TContext>;
|
|
967
|
+
type: any;
|
|
968
|
+
}
|
|
609
969
|
|
|
610
970
|
// @public
|
|
611
971
|
export function volatile(target: {}, name: string | Accessor, descriptor: PropertyDescriptor): PropertyDescriptor;
|
|
@@ -613,7 +973,6 @@ export function volatile(target: {}, name: string | Accessor, descriptor: Proper
|
|
|
613
973
|
// @public
|
|
614
974
|
export function when<TSource = any, TReturn = any>(binding: Binding<TSource, TReturn>, templateOrTemplateBinding: SyntheticViewTemplate | Binding<TSource, SyntheticViewTemplate>): CaptureType<TSource>;
|
|
615
975
|
|
|
616
|
-
|
|
617
976
|
// (No @packageDocumentation comment for this package)
|
|
618
977
|
|
|
619
978
|
```
|