@microsoft/fast-element 2.0.0-beta.1 → 2.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +333 -0
- package/CHANGELOG.md +106 -1
- package/dist/dts/components/attributes.d.ts +10 -0
- package/dist/dts/components/{controller.d.ts → element-controller.d.ts} +24 -25
- package/dist/dts/components/fast-definitions.d.ts +43 -9
- package/dist/dts/components/fast-element.d.ts +15 -21
- package/dist/dts/context.d.ts +157 -0
- package/dist/dts/di/di.d.ts +899 -0
- package/dist/dts/index.d.ts +2 -2
- package/dist/dts/interfaces.d.ts +44 -12
- package/dist/dts/metadata.d.ts +25 -0
- package/dist/dts/observation/arrays.d.ts +1 -1
- package/dist/dts/observation/observable.d.ts +101 -75
- package/dist/dts/pending-task.d.ts +20 -0
- package/dist/dts/platform.d.ts +6 -0
- package/dist/dts/state/exports.d.ts +3 -0
- package/dist/dts/state/reactive.d.ts +8 -0
- package/dist/dts/state/state.d.ts +141 -0
- package/dist/dts/state/visitor.d.ts +6 -0
- package/dist/dts/state/watch.d.ts +10 -0
- package/dist/dts/styles/css-directive.d.ts +2 -2
- package/dist/dts/styles/element-styles.d.ts +9 -3
- package/dist/dts/styles/host.d.ts +68 -0
- package/dist/dts/templating/binding-signal.d.ts +21 -0
- package/dist/dts/templating/binding-two-way.d.ts +39 -0
- package/dist/dts/templating/binding.d.ts +69 -294
- package/dist/dts/templating/children.d.ts +1 -1
- package/dist/dts/templating/compiler.d.ts +1 -2
- package/dist/dts/templating/html-directive.d.ts +93 -35
- package/dist/dts/templating/node-observation.d.ts +4 -5
- package/dist/dts/templating/ref.d.ts +5 -13
- package/dist/dts/templating/render.d.ts +272 -0
- package/dist/dts/templating/repeat.d.ts +20 -75
- package/dist/dts/templating/slotted.d.ts +1 -1
- package/dist/dts/templating/template.d.ts +12 -61
- package/dist/dts/templating/view.d.ts +77 -12
- package/dist/dts/templating/when.d.ts +3 -3
- package/dist/dts/testing/exports.d.ts +3 -0
- package/dist/dts/testing/fakes.d.ts +4 -0
- package/dist/dts/testing/fixture.d.ts +84 -0
- package/dist/dts/testing/timeout.d.ts +7 -0
- package/dist/{tsdoc-metadata.json → dts/tsdoc-metadata.json} +0 -0
- package/dist/dts/utilities.d.ts +0 -18
- package/dist/esm/components/attributes.js +13 -4
- package/dist/esm/components/{controller.js → element-controller.js} +95 -105
- package/dist/esm/components/fast-definitions.js +38 -28
- package/dist/esm/components/fast-element.js +31 -12
- package/dist/esm/context.js +163 -0
- package/dist/esm/debug.js +36 -4
- package/dist/esm/di/di.js +1435 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/interfaces.js +4 -0
- package/dist/esm/metadata.js +60 -0
- package/dist/esm/observation/arrays.js +304 -3
- package/dist/esm/observation/observable.js +81 -87
- package/dist/esm/pending-task.js +16 -0
- package/dist/esm/platform.js +25 -1
- package/dist/esm/state/exports.js +3 -0
- package/dist/esm/state/reactive.js +34 -0
- package/dist/esm/state/state.js +148 -0
- package/dist/esm/state/visitor.js +28 -0
- package/dist/esm/state/watch.js +36 -0
- package/dist/esm/styles/css.js +4 -4
- package/dist/esm/styles/element-styles.js +14 -0
- package/dist/esm/{observation/behavior.js → styles/host.js} +0 -0
- package/dist/esm/templating/binding-signal.js +83 -0
- package/dist/esm/templating/binding-two-way.js +103 -0
- package/dist/esm/templating/binding.js +134 -414
- package/dist/esm/templating/compiler.js +30 -7
- package/dist/esm/templating/html-directive.js +100 -28
- package/dist/esm/templating/node-observation.js +9 -8
- package/dist/esm/templating/ref.js +4 -12
- package/dist/esm/templating/render.js +391 -0
- package/dist/esm/templating/repeat.js +96 -72
- package/dist/esm/templating/template.js +11 -29
- package/dist/esm/templating/view.js +107 -29
- package/dist/esm/templating/when.js +5 -4
- package/dist/esm/testing/exports.js +3 -0
- package/dist/esm/testing/fakes.js +76 -0
- package/dist/esm/testing/fixture.js +86 -0
- package/dist/esm/testing/timeout.js +24 -0
- package/dist/esm/utilities.js +0 -95
- package/dist/fast-element.api.json +9034 -10524
- package/dist/fast-element.d.ts +707 -811
- package/dist/fast-element.debug.js +1133 -850
- package/dist/fast-element.debug.min.js +1 -1
- package/dist/fast-element.js +1097 -846
- package/dist/fast-element.min.js +1 -1
- package/dist/fast-element.untrimmed.d.ts +724 -818
- package/docs/api-report.md +264 -305
- package/package.json +39 -10
- package/dist/dts/hooks.d.ts +0 -20
- package/dist/dts/observation/behavior.d.ts +0 -19
- package/dist/dts/observation/splice-strategies.d.ts +0 -13
- package/dist/esm/hooks.js +0 -32
- package/dist/esm/observation/splice-strategies.js +0 -400
package/docs/api-report.md
CHANGED
|
@@ -12,7 +12,7 @@ export interface Accessor {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// @public
|
|
15
|
-
export type AddBehavior = (behavior:
|
|
15
|
+
export type AddBehavior = (behavior: HostBehavior<HTMLElement>) => void;
|
|
16
16
|
|
|
17
17
|
// @public
|
|
18
18
|
export type AddViewBehaviorFactory = (factory: ViewBehaviorFactory) => string;
|
|
@@ -53,7 +53,7 @@ export const Aspect: Readonly<{
|
|
|
53
53
|
readonly content: 4;
|
|
54
54
|
readonly tokenList: 5;
|
|
55
55
|
readonly event: 6;
|
|
56
|
-
readonly assign: (directive: Aspected, value
|
|
56
|
+
readonly assign: (directive: Aspected, value?: string) => void;
|
|
57
57
|
}>;
|
|
58
58
|
|
|
59
59
|
// @public
|
|
@@ -62,7 +62,7 @@ export type Aspect = typeof Aspect[Exclude<keyof typeof Aspect, "assign" | "none
|
|
|
62
62
|
// @public
|
|
63
63
|
export interface Aspected {
|
|
64
64
|
aspectType: Aspect;
|
|
65
|
-
|
|
65
|
+
dataBinding?: Binding;
|
|
66
66
|
sourceAspect: string;
|
|
67
67
|
targetAspect: string;
|
|
68
68
|
}
|
|
@@ -81,6 +81,11 @@ export type AttributeConfiguration = {
|
|
|
81
81
|
converter?: ValueConverter;
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
+
// @public
|
|
85
|
+
export const AttributeConfiguration: Readonly<{
|
|
86
|
+
locate: (target: {}) => AttributeConfiguration[];
|
|
87
|
+
}>;
|
|
88
|
+
|
|
84
89
|
// @public
|
|
85
90
|
export class AttributeDefinition implements Accessor {
|
|
86
91
|
constructor(Owner: Function, name: string, attribute?: string, mode?: AttributeMode, converter?: ValueConverter);
|
|
@@ -104,44 +109,17 @@ export class AttributeDefinition implements Accessor {
|
|
|
104
109
|
export type AttributeMode = typeof reflectMode | typeof booleanMode | "fromView";
|
|
105
110
|
|
|
106
111
|
// @public
|
|
107
|
-
export
|
|
108
|
-
bind(source: TSource, context: TContext): void;
|
|
109
|
-
unbind(source: TSource, context: TContext): void;
|
|
110
|
-
}
|
|
112
|
+
export function bind<T = any>(binding: Expression<T>, isVolatile?: boolean): Binding<T>;
|
|
111
113
|
|
|
112
114
|
// @public
|
|
113
|
-
export
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
//
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
options: T;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// @public
|
|
125
|
-
export const BindingConfig: Readonly<{
|
|
126
|
-
define<T>(mode: BindingMode, defaultOptions: T): BindingConfig<T> & BindingConfigResolver<T>;
|
|
127
|
-
}>;
|
|
128
|
-
|
|
129
|
-
// @public
|
|
130
|
-
export type BindingConfigResolver<T> = (options: T) => BindingConfig<T>;
|
|
131
|
-
|
|
132
|
-
// @public
|
|
133
|
-
export type BindingMode = Record<Aspect, (directive: HTMLBindingDirective) => Pick<ViewBehaviorFactory, "createBehavior">>;
|
|
134
|
-
|
|
135
|
-
// @public
|
|
136
|
-
export const BindingMode: Readonly<{
|
|
137
|
-
define(UpdateType: typeof UpdateBinding, EventType?: typeof EventBinding): BindingMode;
|
|
138
|
-
}>;
|
|
139
|
-
|
|
140
|
-
// @public
|
|
141
|
-
export interface BindingObserver<TSource = any, TReturn = any, TParent = any> extends Notifier, Disposable {
|
|
142
|
-
observe(source: TSource, context?: ExecutionContext<TParent>): TReturn;
|
|
143
|
-
records(): IterableIterator<ObservationRecord>;
|
|
144
|
-
setMode(isAsync: boolean): void;
|
|
115
|
+
export abstract class Binding<TSource = any, TReturn = any, TParent = any> {
|
|
116
|
+
constructor(evaluate: Expression<TSource, TReturn, TParent>, isVolatile?: boolean);
|
|
117
|
+
abstract createObserver(directive: HTMLDirective, subscriber: Subscriber): ExpressionObserver<TSource, TReturn, TParent>;
|
|
118
|
+
// (undocumented)
|
|
119
|
+
evaluate: Expression<TSource, TReturn, TParent>;
|
|
120
|
+
// (undocumented)
|
|
121
|
+
isVolatile: boolean;
|
|
122
|
+
options?: any;
|
|
145
123
|
}
|
|
146
124
|
|
|
147
125
|
// @public
|
|
@@ -153,27 +131,7 @@ export type Callable = typeof Function.prototype.call | {
|
|
|
153
131
|
};
|
|
154
132
|
|
|
155
133
|
// @public
|
|
156
|
-
export interface CaptureType<TSource> {
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// @public
|
|
160
|
-
export class ChangeBinding extends UpdateBinding {
|
|
161
|
-
constructor(directive: HTMLBindingDirective, updateTarget: UpdateTarget);
|
|
162
|
-
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
163
|
-
protected getObserver(target: Node): BindingObserver;
|
|
164
|
-
// @internal (undocumented)
|
|
165
|
-
handleChange(binding: Binding, observer: BindingObserver): void;
|
|
166
|
-
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// @public
|
|
170
|
-
export const child: <TChild = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TChild, TParent, ChildContext<TParent>>[]) => ChildViewTemplate<TChild, TParent>;
|
|
171
|
-
|
|
172
|
-
// @public
|
|
173
|
-
export interface ChildContext<TParentSource = any> extends RootContext {
|
|
174
|
-
createItemContext(index: number, length: number): ItemContext<TParentSource>;
|
|
175
|
-
readonly parent: TParentSource;
|
|
176
|
-
readonly parentContext: ChildContext<TParentSource>;
|
|
134
|
+
export interface CaptureType<TSource, TParent> {
|
|
177
135
|
}
|
|
178
136
|
|
|
179
137
|
// @public
|
|
@@ -181,7 +139,7 @@ export interface ChildListDirectiveOptions<T = any> extends NodeBehaviorOptions<
|
|
|
181
139
|
}
|
|
182
140
|
|
|
183
141
|
// @public
|
|
184
|
-
export function children<
|
|
142
|
+
export function children<TSource = any, TParent = any>(propertyOrOptions: (keyof TSource & string) | ChildrenDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
|
|
185
143
|
|
|
186
144
|
// @public
|
|
187
145
|
export class ChildrenDirective extends NodeObservationDirective<ChildrenDirectiveOptions> {
|
|
@@ -194,13 +152,6 @@ export class ChildrenDirective extends NodeObservationDirective<ChildrenDirectiv
|
|
|
194
152
|
// @public
|
|
195
153
|
export type ChildrenDirectiveOptions<T = any> = ChildListDirectiveOptions<T> | SubtreeDirectiveOptions<T>;
|
|
196
154
|
|
|
197
|
-
// @public
|
|
198
|
-
export interface ChildViewTemplate<TSource = any, TParent = any> {
|
|
199
|
-
create(): SyntheticView<TSource, TParent, ChildContext<TParent>>;
|
|
200
|
-
// (undocumented)
|
|
201
|
-
type: "child";
|
|
202
|
-
}
|
|
203
|
-
|
|
204
155
|
// @public
|
|
205
156
|
export type CompilationStrategy = (
|
|
206
157
|
html: string | HTMLTemplateElement,
|
|
@@ -209,7 +160,7 @@ factories: Record<string, ViewBehaviorFactory>) => HTMLTemplateCompilationResult
|
|
|
209
160
|
// @public
|
|
210
161
|
export const Compiler: {
|
|
211
162
|
setHTMLPolicy(policy: TrustedTypesPolicy): void;
|
|
212
|
-
compile<TSource = any, TParent = any
|
|
163
|
+
compile<TSource = any, TParent = any>(html: string | HTMLTemplateElement, directives: Record<string, ViewBehaviorFactory>): HTMLTemplateCompilationResult<TSource, TParent>;
|
|
213
164
|
setDefaultStrategy(strategy: CompilationStrategy): void;
|
|
214
165
|
aggregate(parts: (string | ViewBehaviorFactory)[]): ViewBehaviorFactory;
|
|
215
166
|
};
|
|
@@ -228,28 +179,25 @@ export type ConstructibleStyleStrategy = {
|
|
|
228
179
|
};
|
|
229
180
|
|
|
230
181
|
// @public
|
|
231
|
-
export
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
onDisconnectedCallback(): void;
|
|
244
|
-
removeBehaviors(behaviors: ReadonlyArray<Behavior<TElement>>, force?: boolean): void;
|
|
245
|
-
removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
246
|
-
get styles(): ElementStyles | null;
|
|
247
|
-
set styles(value: ElementStyles | null);
|
|
248
|
-
get template(): ElementViewTemplate<TElement> | null;
|
|
249
|
-
set template(value: ElementViewTemplate<TElement> | null);
|
|
250
|
-
readonly view: ElementView<TElement> | null;
|
|
182
|
+
export interface ContentTemplate {
|
|
183
|
+
create(): ContentView;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// @public
|
|
187
|
+
export interface ContentView {
|
|
188
|
+
bind(source: any, context?: ExecutionContext): void;
|
|
189
|
+
// (undocumented)
|
|
190
|
+
readonly context: ExecutionContext;
|
|
191
|
+
insertBefore(node: Node): void;
|
|
192
|
+
remove(): void;
|
|
193
|
+
unbind(): void;
|
|
251
194
|
}
|
|
252
195
|
|
|
196
|
+
// Warning: (ae-internal-missing-underscore) The name "createMetadataLocator" should be prefixed with an underscore because the declaration is marked as @internal
|
|
197
|
+
//
|
|
198
|
+
// @internal
|
|
199
|
+
export function createMetadataLocator<TMetadata>(): (target: {}) => TMetadata[];
|
|
200
|
+
|
|
253
201
|
// Warning: (ae-internal-missing-underscore) The name "createTypeRegistry" should be prefixed with an underscore because the declaration is marked as @internal
|
|
254
202
|
//
|
|
255
203
|
// @internal
|
|
@@ -292,15 +240,6 @@ export function customElement(nameOrDef: string | PartialFASTElementDefinition):
|
|
|
292
240
|
// @public
|
|
293
241
|
export type DecoratorAttributeConfiguration = Omit<AttributeConfiguration, "property">;
|
|
294
242
|
|
|
295
|
-
// @public
|
|
296
|
-
export type DefaultBindingOptions = AddEventListenerOptions;
|
|
297
|
-
|
|
298
|
-
// @public
|
|
299
|
-
export type DefaultTwoWayBindingOptions = DefaultBindingOptions & {
|
|
300
|
-
changeEvent?: string;
|
|
301
|
-
fromView?: (value: any) => any;
|
|
302
|
-
};
|
|
303
|
-
|
|
304
243
|
// @public
|
|
305
244
|
export interface Disposable {
|
|
306
245
|
dispose(): void;
|
|
@@ -315,20 +254,44 @@ export const DOM: Readonly<{
|
|
|
315
254
|
setBooleanAttribute(element: HTMLElement, attributeName: string, value: boolean): void;
|
|
316
255
|
}>;
|
|
317
256
|
|
|
257
|
+
// @public
|
|
258
|
+
export class ElementController<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier implements HostController<TElement> {
|
|
259
|
+
// @internal
|
|
260
|
+
constructor(element: TElement, definition: FASTElementDefinition);
|
|
261
|
+
addBehavior(behavior: HostBehavior<TElement>): void;
|
|
262
|
+
addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
263
|
+
connect(): void;
|
|
264
|
+
readonly definition: FASTElementDefinition;
|
|
265
|
+
disconnect(): void;
|
|
266
|
+
emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): void | boolean;
|
|
267
|
+
static forCustomElement(element: HTMLElement): ElementController;
|
|
268
|
+
get isConnected(): boolean;
|
|
269
|
+
get mainStyles(): ElementStyles | null;
|
|
270
|
+
set mainStyles(value: ElementStyles | null);
|
|
271
|
+
onAttributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
272
|
+
removeBehavior(behavior: HostBehavior<TElement>, force?: boolean): void;
|
|
273
|
+
removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
274
|
+
readonly source: TElement;
|
|
275
|
+
get template(): ElementViewTemplate<TElement> | null;
|
|
276
|
+
set template(value: ElementViewTemplate<TElement> | null);
|
|
277
|
+
readonly view: ElementView<TElement> | null;
|
|
278
|
+
}
|
|
279
|
+
|
|
318
280
|
// @public
|
|
319
281
|
export const elements: (selector?: string) => ElementsFilter;
|
|
320
282
|
|
|
321
283
|
// @public
|
|
322
|
-
export type ElementsFilter = (value: Node, index
|
|
284
|
+
export type ElementsFilter = (value: Node, index?: number, array?: Node[]) => boolean;
|
|
323
285
|
|
|
324
286
|
// @public
|
|
325
287
|
export class ElementStyles {
|
|
326
288
|
constructor(styles: ReadonlyArray<ComposableStyles>);
|
|
327
289
|
// @internal (undocumented)
|
|
328
290
|
addStylesTo(target: StyleTarget): void;
|
|
329
|
-
readonly behaviors: ReadonlyArray<
|
|
291
|
+
readonly behaviors: ReadonlyArray<HostBehavior<HTMLElement>> | null;
|
|
330
292
|
// @internal (undocumented)
|
|
331
293
|
isAttachedTo(target: StyleTarget): boolean;
|
|
294
|
+
static normalize(styles: ComposableStyles | ComposableStyles[] | undefined): ElementStyles | undefined;
|
|
332
295
|
// @internal (undocumented)
|
|
333
296
|
removeStylesFrom(target: StyleTarget): void;
|
|
334
297
|
static setDefaultStrategy(Strategy: ConstructibleStyleStrategy): void;
|
|
@@ -336,12 +299,12 @@ export class ElementStyles {
|
|
|
336
299
|
// (undocumented)
|
|
337
300
|
readonly styles: ReadonlyArray<ComposableStyles>;
|
|
338
301
|
static readonly supportsAdoptedStyleSheets: boolean;
|
|
339
|
-
withBehaviors(...behaviors:
|
|
302
|
+
withBehaviors(...behaviors: HostBehavior<HTMLElement>[]): this;
|
|
340
303
|
withStrategy(Strategy: ConstructibleStyleStrategy): this;
|
|
341
304
|
}
|
|
342
305
|
|
|
343
306
|
// @public
|
|
344
|
-
export interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent
|
|
307
|
+
export interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent> {
|
|
345
308
|
appendTo(node: Node): void;
|
|
346
309
|
}
|
|
347
310
|
|
|
@@ -349,34 +312,59 @@ export interface ElementView<TSource = any, TParent = any> extends View<TSource,
|
|
|
349
312
|
export interface ElementViewTemplate<TSource = any, TParent = any> {
|
|
350
313
|
create(hostBindingTarget: Element): ElementView<TSource, TParent>;
|
|
351
314
|
render(source: TSource, host: Node, hostBindingTarget?: Element): ElementView<TSource, TParent>;
|
|
352
|
-
// (undocumented)
|
|
353
|
-
type: "element";
|
|
354
315
|
}
|
|
355
316
|
|
|
356
317
|
// @public
|
|
357
318
|
export const emptyArray: readonly never[];
|
|
358
319
|
|
|
359
320
|
// @public
|
|
360
|
-
export
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
readonly
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
321
|
+
export interface ExecutionContext<TParent = any> {
|
|
322
|
+
readonly event: Event;
|
|
323
|
+
eventDetail<TDetail>(): TDetail;
|
|
324
|
+
eventTarget<TTarget extends EventTarget>(): TTarget;
|
|
325
|
+
index: number;
|
|
326
|
+
readonly isEven: boolean;
|
|
327
|
+
readonly isFirst: boolean;
|
|
328
|
+
readonly isInMiddle: boolean;
|
|
329
|
+
readonly isLast: boolean;
|
|
330
|
+
readonly isOdd: boolean;
|
|
331
|
+
length: number;
|
|
332
|
+
parent: TParent;
|
|
333
|
+
parentContext: ExecutionContext<TParent>;
|
|
369
334
|
}
|
|
370
335
|
|
|
371
336
|
// @public
|
|
372
337
|
export const ExecutionContext: Readonly<{
|
|
373
|
-
default:
|
|
338
|
+
default: ExecutionContext<any>;
|
|
339
|
+
getEvent(): Event | null;
|
|
374
340
|
setEvent(event: Event | null): void;
|
|
375
|
-
create(): RootContext;
|
|
376
341
|
}>;
|
|
377
342
|
|
|
378
343
|
// @public
|
|
379
|
-
export type
|
|
344
|
+
export type Expression<TSource = any, TReturn = any, TParent = any> = (source: TSource, context: ExecutionContext<TParent>) => TReturn;
|
|
345
|
+
|
|
346
|
+
// @public
|
|
347
|
+
export interface ExpressionController<TSource = any, TParent = any> {
|
|
348
|
+
readonly context: ExecutionContext<TParent>;
|
|
349
|
+
readonly isBound: boolean;
|
|
350
|
+
onUnbind(behavior: {
|
|
351
|
+
unbind(controller: ExpressionController<TSource, TParent>): any;
|
|
352
|
+
}): void;
|
|
353
|
+
readonly source: TSource;
|
|
354
|
+
readonly sourceLifetime?: SourceLifetime;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// @public
|
|
358
|
+
export interface ExpressionNotifier<TSource = any, TReturn = any, TParent = any> extends Notifier, ExpressionObserver<TSource, TReturn, TParent>, Disposable {
|
|
359
|
+
observe(source: TSource, context?: ExecutionContext): TReturn;
|
|
360
|
+
records(): IterableIterator<ObservationRecord>;
|
|
361
|
+
setMode(isAsync: boolean): void;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// @public
|
|
365
|
+
export interface ExpressionObserver<TSource = any, TReturn = any, TParent = any> {
|
|
366
|
+
bind(controller: ExpressionController<TSource, TParent>): TReturn;
|
|
367
|
+
}
|
|
380
368
|
|
|
381
369
|
// Warning: (ae-internal-missing-underscore) The name "FAST" should be prefixed with an underscore because the declaration is marked as @internal
|
|
382
370
|
//
|
|
@@ -386,34 +374,36 @@ export const FAST: FASTGlobal;
|
|
|
386
374
|
// @public
|
|
387
375
|
export interface FASTElement extends HTMLElement {
|
|
388
376
|
$emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): boolean | void;
|
|
389
|
-
readonly $fastController:
|
|
377
|
+
readonly $fastController: ElementController;
|
|
390
378
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
391
379
|
connectedCallback(): void;
|
|
392
380
|
disconnectedCallback(): void;
|
|
393
381
|
}
|
|
394
382
|
|
|
395
383
|
// @public
|
|
396
|
-
export const FASTElement:
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
define<TType extends Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): TType;
|
|
384
|
+
export const FASTElement: {
|
|
385
|
+
new (): FASTElement;
|
|
386
|
+
define: typeof define;
|
|
387
|
+
compose: typeof compose;
|
|
388
|
+
from: typeof from;
|
|
402
389
|
};
|
|
403
390
|
|
|
404
391
|
// @public
|
|
405
392
|
export class FASTElementDefinition<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> {
|
|
406
|
-
constructor(type: TType, nameOrConfig?: PartialFASTElementDefinition | string);
|
|
407
393
|
readonly attributeLookup: Record<string, AttributeDefinition>;
|
|
408
394
|
readonly attributes: ReadonlyArray<AttributeDefinition>;
|
|
395
|
+
static compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
|
|
409
396
|
define(registry?: CustomElementRegistry): this;
|
|
410
|
-
readonly elementOptions
|
|
397
|
+
readonly elementOptions: ElementDefinitionOptions;
|
|
411
398
|
static readonly getByType: (key: Function) => FASTElementDefinition<Constructable<HTMLElement>> | undefined;
|
|
412
399
|
static readonly getForInstance: (object: any) => FASTElementDefinition<Constructable<HTMLElement>> | undefined;
|
|
413
400
|
get isDefined(): boolean;
|
|
414
401
|
readonly name: string;
|
|
415
402
|
readonly propertyLookup: Record<string, AttributeDefinition>;
|
|
416
|
-
|
|
403
|
+
// @internal
|
|
404
|
+
static registerBaseType(type: Function): void;
|
|
405
|
+
readonly registry: CustomElementRegistry;
|
|
406
|
+
readonly shadowOptions?: ShadowRootOptions;
|
|
417
407
|
readonly styles?: ElementStyles;
|
|
418
408
|
readonly template?: ElementViewTemplate;
|
|
419
409
|
readonly type: TType;
|
|
@@ -424,33 +414,62 @@ export class FASTElementDefinition<TType extends Constructable<HTMLElement> = Co
|
|
|
424
414
|
// @internal
|
|
425
415
|
export interface FASTGlobal {
|
|
426
416
|
addMessages(messages: Record<number, string>): void;
|
|
427
|
-
error(code: number,
|
|
417
|
+
error(code: number, values?: Record<string, any>): Error;
|
|
428
418
|
getById<T>(id: string | number): T | null;
|
|
429
419
|
// (undocumented)
|
|
430
420
|
getById<T>(id: string | number, initialize: () => T): T;
|
|
431
421
|
readonly versions: string[];
|
|
432
|
-
warn(code: number,
|
|
422
|
+
warn(code: number, values?: Record<string, any>): void;
|
|
433
423
|
}
|
|
434
424
|
|
|
435
425
|
// @public
|
|
436
|
-
export
|
|
426
|
+
export interface HostBehavior<TSource = any> {
|
|
427
|
+
addedCallback?(controller: HostController<TSource>): void;
|
|
428
|
+
connectedCallback?(controller: HostController<TSource>): void;
|
|
429
|
+
disconnectedCallback?(controller: HostController<TSource>): void;
|
|
430
|
+
removedCallback?(controller: HostController<TSource>): void;
|
|
431
|
+
}
|
|
437
432
|
|
|
438
433
|
// @public
|
|
439
|
-
export
|
|
440
|
-
|
|
434
|
+
export interface HostController<TSource = any> {
|
|
435
|
+
addBehavior(behavior: HostBehavior<TSource>): void;
|
|
436
|
+
addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
437
|
+
readonly isConnected: boolean;
|
|
438
|
+
mainStyles: ElementStyles | null;
|
|
439
|
+
removeBehavior(behavior: HostBehavior<TSource>, force?: boolean): void;
|
|
440
|
+
removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
441
|
+
readonly source: TSource;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// @public
|
|
445
|
+
export function html<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]): ViewTemplate<TSource, TParent>;
|
|
446
|
+
|
|
447
|
+
// @public
|
|
448
|
+
export class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, ViewBehavior, Aspected {
|
|
449
|
+
constructor(dataBinding: Binding);
|
|
441
450
|
aspectType: Aspect;
|
|
442
|
-
// (undocumented)
|
|
443
|
-
|
|
444
|
-
|
|
451
|
+
// @internal (undocumented)
|
|
452
|
+
bind: (controller: ViewController) => void;
|
|
453
|
+
// @internal (undocumented)
|
|
454
|
+
bindContent(controller: ViewController): void;
|
|
455
|
+
// @internal (undocumented)
|
|
456
|
+
bindDefault(controller: ViewController): void;
|
|
457
|
+
// @internal (undocumented)
|
|
458
|
+
bindEvent(controller: ViewController): void;
|
|
459
|
+
createBehavior(): ViewBehavior;
|
|
445
460
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
446
|
-
id: string;
|
|
447
461
|
// (undocumented)
|
|
448
|
-
|
|
462
|
+
dataBinding: Binding;
|
|
463
|
+
// @internal (undocumented)
|
|
464
|
+
handleChange(binding: Expression, observer: ExpressionObserver): void;
|
|
465
|
+
// @internal (undocumented)
|
|
466
|
+
handleEvent(event: Event): void;
|
|
467
|
+
id: string;
|
|
449
468
|
nodeId: string;
|
|
450
|
-
// (undocumented)
|
|
451
|
-
options: any;
|
|
452
469
|
sourceAspect: string;
|
|
453
470
|
targetAspect: string;
|
|
471
|
+
// @internal (undocumented)
|
|
472
|
+
unbind(controller: ViewController): void;
|
|
454
473
|
}
|
|
455
474
|
|
|
456
475
|
// @public
|
|
@@ -474,56 +493,56 @@ export interface HTMLDirectiveDefinition<TType extends Constructable<HTMLDirecti
|
|
|
474
493
|
}
|
|
475
494
|
|
|
476
495
|
// @public
|
|
477
|
-
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any
|
|
478
|
-
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent
|
|
496
|
+
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any> {
|
|
497
|
+
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
479
498
|
}
|
|
480
499
|
|
|
481
500
|
// @public
|
|
482
|
-
export class HTMLView<TSource = any, TParent = any
|
|
501
|
+
export class HTMLView<TSource = any, TParent = any> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent>, ExecutionContext<TParent> {
|
|
483
502
|
constructor(fragment: DocumentFragment, factories: ReadonlyArray<ViewBehaviorFactory>, targets: ViewBehaviorTargets);
|
|
484
503
|
appendTo(node: Node): void;
|
|
485
|
-
bind(source: TSource, context
|
|
486
|
-
context:
|
|
504
|
+
bind(source: TSource, context?: ExecutionContext<TParent>): void;
|
|
505
|
+
context: ExecutionContext<TParent>;
|
|
487
506
|
dispose(): void;
|
|
488
507
|
static disposeContiguousBatch(views: SyntheticView[]): void;
|
|
508
|
+
get event(): Event;
|
|
509
|
+
eventDetail<TDetail>(): TDetail;
|
|
510
|
+
eventTarget<TTarget extends EventTarget>(): TTarget;
|
|
489
511
|
firstChild: Node;
|
|
512
|
+
index: number;
|
|
490
513
|
insertBefore(node: Node): void;
|
|
514
|
+
isBound: boolean;
|
|
515
|
+
get isEven(): boolean;
|
|
516
|
+
get isFirst(): boolean;
|
|
517
|
+
get isInMiddle(): boolean;
|
|
518
|
+
get isLast(): boolean;
|
|
519
|
+
get isOdd(): boolean;
|
|
491
520
|
lastChild: Node;
|
|
521
|
+
length: number;
|
|
522
|
+
// (undocumented)
|
|
523
|
+
onUnbind(behavior: {
|
|
524
|
+
unbind(controller: ViewController<TSource, TParent>): any;
|
|
525
|
+
}): void;
|
|
526
|
+
readonly parent: TParent;
|
|
527
|
+
readonly parentContext: ExecutionContext<TParent>;
|
|
492
528
|
remove(): void;
|
|
493
529
|
source: TSource | null;
|
|
530
|
+
readonly sourceLifetime: SourceLifetime;
|
|
531
|
+
// (undocumented)
|
|
532
|
+
readonly targets: ViewBehaviorTargets;
|
|
494
533
|
unbind(): void;
|
|
495
534
|
}
|
|
496
535
|
|
|
497
536
|
// @public
|
|
498
|
-
export
|
|
499
|
-
|
|
500
|
-
// @public
|
|
501
|
-
export interface ItemContext<TParentSource = any> extends ChildContext<TParentSource> {
|
|
502
|
-
readonly index: number;
|
|
503
|
-
readonly isEven: boolean;
|
|
504
|
-
readonly isFirst: boolean;
|
|
505
|
-
readonly isInMiddle: boolean;
|
|
506
|
-
readonly isLast: boolean;
|
|
507
|
-
readonly isOdd: boolean;
|
|
508
|
-
readonly length: number;
|
|
509
|
-
updatePosition(index: number, length: number): void;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
// @public
|
|
513
|
-
export interface ItemViewTemplate<TSource = any, TParent = any> {
|
|
514
|
-
create(): SyntheticView<TSource, TParent, ItemContext<TParent>>;
|
|
515
|
-
// (undocumented)
|
|
516
|
-
type: "item";
|
|
537
|
+
export interface LengthObserver extends Subscriber {
|
|
538
|
+
length: number;
|
|
517
539
|
}
|
|
518
540
|
|
|
519
541
|
// @public
|
|
520
|
-
function
|
|
521
|
-
export { length_2 as length }
|
|
542
|
+
export function lengthOf<T>(array: readonly T[]): number;
|
|
522
543
|
|
|
523
544
|
// @public
|
|
524
|
-
export
|
|
525
|
-
length: number;
|
|
526
|
-
}
|
|
545
|
+
export function listener<T = any>(binding: Expression<T>, options?: AddEventListenerOptions): Binding<T>;
|
|
527
546
|
|
|
528
547
|
// @public
|
|
529
548
|
export const Markup: Readonly<{
|
|
@@ -547,16 +566,19 @@ export interface NodeBehaviorOptions<T = any> {
|
|
|
547
566
|
|
|
548
567
|
// @public
|
|
549
568
|
export abstract class NodeObservationDirective<T extends NodeBehaviorOptions> extends StatelessAttachedAttributeDirective<T> {
|
|
550
|
-
bind(
|
|
569
|
+
bind(controller: ViewController): void;
|
|
551
570
|
protected computeNodes(target: any): Node[];
|
|
552
571
|
protected abstract disconnect(target: any): void;
|
|
553
572
|
protected abstract getNodes(target: any): Node[];
|
|
554
573
|
protected getSource(target: Node): any;
|
|
555
574
|
protected abstract observe(target: any): void;
|
|
556
|
-
unbind(
|
|
575
|
+
unbind(controller: ViewController): void;
|
|
557
576
|
protected updateTarget(source: any, value: ReadonlyArray<any>): void;
|
|
558
577
|
}
|
|
559
578
|
|
|
579
|
+
// @public
|
|
580
|
+
export function normalizeBinding<TSource = any, TReturn = any, TParent = any>(value: Expression<TSource, TReturn, TParent> | Binding<TSource, TReturn, TParent> | {}): Binding<TSource, TReturn, TParent>;
|
|
581
|
+
|
|
560
582
|
// @public
|
|
561
583
|
export interface Notifier {
|
|
562
584
|
notify(args: any): void;
|
|
@@ -577,8 +599,8 @@ export const Observable: Readonly<{
|
|
|
577
599
|
notify(source: unknown, args: any): void;
|
|
578
600
|
defineProperty(target: {}, nameOrAccessor: string | Accessor): void;
|
|
579
601
|
getAccessors: (target: {}) => Accessor[];
|
|
580
|
-
binding<TSource = any, TReturn = any>(
|
|
581
|
-
isVolatileBinding<TSource_1 = any, TReturn_1 = any>(
|
|
602
|
+
binding<TSource = any, TReturn = any>(expression: Expression<TSource, TReturn, any>, initialSubscriber?: Subscriber, isVolatileBinding?: boolean): ExpressionNotifier<TSource, TReturn, any>;
|
|
603
|
+
isVolatileBinding<TSource_1 = any, TReturn_1 = any>(expression: Expression<TSource_1, TReturn_1, any>): boolean;
|
|
582
604
|
}>;
|
|
583
605
|
|
|
584
606
|
// @public
|
|
@@ -591,15 +613,7 @@ export interface ObservationRecord {
|
|
|
591
613
|
}
|
|
592
614
|
|
|
593
615
|
// @public
|
|
594
|
-
export
|
|
595
|
-
|
|
596
|
-
// @public
|
|
597
|
-
export const oneTime: BindingConfig<AddEventListenerOptions> & BindingConfigResolver<AddEventListenerOptions>;
|
|
598
|
-
|
|
599
|
-
// @public
|
|
600
|
-
export class OneTimeBinding extends UpdateBinding {
|
|
601
|
-
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
602
|
-
}
|
|
616
|
+
export function oneTime<T = any>(binding: Expression<T>): Binding<T>;
|
|
603
617
|
|
|
604
618
|
// @public
|
|
605
619
|
export const Parser: Readonly<{
|
|
@@ -611,7 +625,8 @@ export interface PartialFASTElementDefinition {
|
|
|
611
625
|
readonly attributes?: (AttributeConfiguration | string)[];
|
|
612
626
|
readonly elementOptions?: ElementDefinitionOptions;
|
|
613
627
|
readonly name: string;
|
|
614
|
-
readonly
|
|
628
|
+
readonly registry?: CustomElementRegistry;
|
|
629
|
+
readonly shadowOptions?: Partial<ShadowRootOptions> | null;
|
|
615
630
|
readonly styles?: ComposableStyles | ComposableStyles[];
|
|
616
631
|
readonly template?: ElementViewTemplate;
|
|
617
632
|
}
|
|
@@ -631,67 +646,32 @@ export class PropertyChangeNotifier implements Notifier {
|
|
|
631
646
|
}
|
|
632
647
|
|
|
633
648
|
// @public
|
|
634
|
-
export const ref: <
|
|
649
|
+
export const ref: <TSource = any, TParent = any>(propertyName: keyof TSource & string) => CaptureType<TSource, TParent>;
|
|
635
650
|
|
|
636
651
|
// @public
|
|
637
652
|
export class RefDirective extends StatelessAttachedAttributeDirective<string> {
|
|
638
|
-
bind(
|
|
639
|
-
unbind(): void;
|
|
653
|
+
bind(controller: ViewController): void;
|
|
640
654
|
}
|
|
641
655
|
|
|
642
656
|
// @public
|
|
643
|
-
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
} | {
|
|
651
|
-
positioning: false;
|
|
652
|
-
recycle: true;
|
|
653
|
-
}): CaptureType<TSource>;
|
|
654
|
-
|
|
655
|
-
// @public
|
|
656
|
-
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ChildViewTemplate | Binding<TSource, ChildViewTemplate, ChildContext>, options?: {
|
|
657
|
-
positioning: false;
|
|
658
|
-
} | {
|
|
659
|
-
recycle: true;
|
|
660
|
-
} | {
|
|
661
|
-
positioning: false;
|
|
662
|
-
recycle: false;
|
|
663
|
-
} | {
|
|
664
|
-
positioning: false;
|
|
665
|
-
recycle: true;
|
|
666
|
-
}): CaptureType<TSource>;
|
|
667
|
-
|
|
668
|
-
// @public
|
|
669
|
-
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(itemsBinding: Binding<TSource, TArray, ExecutionContext<TSource>>, templateOrTemplateBinding: ItemViewTemplate | Binding<TSource, ItemViewTemplate, ItemContext>, options: {
|
|
670
|
-
positioning: true;
|
|
671
|
-
} | {
|
|
672
|
-
positioning: true;
|
|
673
|
-
recycle: true;
|
|
674
|
-
} | {
|
|
675
|
-
positioning: true;
|
|
676
|
-
recycle: false;
|
|
677
|
-
}): CaptureType<TSource>;
|
|
678
|
-
|
|
679
|
-
// @public
|
|
680
|
-
export class RepeatBehavior<TSource = any> implements Behavior, Subscriber {
|
|
681
|
-
constructor(location: Node, itemsBinding: Binding<TSource, any[]>, isItemsBindingVolatile: boolean, templateBinding: Binding<TSource, SyntheticViewTemplate>, isTemplateBindingVolatile: boolean, options: RepeatOptions);
|
|
682
|
-
bind(source: TSource, context: ExecutionContext): void;
|
|
683
|
-
handleChange(source: any, args: Splice[]): void;
|
|
657
|
+
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>, TParent = any>(items: Expression<TSource, TArray, TParent> | Binding<TSource, TArray, TParent> | ReadonlyArray<any>, template: Expression<TSource, ViewTemplate<any, TSource>> | Binding<TSource, ViewTemplate<any, TSource>> | ViewTemplate<any, TSource>, options?: RepeatOptions): CaptureType<TSource, TParent>;
|
|
658
|
+
|
|
659
|
+
// @public
|
|
660
|
+
export class RepeatBehavior<TSource = any> implements ViewBehavior, Subscriber {
|
|
661
|
+
constructor(directive: RepeatDirective);
|
|
662
|
+
bind(controller: ViewController): void;
|
|
663
|
+
handleChange(source: any, args: Splice[] | ExpressionObserver): void;
|
|
684
664
|
unbind(): void;
|
|
685
665
|
}
|
|
686
666
|
|
|
687
667
|
// @public
|
|
688
668
|
export class RepeatDirective<TSource = any> implements HTMLDirective, ViewBehaviorFactory {
|
|
689
|
-
constructor(
|
|
690
|
-
createBehavior(
|
|
669
|
+
constructor(dataBinding: Binding<TSource>, templateBinding: Binding<TSource, SyntheticViewTemplate>, options: RepeatOptions);
|
|
670
|
+
createBehavior(): RepeatBehavior<TSource>;
|
|
691
671
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
692
|
-
id: string;
|
|
693
672
|
// (undocumented)
|
|
694
|
-
readonly
|
|
673
|
+
readonly dataBinding: Binding<TSource>;
|
|
674
|
+
id: string;
|
|
695
675
|
nodeId: string;
|
|
696
676
|
// (undocumented)
|
|
697
677
|
readonly options: RepeatOptions;
|
|
@@ -706,25 +686,13 @@ export interface RepeatOptions {
|
|
|
706
686
|
}
|
|
707
687
|
|
|
708
688
|
// @public
|
|
709
|
-
export interface
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
eventDetail<TDetail = any>(): TDetail;
|
|
713
|
-
eventTarget<TTarget extends EventTarget = EventTarget>(): TTarget;
|
|
689
|
+
export interface ShadowRootOptions extends ShadowRootInit {
|
|
690
|
+
// @beta
|
|
691
|
+
registry?: CustomElementRegistry;
|
|
714
692
|
}
|
|
715
693
|
|
|
716
694
|
// @public
|
|
717
|
-
export
|
|
718
|
-
|
|
719
|
-
// @public
|
|
720
|
-
export class SignalBinding extends UpdateBinding {
|
|
721
|
-
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
722
|
-
static send(signal: string): void;
|
|
723
|
-
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
// @public
|
|
727
|
-
export function slotted<T = any>(propertyOrOptions: (keyof T & string) | SlottedDirectiveOptions<keyof T & string>): CaptureType<T>;
|
|
695
|
+
export function slotted<TSource = any, TParent = any>(propertyOrOptions: (keyof TSource & string) | SlottedDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
|
|
728
696
|
|
|
729
697
|
// @public
|
|
730
698
|
export class SlottedDirective extends NodeObservationDirective<SlottedDirectiveOptions> {
|
|
@@ -739,6 +707,15 @@ export class SlottedDirective extends NodeObservationDirective<SlottedDirectiveO
|
|
|
739
707
|
export interface SlottedDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, AssignedNodesOptions {
|
|
740
708
|
}
|
|
741
709
|
|
|
710
|
+
// @public
|
|
711
|
+
export const SourceLifetime: Readonly<{
|
|
712
|
+
readonly unknown: undefined;
|
|
713
|
+
readonly coupled: 1;
|
|
714
|
+
}>;
|
|
715
|
+
|
|
716
|
+
// @public
|
|
717
|
+
export type SourceLifetime = typeof SourceLifetime[keyof typeof SourceLifetime];
|
|
718
|
+
|
|
742
719
|
// @public
|
|
743
720
|
export class Splice {
|
|
744
721
|
constructor(index: number, removed: any[], addedCount: number);
|
|
@@ -782,16 +759,15 @@ export const SpliceStrategySupport: Readonly<{
|
|
|
782
759
|
export type SpliceStrategySupport = typeof SpliceStrategySupport[keyof typeof SpliceStrategySupport];
|
|
783
760
|
|
|
784
761
|
// @public
|
|
785
|
-
export abstract class StatelessAttachedAttributeDirective<
|
|
786
|
-
constructor(options:
|
|
787
|
-
abstract bind(
|
|
788
|
-
createBehavior(
|
|
762
|
+
export abstract class StatelessAttachedAttributeDirective<TOptions> implements HTMLDirective, ViewBehaviorFactory, ViewBehavior {
|
|
763
|
+
constructor(options: TOptions);
|
|
764
|
+
abstract bind(controller: ViewController): void;
|
|
765
|
+
createBehavior(): ViewBehavior;
|
|
789
766
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
790
767
|
id: string;
|
|
791
768
|
nodeId: string;
|
|
792
769
|
// (undocumented)
|
|
793
|
-
protected options:
|
|
794
|
-
abstract unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
770
|
+
protected options: TOptions;
|
|
795
771
|
}
|
|
796
772
|
|
|
797
773
|
// @public
|
|
@@ -830,7 +806,7 @@ export interface SubtreeDirectiveOptions<T = any> extends NodeBehaviorOptions<T>
|
|
|
830
806
|
}
|
|
831
807
|
|
|
832
808
|
// @public
|
|
833
|
-
export interface SyntheticView<TSource = any, TParent = any
|
|
809
|
+
export interface SyntheticView<TSource = any, TParent = any> extends View<TSource, TParent> {
|
|
834
810
|
readonly firstChild: Node;
|
|
835
811
|
insertBefore(node: Node): void;
|
|
836
812
|
readonly lastChild: Node;
|
|
@@ -838,14 +814,12 @@ export interface SyntheticView<TSource = any, TParent = any, TContext extends Ex
|
|
|
838
814
|
}
|
|
839
815
|
|
|
840
816
|
// @public
|
|
841
|
-
export interface SyntheticViewTemplate<TSource = any, TParent = any
|
|
842
|
-
create(): SyntheticView<TSource, TParent
|
|
843
|
-
// (undocumented)
|
|
844
|
-
type: "synthetic";
|
|
817
|
+
export interface SyntheticViewTemplate<TSource = any, TParent = any> {
|
|
818
|
+
create(): SyntheticView<TSource, TParent>;
|
|
845
819
|
}
|
|
846
820
|
|
|
847
821
|
// @public
|
|
848
|
-
export type TemplateValue<TSource, TParent = any
|
|
822
|
+
export type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource, TParent>;
|
|
849
823
|
|
|
850
824
|
// @public
|
|
851
825
|
export type TrustedTypes = {
|
|
@@ -857,23 +831,6 @@ export type TrustedTypesPolicy = {
|
|
|
857
831
|
createHTML(html: string): string;
|
|
858
832
|
};
|
|
859
833
|
|
|
860
|
-
// @public
|
|
861
|
-
export const twoWay: BindingConfig<DefaultTwoWayBindingOptions> & BindingConfigResolver<DefaultTwoWayBindingOptions>;
|
|
862
|
-
|
|
863
|
-
// @public
|
|
864
|
-
export class TwoWayBinding extends ChangeBinding {
|
|
865
|
-
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
866
|
-
static configure(settings: TwoWaySettings): void;
|
|
867
|
-
// @internal (undocumented)
|
|
868
|
-
handleEvent(event: Event): void;
|
|
869
|
-
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
// @public
|
|
873
|
-
export interface TwoWaySettings {
|
|
874
|
-
determineChangeEvent(directive: HTMLBindingDirective, target: HTMLElement): string;
|
|
875
|
-
}
|
|
876
|
-
|
|
877
834
|
// Warning: (ae-internal-missing-underscore) The name "TypeDefinition" should be prefixed with an underscore because the declaration is marked as @internal
|
|
878
835
|
//
|
|
879
836
|
// @internal
|
|
@@ -894,18 +851,6 @@ export interface TypeRegistry<TDefinition extends TypeDefinition> {
|
|
|
894
851
|
register(definition: TDefinition): boolean;
|
|
895
852
|
}
|
|
896
853
|
|
|
897
|
-
// @public
|
|
898
|
-
export class UpdateBinding implements ViewBehavior {
|
|
899
|
-
constructor(directive: HTMLBindingDirective, updateTarget: UpdateTarget);
|
|
900
|
-
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
901
|
-
createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
|
|
902
|
-
// (undocumented)
|
|
903
|
-
readonly directive: HTMLBindingDirective;
|
|
904
|
-
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
905
|
-
// (undocumented)
|
|
906
|
-
protected updateTarget: UpdateTarget;
|
|
907
|
-
}
|
|
908
|
-
|
|
909
854
|
// @public
|
|
910
855
|
export interface UpdateQueue {
|
|
911
856
|
enqueue(callable: Callable): void;
|
|
@@ -917,14 +862,6 @@ export interface UpdateQueue {
|
|
|
917
862
|
// @public
|
|
918
863
|
export const Updates: UpdateQueue;
|
|
919
864
|
|
|
920
|
-
// @public
|
|
921
|
-
export type UpdateTarget = (this: UpdateTargetThis, target: Node, aspect: string, value: any, source: any, context: ExecutionContext) => void;
|
|
922
|
-
|
|
923
|
-
// @public
|
|
924
|
-
export interface UpdateTargetThis {
|
|
925
|
-
directive: HTMLBindingDirective;
|
|
926
|
-
}
|
|
927
|
-
|
|
928
865
|
// @public
|
|
929
866
|
export interface ValueConverter {
|
|
930
867
|
fromView(value: any): any;
|
|
@@ -932,46 +869,68 @@ export interface ValueConverter {
|
|
|
932
869
|
}
|
|
933
870
|
|
|
934
871
|
// @public
|
|
935
|
-
export interface View<TSource = any, TParent = any
|
|
936
|
-
bind(source: TSource, context
|
|
937
|
-
readonly context:
|
|
872
|
+
export interface View<TSource = any, TParent = any> extends Disposable {
|
|
873
|
+
bind(source: TSource, context?: ExecutionContext<TParent>): void;
|
|
874
|
+
readonly context: ExecutionContext<TParent>;
|
|
938
875
|
readonly source: TSource | null;
|
|
939
876
|
unbind(): void;
|
|
940
877
|
}
|
|
941
878
|
|
|
942
879
|
// @public
|
|
943
880
|
export interface ViewBehavior<TSource = any, TParent = any> {
|
|
944
|
-
bind(
|
|
945
|
-
unbind(source: TSource, context: ExecutionContext<TParent>, targets: ViewBehaviorTargets): void;
|
|
881
|
+
bind(controller: ViewController<TSource, TParent>): void;
|
|
946
882
|
}
|
|
947
883
|
|
|
948
884
|
// @public
|
|
949
885
|
export interface ViewBehaviorFactory {
|
|
950
|
-
createBehavior(
|
|
886
|
+
createBehavior(): ViewBehavior;
|
|
951
887
|
id: string;
|
|
952
888
|
nodeId: string;
|
|
953
889
|
}
|
|
954
890
|
|
|
891
|
+
// @public
|
|
892
|
+
export interface ViewBehaviorOrchestrator<TSource = any, TParent = any> extends ViewController<TSource, TParent>, HostBehavior<TSource> {
|
|
893
|
+
addBehavior(behavior: ViewBehavior): void;
|
|
894
|
+
addBehaviorFactory(factory: ViewBehaviorFactory, target: Node): void;
|
|
895
|
+
// (undocumented)
|
|
896
|
+
addTarget(nodeId: string, target: Node): void;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
// @public
|
|
900
|
+
export const ViewBehaviorOrchestrator: Readonly<{
|
|
901
|
+
create<TSource = any, TParent = any>(source: TSource): ViewBehaviorOrchestrator<TSource, TParent>;
|
|
902
|
+
}>;
|
|
903
|
+
|
|
955
904
|
// @public
|
|
956
905
|
export type ViewBehaviorTargets = {
|
|
957
906
|
[id: string]: Node;
|
|
958
907
|
};
|
|
959
908
|
|
|
960
909
|
// @public
|
|
961
|
-
export
|
|
910
|
+
export interface ViewController<TSource = any, TParent = any> extends ExpressionController<TSource, TParent> {
|
|
911
|
+
readonly targets: ViewBehaviorTargets;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
// @public
|
|
915
|
+
export class ViewTemplate<TSource = any, TParent = any> implements ElementViewTemplate<TSource, TParent>, SyntheticViewTemplate<TSource, TParent> {
|
|
962
916
|
constructor(html: string | HTMLTemplateElement, factories: Record<string, ViewBehaviorFactory>);
|
|
963
|
-
create(hostBindingTarget?: Element): HTMLView<TSource, TParent
|
|
917
|
+
create(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
964
918
|
readonly factories: Record<string, ViewBehaviorFactory>;
|
|
965
919
|
readonly html: string | HTMLTemplateElement;
|
|
966
|
-
render(source: TSource, host: Node, hostBindingTarget?: Element
|
|
967
|
-
type: any;
|
|
920
|
+
render(source: TSource, host: Node, hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
968
921
|
}
|
|
969
922
|
|
|
970
923
|
// @public
|
|
971
924
|
export function volatile(target: {}, name: string | Accessor, descriptor: PropertyDescriptor): PropertyDescriptor;
|
|
972
925
|
|
|
973
926
|
// @public
|
|
974
|
-
export function when<TSource = any, TReturn = any>(
|
|
927
|
+
export function when<TSource = any, TReturn = any, TParent = any>(condition: Expression<TSource, TReturn, TParent> | boolean, templateOrTemplateBinding: SyntheticViewTemplate<TSource, TParent> | Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>): CaptureType<TSource, TParent>;
|
|
928
|
+
|
|
929
|
+
// Warnings were encountered during analysis:
|
|
930
|
+
//
|
|
931
|
+
// dist/dts/components/fast-element.d.ts:60:5 - (ae-forgotten-export) The symbol "define" needs to be exported by the entry point index.d.ts
|
|
932
|
+
// dist/dts/components/fast-element.d.ts:61:5 - (ae-forgotten-export) The symbol "compose" needs to be exported by the entry point index.d.ts
|
|
933
|
+
// dist/dts/components/fast-element.d.ts:62:5 - (ae-forgotten-export) The symbol "from" needs to be exported by the entry point index.d.ts
|
|
975
934
|
|
|
976
935
|
// (No @packageDocumentation comment for this package)
|
|
977
936
|
|