@microsoft/fast-element 2.0.0-beta.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +1 -1
- package/CHANGELOG.json +512 -0
- package/CHANGELOG.md +180 -1
- package/README.md +1 -9
- package/api-extractor.context.json +14 -0
- package/api-extractor.di.json +14 -0
- package/dist/context/context.api.json +1068 -0
- package/dist/di/di.api.json +4929 -0
- package/dist/dts/binding/binding.d.ts +49 -0
- package/dist/dts/binding/normalize.d.ts +9 -0
- package/dist/dts/binding/one-time.d.ts +11 -0
- package/dist/dts/binding/one-way.d.ts +20 -0
- package/dist/dts/{templating/binding-signal.d.ts → binding/signal.d.ts} +19 -4
- package/dist/dts/{templating/binding-two-way.d.ts → binding/two-way.d.ts} +9 -5
- package/dist/dts/components/attributes.d.ts +6 -0
- package/dist/dts/components/element-controller.d.ts +104 -8
- package/dist/dts/components/element-hydration.d.ts +2 -0
- package/dist/dts/components/fast-definitions.d.ts +6 -0
- package/dist/dts/components/hydration.d.ts +56 -0
- package/dist/dts/components/install-hydration.d.ts +1 -0
- package/dist/dts/context.d.ts +29 -15
- package/dist/dts/di/di.d.ts +0 -5
- package/dist/dts/dom-policy.d.ts +83 -0
- package/dist/dts/dom.d.ts +100 -0
- package/dist/dts/hydration/target-builder.d.ts +63 -0
- package/dist/dts/index.d.ts +33 -26
- package/dist/dts/index.rollup.d.ts +0 -1
- package/dist/dts/index.rollup.debug.d.ts +0 -1
- package/dist/dts/interfaces.d.ts +32 -82
- package/dist/dts/metadata.d.ts +6 -5
- package/dist/dts/observation/arrays.d.ts +1 -1
- package/dist/dts/observation/observable.bench.d.ts +18 -0
- package/dist/dts/observation/observable.d.ts +5 -5
- package/dist/dts/pending-task.d.ts +19 -7
- package/dist/dts/platform.d.ts +11 -2
- package/dist/dts/polyfills.d.ts +0 -8
- package/dist/dts/styles/css-binding-directive.d.ts +60 -0
- package/dist/dts/styles/css.d.ts +9 -7
- package/dist/dts/styles/element-styles.d.ts +1 -14
- package/dist/dts/styles/host.d.ts +2 -5
- package/dist/dts/styles/style-strategy.d.ts +42 -0
- package/dist/dts/templating/compiler.d.ts +11 -13
- package/dist/dts/templating/{binding.d.ts → html-binding-directive.d.ts} +22 -42
- package/dist/dts/templating/html-directive.d.ts +44 -140
- package/dist/dts/templating/install-hydratable-view-templates.d.ts +1 -0
- package/dist/dts/templating/node-observation.d.ts +11 -1
- package/dist/dts/templating/ref.d.ts +4 -0
- package/dist/dts/templating/render.bench.d.ts +3 -0
- package/dist/dts/templating/render.d.ts +49 -9
- package/dist/dts/templating/repeat-basic-reverse.bench.d.ts +3 -0
- package/dist/dts/templating/repeat-basic-shift.bench.d.ts +3 -0
- package/dist/dts/templating/repeat.d.ts +31 -9
- package/dist/dts/templating/template.d.ts +97 -12
- package/dist/dts/templating/view.d.ts +149 -26
- package/dist/dts/templating/when-basic.bench.d.ts +3 -0
- package/dist/dts/templating/when-conditional.bench.d.ts +3 -0
- package/dist/dts/templating/when-switch.bench.d.ts +3 -0
- package/dist/dts/templating/when.d.ts +3 -1
- package/dist/dts/testing/fakes.d.ts +12 -1
- package/dist/dts/tsdoc-metadata.json +1 -1
- package/dist/dts/utilities.d.ts +55 -1
- package/dist/esm/binding/binding.js +18 -0
- package/dist/esm/binding/normalize.js +17 -0
- package/dist/esm/binding/one-time.js +21 -0
- package/dist/esm/binding/one-way.js +30 -0
- package/dist/esm/{templating/binding-signal.js → binding/signal.js} +22 -6
- package/dist/esm/{templating/binding-two-way.js → binding/two-way.js} +18 -12
- package/dist/esm/components/attributes.js +16 -1
- package/dist/esm/components/element-controller.js +319 -49
- package/dist/esm/components/element-hydration.js +2 -0
- package/dist/esm/components/fast-definitions.js +12 -4
- package/dist/esm/components/fast-element.js +3 -1
- package/dist/esm/components/hydration.js +104 -0
- package/dist/esm/components/install-hydration.js +3 -0
- package/dist/esm/context.js +26 -4
- package/dist/esm/debug.js +8 -2
- package/dist/esm/di/di.js +9 -12
- package/dist/esm/dom-policy.js +345 -0
- package/dist/esm/dom.js +101 -0
- package/dist/esm/hydration/target-builder.js +175 -0
- package/dist/esm/index.js +34 -25
- package/dist/esm/index.rollup.debug.js +3 -1
- package/dist/esm/index.rollup.js +3 -1
- package/dist/esm/interfaces.js +51 -3
- package/dist/esm/metadata.js +11 -8
- package/dist/esm/observation/arrays.js +1 -1
- package/dist/esm/observation/observable.bench.js +79 -0
- package/dist/esm/observation/observable.js +20 -15
- package/dist/esm/observation/update-queue.js +2 -2
- package/dist/esm/pending-task.js +13 -1
- package/dist/esm/platform.js +12 -2
- package/dist/esm/polyfills.js +3 -61
- package/dist/esm/styles/css-binding-directive.js +76 -0
- package/dist/esm/styles/css.js +14 -7
- package/dist/esm/styles/element-styles.js +0 -33
- package/dist/esm/styles/style-strategy.js +1 -0
- package/dist/esm/templating/children.js +8 -4
- package/dist/esm/templating/compiler.js +37 -44
- package/dist/esm/templating/html-binding-directive.js +218 -0
- package/dist/esm/templating/html-directive.js +25 -152
- package/dist/esm/templating/install-hydratable-view-templates.js +17 -0
- package/dist/esm/templating/node-observation.js +14 -8
- package/dist/esm/templating/ref.js +1 -1
- package/dist/esm/templating/render.bench.js +56 -0
- package/dist/esm/templating/render.js +74 -30
- package/dist/esm/templating/repeat-basic-reverse.bench.js +43 -0
- package/dist/esm/templating/repeat-basic-shift.bench.js +43 -0
- package/dist/esm/templating/repeat.js +116 -17
- package/dist/esm/templating/template.js +135 -60
- package/dist/esm/templating/view.js +259 -32
- package/dist/esm/templating/when-basic.bench.js +36 -0
- package/dist/esm/templating/when-conditional.bench.js +39 -0
- package/dist/esm/templating/when-switch.bench.js +68 -0
- package/dist/esm/templating/when.js +12 -5
- package/dist/esm/testing/fakes.js +32 -1
- package/dist/esm/testing/fixture.js +1 -1
- package/dist/esm/utilities.js +97 -1
- package/dist/fast-element.api.json +9804 -5622
- package/dist/fast-element.d.ts +813 -2386
- package/dist/fast-element.debug.js +2797 -974
- package/dist/fast-element.debug.min.js +3 -1
- package/dist/fast-element.js +2642 -825
- package/dist/fast-element.min.js +3 -1
- package/dist/fast-element.untrimmed.d.ts +669 -315
- package/docs/{api-report.md → api-report.api.md} +243 -158
- package/docs/context/api-report.api.md +69 -0
- package/docs/di/api-report.api.md +315 -0
- package/karma.conf.cjs +2 -1
- package/package.json +59 -47
- package/scripts/run-api-extractor.js +51 -0
- package/scripts/run-benchmarks.js +46 -0
- package/tensile.config.js +12 -0
- package/dist/dts/templating/dom.d.ts +0 -41
- package/dist/esm/templating/binding.js +0 -282
- package/dist/esm/templating/dom.js +0 -49
- package/docs/guide/declaring-templates.md +0 -230
- package/docs/guide/defining-elements.md +0 -214
- package/docs/guide/leveraging-css.md +0 -253
- package/docs/guide/next-steps.md +0 -13
- package/docs/guide/observables-and-state.md +0 -213
- package/docs/guide/using-directives.md +0 -576
- package/docs/guide/working-with-shadow-dom.md +0 -296
|
@@ -17,19 +17,6 @@ export type AddBehavior = (behavior: HostBehavior<HTMLElement>) => void;
|
|
|
17
17
|
// @public
|
|
18
18
|
export type AddViewBehaviorFactory = (factory: ViewBehaviorFactory) => string;
|
|
19
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
20
|
// @public
|
|
34
21
|
export interface ArrayObserver extends SubscriberSet {
|
|
35
22
|
addSplice(splice: Splice): void;
|
|
@@ -44,24 +31,9 @@ export const ArrayObserver: Readonly<{
|
|
|
44
31
|
readonly enable: () => void;
|
|
45
32
|
}>;
|
|
46
33
|
|
|
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">];
|
|
61
|
-
|
|
62
34
|
// @public
|
|
63
35
|
export interface Aspected {
|
|
64
|
-
aspectType:
|
|
36
|
+
aspectType: DOMAspect;
|
|
65
37
|
dataBinding?: Binding;
|
|
66
38
|
sourceAspect: string;
|
|
67
39
|
targetAspect: string;
|
|
@@ -108,18 +80,24 @@ export class AttributeDefinition implements Accessor {
|
|
|
108
80
|
// @public
|
|
109
81
|
export type AttributeMode = typeof reflectMode | typeof booleanMode | "fromView";
|
|
110
82
|
|
|
111
|
-
// @public
|
|
112
|
-
export function bind<T = any>(binding: Expression<T>, isVolatile?: boolean): Binding<T>;
|
|
113
|
-
|
|
114
83
|
// @public
|
|
115
84
|
export abstract class Binding<TSource = any, TReturn = any, TParent = any> {
|
|
116
|
-
constructor(evaluate: Expression<TSource, TReturn, TParent>, isVolatile?: boolean);
|
|
117
|
-
abstract createObserver(
|
|
85
|
+
constructor(evaluate: Expression<TSource, TReturn, TParent>, policy?: DOMPolicy | undefined, isVolatile?: boolean);
|
|
86
|
+
abstract createObserver(subscriber: Subscriber, directive: BindingDirective): ExpressionObserver<TSource, TReturn, TParent>;
|
|
118
87
|
// (undocumented)
|
|
119
88
|
evaluate: Expression<TSource, TReturn, TParent>;
|
|
120
89
|
// (undocumented)
|
|
121
90
|
isVolatile: boolean;
|
|
122
91
|
options?: any;
|
|
92
|
+
// (undocumented)
|
|
93
|
+
policy?: DOMPolicy | undefined;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// @public
|
|
97
|
+
export interface BindingDirective {
|
|
98
|
+
readonly aspectType?: DOMAspect;
|
|
99
|
+
readonly dataBinding: Binding;
|
|
100
|
+
readonly targetAspect?: string;
|
|
123
101
|
}
|
|
124
102
|
|
|
125
103
|
// @public
|
|
@@ -152,17 +130,25 @@ export class ChildrenDirective extends NodeObservationDirective<ChildrenDirectiv
|
|
|
152
130
|
// @public
|
|
153
131
|
export type ChildrenDirectiveOptions<T = any> = ChildListDirectiveOptions<T> | SubtreeDirectiveOptions<T>;
|
|
154
132
|
|
|
133
|
+
// @public
|
|
134
|
+
export type Class<T, C = {}> = C & Constructable<T> & {
|
|
135
|
+
readonly prototype: T;
|
|
136
|
+
};
|
|
137
|
+
|
|
155
138
|
// @public
|
|
156
139
|
export type CompilationStrategy = (
|
|
157
140
|
html: string | HTMLTemplateElement,
|
|
158
|
-
factories: Record<string, ViewBehaviorFactory
|
|
141
|
+
factories: Record<string, ViewBehaviorFactory>,
|
|
142
|
+
policy: DOMPolicy) => HTMLTemplateCompilationResult;
|
|
143
|
+
|
|
144
|
+
// @public
|
|
145
|
+
export type CompiledViewBehaviorFactory = Required<ViewBehaviorFactory>;
|
|
159
146
|
|
|
160
147
|
// @public
|
|
161
148
|
export const Compiler: {
|
|
162
|
-
|
|
163
|
-
compile<TSource = any, TParent = any>(html: string | HTMLTemplateElement, directives: Record<string, ViewBehaviorFactory>): HTMLTemplateCompilationResult<TSource, TParent>;
|
|
149
|
+
compile<TSource = any, TParent = any>(html: string | HTMLTemplateElement, factories: Record<string, ViewBehaviorFactory>, policy?: DOMPolicy): HTMLTemplateCompilationResult<TSource, TParent>;
|
|
164
150
|
setDefaultStrategy(strategy: CompilationStrategy): void;
|
|
165
|
-
aggregate(parts: (string | ViewBehaviorFactory)[]): ViewBehaviorFactory;
|
|
151
|
+
aggregate(parts: (string | ViewBehaviorFactory)[], policy?: DOMPolicy): ViewBehaviorFactory;
|
|
166
152
|
};
|
|
167
153
|
|
|
168
154
|
// @public
|
|
@@ -185,7 +171,7 @@ export interface ContentTemplate {
|
|
|
185
171
|
|
|
186
172
|
// @public
|
|
187
173
|
export interface ContentView {
|
|
188
|
-
bind(source: any): void;
|
|
174
|
+
bind(source: any, context?: ExecutionContext): void;
|
|
189
175
|
// (undocumented)
|
|
190
176
|
readonly context: ExecutionContext;
|
|
191
177
|
insertBefore(node: Node): void;
|
|
@@ -193,19 +179,30 @@ export interface ContentView {
|
|
|
193
179
|
unbind(): void;
|
|
194
180
|
}
|
|
195
181
|
|
|
196
|
-
// Warning: (ae-internal-missing-underscore) The name "createMetadataLocator" should be prefixed with an underscore because the declaration is marked as @internal
|
|
197
|
-
//
|
|
198
|
-
// @internal
|
|
199
|
-
export function createMetadataLocator<TMetadata>(): (target: {}) => TMetadata[];
|
|
200
|
-
|
|
201
|
-
// Warning: (ae-internal-missing-underscore) The name "createTypeRegistry" should be prefixed with an underscore because the declaration is marked as @internal
|
|
202
|
-
//
|
|
203
|
-
// @internal
|
|
204
|
-
export function createTypeRegistry<TDefinition extends TypeDefinition>(): TypeRegistry<TDefinition>;
|
|
205
|
-
|
|
206
182
|
// @public
|
|
207
183
|
export const css: CSSTemplateTag;
|
|
208
184
|
|
|
185
|
+
// @public
|
|
186
|
+
export class CSSBindingDirective implements HostBehavior, Subscriber, CSSDirective, BindingDirective {
|
|
187
|
+
constructor(dataBinding: Binding, targetAspect: string);
|
|
188
|
+
addedCallback(controller: HostController<HTMLElement & {
|
|
189
|
+
$cssBindings: Map<CSSBindingDirective, CSSBindingEntry>;
|
|
190
|
+
}>): void;
|
|
191
|
+
connectedCallback(controller: HostController<HTMLElement & {
|
|
192
|
+
$cssBindings: Map<CSSBindingDirective, CSSBindingEntry>;
|
|
193
|
+
}>): void;
|
|
194
|
+
createCSS(add: AddBehavior): ComposableStyles;
|
|
195
|
+
// (undocumented)
|
|
196
|
+
readonly dataBinding: Binding;
|
|
197
|
+
// @internal
|
|
198
|
+
handleChange(_: any, observer: ExpressionObserver): void;
|
|
199
|
+
removedCallback(controller: HostController<HTMLElement & {
|
|
200
|
+
$cssBindings: Map<CSSBindingDirective, CSSBindingEntry>;
|
|
201
|
+
}>): void;
|
|
202
|
+
// (undocumented)
|
|
203
|
+
readonly targetAspect: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
209
206
|
// @public
|
|
210
207
|
export interface CSSDirective {
|
|
211
208
|
createCSS(add: AddBehavior): ComposableStyles;
|
|
@@ -226,14 +223,14 @@ export interface CSSDirectiveDefinition<TType extends Constructable<CSSDirective
|
|
|
226
223
|
readonly type: TType;
|
|
227
224
|
}
|
|
228
225
|
|
|
229
|
-
// @public @deprecated (undocumented)
|
|
230
|
-
export const cssPartial: (strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]) => CSSDirective;
|
|
231
|
-
|
|
232
226
|
// @public
|
|
233
|
-
export type CSSTemplateTag = ((strings: TemplateStringsArray, ...values:
|
|
234
|
-
partial(strings: TemplateStringsArray, ...values:
|
|
227
|
+
export type CSSTemplateTag = (<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: CSSValue<TSource, TParent>[]) => ElementStyles) & {
|
|
228
|
+
partial<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: CSSValue<TSource, TParent>[]): CSSDirective;
|
|
235
229
|
};
|
|
236
230
|
|
|
231
|
+
// @public
|
|
232
|
+
export type CSSValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | ComposableStyles | CSSDirective;
|
|
233
|
+
|
|
237
234
|
// @public
|
|
238
235
|
export function customElement(nameOrDef: string | PartialFASTElementDefinition): (type: Constructable<HTMLElement>) => void;
|
|
239
236
|
|
|
@@ -247,36 +244,87 @@ export interface Disposable {
|
|
|
247
244
|
|
|
248
245
|
// @public
|
|
249
246
|
export const DOM: Readonly<{
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
processUpdates: () => void;
|
|
247
|
+
readonly policy: DOMPolicy;
|
|
248
|
+
setPolicy(value: DOMPolicy): void;
|
|
253
249
|
setAttribute(element: HTMLElement, attributeName: string, value: any): void;
|
|
254
250
|
setBooleanAttribute(element: HTMLElement, attributeName: string, value: boolean): void;
|
|
255
251
|
}>;
|
|
256
252
|
|
|
253
|
+
// @public
|
|
254
|
+
export const DOMAspect: Readonly<{
|
|
255
|
+
readonly none: 0;
|
|
256
|
+
readonly attribute: 1;
|
|
257
|
+
readonly booleanAttribute: 2;
|
|
258
|
+
readonly property: 3;
|
|
259
|
+
readonly content: 4;
|
|
260
|
+
readonly tokenList: 5;
|
|
261
|
+
readonly event: 6;
|
|
262
|
+
}>;
|
|
263
|
+
|
|
264
|
+
// @public
|
|
265
|
+
export type DOMAspect = (typeof DOMAspect)[Exclude<keyof typeof DOMAspect, "none">];
|
|
266
|
+
|
|
267
|
+
// @public
|
|
268
|
+
export interface DOMPolicy {
|
|
269
|
+
createHTML(value: string): string;
|
|
270
|
+
protect(tagName: string | null, aspect: DOMAspect, aspectName: string, sink: DOMSink): DOMSink;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// @public
|
|
274
|
+
export type DOMSink = (target: Node, aspectName: string, value: any, ...args: any[]) => void;
|
|
275
|
+
|
|
257
276
|
// @public
|
|
258
277
|
export class ElementController<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier implements HostController<TElement> {
|
|
259
278
|
// @internal
|
|
260
279
|
constructor(element: TElement, definition: FASTElementDefinition);
|
|
261
280
|
addBehavior(behavior: HostBehavior<TElement>): void;
|
|
262
281
|
addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
282
|
+
// (undocumented)
|
|
283
|
+
protected behaviors: Map<HostBehavior<TElement>, number> | null;
|
|
284
|
+
// (undocumented)
|
|
285
|
+
protected bindObservables(): void;
|
|
263
286
|
connect(): void;
|
|
287
|
+
// (undocumented)
|
|
288
|
+
protected connectBehaviors(): void;
|
|
289
|
+
get context(): ExecutionContext;
|
|
264
290
|
readonly definition: FASTElementDefinition;
|
|
265
291
|
disconnect(): void;
|
|
292
|
+
// (undocumented)
|
|
293
|
+
protected disconnectBehaviors(): void;
|
|
266
294
|
emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): void | boolean;
|
|
267
295
|
static forCustomElement(element: HTMLElement): ElementController;
|
|
296
|
+
get isBound(): boolean;
|
|
268
297
|
get isConnected(): boolean;
|
|
269
298
|
get mainStyles(): ElementStyles | null;
|
|
270
299
|
set mainStyles(value: ElementStyles | null);
|
|
300
|
+
// (undocumented)
|
|
301
|
+
protected needsInitialization: boolean;
|
|
271
302
|
onAttributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
303
|
+
onUnbind(behavior: {
|
|
304
|
+
unbind(controller: ExpressionController<TElement>): any;
|
|
305
|
+
}): void;
|
|
272
306
|
removeBehavior(behavior: HostBehavior<TElement>, force?: boolean): void;
|
|
273
307
|
removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
308
|
+
// (undocumented)
|
|
309
|
+
protected renderTemplate(template: ElementViewTemplate | null | undefined): void;
|
|
310
|
+
static setStrategy(strategy: ElementControllerStrategy): void;
|
|
274
311
|
readonly source: TElement;
|
|
312
|
+
get sourceLifetime(): SourceLifetime | undefined;
|
|
313
|
+
// Warning: (ae-forgotten-export) The symbol "Stages" needs to be exported by the entry point index.d.ts
|
|
314
|
+
//
|
|
315
|
+
// (undocumented)
|
|
316
|
+
protected stage: Stages;
|
|
275
317
|
get template(): ElementViewTemplate<TElement> | null;
|
|
276
318
|
set template(value: ElementViewTemplate<TElement> | null);
|
|
277
319
|
readonly view: ElementView<TElement> | null;
|
|
278
320
|
}
|
|
279
321
|
|
|
322
|
+
// @public
|
|
323
|
+
export interface ElementControllerStrategy {
|
|
324
|
+
// (undocumented)
|
|
325
|
+
new (element: HTMLElement, definition: FASTElementDefinition): ElementController;
|
|
326
|
+
}
|
|
327
|
+
|
|
280
328
|
// @public
|
|
281
329
|
export const elements: (selector?: string) => ElementsFilter;
|
|
282
330
|
|
|
@@ -306,6 +354,10 @@ export class ElementStyles {
|
|
|
306
354
|
// @public
|
|
307
355
|
export interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent> {
|
|
308
356
|
appendTo(node: Node): void;
|
|
357
|
+
onUnbind(behavior: {
|
|
358
|
+
unbind(controller: ViewController<TSource, TParent>): any;
|
|
359
|
+
}): void;
|
|
360
|
+
readonly sourceLifetime?: SourceLifetime;
|
|
309
361
|
}
|
|
310
362
|
|
|
311
363
|
// @public
|
|
@@ -366,9 +418,7 @@ export interface ExpressionObserver<TSource = any, TReturn = any, TParent = any>
|
|
|
366
418
|
bind(controller: ExpressionController<TSource, TParent>): TReturn;
|
|
367
419
|
}
|
|
368
420
|
|
|
369
|
-
//
|
|
370
|
-
//
|
|
371
|
-
// @internal
|
|
421
|
+
// @public
|
|
372
422
|
export const FAST: FASTGlobal;
|
|
373
423
|
|
|
374
424
|
// @public
|
|
@@ -400,6 +450,8 @@ export class FASTElementDefinition<TType extends Constructable<HTMLElement> = Co
|
|
|
400
450
|
get isDefined(): boolean;
|
|
401
451
|
readonly name: string;
|
|
402
452
|
readonly propertyLookup: Record<string, AttributeDefinition>;
|
|
453
|
+
// @internal
|
|
454
|
+
static registerBaseType(type: Function): void;
|
|
403
455
|
readonly registry: CustomElementRegistry;
|
|
404
456
|
readonly shadowOptions?: ShadowRootOptions;
|
|
405
457
|
readonly styles?: ElementStyles;
|
|
@@ -407,9 +459,7 @@ export class FASTElementDefinition<TType extends Constructable<HTMLElement> = Co
|
|
|
407
459
|
readonly type: TType;
|
|
408
460
|
}
|
|
409
461
|
|
|
410
|
-
//
|
|
411
|
-
//
|
|
412
|
-
// @internal
|
|
462
|
+
// @public
|
|
413
463
|
export interface FASTGlobal {
|
|
414
464
|
addMessages(messages: Record<number, string>): void;
|
|
415
465
|
error(code: number, values?: Record<string, any>): Error;
|
|
@@ -429,31 +479,24 @@ export interface HostBehavior<TSource = any> {
|
|
|
429
479
|
}
|
|
430
480
|
|
|
431
481
|
// @public
|
|
432
|
-
export interface HostController<TSource = any> {
|
|
482
|
+
export interface HostController<TSource = any> extends ExpressionController<TSource> {
|
|
433
483
|
addBehavior(behavior: HostBehavior<TSource>): void;
|
|
434
484
|
addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
435
485
|
readonly isConnected: boolean;
|
|
436
486
|
mainStyles: ElementStyles | null;
|
|
437
487
|
removeBehavior(behavior: HostBehavior<TSource>, force?: boolean): void;
|
|
438
488
|
removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
439
|
-
readonly source: TSource;
|
|
440
489
|
}
|
|
441
490
|
|
|
442
491
|
// @public
|
|
443
|
-
export
|
|
492
|
+
export const html: HTMLTemplateTag;
|
|
444
493
|
|
|
445
494
|
// @public
|
|
446
|
-
export class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, ViewBehavior, Aspected {
|
|
495
|
+
export class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, ViewBehavior, Aspected, BindingDirective {
|
|
447
496
|
constructor(dataBinding: Binding);
|
|
448
|
-
aspectType:
|
|
449
|
-
// @internal (undocumented)
|
|
450
|
-
bind: (controller: ViewController) => void;
|
|
451
|
-
// @internal (undocumented)
|
|
452
|
-
bindContent(controller: ViewController): void;
|
|
497
|
+
aspectType: DOMAspect;
|
|
453
498
|
// @internal (undocumented)
|
|
454
|
-
|
|
455
|
-
// @internal (undocumented)
|
|
456
|
-
bindEvent(controller: ViewController): void;
|
|
499
|
+
bind(controller: ViewController): void;
|
|
457
500
|
createBehavior(): ViewBehavior;
|
|
458
501
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
459
502
|
// (undocumented)
|
|
@@ -463,9 +506,11 @@ export class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory,
|
|
|
463
506
|
// @internal (undocumented)
|
|
464
507
|
handleEvent(event: Event): void;
|
|
465
508
|
id: string;
|
|
466
|
-
|
|
509
|
+
policy: DOMPolicy;
|
|
467
510
|
sourceAspect: string;
|
|
468
511
|
targetAspect: string;
|
|
512
|
+
targetNodeId: string;
|
|
513
|
+
targetTagName: string | null;
|
|
469
514
|
// @internal (undocumented)
|
|
470
515
|
unbind(controller: ViewController): void;
|
|
471
516
|
}
|
|
@@ -480,6 +525,7 @@ export const HTMLDirective: Readonly<{
|
|
|
480
525
|
getForInstance: (object: any) => HTMLDirectiveDefinition<Constructable<HTMLDirective>> | undefined;
|
|
481
526
|
getByType: (key: Function) => HTMLDirectiveDefinition<Constructable<HTMLDirective>> | undefined;
|
|
482
527
|
define<TType extends Constructable<HTMLDirective>>(type: TType, options?: PartialHTMLDirectiveDefinition): TType;
|
|
528
|
+
assignAspect(directive: Aspected, value?: string): void;
|
|
483
529
|
}>;
|
|
484
530
|
|
|
485
531
|
// @public
|
|
@@ -493,46 +539,85 @@ export interface HTMLDirectiveDefinition<TType extends Constructable<HTMLDirecti
|
|
|
493
539
|
// @public
|
|
494
540
|
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any> {
|
|
495
541
|
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
542
|
+
// (undocumented)
|
|
543
|
+
readonly factories: CompiledViewBehaviorFactory[];
|
|
496
544
|
}
|
|
497
545
|
|
|
498
546
|
// @public
|
|
499
|
-
export
|
|
500
|
-
|
|
547
|
+
export type HTMLTemplateTag = (<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]) => ViewTemplate<TSource, TParent>) & {
|
|
548
|
+
partial(html: string): InlineTemplateDirective;
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
// Warning: (ae-forgotten-export) The symbol "DefaultExecutionContext" needs to be exported by the entry point index.d.ts
|
|
552
|
+
//
|
|
553
|
+
// @public
|
|
554
|
+
export class HTMLView<TSource = any, TParent = any> extends DefaultExecutionContext<TParent> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent>, ExecutionContext<TParent> {
|
|
555
|
+
constructor(fragment: DocumentFragment, factories: ReadonlyArray<CompiledViewBehaviorFactory>, targets: ViewBehaviorTargets);
|
|
501
556
|
appendTo(node: Node): void;
|
|
502
|
-
bind(source: TSource): void;
|
|
503
|
-
|
|
557
|
+
bind(source: TSource, context?: ExecutionContext<TParent>): void;
|
|
558
|
+
context: ExecutionContext<TParent>;
|
|
504
559
|
dispose(): void;
|
|
505
560
|
static disposeContiguousBatch(views: SyntheticView[]): void;
|
|
506
|
-
get event(): Event;
|
|
507
|
-
eventDetail<TDetail>(): TDetail;
|
|
508
|
-
eventTarget<TTarget extends EventTarget>(): TTarget;
|
|
509
561
|
firstChild: Node;
|
|
510
|
-
index: number;
|
|
511
562
|
insertBefore(node: Node): void;
|
|
512
|
-
// (undocumented)
|
|
513
563
|
isBound: boolean;
|
|
514
|
-
get isEven(): boolean;
|
|
515
|
-
get isFirst(): boolean;
|
|
516
|
-
get isInMiddle(): boolean;
|
|
517
|
-
get isLast(): boolean;
|
|
518
|
-
get isOdd(): boolean;
|
|
519
564
|
lastChild: Node;
|
|
520
|
-
length: number;
|
|
521
565
|
// (undocumented)
|
|
522
566
|
onUnbind(behavior: {
|
|
523
|
-
unbind(controller: ViewController<TSource, TParent>):
|
|
567
|
+
unbind(controller: ViewController<TSource, TParent>): void;
|
|
524
568
|
}): void;
|
|
525
|
-
readonly parent: TParent;
|
|
526
|
-
readonly parentContext: ExecutionContext<TParent>;
|
|
527
569
|
remove(): void;
|
|
528
|
-
// (undocumented)
|
|
529
|
-
selfContained: boolean;
|
|
530
570
|
source: TSource | null;
|
|
571
|
+
readonly sourceLifetime: SourceLifetime;
|
|
531
572
|
// (undocumented)
|
|
532
573
|
readonly targets: ViewBehaviorTargets;
|
|
533
574
|
unbind(): void;
|
|
534
575
|
}
|
|
535
576
|
|
|
577
|
+
// @beta
|
|
578
|
+
export class HydratableElementController<TElement extends HTMLElement = HTMLElement> extends ElementController<TElement> {
|
|
579
|
+
// (undocumented)
|
|
580
|
+
connect(): void;
|
|
581
|
+
// (undocumented)
|
|
582
|
+
disconnect(): void;
|
|
583
|
+
// (undocumented)
|
|
584
|
+
static install(): void;
|
|
585
|
+
protected needsHydration?: boolean;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
// @public (undocumented)
|
|
589
|
+
export interface HydratableView<TSource = any, TParent = any> extends ElementView, SyntheticView, DefaultExecutionContext<TParent> {
|
|
590
|
+
// (undocumented)
|
|
591
|
+
[Hydratable]: symbol;
|
|
592
|
+
// Warning: (ae-forgotten-export) The symbol "ViewNodes" needs to be exported by the entry point index.d.ts
|
|
593
|
+
//
|
|
594
|
+
// (undocumented)
|
|
595
|
+
readonly bindingViewBoundaries: Record<string, ViewNodes>;
|
|
596
|
+
// Warning: (ae-forgotten-export) The symbol "HydrationStage" needs to be exported by the entry point index.d.ts
|
|
597
|
+
//
|
|
598
|
+
// (undocumented)
|
|
599
|
+
readonly hydrationStage: keyof typeof HydrationStage;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
// @public (undocumented)
|
|
603
|
+
export class HydrationBindingError extends Error {
|
|
604
|
+
constructor(
|
|
605
|
+
message: string | undefined,
|
|
606
|
+
factory: ViewBehaviorFactory,
|
|
607
|
+
fragment: DocumentFragment,
|
|
608
|
+
templateString: string);
|
|
609
|
+
readonly factory: ViewBehaviorFactory;
|
|
610
|
+
readonly fragment: DocumentFragment;
|
|
611
|
+
readonly templateString: string;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
// @public
|
|
615
|
+
export class InlineTemplateDirective implements HTMLDirective {
|
|
616
|
+
constructor(html: string, factories?: Record<string, ViewBehaviorFactory>);
|
|
617
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
618
|
+
static readonly empty: InlineTemplateDirective;
|
|
619
|
+
}
|
|
620
|
+
|
|
536
621
|
// @public
|
|
537
622
|
export interface LengthObserver extends Subscriber {
|
|
538
623
|
length: number;
|
|
@@ -542,7 +627,7 @@ export interface LengthObserver extends Subscriber {
|
|
|
542
627
|
export function lengthOf<T>(array: readonly T[]): number;
|
|
543
628
|
|
|
544
629
|
// @public
|
|
545
|
-
export function listener<T = any>(
|
|
630
|
+
export function listener<T = any>(expression: Expression<T>, options?: AddEventListenerOptions): Binding<T>;
|
|
546
631
|
|
|
547
632
|
// @public
|
|
548
633
|
export const Markup: Readonly<{
|
|
@@ -551,13 +636,6 @@ export const Markup: Readonly<{
|
|
|
551
636
|
comment: (id: string) => string;
|
|
552
637
|
}>;
|
|
553
638
|
|
|
554
|
-
// Warning: (ae-internal-missing-underscore) The name "Mutable" should be prefixed with an underscore because the declaration is marked as @internal
|
|
555
|
-
//
|
|
556
|
-
// @internal
|
|
557
|
-
export type Mutable<T> = {
|
|
558
|
-
-readonly [P in keyof T]: T[P];
|
|
559
|
-
};
|
|
560
|
-
|
|
561
639
|
// @public
|
|
562
640
|
export interface NodeBehaviorOptions<T = any> {
|
|
563
641
|
filter?: ElementsFilter;
|
|
@@ -571,7 +649,10 @@ export abstract class NodeObservationDirective<T extends NodeBehaviorOptions> ex
|
|
|
571
649
|
protected abstract disconnect(target: any): void;
|
|
572
650
|
protected abstract getNodes(target: any): Node[];
|
|
573
651
|
protected getSource(target: Node): any;
|
|
652
|
+
get id(): string;
|
|
653
|
+
set id(value: string);
|
|
574
654
|
protected abstract observe(target: any): void;
|
|
655
|
+
targetNodeId: string;
|
|
575
656
|
unbind(controller: ViewController): void;
|
|
576
657
|
protected updateTarget(source: any, value: ReadonlyArray<any>): void;
|
|
577
658
|
}
|
|
@@ -587,6 +668,9 @@ export interface Notifier {
|
|
|
587
668
|
unsubscribe(subscriber: Subscriber, propertyToUnwatch?: any): void;
|
|
588
669
|
}
|
|
589
670
|
|
|
671
|
+
// @public
|
|
672
|
+
export const nullableBooleanConverter: ValueConverter;
|
|
673
|
+
|
|
590
674
|
// @public
|
|
591
675
|
export const nullableNumberConverter: ValueConverter;
|
|
592
676
|
|
|
@@ -599,8 +683,8 @@ export const Observable: Readonly<{
|
|
|
599
683
|
notify(source: unknown, args: any): void;
|
|
600
684
|
defineProperty(target: {}, nameOrAccessor: string | Accessor): void;
|
|
601
685
|
getAccessors: (target: {}) => Accessor[];
|
|
602
|
-
binding<TSource = any, TReturn = any>(
|
|
603
|
-
isVolatileBinding<TSource_1 = any, TReturn_1 = any>(
|
|
686
|
+
binding<TSource = any, TReturn = any>(expression: Expression<TSource, TReturn, any>, initialSubscriber?: Subscriber, isVolatileBinding?: boolean): ExpressionNotifier<TSource, TReturn, any>;
|
|
687
|
+
isVolatileBinding<TSource_1 = any, TReturn_1 = any>(expression: Expression<TSource_1, TReturn_1, any>): boolean;
|
|
604
688
|
}>;
|
|
605
689
|
|
|
606
690
|
// @public
|
|
@@ -613,7 +697,10 @@ export interface ObservationRecord {
|
|
|
613
697
|
}
|
|
614
698
|
|
|
615
699
|
// @public
|
|
616
|
-
export function oneTime<T = any>(
|
|
700
|
+
export function oneTime<T = any>(expression: Expression<T>, policy?: DOMPolicy): Binding<T>;
|
|
701
|
+
|
|
702
|
+
// @public
|
|
703
|
+
export function oneWay<T = any>(expression: Expression<T>, policy?: DOMPolicy, isVolatile?: boolean): Binding<T>;
|
|
617
704
|
|
|
618
705
|
// @public
|
|
619
706
|
export const Parser: Readonly<{
|
|
@@ -651,6 +738,33 @@ export const ref: <TSource = any, TParent = any>(propertyName: keyof TSource & s
|
|
|
651
738
|
// @public
|
|
652
739
|
export class RefDirective extends StatelessAttachedAttributeDirective<string> {
|
|
653
740
|
bind(controller: ViewController): void;
|
|
741
|
+
targetNodeId: string;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
// @public
|
|
745
|
+
export function render<TSource = any, TItem = any, TParent = any>(value?: Expression<TSource, TItem> | Binding<TSource, TItem> | {}, template?: ContentTemplate | string | Expression<TSource, ContentTemplate | string | Node, TParent> | Binding<TSource, ContentTemplate | string | Node, TParent>): CaptureType<TSource, TParent>;
|
|
746
|
+
|
|
747
|
+
// @public
|
|
748
|
+
export class RenderBehavior<TSource = any> implements ViewBehavior, Subscriber {
|
|
749
|
+
constructor(directive: RenderDirective);
|
|
750
|
+
bind(controller: ViewController): void;
|
|
751
|
+
// @internal (undocumented)
|
|
752
|
+
handleChange(source: any, observer: ExpressionObserver): void;
|
|
753
|
+
unbind(controller: ViewController): void;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
// @public
|
|
757
|
+
export class RenderDirective<TSource = any> implements HTMLDirective, ViewBehaviorFactory, BindingDirective {
|
|
758
|
+
constructor(dataBinding: Binding<TSource>, templateBinding: Binding<TSource, ContentTemplate>, templateBindingDependsOnData: boolean);
|
|
759
|
+
createBehavior(): RenderBehavior<TSource>;
|
|
760
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
761
|
+
// (undocumented)
|
|
762
|
+
readonly dataBinding: Binding<TSource>;
|
|
763
|
+
targetNodeId: string;
|
|
764
|
+
// (undocumented)
|
|
765
|
+
readonly templateBinding: Binding<TSource, ContentTemplate>;
|
|
766
|
+
// (undocumented)
|
|
767
|
+
readonly templateBindingDependsOnData: boolean;
|
|
654
768
|
}
|
|
655
769
|
|
|
656
770
|
// @public
|
|
@@ -662,19 +776,20 @@ export class RepeatBehavior<TSource = any> implements ViewBehavior, Subscriber {
|
|
|
662
776
|
bind(controller: ViewController): void;
|
|
663
777
|
handleChange(source: any, args: Splice[] | ExpressionObserver): void;
|
|
664
778
|
unbind(): void;
|
|
779
|
+
// @internal (undocumented)
|
|
780
|
+
views: SyntheticView[];
|
|
665
781
|
}
|
|
666
782
|
|
|
667
783
|
// @public
|
|
668
|
-
export class RepeatDirective<TSource = any> implements HTMLDirective, ViewBehaviorFactory {
|
|
784
|
+
export class RepeatDirective<TSource = any> implements HTMLDirective, ViewBehaviorFactory, BindingDirective {
|
|
669
785
|
constructor(dataBinding: Binding<TSource>, templateBinding: Binding<TSource, SyntheticViewTemplate>, options: RepeatOptions);
|
|
670
786
|
createBehavior(): RepeatBehavior<TSource>;
|
|
671
787
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
672
788
|
// (undocumented)
|
|
673
789
|
readonly dataBinding: Binding<TSource>;
|
|
674
|
-
id: string;
|
|
675
|
-
nodeId: string;
|
|
676
790
|
// (undocumented)
|
|
677
791
|
readonly options: RepeatOptions;
|
|
792
|
+
targetNodeId: string;
|
|
678
793
|
// (undocumented)
|
|
679
794
|
readonly templateBinding: Binding<TSource, SyntheticViewTemplate>;
|
|
680
795
|
}
|
|
@@ -714,7 +829,7 @@ export const SourceLifetime: Readonly<{
|
|
|
714
829
|
}>;
|
|
715
830
|
|
|
716
831
|
// @public
|
|
717
|
-
export type SourceLifetime = typeof SourceLifetime[keyof typeof SourceLifetime];
|
|
832
|
+
export type SourceLifetime = (typeof SourceLifetime)[keyof typeof SourceLifetime];
|
|
718
833
|
|
|
719
834
|
// @public
|
|
720
835
|
export class Splice {
|
|
@@ -756,7 +871,7 @@ export const SpliceStrategySupport: Readonly<{
|
|
|
756
871
|
}>;
|
|
757
872
|
|
|
758
873
|
// @public
|
|
759
|
-
export type SpliceStrategySupport = typeof SpliceStrategySupport[keyof typeof SpliceStrategySupport];
|
|
874
|
+
export type SpliceStrategySupport = (typeof SpliceStrategySupport)[keyof typeof SpliceStrategySupport];
|
|
760
875
|
|
|
761
876
|
// @public
|
|
762
877
|
export abstract class StatelessAttachedAttributeDirective<TOptions> implements HTMLDirective, ViewBehaviorFactory, ViewBehavior {
|
|
@@ -764,8 +879,6 @@ export abstract class StatelessAttachedAttributeDirective<TOptions> implements H
|
|
|
764
879
|
abstract bind(controller: ViewController): void;
|
|
765
880
|
createBehavior(): ViewBehavior;
|
|
766
881
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
767
|
-
id: string;
|
|
768
|
-
nodeId: string;
|
|
769
882
|
// (undocumented)
|
|
770
883
|
protected options: TOptions;
|
|
771
884
|
}
|
|
@@ -777,7 +890,7 @@ export interface StyleStrategy {
|
|
|
777
890
|
}
|
|
778
891
|
|
|
779
892
|
// @public
|
|
780
|
-
export interface StyleTarget {
|
|
893
|
+
export interface StyleTarget extends Pick<Node, "getRootNode"> {
|
|
781
894
|
adoptedStyleSheets?: CSSStyleSheet[];
|
|
782
895
|
append(styles: HTMLStyleElement): void;
|
|
783
896
|
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
|
|
@@ -816,41 +929,17 @@ export interface SyntheticView<TSource = any, TParent = any> extends View<TSourc
|
|
|
816
929
|
// @public
|
|
817
930
|
export interface SyntheticViewTemplate<TSource = any, TParent = any> {
|
|
818
931
|
create(): SyntheticView<TSource, TParent>;
|
|
932
|
+
inline(): CaptureType<TSource, TParent>;
|
|
819
933
|
}
|
|
820
934
|
|
|
821
935
|
// @public
|
|
822
936
|
export type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource, TParent>;
|
|
823
937
|
|
|
824
|
-
// @public
|
|
825
|
-
export type TrustedTypes = {
|
|
826
|
-
createPolicy(name: string, rules: TrustedTypesPolicy): TrustedTypesPolicy;
|
|
827
|
-
};
|
|
828
|
-
|
|
829
938
|
// @public
|
|
830
939
|
export type TrustedTypesPolicy = {
|
|
831
940
|
createHTML(html: string): string;
|
|
832
941
|
};
|
|
833
942
|
|
|
834
|
-
// Warning: (ae-internal-missing-underscore) The name "TypeDefinition" should be prefixed with an underscore because the declaration is marked as @internal
|
|
835
|
-
//
|
|
836
|
-
// @internal
|
|
837
|
-
export interface TypeDefinition {
|
|
838
|
-
// (undocumented)
|
|
839
|
-
type: Function;
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
// Warning: (ae-internal-missing-underscore) The name "TypeRegistry" should be prefixed with an underscore because the declaration is marked as @internal
|
|
843
|
-
//
|
|
844
|
-
// @internal
|
|
845
|
-
export interface TypeRegistry<TDefinition extends TypeDefinition> {
|
|
846
|
-
// (undocumented)
|
|
847
|
-
getByType(key: Function): TDefinition | undefined;
|
|
848
|
-
// (undocumented)
|
|
849
|
-
getForInstance(object: any): TDefinition | undefined;
|
|
850
|
-
// (undocumented)
|
|
851
|
-
register(definition: TDefinition): boolean;
|
|
852
|
-
}
|
|
853
|
-
|
|
854
943
|
// @public
|
|
855
944
|
export interface UpdateQueue {
|
|
856
945
|
enqueue(callable: Callable): void;
|
|
@@ -870,8 +959,9 @@ export interface ValueConverter {
|
|
|
870
959
|
|
|
871
960
|
// @public
|
|
872
961
|
export interface View<TSource = any, TParent = any> extends Disposable {
|
|
873
|
-
bind(source: TSource): void;
|
|
962
|
+
bind(source: TSource, context?: ExecutionContext<TParent>): void;
|
|
874
963
|
readonly context: ExecutionContext<TParent>;
|
|
964
|
+
readonly isBound: boolean;
|
|
875
965
|
readonly source: TSource | null;
|
|
876
966
|
unbind(): void;
|
|
877
967
|
}
|
|
@@ -884,23 +974,12 @@ export interface ViewBehavior<TSource = any, TParent = any> {
|
|
|
884
974
|
// @public
|
|
885
975
|
export interface ViewBehaviorFactory {
|
|
886
976
|
createBehavior(): ViewBehavior;
|
|
887
|
-
id
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
// @public
|
|
892
|
-
export interface ViewBehaviorOrchestrator<TSource = any, TParent = any> extends ViewController<TSource, TParent>, HostBehavior<TSource> {
|
|
893
|
-
addBehavior(behavior: ViewBehavior): void;
|
|
894
|
-
addBehaviorFactory(factory: ViewBehaviorFactory, target: Node): void;
|
|
895
|
-
// (undocumented)
|
|
896
|
-
addTarget(nodeId: string, target: Node): void;
|
|
977
|
+
id?: string;
|
|
978
|
+
policy?: DOMPolicy;
|
|
979
|
+
targetNodeId?: string;
|
|
980
|
+
targetTagName?: string | null;
|
|
897
981
|
}
|
|
898
982
|
|
|
899
|
-
// @public
|
|
900
|
-
export const ViewBehaviorOrchestrator: Readonly<{
|
|
901
|
-
create<TSource = any, TParent = any>(source: TSource): ViewBehaviorOrchestrator<TSource, TParent>;
|
|
902
|
-
}>;
|
|
903
|
-
|
|
904
983
|
// @public
|
|
905
984
|
export type ViewBehaviorTargets = {
|
|
906
985
|
[id: string]: Node;
|
|
@@ -913,24 +992,30 @@ export interface ViewController<TSource = any, TParent = any> extends Expression
|
|
|
913
992
|
|
|
914
993
|
// @public
|
|
915
994
|
export class ViewTemplate<TSource = any, TParent = any> implements ElementViewTemplate<TSource, TParent>, SyntheticViewTemplate<TSource, TParent> {
|
|
916
|
-
constructor(html: string | HTMLTemplateElement, factories
|
|
995
|
+
constructor(html: string | HTMLTemplateElement, factories?: Record<string, ViewBehaviorFactory>, policy?: DOMPolicy | undefined);
|
|
996
|
+
// @internal (undocumented)
|
|
997
|
+
compile(): HTMLTemplateCompilationResult<TSource, TParent>;
|
|
917
998
|
create(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
999
|
+
static create<TSource = any, TParent = any>(strings: string[], values: TemplateValue<TSource, TParent>[], policy?: DOMPolicy): ViewTemplate<TSource, TParent>;
|
|
918
1000
|
readonly factories: Record<string, ViewBehaviorFactory>;
|
|
919
1001
|
readonly html: string | HTMLTemplateElement;
|
|
1002
|
+
inline(): CaptureType<TSource, TParent>;
|
|
920
1003
|
render(source: TSource, host: Node, hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
1004
|
+
withPolicy(policy: DOMPolicy): this;
|
|
921
1005
|
}
|
|
922
1006
|
|
|
923
1007
|
// @public
|
|
924
1008
|
export function volatile(target: {}, name: string | Accessor, descriptor: PropertyDescriptor): PropertyDescriptor;
|
|
925
1009
|
|
|
926
1010
|
// @public
|
|
927
|
-
export function when<TSource = any, TReturn = any, TParent = any>(condition: Expression<TSource, TReturn, TParent> | boolean, templateOrTemplateBinding: SyntheticViewTemplate<TSource, TParent> | Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>): CaptureType<TSource, TParent>;
|
|
1011
|
+
export function when<TSource = any, TReturn = any, TParent = any>(condition: Expression<TSource, TReturn, TParent> | boolean, templateOrTemplateBinding: SyntheticViewTemplate<TSource, TParent> | Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>, elseTemplateOrTemplateBinding?: SyntheticViewTemplate<TSource, TParent> | Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>): CaptureType<TSource, TParent>;
|
|
928
1012
|
|
|
929
1013
|
// Warnings were encountered during analysis:
|
|
930
1014
|
//
|
|
931
1015
|
// dist/dts/components/fast-element.d.ts:60:5 - (ae-forgotten-export) The symbol "define" needs to be exported by the entry point index.d.ts
|
|
932
1016
|
// dist/dts/components/fast-element.d.ts:61:5 - (ae-forgotten-export) The symbol "compose" needs to be exported by the entry point index.d.ts
|
|
933
1017
|
// dist/dts/components/fast-element.d.ts:62:5 - (ae-forgotten-export) The symbol "from" needs to be exported by the entry point index.d.ts
|
|
1018
|
+
// dist/dts/styles/css-binding-directive.d.ts:35:9 - (ae-forgotten-export) The symbol "CSSBindingEntry" needs to be exported by the entry point index.d.ts
|
|
934
1019
|
|
|
935
1020
|
// (No @packageDocumentation comment for this package)
|
|
936
1021
|
|