@microsoft/fast-element 2.0.0-beta.1 → 2.0.0-beta.4
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 +147 -0
- package/CHANGELOG.md +42 -1
- package/dist/dts/components/fast-definitions.d.ts +11 -8
- package/dist/dts/components/fast-element.d.ts +13 -3
- package/dist/dts/context.d.ts +157 -0
- package/dist/dts/di/di.d.ts +854 -0
- package/dist/dts/hooks.d.ts +2 -2
- package/dist/dts/interfaces.d.ts +39 -7
- package/dist/dts/metadata.d.ts +25 -0
- package/dist/dts/observation/arrays.d.ts +1 -1
- package/dist/dts/observation/behavior.d.ts +4 -4
- package/dist/dts/observation/observable.d.ts +59 -72
- package/dist/dts/styles/element-styles.d.ts +6 -0
- package/dist/dts/templating/binding-signal.d.ts +21 -0
- package/dist/dts/templating/binding-two-way.d.ts +31 -0
- package/dist/dts/templating/binding.d.ts +74 -201
- package/dist/dts/templating/compiler.d.ts +1 -2
- package/dist/dts/templating/html-directive.d.ts +31 -3
- package/dist/dts/templating/render.d.ts +277 -0
- package/dist/dts/templating/repeat.d.ts +13 -63
- package/dist/dts/templating/template.d.ts +11 -60
- package/dist/dts/templating/view.d.ts +9 -9
- package/dist/dts/templating/when.d.ts +3 -3
- package/dist/dts/testing/exports.d.ts +2 -0
- package/dist/dts/testing/fixture.d.ts +90 -0
- package/dist/dts/testing/timeout.d.ts +7 -0
- package/dist/{tsdoc-metadata.json → dts/tsdoc-metadata.json} +0 -0
- package/dist/esm/components/fast-definitions.js +27 -27
- package/dist/esm/components/fast-element.js +20 -4
- package/dist/esm/context.js +163 -0
- package/dist/esm/debug.js +35 -4
- package/dist/esm/di/di.js +1349 -0
- package/dist/esm/metadata.js +60 -0
- package/dist/esm/observation/arrays.js +1 -1
- package/dist/esm/observation/observable.js +73 -21
- package/dist/esm/platform.js +1 -1
- package/dist/esm/styles/element-styles.js +14 -0
- package/dist/esm/templating/binding-signal.js +79 -0
- package/dist/esm/templating/binding-two-way.js +98 -0
- package/dist/esm/templating/binding.js +137 -313
- package/dist/esm/templating/compiler.js +30 -7
- package/dist/esm/templating/html-directive.js +16 -2
- package/dist/esm/templating/render.js +392 -0
- package/dist/esm/templating/repeat.js +60 -38
- package/dist/esm/templating/template.js +9 -26
- package/dist/esm/templating/when.js +5 -4
- package/dist/esm/testing/exports.js +2 -0
- package/dist/esm/testing/fixture.js +88 -0
- package/dist/esm/testing/timeout.js +24 -0
- package/dist/fast-element.api.json +8509 -10358
- package/dist/fast-element.d.ts +315 -522
- package/dist/fast-element.debug.js +417 -438
- package/dist/fast-element.debug.min.js +1 -1
- package/dist/fast-element.js +382 -434
- package/dist/fast-element.min.js +1 -1
- package/dist/fast-element.untrimmed.d.ts +324 -529
- package/docs/api-report.md +124 -232
- package/package.json +32 -4
package/docs/api-report.md
CHANGED
|
@@ -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
|
}
|
|
@@ -104,44 +104,35 @@ export class AttributeDefinition implements Accessor {
|
|
|
104
104
|
export type AttributeMode = typeof reflectMode | typeof booleanMode | "fromView";
|
|
105
105
|
|
|
106
106
|
// @public
|
|
107
|
-
export interface Behavior<TSource = any, TParent = any
|
|
108
|
-
bind(source: TSource, context:
|
|
109
|
-
unbind(source: TSource, context:
|
|
107
|
+
export interface Behavior<TSource = any, TParent = any> {
|
|
108
|
+
bind(source: TSource, context: ExecutionContext<TParent>): void;
|
|
109
|
+
unbind(source: TSource, context: ExecutionContext<TParent>): void;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
// @public
|
|
113
|
-
export function bind<T = any>(binding:
|
|
113
|
+
export function bind<T = any>(binding: Expression<T>, isVolatile?: boolean): Binding<T>;
|
|
114
114
|
|
|
115
115
|
// @public
|
|
116
|
-
export
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
options: T;
|
|
116
|
+
export abstract class Binding<TSource = any, TReturn = any, TParent = any> {
|
|
117
|
+
abstract createObserver(directive: HTMLDirective, subscriber: Subscriber): ExpressionObserver<TSource, TReturn, TParent>;
|
|
118
|
+
evaluate: Expression<TSource, TReturn, TParent>;
|
|
119
|
+
isVolatile?: boolean;
|
|
120
|
+
options?: any;
|
|
122
121
|
}
|
|
123
122
|
|
|
124
123
|
// @public
|
|
125
|
-
export
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
//
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
// @
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
//
|
|
136
|
-
|
|
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;
|
|
124
|
+
export class BindingBehavior implements ViewBehavior {
|
|
125
|
+
constructor(directive: HTMLBindingDirective, updateTarget: UpdateTarget);
|
|
126
|
+
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
127
|
+
createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
|
|
128
|
+
// (undocumented)
|
|
129
|
+
readonly directive: HTMLBindingDirective;
|
|
130
|
+
protected getObserver(target: Node): ExpressionObserver;
|
|
131
|
+
// @internal (undocumented)
|
|
132
|
+
handleChange(binding: Expression, observer: ExpressionObserver): void;
|
|
133
|
+
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
134
|
+
// (undocumented)
|
|
135
|
+
protected updateTarget: UpdateTarget;
|
|
145
136
|
}
|
|
146
137
|
|
|
147
138
|
// @public
|
|
@@ -156,26 +147,6 @@ export type Callable = typeof Function.prototype.call | {
|
|
|
156
147
|
export interface CaptureType<TSource> {
|
|
157
148
|
}
|
|
158
149
|
|
|
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>;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
150
|
// @public
|
|
180
151
|
export interface ChildListDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, Omit<MutationObserverInit, "subtree" | "childList"> {
|
|
181
152
|
}
|
|
@@ -194,13 +165,6 @@ export class ChildrenDirective extends NodeObservationDirective<ChildrenDirectiv
|
|
|
194
165
|
// @public
|
|
195
166
|
export type ChildrenDirectiveOptions<T = any> = ChildListDirectiveOptions<T> | SubtreeDirectiveOptions<T>;
|
|
196
167
|
|
|
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
168
|
// @public
|
|
205
169
|
export type CompilationStrategy = (
|
|
206
170
|
html: string | HTMLTemplateElement,
|
|
@@ -209,7 +173,7 @@ factories: Record<string, ViewBehaviorFactory>) => HTMLTemplateCompilationResult
|
|
|
209
173
|
// @public
|
|
210
174
|
export const Compiler: {
|
|
211
175
|
setHTMLPolicy(policy: TrustedTypesPolicy): void;
|
|
212
|
-
compile<TSource = any, TParent = any
|
|
176
|
+
compile<TSource = any, TParent = any>(html: string | HTMLTemplateElement, directives: Record<string, ViewBehaviorFactory>): HTMLTemplateCompilationResult<TSource, TParent>;
|
|
213
177
|
setDefaultStrategy(strategy: CompilationStrategy): void;
|
|
214
178
|
aggregate(parts: (string | ViewBehaviorFactory)[]): ViewBehaviorFactory;
|
|
215
179
|
};
|
|
@@ -227,6 +191,24 @@ export type ConstructibleStyleStrategy = {
|
|
|
227
191
|
new (styles: (string | CSSStyleSheet)[]): StyleStrategy;
|
|
228
192
|
};
|
|
229
193
|
|
|
194
|
+
// @public
|
|
195
|
+
export class ContentBehavior extends BindingBehavior {
|
|
196
|
+
unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// @public
|
|
200
|
+
export interface ContentTemplate {
|
|
201
|
+
create(): ContentView;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// @public
|
|
205
|
+
export interface ContentView {
|
|
206
|
+
bind(source: any, context: ExecutionContext): void;
|
|
207
|
+
insertBefore(node: Node): void;
|
|
208
|
+
remove(): void;
|
|
209
|
+
unbind(): void;
|
|
210
|
+
}
|
|
211
|
+
|
|
230
212
|
// @public
|
|
231
213
|
export class Controller<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier {
|
|
232
214
|
// @internal
|
|
@@ -292,15 +274,6 @@ export function customElement(nameOrDef: string | PartialFASTElementDefinition):
|
|
|
292
274
|
// @public
|
|
293
275
|
export type DecoratorAttributeConfiguration = Omit<AttributeConfiguration, "property">;
|
|
294
276
|
|
|
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
277
|
// @public
|
|
305
278
|
export interface Disposable {
|
|
306
279
|
dispose(): void;
|
|
@@ -329,6 +302,7 @@ export class ElementStyles {
|
|
|
329
302
|
readonly behaviors: ReadonlyArray<Behavior<HTMLElement>> | null;
|
|
330
303
|
// @internal (undocumented)
|
|
331
304
|
isAttachedTo(target: StyleTarget): boolean;
|
|
305
|
+
static normalize(styles: ComposableStyles | ComposableStyles[] | undefined): ElementStyles | undefined;
|
|
332
306
|
// @internal (undocumented)
|
|
333
307
|
removeStylesFrom(target: StyleTarget): void;
|
|
334
308
|
static setDefaultStrategy(Strategy: ConstructibleStyleStrategy): void;
|
|
@@ -341,7 +315,7 @@ export class ElementStyles {
|
|
|
341
315
|
}
|
|
342
316
|
|
|
343
317
|
// @public
|
|
344
|
-
export interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent
|
|
318
|
+
export interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent> {
|
|
345
319
|
appendTo(node: Node): void;
|
|
346
320
|
}
|
|
347
321
|
|
|
@@ -349,15 +323,13 @@ export interface ElementView<TSource = any, TParent = any> extends View<TSource,
|
|
|
349
323
|
export interface ElementViewTemplate<TSource = any, TParent = any> {
|
|
350
324
|
create(hostBindingTarget: Element): ElementView<TSource, TParent>;
|
|
351
325
|
render(source: TSource, host: Node, hostBindingTarget?: Element): ElementView<TSource, TParent>;
|
|
352
|
-
// (undocumented)
|
|
353
|
-
type: "element";
|
|
354
326
|
}
|
|
355
327
|
|
|
356
328
|
// @public
|
|
357
329
|
export const emptyArray: readonly never[];
|
|
358
330
|
|
|
359
331
|
// @public
|
|
360
|
-
export class
|
|
332
|
+
export class EventBehavior {
|
|
361
333
|
constructor(directive: HTMLBindingDirective);
|
|
362
334
|
bind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
363
335
|
createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
|
|
@@ -369,14 +341,41 @@ export class EventBinding {
|
|
|
369
341
|
}
|
|
370
342
|
|
|
371
343
|
// @public
|
|
372
|
-
export
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
344
|
+
export class ExecutionContext<TParentSource = any> {
|
|
345
|
+
static create(): ExecutionContext;
|
|
346
|
+
createChildContext<TParentSource>(parentSource: TParentSource): ExecutionContext<TParentSource>;
|
|
347
|
+
createItemContext(index: number, length: number): ExecutionContext<TParentSource>;
|
|
348
|
+
static readonly default: ExecutionContext<any>;
|
|
349
|
+
get event(): Event;
|
|
350
|
+
eventDetail<TDetail>(): TDetail;
|
|
351
|
+
eventTarget<TTarget extends EventTarget>(): TTarget;
|
|
352
|
+
index: number;
|
|
353
|
+
get isEven(): boolean;
|
|
354
|
+
get isFirst(): boolean;
|
|
355
|
+
get isInMiddle(): boolean;
|
|
356
|
+
get isLast(): boolean;
|
|
357
|
+
get isOdd(): boolean;
|
|
358
|
+
length: number;
|
|
359
|
+
readonly parent: TParentSource;
|
|
360
|
+
readonly parentContext: ExecutionContext<TParentSource>;
|
|
361
|
+
// @internal
|
|
362
|
+
static setEvent(event: Event | null): void;
|
|
363
|
+
updatePosition(index: number, length: number): void;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// @public
|
|
367
|
+
export type Expression<TSource = any, TReturn = any, TParent = any> = (source: TSource, context: ExecutionContext<TParent>) => TReturn;
|
|
377
368
|
|
|
378
369
|
// @public
|
|
379
|
-
export
|
|
370
|
+
export interface ExpressionNotifier<TSource = any, TReturn = any, TParent = any> extends Notifier, ExpressionObserver<TSource, TReturn, TParent> {
|
|
371
|
+
records(): IterableIterator<ObservationRecord>;
|
|
372
|
+
setMode(isAsync: boolean): void;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// @public
|
|
376
|
+
export interface ExpressionObserver<TSource = any, TReturn = any, TParent = any> extends Disposable {
|
|
377
|
+
observe(source: TSource, context?: ExecutionContext<TParent>): TReturn;
|
|
378
|
+
}
|
|
380
379
|
|
|
381
380
|
// Warning: (ae-internal-missing-underscore) The name "FAST" should be prefixed with an underscore because the declaration is marked as @internal
|
|
382
381
|
//
|
|
@@ -398,14 +397,15 @@ export const FASTElement: (new () => HTMLElement & FASTElement) & {
|
|
|
398
397
|
new (): HTMLElement;
|
|
399
398
|
prototype: HTMLElement;
|
|
400
399
|
}>(BaseType: TBase): new () => InstanceType<TBase> & FASTElement;
|
|
401
|
-
define
|
|
400
|
+
define: typeof define;
|
|
401
|
+
compose: typeof compose;
|
|
402
402
|
};
|
|
403
403
|
|
|
404
404
|
// @public
|
|
405
405
|
export class FASTElementDefinition<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> {
|
|
406
|
-
constructor(type: TType, nameOrConfig?: PartialFASTElementDefinition | string);
|
|
407
406
|
readonly attributeLookup: Record<string, AttributeDefinition>;
|
|
408
407
|
readonly attributes: ReadonlyArray<AttributeDefinition>;
|
|
408
|
+
static compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
|
|
409
409
|
define(registry?: CustomElementRegistry): this;
|
|
410
410
|
readonly elementOptions?: ElementDefinitionOptions;
|
|
411
411
|
static readonly getByType: (key: Function) => FASTElementDefinition<Constructable<HTMLElement>> | undefined;
|
|
@@ -424,31 +424,27 @@ export class FASTElementDefinition<TType extends Constructable<HTMLElement> = Co
|
|
|
424
424
|
// @internal
|
|
425
425
|
export interface FASTGlobal {
|
|
426
426
|
addMessages(messages: Record<number, string>): void;
|
|
427
|
-
error(code: number,
|
|
427
|
+
error(code: number, values?: Record<string, any>): Error;
|
|
428
428
|
getById<T>(id: string | number): T | null;
|
|
429
429
|
// (undocumented)
|
|
430
430
|
getById<T>(id: string | number, initialize: () => T): T;
|
|
431
431
|
readonly versions: string[];
|
|
432
|
-
warn(code: number,
|
|
432
|
+
warn(code: number, values?: Record<string, any>): void;
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
// @public
|
|
436
|
-
export function html<TSource = any, TParent = any
|
|
436
|
+
export function html<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]): ViewTemplate<TSource, TParent>;
|
|
437
437
|
|
|
438
438
|
// @public
|
|
439
439
|
export class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, Aspected {
|
|
440
|
-
constructor(
|
|
440
|
+
constructor(dataBinding: Binding);
|
|
441
441
|
aspectType: Aspect;
|
|
442
|
-
// (undocumented)
|
|
443
|
-
binding: Binding;
|
|
444
442
|
createBehavior(targets: ViewBehaviorTargets): ViewBehavior;
|
|
445
443
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
446
|
-
id: string;
|
|
447
444
|
// (undocumented)
|
|
448
|
-
|
|
445
|
+
dataBinding: Binding;
|
|
446
|
+
id: string;
|
|
449
447
|
nodeId: string;
|
|
450
|
-
// (undocumented)
|
|
451
|
-
options: any;
|
|
452
448
|
sourceAspect: string;
|
|
453
449
|
targetAspect: string;
|
|
454
450
|
}
|
|
@@ -474,16 +470,16 @@ export interface HTMLDirectiveDefinition<TType extends Constructable<HTMLDirecti
|
|
|
474
470
|
}
|
|
475
471
|
|
|
476
472
|
// @public
|
|
477
|
-
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any
|
|
478
|
-
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent
|
|
473
|
+
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any> {
|
|
474
|
+
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
479
475
|
}
|
|
480
476
|
|
|
481
477
|
// @public
|
|
482
|
-
export class HTMLView<TSource = any, TParent = any
|
|
478
|
+
export class HTMLView<TSource = any, TParent = any> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent> {
|
|
483
479
|
constructor(fragment: DocumentFragment, factories: ReadonlyArray<ViewBehaviorFactory>, targets: ViewBehaviorTargets);
|
|
484
480
|
appendTo(node: Node): void;
|
|
485
|
-
bind(source: TSource, context:
|
|
486
|
-
context:
|
|
481
|
+
bind(source: TSource, context: ExecutionContext<TParent>): void;
|
|
482
|
+
context: ExecutionContext<TParent> | null;
|
|
487
483
|
dispose(): void;
|
|
488
484
|
static disposeContiguousBatch(views: SyntheticView[]): void;
|
|
489
485
|
firstChild: Node;
|
|
@@ -495,35 +491,15 @@ export class HTMLView<TSource = any, TParent = any, TContext extends ExecutionCo
|
|
|
495
491
|
}
|
|
496
492
|
|
|
497
493
|
// @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";
|
|
494
|
+
export interface LengthObserver extends Subscriber {
|
|
495
|
+
length: number;
|
|
517
496
|
}
|
|
518
497
|
|
|
519
498
|
// @public
|
|
520
|
-
function
|
|
521
|
-
export { length_2 as length }
|
|
499
|
+
export function lengthOf<T>(array: readonly T[]): number;
|
|
522
500
|
|
|
523
501
|
// @public
|
|
524
|
-
export
|
|
525
|
-
length: number;
|
|
526
|
-
}
|
|
502
|
+
export function listener<T = any>(binding: Expression<T>, options?: AddEventListenerOptions): Binding<T>;
|
|
527
503
|
|
|
528
504
|
// @public
|
|
529
505
|
export const Markup: Readonly<{
|
|
@@ -557,6 +533,9 @@ export abstract class NodeObservationDirective<T extends NodeBehaviorOptions> ex
|
|
|
557
533
|
protected updateTarget(source: any, value: ReadonlyArray<any>): void;
|
|
558
534
|
}
|
|
559
535
|
|
|
536
|
+
// @public
|
|
537
|
+
export function normalizeBinding<TSource = any, TReturn = any, TParent = any>(value: Expression<TSource, TReturn, TParent> | Binding<TSource, TReturn, TParent> | {}): Binding<TSource, TReturn, TParent>;
|
|
538
|
+
|
|
560
539
|
// @public
|
|
561
540
|
export interface Notifier {
|
|
562
541
|
notify(args: any): void;
|
|
@@ -577,8 +556,8 @@ export const Observable: Readonly<{
|
|
|
577
556
|
notify(source: unknown, args: any): void;
|
|
578
557
|
defineProperty(target: {}, nameOrAccessor: string | Accessor): void;
|
|
579
558
|
getAccessors: (target: {}) => Accessor[];
|
|
580
|
-
binding<TSource = any, TReturn = any>(binding:
|
|
581
|
-
isVolatileBinding<TSource_1 = any, TReturn_1 = any>(binding:
|
|
559
|
+
binding<TSource = any, TReturn = any>(binding: Expression<TSource, TReturn, any>, initialSubscriber?: Subscriber, isVolatileBinding?: boolean): ExpressionNotifier<TSource, TReturn, any>;
|
|
560
|
+
isVolatileBinding<TSource_1 = any, TReturn_1 = any>(binding: Expression<TSource_1, TReturn_1, any>): boolean;
|
|
582
561
|
}>;
|
|
583
562
|
|
|
584
563
|
// @public
|
|
@@ -591,15 +570,7 @@ export interface ObservationRecord {
|
|
|
591
570
|
}
|
|
592
571
|
|
|
593
572
|
// @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
|
-
}
|
|
573
|
+
export function oneTime<T = any>(binding: Expression<T>): Binding<T>;
|
|
603
574
|
|
|
604
575
|
// @public
|
|
605
576
|
export const Parser: Readonly<{
|
|
@@ -640,58 +611,24 @@ export class RefDirective extends StatelessAttachedAttributeDirective<string> {
|
|
|
640
611
|
}
|
|
641
612
|
|
|
642
613
|
// @public
|
|
643
|
-
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(
|
|
644
|
-
positioning: false;
|
|
645
|
-
} | {
|
|
646
|
-
recycle: true;
|
|
647
|
-
} | {
|
|
648
|
-
positioning: false;
|
|
649
|
-
recycle: false;
|
|
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>;
|
|
614
|
+
export function repeat<TSource = any, TArray extends ReadonlyArray<any> = ReadonlyArray<any>>(items: Expression<TSource, TArray, ExecutionContext<TSource>> | Binding<TSource, TArray> | ReadonlyArray<any>, template: Expression<TSource, ViewTemplate> | Binding<TSource, ViewTemplate> | ViewTemplate, options?: RepeatOptions): CaptureType<TSource>;
|
|
678
615
|
|
|
679
616
|
// @public
|
|
680
617
|
export class RepeatBehavior<TSource = any> implements Behavior, Subscriber {
|
|
681
|
-
constructor(
|
|
618
|
+
constructor(directive: RepeatDirective, location: Node);
|
|
682
619
|
bind(source: TSource, context: ExecutionContext): void;
|
|
683
|
-
handleChange(source: any, args: Splice[]): void;
|
|
620
|
+
handleChange(source: any, args: Splice[] | ExpressionObserver): void;
|
|
684
621
|
unbind(): void;
|
|
685
622
|
}
|
|
686
623
|
|
|
687
624
|
// @public
|
|
688
625
|
export class RepeatDirective<TSource = any> implements HTMLDirective, ViewBehaviorFactory {
|
|
689
|
-
constructor(
|
|
626
|
+
constructor(dataBinding: Binding<TSource>, templateBinding: Binding<TSource, SyntheticViewTemplate>, options: RepeatOptions);
|
|
690
627
|
createBehavior(targets: ViewBehaviorTargets): RepeatBehavior<TSource>;
|
|
691
628
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
692
|
-
id: string;
|
|
693
629
|
// (undocumented)
|
|
694
|
-
readonly
|
|
630
|
+
readonly dataBinding: Binding<TSource>;
|
|
631
|
+
id: string;
|
|
695
632
|
nodeId: string;
|
|
696
633
|
// (undocumented)
|
|
697
634
|
readonly options: RepeatOptions;
|
|
@@ -705,24 +642,6 @@ export interface RepeatOptions {
|
|
|
705
642
|
recycle?: boolean;
|
|
706
643
|
}
|
|
707
644
|
|
|
708
|
-
// @public
|
|
709
|
-
export interface RootContext {
|
|
710
|
-
createChildContext<TParentSource>(source: TParentSource): ChildContext<TParentSource>;
|
|
711
|
-
readonly event: Event;
|
|
712
|
-
eventDetail<TDetail = any>(): TDetail;
|
|
713
|
-
eventTarget<TTarget extends EventTarget = EventTarget>(): TTarget;
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
// @public
|
|
717
|
-
export const signal: <T = any>(options: string | Binding<T, any, ExecutionContext<any>>) => BindingConfig<string | Binding<T, any, ExecutionContext<any>>>;
|
|
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
645
|
// @public
|
|
727
646
|
export function slotted<T = any>(propertyOrOptions: (keyof T & string) | SlottedDirectiveOptions<keyof T & string>): CaptureType<T>;
|
|
728
647
|
|
|
@@ -830,7 +749,7 @@ export interface SubtreeDirectiveOptions<T = any> extends NodeBehaviorOptions<T>
|
|
|
830
749
|
}
|
|
831
750
|
|
|
832
751
|
// @public
|
|
833
|
-
export interface SyntheticView<TSource = any, TParent = any
|
|
752
|
+
export interface SyntheticView<TSource = any, TParent = any> extends View<TSource, TParent> {
|
|
834
753
|
readonly firstChild: Node;
|
|
835
754
|
insertBefore(node: Node): void;
|
|
836
755
|
readonly lastChild: Node;
|
|
@@ -838,14 +757,12 @@ export interface SyntheticView<TSource = any, TParent = any, TContext extends Ex
|
|
|
838
757
|
}
|
|
839
758
|
|
|
840
759
|
// @public
|
|
841
|
-
export interface SyntheticViewTemplate<TSource = any, TParent = any
|
|
842
|
-
create(): SyntheticView<TSource, TParent
|
|
843
|
-
// (undocumented)
|
|
844
|
-
type: "synthetic";
|
|
760
|
+
export interface SyntheticViewTemplate<TSource = any, TParent = any> {
|
|
761
|
+
create(): SyntheticView<TSource, TParent>;
|
|
845
762
|
}
|
|
846
763
|
|
|
847
764
|
// @public
|
|
848
|
-
export type TemplateValue<TSource, TParent = any
|
|
765
|
+
export type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource>;
|
|
849
766
|
|
|
850
767
|
// @public
|
|
851
768
|
export type TrustedTypes = {
|
|
@@ -857,23 +774,6 @@ export type TrustedTypesPolicy = {
|
|
|
857
774
|
createHTML(html: string): string;
|
|
858
775
|
};
|
|
859
776
|
|
|
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
777
|
// Warning: (ae-internal-missing-underscore) The name "TypeDefinition" should be prefixed with an underscore because the declaration is marked as @internal
|
|
878
778
|
//
|
|
879
779
|
// @internal
|
|
@@ -894,18 +794,6 @@ export interface TypeRegistry<TDefinition extends TypeDefinition> {
|
|
|
894
794
|
register(definition: TDefinition): boolean;
|
|
895
795
|
}
|
|
896
796
|
|
|
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
797
|
// @public
|
|
910
798
|
export interface UpdateQueue {
|
|
911
799
|
enqueue(callable: Callable): void;
|
|
@@ -932,9 +820,9 @@ export interface ValueConverter {
|
|
|
932
820
|
}
|
|
933
821
|
|
|
934
822
|
// @public
|
|
935
|
-
export interface View<TSource = any, TParent = any
|
|
936
|
-
bind(source: TSource, context:
|
|
937
|
-
readonly context:
|
|
823
|
+
export interface View<TSource = any, TParent = any> extends Disposable {
|
|
824
|
+
bind(source: TSource, context: ExecutionContext<TParent>): void;
|
|
825
|
+
readonly context: ExecutionContext<TParent> | null;
|
|
938
826
|
readonly source: TSource | null;
|
|
939
827
|
unbind(): void;
|
|
940
828
|
}
|
|
@@ -958,20 +846,24 @@ export type ViewBehaviorTargets = {
|
|
|
958
846
|
};
|
|
959
847
|
|
|
960
848
|
// @public
|
|
961
|
-
export class ViewTemplate<TSource = any, TParent = any
|
|
849
|
+
export class ViewTemplate<TSource = any, TParent = any> implements ElementViewTemplate<TSource, TParent>, SyntheticViewTemplate<TSource, TParent> {
|
|
962
850
|
constructor(html: string | HTMLTemplateElement, factories: Record<string, ViewBehaviorFactory>);
|
|
963
|
-
create(hostBindingTarget?: Element): HTMLView<TSource, TParent
|
|
851
|
+
create(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
964
852
|
readonly factories: Record<string, ViewBehaviorFactory>;
|
|
965
853
|
readonly html: string | HTMLTemplateElement;
|
|
966
|
-
render(source: TSource, host: Node, hostBindingTarget?: Element, context?:
|
|
967
|
-
type: any;
|
|
854
|
+
render(source: TSource, host: Node, hostBindingTarget?: Element, context?: ExecutionContext): HTMLView<TSource, TParent>;
|
|
968
855
|
}
|
|
969
856
|
|
|
970
857
|
// @public
|
|
971
858
|
export function volatile(target: {}, name: string | Accessor, descriptor: PropertyDescriptor): PropertyDescriptor;
|
|
972
859
|
|
|
973
860
|
// @public
|
|
974
|
-
export function when<TSource = any, TReturn = any>(
|
|
861
|
+
export function when<TSource = any, TReturn = any>(condition: Expression<TSource, TReturn> | boolean, templateOrTemplateBinding: SyntheticViewTemplate | Expression<TSource, SyntheticViewTemplate>): CaptureType<TSource>;
|
|
862
|
+
|
|
863
|
+
// Warnings were encountered during analysis:
|
|
864
|
+
//
|
|
865
|
+
// dist/dts/components/fast-element.d.ts:73:5 - (ae-forgotten-export) The symbol "define" needs to be exported by the entry point index.d.ts
|
|
866
|
+
// dist/dts/components/fast-element.d.ts:78:5 - (ae-forgotten-export) The symbol "compose" needs to be exported by the entry point index.d.ts
|
|
975
867
|
|
|
976
868
|
// (No @packageDocumentation comment for this package)
|
|
977
869
|
|