@microsoft/fast-element 2.0.0-beta.2 → 2.0.0-beta.21

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.
Files changed (115) hide show
  1. package/CHANGELOG.json +509 -0
  2. package/CHANGELOG.md +189 -1
  3. package/dist/dts/components/attributes.d.ts +15 -0
  4. package/dist/dts/components/{controller.d.ts → element-controller.d.ts} +74 -28
  5. package/dist/dts/components/fast-definitions.d.ts +41 -9
  6. package/dist/dts/components/fast-element.d.ts +14 -26
  7. package/dist/dts/components/hydration.d.ts +14 -0
  8. package/dist/{esm/observation/behavior.js → dts/components/install-hydration.d.ts} +0 -0
  9. package/dist/dts/context.d.ts +7 -7
  10. package/dist/dts/di/di.d.ts +894 -0
  11. package/dist/dts/dom-policy.d.ts +83 -0
  12. package/dist/dts/dom.d.ts +100 -0
  13. package/dist/dts/index.d.ts +5 -4
  14. package/dist/dts/index.rollup.d.ts +0 -1
  15. package/dist/dts/index.rollup.debug.d.ts +0 -1
  16. package/dist/dts/interfaces.d.ts +62 -80
  17. package/dist/dts/metadata.d.ts +5 -5
  18. package/dist/dts/observation/observable.d.ts +99 -54
  19. package/dist/dts/pending-task.d.ts +32 -0
  20. package/dist/dts/platform.d.ts +8 -1
  21. package/dist/dts/polyfills.d.ts +0 -8
  22. package/dist/dts/state/exports.d.ts +3 -0
  23. package/dist/dts/state/reactive.d.ts +8 -0
  24. package/dist/dts/state/state.d.ts +141 -0
  25. package/dist/dts/state/visitor.d.ts +6 -0
  26. package/dist/dts/state/watch.d.ts +10 -0
  27. package/dist/dts/styles/css-directive.d.ts +2 -2
  28. package/dist/dts/styles/css.d.ts +0 -5
  29. package/dist/dts/styles/element-styles.d.ts +10 -17
  30. package/dist/dts/styles/host.d.ts +68 -0
  31. package/dist/dts/styles/style-strategy.d.ts +42 -0
  32. package/dist/dts/templating/binding-signal.d.ts +12 -27
  33. package/dist/dts/templating/binding-two-way.d.ts +22 -37
  34. package/dist/dts/templating/binding.d.ts +76 -208
  35. package/dist/dts/templating/children.d.ts +1 -1
  36. package/dist/dts/templating/compiler.d.ts +11 -13
  37. package/dist/dts/templating/html-directive.d.ts +91 -97
  38. package/dist/dts/templating/node-observation.d.ts +15 -6
  39. package/dist/dts/templating/ref.d.ts +7 -11
  40. package/dist/dts/templating/render.d.ts +296 -0
  41. package/dist/dts/templating/repeat.d.ts +23 -34
  42. package/dist/dts/templating/slotted.d.ts +1 -1
  43. package/dist/dts/templating/template.d.ts +92 -14
  44. package/dist/dts/templating/view.d.ts +81 -11
  45. package/dist/dts/templating/when.d.ts +3 -3
  46. package/dist/dts/testing/exports.d.ts +3 -0
  47. package/dist/dts/testing/fakes.d.ts +14 -0
  48. package/dist/dts/testing/fixture.d.ts +84 -0
  49. package/dist/dts/testing/timeout.d.ts +7 -0
  50. package/dist/dts/utilities.d.ts +55 -19
  51. package/dist/esm/components/attributes.js +28 -5
  52. package/dist/esm/components/{controller.js → element-controller.js} +238 -137
  53. package/dist/esm/components/fast-definitions.js +38 -30
  54. package/dist/esm/components/fast-element.js +27 -16
  55. package/dist/esm/components/hydration.js +35 -0
  56. package/dist/esm/components/install-hydration.js +2 -0
  57. package/dist/esm/context.js +7 -3
  58. package/dist/esm/debug.js +41 -5
  59. package/dist/esm/di/di.js +1430 -0
  60. package/dist/esm/dom-policy.js +345 -0
  61. package/dist/esm/dom.js +101 -0
  62. package/dist/esm/index.js +4 -2
  63. package/dist/esm/index.rollup.debug.js +3 -1
  64. package/dist/esm/index.rollup.js +3 -1
  65. package/dist/esm/interfaces.js +52 -0
  66. package/dist/esm/metadata.js +9 -8
  67. package/dist/esm/observation/arrays.js +303 -2
  68. package/dist/esm/observation/observable.js +88 -142
  69. package/dist/esm/observation/update-queue.js +2 -2
  70. package/dist/esm/pending-task.js +28 -0
  71. package/dist/esm/platform.js +28 -3
  72. package/dist/esm/polyfills.js +3 -61
  73. package/dist/esm/state/exports.js +3 -0
  74. package/dist/esm/state/reactive.js +34 -0
  75. package/dist/esm/state/state.js +148 -0
  76. package/dist/esm/state/visitor.js +28 -0
  77. package/dist/esm/state/watch.js +36 -0
  78. package/dist/esm/styles/css.js +4 -9
  79. package/dist/esm/styles/element-styles.js +14 -33
  80. package/dist/esm/styles/host.js +1 -0
  81. package/dist/esm/styles/style-strategy.js +1 -0
  82. package/dist/esm/templating/binding-signal.js +67 -62
  83. package/dist/esm/templating/binding-two-way.js +72 -39
  84. package/dist/esm/templating/binding.js +142 -286
  85. package/dist/esm/templating/children.js +8 -4
  86. package/dist/esm/templating/compiler.js +59 -43
  87. package/dist/esm/templating/html-directive.js +56 -75
  88. package/dist/esm/templating/node-observation.js +20 -13
  89. package/dist/esm/templating/ref.js +4 -12
  90. package/dist/esm/templating/render.js +402 -0
  91. package/dist/esm/templating/repeat.js +88 -75
  92. package/dist/esm/templating/template.js +132 -60
  93. package/dist/esm/templating/view.js +113 -29
  94. package/dist/esm/templating/when.js +5 -4
  95. package/dist/esm/testing/exports.js +3 -0
  96. package/dist/esm/testing/fakes.js +107 -0
  97. package/dist/esm/testing/fixture.js +86 -0
  98. package/dist/esm/testing/timeout.js +24 -0
  99. package/dist/esm/utilities.js +97 -96
  100. package/dist/fast-element.api.json +9741 -8201
  101. package/dist/fast-element.d.ts +889 -646
  102. package/dist/fast-element.debug.js +2001 -1167
  103. package/dist/fast-element.debug.min.js +1 -1
  104. package/dist/fast-element.js +1907 -1109
  105. package/dist/fast-element.min.js +1 -1
  106. package/dist/fast-element.untrimmed.d.ts +913 -703
  107. package/docs/api-report.md +331 -258
  108. package/package.json +38 -16
  109. package/dist/dts/hooks.d.ts +0 -20
  110. package/dist/dts/observation/behavior.d.ts +0 -19
  111. package/dist/dts/observation/splice-strategies.d.ts +0 -13
  112. package/dist/dts/templating/dom.d.ts +0 -41
  113. package/dist/esm/hooks.js +0 -32
  114. package/dist/esm/observation/splice-strategies.js +0 -400
  115. package/dist/esm/templating/dom.js +0 -49
@@ -12,24 +12,11 @@ export interface Accessor {
12
12
  }
13
13
 
14
14
  // @public
15
- export type AddBehavior = (behavior: Behavior<HTMLElement>) => void;
15
+ export type AddBehavior = (behavior: HostBehavior<HTMLElement>) => void;
16
16
 
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,25 +31,10 @@ 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: Aspect;
65
- binding?: Binding;
36
+ aspectType: DOMAspect;
37
+ dataBinding?: Binding;
66
38
  sourceAspect: string;
67
39
  targetAspect: string;
68
40
  }
@@ -81,6 +53,11 @@ export type AttributeConfiguration = {
81
53
  converter?: ValueConverter;
82
54
  };
83
55
 
56
+ // @public
57
+ export const AttributeConfiguration: Readonly<{
58
+ locate: (target: {}) => AttributeConfiguration[];
59
+ }>;
60
+
84
61
  // @public
85
62
  export class AttributeDefinition implements Accessor {
86
63
  constructor(Owner: Function, name: string, attribute?: string, mode?: AttributeMode, converter?: ValueConverter);
@@ -104,44 +81,19 @@ export class AttributeDefinition implements Accessor {
104
81
  export type AttributeMode = typeof reflectMode | typeof booleanMode | "fromView";
105
82
 
106
83
  // @public
107
- export interface Behavior<TSource = any, TParent = any> {
108
- bind(source: TSource, context: ExecutionContext<TParent>): void;
109
- unbind(source: TSource, context: ExecutionContext<TParent>): void;
110
- }
111
-
112
- // @public
113
- export function bind<T = any>(binding: Binding<T>, config?: BindingConfig | DefaultBindingOptions): CaptureType<T>;
114
-
115
- // @public
116
- export type Binding<TSource = any, TReturn = any, TParent = any> = (source: TSource, context: ExecutionContext<TParent>) => TReturn;
117
-
118
- // @public
119
- export interface BindingConfig<T = any> {
120
- mode: BindingMode;
121
- options: T;
122
- }
123
-
124
- // @public
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>;
84
+ export function bind<T = any>(expression: Expression<T>, policy?: DOMPolicy, isVolatile?: boolean): Binding<T>;
131
85
 
132
86
  // @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;
143
- records(): IterableIterator<ObservationRecord>;
144
- setMode(isAsync: boolean): void;
87
+ export abstract class Binding<TSource = any, TReturn = any, TParent = any> {
88
+ constructor(evaluate: Expression<TSource, TReturn, TParent>, policy?: DOMPolicy | undefined, isVolatile?: boolean);
89
+ abstract createObserver(directive: HTMLDirective, subscriber: Subscriber): ExpressionObserver<TSource, TReturn, TParent>;
90
+ // (undocumented)
91
+ evaluate: Expression<TSource, TReturn, TParent>;
92
+ // (undocumented)
93
+ isVolatile: boolean;
94
+ options?: any;
95
+ // (undocumented)
96
+ policy?: DOMPolicy | undefined;
145
97
  }
146
98
 
147
99
  // @public
@@ -153,17 +105,7 @@ export type Callable = typeof Function.prototype.call | {
153
105
  };
154
106
 
155
107
  // @public
156
- export interface CaptureType<TSource> {
157
- }
158
-
159
- // @public
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;
108
+ export interface CaptureType<TSource, TParent> {
167
109
  }
168
110
 
169
111
  // @public
@@ -171,7 +113,7 @@ export interface ChildListDirectiveOptions<T = any> extends NodeBehaviorOptions<
171
113
  }
172
114
 
173
115
  // @public
174
- export function children<T = any>(propertyOrOptions: (keyof T & string) | ChildrenDirectiveOptions<keyof T & string>): CaptureType<T>;
116
+ export function children<TSource = any, TParent = any>(propertyOrOptions: (keyof TSource & string) | ChildrenDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
175
117
 
176
118
  // @public
177
119
  export class ChildrenDirective extends NodeObservationDirective<ChildrenDirectiveOptions> {
@@ -184,17 +126,25 @@ export class ChildrenDirective extends NodeObservationDirective<ChildrenDirectiv
184
126
  // @public
185
127
  export type ChildrenDirectiveOptions<T = any> = ChildListDirectiveOptions<T> | SubtreeDirectiveOptions<T>;
186
128
 
129
+ // @public
130
+ export type Class<T, C = {}> = C & Constructable<T> & {
131
+ readonly prototype: T;
132
+ };
133
+
187
134
  // @public
188
135
  export type CompilationStrategy = (
189
136
  html: string | HTMLTemplateElement,
190
- factories: Record<string, ViewBehaviorFactory>) => HTMLTemplateCompilationResult;
137
+ factories: Record<string, ViewBehaviorFactory>,
138
+ policy: DOMPolicy) => HTMLTemplateCompilationResult;
139
+
140
+ // @public
141
+ export type CompiledViewBehaviorFactory = Required<ViewBehaviorFactory>;
191
142
 
192
143
  // @public
193
144
  export const Compiler: {
194
- setHTMLPolicy(policy: TrustedTypesPolicy): void;
195
- compile<TSource = any, TParent = any>(html: string | HTMLTemplateElement, directives: Record<string, ViewBehaviorFactory>): HTMLTemplateCompilationResult<TSource, TParent>;
145
+ compile<TSource = any, TParent = any>(html: string | HTMLTemplateElement, factories: Record<string, ViewBehaviorFactory>, policy?: DOMPolicy): HTMLTemplateCompilationResult<TSource, TParent>;
196
146
  setDefaultStrategy(strategy: CompilationStrategy): void;
197
- aggregate(parts: (string | ViewBehaviorFactory)[]): ViewBehaviorFactory;
147
+ aggregate(parts: (string | ViewBehaviorFactory)[], policy?: DOMPolicy): ViewBehaviorFactory;
198
148
  };
199
149
 
200
150
  // @public
@@ -211,28 +161,25 @@ export type ConstructibleStyleStrategy = {
211
161
  };
212
162
 
213
163
  // @public
214
- export class Controller<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier {
215
- // @internal
216
- constructor(element: TElement, definition: FASTElementDefinition);
217
- addBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>): void;
218
- addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
219
- readonly definition: FASTElementDefinition;
220
- readonly element: TElement;
221
- emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): void | boolean;
222
- static forCustomElement(element: HTMLElement): Controller;
223
- get isConnected(): boolean;
224
- onAttributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
225
- onConnectedCallback(): void;
226
- onDisconnectedCallback(): void;
227
- removeBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>, force?: boolean): void;
228
- removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
229
- get styles(): ElementStyles | null;
230
- set styles(value: ElementStyles | null);
231
- get template(): ElementViewTemplate<TElement> | null;
232
- set template(value: ElementViewTemplate<TElement> | null);
233
- readonly view: ElementView<TElement> | null;
164
+ export interface ContentTemplate {
165
+ create(): ContentView;
234
166
  }
235
167
 
168
+ // @public
169
+ export interface ContentView {
170
+ bind(source: any, context?: ExecutionContext): void;
171
+ // (undocumented)
172
+ readonly context: ExecutionContext;
173
+ insertBefore(node: Node): void;
174
+ remove(): void;
175
+ unbind(): void;
176
+ }
177
+
178
+ // Warning: (ae-internal-missing-underscore) The name "createMetadataLocator" should be prefixed with an underscore because the declaration is marked as @internal
179
+ //
180
+ // @internal
181
+ export function createMetadataLocator<TMetadata>(): (target: {}) => TMetadata[];
182
+
236
183
  // Warning: (ae-internal-missing-underscore) The name "createTypeRegistry" should be prefixed with an underscore because the declaration is marked as @internal
237
184
  //
238
185
  // @internal
@@ -261,9 +208,6 @@ export interface CSSDirectiveDefinition<TType extends Constructable<CSSDirective
261
208
  readonly type: TType;
262
209
  }
263
210
 
264
- // @public @deprecated (undocumented)
265
- export const cssPartial: (strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]) => CSSDirective;
266
-
267
211
  // @public
268
212
  export type CSSTemplateTag = ((strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]) => ElementStyles) & {
269
213
  partial(strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]): CSSDirective;
@@ -275,9 +219,6 @@ export function customElement(nameOrDef: string | PartialFASTElementDefinition):
275
219
  // @public
276
220
  export type DecoratorAttributeConfiguration = Omit<AttributeConfiguration, "property">;
277
221
 
278
- // @public
279
- export type DefaultBindingOptions = AddEventListenerOptions;
280
-
281
222
  // @public
282
223
  export interface Disposable {
283
224
  dispose(): void;
@@ -285,27 +226,82 @@ export interface Disposable {
285
226
 
286
227
  // @public
287
228
  export const DOM: Readonly<{
288
- queueUpdate: (callable: Callable) => void;
289
- nextUpdate: () => Promise<void>;
290
- processUpdates: () => void;
229
+ readonly policy: DOMPolicy;
230
+ setPolicy(value: DOMPolicy): void;
291
231
  setAttribute(element: HTMLElement, attributeName: string, value: any): void;
292
232
  setBooleanAttribute(element: HTMLElement, attributeName: string, value: boolean): void;
293
233
  }>;
294
234
 
235
+ // @public
236
+ export const DOMAspect: Readonly<{
237
+ readonly none: 0;
238
+ readonly attribute: 1;
239
+ readonly booleanAttribute: 2;
240
+ readonly property: 3;
241
+ readonly content: 4;
242
+ readonly tokenList: 5;
243
+ readonly event: 6;
244
+ }>;
245
+
246
+ // @public
247
+ export type DOMAspect = typeof DOMAspect[Exclude<keyof typeof DOMAspect, "none">];
248
+
249
+ // @public
250
+ export interface DOMPolicy {
251
+ createHTML(value: string): string;
252
+ protect(tagName: string | null, aspect: DOMAspect, aspectName: string, sink: DOMSink): DOMSink;
253
+ }
254
+
255
+ // @public
256
+ export type DOMSink = (target: Node, aspectName: string, value: any, ...args: any[]) => void;
257
+
258
+ // @public
259
+ export class ElementController<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier implements HostController<TElement> {
260
+ // @internal
261
+ constructor(element: TElement, definition: FASTElementDefinition);
262
+ addBehavior(behavior: HostBehavior<TElement>): void;
263
+ addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
264
+ connect(): void;
265
+ readonly definition: FASTElementDefinition;
266
+ disconnect(): void;
267
+ emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): void | boolean;
268
+ static forCustomElement(element: HTMLElement): ElementController;
269
+ get isConnected(): boolean;
270
+ get mainStyles(): ElementStyles | null;
271
+ set mainStyles(value: ElementStyles | null);
272
+ onAttributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
273
+ removeBehavior(behavior: HostBehavior<TElement>, force?: boolean): void;
274
+ removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
275
+ static setStrategy(strategy: ElementControllerStrategy): void;
276
+ readonly source: TElement;
277
+ get template(): ElementViewTemplate<TElement> | null;
278
+ set template(value: ElementViewTemplate<TElement> | null);
279
+ // @internal
280
+ toJSON: () => undefined;
281
+ readonly view: ElementView<TElement> | null;
282
+ }
283
+
284
+ // @public
285
+ export interface ElementControllerStrategy {
286
+ // (undocumented)
287
+ new (element: HTMLElement, definition: FASTElementDefinition): ElementController;
288
+ }
289
+
295
290
  // @public
296
291
  export const elements: (selector?: string) => ElementsFilter;
297
292
 
298
293
  // @public
299
- export type ElementsFilter = (value: Node, index: number, array: Node[]) => boolean;
294
+ export type ElementsFilter = (value: Node, index?: number, array?: Node[]) => boolean;
300
295
 
301
296
  // @public
302
297
  export class ElementStyles {
303
298
  constructor(styles: ReadonlyArray<ComposableStyles>);
304
299
  // @internal (undocumented)
305
300
  addStylesTo(target: StyleTarget): void;
306
- readonly behaviors: ReadonlyArray<Behavior<HTMLElement>> | null;
301
+ readonly behaviors: ReadonlyArray<HostBehavior<HTMLElement>> | null;
307
302
  // @internal (undocumented)
308
303
  isAttachedTo(target: StyleTarget): boolean;
304
+ static normalize(styles: ComposableStyles | ComposableStyles[] | undefined): ElementStyles | undefined;
309
305
  // @internal (undocumented)
310
306
  removeStylesFrom(target: StyleTarget): void;
311
307
  static setDefaultStrategy(Strategy: ConstructibleStyleStrategy): void;
@@ -313,7 +309,7 @@ export class ElementStyles {
313
309
  // (undocumented)
314
310
  readonly styles: ReadonlyArray<ComposableStyles>;
315
311
  static readonly supportsAdoptedStyleSheets: boolean;
316
- withBehaviors(...behaviors: Behavior<HTMLElement>[]): this;
312
+ withBehaviors(...behaviors: HostBehavior<HTMLElement>[]): this;
317
313
  withStrategy(Strategy: ConstructibleStyleStrategy): this;
318
314
  }
319
315
 
@@ -332,114 +328,150 @@ export interface ElementViewTemplate<TSource = any, TParent = any> {
332
328
  export const emptyArray: readonly never[];
333
329
 
334
330
  // @public
335
- export class EventBinding {
336
- constructor(directive: HTMLBindingDirective);
337
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
338
- createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
339
- // (undocumented)
340
- readonly directive: HTMLBindingDirective;
341
- // @internal (undocumented)
342
- handleEvent(event: Event): void;
343
- unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
344
- }
345
-
346
- // @public
347
- export class ExecutionContext<TParentSource = any> {
348
- static create(): ExecutionContext;
349
- createChildContext<TParentSource>(parentSource: TParentSource): ExecutionContext<TParentSource>;
350
- createItemContext(index: number, length: number): ExecutionContext<TParentSource>;
351
- static readonly default: ExecutionContext<any>;
352
- get event(): Event;
331
+ export interface ExecutionContext<TParent = any> {
332
+ readonly event: Event;
353
333
  eventDetail<TDetail>(): TDetail;
354
334
  eventTarget<TTarget extends EventTarget>(): TTarget;
355
335
  index: number;
356
- get isEven(): boolean;
357
- get isFirst(): boolean;
358
- get isInMiddle(): boolean;
359
- get isLast(): boolean;
360
- get isOdd(): boolean;
336
+ readonly isEven: boolean;
337
+ readonly isFirst: boolean;
338
+ readonly isInMiddle: boolean;
339
+ readonly isLast: boolean;
340
+ readonly isOdd: boolean;
361
341
  length: number;
362
- readonly parent: TParentSource;
363
- readonly parentContext: ExecutionContext<TParentSource>;
364
- // @internal
365
- static setEvent(event: Event | null): void;
366
- updatePosition(index: number, length: number): void;
342
+ parent: TParent;
343
+ parentContext: ExecutionContext<TParent>;
367
344
  }
368
345
 
369
- // Warning: (ae-internal-missing-underscore) The name "FAST" should be prefixed with an underscore because the declaration is marked as @internal
370
- //
371
- // @internal
346
+ // @public
347
+ export const ExecutionContext: Readonly<{
348
+ default: ExecutionContext<any>;
349
+ getEvent(): Event | null;
350
+ setEvent(event: Event | null): void;
351
+ }>;
352
+
353
+ // @public
354
+ export type Expression<TSource = any, TReturn = any, TParent = any> = (source: TSource, context: ExecutionContext<TParent>) => TReturn;
355
+
356
+ // @public
357
+ export interface ExpressionController<TSource = any, TParent = any> {
358
+ readonly context: ExecutionContext<TParent>;
359
+ readonly isBound: boolean;
360
+ onUnbind(behavior: {
361
+ unbind(controller: ExpressionController<TSource, TParent>): any;
362
+ }): void;
363
+ readonly source: TSource;
364
+ readonly sourceLifetime?: SourceLifetime;
365
+ }
366
+
367
+ // @public
368
+ export interface ExpressionNotifier<TSource = any, TReturn = any, TParent = any> extends Notifier, ExpressionObserver<TSource, TReturn, TParent>, Disposable {
369
+ observe(source: TSource, context?: ExecutionContext): TReturn;
370
+ records(): IterableIterator<ObservationRecord>;
371
+ setMode(isAsync: boolean): void;
372
+ }
373
+
374
+ // @public
375
+ export interface ExpressionObserver<TSource = any, TReturn = any, TParent = any> {
376
+ bind(controller: ExpressionController<TSource, TParent>): TReturn;
377
+ }
378
+
379
+ // @public
372
380
  export const FAST: FASTGlobal;
373
381
 
374
382
  // @public
375
383
  export interface FASTElement extends HTMLElement {
376
384
  $emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): boolean | void;
377
- readonly $fastController: Controller;
385
+ readonly $fastController: ElementController;
378
386
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
379
387
  connectedCallback(): void;
380
388
  disconnectedCallback(): void;
381
389
  }
382
390
 
383
391
  // @public
384
- export const FASTElement: (new () => HTMLElement & FASTElement) & {
385
- from<TBase extends {
386
- new (): HTMLElement;
387
- prototype: HTMLElement;
388
- }>(BaseType: TBase): new () => InstanceType<TBase> & FASTElement;
389
- define<TType extends Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): TType;
390
- metadata<TType_1 extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType_1, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType_1>;
392
+ export const FASTElement: {
393
+ new (): FASTElement;
394
+ define: typeof define;
395
+ compose: typeof compose;
396
+ from: typeof from;
391
397
  };
392
398
 
393
399
  // @public
394
400
  export class FASTElementDefinition<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> {
395
- constructor(type: TType, nameOrConfig?: PartialFASTElementDefinition | string);
396
401
  readonly attributeLookup: Record<string, AttributeDefinition>;
397
402
  readonly attributes: ReadonlyArray<AttributeDefinition>;
403
+ static compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
398
404
  define(registry?: CustomElementRegistry): this;
399
- readonly elementOptions?: ElementDefinitionOptions;
405
+ readonly elementOptions: ElementDefinitionOptions;
400
406
  static readonly getByType: (key: Function) => FASTElementDefinition<Constructable<HTMLElement>> | undefined;
401
407
  static readonly getForInstance: (object: any) => FASTElementDefinition<Constructable<HTMLElement>> | undefined;
402
408
  get isDefined(): boolean;
403
409
  readonly name: string;
404
410
  readonly propertyLookup: Record<string, AttributeDefinition>;
405
- readonly shadowOptions?: ShadowRootInit;
411
+ // @internal
412
+ static registerBaseType(type: Function): void;
413
+ readonly registry: CustomElementRegistry;
414
+ readonly shadowOptions?: ShadowRootOptions;
406
415
  readonly styles?: ElementStyles;
407
416
  readonly template?: ElementViewTemplate;
408
417
  readonly type: TType;
409
418
  }
410
419
 
411
- // Warning: (ae-internal-missing-underscore) The name "FASTGlobal" should be prefixed with an underscore because the declaration is marked as @internal
412
- //
413
- // @internal
420
+ // @public
414
421
  export interface FASTGlobal {
415
422
  addMessages(messages: Record<number, string>): void;
416
- error(code: number, ...args: any[]): Error;
423
+ error(code: number, values?: Record<string, any>): Error;
417
424
  getById<T>(id: string | number): T | null;
418
425
  // (undocumented)
419
426
  getById<T>(id: string | number, initialize: () => T): T;
420
427
  readonly versions: string[];
421
- warn(code: number, ...args: any[]): void;
428
+ warn(code: number, values?: Record<string, any>): void;
422
429
  }
423
430
 
424
431
  // @public
425
- export function html<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]): ViewTemplate<TSource, TParent>;
432
+ export interface HostBehavior<TSource = any> {
433
+ addedCallback?(controller: HostController<TSource>): void;
434
+ connectedCallback?(controller: HostController<TSource>): void;
435
+ disconnectedCallback?(controller: HostController<TSource>): void;
436
+ removedCallback?(controller: HostController<TSource>): void;
437
+ }
426
438
 
427
439
  // @public
428
- export class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, Aspected {
429
- constructor(binding: Binding, mode: BindingMode, options: any);
430
- aspectType: Aspect;
431
- // (undocumented)
432
- binding: Binding;
433
- createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
440
+ export interface HostController<TSource = any> {
441
+ addBehavior(behavior: HostBehavior<TSource>): void;
442
+ addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
443
+ readonly isConnected: boolean;
444
+ mainStyles: ElementStyles | null;
445
+ removeBehavior(behavior: HostBehavior<TSource>, force?: boolean): void;
446
+ removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
447
+ readonly source: TSource;
448
+ }
449
+
450
+ // @public
451
+ export const html: HTMLTemplateTag;
452
+
453
+ // @public
454
+ export class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, ViewBehavior, Aspected {
455
+ constructor(dataBinding: Binding);
456
+ aspectType: DOMAspect;
457
+ // @internal (undocumented)
458
+ bind(controller: ViewController): void;
459
+ createBehavior(): ViewBehavior;
434
460
  createHTML(add: AddViewBehaviorFactory): string;
435
- id: string;
436
461
  // (undocumented)
437
- mode: BindingMode;
438
- nodeId: string;
439
- // (undocumented)
440
- options: any;
462
+ dataBinding: Binding;
463
+ // @internal (undocumented)
464
+ handleChange(binding: Expression, observer: ExpressionObserver): void;
465
+ // @internal (undocumented)
466
+ handleEvent(event: Event): void;
467
+ id: string;
468
+ policy: DOMPolicy;
441
469
  sourceAspect: string;
442
470
  targetAspect: string;
471
+ targetNodeId: string;
472
+ targetTagName: string | null;
473
+ // @internal (undocumented)
474
+ unbind(controller: ViewController): void;
443
475
  }
444
476
 
445
477
  // @public
@@ -452,6 +484,7 @@ export const HTMLDirective: Readonly<{
452
484
  getForInstance: (object: any) => HTMLDirectiveDefinition<Constructable<HTMLDirective>> | undefined;
453
485
  getByType: (key: Function) => HTMLDirectiveDefinition<Constructable<HTMLDirective>> | undefined;
454
486
  define<TType extends Constructable<HTMLDirective>>(type: TType, options?: PartialHTMLDirectiveDefinition): TType;
487
+ assignAspect(directive: Aspected, value?: string): void;
455
488
  }>;
456
489
 
457
490
  // @public
@@ -468,21 +501,55 @@ export interface HTMLTemplateCompilationResult<TSource = any, TParent = any> {
468
501
  }
469
502
 
470
503
  // @public
471
- export class HTMLView<TSource = any, TParent = any> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent> {
472
- constructor(fragment: DocumentFragment, factories: ReadonlyArray<ViewBehaviorFactory>, targets: ViewBehaviorTargets);
504
+ export type HTMLTemplateTag = (<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]) => ViewTemplate<TSource, TParent>) & {
505
+ partial(html: string): InlineTemplateDirective;
506
+ };
507
+
508
+ // @public
509
+ export class HTMLView<TSource = any, TParent = any> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent>, ExecutionContext<TParent> {
510
+ constructor(fragment: DocumentFragment, factories: ReadonlyArray<CompiledViewBehaviorFactory>, targets: ViewBehaviorTargets);
473
511
  appendTo(node: Node): void;
474
- bind(source: TSource, context: ExecutionContext<TParent>): void;
475
- context: ExecutionContext<TParent> | null;
512
+ bind(source: TSource, context?: ExecutionContext<TParent>): void;
513
+ context: ExecutionContext<TParent>;
476
514
  dispose(): void;
477
515
  static disposeContiguousBatch(views: SyntheticView[]): void;
516
+ get event(): Event;
517
+ eventDetail<TDetail>(): TDetail;
518
+ eventTarget<TTarget extends EventTarget>(): TTarget;
478
519
  firstChild: Node;
520
+ index: number;
479
521
  insertBefore(node: Node): void;
522
+ isBound: boolean;
523
+ get isEven(): boolean;
524
+ get isFirst(): boolean;
525
+ get isInMiddle(): boolean;
526
+ get isLast(): boolean;
527
+ get isOdd(): boolean;
480
528
  lastChild: Node;
529
+ length: number;
530
+ // (undocumented)
531
+ onUnbind(behavior: {
532
+ unbind(controller: ViewController<TSource, TParent>): any;
533
+ }): void;
534
+ readonly parent: TParent;
535
+ readonly parentContext: ExecutionContext<TParent>;
481
536
  remove(): void;
482
537
  source: TSource | null;
538
+ readonly sourceLifetime: SourceLifetime;
539
+ // (undocumented)
540
+ readonly targets: ViewBehaviorTargets;
541
+ // @internal
542
+ toJSON: () => undefined;
483
543
  unbind(): void;
484
544
  }
485
545
 
546
+ // @public
547
+ export class InlineTemplateDirective implements HTMLDirective {
548
+ constructor(html: string, factories?: Record<string, ViewBehaviorFactory>);
549
+ createHTML(add: AddViewBehaviorFactory): string;
550
+ static readonly empty: InlineTemplateDirective;
551
+ }
552
+
486
553
  // @public
487
554
  export interface LengthObserver extends Subscriber {
488
555
  length: number;
@@ -491,6 +558,9 @@ export interface LengthObserver extends Subscriber {
491
558
  // @public
492
559
  export function lengthOf<T>(array: readonly T[]): number;
493
560
 
561
+ // @public
562
+ export function listener<T = any>(expression: Expression<T>, options?: AddEventListenerOptions): Binding<T>;
563
+
494
564
  // @public
495
565
  export const Markup: Readonly<{
496
566
  interpolation: (id: string) => string;
@@ -498,13 +568,6 @@ export const Markup: Readonly<{
498
568
  comment: (id: string) => string;
499
569
  }>;
500
570
 
501
- // Warning: (ae-internal-missing-underscore) The name "Mutable" should be prefixed with an underscore because the declaration is marked as @internal
502
- //
503
- // @internal
504
- export type Mutable<T> = {
505
- -readonly [P in keyof T]: T[P];
506
- };
507
-
508
571
  // @public
509
572
  export interface NodeBehaviorOptions<T = any> {
510
573
  filter?: ElementsFilter;
@@ -513,16 +576,22 @@ export interface NodeBehaviorOptions<T = any> {
513
576
 
514
577
  // @public
515
578
  export abstract class NodeObservationDirective<T extends NodeBehaviorOptions> extends StatelessAttachedAttributeDirective<T> {
516
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
579
+ bind(controller: ViewController): void;
517
580
  protected computeNodes(target: any): Node[];
518
581
  protected abstract disconnect(target: any): void;
519
582
  protected abstract getNodes(target: any): Node[];
520
583
  protected getSource(target: Node): any;
584
+ get id(): string;
585
+ set id(value: string);
521
586
  protected abstract observe(target: any): void;
522
- unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
587
+ targetNodeId: string;
588
+ unbind(controller: ViewController): void;
523
589
  protected updateTarget(source: any, value: ReadonlyArray<any>): void;
524
590
  }
525
591
 
592
+ // @public
593
+ export function normalizeBinding<TSource = any, TReturn = any, TParent = any>(value: Expression<TSource, TReturn, TParent> | Binding<TSource, TReturn, TParent> | {}): Binding<TSource, TReturn, TParent>;
594
+
526
595
  // @public
527
596
  export interface Notifier {
528
597
  notify(args: any): void;
@@ -531,6 +600,9 @@ export interface Notifier {
531
600
  unsubscribe(subscriber: Subscriber, propertyToUnwatch?: any): void;
532
601
  }
533
602
 
603
+ // @public
604
+ export const nullableBooleanConverter: ValueConverter;
605
+
534
606
  // @public
535
607
  export const nullableNumberConverter: ValueConverter;
536
608
 
@@ -543,8 +615,8 @@ export const Observable: Readonly<{
543
615
  notify(source: unknown, args: any): void;
544
616
  defineProperty(target: {}, nameOrAccessor: string | Accessor): void;
545
617
  getAccessors: (target: {}) => Accessor[];
546
- binding<TSource = any, TReturn = any>(binding: Binding<TSource, TReturn, any>, initialSubscriber?: Subscriber, isVolatileBinding?: boolean): BindingObserver<TSource, TReturn, any>;
547
- isVolatileBinding<TSource_1 = any, TReturn_1 = any>(binding: Binding<TSource_1, TReturn_1, any>): boolean;
618
+ binding<TSource = any, TReturn = any>(expression: Expression<TSource, TReturn, any>, initialSubscriber?: Subscriber, isVolatileBinding?: boolean): ExpressionNotifier<TSource, TReturn, any>;
619
+ isVolatileBinding<TSource_1 = any, TReturn_1 = any>(expression: Expression<TSource_1, TReturn_1, any>): boolean;
548
620
  }>;
549
621
 
550
622
  // @public
@@ -557,15 +629,7 @@ export interface ObservationRecord {
557
629
  }
558
630
 
559
631
  // @public
560
- export const onChange: BindingConfig<AddEventListenerOptions> & BindingConfigResolver<AddEventListenerOptions>;
561
-
562
- // @public
563
- export const oneTime: BindingConfig<AddEventListenerOptions> & BindingConfigResolver<AddEventListenerOptions>;
564
-
565
- // @public
566
- export class OneTimeBinding extends UpdateBinding {
567
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
568
- }
632
+ export function oneTime<T = any>(expression: Expression<T>, policy?: DOMPolicy): Binding<T>;
569
633
 
570
634
  // @public
571
635
  export const Parser: Readonly<{
@@ -577,7 +641,8 @@ export interface PartialFASTElementDefinition {
577
641
  readonly attributes?: (AttributeConfiguration | string)[];
578
642
  readonly elementOptions?: ElementDefinitionOptions;
579
643
  readonly name: string;
580
- readonly shadowOptions?: Partial<ShadowRootInit> | null;
644
+ readonly registry?: CustomElementRegistry;
645
+ readonly shadowOptions?: Partial<ShadowRootOptions> | null;
581
646
  readonly styles?: ComposableStyles | ComposableStyles[];
582
647
  readonly template?: ElementViewTemplate;
583
648
  }
@@ -597,36 +662,37 @@ export class PropertyChangeNotifier implements Notifier {
597
662
  }
598
663
 
599
664
  // @public
600
- export const ref: <T = any>(propertyName: keyof T & string) => CaptureType<T>;
665
+ export const ref: <TSource = any, TParent = any>(propertyName: keyof TSource & string) => CaptureType<TSource, TParent>;
601
666
 
602
667
  // @public
603
668
  export class RefDirective extends StatelessAttachedAttributeDirective<string> {
604
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
605
- unbind(): void;
669
+ bind(controller: ViewController): void;
670
+ targetNodeId: string;
606
671
  }
607
672
 
608
673
  // @public
609
- export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ViewTemplate | Binding<TSource, ViewTemplate>, options?: RepeatOptions): CaptureType<TSource>;
674
+ export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>, TParent = any>(items: Expression<TSource, TArray, TParent> | Binding<TSource, TArray, TParent> | ReadonlyArray<any>, template: Expression<TSource, ViewTemplate<any, TSource>> | Binding<TSource, ViewTemplate<any, TSource>> | ViewTemplate<any, TSource>, options?: RepeatOptions): CaptureType<TSource, TParent>;
610
675
 
611
676
  // @public
612
- export class RepeatBehavior<TSource = any> implements Behavior, Subscriber {
613
- constructor(location: Node, itemsBinding: Binding<TSource, any[]>, isItemsBindingVolatile: boolean, templateBinding: Binding<TSource, SyntheticViewTemplate>, isTemplateBindingVolatile: boolean, options: RepeatOptions);
614
- bind(source: TSource, context: ExecutionContext): void;
615
- handleChange(source: any, args: Splice[]): void;
677
+ export class RepeatBehavior<TSource = any> implements ViewBehavior, Subscriber {
678
+ constructor(directive: RepeatDirective);
679
+ bind(controller: ViewController): void;
680
+ handleChange(source: any, args: Splice[] | ExpressionObserver): void;
616
681
  unbind(): void;
682
+ // @internal (undocumented)
683
+ views: SyntheticView[];
617
684
  }
618
685
 
619
686
  // @public
620
687
  export class RepeatDirective<TSource = any> implements HTMLDirective, ViewBehaviorFactory {
621
- constructor(itemsBinding: Binding, templateBinding: Binding<TSource, SyntheticViewTemplate>, options: RepeatOptions);
622
- createBehavior(targets: ViewBehaviorTargets): RepeatBehavior<TSource>;
688
+ constructor(dataBinding: Binding<TSource>, templateBinding: Binding<TSource, SyntheticViewTemplate>, options: RepeatOptions);
689
+ createBehavior(): RepeatBehavior<TSource>;
623
690
  createHTML(add: AddViewBehaviorFactory): string;
624
- id: string;
625
691
  // (undocumented)
626
- readonly itemsBinding: Binding;
627
- nodeId: string;
692
+ readonly dataBinding: Binding<TSource>;
628
693
  // (undocumented)
629
694
  readonly options: RepeatOptions;
695
+ targetNodeId: string;
630
696
  // (undocumented)
631
697
  readonly templateBinding: Binding<TSource, SyntheticViewTemplate>;
632
698
  }
@@ -638,7 +704,13 @@ export interface RepeatOptions {
638
704
  }
639
705
 
640
706
  // @public
641
- export function slotted<T = any>(propertyOrOptions: (keyof T & string) | SlottedDirectiveOptions<keyof T & string>): CaptureType<T>;
707
+ export interface ShadowRootOptions extends ShadowRootInit {
708
+ // @beta
709
+ registry?: CustomElementRegistry;
710
+ }
711
+
712
+ // @public
713
+ export function slotted<TSource = any, TParent = any>(propertyOrOptions: (keyof TSource & string) | SlottedDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
642
714
 
643
715
  // @public
644
716
  export class SlottedDirective extends NodeObservationDirective<SlottedDirectiveOptions> {
@@ -653,6 +725,15 @@ export class SlottedDirective extends NodeObservationDirective<SlottedDirectiveO
653
725
  export interface SlottedDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, AssignedNodesOptions {
654
726
  }
655
727
 
728
+ // @public
729
+ export const SourceLifetime: Readonly<{
730
+ readonly unknown: undefined;
731
+ readonly coupled: 1;
732
+ }>;
733
+
734
+ // @public
735
+ export type SourceLifetime = typeof SourceLifetime[keyof typeof SourceLifetime];
736
+
656
737
  // @public
657
738
  export class Splice {
658
739
  constructor(index: number, removed: any[], addedCount: number);
@@ -696,16 +777,15 @@ export const SpliceStrategySupport: Readonly<{
696
777
  export type SpliceStrategySupport = typeof SpliceStrategySupport[keyof typeof SpliceStrategySupport];
697
778
 
698
779
  // @public
699
- export abstract class StatelessAttachedAttributeDirective<T> implements HTMLDirective, ViewBehaviorFactory, ViewBehavior {
700
- constructor(options: T);
701
- abstract bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
702
- createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
780
+ export abstract class StatelessAttachedAttributeDirective<TOptions> implements HTMLDirective, ViewBehaviorFactory, ViewBehavior {
781
+ constructor(options: TOptions);
782
+ abstract bind(controller: ViewController): void;
783
+ createBehavior(): ViewBehavior;
703
784
  createHTML(add: AddViewBehaviorFactory): string;
704
- id: string;
705
- nodeId: string;
706
785
  // (undocumented)
707
- protected options: T;
708
- abstract unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
786
+ protected options: TOptions;
787
+ // @internal
788
+ toJSON: () => undefined;
709
789
  }
710
790
 
711
791
  // @public
@@ -715,7 +795,7 @@ export interface StyleStrategy {
715
795
  }
716
796
 
717
797
  // @public
718
- export interface StyleTarget {
798
+ export interface StyleTarget extends Pick<Node, "getRootNode"> {
719
799
  adoptedStyleSheets?: CSSStyleSheet[];
720
800
  append(styles: HTMLStyleElement): void;
721
801
  querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
@@ -754,15 +834,11 @@ export interface SyntheticView<TSource = any, TParent = any> extends View<TSourc
754
834
  // @public
755
835
  export interface SyntheticViewTemplate<TSource = any, TParent = any> {
756
836
  create(): SyntheticView<TSource, TParent>;
837
+ inline(): CaptureType<TSource, TParent>;
757
838
  }
758
839
 
759
840
  // @public
760
- export type TemplateValue<TSource, TParent = any> = Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource>;
761
-
762
- // @public
763
- export type TrustedTypes = {
764
- createPolicy(name: string, rules: TrustedTypesPolicy): TrustedTypesPolicy;
765
- };
841
+ export type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource, TParent>;
766
842
 
767
843
  // @public
768
844
  export type TrustedTypesPolicy = {
@@ -789,18 +865,6 @@ export interface TypeRegistry<TDefinition extends TypeDefinition> {
789
865
  register(definition: TDefinition): boolean;
790
866
  }
791
867
 
792
- // @public
793
- export class UpdateBinding implements ViewBehavior {
794
- constructor(directive: HTMLBindingDirective, updateTarget: UpdateTarget);
795
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
796
- createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
797
- // (undocumented)
798
- readonly directive: HTMLBindingDirective;
799
- unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
800
- // (undocumented)
801
- protected updateTarget: UpdateTarget;
802
- }
803
-
804
868
  // @public
805
869
  export interface UpdateQueue {
806
870
  enqueue(callable: Callable): void;
@@ -812,14 +876,6 @@ export interface UpdateQueue {
812
876
  // @public
813
877
  export const Updates: UpdateQueue;
814
878
 
815
- // @public
816
- export type UpdateTarget = (this: UpdateTargetThis, target: Node, aspect: string, value: any, source: any, context: ExecutionContext) => void;
817
-
818
- // @public
819
- export interface UpdateTargetThis {
820
- directive: HTMLBindingDirective;
821
- }
822
-
823
879
  // @public
824
880
  export interface ValueConverter {
825
881
  fromView(value: any): any;
@@ -828,23 +884,24 @@ export interface ValueConverter {
828
884
 
829
885
  // @public
830
886
  export interface View<TSource = any, TParent = any> extends Disposable {
831
- bind(source: TSource, context: ExecutionContext<TParent>): void;
832
- readonly context: ExecutionContext<TParent> | null;
887
+ bind(source: TSource, context?: ExecutionContext<TParent>): void;
888
+ readonly context: ExecutionContext<TParent>;
833
889
  readonly source: TSource | null;
834
890
  unbind(): void;
835
891
  }
836
892
 
837
893
  // @public
838
894
  export interface ViewBehavior<TSource = any, TParent = any> {
839
- bind(source: TSource, context: ExecutionContext<TParent>, targets: ViewBehaviorTargets): void;
840
- unbind(source: TSource, context: ExecutionContext<TParent>, targets: ViewBehaviorTargets): void;
895
+ bind(controller: ViewController<TSource, TParent>): void;
841
896
  }
842
897
 
843
898
  // @public
844
899
  export interface ViewBehaviorFactory {
845
- createBehavior(targets: ViewBehaviorTargets): Behavior | ViewBehavior;
846
- id: string;
847
- nodeId: string;
900
+ createBehavior(): ViewBehavior;
901
+ id?: string;
902
+ policy?: DOMPolicy;
903
+ targetNodeId?: string;
904
+ targetTagName?: string | null;
848
905
  }
849
906
 
850
907
  // @public
@@ -852,20 +909,36 @@ export type ViewBehaviorTargets = {
852
909
  [id: string]: Node;
853
910
  };
854
911
 
912
+ // @public
913
+ export interface ViewController<TSource = any, TParent = any> extends ExpressionController<TSource, TParent> {
914
+ readonly targets: ViewBehaviorTargets;
915
+ }
916
+
855
917
  // @public
856
918
  export class ViewTemplate<TSource = any, TParent = any> implements ElementViewTemplate<TSource, TParent>, SyntheticViewTemplate<TSource, TParent> {
857
- constructor(html: string | HTMLTemplateElement, factories: Record<string, ViewBehaviorFactory>);
919
+ constructor(html: string | HTMLTemplateElement, factories?: Record<string, ViewBehaviorFactory>, policy?: DOMPolicy | undefined);
858
920
  create(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
921
+ static create<TSource = any, TParent = any>(strings: string[], values: TemplateValue<TSource, TParent>[], policy?: DOMPolicy): ViewTemplate<TSource, TParent>;
859
922
  readonly factories: Record<string, ViewBehaviorFactory>;
860
923
  readonly html: string | HTMLTemplateElement;
861
- render(source: TSource, host: Node, hostBindingTarget?: Element, context?: ExecutionContext): HTMLView<TSource, TParent>;
924
+ inline(): CaptureType<TSource, TParent>;
925
+ render(source: TSource, host: Node, hostBindingTarget?: Element): HTMLView<TSource, TParent>;
926
+ // @internal
927
+ toJSON: () => undefined;
928
+ withPolicy(policy: DOMPolicy): this;
862
929
  }
863
930
 
864
931
  // @public
865
932
  export function volatile(target: {}, name: string | Accessor, descriptor: PropertyDescriptor): PropertyDescriptor;
866
933
 
867
934
  // @public
868
- export function when<TSource = any, TReturn = any>(binding: Binding<TSource, TReturn>, templateOrTemplateBinding: SyntheticViewTemplate | Binding<TSource, SyntheticViewTemplate>): CaptureType<TSource>;
935
+ 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>;
936
+
937
+ // Warnings were encountered during analysis:
938
+ //
939
+ // 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
940
+ // 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
941
+ // 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
869
942
 
870
943
  // (No @packageDocumentation comment for this package)
871
944