@microsoft/fast-element 2.0.0-beta.1 → 2.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +348 -0
- package/CHANGELOG.md +114 -1
- package/dist/dts/components/attributes.d.ts +10 -0
- package/dist/dts/components/{controller.d.ts → element-controller.d.ts} +49 -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 +45 -14
- 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 +7 -0
- package/dist/dts/polyfills.d.ts +1 -8
- 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 +10 -17
- 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} +188 -109
- 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 +26 -1
- package/dist/esm/polyfills.js +1 -55
- 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 -33
- 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 +9278 -10745
- package/dist/fast-element.d.ts +707 -813
- package/dist/fast-element.debug.js +1229 -944
- package/dist/fast-element.debug.min.js +1 -1
- package/dist/fast-element.js +1191 -938
- package/dist/fast-element.min.js +1 -1
- package/dist/fast-element.untrimmed.d.ts +716 -824
- package/docs/api-report.md +265 -319
- package/package.json +39 -14
- 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,24 +12,11 @@ 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;
|
|
19
19
|
|
|
20
|
-
// Warning: (ae-internal-missing-underscore) The name "AdoptedStyleSheetsStrategy" should be prefixed with an underscore because the declaration is marked as @internal
|
|
21
|
-
//
|
|
22
|
-
// @internal
|
|
23
|
-
export class AdoptedStyleSheetsStrategy implements StyleStrategy {
|
|
24
|
-
constructor(styles: (string | CSSStyleSheet)[]);
|
|
25
|
-
// (undocumented)
|
|
26
|
-
addStylesTo(target: StyleTarget): void;
|
|
27
|
-
// (undocumented)
|
|
28
|
-
removeStylesFrom(target: StyleTarget): void;
|
|
29
|
-
// (undocumented)
|
|
30
|
-
readonly sheets: CSSStyleSheet[];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
20
|
// @public
|
|
34
21
|
export interface ArrayObserver extends SubscriberSet {
|
|
35
22
|
addSplice(splice: Splice): void;
|
|
@@ -53,7 +40,7 @@ export const Aspect: Readonly<{
|
|
|
53
40
|
readonly content: 4;
|
|
54
41
|
readonly tokenList: 5;
|
|
55
42
|
readonly event: 6;
|
|
56
|
-
readonly assign: (directive: Aspected, value
|
|
43
|
+
readonly assign: (directive: Aspected, value?: string) => void;
|
|
57
44
|
}>;
|
|
58
45
|
|
|
59
46
|
// @public
|
|
@@ -62,7 +49,7 @@ export type Aspect = typeof Aspect[Exclude<keyof typeof Aspect, "assign" | "none
|
|
|
62
49
|
// @public
|
|
63
50
|
export interface Aspected {
|
|
64
51
|
aspectType: Aspect;
|
|
65
|
-
|
|
52
|
+
dataBinding?: Binding;
|
|
66
53
|
sourceAspect: string;
|
|
67
54
|
targetAspect: string;
|
|
68
55
|
}
|
|
@@ -81,6 +68,11 @@ export type AttributeConfiguration = {
|
|
|
81
68
|
converter?: ValueConverter;
|
|
82
69
|
};
|
|
83
70
|
|
|
71
|
+
// @public
|
|
72
|
+
export const AttributeConfiguration: Readonly<{
|
|
73
|
+
locate: (target: {}) => AttributeConfiguration[];
|
|
74
|
+
}>;
|
|
75
|
+
|
|
84
76
|
// @public
|
|
85
77
|
export class AttributeDefinition implements Accessor {
|
|
86
78
|
constructor(Owner: Function, name: string, attribute?: string, mode?: AttributeMode, converter?: ValueConverter);
|
|
@@ -104,44 +96,17 @@ export class AttributeDefinition implements Accessor {
|
|
|
104
96
|
export type AttributeMode = typeof reflectMode | typeof booleanMode | "fromView";
|
|
105
97
|
|
|
106
98
|
// @public
|
|
107
|
-
export
|
|
108
|
-
bind(source: TSource, context: TContext): void;
|
|
109
|
-
unbind(source: TSource, context: TContext): void;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// @public
|
|
113
|
-
export function bind<T = any>(binding: Binding<T>, config?: BindingConfig | DefaultBindingOptions): CaptureType<T>;
|
|
114
|
-
|
|
115
|
-
// @public
|
|
116
|
-
export type Binding<TSource = any, TReturn = any, TContext extends ExecutionContext = ExecutionContext> = (source: TSource, context: TContext) => TReturn;
|
|
117
|
-
|
|
118
|
-
// @public
|
|
119
|
-
export interface BindingConfig<T = any> {
|
|
120
|
-
mode: BindingMode;
|
|
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
|
-
}>;
|
|
99
|
+
export function bind<T = any>(binding: Expression<T>, isVolatile?: boolean): Binding<T>;
|
|
139
100
|
|
|
140
101
|
// @public
|
|
141
|
-
export
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
102
|
+
export abstract class Binding<TSource = any, TReturn = any, TParent = any> {
|
|
103
|
+
constructor(evaluate: Expression<TSource, TReturn, TParent>, isVolatile?: boolean);
|
|
104
|
+
abstract createObserver(directive: HTMLDirective, subscriber: Subscriber): ExpressionObserver<TSource, TReturn, TParent>;
|
|
105
|
+
// (undocumented)
|
|
106
|
+
evaluate: Expression<TSource, TReturn, TParent>;
|
|
107
|
+
// (undocumented)
|
|
108
|
+
isVolatile: boolean;
|
|
109
|
+
options?: any;
|
|
145
110
|
}
|
|
146
111
|
|
|
147
112
|
// @public
|
|
@@ -153,27 +118,7 @@ export type Callable = typeof Function.prototype.call | {
|
|
|
153
118
|
};
|
|
154
119
|
|
|
155
120
|
// @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>;
|
|
121
|
+
export interface CaptureType<TSource, TParent> {
|
|
177
122
|
}
|
|
178
123
|
|
|
179
124
|
// @public
|
|
@@ -181,7 +126,7 @@ export interface ChildListDirectiveOptions<T = any> extends NodeBehaviorOptions<
|
|
|
181
126
|
}
|
|
182
127
|
|
|
183
128
|
// @public
|
|
184
|
-
export function children<
|
|
129
|
+
export function children<TSource = any, TParent = any>(propertyOrOptions: (keyof TSource & string) | ChildrenDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
|
|
185
130
|
|
|
186
131
|
// @public
|
|
187
132
|
export class ChildrenDirective extends NodeObservationDirective<ChildrenDirectiveOptions> {
|
|
@@ -194,13 +139,6 @@ export class ChildrenDirective extends NodeObservationDirective<ChildrenDirectiv
|
|
|
194
139
|
// @public
|
|
195
140
|
export type ChildrenDirectiveOptions<T = any> = ChildListDirectiveOptions<T> | SubtreeDirectiveOptions<T>;
|
|
196
141
|
|
|
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
142
|
// @public
|
|
205
143
|
export type CompilationStrategy = (
|
|
206
144
|
html: string | HTMLTemplateElement,
|
|
@@ -209,7 +147,7 @@ factories: Record<string, ViewBehaviorFactory>) => HTMLTemplateCompilationResult
|
|
|
209
147
|
// @public
|
|
210
148
|
export const Compiler: {
|
|
211
149
|
setHTMLPolicy(policy: TrustedTypesPolicy): void;
|
|
212
|
-
compile<TSource = any, TParent = any
|
|
150
|
+
compile<TSource = any, TParent = any>(html: string | HTMLTemplateElement, directives: Record<string, ViewBehaviorFactory>): HTMLTemplateCompilationResult<TSource, TParent>;
|
|
213
151
|
setDefaultStrategy(strategy: CompilationStrategy): void;
|
|
214
152
|
aggregate(parts: (string | ViewBehaviorFactory)[]): ViewBehaviorFactory;
|
|
215
153
|
};
|
|
@@ -228,28 +166,25 @@ export type ConstructibleStyleStrategy = {
|
|
|
228
166
|
};
|
|
229
167
|
|
|
230
168
|
// @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;
|
|
169
|
+
export interface ContentTemplate {
|
|
170
|
+
create(): ContentView;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// @public
|
|
174
|
+
export interface ContentView {
|
|
175
|
+
bind(source: any, context?: ExecutionContext): void;
|
|
176
|
+
// (undocumented)
|
|
177
|
+
readonly context: ExecutionContext;
|
|
178
|
+
insertBefore(node: Node): void;
|
|
179
|
+
remove(): void;
|
|
180
|
+
unbind(): void;
|
|
251
181
|
}
|
|
252
182
|
|
|
183
|
+
// Warning: (ae-internal-missing-underscore) The name "createMetadataLocator" should be prefixed with an underscore because the declaration is marked as @internal
|
|
184
|
+
//
|
|
185
|
+
// @internal
|
|
186
|
+
export function createMetadataLocator<TMetadata>(): (target: {}) => TMetadata[];
|
|
187
|
+
|
|
253
188
|
// Warning: (ae-internal-missing-underscore) The name "createTypeRegistry" should be prefixed with an underscore because the declaration is marked as @internal
|
|
254
189
|
//
|
|
255
190
|
// @internal
|
|
@@ -292,15 +227,6 @@ export function customElement(nameOrDef: string | PartialFASTElementDefinition):
|
|
|
292
227
|
// @public
|
|
293
228
|
export type DecoratorAttributeConfiguration = Omit<AttributeConfiguration, "property">;
|
|
294
229
|
|
|
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
230
|
// @public
|
|
305
231
|
export interface Disposable {
|
|
306
232
|
dispose(): void;
|
|
@@ -315,20 +241,44 @@ export const DOM: Readonly<{
|
|
|
315
241
|
setBooleanAttribute(element: HTMLElement, attributeName: string, value: boolean): void;
|
|
316
242
|
}>;
|
|
317
243
|
|
|
244
|
+
// @public
|
|
245
|
+
export class ElementController<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier implements HostController<TElement> {
|
|
246
|
+
// @internal
|
|
247
|
+
constructor(element: TElement, definition: FASTElementDefinition);
|
|
248
|
+
addBehavior(behavior: HostBehavior<TElement>): void;
|
|
249
|
+
addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
250
|
+
connect(): void;
|
|
251
|
+
readonly definition: FASTElementDefinition;
|
|
252
|
+
disconnect(): void;
|
|
253
|
+
emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): void | boolean;
|
|
254
|
+
static forCustomElement(element: HTMLElement): ElementController;
|
|
255
|
+
get isConnected(): boolean;
|
|
256
|
+
get mainStyles(): ElementStyles | null;
|
|
257
|
+
set mainStyles(value: ElementStyles | null);
|
|
258
|
+
onAttributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
259
|
+
removeBehavior(behavior: HostBehavior<TElement>, force?: boolean): void;
|
|
260
|
+
removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
261
|
+
readonly source: TElement;
|
|
262
|
+
get template(): ElementViewTemplate<TElement> | null;
|
|
263
|
+
set template(value: ElementViewTemplate<TElement> | null);
|
|
264
|
+
readonly view: ElementView<TElement> | null;
|
|
265
|
+
}
|
|
266
|
+
|
|
318
267
|
// @public
|
|
319
268
|
export const elements: (selector?: string) => ElementsFilter;
|
|
320
269
|
|
|
321
270
|
// @public
|
|
322
|
-
export type ElementsFilter = (value: Node, index
|
|
271
|
+
export type ElementsFilter = (value: Node, index?: number, array?: Node[]) => boolean;
|
|
323
272
|
|
|
324
273
|
// @public
|
|
325
274
|
export class ElementStyles {
|
|
326
275
|
constructor(styles: ReadonlyArray<ComposableStyles>);
|
|
327
276
|
// @internal (undocumented)
|
|
328
277
|
addStylesTo(target: StyleTarget): void;
|
|
329
|
-
readonly behaviors: ReadonlyArray<
|
|
278
|
+
readonly behaviors: ReadonlyArray<HostBehavior<HTMLElement>> | null;
|
|
330
279
|
// @internal (undocumented)
|
|
331
280
|
isAttachedTo(target: StyleTarget): boolean;
|
|
281
|
+
static normalize(styles: ComposableStyles | ComposableStyles[] | undefined): ElementStyles | undefined;
|
|
332
282
|
// @internal (undocumented)
|
|
333
283
|
removeStylesFrom(target: StyleTarget): void;
|
|
334
284
|
static setDefaultStrategy(Strategy: ConstructibleStyleStrategy): void;
|
|
@@ -336,12 +286,12 @@ export class ElementStyles {
|
|
|
336
286
|
// (undocumented)
|
|
337
287
|
readonly styles: ReadonlyArray<ComposableStyles>;
|
|
338
288
|
static readonly supportsAdoptedStyleSheets: boolean;
|
|
339
|
-
withBehaviors(...behaviors:
|
|
289
|
+
withBehaviors(...behaviors: HostBehavior<HTMLElement>[]): this;
|
|
340
290
|
withStrategy(Strategy: ConstructibleStyleStrategy): this;
|
|
341
291
|
}
|
|
342
292
|
|
|
343
293
|
// @public
|
|
344
|
-
export interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent
|
|
294
|
+
export interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent> {
|
|
345
295
|
appendTo(node: Node): void;
|
|
346
296
|
}
|
|
347
297
|
|
|
@@ -349,34 +299,59 @@ export interface ElementView<TSource = any, TParent = any> extends View<TSource,
|
|
|
349
299
|
export interface ElementViewTemplate<TSource = any, TParent = any> {
|
|
350
300
|
create(hostBindingTarget: Element): ElementView<TSource, TParent>;
|
|
351
301
|
render(source: TSource, host: Node, hostBindingTarget?: Element): ElementView<TSource, TParent>;
|
|
352
|
-
// (undocumented)
|
|
353
|
-
type: "element";
|
|
354
302
|
}
|
|
355
303
|
|
|
356
304
|
// @public
|
|
357
305
|
export const emptyArray: readonly never[];
|
|
358
306
|
|
|
359
307
|
// @public
|
|
360
|
-
export
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
readonly
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
308
|
+
export interface ExecutionContext<TParent = any> {
|
|
309
|
+
readonly event: Event;
|
|
310
|
+
eventDetail<TDetail>(): TDetail;
|
|
311
|
+
eventTarget<TTarget extends EventTarget>(): TTarget;
|
|
312
|
+
index: number;
|
|
313
|
+
readonly isEven: boolean;
|
|
314
|
+
readonly isFirst: boolean;
|
|
315
|
+
readonly isInMiddle: boolean;
|
|
316
|
+
readonly isLast: boolean;
|
|
317
|
+
readonly isOdd: boolean;
|
|
318
|
+
length: number;
|
|
319
|
+
parent: TParent;
|
|
320
|
+
parentContext: ExecutionContext<TParent>;
|
|
369
321
|
}
|
|
370
322
|
|
|
371
323
|
// @public
|
|
372
324
|
export const ExecutionContext: Readonly<{
|
|
373
|
-
default:
|
|
325
|
+
default: ExecutionContext<any>;
|
|
326
|
+
getEvent(): Event | null;
|
|
374
327
|
setEvent(event: Event | null): void;
|
|
375
|
-
create(): RootContext;
|
|
376
328
|
}>;
|
|
377
329
|
|
|
378
330
|
// @public
|
|
379
|
-
export type
|
|
331
|
+
export type Expression<TSource = any, TReturn = any, TParent = any> = (source: TSource, context: ExecutionContext<TParent>) => TReturn;
|
|
332
|
+
|
|
333
|
+
// @public
|
|
334
|
+
export interface ExpressionController<TSource = any, TParent = any> {
|
|
335
|
+
readonly context: ExecutionContext<TParent>;
|
|
336
|
+
readonly isBound: boolean;
|
|
337
|
+
onUnbind(behavior: {
|
|
338
|
+
unbind(controller: ExpressionController<TSource, TParent>): any;
|
|
339
|
+
}): void;
|
|
340
|
+
readonly source: TSource;
|
|
341
|
+
readonly sourceLifetime?: SourceLifetime;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// @public
|
|
345
|
+
export interface ExpressionNotifier<TSource = any, TReturn = any, TParent = any> extends Notifier, ExpressionObserver<TSource, TReturn, TParent>, Disposable {
|
|
346
|
+
observe(source: TSource, context?: ExecutionContext): TReturn;
|
|
347
|
+
records(): IterableIterator<ObservationRecord>;
|
|
348
|
+
setMode(isAsync: boolean): void;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// @public
|
|
352
|
+
export interface ExpressionObserver<TSource = any, TReturn = any, TParent = any> {
|
|
353
|
+
bind(controller: ExpressionController<TSource, TParent>): TReturn;
|
|
354
|
+
}
|
|
380
355
|
|
|
381
356
|
// Warning: (ae-internal-missing-underscore) The name "FAST" should be prefixed with an underscore because the declaration is marked as @internal
|
|
382
357
|
//
|
|
@@ -386,34 +361,36 @@ export const FAST: FASTGlobal;
|
|
|
386
361
|
// @public
|
|
387
362
|
export interface FASTElement extends HTMLElement {
|
|
388
363
|
$emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): boolean | void;
|
|
389
|
-
readonly $fastController:
|
|
364
|
+
readonly $fastController: ElementController;
|
|
390
365
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
391
366
|
connectedCallback(): void;
|
|
392
367
|
disconnectedCallback(): void;
|
|
393
368
|
}
|
|
394
369
|
|
|
395
370
|
// @public
|
|
396
|
-
export const FASTElement:
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
define<TType extends Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): TType;
|
|
371
|
+
export const FASTElement: {
|
|
372
|
+
new (): FASTElement;
|
|
373
|
+
define: typeof define;
|
|
374
|
+
compose: typeof compose;
|
|
375
|
+
from: typeof from;
|
|
402
376
|
};
|
|
403
377
|
|
|
404
378
|
// @public
|
|
405
379
|
export class FASTElementDefinition<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> {
|
|
406
|
-
constructor(type: TType, nameOrConfig?: PartialFASTElementDefinition | string);
|
|
407
380
|
readonly attributeLookup: Record<string, AttributeDefinition>;
|
|
408
381
|
readonly attributes: ReadonlyArray<AttributeDefinition>;
|
|
382
|
+
static compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
|
|
409
383
|
define(registry?: CustomElementRegistry): this;
|
|
410
|
-
readonly elementOptions
|
|
384
|
+
readonly elementOptions: ElementDefinitionOptions;
|
|
411
385
|
static readonly getByType: (key: Function) => FASTElementDefinition<Constructable<HTMLElement>> | undefined;
|
|
412
386
|
static readonly getForInstance: (object: any) => FASTElementDefinition<Constructable<HTMLElement>> | undefined;
|
|
413
387
|
get isDefined(): boolean;
|
|
414
388
|
readonly name: string;
|
|
415
389
|
readonly propertyLookup: Record<string, AttributeDefinition>;
|
|
416
|
-
|
|
390
|
+
// @internal
|
|
391
|
+
static registerBaseType(type: Function): void;
|
|
392
|
+
readonly registry: CustomElementRegistry;
|
|
393
|
+
readonly shadowOptions?: ShadowRootOptions;
|
|
417
394
|
readonly styles?: ElementStyles;
|
|
418
395
|
readonly template?: ElementViewTemplate;
|
|
419
396
|
readonly type: TType;
|
|
@@ -424,33 +401,62 @@ export class FASTElementDefinition<TType extends Constructable<HTMLElement> = Co
|
|
|
424
401
|
// @internal
|
|
425
402
|
export interface FASTGlobal {
|
|
426
403
|
addMessages(messages: Record<number, string>): void;
|
|
427
|
-
error(code: number,
|
|
404
|
+
error(code: number, values?: Record<string, any>): Error;
|
|
428
405
|
getById<T>(id: string | number): T | null;
|
|
429
406
|
// (undocumented)
|
|
430
407
|
getById<T>(id: string | number, initialize: () => T): T;
|
|
431
408
|
readonly versions: string[];
|
|
432
|
-
warn(code: number,
|
|
409
|
+
warn(code: number, values?: Record<string, any>): void;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// @public
|
|
413
|
+
export interface HostBehavior<TSource = any> {
|
|
414
|
+
addedCallback?(controller: HostController<TSource>): void;
|
|
415
|
+
connectedCallback?(controller: HostController<TSource>): void;
|
|
416
|
+
disconnectedCallback?(controller: HostController<TSource>): void;
|
|
417
|
+
removedCallback?(controller: HostController<TSource>): void;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// @public
|
|
421
|
+
export interface HostController<TSource = any> {
|
|
422
|
+
addBehavior(behavior: HostBehavior<TSource>): void;
|
|
423
|
+
addStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
424
|
+
readonly isConnected: boolean;
|
|
425
|
+
mainStyles: ElementStyles | null;
|
|
426
|
+
removeBehavior(behavior: HostBehavior<TSource>, force?: boolean): void;
|
|
427
|
+
removeStyles(styles: ElementStyles | HTMLStyleElement | null | undefined): void;
|
|
428
|
+
readonly source: TSource;
|
|
433
429
|
}
|
|
434
430
|
|
|
435
431
|
// @public
|
|
436
|
-
export function html<TSource = any, TParent = any
|
|
432
|
+
export function html<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]): ViewTemplate<TSource, TParent>;
|
|
437
433
|
|
|
438
434
|
// @public
|
|
439
|
-
export class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, Aspected {
|
|
440
|
-
constructor(
|
|
435
|
+
export class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, ViewBehavior, Aspected {
|
|
436
|
+
constructor(dataBinding: Binding);
|
|
441
437
|
aspectType: Aspect;
|
|
442
|
-
// (undocumented)
|
|
443
|
-
|
|
444
|
-
|
|
438
|
+
// @internal (undocumented)
|
|
439
|
+
bind: (controller: ViewController) => void;
|
|
440
|
+
// @internal (undocumented)
|
|
441
|
+
bindContent(controller: ViewController): void;
|
|
442
|
+
// @internal (undocumented)
|
|
443
|
+
bindDefault(controller: ViewController): void;
|
|
444
|
+
// @internal (undocumented)
|
|
445
|
+
bindEvent(controller: ViewController): void;
|
|
446
|
+
createBehavior(): ViewBehavior;
|
|
445
447
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
446
|
-
id: string;
|
|
447
448
|
// (undocumented)
|
|
448
|
-
|
|
449
|
+
dataBinding: Binding;
|
|
450
|
+
// @internal (undocumented)
|
|
451
|
+
handleChange(binding: Expression, observer: ExpressionObserver): void;
|
|
452
|
+
// @internal (undocumented)
|
|
453
|
+
handleEvent(event: Event): void;
|
|
454
|
+
id: string;
|
|
449
455
|
nodeId: string;
|
|
450
|
-
// (undocumented)
|
|
451
|
-
options: any;
|
|
452
456
|
sourceAspect: string;
|
|
453
457
|
targetAspect: string;
|
|
458
|
+
// @internal (undocumented)
|
|
459
|
+
unbind(controller: ViewController): void;
|
|
454
460
|
}
|
|
455
461
|
|
|
456
462
|
// @public
|
|
@@ -474,56 +480,56 @@ export interface HTMLDirectiveDefinition<TType extends Constructable<HTMLDirecti
|
|
|
474
480
|
}
|
|
475
481
|
|
|
476
482
|
// @public
|
|
477
|
-
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any
|
|
478
|
-
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent
|
|
483
|
+
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any> {
|
|
484
|
+
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
479
485
|
}
|
|
480
486
|
|
|
481
487
|
// @public
|
|
482
|
-
export class HTMLView<TSource = any, TParent = any
|
|
488
|
+
export class HTMLView<TSource = any, TParent = any> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent>, ExecutionContext<TParent> {
|
|
483
489
|
constructor(fragment: DocumentFragment, factories: ReadonlyArray<ViewBehaviorFactory>, targets: ViewBehaviorTargets);
|
|
484
490
|
appendTo(node: Node): void;
|
|
485
|
-
bind(source: TSource, context
|
|
486
|
-
context:
|
|
491
|
+
bind(source: TSource, context?: ExecutionContext<TParent>): void;
|
|
492
|
+
context: ExecutionContext<TParent>;
|
|
487
493
|
dispose(): void;
|
|
488
494
|
static disposeContiguousBatch(views: SyntheticView[]): void;
|
|
495
|
+
get event(): Event;
|
|
496
|
+
eventDetail<TDetail>(): TDetail;
|
|
497
|
+
eventTarget<TTarget extends EventTarget>(): TTarget;
|
|
489
498
|
firstChild: Node;
|
|
499
|
+
index: number;
|
|
490
500
|
insertBefore(node: Node): void;
|
|
501
|
+
isBound: boolean;
|
|
502
|
+
get isEven(): boolean;
|
|
503
|
+
get isFirst(): boolean;
|
|
504
|
+
get isInMiddle(): boolean;
|
|
505
|
+
get isLast(): boolean;
|
|
506
|
+
get isOdd(): boolean;
|
|
491
507
|
lastChild: Node;
|
|
508
|
+
length: number;
|
|
509
|
+
// (undocumented)
|
|
510
|
+
onUnbind(behavior: {
|
|
511
|
+
unbind(controller: ViewController<TSource, TParent>): any;
|
|
512
|
+
}): void;
|
|
513
|
+
readonly parent: TParent;
|
|
514
|
+
readonly parentContext: ExecutionContext<TParent>;
|
|
492
515
|
remove(): void;
|
|
493
516
|
source: TSource | null;
|
|
517
|
+
readonly sourceLifetime: SourceLifetime;
|
|
518
|
+
// (undocumented)
|
|
519
|
+
readonly targets: ViewBehaviorTargets;
|
|
494
520
|
unbind(): void;
|
|
495
521
|
}
|
|
496
522
|
|
|
497
523
|
// @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";
|
|
524
|
+
export interface LengthObserver extends Subscriber {
|
|
525
|
+
length: number;
|
|
517
526
|
}
|
|
518
527
|
|
|
519
528
|
// @public
|
|
520
|
-
function
|
|
521
|
-
export { length_2 as length }
|
|
529
|
+
export function lengthOf<T>(array: readonly T[]): number;
|
|
522
530
|
|
|
523
531
|
// @public
|
|
524
|
-
export
|
|
525
|
-
length: number;
|
|
526
|
-
}
|
|
532
|
+
export function listener<T = any>(binding: Expression<T>, options?: AddEventListenerOptions): Binding<T>;
|
|
527
533
|
|
|
528
534
|
// @public
|
|
529
535
|
export const Markup: Readonly<{
|
|
@@ -547,16 +553,19 @@ export interface NodeBehaviorOptions<T = any> {
|
|
|
547
553
|
|
|
548
554
|
// @public
|
|
549
555
|
export abstract class NodeObservationDirective<T extends NodeBehaviorOptions> extends StatelessAttachedAttributeDirective<T> {
|
|
550
|
-
bind(
|
|
556
|
+
bind(controller: ViewController): void;
|
|
551
557
|
protected computeNodes(target: any): Node[];
|
|
552
558
|
protected abstract disconnect(target: any): void;
|
|
553
559
|
protected abstract getNodes(target: any): Node[];
|
|
554
560
|
protected getSource(target: Node): any;
|
|
555
561
|
protected abstract observe(target: any): void;
|
|
556
|
-
unbind(
|
|
562
|
+
unbind(controller: ViewController): void;
|
|
557
563
|
protected updateTarget(source: any, value: ReadonlyArray<any>): void;
|
|
558
564
|
}
|
|
559
565
|
|
|
566
|
+
// @public
|
|
567
|
+
export function normalizeBinding<TSource = any, TReturn = any, TParent = any>(value: Expression<TSource, TReturn, TParent> | Binding<TSource, TReturn, TParent> | {}): Binding<TSource, TReturn, TParent>;
|
|
568
|
+
|
|
560
569
|
// @public
|
|
561
570
|
export interface Notifier {
|
|
562
571
|
notify(args: any): void;
|
|
@@ -577,8 +586,8 @@ export const Observable: Readonly<{
|
|
|
577
586
|
notify(source: unknown, args: any): void;
|
|
578
587
|
defineProperty(target: {}, nameOrAccessor: string | Accessor): void;
|
|
579
588
|
getAccessors: (target: {}) => Accessor[];
|
|
580
|
-
binding<TSource = any, TReturn = any>(
|
|
581
|
-
isVolatileBinding<TSource_1 = any, TReturn_1 = any>(
|
|
589
|
+
binding<TSource = any, TReturn = any>(expression: Expression<TSource, TReturn, any>, initialSubscriber?: Subscriber, isVolatileBinding?: boolean): ExpressionNotifier<TSource, TReturn, any>;
|
|
590
|
+
isVolatileBinding<TSource_1 = any, TReturn_1 = any>(expression: Expression<TSource_1, TReturn_1, any>): boolean;
|
|
582
591
|
}>;
|
|
583
592
|
|
|
584
593
|
// @public
|
|
@@ -591,15 +600,7 @@ export interface ObservationRecord {
|
|
|
591
600
|
}
|
|
592
601
|
|
|
593
602
|
// @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
|
-
}
|
|
603
|
+
export function oneTime<T = any>(binding: Expression<T>): Binding<T>;
|
|
603
604
|
|
|
604
605
|
// @public
|
|
605
606
|
export const Parser: Readonly<{
|
|
@@ -611,7 +612,8 @@ export interface PartialFASTElementDefinition {
|
|
|
611
612
|
readonly attributes?: (AttributeConfiguration | string)[];
|
|
612
613
|
readonly elementOptions?: ElementDefinitionOptions;
|
|
613
614
|
readonly name: string;
|
|
614
|
-
readonly
|
|
615
|
+
readonly registry?: CustomElementRegistry;
|
|
616
|
+
readonly shadowOptions?: Partial<ShadowRootOptions> | null;
|
|
615
617
|
readonly styles?: ComposableStyles | ComposableStyles[];
|
|
616
618
|
readonly template?: ElementViewTemplate;
|
|
617
619
|
}
|
|
@@ -631,67 +633,32 @@ export class PropertyChangeNotifier implements Notifier {
|
|
|
631
633
|
}
|
|
632
634
|
|
|
633
635
|
// @public
|
|
634
|
-
export const ref: <
|
|
636
|
+
export const ref: <TSource = any, TParent = any>(propertyName: keyof TSource & string) => CaptureType<TSource, TParent>;
|
|
635
637
|
|
|
636
638
|
// @public
|
|
637
639
|
export class RefDirective extends StatelessAttachedAttributeDirective<string> {
|
|
638
|
-
bind(
|
|
639
|
-
unbind(): void;
|
|
640
|
+
bind(controller: ViewController): void;
|
|
640
641
|
}
|
|
641
642
|
|
|
642
643
|
// @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;
|
|
644
|
+
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>;
|
|
645
|
+
|
|
646
|
+
// @public
|
|
647
|
+
export class RepeatBehavior<TSource = any> implements ViewBehavior, Subscriber {
|
|
648
|
+
constructor(directive: RepeatDirective);
|
|
649
|
+
bind(controller: ViewController): void;
|
|
650
|
+
handleChange(source: any, args: Splice[] | ExpressionObserver): void;
|
|
684
651
|
unbind(): void;
|
|
685
652
|
}
|
|
686
653
|
|
|
687
654
|
// @public
|
|
688
655
|
export class RepeatDirective<TSource = any> implements HTMLDirective, ViewBehaviorFactory {
|
|
689
|
-
constructor(
|
|
690
|
-
createBehavior(
|
|
656
|
+
constructor(dataBinding: Binding<TSource>, templateBinding: Binding<TSource, SyntheticViewTemplate>, options: RepeatOptions);
|
|
657
|
+
createBehavior(): RepeatBehavior<TSource>;
|
|
691
658
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
692
|
-
id: string;
|
|
693
659
|
// (undocumented)
|
|
694
|
-
readonly
|
|
660
|
+
readonly dataBinding: Binding<TSource>;
|
|
661
|
+
id: string;
|
|
695
662
|
nodeId: string;
|
|
696
663
|
// (undocumented)
|
|
697
664
|
readonly options: RepeatOptions;
|
|
@@ -706,25 +673,13 @@ export interface RepeatOptions {
|
|
|
706
673
|
}
|
|
707
674
|
|
|
708
675
|
// @public
|
|
709
|
-
export interface
|
|
710
|
-
|
|
711
|
-
|
|
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;
|
|
676
|
+
export interface ShadowRootOptions extends ShadowRootInit {
|
|
677
|
+
// @beta
|
|
678
|
+
registry?: CustomElementRegistry;
|
|
724
679
|
}
|
|
725
680
|
|
|
726
681
|
// @public
|
|
727
|
-
export function slotted<
|
|
682
|
+
export function slotted<TSource = any, TParent = any>(propertyOrOptions: (keyof TSource & string) | SlottedDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
|
|
728
683
|
|
|
729
684
|
// @public
|
|
730
685
|
export class SlottedDirective extends NodeObservationDirective<SlottedDirectiveOptions> {
|
|
@@ -739,6 +694,15 @@ export class SlottedDirective extends NodeObservationDirective<SlottedDirectiveO
|
|
|
739
694
|
export interface SlottedDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, AssignedNodesOptions {
|
|
740
695
|
}
|
|
741
696
|
|
|
697
|
+
// @public
|
|
698
|
+
export const SourceLifetime: Readonly<{
|
|
699
|
+
readonly unknown: undefined;
|
|
700
|
+
readonly coupled: 1;
|
|
701
|
+
}>;
|
|
702
|
+
|
|
703
|
+
// @public
|
|
704
|
+
export type SourceLifetime = typeof SourceLifetime[keyof typeof SourceLifetime];
|
|
705
|
+
|
|
742
706
|
// @public
|
|
743
707
|
export class Splice {
|
|
744
708
|
constructor(index: number, removed: any[], addedCount: number);
|
|
@@ -782,16 +746,15 @@ export const SpliceStrategySupport: Readonly<{
|
|
|
782
746
|
export type SpliceStrategySupport = typeof SpliceStrategySupport[keyof typeof SpliceStrategySupport];
|
|
783
747
|
|
|
784
748
|
// @public
|
|
785
|
-
export abstract class StatelessAttachedAttributeDirective<
|
|
786
|
-
constructor(options:
|
|
787
|
-
abstract bind(
|
|
788
|
-
createBehavior(
|
|
749
|
+
export abstract class StatelessAttachedAttributeDirective<TOptions> implements HTMLDirective, ViewBehaviorFactory, ViewBehavior {
|
|
750
|
+
constructor(options: TOptions);
|
|
751
|
+
abstract bind(controller: ViewController): void;
|
|
752
|
+
createBehavior(): ViewBehavior;
|
|
789
753
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
790
754
|
id: string;
|
|
791
755
|
nodeId: string;
|
|
792
756
|
// (undocumented)
|
|
793
|
-
protected options:
|
|
794
|
-
abstract unbind(source: any, context: ExecutionContext, targets: ViewBehaviorTargets): void;
|
|
757
|
+
protected options: TOptions;
|
|
795
758
|
}
|
|
796
759
|
|
|
797
760
|
// @public
|
|
@@ -801,7 +764,7 @@ export interface StyleStrategy {
|
|
|
801
764
|
}
|
|
802
765
|
|
|
803
766
|
// @public
|
|
804
|
-
export interface StyleTarget {
|
|
767
|
+
export interface StyleTarget extends Pick<Node, "getRootNode"> {
|
|
805
768
|
adoptedStyleSheets?: CSSStyleSheet[];
|
|
806
769
|
append(styles: HTMLStyleElement): void;
|
|
807
770
|
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
|
|
@@ -830,7 +793,7 @@ export interface SubtreeDirectiveOptions<T = any> extends NodeBehaviorOptions<T>
|
|
|
830
793
|
}
|
|
831
794
|
|
|
832
795
|
// @public
|
|
833
|
-
export interface SyntheticView<TSource = any, TParent = any
|
|
796
|
+
export interface SyntheticView<TSource = any, TParent = any> extends View<TSource, TParent> {
|
|
834
797
|
readonly firstChild: Node;
|
|
835
798
|
insertBefore(node: Node): void;
|
|
836
799
|
readonly lastChild: Node;
|
|
@@ -838,14 +801,12 @@ export interface SyntheticView<TSource = any, TParent = any, TContext extends Ex
|
|
|
838
801
|
}
|
|
839
802
|
|
|
840
803
|
// @public
|
|
841
|
-
export interface SyntheticViewTemplate<TSource = any, TParent = any
|
|
842
|
-
create(): SyntheticView<TSource, TParent
|
|
843
|
-
// (undocumented)
|
|
844
|
-
type: "synthetic";
|
|
804
|
+
export interface SyntheticViewTemplate<TSource = any, TParent = any> {
|
|
805
|
+
create(): SyntheticView<TSource, TParent>;
|
|
845
806
|
}
|
|
846
807
|
|
|
847
808
|
// @public
|
|
848
|
-
export type TemplateValue<TSource, TParent = any
|
|
809
|
+
export type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource, TParent>;
|
|
849
810
|
|
|
850
811
|
// @public
|
|
851
812
|
export type TrustedTypes = {
|
|
@@ -857,23 +818,6 @@ export type TrustedTypesPolicy = {
|
|
|
857
818
|
createHTML(html: string): string;
|
|
858
819
|
};
|
|
859
820
|
|
|
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
821
|
// Warning: (ae-internal-missing-underscore) The name "TypeDefinition" should be prefixed with an underscore because the declaration is marked as @internal
|
|
878
822
|
//
|
|
879
823
|
// @internal
|
|
@@ -894,18 +838,6 @@ export interface TypeRegistry<TDefinition extends TypeDefinition> {
|
|
|
894
838
|
register(definition: TDefinition): boolean;
|
|
895
839
|
}
|
|
896
840
|
|
|
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
841
|
// @public
|
|
910
842
|
export interface UpdateQueue {
|
|
911
843
|
enqueue(callable: Callable): void;
|
|
@@ -917,14 +849,6 @@ export interface UpdateQueue {
|
|
|
917
849
|
// @public
|
|
918
850
|
export const Updates: UpdateQueue;
|
|
919
851
|
|
|
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
852
|
// @public
|
|
929
853
|
export interface ValueConverter {
|
|
930
854
|
fromView(value: any): any;
|
|
@@ -932,46 +856,68 @@ export interface ValueConverter {
|
|
|
932
856
|
}
|
|
933
857
|
|
|
934
858
|
// @public
|
|
935
|
-
export interface View<TSource = any, TParent = any
|
|
936
|
-
bind(source: TSource, context
|
|
937
|
-
readonly context:
|
|
859
|
+
export interface View<TSource = any, TParent = any> extends Disposable {
|
|
860
|
+
bind(source: TSource, context?: ExecutionContext<TParent>): void;
|
|
861
|
+
readonly context: ExecutionContext<TParent>;
|
|
938
862
|
readonly source: TSource | null;
|
|
939
863
|
unbind(): void;
|
|
940
864
|
}
|
|
941
865
|
|
|
942
866
|
// @public
|
|
943
867
|
export interface ViewBehavior<TSource = any, TParent = any> {
|
|
944
|
-
bind(
|
|
945
|
-
unbind(source: TSource, context: ExecutionContext<TParent>, targets: ViewBehaviorTargets): void;
|
|
868
|
+
bind(controller: ViewController<TSource, TParent>): void;
|
|
946
869
|
}
|
|
947
870
|
|
|
948
871
|
// @public
|
|
949
872
|
export interface ViewBehaviorFactory {
|
|
950
|
-
createBehavior(
|
|
873
|
+
createBehavior(): ViewBehavior;
|
|
951
874
|
id: string;
|
|
952
875
|
nodeId: string;
|
|
953
876
|
}
|
|
954
877
|
|
|
878
|
+
// @public
|
|
879
|
+
export interface ViewBehaviorOrchestrator<TSource = any, TParent = any> extends ViewController<TSource, TParent>, HostBehavior<TSource> {
|
|
880
|
+
addBehavior(behavior: ViewBehavior): void;
|
|
881
|
+
addBehaviorFactory(factory: ViewBehaviorFactory, target: Node): void;
|
|
882
|
+
// (undocumented)
|
|
883
|
+
addTarget(nodeId: string, target: Node): void;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
// @public
|
|
887
|
+
export const ViewBehaviorOrchestrator: Readonly<{
|
|
888
|
+
create<TSource = any, TParent = any>(source: TSource): ViewBehaviorOrchestrator<TSource, TParent>;
|
|
889
|
+
}>;
|
|
890
|
+
|
|
955
891
|
// @public
|
|
956
892
|
export type ViewBehaviorTargets = {
|
|
957
893
|
[id: string]: Node;
|
|
958
894
|
};
|
|
959
895
|
|
|
960
896
|
// @public
|
|
961
|
-
export
|
|
897
|
+
export interface ViewController<TSource = any, TParent = any> extends ExpressionController<TSource, TParent> {
|
|
898
|
+
readonly targets: ViewBehaviorTargets;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
// @public
|
|
902
|
+
export class ViewTemplate<TSource = any, TParent = any> implements ElementViewTemplate<TSource, TParent>, SyntheticViewTemplate<TSource, TParent> {
|
|
962
903
|
constructor(html: string | HTMLTemplateElement, factories: Record<string, ViewBehaviorFactory>);
|
|
963
|
-
create(hostBindingTarget?: Element): HTMLView<TSource, TParent
|
|
904
|
+
create(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
964
905
|
readonly factories: Record<string, ViewBehaviorFactory>;
|
|
965
906
|
readonly html: string | HTMLTemplateElement;
|
|
966
|
-
render(source: TSource, host: Node, hostBindingTarget?: Element
|
|
967
|
-
type: any;
|
|
907
|
+
render(source: TSource, host: Node, hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
968
908
|
}
|
|
969
909
|
|
|
970
910
|
// @public
|
|
971
911
|
export function volatile(target: {}, name: string | Accessor, descriptor: PropertyDescriptor): PropertyDescriptor;
|
|
972
912
|
|
|
973
913
|
// @public
|
|
974
|
-
export function when<TSource = any, TReturn = any>(
|
|
914
|
+
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>;
|
|
915
|
+
|
|
916
|
+
// Warnings were encountered during analysis:
|
|
917
|
+
//
|
|
918
|
+
// 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
|
|
919
|
+
// 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
|
|
920
|
+
// 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
921
|
|
|
976
922
|
// (No @packageDocumentation comment for this package)
|
|
977
923
|
|