@microsoft/fast-element 2.0.0-beta.3 → 2.0.0-beta.6

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 (68) hide show
  1. package/CHANGELOG.json +147 -0
  2. package/CHANGELOG.md +42 -1
  3. package/dist/dts/components/fast-definitions.d.ts +9 -8
  4. package/dist/dts/components/fast-element.d.ts +12 -24
  5. package/dist/dts/context.d.ts +1 -1
  6. package/dist/dts/di/di.d.ts +858 -0
  7. package/dist/dts/interfaces.d.ts +43 -7
  8. package/dist/dts/observation/observable.d.ts +19 -13
  9. package/dist/dts/state/exports.d.ts +3 -0
  10. package/dist/dts/state/reactive.d.ts +8 -0
  11. package/dist/dts/state/state.d.ts +141 -0
  12. package/dist/dts/state/visitor.d.ts +6 -0
  13. package/dist/dts/state/watch.d.ts +10 -0
  14. package/dist/dts/styles/element-styles.d.ts +6 -0
  15. package/dist/dts/templating/binding-signal.d.ts +10 -27
  16. package/dist/dts/templating/binding-two-way.d.ts +16 -41
  17. package/dist/dts/templating/binding.d.ts +79 -118
  18. package/dist/dts/templating/html-directive.d.ts +28 -2
  19. package/dist/dts/templating/render.d.ts +277 -0
  20. package/dist/dts/templating/repeat.d.ts +12 -16
  21. package/dist/dts/templating/template.d.ts +3 -3
  22. package/dist/dts/templating/when.d.ts +3 -3
  23. package/dist/dts/testing/exports.d.ts +2 -0
  24. package/dist/dts/testing/fixture.d.ts +90 -0
  25. package/dist/dts/testing/timeout.d.ts +7 -0
  26. package/dist/dts/utilities.d.ts +0 -18
  27. package/dist/esm/components/fast-definitions.js +25 -27
  28. package/dist/esm/components/fast-element.js +20 -11
  29. package/dist/esm/context.js +5 -1
  30. package/dist/esm/debug.js +35 -4
  31. package/dist/esm/di/di.js +1351 -0
  32. package/dist/esm/interfaces.js +4 -0
  33. package/dist/esm/observation/arrays.js +303 -2
  34. package/dist/esm/observation/observable.js +11 -6
  35. package/dist/esm/platform.js +1 -1
  36. package/dist/esm/state/exports.js +3 -0
  37. package/dist/esm/state/reactive.js +34 -0
  38. package/dist/esm/state/state.js +148 -0
  39. package/dist/esm/state/visitor.js +28 -0
  40. package/dist/esm/state/watch.js +36 -0
  41. package/dist/esm/styles/element-styles.js +14 -0
  42. package/dist/esm/templating/binding-signal.js +56 -61
  43. package/dist/esm/templating/binding-two-way.js +51 -35
  44. package/dist/esm/templating/binding.js +137 -156
  45. package/dist/esm/templating/compiler.js +29 -7
  46. package/dist/esm/templating/html-directive.js +12 -1
  47. package/dist/esm/templating/render.js +392 -0
  48. package/dist/esm/templating/repeat.js +57 -40
  49. package/dist/esm/templating/template.js +8 -5
  50. package/dist/esm/templating/view.js +3 -1
  51. package/dist/esm/templating/when.js +5 -4
  52. package/dist/esm/testing/exports.js +2 -0
  53. package/dist/esm/testing/fixture.js +88 -0
  54. package/dist/esm/testing/timeout.js +24 -0
  55. package/dist/esm/utilities.js +0 -95
  56. package/dist/fast-element.api.json +2827 -2757
  57. package/dist/fast-element.d.ts +215 -229
  58. package/dist/fast-element.debug.js +650 -256
  59. package/dist/fast-element.debug.min.js +1 -1
  60. package/dist/fast-element.js +615 -252
  61. package/dist/fast-element.min.js +1 -1
  62. package/dist/fast-element.untrimmed.d.ts +223 -234
  63. package/docs/api-report.md +87 -90
  64. package/package.json +18 -9
  65. package/dist/dts/hooks.d.ts +0 -20
  66. package/dist/dts/observation/splice-strategies.d.ts +0 -13
  67. package/dist/esm/hooks.js +0 -32
  68. package/dist/esm/observation/splice-strategies.js +0 -400
@@ -1,56 +1,5 @@
1
- import { Binding, BindingObserver, ExecutionContext } from "../observation/observable.js";
2
- import { AddViewBehaviorFactory, Aspect, Aspected, HTMLDirective, ViewBehavior, ViewBehaviorFactory, ViewBehaviorTargets } from "./html-directive.js";
3
- import type { CaptureType } from "./template.js";
4
- /**
5
- * Describes how aspects of an HTML element will be affected by bindings.
6
- * @public
7
- */
8
- export declare type BindingMode = Record<Aspect, (directive: HTMLBindingDirective) => Pick<ViewBehaviorFactory, "createBehavior">>;
9
- /**
10
- * Describes how aspects of an HTML element will be affected by bindings.
11
- * @public
12
- */
13
- export declare const BindingMode: Readonly<{
14
- /**
15
- * Creates a binding mode based on the supplied behavior types.
16
- * @param UpdateType - The base behavior type used to update aspects.
17
- * @param EventType - The base behavior type used to respond to events.
18
- * @returns A new binding mode.
19
- */
20
- define(UpdateType: typeof UpdateBinding, EventType?: typeof EventBinding): BindingMode;
21
- }>;
22
- /**
23
- * Describes the configuration for a binding expression.
24
- * @public
25
- */
26
- export interface BindingConfig<T = any> {
27
- /**
28
- * The binding mode to configure the binding with.
29
- */
30
- mode: BindingMode;
31
- /**
32
- * Options to be supplied to the binding behaviors.
33
- */
34
- options: T;
35
- }
36
- /**
37
- * Creates a new binding configuration based on the supplied options.
38
- * @public
39
- */
40
- export declare type BindingConfigResolver<T> = (options: T) => BindingConfig<T>;
41
- /**
42
- * Describes the configuration for a binding expression.
43
- * @public
44
- */
45
- export declare const BindingConfig: Readonly<{
46
- /**
47
- * Creates a binding configuration based on the provided mode and options.
48
- * @param mode - The mode to use for the configuration.
49
- * @param defaultOptions - The default options to use for the configuration.
50
- * @returns A new binding configuration.
51
- */
52
- define<T>(mode: BindingMode, defaultOptions: T): BindingConfig<T> & BindingConfigResolver<T>;
53
- }>;
1
+ import { ExecutionContext, Expression, ExpressionObserver } from "../observation/observable.js";
2
+ import { AddViewBehaviorFactory, Aspect, Aspected, Binding, HTMLDirective, ViewBehavior, ViewBehaviorFactory, ViewBehaviorTargets } from "./html-directive.js";
54
3
  /**
55
4
  * The "this" context for an update target function.
56
5
  * @public
@@ -73,57 +22,48 @@ export interface UpdateTargetThis {
73
22
  */
74
23
  export declare type UpdateTarget = (this: UpdateTargetThis, target: Node, aspect: string, value: any, source: any, context: ExecutionContext) => void;
75
24
  /**
76
- * A base binding behavior for DOM updates.
25
+ * A simple View that can be interpolated into HTML content.
77
26
  * @public
78
27
  */
79
- export declare class UpdateBinding implements ViewBehavior {
80
- readonly directive: HTMLBindingDirective;
81
- protected updateTarget: UpdateTarget;
28
+ export interface ContentView {
82
29
  /**
83
- * Creates an instance of UpdateBinding.
84
- * @param directive - The directive that has the configuration for this behavior.
85
- * @param updateTarget - The function used to update the target with the latest value.
30
+ * Binds a view's behaviors to its binding source.
31
+ * @param source - The binding source for the view's binding behaviors.
32
+ * @param context - The execution context to run the view within.
86
33
  */
87
- constructor(directive: HTMLBindingDirective, updateTarget: UpdateTarget);
34
+ bind(source: any, context: ExecutionContext): void;
88
35
  /**
89
- * Bind this behavior to the source.
90
- * @param source - The source to bind to.
91
- * @param context - The execution context that the binding is operating within.
92
- * @param targets - The targets that behaviors in a view can attach to.
36
+ * Unbinds a view's behaviors from its binding source and context.
93
37
  */
94
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
38
+ unbind(): void;
95
39
  /**
96
- * Unbinds this behavior from the source.
97
- * @param source - The source to unbind from.
98
- * @param context - The execution context that the binding is operating within.
99
- * @param targets - The targets that behaviors in a view can attach to.
40
+ * Inserts the view's DOM nodes before the referenced node.
41
+ * @param node - The node to insert the view's DOM before.
100
42
  */
101
- unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
43
+ insertBefore(node: Node): void;
102
44
  /**
103
- * Creates a behavior.
104
- * @param targets - The targets available for behaviors to be attached to.
45
+ * Removes the view's DOM nodes.
46
+ * The nodes are not disposed and the view can later be re-inserted.
105
47
  */
106
- createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
48
+ remove(): void;
107
49
  }
108
50
  /**
109
- * A binding behavior for one-time bindings.
51
+ * A simple template that can create ContentView instances.
110
52
  * @public
111
53
  */
112
- export declare class OneTimeBinding extends UpdateBinding {
54
+ export interface ContentTemplate {
113
55
  /**
114
- * Bind this behavior to the source.
115
- * @param source - The source to bind to.
116
- * @param context - The execution context that the binding is operating within.
117
- * @param targets - The targets that behaviors in a view can attach to.
56
+ * Creates a simple content view instance.
118
57
  */
119
- bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
58
+ create(): ContentView;
120
59
  }
121
60
  /**
122
61
  * A binding behavior for bindings that change.
123
62
  * @public
124
63
  */
125
- export declare class ChangeBinding extends UpdateBinding {
126
- private isBindingVolatile;
64
+ export declare class BindingBehavior implements ViewBehavior {
65
+ readonly directive: HTMLBindingDirective;
66
+ protected updateTarget: UpdateTarget;
127
67
  private observerProperty;
128
68
  /**
129
69
  * Creates an instance of ChangeBinding.
@@ -131,12 +71,6 @@ export declare class ChangeBinding extends UpdateBinding {
131
71
  * @param updateTarget - The function used to update the target with the latest value.
132
72
  */
133
73
  constructor(directive: HTMLBindingDirective, updateTarget: UpdateTarget);
134
- /**
135
- * Returns the binding observer used to update the node.
136
- * @param target - The target node.
137
- * @returns A BindingObserver.
138
- */
139
- protected getObserver(target: Node): BindingObserver;
140
74
  /**
141
75
  * Bind this behavior to the source.
142
76
  * @param source - The source to bind to.
@@ -152,13 +86,37 @@ export declare class ChangeBinding extends UpdateBinding {
152
86
  */
153
87
  unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
154
88
  /** @internal */
155
- handleChange(binding: Binding, observer: BindingObserver): void;
89
+ handleChange(binding: Expression, observer: ExpressionObserver): void;
90
+ /**
91
+ * Returns the binding observer used to update the node.
92
+ * @param target - The target node.
93
+ * @returns A BindingObserver.
94
+ */
95
+ protected getObserver(target: Node): ExpressionObserver;
96
+ /**
97
+ * Creates a behavior.
98
+ * @param targets - The targets available for behaviors to be attached to.
99
+ */
100
+ createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
101
+ }
102
+ /**
103
+ * A special binding behavior that can bind node content.
104
+ * @public
105
+ */
106
+ export declare class ContentBehavior extends BindingBehavior {
107
+ /**
108
+ * Unbinds this behavior from the source.
109
+ * @param source - The source to unbind from.
110
+ * @param context - The execution context that the binding is operating within.
111
+ * @param targets - The targets that behaviors in a view can attach to.
112
+ */
113
+ unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
156
114
  }
157
115
  /**
158
116
  * A binding behavior for handling events.
159
117
  * @public
160
118
  */
161
- export declare class EventBinding {
119
+ export declare class EventBehavior {
162
120
  readonly directive: HTMLBindingDirective;
163
121
  private contextProperty;
164
122
  private sourceProperty;
@@ -191,29 +149,12 @@ export declare class EventBinding {
191
149
  */
192
150
  handleEvent(event: Event): void;
193
151
  }
194
- /**
195
- * The default binding options.
196
- * @public
197
- */
198
- export declare type DefaultBindingOptions = AddEventListenerOptions;
199
- /**
200
- * The default onChange binding configuration.
201
- * @public
202
- */
203
- export declare const onChange: BindingConfig<AddEventListenerOptions> & BindingConfigResolver<AddEventListenerOptions>;
204
- /**
205
- * The default onTime binding configuration.
206
- * @public
207
- */
208
- export declare const oneTime: BindingConfig<AddEventListenerOptions> & BindingConfigResolver<AddEventListenerOptions>;
209
152
  /**
210
153
  * A directive that applies bindings.
211
154
  * @public
212
155
  */
213
156
  export declare class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, Aspected {
214
- binding: Binding;
215
- mode: BindingMode;
216
- options: any;
157
+ dataBinding: Binding;
217
158
  private factory;
218
159
  /**
219
160
  * The unique id of the factory.
@@ -237,11 +178,9 @@ export declare class HTMLBindingDirective implements HTMLDirective, ViewBehavior
237
178
  aspectType: Aspect;
238
179
  /**
239
180
  * Creates an instance of HTMLBindingDirective.
240
- * @param binding - The binding to apply.
241
- * @param mode - The binding mode to use when applying the binding.
242
- * @param options - The options to configure the binding with.
181
+ * @param dataBinding - The binding configuration to apply.
243
182
  */
244
- constructor(binding: Binding, mode: BindingMode, options: any);
183
+ constructor(dataBinding: Binding);
245
184
  /**
246
185
  * Creates HTML to be used within a template.
247
186
  * @param add - Can be used to add behavior factories to a template.
@@ -254,10 +193,32 @@ export declare class HTMLBindingDirective implements HTMLDirective, ViewBehavior
254
193
  createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
255
194
  }
256
195
  /**
257
- * Creates a binding directive with the specified configuration.
258
- * @param binding - The binding expression.
259
- * @param config - The binding configuration.
260
- * @returns A binding directive.
196
+ * Creates an standard binding.
197
+ * @param binding - The binding to refresh when changed.
198
+ * @param isVolatile - Indicates whether the binding is volatile or not.
199
+ * @returns A binding configuration.
200
+ * @public
201
+ */
202
+ export declare function bind<T = any>(binding: Expression<T>, isVolatile?: boolean): Binding<T>;
203
+ /**
204
+ * Creates a one time binding
205
+ * @param binding - The binding to refresh when signaled.
206
+ * @returns A binding configuration.
207
+ * @public
208
+ */
209
+ export declare function oneTime<T = any>(binding: Expression<T>): Binding<T>;
210
+ /**
211
+ * Creates an event listener binding.
212
+ * @param binding - The binding to invoke when the event is raised.
213
+ * @param options - Event listener options.
214
+ * @returns A binding configuration.
215
+ * @public
216
+ */
217
+ export declare function listener<T = any>(binding: Expression<T>, options?: AddEventListenerOptions): Binding<T>;
218
+ /**
219
+ * Normalizes the input value into a binding.
220
+ * @param value - The value to create the default binding for.
221
+ * @returns A binding configuration for the provided value.
261
222
  * @public
262
223
  */
263
- export declare function bind<T = any>(binding: Binding<T>, config?: BindingConfig | DefaultBindingOptions): CaptureType<T>;
224
+ export declare function normalizeBinding<TSource = any, TReturn = any, TParent = any>(value: Expression<TSource, TReturn, TParent> | Binding<TSource, TReturn, TParent> | {}): Binding<TSource, TReturn, TParent>;
@@ -1,6 +1,7 @@
1
1
  import type { Constructable } from "../interfaces.js";
2
2
  import type { Behavior } from "../observation/behavior.js";
3
- import type { Binding, ExecutionContext } from "../observation/observable.js";
3
+ import type { Subscriber } from "../observation/notifier.js";
4
+ import type { ExecutionContext, Expression, ExpressionObserver } from "../observation/observable.js";
4
5
  /**
5
6
  * The target nodes available to a behavior.
6
7
  * @public
@@ -113,6 +114,31 @@ export declare const HTMLDirective: Readonly<{
113
114
  * @public
114
115
  */
115
116
  export declare function htmlDirective(options?: PartialHTMLDirectiveDefinition): (type: Constructable<HTMLDirective>) => void;
117
+ /**
118
+ * Captures a binding expression along with related information and capabilities.
119
+ *
120
+ * @public
121
+ */
122
+ export declare abstract class Binding<TSource = any, TReturn = any, TParent = any> {
123
+ /**
124
+ * Options associated with the binding.
125
+ */
126
+ options?: any;
127
+ /**
128
+ * Whether or not the binding is volatile.
129
+ */
130
+ isVolatile?: boolean;
131
+ /**
132
+ * Evaluates the binding expression.
133
+ */
134
+ evaluate: Expression<TSource, TReturn, TParent>;
135
+ /**
136
+ * Creates an observer capable of notifying a subscriber when the output of a binding changes.
137
+ * @param directive - The HTML Directive to create the observer for.
138
+ * @param subscriber - The subscriber to changes in the binding.
139
+ */
140
+ abstract createObserver(directive: HTMLDirective, subscriber: Subscriber): ExpressionObserver<TSource, TReturn, TParent>;
141
+ }
116
142
  /**
117
143
  * The type of HTML aspect to target.
118
144
  * @public
@@ -180,7 +206,7 @@ export interface Aspected {
180
206
  /**
181
207
  * A binding if one is associated with the aspect.
182
208
  */
183
- binding?: Binding;
209
+ dataBinding?: Binding;
184
210
  }
185
211
  /**
186
212
  * A base class used for attribute directives that don't need internal state.
@@ -0,0 +1,277 @@
1
+ import type { FASTElement } from "../components/fast-element.js";
2
+ import { Constructable } from "../interfaces.js";
3
+ import type { Behavior } from "../observation/behavior.js";
4
+ import type { Subscriber } from "../observation/notifier.js";
5
+ import type { ExecutionContext, Expression, ExpressionObserver } from "../observation/observable.js";
6
+ import { ContentTemplate, ContentView } from "./binding.js";
7
+ import { AddViewBehaviorFactory, Binding, HTMLDirective, ViewBehaviorFactory, ViewBehaviorTargets } from "./html-directive.js";
8
+ import { CaptureType, SyntheticViewTemplate, TemplateValue, ViewTemplate } from "./template.js";
9
+ /**
10
+ * A Behavior that enables advanced rendering.
11
+ * @public
12
+ */
13
+ export declare class RenderBehavior<TSource = any, TParent = any> implements Behavior, Subscriber {
14
+ private directive;
15
+ private location;
16
+ private source;
17
+ private view;
18
+ private template;
19
+ private templateBindingObserver;
20
+ private data;
21
+ private dataBindingObserver;
22
+ private originalContext;
23
+ private childContext;
24
+ /**
25
+ * Creates an instance of RenderBehavior.
26
+ * @param location - A Node representing the location where this behavior will render.
27
+ * @param dataBinding - A binding expression that returns the data to render.
28
+ * @param templateBinding - A binding expression that returns the template to use with the data.
29
+ */
30
+ constructor(directive: RenderDirective, location: Node);
31
+ /**
32
+ * Bind this behavior to the source.
33
+ * @param source - The source to bind to.
34
+ * @param context - The execution context that the binding is operating within.
35
+ */
36
+ bind(source: TSource, context: ExecutionContext): void;
37
+ /**
38
+ * Unbinds this behavior from the source.
39
+ * @param source - The source to unbind from.
40
+ */
41
+ unbind(source: TSource, context: ExecutionContext<TParent>): void;
42
+ /** @internal */
43
+ handleChange(source: any, observer: ExpressionObserver): void;
44
+ private refreshView;
45
+ }
46
+ /**
47
+ * A Directive that enables use of the RenderBehavior.
48
+ * @public
49
+ */
50
+ export declare class RenderDirective<TSource = any> implements HTMLDirective, ViewBehaviorFactory {
51
+ readonly dataBinding: Binding<TSource>;
52
+ readonly templateBinding: Binding<TSource, ContentTemplate>;
53
+ readonly templateBindingDependsOnData: boolean;
54
+ /**
55
+ * The unique id of the factory.
56
+ */
57
+ id: string;
58
+ /**
59
+ * The structural id of the DOM node to which the created behavior will apply.
60
+ */
61
+ nodeId: string;
62
+ /**
63
+ * Creates an instance of RenderDirective.
64
+ * @param dataBinding - A binding expression that returns the data to render.
65
+ * @param templateBinding - A binding expression that returns the template to use to render the data.
66
+ */
67
+ constructor(dataBinding: Binding<TSource>, templateBinding: Binding<TSource, ContentTemplate>, templateBindingDependsOnData: boolean);
68
+ /**
69
+ * Creates HTML to be used within a template.
70
+ * @param add - Can be used to add behavior factories to a template.
71
+ */
72
+ createHTML(add: AddViewBehaviorFactory): string;
73
+ /**
74
+ * Creates a behavior.
75
+ * @param targets - The targets available for behaviors to be attached to.
76
+ */
77
+ createBehavior(targets: ViewBehaviorTargets): RenderBehavior<TSource>;
78
+ }
79
+ /**
80
+ * Provides instructions for how to render a type.
81
+ * @public
82
+ */
83
+ export interface RenderInstruction {
84
+ /**
85
+ * Identifies this as a RenderInstruction.
86
+ */
87
+ brand: symbol;
88
+ /**
89
+ * The type this instruction is associated with.
90
+ */
91
+ type: Constructable;
92
+ /**
93
+ * The template to use when rendering.
94
+ */
95
+ template: ContentTemplate;
96
+ /**
97
+ * A name that can be used to identify the instruction.
98
+ */
99
+ name: string;
100
+ }
101
+ /**
102
+ * Render options that are common to all configurations.
103
+ * @public
104
+ */
105
+ export declare type CommonRenderOptions = {
106
+ /**
107
+ * The type this instruction is associated with.
108
+ */
109
+ type: Constructable;
110
+ /**
111
+ * A name that can be used to identify the instruction.
112
+ */
113
+ name?: string;
114
+ };
115
+ /**
116
+ * Render options used to specify a template.
117
+ * @public
118
+ */
119
+ export declare type TemplateRenderOptions = CommonRenderOptions & {
120
+ /**
121
+ * The template to use when rendering.
122
+ */
123
+ template: ContentTemplate;
124
+ };
125
+ /**
126
+ * Render options that are common to all element render instructions.
127
+ * @public
128
+ */
129
+ export declare type BaseElementRenderOptions<TSource = any, TParent = any> = CommonRenderOptions & {
130
+ /**
131
+ * Attributes to use when creating the element template.
132
+ */
133
+ attributes?: Record<string, string | TemplateValue<TSource, TParent>>;
134
+ /**
135
+ * Content to use when creating the element template.
136
+ */
137
+ content?: string | SyntheticViewTemplate;
138
+ };
139
+ /**
140
+ * Render options used to specify an element.
141
+ * @public
142
+ */
143
+ export declare type ElementConstructorRenderOptions<TSource = any, TParent = any> = BaseElementRenderOptions<TSource, TParent> & {
144
+ /**
145
+ * The element to use when rendering.
146
+ */
147
+ element: Constructable<FASTElement>;
148
+ };
149
+ /**
150
+ * Render options use to specify an element by tag name.
151
+ * @public
152
+ */
153
+ export declare type TagNameRenderOptions<TSource = any, TParent = any> = BaseElementRenderOptions<TSource, TParent> & {
154
+ /**
155
+ * The tag name to use when rendering.
156
+ */
157
+ tagName: string;
158
+ };
159
+ declare function createElementTemplate<TSource = any, TParent = any>(tagName: string, attributes?: Record<string, string | TemplateValue<TSource, TParent>>, content?: string | ContentTemplate): ViewTemplate<TSource, TParent>;
160
+ declare function create(options: TagNameRenderOptions): RenderInstruction;
161
+ declare function create(options: ElementConstructorRenderOptions): RenderInstruction;
162
+ declare function create(options: TemplateRenderOptions): RenderInstruction;
163
+ declare function instanceOf(object: any): object is RenderInstruction;
164
+ declare function register(options: TagNameRenderOptions): RenderInstruction;
165
+ declare function register(options: ElementConstructorRenderOptions): RenderInstruction;
166
+ declare function register(options: TemplateRenderOptions): RenderInstruction;
167
+ declare function register(instruction: RenderInstruction): RenderInstruction;
168
+ declare function getByType(type: Constructable, name?: string): RenderInstruction | undefined;
169
+ declare function getForInstance(object: any, name?: string): RenderInstruction | undefined;
170
+ /**
171
+ * Provides APIs for creating and interacting with render instructions.
172
+ * @public
173
+ */
174
+ export declare const RenderInstruction: Readonly<{
175
+ /**
176
+ * Checks whether the provided object is a RenderInstruction.
177
+ * @param object - The object to check.
178
+ * @returns true if the object is a RenderInstruction; false otherwise
179
+ */
180
+ instanceOf: typeof instanceOf;
181
+ /**
182
+ * Creates a RenderInstruction for a set of options.
183
+ * @param options - The options to use when creating the RenderInstruction.
184
+ */
185
+ create: typeof create;
186
+ /**
187
+ * Creates a template based on a tag name.
188
+ * @param tagName - The tag name to use when creating the template.
189
+ * @param attributes - The attributes to apply to the element.
190
+ * @param content - The content to insert into the element.
191
+ * @returns A template based on the provided specifications.
192
+ */
193
+ createElementTemplate: typeof createElementTemplate;
194
+ /**
195
+ * Creates and registers an instruction.
196
+ * @param options The options to use when creating the RenderInstruction.
197
+ * @remarks
198
+ * A previously created RenderInstruction can also be registered.
199
+ */
200
+ register: typeof register;
201
+ /**
202
+ * Finds a previously registered RenderInstruction by type and optionally by name.
203
+ * @param type - The type to retrieve the RenderInstruction for.
204
+ * @param name - An optional name used in differentiating between multiple registered instructions.
205
+ * @returns The located RenderInstruction that matches the criteria or undefined if none is found.
206
+ */
207
+ getByType: typeof getByType;
208
+ /**
209
+ * Finds a previously registered RenderInstruction for the instance's type and optionally by name.
210
+ * @param object - The instance to retrieve the RenderInstruction for.
211
+ * @param name - An optional name used in differentiating between multiple registered instructions.
212
+ * @returns The located RenderInstruction that matches the criteria or undefined if none is found.
213
+ */
214
+ getForInstance: typeof getForInstance;
215
+ }>;
216
+ /**
217
+ * Decorates a type with render instruction metadata.
218
+ * @param options - The options used in creating the RenderInstruction.
219
+ * @public
220
+ */
221
+ export declare function renderWith(options: Omit<TagNameRenderOptions, "type">): ClassDecorator;
222
+ /**
223
+ * Decorates a type with render instruction metadata.
224
+ * @param options - The options used in creating the RenderInstruction.
225
+ * @public
226
+ */
227
+ export declare function renderWith(options: Omit<ElementConstructorRenderOptions, "type">): ClassDecorator;
228
+ /**
229
+ * Decorates a type with render instruction metadata.
230
+ * @param options - The options used in creating the RenderInstruction.
231
+ * @public
232
+ */
233
+ export declare function renderWith(options: Omit<TemplateRenderOptions, "type">): ClassDecorator;
234
+ /**
235
+ * Decorates a type with render instruction metadata.
236
+ * @param element - The element to use to render the decorated class.
237
+ * @param name - An optional name to differentiate the render instruction.
238
+ * @public
239
+ */
240
+ export declare function renderWith(element: Constructable<FASTElement>, name?: string): ClassDecorator;
241
+ /**
242
+ * Decorates a type with render instruction metadata.
243
+ * @param template - The template to use to render the decorated class.
244
+ * @param name - An optional name to differentiate the render instruction.
245
+ * @public
246
+ */
247
+ export declare function renderWith(template: ContentTemplate, name?: string): ClassDecorator;
248
+ /**
249
+ * @internal
250
+ */
251
+ export declare class NodeTemplate implements ContentTemplate, ContentView {
252
+ readonly node: Node;
253
+ constructor(node: Node);
254
+ bind(source: any, context: ExecutionContext<any>): void;
255
+ unbind(): void;
256
+ insertBefore(refNode: Node): void;
257
+ remove(): void;
258
+ create(): ContentView;
259
+ }
260
+ /**
261
+ * Creates a RenderDirective for use in advanced rendering scenarios.
262
+ * @param value - The binding expression that returns the data to be rendered. The expression
263
+ * can also return a Node to render directly.
264
+ * @param template - A template to render the data with
265
+ * or a string to indicate which RenderInstruction to use when looking up a RenderInstruction.
266
+ * Expressions can also be provided to dynamically determine either the template or the name.
267
+ * @returns A RenderDirective suitable for use in a template.
268
+ * @remarks
269
+ * If no binding is provided, then a default binding that returns the source is created.
270
+ * If no template is provided, then a binding is created that will use registered
271
+ * RenderInstructions to determine the view.
272
+ * If the template binding returns a string, then it will be used to look up a
273
+ * RenderInstruction to determine the view.
274
+ * @public
275
+ */
276
+ export declare function render<TSource = any, TItem = any>(value?: Expression<TSource, TItem> | Binding<TSource, TItem> | {}, template?: ContentTemplate | string | Expression<TSource, ContentTemplate | string | Node> | Binding<TSource, ContentTemplate | string | Node>): CaptureType<TSource>;
277
+ export {};