@microsoft/fast-element 2.0.0-beta.1 → 2.0.0-beta.10

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 (96) hide show
  1. package/CHANGELOG.json +333 -0
  2. package/CHANGELOG.md +106 -1
  3. package/dist/dts/components/attributes.d.ts +10 -0
  4. package/dist/dts/components/{controller.d.ts → element-controller.d.ts} +24 -25
  5. package/dist/dts/components/fast-definitions.d.ts +43 -9
  6. package/dist/dts/components/fast-element.d.ts +15 -21
  7. package/dist/dts/context.d.ts +157 -0
  8. package/dist/dts/di/di.d.ts +899 -0
  9. package/dist/dts/index.d.ts +2 -2
  10. package/dist/dts/interfaces.d.ts +44 -12
  11. package/dist/dts/metadata.d.ts +25 -0
  12. package/dist/dts/observation/arrays.d.ts +1 -1
  13. package/dist/dts/observation/observable.d.ts +101 -75
  14. package/dist/dts/pending-task.d.ts +20 -0
  15. package/dist/dts/platform.d.ts +6 -0
  16. package/dist/dts/state/exports.d.ts +3 -0
  17. package/dist/dts/state/reactive.d.ts +8 -0
  18. package/dist/dts/state/state.d.ts +141 -0
  19. package/dist/dts/state/visitor.d.ts +6 -0
  20. package/dist/dts/state/watch.d.ts +10 -0
  21. package/dist/dts/styles/css-directive.d.ts +2 -2
  22. package/dist/dts/styles/element-styles.d.ts +9 -3
  23. package/dist/dts/styles/host.d.ts +68 -0
  24. package/dist/dts/templating/binding-signal.d.ts +21 -0
  25. package/dist/dts/templating/binding-two-way.d.ts +39 -0
  26. package/dist/dts/templating/binding.d.ts +69 -294
  27. package/dist/dts/templating/children.d.ts +1 -1
  28. package/dist/dts/templating/compiler.d.ts +1 -2
  29. package/dist/dts/templating/html-directive.d.ts +93 -35
  30. package/dist/dts/templating/node-observation.d.ts +4 -5
  31. package/dist/dts/templating/ref.d.ts +5 -13
  32. package/dist/dts/templating/render.d.ts +272 -0
  33. package/dist/dts/templating/repeat.d.ts +20 -75
  34. package/dist/dts/templating/slotted.d.ts +1 -1
  35. package/dist/dts/templating/template.d.ts +12 -61
  36. package/dist/dts/templating/view.d.ts +77 -12
  37. package/dist/dts/templating/when.d.ts +3 -3
  38. package/dist/dts/testing/exports.d.ts +3 -0
  39. package/dist/dts/testing/fakes.d.ts +4 -0
  40. package/dist/dts/testing/fixture.d.ts +84 -0
  41. package/dist/dts/testing/timeout.d.ts +7 -0
  42. package/dist/{tsdoc-metadata.json → dts/tsdoc-metadata.json} +0 -0
  43. package/dist/dts/utilities.d.ts +0 -18
  44. package/dist/esm/components/attributes.js +13 -4
  45. package/dist/esm/components/{controller.js → element-controller.js} +95 -105
  46. package/dist/esm/components/fast-definitions.js +38 -28
  47. package/dist/esm/components/fast-element.js +31 -12
  48. package/dist/esm/context.js +163 -0
  49. package/dist/esm/debug.js +36 -4
  50. package/dist/esm/di/di.js +1435 -0
  51. package/dist/esm/index.js +2 -1
  52. package/dist/esm/interfaces.js +4 -0
  53. package/dist/esm/metadata.js +60 -0
  54. package/dist/esm/observation/arrays.js +304 -3
  55. package/dist/esm/observation/observable.js +81 -87
  56. package/dist/esm/pending-task.js +16 -0
  57. package/dist/esm/platform.js +25 -1
  58. package/dist/esm/state/exports.js +3 -0
  59. package/dist/esm/state/reactive.js +34 -0
  60. package/dist/esm/state/state.js +148 -0
  61. package/dist/esm/state/visitor.js +28 -0
  62. package/dist/esm/state/watch.js +36 -0
  63. package/dist/esm/styles/css.js +4 -4
  64. package/dist/esm/styles/element-styles.js +14 -0
  65. package/dist/esm/{observation/behavior.js → styles/host.js} +0 -0
  66. package/dist/esm/templating/binding-signal.js +83 -0
  67. package/dist/esm/templating/binding-two-way.js +103 -0
  68. package/dist/esm/templating/binding.js +134 -414
  69. package/dist/esm/templating/compiler.js +30 -7
  70. package/dist/esm/templating/html-directive.js +100 -28
  71. package/dist/esm/templating/node-observation.js +9 -8
  72. package/dist/esm/templating/ref.js +4 -12
  73. package/dist/esm/templating/render.js +391 -0
  74. package/dist/esm/templating/repeat.js +96 -72
  75. package/dist/esm/templating/template.js +11 -29
  76. package/dist/esm/templating/view.js +107 -29
  77. package/dist/esm/templating/when.js +5 -4
  78. package/dist/esm/testing/exports.js +3 -0
  79. package/dist/esm/testing/fakes.js +76 -0
  80. package/dist/esm/testing/fixture.js +86 -0
  81. package/dist/esm/testing/timeout.js +24 -0
  82. package/dist/esm/utilities.js +0 -95
  83. package/dist/fast-element.api.json +9034 -10524
  84. package/dist/fast-element.d.ts +707 -811
  85. package/dist/fast-element.debug.js +1133 -850
  86. package/dist/fast-element.debug.min.js +1 -1
  87. package/dist/fast-element.js +1097 -846
  88. package/dist/fast-element.min.js +1 -1
  89. package/dist/fast-element.untrimmed.d.ts +724 -818
  90. package/docs/api-report.md +264 -305
  91. package/package.json +39 -10
  92. package/dist/dts/hooks.d.ts +0 -20
  93. package/dist/dts/observation/behavior.d.ts +0 -19
  94. package/dist/dts/observation/splice-strategies.d.ts +0 -13
  95. package/dist/esm/hooks.js +0 -32
  96. package/dist/esm/observation/splice-strategies.js +0 -400
@@ -24,7 +24,7 @@ export declare interface Accessor {
24
24
  * Used to add behaviors when constructing styles.
25
25
  * @public
26
26
  */
27
- export declare type AddBehavior = (behavior: Behavior<HTMLElement>) => void;
27
+ export declare type AddBehavior = (behavior: HostBehavior<HTMLElement>) => void;
28
28
 
29
29
  /**
30
30
  * Used to add behavior factories when constructing templates.
@@ -115,8 +115,10 @@ export declare const Aspect: Readonly<{
115
115
  *
116
116
  * @param directive - The directive to assign the aspect to.
117
117
  * @param value - The value to base the aspect determination on.
118
+ * @remarks
119
+ * If a falsy value is provided, then the content aspect will be assigned.
118
120
  */
119
- readonly assign: (directive: Aspected, value: string) => void;
121
+ readonly assign: (directive: Aspected, value?: string) => void;
120
122
  }>;
121
123
 
122
124
  /**
@@ -145,7 +147,7 @@ export declare interface Aspected {
145
147
  /**
146
148
  * A binding if one is associated with the aspect.
147
149
  */
148
- binding?: Binding;
150
+ dataBinding?: Binding;
149
151
  }
150
152
 
151
153
  /**
@@ -174,6 +176,17 @@ export declare type AttributeConfiguration = {
174
176
  converter?: ValueConverter;
175
177
  };
176
178
 
179
+ /**
180
+ * Metadata used to configure a custom attribute's behavior.
181
+ * @public
182
+ */
183
+ export declare const AttributeConfiguration: Readonly<{
184
+ /**
185
+ * Locates all attribute configurations associated with a type.
186
+ */
187
+ locate: (target: {}) => AttributeConfiguration[];
188
+ }>;
189
+
177
190
  /**
178
191
  * An implementation of {@link Accessor} that supports reactivity,
179
192
  * change callbacks, attribute reflection, and type conversion for
@@ -246,121 +259,38 @@ export declare class AttributeDefinition implements Accessor {
246
259
  export declare type AttributeMode = typeof reflectMode | typeof booleanMode | "fromView";
247
260
 
248
261
  /**
249
- * Represents an object that can contribute behavior to a view or
250
- * element's bind/unbind operations.
251
- * @public
252
- */
253
- export declare interface Behavior<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = RootContext> {
254
- /**
255
- * Bind this behavior to the source.
256
- * @param source - The source to bind to.
257
- * @param context - The execution context that the binding is operating within.
258
- */
259
- bind(source: TSource, context: TContext): void;
260
- /**
261
- * Unbinds this behavior from the source.
262
- * @param source - The source to unbind from.
263
- */
264
- unbind(source: TSource, context: TContext): void;
265
- }
266
-
267
- /**
268
- * Creates a binding directive with the specified configuration.
269
- * @param binding - The binding expression.
270
- * @param config - The binding configuration.
271
- * @returns A binding directive.
272
- * @public
273
- */
274
- export declare function bind<T = any>(binding: Binding<T>, config?: BindingConfig | DefaultBindingOptions): CaptureType<T>;
275
-
276
- /**
277
- * The signature of an arrow function capable of being evaluated
278
- * as part of a template binding update.
279
- * @public
280
- */
281
- export declare type Binding<TSource = any, TReturn = any, TContext extends ExecutionContext = ExecutionContext> = (source: TSource, context: TContext) => TReturn;
282
-
283
- /**
284
- * Describes the configuration for a binding expression.
285
- * @public
286
- */
287
- export declare interface BindingConfig<T = any> {
288
- /**
289
- * The binding mode to configure the binding with.
290
- */
291
- mode: BindingMode;
292
- /**
293
- * Options to be supplied to the binding behaviors.
294
- */
295
- options: T;
296
- }
297
-
298
- /**
299
- * Describes the configuration for a binding expression.
300
- * @public
301
- */
302
- export declare const BindingConfig: Readonly<{
303
- /**
304
- * Creates a binding configuration based on the provided mode and options.
305
- * @param mode - The mode to use for the configuration.
306
- * @param defaultOptions - The default options to use for the configuration.
307
- * @returns A new binding configuration.
308
- */
309
- define<T>(mode: BindingMode, defaultOptions: T): BindingConfig<T> & BindingConfigResolver<T>;
310
- }>;
311
-
312
- /**
313
- * Creates a new binding configuration based on the supplied options.
314
- * @public
315
- */
316
- export declare type BindingConfigResolver<T> = (options: T) => BindingConfig<T>;
317
-
318
- /**
319
- * Describes how aspects of an HTML element will be affected by bindings.
320
- * @public
321
- */
322
- export declare type BindingMode = Record<Aspect, (directive: HTMLBindingDirective) => Pick<ViewBehaviorFactory, "createBehavior">>;
323
-
324
- /**
325
- * Describes how aspects of an HTML element will be affected by bindings.
262
+ * Creates an standard binding.
263
+ * @param binding - The binding to refresh when changed.
264
+ * @param isVolatile - Indicates whether the binding is volatile or not.
265
+ * @returns A binding configuration.
326
266
  * @public
327
267
  */
328
- export declare const BindingMode: Readonly<{
329
- /**
330
- * Creates a binding mode based on the supplied behavior types.
331
- * @param UpdateType - The base behavior type used to update aspects.
332
- * @param EventType - The base behavior type used to respond to events.
333
- * @returns A new binding mode.
334
- */
335
- define(UpdateType: typeof UpdateBinding, EventType?: typeof EventBinding): BindingMode;
336
- }>;
268
+ export declare function bind<T = any>(binding: Expression<T>, isVolatile?: boolean): Binding<T>;
337
269
 
338
270
  /**
339
- * Enables evaluation of and subscription to a binding.
271
+ * Captures a binding expression along with related information and capabilities.
272
+ *
340
273
  * @public
341
274
  */
342
- export declare interface BindingObserver<TSource = any, TReturn = any, TParent = any> extends Notifier, Disposable {
275
+ export declare abstract class Binding<TSource = any, TReturn = any, TParent = any> {
276
+ evaluate: Expression<TSource, TReturn, TParent>;
277
+ isVolatile: boolean;
343
278
  /**
344
- * Begins observing the binding for the source and returns the current value.
345
- * @param source - The source that the binding is based on.
346
- * @param context - The execution context to execute the binding within.
347
- * @returns The value of the binding.
279
+ * Options associated with the binding.
348
280
  */
349
- observe(source: TSource, context?: ExecutionContext<TParent>): TReturn;
281
+ options?: any;
350
282
  /**
351
- * Gets {@link ObservationRecord|ObservationRecords} that the {@link BindingObserver}
352
- * is observing.
283
+ * Creates a binding.
284
+ * @param evaluate - Evaluates the binding.
285
+ * @param isVolatile - Indicates whether the binding is volatile.
353
286
  */
354
- records(): IterableIterator<ObservationRecord>;
287
+ constructor(evaluate: Expression<TSource, TReturn, TParent>, isVolatile?: boolean);
355
288
  /**
356
- * Sets the update mode used by the observer.
357
- * @param isAsync - Indicates whether updates should be asynchronous.
358
- * @remarks
359
- * By default, the update mode is asynchronous, since that provides the best
360
- * performance for template rendering scenarios. Passing false to setMode will
361
- * instead cause the observer to notify subscribers immediately when changes occur.
289
+ * Creates an observer capable of notifying a subscriber when the output of a binding changes.
290
+ * @param directive - The HTML Directive to create the observer for.
291
+ * @param subscriber - The subscriber to changes in the binding.
362
292
  */
363
- setMode(isAsync: boolean): void;
293
+ abstract createObserver(directive: HTMLDirective, subscriber: Subscriber): ExpressionObserver<TSource, TReturn, TParent>;
364
294
  }
365
295
 
366
296
  /**
@@ -386,76 +316,7 @@ export declare type Callable = typeof Function.prototype.call | {
386
316
  * into templates.
387
317
  * @public
388
318
  */
389
- export declare interface CaptureType<TSource> {
390
- }
391
-
392
- /**
393
- * A binding behavior for bindings that change.
394
- * @public
395
- */
396
- export declare class ChangeBinding extends UpdateBinding {
397
- private isBindingVolatile;
398
- private observerProperty;
399
- /**
400
- * Creates an instance of ChangeBinding.
401
- * @param directive - The directive that has the configuration for this behavior.
402
- * @param updateTarget - The function used to update the target with the latest value.
403
- */
404
- constructor(directive: HTMLBindingDirective, updateTarget: UpdateTarget);
405
- /**
406
- * Returns the binding observer used to update the node.
407
- * @param target - The target node.
408
- * @returns A BindingObserver.
409
- */
410
- protected getObserver(target: Node): BindingObserver;
411
- /**
412
- * Bind this behavior to the source.
413
- * @param source - The source to bind to.
414
- * @param context - The execution context that the binding is operating within.
415
- * @param targets - The targets that behaviors in a view can attach to.
416
- */
417
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
418
- /**
419
- * Unbinds this behavior from the source.
420
- * @param source - The source to unbind from.
421
- * @param context - The execution context that the binding is operating within.
422
- * @param targets - The targets that behaviors in a view can attach to.
423
- */
424
- unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
425
- /* Excluded from this release type: handleChange */
426
- }
427
-
428
- /**
429
- * Transforms a template literal string into a ChildViewTemplate.
430
- * @param strings - The string fragments that are interpolated with the values.
431
- * @param values - The values that are interpolated with the string fragments.
432
- * @remarks
433
- * The html helper supports interpolation of strings, numbers, binding expressions,
434
- * other template instances, and Directive instances.
435
- * @public
436
- */
437
- export declare const child: <TChild = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TChild, TParent, ChildContext<TParent>>[]) => ChildViewTemplate<TChild, TParent>;
438
-
439
- /**
440
- * Provides additional contextual information when inside a child template.
441
- * @public
442
- */
443
- export declare interface ChildContext<TParentSource = any> extends RootContext {
444
- /**
445
- * The parent data source within a nested context.
446
- */
447
- readonly parent: TParentSource;
448
- /**
449
- * The parent execution context when in nested context scenarios.
450
- */
451
- readonly parentContext: ChildContext<TParentSource>;
452
- /**
453
- * Creates a new execution context descent suitable for use in list rendering.
454
- * @param item - The list item to serve as the source.
455
- * @param index - The index of the item in the list.
456
- * @param length - The length of the list.
457
- */
458
- createItemContext(index: number, length: number): ItemContext<TParentSource>;
319
+ export declare interface CaptureType<TSource, TParent> {
459
320
  }
460
321
 
461
322
  /**
@@ -471,7 +332,7 @@ export declare interface ChildListDirectiveOptions<T = any> extends NodeBehavior
471
332
  * @param propertyOrOptions - The options used to configure child node observation.
472
333
  * @public
473
334
  */
474
- export declare function children<T = any>(propertyOrOptions: (keyof T & string) | ChildrenDirectiveOptions<keyof T & string>): CaptureType<T>;
335
+ export declare function children<TSource = any, TParent = any>(propertyOrOptions: (keyof TSource & string) | ChildrenDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
475
336
 
476
337
  /**
477
338
  * The runtime behavior for child node observation.
@@ -508,18 +369,6 @@ export declare class ChildrenDirective extends NodeObservationDirective<Children
508
369
  */
509
370
  export declare type ChildrenDirectiveOptions<T = any> = ChildListDirectiveOptions<T> | SubtreeDirectiveOptions<T>;
510
371
 
511
- /**
512
- * A template capable of rendering child views not specifically connected to custom elements.
513
- * @public
514
- */
515
- export declare interface ChildViewTemplate<TSource = any, TParent = any> {
516
- type: "child";
517
- /**
518
- * Creates a SyntheticView instance based on this template definition.
519
- */
520
- create(): SyntheticView<TSource, TParent, ChildContext<TParent>>;
521
- }
522
-
523
372
  /**
524
373
  * A function capable of compiling a template from the preprocessed form produced
525
374
  * by the html template function into a result that can instantiate views.
@@ -559,7 +408,7 @@ export declare const Compiler: {
559
408
  * it is recommended that you clone the original and pass the clone to this API.
560
409
  * @public
561
410
  */
562
- compile<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>>(html: string | HTMLTemplateElement, directives: Record<string, ViewBehaviorFactory>): HTMLTemplateCompilationResult<TSource, TParent, TContext>;
411
+ compile<TSource = any, TParent = any>(html: string | HTMLTemplateElement, directives: Record<string, ViewBehaviorFactory>): HTMLTemplateCompilationResult<TSource, TParent>;
563
412
  /**
564
413
  * Sets the default compilation strategy that will be used by the ViewTemplate whenever
565
414
  * it needs to compile a view preprocessed with the html template function.
@@ -581,6 +430,10 @@ export declare const Compiler: {
581
430
  */
582
431
  export declare type ComposableStyles = string | ElementStyles | CSSStyleSheet;
583
432
 
433
+ declare function compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
434
+
435
+ declare function compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
436
+
584
437
  /**
585
438
  * Allows for the creation of Constructable mixin classes.
586
439
  *
@@ -603,120 +456,46 @@ export declare type ConstructibleStyleStrategy = {
603
456
  };
604
457
 
605
458
  /**
606
- * Controls the lifecycle and rendering of a `FASTElement`.
459
+ * A simple template that can create ContentView instances.
607
460
  * @public
608
461
  */
609
- export declare class Controller<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier {
610
- private boundObservables;
611
- private behaviors;
612
- private needsInitialization;
613
- private hasExistingShadowRoot;
614
- private _template;
615
- private _styles;
616
- private _isConnected;
617
- /**
618
- * This allows Observable.getNotifier(...) to return the Controller
619
- * when the notifier for the Controller itself is being requested. The
620
- * result is that the Observable system does not need to create a separate
621
- * instance of Notifier for observables on the Controller. The component and
622
- * the controller will now share the same notifier, removing one-object construct
623
- * per web component instance.
624
- */
625
- private readonly $fastController;
626
- /**
627
- * The element being controlled by this controller.
628
- */
629
- readonly element: TElement;
630
- /**
631
- * The element definition that instructs this controller
632
- * in how to handle rendering and other platform integrations.
633
- */
634
- readonly definition: FASTElementDefinition;
635
- /**
636
- * The view associated with the custom element.
637
- * @remarks
638
- * If `null` then the element is managing its own rendering.
639
- */
640
- readonly view: ElementView<TElement> | null;
641
- /**
642
- * Indicates whether or not the custom element has been
643
- * connected to the document.
644
- */
645
- get isConnected(): boolean;
646
- private setIsConnected;
647
- /**
648
- * Gets/sets the template used to render the component.
649
- * @remarks
650
- * This value can only be accurately read after connect but can be set at any time.
651
- */
652
- get template(): ElementViewTemplate<TElement> | null;
653
- set template(value: ElementViewTemplate<TElement> | null);
654
- /**
655
- * Gets/sets the primary styles used for the component.
656
- * @remarks
657
- * This value can only be accurately read after connect but can be set at any time.
658
- */
659
- get styles(): ElementStyles | null;
660
- set styles(value: ElementStyles | null);
661
- /* Excluded from this release type: __constructor */
662
- /**
663
- * Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot.
664
- * @param styles - The styles to add.
665
- */
666
- addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
667
- /**
668
- * Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot.
669
- * @param styles - the styles to remove.
670
- */
671
- removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
462
+ export declare interface ContentTemplate {
672
463
  /**
673
- * Adds behaviors to this element.
674
- * @param behaviors - The behaviors to add.
464
+ * Creates a simple content view instance.
675
465
  */
676
- addBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>): void;
677
- /**
678
- * Removes behaviors from this element.
679
- * @param behaviors - The behaviors to remove.
680
- * @param force - Forces unbinding of behaviors.
681
- */
682
- removeBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>, force?: boolean): void;
683
- /**
684
- * Runs connected lifecycle behavior on the associated element.
685
- */
686
- onConnectedCallback(): void;
466
+ create(): ContentView;
467
+ }
468
+
469
+ /**
470
+ * A simple View that can be interpolated into HTML content.
471
+ * @public
472
+ */
473
+ export declare interface ContentView {
474
+ readonly context: ExecutionContext;
687
475
  /**
688
- * Runs disconnected lifecycle behavior on the associated element.
476
+ * Binds a view's behaviors to its binding source.
477
+ * @param source - The binding source for the view's binding behaviors.
478
+ * @param context - The execution context to run the view within.
689
479
  */
690
- onDisconnectedCallback(): void;
480
+ bind(source: any, context?: ExecutionContext): void;
691
481
  /**
692
- * Runs the attribute changed callback for the associated element.
693
- * @param name - The name of the attribute that changed.
694
- * @param oldValue - The previous value of the attribute.
695
- * @param newValue - The new value of the attribute.
482
+ * Unbinds a view's behaviors from its binding source and context.
696
483
  */
697
- onAttributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
484
+ unbind(): void;
698
485
  /**
699
- * Emits a custom HTML event.
700
- * @param type - The type name of the event.
701
- * @param detail - The event detail object to send with the event.
702
- * @param options - The event options. By default bubbles and composed.
703
- * @remarks
704
- * Only emits events if connected.
486
+ * Inserts the view's DOM nodes before the referenced node.
487
+ * @param node - The node to insert the view's DOM before.
705
488
  */
706
- emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): void | boolean;
707
- private finishInitialization;
708
- private renderTemplate;
489
+ insertBefore(node: Node): void;
709
490
  /**
710
- * Locates or creates a controller for the specified element.
711
- * @param element - The element to return the controller for.
712
- * @remarks
713
- * The specified element must have a {@link FASTElementDefinition}
714
- * registered either through the use of the {@link customElement}
715
- * decorator or a call to `FASTElement.define`.
491
+ * Removes the view's DOM nodes.
492
+ * The nodes are not disposed and the view can later be re-inserted.
716
493
  */
717
- static forCustomElement(element: HTMLElement): Controller;
494
+ remove(): void;
718
495
  }
719
496
 
497
+ /* Excluded from this release type: createMetadataLocator */
498
+
720
499
  /* Excluded from this release type: createTypeRegistry */
721
500
 
722
501
  /**
@@ -821,20 +600,9 @@ export declare function customElement(nameOrDef: string | PartialFASTElementDefi
821
600
  */
822
601
  export declare type DecoratorAttributeConfiguration = Omit<AttributeConfiguration, "property">;
823
602
 
824
- /**
825
- * The default binding options.
826
- * @public
827
- */
828
- export declare type DefaultBindingOptions = AddEventListenerOptions;
603
+ declare function define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition): TType;
829
604
 
830
- /**
831
- * The default twoWay binding options.
832
- * @public
833
- */
834
- export declare type DefaultTwoWayBindingOptions = DefaultBindingOptions & {
835
- changeEvent?: string;
836
- fromView?: (value: any) => any;
837
- };
605
+ declare function define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): TType;
838
606
 
839
607
  /**
840
608
  * Provides a mechanism for releasing resources.
@@ -889,31 +657,145 @@ export declare const DOM: Readonly<{
889
657
  }>;
890
658
 
891
659
  /**
892
- * Creates a function that can be used to filter a Node array, selecting only elements.
893
- * @param selector - An optional selector to restrict the filter to.
894
- * @public
895
- */
896
- export declare const elements: (selector?: string) => ElementsFilter;
897
-
898
- /**
899
- * Elements filter function type.
900
- *
901
- * @public
902
- */
903
- export declare type ElementsFilter = (value: Node, index: number, array: Node[]) => boolean;
904
-
905
- /**
906
- * Represents styles that can be applied to a custom element.
660
+ * Controls the lifecycle and rendering of a `FASTElement`.
907
661
  * @public
908
662
  */
909
- export declare class ElementStyles {
910
- readonly styles: ReadonlyArray<ComposableStyles>;
911
- private targets;
912
- private _strategy;
913
- /**
914
- * The behaviors associated with this set of styles.
915
- */
916
- readonly behaviors: ReadonlyArray<Behavior<HTMLElement>> | null;
663
+ export declare class ElementController<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier implements HostController<TElement> {
664
+ private boundObservables;
665
+ private needsInitialization;
666
+ private hasExistingShadowRoot;
667
+ private _template;
668
+ private _isConnected;
669
+ private behaviors;
670
+ private _mainStyles;
671
+ /**
672
+ * This allows Observable.getNotifier(...) to return the Controller
673
+ * when the notifier for the Controller itself is being requested. The
674
+ * result is that the Observable system does not need to create a separate
675
+ * instance of Notifier for observables on the Controller. The component and
676
+ * the controller will now share the same notifier, removing one-object construct
677
+ * per web component instance.
678
+ */
679
+ private readonly $fastController;
680
+ /**
681
+ * The element being controlled by this controller.
682
+ */
683
+ readonly source: TElement;
684
+ /**
685
+ * The element definition that instructs this controller
686
+ * in how to handle rendering and other platform integrations.
687
+ */
688
+ readonly definition: FASTElementDefinition;
689
+ /**
690
+ * The view associated with the custom element.
691
+ * @remarks
692
+ * If `null` then the element is managing its own rendering.
693
+ */
694
+ readonly view: ElementView<TElement> | null;
695
+ /**
696
+ * Indicates whether or not the custom element has been
697
+ * connected to the document.
698
+ */
699
+ get isConnected(): boolean;
700
+ private setIsConnected;
701
+ /**
702
+ * Gets/sets the template used to render the component.
703
+ * @remarks
704
+ * This value can only be accurately read after connect but can be set at any time.
705
+ */
706
+ get template(): ElementViewTemplate<TElement> | null;
707
+ set template(value: ElementViewTemplate<TElement> | null);
708
+ /**
709
+ * The main set of styles used for the component, independent
710
+ * of any dynamically added styles.
711
+ */
712
+ get mainStyles(): ElementStyles | null;
713
+ set mainStyles(value: ElementStyles | null);
714
+ /* Excluded from this release type: __constructor */
715
+ /**
716
+ * Adds the behavior to the component.
717
+ * @param behavior - The behavior to add.
718
+ */
719
+ addBehavior(behavior: HostBehavior<TElement>): void;
720
+ /**
721
+ * Removes the behavior from the component.
722
+ * @param behavior - The behavior to remove.
723
+ * @param force - Forces removal even if this behavior was added more than once.
724
+ */
725
+ removeBehavior(behavior: HostBehavior<TElement>, force?: boolean): void;
726
+ /**
727
+ * Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot.
728
+ * @param styles - The styles to add.
729
+ */
730
+ addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
731
+ /**
732
+ * Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot.
733
+ * @param styles - the styles to remove.
734
+ */
735
+ removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
736
+ /**
737
+ * Runs connected lifecycle behavior on the associated element.
738
+ */
739
+ connect(): void;
740
+ /**
741
+ * Runs disconnected lifecycle behavior on the associated element.
742
+ */
743
+ disconnect(): void;
744
+ /**
745
+ * Runs the attribute changed callback for the associated element.
746
+ * @param name - The name of the attribute that changed.
747
+ * @param oldValue - The previous value of the attribute.
748
+ * @param newValue - The new value of the attribute.
749
+ */
750
+ onAttributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
751
+ /**
752
+ * Emits a custom HTML event.
753
+ * @param type - The type name of the event.
754
+ * @param detail - The event detail object to send with the event.
755
+ * @param options - The event options. By default bubbles and composed.
756
+ * @remarks
757
+ * Only emits events if connected.
758
+ */
759
+ emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): void | boolean;
760
+ private finishInitialization;
761
+ private renderTemplate;
762
+ /**
763
+ * Locates or creates a controller for the specified element.
764
+ * @param element - The element to return the controller for.
765
+ * @remarks
766
+ * The specified element must have a {@link FASTElementDefinition}
767
+ * registered either through the use of the {@link customElement}
768
+ * decorator or a call to `FASTElement.define`.
769
+ */
770
+ static forCustomElement(element: HTMLElement): ElementController;
771
+ }
772
+
773
+ /**
774
+ * Creates a function that can be used to filter a Node array, selecting only elements.
775
+ * @param selector - An optional selector to restrict the filter to.
776
+ * @public
777
+ */
778
+ export declare const elements: (selector?: string) => ElementsFilter;
779
+
780
+ /**
781
+ * Elements filter function type.
782
+ *
783
+ * @public
784
+ */
785
+ export declare type ElementsFilter = (value: Node, index?: number, array?: Node[]) => boolean;
786
+
787
+ /**
788
+ * Represents styles that can be applied to a custom element.
789
+ * @public
790
+ */
791
+ export declare class ElementStyles {
792
+ readonly styles: ReadonlyArray<ComposableStyles>;
793
+ private targets;
794
+ private _strategy;
795
+ /**
796
+ * The behaviors associated with this set of styles.
797
+ */
798
+ readonly behaviors: ReadonlyArray<HostBehavior<HTMLElement>> | null;
917
799
  /**
918
800
  * Gets the StyleStrategy associated with these element styles.
919
801
  */
@@ -930,7 +812,7 @@ export declare class ElementStyles {
930
812
  * Associates behaviors with this set of styles.
931
813
  * @param behaviors - The behaviors to associate.
932
814
  */
933
- withBehaviors(...behaviors: Behavior<HTMLElement>[]): this;
815
+ withBehaviors(...behaviors: HostBehavior<HTMLElement>[]): this;
934
816
  /**
935
817
  * Sets the strategy that handles adding/removing these styles for an element.
936
818
  * @param strategy - The strategy to use.
@@ -941,6 +823,12 @@ export declare class ElementStyles {
941
823
  * @param Strategy - The strategy type to construct.
942
824
  */
943
825
  static setDefaultStrategy(Strategy: ConstructibleStyleStrategy): void;
826
+ /**
827
+ * Normalizes a set of composable style options.
828
+ * @param styles - The style options to normalize.
829
+ * @returns A singular ElementStyles instance or undefined.
830
+ */
831
+ static normalize(styles: ComposableStyles | ComposableStyles[] | undefined): ElementStyles | undefined;
944
832
  /**
945
833
  * Indicates whether the DOM supports the adoptedStyleSheets feature.
946
834
  */
@@ -951,7 +839,7 @@ export declare class ElementStyles {
951
839
  * A View representing DOM nodes specifically for rendering the view of a custom element.
952
840
  * @public
953
841
  */
954
- export declare interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent, RootContext> {
842
+ export declare interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent> {
955
843
  /**
956
844
  * Appends the view's DOM nodes to the referenced node.
957
845
  * @param node - The parent node to append the view's DOM nodes to.
@@ -964,7 +852,6 @@ export declare interface ElementView<TSource = any, TParent = any> extends View<
964
852
  * @public
965
853
  */
966
854
  export declare interface ElementViewTemplate<TSource = any, TParent = any> {
967
- type: "element";
968
855
  /**
969
856
  * Creates an ElementView instance based on this template definition.
970
857
  * @param hostBindingTarget - The element that host behaviors will be bound to.
@@ -990,59 +877,162 @@ export declare interface ElementViewTemplate<TSource = any, TParent = any> {
990
877
  export declare const emptyArray: readonly never[];
991
878
 
992
879
  /**
993
- * A binding behavior for handling events.
880
+ * Provides additional contextual information available to behaviors and expressions.
994
881
  * @public
995
882
  */
996
- export declare class EventBinding {
997
- readonly directive: HTMLBindingDirective;
998
- private contextProperty;
999
- private sourceProperty;
883
+ export declare interface ExecutionContext<TParent = any> {
1000
884
  /**
1001
- * Creates an instance of EventBinding.
1002
- * @param directive - The directive that has the configuration for this behavior.
885
+ * The index of the current item within a repeat context.
1003
886
  */
1004
- constructor(directive: HTMLBindingDirective);
887
+ index: number;
1005
888
  /**
1006
- * Bind this behavior to the source.
1007
- * @param source - The source to bind to.
1008
- * @param context - The execution context that the binding is operating within.
1009
- * @param targets - The targets that behaviors in a view can attach to.
889
+ * The length of the current collection within a repeat context.
1010
890
  */
1011
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
891
+ length: number;
1012
892
  /**
1013
- * Unbinds this behavior from the source.
1014
- * @param source - The source to unbind from.
1015
- * @param context - The execution context that the binding is operating within.
1016
- * @param targets - The targets that behaviors in a view can attach to.
893
+ * The parent data source within a nested context.
1017
894
  */
1018
- unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
895
+ parent: TParent;
1019
896
  /**
1020
- * Creates a behavior.
1021
- * @param targets - The targets available for behaviors to be attached to.
897
+ * The parent execution context when in nested context scenarios.
1022
898
  */
1023
- createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
1024
- /* Excluded from this release type: handleEvent */
899
+ parentContext: ExecutionContext<TParent>;
900
+ /**
901
+ * The current event within an event handler.
902
+ */
903
+ readonly event: Event;
904
+ /**
905
+ * Indicates whether the current item within a repeat context
906
+ * has an even index.
907
+ */
908
+ readonly isEven: boolean;
909
+ /**
910
+ * Indicates whether the current item within a repeat context
911
+ * has an odd index.
912
+ */
913
+ readonly isOdd: boolean;
914
+ /**
915
+ * Indicates whether the current item within a repeat context
916
+ * is the first item in the collection.
917
+ */
918
+ readonly isFirst: boolean;
919
+ /**
920
+ * Indicates whether the current item within a repeat context
921
+ * is somewhere in the middle of the collection.
922
+ */
923
+ readonly isInMiddle: boolean;
924
+ /**
925
+ * Indicates whether the current item within a repeat context
926
+ * is the last item in the collection.
927
+ */
928
+ readonly isLast: boolean;
929
+ /**
930
+ * Returns the typed event detail of a custom event.
931
+ */
932
+ eventDetail<TDetail>(): TDetail;
933
+ /**
934
+ * Returns the typed event target of the event.
935
+ */
936
+ eventTarget<TTarget extends EventTarget>(): TTarget;
1025
937
  }
1026
938
 
1027
939
  /**
1028
- * The common execution context APIs.
940
+ * Provides additional contextual information available to behaviors and expressions.
1029
941
  * @public
1030
942
  */
1031
943
  export declare const ExecutionContext: Readonly<{
1032
- default: RootContext;
1033
- /* Excluded from this release type: setEvent */
1034
944
  /**
1035
- * Creates a new root execution context.
1036
- * @returns A new execution context.
945
+ * A default execution context.
946
+ */
947
+ default: ExecutionContext<any>;
948
+ /**
949
+ * Gets the current event.
950
+ * @returns An event object.
1037
951
  */
1038
- create(): RootContext;
952
+ getEvent(): Event | null;
953
+ /**
954
+ * Sets the current event.
955
+ * @param event - An event object.
956
+ */
957
+ setEvent(event: Event | null): void;
1039
958
  }>;
1040
959
 
1041
960
  /**
1042
- * Represents some sort of execution context.
961
+ * The signature of an arrow function capable of being evaluated
962
+ * against source data and within an execution context.
1043
963
  * @public
1044
964
  */
1045
- export declare type ExecutionContext<TParentSource = any> = RootContext | ChildContext<TParentSource> | ItemContext<TParentSource>;
965
+ export declare type Expression<TSource = any, TReturn = any, TParent = any> = (source: TSource, context: ExecutionContext<TParent>) => TReturn;
966
+
967
+ /**
968
+ * Controls the lifecycle of an expression and provides relevant context.
969
+ * @public
970
+ */
971
+ export declare interface ExpressionController<TSource = any, TParent = any> {
972
+ /**
973
+ * The source the expression is evaluated against.
974
+ */
975
+ readonly source: TSource;
976
+ /**
977
+ * Indicates how the source's lifetime relates to the controller's lifetime.
978
+ */
979
+ readonly sourceLifetime?: SourceLifetime;
980
+ /**
981
+ * The context the expression is evaluated against.
982
+ */
983
+ readonly context: ExecutionContext<TParent>;
984
+ /**
985
+ * Indicates whether the controller is bound.
986
+ */
987
+ readonly isBound: boolean;
988
+ /**
989
+ * Registers an unbind handler with the controller.
990
+ * @param behavior - An object to call when the controller unbinds.
991
+ */
992
+ onUnbind(behavior: {
993
+ unbind(controller: ExpressionController<TSource, TParent>): any;
994
+ }): void;
995
+ }
996
+
997
+ /**
998
+ * Enables evaluation of and subscription to a binding.
999
+ * @public
1000
+ */
1001
+ export declare interface ExpressionNotifier<TSource = any, TReturn = any, TParent = any> extends Notifier, ExpressionObserver<TSource, TReturn, TParent>, Disposable {
1002
+ /**
1003
+ * Observes the expression.
1004
+ * @param source - The source for the expression.
1005
+ * @param context - The context for the expression.
1006
+ */
1007
+ observe(source: TSource, context?: ExecutionContext): TReturn;
1008
+ /**
1009
+ * Gets {@link ObservationRecord|ObservationRecords} that the {@link ExpressionNotifier}
1010
+ * is observing.
1011
+ */
1012
+ records(): IterableIterator<ObservationRecord>;
1013
+ /**
1014
+ * Sets the update mode used by the observer.
1015
+ * @param isAsync - Indicates whether updates should be asynchronous.
1016
+ * @remarks
1017
+ * By default, the update mode is asynchronous, since that provides the best
1018
+ * performance for template rendering scenarios. Passing false to setMode will
1019
+ * instead cause the observer to notify subscribers immediately when changes occur.
1020
+ */
1021
+ setMode(isAsync: boolean): void;
1022
+ }
1023
+
1024
+ /**
1025
+ * Observes an expression for changes.
1026
+ * @public
1027
+ */
1028
+ export declare interface ExpressionObserver<TSource = any, TReturn = any, TParent = any> {
1029
+ /**
1030
+ * Binds the expression to the source.
1031
+ * @param controller - The controller that manages the lifecycle and related
1032
+ * context for the expression.
1033
+ */
1034
+ bind(controller: ExpressionController<TSource, TParent>): TReturn;
1035
+ }
1046
1036
 
1047
1037
  /* Excluded from this release type: FAST */
1048
1038
 
@@ -1055,7 +1045,7 @@ export declare interface FASTElement extends HTMLElement {
1055
1045
  * The underlying controller that handles the lifecycle and rendering of
1056
1046
  * this FASTElement.
1057
1047
  */
1058
- readonly $fastController: Controller;
1048
+ readonly $fastController: ElementController;
1059
1049
  /**
1060
1050
  * Emits a custom HTML event.
1061
1051
  * @param type - The type name of the event.
@@ -1096,23 +1086,11 @@ export declare interface FASTElement extends HTMLElement {
1096
1086
  * static helpers for working with FASTElements.
1097
1087
  * @public
1098
1088
  */
1099
- export declare const FASTElement: (new () => HTMLElement & FASTElement) & {
1100
- /**
1101
- * Creates a new FASTElement base class inherited from the
1102
- * provided base type.
1103
- * @param BaseType - The base element type to inherit from.
1104
- */
1105
- from<TBase extends {
1106
- new (): HTMLElement;
1107
- prototype: HTMLElement;
1108
- }>(BaseType: TBase): new () => InstanceType<TBase> & FASTElement;
1109
- /**
1110
- * Defines a platform custom element based on the provided type and definition.
1111
- * @param type - The custom element type to define.
1112
- * @param nameOrDef - The name of the element to define or a definition object
1113
- * that describes the element to define.
1114
- */
1115
- define<TType extends Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): TType;
1089
+ export declare const FASTElement: {
1090
+ new (): FASTElement;
1091
+ define: typeof define;
1092
+ compose: typeof compose;
1093
+ from: typeof from;
1116
1094
  };
1117
1095
 
1118
1096
  /**
@@ -1120,7 +1098,7 @@ export declare const FASTElement: (new () => HTMLElement & FASTElement) & {
1120
1098
  * @public
1121
1099
  */
1122
1100
  export declare class FASTElementDefinition<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> {
1123
- private observedAttributes;
1101
+ private platformDefined;
1124
1102
  /**
1125
1103
  * The type this element definition describes.
1126
1104
  */
@@ -1156,23 +1134,31 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
1156
1134
  /**
1157
1135
  * Options controlling the creation of the custom element's shadow DOM.
1158
1136
  */
1159
- readonly shadowOptions?: ShadowRootInit;
1137
+ readonly shadowOptions?: ShadowRootOptions;
1160
1138
  /**
1161
1139
  * Options controlling how the custom element is defined with the platform.
1162
1140
  */
1163
- readonly elementOptions?: ElementDefinitionOptions;
1141
+ readonly elementOptions: ElementDefinitionOptions;
1164
1142
  /**
1165
- * Creates an instance of FASTElementDefinition.
1166
- * @param type - The type this definition is being created for.
1167
- * @param nameOrConfig - The name of the element to define or a config object
1168
- * that describes the element to define.
1143
+ * The registry to register this component in by default.
1169
1144
  */
1170
- constructor(type: TType, nameOrConfig?: PartialFASTElementDefinition | string);
1145
+ readonly registry: CustomElementRegistry;
1146
+ private constructor();
1171
1147
  /**
1172
1148
  * Defines a custom element based on this definition.
1173
1149
  * @param registry - The element registry to define the element in.
1150
+ * @remarks
1151
+ * This operation is idempotent per registry.
1174
1152
  */
1175
1153
  define(registry?: CustomElementRegistry): this;
1154
+ /**
1155
+ * Creates an instance of FASTElementDefinition.
1156
+ * @param type - The type this definition is being created for.
1157
+ * @param nameOrDef - The name of the element to define or a config object
1158
+ * that describes the element to define.
1159
+ */
1160
+ static compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
1161
+ /* Excluded from this release type: registerBaseType */
1176
1162
  /**
1177
1163
  * Gets the element definition associated with the specified type.
1178
1164
  * @param type - The custom element type to retrieve the definition for.
@@ -1187,6 +1173,77 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
1187
1173
 
1188
1174
  /* Excluded from this release type: FASTGlobal */
1189
1175
 
1176
+ declare function from<TBase extends typeof HTMLElement>(BaseType: TBase): new () => InstanceType<TBase> & FASTElement;
1177
+
1178
+ /**
1179
+ * Represents an object that can contribute behavior to a host.
1180
+ * @public
1181
+ */
1182
+ export declare interface HostBehavior<TSource = any> {
1183
+ /**
1184
+ * Executed when this behavior is attached to a controller.
1185
+ * @param controller - Controls the behavior lifecycle.
1186
+ */
1187
+ addedCallback?(controller: HostController<TSource>): void;
1188
+ /**
1189
+ * Executed when this behavior is detached from a controller.
1190
+ * @param controller - Controls the behavior lifecycle.
1191
+ */
1192
+ removedCallback?(controller: HostController<TSource>): void;
1193
+ /**
1194
+ * Executed when this behavior's host is connected.
1195
+ * @param controller - Controls the behavior lifecycle.
1196
+ */
1197
+ connectedCallback?(controller: HostController<TSource>): void;
1198
+ /**
1199
+ * Executed when this behavior's host is disconnected.
1200
+ * @param controller - Controls the behavior lifecycle.
1201
+ */
1202
+ disconnectedCallback?(controller: HostController<TSource>): void;
1203
+ }
1204
+
1205
+ /**
1206
+ * Controls the lifecycle and context of behaviors and styles
1207
+ * associated with a component host.
1208
+ * @public
1209
+ */
1210
+ export declare interface HostController<TSource = any> {
1211
+ /**
1212
+ * The component source.
1213
+ */
1214
+ readonly source: TSource;
1215
+ /**
1216
+ * Indicates whether the host is connected or not.
1217
+ */
1218
+ readonly isConnected: boolean;
1219
+ /**
1220
+ * The main set of styles used for the component, independent
1221
+ * of any behavior-specific styles.
1222
+ */
1223
+ mainStyles: ElementStyles | null;
1224
+ /**
1225
+ * Adds the behavior to the component.
1226
+ * @param behavior - The behavior to add.
1227
+ */
1228
+ addBehavior(behavior: HostBehavior<TSource>): void;
1229
+ /**
1230
+ * Removes the behavior from the component.
1231
+ * @param behavior - The behavior to remove.
1232
+ * @param force - Forces removal even if this behavior was added more than once.
1233
+ */
1234
+ removeBehavior(behavior: HostBehavior<TSource>, force?: boolean): void;
1235
+ /**
1236
+ * Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot.
1237
+ * @param styles - The styles to add.
1238
+ */
1239
+ addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
1240
+ /**
1241
+ * Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot.
1242
+ * @param styles - the styles to remove.
1243
+ */
1244
+ removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
1245
+ }
1246
+
1190
1247
  /**
1191
1248
  * Transforms a template literal string into a ViewTemplate.
1192
1249
  * @param strings - The string fragments that are interpolated with the values.
@@ -1196,17 +1253,16 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
1196
1253
  * other template instances, and Directive instances.
1197
1254
  * @public
1198
1255
  */
1199
- export declare function html<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent, TContext>[]): ViewTemplate<TSource, TParent>;
1256
+ export declare function html<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]): ViewTemplate<TSource, TParent>;
1200
1257
 
1201
1258
  /**
1202
1259
  * A directive that applies bindings.
1203
1260
  * @public
1204
1261
  */
1205
- export declare class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, Aspected {
1206
- binding: Binding;
1207
- mode: BindingMode;
1208
- options: any;
1209
- private factory;
1262
+ export declare class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, ViewBehavior, Aspected {
1263
+ dataBinding: Binding;
1264
+ private data;
1265
+ private updateTarget;
1210
1266
  /**
1211
1267
  * The unique id of the factory.
1212
1268
  */
@@ -1229,11 +1285,9 @@ export declare class HTMLBindingDirective implements HTMLDirective, ViewBehavior
1229
1285
  aspectType: Aspect;
1230
1286
  /**
1231
1287
  * Creates an instance of HTMLBindingDirective.
1232
- * @param binding - The binding to apply.
1233
- * @param mode - The binding mode to use when applying the binding.
1234
- * @param options - The options to configure the binding with.
1288
+ * @param dataBinding - The binding configuration to apply.
1235
1289
  */
1236
- constructor(binding: Binding, mode: BindingMode, options: any);
1290
+ constructor(dataBinding: Binding);
1237
1291
  /**
1238
1292
  * Creates HTML to be used within a template.
1239
1293
  * @param add - Can be used to add behavior factories to a template.
@@ -1241,9 +1295,15 @@ export declare class HTMLBindingDirective implements HTMLDirective, ViewBehavior
1241
1295
  createHTML(add: AddViewBehaviorFactory): string;
1242
1296
  /**
1243
1297
  * Creates a behavior.
1244
- * @param targets - The targets available for behaviors to be attached to.
1245
1298
  */
1246
- createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
1299
+ createBehavior(): ViewBehavior;
1300
+ /* Excluded from this release type: bindDefault */
1301
+ /* Excluded from this release type: bind */
1302
+ /* Excluded from this release type: bindContent */
1303
+ /* Excluded from this release type: bindEvent */
1304
+ /* Excluded from this release type: unbind */
1305
+ /* Excluded from this release type: handleEvent */
1306
+ /* Excluded from this release type: handleChange */
1247
1307
  }
1248
1308
 
1249
1309
  /**
@@ -1303,149 +1363,157 @@ export declare interface HTMLDirectiveDefinition<TType extends Constructable<HTM
1303
1363
  * The result of a template compilation operation.
1304
1364
  * @public
1305
1365
  */
1306
- export declare interface HTMLTemplateCompilationResult<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> {
1366
+ export declare interface HTMLTemplateCompilationResult<TSource = any, TParent = any> {
1307
1367
  /**
1308
1368
  * Creates a view instance.
1309
1369
  * @param hostBindingTarget - The host binding target for the view.
1310
1370
  */
1311
- createView(hostBindingTarget?: Element): HTMLView<TSource, TParent, TContext>;
1371
+ createView(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
1312
1372
  }
1313
1373
 
1314
1374
  /**
1315
1375
  * The standard View implementation, which also implements ElementView and SyntheticView.
1316
1376
  * @public
1317
1377
  */
1318
- export declare class HTMLView<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent, TContext> {
1378
+ export declare class HTMLView<TSource = any, TParent = any> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent>, ExecutionContext<TParent> {
1319
1379
  private fragment;
1320
1380
  private factories;
1321
- private targets;
1381
+ readonly targets: ViewBehaviorTargets;
1322
1382
  private behaviors;
1383
+ private unbindables;
1323
1384
  /**
1324
1385
  * The data that the view is bound to.
1325
1386
  */
1326
1387
  source: TSource | null;
1388
+ /**
1389
+ * Indicates whether the controller is bound.
1390
+ */
1391
+ isBound: boolean;
1392
+ /**
1393
+ * Indicates how the source's lifetime relates to the controller's lifetime.
1394
+ */
1395
+ readonly sourceLifetime: SourceLifetime;
1327
1396
  /**
1328
1397
  * The execution context the view is running within.
1329
1398
  */
1330
- context: TContext | null;
1399
+ context: ExecutionContext<TParent>;
1331
1400
  /**
1332
- * The first DOM node in the range of nodes that make up the view.
1401
+ * The index of the current item within a repeat context.
1333
1402
  */
1334
- firstChild: Node;
1403
+ index: number;
1335
1404
  /**
1336
- * The last DOM node in the range of nodes that make up the view.
1405
+ * The length of the current collection within a repeat context.
1337
1406
  */
1338
- lastChild: Node;
1407
+ length: number;
1339
1408
  /**
1340
- * Constructs an instance of HTMLView.
1341
- * @param fragment - The html fragment that contains the nodes for this view.
1342
- * @param behaviors - The behaviors to be applied to this view.
1409
+ * The parent data source within a nested context.
1343
1410
  */
1344
- constructor(fragment: DocumentFragment, factories: ReadonlyArray<ViewBehaviorFactory>, targets: ViewBehaviorTargets);
1411
+ readonly parent: TParent;
1345
1412
  /**
1346
- * Appends the view's DOM nodes to the referenced node.
1347
- * @param node - The parent node to append the view's DOM nodes to.
1413
+ * The parent execution context when in nested context scenarios.
1348
1414
  */
1349
- appendTo(node: Node): void;
1415
+ readonly parentContext: ExecutionContext<TParent>;
1350
1416
  /**
1351
- * Inserts the view's DOM nodes before the referenced node.
1352
- * @param node - The node to insert the view's DOM before.
1417
+ * The current event within an event handler.
1353
1418
  */
1354
- insertBefore(node: Node): void;
1419
+ get event(): Event;
1355
1420
  /**
1356
- * Removes the view's DOM nodes.
1357
- * The nodes are not disposed and the view can later be re-inserted.
1421
+ * Indicates whether the current item within a repeat context
1422
+ * has an even index.
1358
1423
  */
1359
- remove(): void;
1424
+ get isEven(): boolean;
1360
1425
  /**
1361
- * Removes the view and unbinds its behaviors, disposing of DOM nodes afterward.
1362
- * Once a view has been disposed, it cannot be inserted or bound again.
1426
+ * Indicates whether the current item within a repeat context
1427
+ * has an odd index.
1363
1428
  */
1364
- dispose(): void;
1429
+ get isOdd(): boolean;
1365
1430
  /**
1366
- * Binds a view's behaviors to its binding source.
1367
- * @param source - The binding source for the view's binding behaviors.
1368
- * @param context - The execution context to run the behaviors within.
1431
+ * Indicates whether the current item within a repeat context
1432
+ * is the first item in the collection.
1369
1433
  */
1370
- bind(source: TSource, context: TContext): void;
1434
+ get isFirst(): boolean;
1371
1435
  /**
1372
- * Unbinds a view's behaviors from its binding source.
1436
+ * Indicates whether the current item within a repeat context
1437
+ * is somewhere in the middle of the collection.
1373
1438
  */
1374
- unbind(): void;
1439
+ get isInMiddle(): boolean;
1375
1440
  /**
1376
- * Efficiently disposes of a contiguous range of synthetic view instances.
1377
- * @param views - A contiguous range of views to be disposed.
1441
+ * Indicates whether the current item within a repeat context
1442
+ * is the last item in the collection.
1378
1443
  */
1379
- static disposeContiguousBatch(views: SyntheticView[]): void;
1380
- }
1381
-
1382
- /**
1383
- * Transforms a template literal string into an ItemViewTemplate.
1384
- * @param strings - The string fragments that are interpolated with the values.
1385
- * @param values - The values that are interpolated with the string fragments.
1386
- * @remarks
1387
- * The html helper supports interpolation of strings, numbers, binding expressions,
1388
- * other template instances, and Directive instances.
1389
- * @public
1390
- */
1391
- export declare const item: <TItem = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TItem, TParent, ItemContext<TParent>>[]) => ItemViewTemplate<TItem, TParent>;
1392
-
1393
- /**
1394
- * Provides additional contextual information when inside a repeat item template.s
1395
- * @public
1396
- */
1397
- export declare interface ItemContext<TParentSource = any> extends ChildContext<TParentSource> {
1444
+ get isLast(): boolean;
1398
1445
  /**
1399
- * The index of the current item within a repeat context.
1446
+ * Returns the typed event detail of a custom event.
1400
1447
  */
1401
- readonly index: number;
1448
+ eventDetail<TDetail>(): TDetail;
1402
1449
  /**
1403
- * The length of the current collection within a repeat context.
1450
+ * Returns the typed event target of the event.
1404
1451
  */
1405
- readonly length: number;
1452
+ eventTarget<TTarget extends EventTarget>(): TTarget;
1406
1453
  /**
1407
- * Indicates whether the current item within a repeat context
1408
- * has an even index.
1454
+ * The first DOM node in the range of nodes that make up the view.
1409
1455
  */
1410
- readonly isEven: boolean;
1456
+ firstChild: Node;
1411
1457
  /**
1412
- * Indicates whether the current item within a repeat context
1413
- * has an odd index.
1458
+ * The last DOM node in the range of nodes that make up the view.
1459
+ */
1460
+ lastChild: Node;
1461
+ /**
1462
+ * Constructs an instance of HTMLView.
1463
+ * @param fragment - The html fragment that contains the nodes for this view.
1464
+ * @param behaviors - The behaviors to be applied to this view.
1465
+ */
1466
+ constructor(fragment: DocumentFragment, factories: ReadonlyArray<ViewBehaviorFactory>, targets: ViewBehaviorTargets);
1467
+ /**
1468
+ * Appends the view's DOM nodes to the referenced node.
1469
+ * @param node - The parent node to append the view's DOM nodes to.
1470
+ */
1471
+ appendTo(node: Node): void;
1472
+ /**
1473
+ * Inserts the view's DOM nodes before the referenced node.
1474
+ * @param node - The node to insert the view's DOM before.
1475
+ */
1476
+ insertBefore(node: Node): void;
1477
+ /**
1478
+ * Removes the view's DOM nodes.
1479
+ * The nodes are not disposed and the view can later be re-inserted.
1414
1480
  */
1415
- readonly isOdd: boolean;
1481
+ remove(): void;
1416
1482
  /**
1417
- * Indicates whether the current item within a repeat context
1418
- * is the first item in the collection.
1483
+ * Removes the view and unbinds its behaviors, disposing of DOM nodes afterward.
1484
+ * Once a view has been disposed, it cannot be inserted or bound again.
1419
1485
  */
1420
- readonly isFirst: boolean;
1486
+ dispose(): void;
1487
+ onUnbind(behavior: {
1488
+ unbind(controller: ViewController<TSource, TParent>): any;
1489
+ }): void;
1421
1490
  /**
1422
- * Indicates whether the current item within a repeat context
1423
- * is somewhere in the middle of the collection.
1491
+ * Binds a view's behaviors to its binding source.
1492
+ * @param source - The binding source for the view's binding behaviors.
1493
+ * @param context - The execution context to run the behaviors within.
1424
1494
  */
1425
- readonly isInMiddle: boolean;
1495
+ bind(source: TSource, context?: ExecutionContext<TParent>): void;
1426
1496
  /**
1427
- * Indicates whether the current item within a repeat context
1428
- * is the last item in the collection.
1497
+ * Unbinds a view's behaviors from its binding source.
1429
1498
  */
1430
- readonly isLast: boolean;
1499
+ unbind(): void;
1500
+ private evaluateUnbindables;
1431
1501
  /**
1432
- * Updates the position/size on a context associated with a list item.
1433
- * @param index - The new index of the item.
1434
- * @param length - The new length of the list.
1502
+ * Efficiently disposes of a contiguous range of synthetic view instances.
1503
+ * @param views - A contiguous range of views to be disposed.
1435
1504
  */
1436
- updatePosition(index: number, length: number): void;
1505
+ static disposeContiguousBatch(views: SyntheticView[]): void;
1437
1506
  }
1438
1507
 
1439
1508
  /**
1440
- * A template capable of rendering item views not specifically connected to custom elements.
1509
+ * Observes array lengths.
1441
1510
  * @public
1442
1511
  */
1443
- export declare interface ItemViewTemplate<TSource = any, TParent = any> {
1444
- type: "item";
1512
+ export declare interface LengthObserver extends Subscriber {
1445
1513
  /**
1446
- * Creates a SyntheticView instance based on this template definition.
1514
+ * The length of the observed array.
1447
1515
  */
1448
- create(): SyntheticView<TSource, TParent, ItemContext<TParent>>;
1516
+ length: number;
1449
1517
  }
1450
1518
 
1451
1519
  /**
@@ -1454,19 +1522,16 @@ export declare interface ItemViewTemplate<TSource = any, TParent = any> {
1454
1522
  * @returns The length of the array.
1455
1523
  * @public
1456
1524
  */
1457
- declare function length_2<T>(array: readonly T[]): number;
1458
- export { length_2 as length }
1525
+ export declare function lengthOf<T>(array: readonly T[]): number;
1459
1526
 
1460
1527
  /**
1461
- * Observes array lengths.
1528
+ * Creates an event listener binding.
1529
+ * @param binding - The binding to invoke when the event is raised.
1530
+ * @param options - Event listener options.
1531
+ * @returns A binding configuration.
1462
1532
  * @public
1463
1533
  */
1464
- export declare interface LengthObserver extends Subscriber {
1465
- /**
1466
- * The length of the observed array.
1467
- */
1468
- length: number;
1469
- }
1534
+ export declare function listener<T = any>(binding: Expression<T>, options?: AddEventListenerOptions): Binding<T>;
1470
1535
 
1471
1536
  /**
1472
1537
  * Common APIs related to markup generation.
@@ -1534,14 +1599,14 @@ export declare abstract class NodeObservationDirective<T extends NodeBehaviorOpt
1534
1599
  * @param context - The execution context that the binding is operating within.
1535
1600
  * @param targets - The targets that behaviors in a view can attach to.
1536
1601
  */
1537
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
1602
+ bind(controller: ViewController): void;
1538
1603
  /**
1539
1604
  * Unbinds this behavior from the source.
1540
1605
  * @param source - The source to unbind from.
1541
1606
  * @param context - The execution context that the binding is operating within.
1542
1607
  * @param targets - The targets that behaviors in a view can attach to.
1543
1608
  */
1544
- unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
1609
+ unbind(controller: ViewController): void;
1545
1610
  /**
1546
1611
  * Gets the data source for the target.
1547
1612
  * @param target - The target to get the source for.
@@ -1579,6 +1644,14 @@ export declare abstract class NodeObservationDirective<T extends NodeBehaviorOpt
1579
1644
  protected abstract getNodes(target: any): Node[];
1580
1645
  }
1581
1646
 
1647
+ /**
1648
+ * Normalizes the input value into a binding.
1649
+ * @param value - The value to create the default binding for.
1650
+ * @returns A binding configuration for the provided value.
1651
+ * @public
1652
+ */
1653
+ export declare function normalizeBinding<TSource = any, TReturn = any, TParent = any>(value: Expression<TSource, TReturn, TParent> | Binding<TSource, TReturn, TParent> | {}): Binding<TSource, TReturn, TParent>;
1654
+
1582
1655
  /**
1583
1656
  * Provides change notifications for an observed subject.
1584
1657
  * @public
@@ -1665,19 +1738,19 @@ export declare const Observable: Readonly<{
1665
1738
  */
1666
1739
  getAccessors: (target: {}) => Accessor[];
1667
1740
  /**
1668
- * Creates a {@link BindingObserver} that can watch the
1669
- * provided {@link Binding} for changes.
1670
- * @param binding - The binding to observe.
1741
+ * Creates a {@link ExpressionNotifier} that can watch the
1742
+ * provided {@link Expression} for changes.
1743
+ * @param expression - The binding to observe.
1671
1744
  * @param initialSubscriber - An initial subscriber to changes in the binding value.
1672
1745
  * @param isVolatileBinding - Indicates whether the binding's dependency list must be re-evaluated on every value evaluation.
1673
1746
  */
1674
- binding<TSource = any, TReturn = any>(binding: Binding<TSource, TReturn, ExecutionContext<any>>, initialSubscriber?: Subscriber, isVolatileBinding?: boolean): BindingObserver<TSource, TReturn, any>;
1747
+ binding<TSource = any, TReturn = any>(expression: Expression<TSource, TReturn, any>, initialSubscriber?: Subscriber, isVolatileBinding?: boolean): ExpressionNotifier<TSource, TReturn, any>;
1675
1748
  /**
1676
1749
  * Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated
1677
1750
  * on every evaluation of the value.
1678
- * @param binding - The binding to inspect.
1751
+ * @param expression - The binding to inspect.
1679
1752
  */
1680
- isVolatileBinding<TSource_1 = any, TReturn_1 = any>(binding: Binding<TSource_1, TReturn_1, ExecutionContext<any>>): boolean;
1753
+ isVolatileBinding<TSource_1 = any, TReturn_1 = any>(expression: Expression<TSource_1, TReturn_1, any>): boolean;
1681
1754
  }>;
1682
1755
 
1683
1756
  /**
@@ -1704,30 +1777,12 @@ export declare interface ObservationRecord {
1704
1777
  }
1705
1778
 
1706
1779
  /**
1707
- * The default onChange binding configuration.
1708
- * @public
1709
- */
1710
- export declare const onChange: BindingConfig<AddEventListenerOptions> & BindingConfigResolver<AddEventListenerOptions>;
1711
-
1712
- /**
1713
- * The default onTime binding configuration.
1714
- * @public
1715
- */
1716
- export declare const oneTime: BindingConfig<AddEventListenerOptions> & BindingConfigResolver<AddEventListenerOptions>;
1717
-
1718
- /**
1719
- * A binding behavior for one-time bindings.
1780
+ * Creates a one time binding
1781
+ * @param binding - The binding to refresh when signaled.
1782
+ * @returns A binding configuration.
1720
1783
  * @public
1721
1784
  */
1722
- export declare class OneTimeBinding extends UpdateBinding {
1723
- /**
1724
- * Bind this behavior to the source.
1725
- * @param source - The source to bind to.
1726
- * @param context - The execution context that the binding is operating within.
1727
- * @param targets - The targets that behaviors in a view can attach to.
1728
- */
1729
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
1730
- }
1785
+ export declare function oneTime<T = any>(binding: Expression<T>): Binding<T>;
1731
1786
 
1732
1787
  /**
1733
1788
  * Common APIs related to content parsing.
@@ -1768,12 +1823,21 @@ export declare interface PartialFASTElementDefinition {
1768
1823
  readonly attributes?: (AttributeConfiguration | string)[];
1769
1824
  /**
1770
1825
  * Options controlling the creation of the custom element's shadow DOM.
1826
+ * @remarks
1827
+ * If not provided, defaults to an open shadow root. Provide null
1828
+ * to render to the associated template to the light DOM instead.
1771
1829
  */
1772
- readonly shadowOptions?: Partial<ShadowRootInit> | null;
1830
+ readonly shadowOptions?: Partial<ShadowRootOptions> | null;
1773
1831
  /**
1774
1832
  * Options controlling how the custom element is defined with the platform.
1775
1833
  */
1776
1834
  readonly elementOptions?: ElementDefinitionOptions;
1835
+ /**
1836
+ * The registry to register this component in by default.
1837
+ * @remarks
1838
+ * If not provided, defaults to the global registry.
1839
+ */
1840
+ readonly registry?: CustomElementRegistry;
1777
1841
  }
1778
1842
 
1779
1843
  /**
@@ -1829,7 +1893,7 @@ export declare class PropertyChangeNotifier implements Notifier {
1829
1893
  * @param propertyName - The name of the property to assign the reference to.
1830
1894
  * @public
1831
1895
  */
1832
- export declare const ref: <T = any>(propertyName: keyof T & string) => CaptureType<T>;
1896
+ export declare const ref: <TSource = any, TParent = any>(propertyName: keyof TSource & string) => CaptureType<TSource, TParent>;
1833
1897
 
1834
1898
  /**
1835
1899
  * The runtime behavior for template references.
@@ -1837,117 +1901,56 @@ export declare const ref: <T = any>(propertyName: keyof T & string) => CaptureTy
1837
1901
  */
1838
1902
  export declare class RefDirective extends StatelessAttachedAttributeDirective<string> {
1839
1903
  /**
1840
- * Bind this behavior to the source.
1841
- * @param source - The source to bind to.
1842
- * @param context - The execution context that the binding is operating within.
1843
- * @param targets - The targets that behaviors in a view can attach to.
1844
- */
1845
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
1846
- /**
1847
- * Unbinds this behavior from the source.
1848
- * @param source - The source to unbind from.
1904
+ * Bind this behavior.
1905
+ * @param controller - The view controller that manages the lifecycle of this behavior.
1849
1906
  */
1850
- unbind(): void;
1907
+ bind(controller: ViewController): void;
1851
1908
  }
1852
1909
 
1853
1910
  declare const reflectMode = "reflect";
1854
1911
 
1855
1912
  /**
1856
1913
  * A directive that enables list rendering.
1857
- * @param itemsBinding - The array to render.
1858
- * @param templateOrTemplateBinding - The template or a template binding used obtain a template
1859
- * to render for each item in the array.
1860
- * @param options - Options used to turn on special repeat features.
1861
- * @public
1862
- */
1863
- export declare function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ViewTemplate | Binding<TSource, ViewTemplate, RootContext>, options?: {
1864
- positioning: false;
1865
- } | {
1866
- recycle: true;
1867
- } | {
1868
- positioning: false;
1869
- recycle: false;
1870
- } | {
1871
- positioning: false;
1872
- recycle: true;
1873
- }): CaptureType<TSource>;
1874
-
1875
- /**
1876
- * A directive that enables list rendering.
1877
- * @param itemsBinding - The array to render.
1878
- * @param templateOrTemplateBinding - The template or a template binding used obtain a template
1879
- * to render for each item in the array.
1880
- * @param options - Options used to turn on special repeat features.
1881
- * @public
1882
- */
1883
- export declare function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ChildViewTemplate | Binding<TSource, ChildViewTemplate, ChildContext>, options?: {
1884
- positioning: false;
1885
- } | {
1886
- recycle: true;
1887
- } | {
1888
- positioning: false;
1889
- recycle: false;
1890
- } | {
1891
- positioning: false;
1892
- recycle: true;
1893
- }): CaptureType<TSource>;
1894
-
1895
- /**
1896
- * A directive that enables list rendering.
1897
- * @param itemsBinding - The array to render.
1898
- * @param templateOrTemplateBinding - The template or a template binding used obtain a template
1914
+ * @param items - The array to render.
1915
+ * @param template - The template or a template binding used obtain a template
1899
1916
  * to render for each item in the array.
1900
1917
  * @param options - Options used to turn on special repeat features.
1901
1918
  * @public
1902
1919
  */
1903
- export declare function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ItemViewTemplate | Binding<TSource, ItemViewTemplate, ItemContext>, options: {
1904
- positioning: true;
1905
- } | {
1906
- positioning: true;
1907
- recycle: true;
1908
- } | {
1909
- positioning: true;
1910
- recycle: false;
1911
- }): CaptureType<TSource>;
1920
+ export declare 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>;
1912
1921
 
1913
1922
  /**
1914
1923
  * A behavior that renders a template for each item in an array.
1915
1924
  * @public
1916
1925
  */
1917
- export declare class RepeatBehavior<TSource = any> implements Behavior, Subscriber {
1926
+ export declare class RepeatBehavior<TSource = any> implements ViewBehavior, Subscriber {
1927
+ private directive;
1918
1928
  private location;
1919
- private itemsBinding;
1920
- private templateBinding;
1921
- private options;
1922
- private source;
1929
+ private controller;
1923
1930
  private views;
1924
1931
  private template;
1925
1932
  private templateBindingObserver;
1926
1933
  private items;
1927
1934
  private itemsObserver;
1928
1935
  private itemsBindingObserver;
1929
- private context;
1930
- private childContext;
1931
1936
  private bindView;
1932
1937
  /**
1933
1938
  * Creates an instance of RepeatBehavior.
1934
1939
  * @param location - The location in the DOM to render the repeat.
1935
- * @param itemsBinding - The array to render.
1940
+ * @param dataBinding - The array to render.
1936
1941
  * @param isItemsBindingVolatile - Indicates whether the items binding has volatile dependencies.
1937
1942
  * @param templateBinding - The template to render for each item.
1938
1943
  * @param isTemplateBindingVolatile - Indicates whether the template binding has volatile dependencies.
1939
1944
  * @param options - Options used to turn on special repeat features.
1940
1945
  */
1941
- constructor(location: Node, itemsBinding: Binding<TSource, any[]>, isItemsBindingVolatile: boolean, templateBinding: Binding<TSource, SyntheticViewTemplate>, isTemplateBindingVolatile: boolean, options: RepeatOptions);
1946
+ constructor(directive: RepeatDirective);
1942
1947
  /**
1943
- * Bind this behavior to the source.
1944
- * @param source - The source to bind to.
1945
- * @param context - The execution context that the binding is operating within.
1948
+ * Bind this behavior.
1949
+ * @param controller - The view controller that manages the lifecycle of this behavior.
1946
1950
  */
1947
- bind(source: TSource, context: ExecutionContext): void;
1951
+ bind(controller: ViewController): void;
1948
1952
  /**
1949
- * Unbinds this behavior from the source.
1950
- * @param source - The source to unbind from.
1953
+ * Unbinds this behavior.
1951
1954
  */
1952
1955
  unbind(): void;
1953
1956
  /**
@@ -1955,7 +1958,7 @@ export declare class RepeatBehavior<TSource = any> implements Behavior, Subscrib
1955
1958
  * @param source - The source of the change.
1956
1959
  * @param args - The details about what was changed.
1957
1960
  */
1958
- handleChange(source: any, args: Splice[]): void;
1961
+ handleChange(source: any, args: Splice[] | ExpressionObserver): void;
1959
1962
  private observeItems;
1960
1963
  private updateViews;
1961
1964
  private refreshAllViews;
@@ -1967,11 +1970,9 @@ export declare class RepeatBehavior<TSource = any> implements Behavior, Subscrib
1967
1970
  * @public
1968
1971
  */
1969
1972
  export declare class RepeatDirective<TSource = any> implements HTMLDirective, ViewBehaviorFactory {
1970
- readonly itemsBinding: Binding;
1973
+ readonly dataBinding: Binding<TSource>;
1971
1974
  readonly templateBinding: Binding<TSource, SyntheticViewTemplate>;
1972
1975
  readonly options: RepeatOptions;
1973
- private isItemsBindingVolatile;
1974
- private isTemplateBindingVolatile;
1975
1976
  /**
1976
1977
  * The unique id of the factory.
1977
1978
  */
@@ -1987,16 +1988,16 @@ export declare class RepeatDirective<TSource = any> implements HTMLDirective, Vi
1987
1988
  createHTML(add: AddViewBehaviorFactory): string;
1988
1989
  /**
1989
1990
  * Creates an instance of RepeatDirective.
1990
- * @param itemsBinding - The binding that provides the array to render.
1991
+ * @param dataBinding - The binding that provides the array to render.
1991
1992
  * @param templateBinding - The template binding used to obtain a template to render for each item in the array.
1992
1993
  * @param options - Options used to turn on special repeat features.
1993
1994
  */
1994
- constructor(itemsBinding: Binding, templateBinding: Binding<TSource, SyntheticViewTemplate>, options: RepeatOptions);
1995
+ constructor(dataBinding: Binding<TSource>, templateBinding: Binding<TSource, SyntheticViewTemplate>, options: RepeatOptions);
1995
1996
  /**
1996
1997
  * Creates a behavior for the provided target node.
1997
1998
  * @param target - The node instance to create the behavior for.
1998
1999
  */
1999
- createBehavior(targets: ViewBehaviorTargets): RepeatBehavior<TSource>;
2000
+ createBehavior(): RepeatBehavior<TSource>;
2000
2001
  }
2001
2002
 
2002
2003
  /**
@@ -2015,65 +2016,16 @@ export declare interface RepeatOptions {
2015
2016
  }
2016
2017
 
2017
2018
  /**
2018
- * Provides additional contextual information available to behaviors and expressions.
2019
- * @public
2020
- */
2021
- export declare interface RootContext {
2022
- /**
2023
- * The current event within an event handler.
2024
- */
2025
- readonly event: Event;
2026
- /**
2027
- * Returns the typed event detail of a custom event.
2028
- */
2029
- eventDetail<TDetail = any>(): TDetail;
2030
- /**
2031
- * Returns the typed event target of the event.
2032
- */
2033
- eventTarget<TTarget extends EventTarget = EventTarget>(): TTarget;
2034
- /**
2035
- * Creates a new execution context descendent from the current context.
2036
- * @param source - The source for the context if different than the parent.
2037
- * @returns A child execution context.
2038
- */
2039
- createChildContext<TParentSource>(source: TParentSource): ChildContext<TParentSource>;
2040
- }
2041
-
2042
- /**
2043
- * Creates a signal binding configuration with the supplied options.
2044
- * @param options - The signal name or a binding to use to retrieve the signal name.
2045
- * @returns A binding configuration.
2046
- * @public
2047
- */
2048
- export declare const signal: <T = any>(options: string | Binding<T, any, ExecutionContext<any>>) => BindingConfig<string | Binding<T, any, ExecutionContext<any>>>;
2049
-
2050
- /**
2051
- * A binding behavior for signal bindings.
2019
+ * Shadow root initialization options.
2052
2020
  * @public
2053
2021
  */
2054
- export declare class SignalBinding extends UpdateBinding {
2055
- private handlerProperty;
2056
- /**
2057
- * Bind this behavior to the source.
2058
- * @param source - The source to bind to.
2059
- * @param context - The execution context that the binding is operating within.
2060
- * @param targets - The targets that behaviors in a view can attach to.
2061
- */
2062
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
2063
- /**
2064
- * Unbinds this behavior from the source.
2065
- * @param source - The source to unbind from.
2066
- * @param context - The execution context that the binding is operating within.
2067
- * @param targets - The targets that behaviors in a view can attach to.
2068
- */
2069
- unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
2070
- private getSignal;
2022
+ export declare interface ShadowRootOptions extends ShadowRootInit {
2071
2023
  /**
2072
- * Sends the specified signal to signaled bindings.
2073
- * @param signal - The signal to send.
2074
- * @public
2024
+ * A registry that provides the custom elements visible
2025
+ * from within this shadow root.
2026
+ * @beta
2075
2027
  */
2076
- static send(signal: string): void;
2028
+ registry?: CustomElementRegistry;
2077
2029
  }
2078
2030
 
2079
2031
  /**
@@ -2082,7 +2034,7 @@ export declare class SignalBinding extends UpdateBinding {
2082
2034
  * @param propertyOrOptions - The options used to configure slotted node observation.
2083
2035
  * @public
2084
2036
  */
2085
- export declare function slotted<T = any>(propertyOrOptions: (keyof T & string) | SlottedDirectiveOptions<keyof T & string>): CaptureType<T>;
2037
+ export declare function slotted<TSource = any, TParent = any>(propertyOrOptions: (keyof TSource & string) | SlottedDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
2086
2038
 
2087
2039
  /**
2088
2040
  * The runtime behavior for slotted node observation.
@@ -2114,6 +2066,28 @@ export declare class SlottedDirective extends NodeObservationDirective<SlottedDi
2114
2066
  export declare interface SlottedDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, AssignedNodesOptions {
2115
2067
  }
2116
2068
 
2069
+ /**
2070
+ * Describes how the source's lifetime relates to its controller's lifetime.
2071
+ * @public
2072
+ */
2073
+ export declare const SourceLifetime: Readonly<{
2074
+ /**
2075
+ * The source to controller lifetime relationship is unknown.
2076
+ */
2077
+ readonly unknown: undefined;
2078
+ /**
2079
+ * The source and controller lifetimes are coupled to one another.
2080
+ * They can/will be GC'd together.
2081
+ */
2082
+ readonly coupled: 1;
2083
+ }>;
2084
+
2085
+ /**
2086
+ * Describes how the source's lifetime relates to its controller's lifetime.
2087
+ * @public
2088
+ */
2089
+ export declare type SourceLifetime = typeof SourceLifetime[keyof typeof SourceLifetime];
2090
+
2117
2091
  /**
2118
2092
  * A splice map is a representation of how a previous array of items
2119
2093
  * was transformed into a new array of items. Conceptually it is a list of
@@ -2270,8 +2244,8 @@ export declare type SpliceStrategySupport = typeof SpliceStrategySupport[keyof t
2270
2244
  * A base class used for attribute directives that don't need internal state.
2271
2245
  * @public
2272
2246
  */
2273
- export declare abstract class StatelessAttachedAttributeDirective<T> implements HTMLDirective, ViewBehaviorFactory, ViewBehavior {
2274
- protected options: T;
2247
+ export declare abstract class StatelessAttachedAttributeDirective<TOptions> implements HTMLDirective, ViewBehaviorFactory, ViewBehavior {
2248
+ protected options: TOptions;
2275
2249
  /**
2276
2250
  * The unique id of the factory.
2277
2251
  */
@@ -2284,12 +2258,7 @@ export declare abstract class StatelessAttachedAttributeDirective<T> implements
2284
2258
  * Creates an instance of RefDirective.
2285
2259
  * @param options - The options to use in configuring the directive.
2286
2260
  */
2287
- constructor(options: T);
2288
- /**
2289
- * Creates a behavior.
2290
- * @param targets - The targets available for behaviors to be attached to.
2291
- */
2292
- createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
2261
+ constructor(options: TOptions);
2293
2262
  /**
2294
2263
  * Creates a placeholder string based on the directive's index within the template.
2295
2264
  * @param index - The index of the directive within the template.
@@ -2298,17 +2267,15 @@ export declare abstract class StatelessAttachedAttributeDirective<T> implements
2298
2267
  */
2299
2268
  createHTML(add: AddViewBehaviorFactory): string;
2300
2269
  /**
2301
- * Bind this behavior to the source.
2302
- * @param source - The source to bind to.
2303
- * @param context - The execution context that the binding is operating within.
2304
- * @param targets - The targets that behaviors in a view can attach to.
2270
+ * Creates a behavior.
2271
+ * @param targets - The targets available for behaviors to be attached to.
2305
2272
  */
2306
- abstract bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
2273
+ createBehavior(): ViewBehavior;
2307
2274
  /**
2308
- * Unbinds this behavior from the source.
2309
- * @param source - The source to unbind from.
2275
+ * Bind this behavior.
2276
+ * @param controller - The view controller that manages the lifecycle of this behavior.
2310
2277
  */
2311
- abstract unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
2278
+ abstract bind(controller: ViewController): void;
2312
2279
  }
2313
2280
 
2314
2281
  /**
@@ -2435,7 +2402,7 @@ export declare interface SubtreeDirectiveOptions<T = any> extends NodeBehaviorOp
2435
2402
  * A view representing a range of DOM nodes which can be added/removed ad hoc.
2436
2403
  * @public
2437
2404
  */
2438
- export declare interface SyntheticView<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> extends View<TSource, TParent, TContext> {
2405
+ export declare interface SyntheticView<TSource = any, TParent = any> extends View<TSource, TParent> {
2439
2406
  /**
2440
2407
  * The first DOM node in the range of nodes that make up the view.
2441
2408
  */
@@ -2460,19 +2427,18 @@ export declare interface SyntheticView<TSource = any, TParent = any, TContext ex
2460
2427
  * A template capable of rendering views not specifically connected to custom elements.
2461
2428
  * @public
2462
2429
  */
2463
- export declare interface SyntheticViewTemplate<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> {
2464
- type: "synthetic";
2430
+ export declare interface SyntheticViewTemplate<TSource = any, TParent = any> {
2465
2431
  /**
2466
2432
  * Creates a SyntheticView instance based on this template definition.
2467
2433
  */
2468
- create(): SyntheticView<TSource, TParent, TContext>;
2434
+ create(): SyntheticView<TSource, TParent>;
2469
2435
  }
2470
2436
 
2471
2437
  /**
2472
2438
  * Represents the types of values that can be interpolated into a template.
2473
2439
  * @public
2474
2440
  */
2475
- export declare type TemplateValue<TSource, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> = Binding<TSource, any, TContext> | HTMLDirective | CaptureType<TSource>;
2441
+ export declare type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource, TParent>;
2476
2442
 
2477
2443
  /**
2478
2444
  * Enables working with trusted types.
@@ -2499,91 +2465,10 @@ export declare type TrustedTypesPolicy = {
2499
2465
  createHTML(html: string): string;
2500
2466
  };
2501
2467
 
2502
- /**
2503
- * The default twoWay binding configuration.
2504
- * @public
2505
- */
2506
- export declare const twoWay: BindingConfig<DefaultTwoWayBindingOptions> & BindingConfigResolver<DefaultTwoWayBindingOptions>;
2507
-
2508
- /**
2509
- * A binding behavior for bindings that update in two directions.
2510
- * @public
2511
- */
2512
- export declare class TwoWayBinding extends ChangeBinding {
2513
- private changeEvent;
2514
- /**
2515
- * Bind this behavior to the source.
2516
- * @param source - The source to bind to.
2517
- * @param context - The execution context that the binding is operating within.
2518
- * @param targets - The targets that behaviors in a view can attach to.
2519
- */
2520
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
2521
- /**
2522
- * Unbinds this behavior from the source.
2523
- * @param source - The source to unbind from.
2524
- * @param context - The execution context that the binding is operating within.
2525
- * @param targets - The targets that behaviors in a view can attach to.
2526
- */
2527
- unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
2528
- /* Excluded from this release type: handleEvent */
2529
- /**
2530
- * Configures two-way binding.
2531
- * @param settings - The settings to use for the two-way binding system.
2532
- */
2533
- static configure(settings: TwoWaySettings): void;
2534
- }
2535
-
2536
- /**
2537
- * The settings required to enable two-way binding.
2538
- * @public
2539
- */
2540
- export declare interface TwoWaySettings {
2541
- /**
2542
- * Determines which event to listen to, to detect changes in the view.
2543
- * @param directive - The directive to determine the change event for.
2544
- * @param target - The target element to determine the change event for.
2545
- */
2546
- determineChangeEvent(directive: HTMLBindingDirective, target: HTMLElement): string;
2547
- }
2548
-
2549
2468
  /* Excluded from this release type: TypeDefinition */
2550
2469
 
2551
2470
  /* Excluded from this release type: TypeRegistry */
2552
2471
 
2553
- /**
2554
- * A base binding behavior for DOM updates.
2555
- * @public
2556
- */
2557
- export declare class UpdateBinding implements ViewBehavior {
2558
- readonly directive: HTMLBindingDirective;
2559
- protected updateTarget: UpdateTarget;
2560
- /**
2561
- * Creates an instance of UpdateBinding.
2562
- * @param directive - The directive that has the configuration for this behavior.
2563
- * @param updateTarget - The function used to update the target with the latest value.
2564
- */
2565
- constructor(directive: HTMLBindingDirective, updateTarget: UpdateTarget);
2566
- /**
2567
- * Bind this behavior to the source.
2568
- * @param source - The source to bind to.
2569
- * @param context - The execution context that the binding is operating within.
2570
- * @param targets - The targets that behaviors in a view can attach to.
2571
- */
2572
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
2573
- /**
2574
- * Unbinds this behavior from the source.
2575
- * @param source - The source to unbind from.
2576
- * @param context - The execution context that the binding is operating within.
2577
- * @param targets - The targets that behaviors in a view can attach to.
2578
- */
2579
- unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
2580
- /**
2581
- * Creates a behavior.
2582
- * @param targets - The targets available for behaviors to be attached to.
2583
- */
2584
- createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
2585
- }
2586
-
2587
2472
  /**
2588
2473
  * A work queue used to synchronize writes to the DOM.
2589
2474
  * @public
@@ -2625,29 +2510,6 @@ export declare interface UpdateQueue {
2625
2510
  */
2626
2511
  export declare const Updates: UpdateQueue;
2627
2512
 
2628
- /**
2629
- * A target update function.
2630
- * @param this - The "this" context for the update.
2631
- * @param target - The node that is targeted by the update.
2632
- * @param aspect - The aspect of the node that is being targeted.
2633
- * @param value - The value to assign to the aspect.
2634
- * @param source - The source object that the value was derived from.
2635
- * @param context - The execution context that the binding is being run under.
2636
- * @public
2637
- */
2638
- export declare type UpdateTarget = (this: UpdateTargetThis, target: Node, aspect: string, value: any, source: any, context: ExecutionContext) => void;
2639
-
2640
- /**
2641
- * The "this" context for an update target function.
2642
- * @public
2643
- */
2644
- export declare interface UpdateTargetThis {
2645
- /**
2646
- * The directive configuration for the update.
2647
- */
2648
- directive: HTMLBindingDirective;
2649
- }
2650
-
2651
2513
  /**
2652
2514
  * Represents objects that can convert values to and from
2653
2515
  * view or model representations.
@@ -2670,11 +2532,11 @@ export declare interface ValueConverter {
2670
2532
  * Represents a collection of DOM nodes which can be bound to a data source.
2671
2533
  * @public
2672
2534
  */
2673
- export declare interface View<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext<TParent>> extends Disposable {
2535
+ export declare interface View<TSource = any, TParent = any> extends Disposable {
2674
2536
  /**
2675
2537
  * The execution context the view is running within.
2676
2538
  */
2677
- readonly context: TContext | null;
2539
+ readonly context: ExecutionContext<TParent>;
2678
2540
  /**
2679
2541
  * The data that the view is bound to.
2680
2542
  */
@@ -2682,9 +2544,8 @@ export declare interface View<TSource = any, TParent = any, TContext extends Exe
2682
2544
  /**
2683
2545
  * Binds a view's behaviors to its binding source.
2684
2546
  * @param source - The binding source for the view's binding behaviors.
2685
- * @param context - The execution context to run the view within.
2686
2547
  */
2687
- bind(source: TSource, context: TContext): void;
2548
+ bind(source: TSource, context?: ExecutionContext<TParent>): void;
2688
2549
  /**
2689
2550
  * Unbinds a view's behaviors from its binding source and context.
2690
2551
  */
@@ -2697,23 +2558,14 @@ export declare interface View<TSource = any, TParent = any, TContext extends Exe
2697
2558
  */
2698
2559
  export declare interface ViewBehavior<TSource = any, TParent = any> {
2699
2560
  /**
2700
- * Bind this behavior to the source.
2701
- * @param source - The source to bind to.
2702
- * @param context - The execution context that the binding is operating within.
2703
- * @param targets - The targets that behaviors in a view can attach to.
2704
- */
2705
- bind(source: TSource, context: ExecutionContext<TParent>, targets: ViewBehaviorTargets): void;
2706
- /**
2707
- * Unbinds this behavior from the source.
2708
- * @param source - The source to unbind from.
2709
- * @param context - The execution context that the binding is operating within.
2710
- * @param targets - The targets that behaviors in a view can attach to.
2561
+ * Bind this behavior.
2562
+ * @param controller - The view controller that manages the lifecycle of this behavior.
2711
2563
  */
2712
- unbind(source: TSource, context: ExecutionContext<TParent>, targets: ViewBehaviorTargets): void;
2564
+ bind(controller: ViewController<TSource, TParent>): void;
2713
2565
  }
2714
2566
 
2715
2567
  /**
2716
- * A factory that can create a {@link Behavior} associated with a particular
2568
+ * A factory that can create a {@link ViewBehavior} associated with a particular
2717
2569
  * location within a DOM fragment.
2718
2570
  * @public
2719
2571
  */
@@ -2728,11 +2580,49 @@ export declare interface ViewBehaviorFactory {
2728
2580
  nodeId: string;
2729
2581
  /**
2730
2582
  * Creates a behavior.
2731
- * @param targets - The targets available for behaviors to be attached to.
2732
2583
  */
2733
- createBehavior(targets: ViewBehaviorTargets): Behavior | ViewBehavior;
2584
+ createBehavior(): ViewBehavior;
2585
+ }
2586
+
2587
+ /**
2588
+ * Bridges between ViewBehaviors and HostBehaviors, enabling a host to
2589
+ * control ViewBehaviors.
2590
+ * @public
2591
+ */
2592
+ export declare interface ViewBehaviorOrchestrator<TSource = any, TParent = any> extends ViewController<TSource, TParent>, HostBehavior<TSource> {
2593
+ /**
2594
+ *
2595
+ * @param nodeId - The structural id of the DOM node to which a behavior will apply.
2596
+ * @param target - The DOM node associated with the id.
2597
+ */
2598
+ addTarget(nodeId: string, target: Node): void;
2599
+ /**
2600
+ * Adds a behavior.
2601
+ * @param behavior - The behavior to add.
2602
+ */
2603
+ addBehavior(behavior: ViewBehavior): void;
2604
+ /**
2605
+ * Adds a behavior factory.
2606
+ * @param factory - The behavior factory to add.
2607
+ * @param target - The target the factory will create behaviors for.
2608
+ */
2609
+ addBehaviorFactory(factory: ViewBehaviorFactory, target: Node): void;
2734
2610
  }
2735
2611
 
2612
+ /**
2613
+ * Bridges between ViewBehaviors and HostBehaviors, enabling a host to
2614
+ * control ViewBehaviors.
2615
+ * @public
2616
+ */
2617
+ export declare const ViewBehaviorOrchestrator: Readonly<{
2618
+ /**
2619
+ * Creates a ViewBehaviorOrchestrator.
2620
+ * @param source - The source to to associate behaviors with.
2621
+ * @returns A ViewBehaviorOrchestrator.
2622
+ */
2623
+ create<TSource = any, TParent = any>(source: TSource): ViewBehaviorOrchestrator<TSource, TParent>;
2624
+ }>;
2625
+
2736
2626
  /**
2737
2627
  * The target nodes available to a behavior.
2738
2628
  * @public
@@ -2742,16 +2632,22 @@ export declare type ViewBehaviorTargets = {
2742
2632
  };
2743
2633
 
2744
2634
  /**
2745
- * A template capable of creating HTMLView instances or rendering directly to DOM.
2635
+ * Controls the lifecycle of a view and provides relevant context.
2746
2636
  * @public
2747
2637
  */
2748
- export declare class ViewTemplate<TSource = any, TParent = any, TContext extends ExecutionContext<TParent> = ExecutionContext> implements ElementViewTemplate<TSource, TParent>, SyntheticViewTemplate<TSource, TParent, TContext> {
2749
- private result;
2638
+ export declare interface ViewController<TSource = any, TParent = any> extends ExpressionController<TSource, TParent> {
2750
2639
  /**
2751
- * Used for TypeScript purposes only.
2752
- * Do not use.
2640
+ * The parts of the view that are targeted by view behaviors.
2753
2641
  */
2754
- type: any;
2642
+ readonly targets: ViewBehaviorTargets;
2643
+ }
2644
+
2645
+ /**
2646
+ * A template capable of creating HTMLView instances or rendering directly to DOM.
2647
+ * @public
2648
+ */
2649
+ export declare class ViewTemplate<TSource = any, TParent = any> implements ElementViewTemplate<TSource, TParent>, SyntheticViewTemplate<TSource, TParent> {
2650
+ private result;
2755
2651
  /**
2756
2652
  * The html representing what this template will
2757
2653
  * instantiate, including placeholders for directives.
@@ -2771,7 +2667,7 @@ export declare class ViewTemplate<TSource = any, TParent = any, TContext extends
2771
2667
  * Creates an HTMLView instance based on this template definition.
2772
2668
  * @param hostBindingTarget - The element that host behaviors will be bound to.
2773
2669
  */
2774
- create(hostBindingTarget?: Element): HTMLView<TSource, TParent, TContext>;
2670
+ create(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
2775
2671
  /**
2776
2672
  * Creates an HTMLView from this template, binds it to the source, and then appends it to the host.
2777
2673
  * @param source - The data source to bind the template to.
@@ -2779,7 +2675,7 @@ export declare class ViewTemplate<TSource = any, TParent = any, TContext extends
2779
2675
  * @param hostBindingTarget - An HTML element to target the host bindings at if different from the
2780
2676
  * host that the template is being attached to.
2781
2677
  */
2782
- render(source: TSource, host: Node, hostBindingTarget?: Element, context?: TContext): HTMLView<TSource, TParent, TContext>;
2678
+ render(source: TSource, host: Node, hostBindingTarget?: Element): HTMLView<TSource, TParent>;
2783
2679
  }
2784
2680
 
2785
2681
  /**
@@ -2793,11 +2689,11 @@ export declare function volatile(target: {}, name: string | Accessor, descriptor
2793
2689
 
2794
2690
  /**
2795
2691
  * A directive that enables basic conditional rendering in a template.
2796
- * @param binding - The condition to test for rendering.
2692
+ * @param condition - The condition to test for rendering.
2797
2693
  * @param templateOrTemplateBinding - The template or a binding that gets
2798
2694
  * the template to render when the condition is true.
2799
2695
  * @public
2800
2696
  */
2801
- export declare function when<TSource = any, TReturn = any>(binding: Binding<TSource, TReturn>, templateOrTemplateBinding: SyntheticViewTemplate | Binding<TSource, SyntheticViewTemplate>): CaptureType<TSource>;
2697
+ export declare 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>;
2802
2698
 
2803
2699
  export { }