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

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