@microsoft/fast-element 1.10.5 → 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/.eslintrc.json +1 -12
- package/CHANGELOG.json +629 -6
- package/CHANGELOG.md +152 -5
- package/dist/dts/components/attributes.d.ts +14 -1
- package/dist/dts/components/{controller.d.ts → element-controller.d.ts} +32 -32
- package/dist/dts/components/fast-definitions.d.ts +51 -11
- package/dist/dts/components/fast-element.d.ts +18 -23
- package/dist/dts/context.d.ts +157 -0
- package/dist/{esm/observation/behavior.js → dts/debug.d.ts} +0 -0
- package/dist/dts/di/di.d.ts +899 -0
- package/dist/dts/index.d.ts +17 -16
- package/dist/dts/index.debug.d.ts +2 -0
- package/dist/dts/index.rollup.d.ts +2 -0
- package/dist/dts/index.rollup.debug.d.ts +3 -0
- package/dist/dts/interfaces.d.ts +176 -0
- package/dist/dts/metadata.d.ts +25 -0
- package/dist/dts/observation/arrays.d.ts +207 -0
- package/dist/dts/observation/notifier.d.ts +18 -18
- package/dist/dts/observation/observable.d.ts +117 -34
- package/dist/dts/observation/update-queue.d.ts +40 -0
- package/dist/dts/pending-task.d.ts +20 -0
- package/dist/dts/platform.d.ts +23 -66
- package/dist/dts/polyfills.d.ts +8 -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 +44 -6
- package/dist/dts/styles/css.d.ts +19 -3
- package/dist/dts/styles/element-styles.d.ts +49 -63
- 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 +101 -70
- package/dist/dts/templating/children.d.ts +18 -15
- package/dist/dts/templating/compiler.d.ts +46 -28
- package/dist/dts/templating/dom.d.ts +41 -0
- package/dist/dts/templating/html-directive.d.ts +239 -45
- package/dist/dts/templating/markup.d.ts +48 -0
- package/dist/dts/templating/node-observation.d.ts +45 -30
- package/dist/dts/templating/ref.d.ts +6 -20
- package/dist/dts/templating/render.d.ts +272 -0
- package/dist/dts/templating/repeat.d.ts +36 -33
- package/dist/dts/templating/slotted.d.ts +13 -14
- package/dist/dts/templating/template.d.ts +28 -22
- package/dist/dts/templating/view.d.ts +82 -24
- 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} +1 -1
- package/dist/dts/utilities.d.ts +22 -0
- package/dist/esm/components/attributes.js +38 -28
- package/dist/esm/components/{controller.js → element-controller.js} +150 -140
- package/dist/esm/components/fast-definitions.js +48 -46
- package/dist/esm/components/fast-element.js +31 -12
- package/dist/esm/context.js +163 -0
- package/dist/esm/debug.js +61 -0
- package/dist/esm/di/di.js +1435 -0
- package/dist/esm/index.debug.js +2 -0
- package/dist/esm/index.js +20 -14
- package/dist/esm/index.rollup.debug.js +3 -0
- package/dist/esm/index.rollup.js +2 -0
- package/dist/esm/interfaces.js +12 -1
- package/dist/esm/metadata.js +60 -0
- package/dist/esm/observation/arrays.js +570 -0
- package/dist/esm/observation/notifier.js +27 -35
- package/dist/esm/observation/observable.js +116 -149
- package/dist/esm/observation/update-queue.js +67 -0
- package/dist/esm/pending-task.js +16 -0
- package/dist/esm/platform.js +60 -42
- package/dist/esm/polyfills.js +85 -0
- 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-directive.js +29 -13
- package/dist/esm/styles/css.js +29 -42
- package/dist/esm/styles/element-styles.js +79 -104
- package/dist/esm/styles/host.js +1 -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 +189 -159
- package/dist/esm/templating/children.js +33 -23
- package/dist/esm/templating/compiler.js +258 -152
- package/dist/esm/templating/dom.js +49 -0
- package/dist/esm/templating/html-directive.js +193 -36
- package/dist/esm/templating/markup.js +75 -0
- package/dist/esm/templating/node-observation.js +51 -45
- package/dist/esm/templating/ref.js +8 -25
- package/dist/esm/templating/render.js +391 -0
- package/dist/esm/templating/repeat.js +83 -79
- package/dist/esm/templating/slotted.js +23 -20
- package/dist/esm/templating/template.js +51 -93
- package/dist/esm/templating/view.js +125 -46
- package/dist/esm/templating/when.js +6 -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 +44 -0
- package/dist/fast-element.api.json +12153 -5373
- package/dist/fast-element.d.ts +1448 -696
- package/dist/fast-element.debug.js +4107 -0
- package/dist/fast-element.debug.min.js +1 -0
- package/dist/fast-element.js +3817 -4029
- package/dist/fast-element.min.js +1 -1
- package/dist/fast-element.untrimmed.d.ts +2814 -0
- package/docs/api-report.md +567 -254
- package/docs/fast-element-2-changes.md +15 -0
- package/karma.conf.cjs +6 -17
- package/package.json +76 -15
- package/dist/dts/dom.d.ts +0 -112
- package/dist/dts/observation/array-change-records.d.ts +0 -48
- package/dist/dts/observation/array-observer.d.ts +0 -9
- package/dist/dts/observation/behavior.d.ts +0 -19
- package/dist/esm/dom.js +0 -207
- package/dist/esm/observation/array-change-records.js +0 -326
- package/dist/esm/observation/array-observer.js +0 -177
package/docs/api-report.md
CHANGED
|
@@ -4,9 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
|
-
// @public
|
|
8
|
-
export const $global: Global;
|
|
9
|
-
|
|
10
7
|
// @public
|
|
11
8
|
export interface Accessor {
|
|
12
9
|
getValue(source: any): any;
|
|
@@ -15,14 +12,60 @@ export interface Accessor {
|
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
// @public
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
export type AddBehavior = (behavior: HostBehavior<HTMLElement>) => void;
|
|
16
|
+
|
|
17
|
+
// @public
|
|
18
|
+
export type AddViewBehaviorFactory = (factory: ViewBehaviorFactory) => string;
|
|
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
|
+
// @public
|
|
34
|
+
export interface ArrayObserver extends SubscriberSet {
|
|
35
|
+
addSplice(splice: Splice): void;
|
|
36
|
+
flush(): void;
|
|
37
|
+
readonly lengthObserver: LengthObserver;
|
|
38
|
+
reset(oldCollection: any[] | undefined): void;
|
|
39
|
+
strategy: SpliceStrategy | null;
|
|
22
40
|
}
|
|
23
41
|
|
|
24
42
|
// @public
|
|
25
|
-
export
|
|
43
|
+
export const ArrayObserver: Readonly<{
|
|
44
|
+
readonly enable: () => void;
|
|
45
|
+
}>;
|
|
46
|
+
|
|
47
|
+
// @public
|
|
48
|
+
export const Aspect: Readonly<{
|
|
49
|
+
readonly none: 0;
|
|
50
|
+
readonly attribute: 1;
|
|
51
|
+
readonly booleanAttribute: 2;
|
|
52
|
+
readonly property: 3;
|
|
53
|
+
readonly content: 4;
|
|
54
|
+
readonly tokenList: 5;
|
|
55
|
+
readonly event: 6;
|
|
56
|
+
readonly assign: (directive: Aspected, value?: string) => void;
|
|
57
|
+
}>;
|
|
58
|
+
|
|
59
|
+
// @public
|
|
60
|
+
export type Aspect = typeof Aspect[Exclude<keyof typeof Aspect, "assign" | "none">];
|
|
61
|
+
|
|
62
|
+
// @public
|
|
63
|
+
export interface Aspected {
|
|
64
|
+
aspectType: Aspect;
|
|
65
|
+
dataBinding?: Binding;
|
|
66
|
+
sourceAspect: string;
|
|
67
|
+
targetAspect: string;
|
|
68
|
+
}
|
|
26
69
|
|
|
27
70
|
// @public
|
|
28
71
|
export function attr(config?: DecoratorAttributeConfiguration): (target: {}, property: string) => void;
|
|
@@ -38,6 +81,11 @@ export type AttributeConfiguration = {
|
|
|
38
81
|
converter?: ValueConverter;
|
|
39
82
|
};
|
|
40
83
|
|
|
84
|
+
// @public
|
|
85
|
+
export const AttributeConfiguration: Readonly<{
|
|
86
|
+
locate: (target: {}) => AttributeConfiguration[];
|
|
87
|
+
}>;
|
|
88
|
+
|
|
41
89
|
// @public
|
|
42
90
|
export class AttributeDefinition implements Accessor {
|
|
43
91
|
constructor(Owner: Function, name: string, attribute?: string, mode?: AttributeMode, converter?: ValueConverter);
|
|
@@ -54,58 +102,24 @@ export class AttributeDefinition implements Accessor {
|
|
|
54
102
|
setValue(source: HTMLElement, newValue: any): void;
|
|
55
103
|
}
|
|
56
104
|
|
|
105
|
+
// Warning: (ae-forgotten-export) The symbol "reflectMode" needs to be exported by the entry point index.d.ts
|
|
106
|
+
// Warning: (ae-forgotten-export) The symbol "booleanMode" needs to be exported by the entry point index.d.ts
|
|
107
|
+
//
|
|
57
108
|
// @public
|
|
58
|
-
export type AttributeMode =
|
|
59
|
-
|
|
60
|
-
// @public
|
|
61
|
-
export interface Behavior {
|
|
62
|
-
bind(source: unknown, context: ExecutionContext): void;
|
|
63
|
-
unbind(source: unknown): void;
|
|
64
|
-
}
|
|
109
|
+
export type AttributeMode = typeof reflectMode | typeof booleanMode | "fromView";
|
|
65
110
|
|
|
66
111
|
// @public
|
|
67
|
-
export
|
|
112
|
+
export function bind<T = any>(binding: Expression<T>, isVolatile?: boolean): Binding<T>;
|
|
68
113
|
|
|
69
114
|
// @public
|
|
70
|
-
export class
|
|
71
|
-
constructor(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
// @internal (undocumented)
|
|
79
|
-
classVersions: Record<string, number>;
|
|
80
|
-
// @internal (undocumented)
|
|
81
|
-
context: ExecutionContext | null;
|
|
82
|
-
// @internal (undocumented)
|
|
83
|
-
handleChange(): void;
|
|
84
|
-
// @internal (undocumented)
|
|
85
|
-
handleEvent(event: Event): void;
|
|
86
|
-
// @internal (undocumented)
|
|
87
|
-
isBindingVolatile: boolean;
|
|
88
|
-
// @internal (undocumented)
|
|
89
|
-
source: unknown;
|
|
90
|
-
// @internal (undocumented)
|
|
91
|
-
target: any;
|
|
92
|
-
// @internal (undocumented)
|
|
93
|
-
targetName?: string;
|
|
94
|
-
// Warning: (ae-forgotten-export) The symbol "normalUnbind" needs to be exported by the entry point index.d.ts
|
|
95
|
-
unbind: typeof normalUnbind;
|
|
96
|
-
// Warning: (ae-forgotten-export) The symbol "updatePropertyTarget" needs to be exported by the entry point index.d.ts
|
|
97
|
-
//
|
|
98
|
-
// @internal (undocumented)
|
|
99
|
-
updateTarget: typeof updatePropertyTarget;
|
|
100
|
-
// @internal (undocumented)
|
|
101
|
-
version: number;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// @public
|
|
105
|
-
export interface BindingObserver<TSource = any, TReturn = any, TParent = any> extends Notifier {
|
|
106
|
-
disconnect(): void;
|
|
107
|
-
observe(source: TSource, context: ExecutionContext<TParent>): TReturn;
|
|
108
|
-
records(): IterableIterator<ObservationRecord>;
|
|
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;
|
|
109
123
|
}
|
|
110
124
|
|
|
111
125
|
// @public
|
|
@@ -117,41 +131,39 @@ export type Callable = typeof Function.prototype.call | {
|
|
|
117
131
|
};
|
|
118
132
|
|
|
119
133
|
// @public
|
|
120
|
-
export interface CaptureType<TSource> {
|
|
134
|
+
export interface CaptureType<TSource, TParent> {
|
|
121
135
|
}
|
|
122
136
|
|
|
123
137
|
// @public
|
|
124
|
-
export interface
|
|
138
|
+
export interface ChildListDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, Omit<MutationObserverInit, "subtree" | "childList"> {
|
|
125
139
|
}
|
|
126
140
|
|
|
127
141
|
// @public
|
|
128
|
-
export function children<
|
|
142
|
+
export function children<TSource = any, TParent = any>(propertyOrOptions: (keyof TSource & string) | ChildrenDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
|
|
129
143
|
|
|
130
|
-
// Warning: (ae-forgotten-export) The symbol "NodeObservationBehavior" needs to be exported by the entry point index.d.ts
|
|
131
|
-
//
|
|
132
144
|
// @public
|
|
133
|
-
export class
|
|
134
|
-
constructor(
|
|
135
|
-
disconnect(): void;
|
|
136
|
-
|
|
137
|
-
observe(): void;
|
|
145
|
+
export class ChildrenDirective extends NodeObservationDirective<ChildrenDirectiveOptions> {
|
|
146
|
+
constructor(options: ChildrenDirectiveOptions);
|
|
147
|
+
disconnect(target: any): void;
|
|
148
|
+
getNodes(target: Element): Node[];
|
|
149
|
+
observe(target: any): void;
|
|
138
150
|
}
|
|
139
151
|
|
|
140
152
|
// @public
|
|
141
|
-
export type
|
|
153
|
+
export type ChildrenDirectiveOptions<T = any> = ChildListDirectiveOptions<T> | SubtreeDirectiveOptions<T>;
|
|
142
154
|
|
|
143
|
-
// @
|
|
144
|
-
export
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
targetOffset: number;
|
|
148
|
-
viewBehaviorFactories: NodeBehaviorFactory[];
|
|
149
|
-
}
|
|
155
|
+
// @public
|
|
156
|
+
export type CompilationStrategy = (
|
|
157
|
+
html: string | HTMLTemplateElement,
|
|
158
|
+
factories: Record<string, ViewBehaviorFactory>) => HTMLTemplateCompilationResult;
|
|
150
159
|
|
|
151
|
-
// Warning: (ae-incompatible-release-tags) The symbol "compileTemplate" is marked as @public, but its signature references "CompilationResult" which is marked as @beta
|
|
152
|
-
//
|
|
153
160
|
// @public
|
|
154
|
-
export
|
|
161
|
+
export const Compiler: {
|
|
162
|
+
setHTMLPolicy(policy: TrustedTypesPolicy): void;
|
|
163
|
+
compile<TSource = any, TParent = any>(html: string | HTMLTemplateElement, directives: Record<string, ViewBehaviorFactory>): HTMLTemplateCompilationResult<TSource, TParent>;
|
|
164
|
+
setDefaultStrategy(strategy: CompilationStrategy): void;
|
|
165
|
+
aggregate(parts: (string | ViewBehaviorFactory)[]): ViewBehaviorFactory;
|
|
166
|
+
};
|
|
155
167
|
|
|
156
168
|
// @public
|
|
157
169
|
export type ComposableStyles = string | ElementStyles | CSSStyleSheet;
|
|
@@ -162,126 +174,196 @@ export type Constructable<T = {}> = {
|
|
|
162
174
|
};
|
|
163
175
|
|
|
164
176
|
// @public
|
|
165
|
-
export
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
get template(): ElementViewTemplate | null;
|
|
183
|
-
set template(value: ElementViewTemplate | null);
|
|
184
|
-
readonly view: ElementView | null;
|
|
177
|
+
export type ConstructibleStyleStrategy = {
|
|
178
|
+
new (styles: (string | CSSStyleSheet)[]): StyleStrategy;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
// @public
|
|
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;
|
|
185
194
|
}
|
|
186
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
|
+
|
|
201
|
+
// Warning: (ae-internal-missing-underscore) The name "createTypeRegistry" should be prefixed with an underscore because the declaration is marked as @internal
|
|
202
|
+
//
|
|
203
|
+
// @internal
|
|
204
|
+
export function createTypeRegistry<TDefinition extends TypeDefinition>(): TypeRegistry<TDefinition>;
|
|
205
|
+
|
|
187
206
|
// @public
|
|
188
|
-
export
|
|
207
|
+
export const css: CSSTemplateTag;
|
|
189
208
|
|
|
190
209
|
// @public
|
|
191
|
-
export
|
|
192
|
-
|
|
193
|
-
createCSS(): ComposableStyles;
|
|
210
|
+
export interface CSSDirective {
|
|
211
|
+
createCSS(add: AddBehavior): ComposableStyles;
|
|
194
212
|
}
|
|
195
213
|
|
|
196
214
|
// @public
|
|
197
|
-
export
|
|
215
|
+
export const CSSDirective: Readonly<{
|
|
216
|
+
getForInstance: (object: any) => CSSDirectiveDefinition<Constructable<CSSDirective>> | undefined;
|
|
217
|
+
getByType: (key: Function) => CSSDirectiveDefinition<Constructable<CSSDirective>> | undefined;
|
|
218
|
+
define<TType extends Constructable<CSSDirective>>(type: any): TType;
|
|
219
|
+
}>;
|
|
220
|
+
|
|
221
|
+
// @public
|
|
222
|
+
export function cssDirective(): (type: Constructable<CSSDirective>) => void;
|
|
198
223
|
|
|
199
224
|
// @public
|
|
200
|
-
export
|
|
225
|
+
export interface CSSDirectiveDefinition<TType extends Constructable<CSSDirective> = Constructable<CSSDirective>> {
|
|
226
|
+
readonly type: TType;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// @public @deprecated (undocumented)
|
|
230
|
+
export const cssPartial: (strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]) => CSSDirective;
|
|
231
|
+
|
|
232
|
+
// @public
|
|
233
|
+
export type CSSTemplateTag = ((strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]) => ElementStyles) & {
|
|
234
|
+
partial(strings: TemplateStringsArray, ...values: (ComposableStyles | CSSDirective)[]): CSSDirective;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
// @public
|
|
238
|
+
export function customElement(nameOrDef: string | PartialFASTElementDefinition): (type: Constructable<HTMLElement>) => void;
|
|
201
239
|
|
|
202
240
|
// @public
|
|
203
241
|
export type DecoratorAttributeConfiguration = Omit<AttributeConfiguration, "property">;
|
|
204
242
|
|
|
205
243
|
// @public
|
|
206
|
-
export
|
|
244
|
+
export interface Disposable {
|
|
245
|
+
dispose(): void;
|
|
246
|
+
}
|
|
207
247
|
|
|
208
248
|
// @public
|
|
209
249
|
export const DOM: Readonly<{
|
|
210
|
-
supportsAdoptedStyleSheets: boolean;
|
|
211
|
-
setHTMLPolicy(policy: TrustedTypesPolicy): void;
|
|
212
|
-
createHTML(html: string): string;
|
|
213
|
-
isMarker(node: Node): node is Comment;
|
|
214
|
-
extractDirectiveIndexFromMarker(node: Comment): number;
|
|
215
|
-
createInterpolationPlaceholder(index: number): string;
|
|
216
|
-
createCustomAttributePlaceholder(attributeName: string, index: number): string;
|
|
217
|
-
createBlockPlaceholder(index: number): string;
|
|
218
250
|
queueUpdate: (callable: Callable) => void;
|
|
251
|
+
nextUpdate: () => Promise<void>;
|
|
219
252
|
processUpdates: () => void;
|
|
220
|
-
nextUpdate(): Promise<void>;
|
|
221
253
|
setAttribute(element: HTMLElement, attributeName: string, value: any): void;
|
|
222
254
|
setBooleanAttribute(element: HTMLElement, attributeName: string, value: boolean): void;
|
|
223
|
-
removeChildNodes(parent: Node): void;
|
|
224
|
-
createTemplateWalker(fragment: DocumentFragment): TreeWalker;
|
|
225
255
|
}>;
|
|
226
256
|
|
|
227
257
|
// @public
|
|
228
|
-
export
|
|
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
|
+
}
|
|
229
279
|
|
|
230
280
|
// @public
|
|
231
|
-
export
|
|
281
|
+
export const elements: (selector?: string) => ElementsFilter;
|
|
232
282
|
|
|
233
283
|
// @public
|
|
234
|
-
export type
|
|
284
|
+
export type ElementsFilter = (value: Node, index?: number, array?: Node[]) => boolean;
|
|
235
285
|
|
|
236
286
|
// @public
|
|
237
|
-
export
|
|
287
|
+
export class ElementStyles {
|
|
288
|
+
constructor(styles: ReadonlyArray<ComposableStyles>);
|
|
238
289
|
// @internal (undocumented)
|
|
239
290
|
addStylesTo(target: StyleTarget): void;
|
|
240
|
-
|
|
241
|
-
abstract readonly behaviors: ReadonlyArray<Behavior> | null;
|
|
242
|
-
static readonly create: ElementStyleFactory;
|
|
291
|
+
readonly behaviors: ReadonlyArray<HostBehavior<HTMLElement>> | null;
|
|
243
292
|
// @internal (undocumented)
|
|
244
293
|
isAttachedTo(target: StyleTarget): boolean;
|
|
294
|
+
static normalize(styles: ComposableStyles | ComposableStyles[] | undefined): ElementStyles | undefined;
|
|
245
295
|
// @internal (undocumented)
|
|
246
296
|
removeStylesFrom(target: StyleTarget): void;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
297
|
+
static setDefaultStrategy(Strategy: ConstructibleStyleStrategy): void;
|
|
298
|
+
get strategy(): StyleStrategy;
|
|
299
|
+
// (undocumented)
|
|
300
|
+
readonly styles: ReadonlyArray<ComposableStyles>;
|
|
301
|
+
static readonly supportsAdoptedStyleSheets: boolean;
|
|
302
|
+
withBehaviors(...behaviors: HostBehavior<HTMLElement>[]): this;
|
|
303
|
+
withStrategy(Strategy: ConstructibleStyleStrategy): this;
|
|
250
304
|
}
|
|
251
305
|
|
|
252
306
|
// @public
|
|
253
|
-
export interface ElementView extends View {
|
|
307
|
+
export interface ElementView<TSource = any, TParent = any> extends View<TSource, TParent> {
|
|
254
308
|
appendTo(node: Node): void;
|
|
255
309
|
}
|
|
256
310
|
|
|
257
311
|
// @public
|
|
258
|
-
export interface ElementViewTemplate {
|
|
259
|
-
create(hostBindingTarget: Element): ElementView
|
|
260
|
-
render(source:
|
|
312
|
+
export interface ElementViewTemplate<TSource = any, TParent = any> {
|
|
313
|
+
create(hostBindingTarget: Element): ElementView<TSource, TParent>;
|
|
314
|
+
render(source: TSource, host: Node, hostBindingTarget?: Element): ElementView<TSource, TParent>;
|
|
261
315
|
}
|
|
262
316
|
|
|
263
|
-
// Warning: (ae-internal-missing-underscore) The name "emptyArray" should be prefixed with an underscore because the declaration is marked as @internal
|
|
264
|
-
//
|
|
265
|
-
// @internal
|
|
266
|
-
export const emptyArray: readonly never[];
|
|
267
|
-
|
|
268
317
|
// @public
|
|
269
|
-
export
|
|
318
|
+
export const emptyArray: readonly never[];
|
|
270
319
|
|
|
271
320
|
// @public
|
|
272
|
-
export
|
|
273
|
-
|
|
321
|
+
export interface ExecutionContext<TParent = any> {
|
|
322
|
+
readonly event: Event;
|
|
323
|
+
eventDetail<TDetail>(): TDetail;
|
|
324
|
+
eventTarget<TTarget extends EventTarget>(): TTarget;
|
|
274
325
|
index: number;
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
326
|
+
readonly isEven: boolean;
|
|
327
|
+
readonly isFirst: boolean;
|
|
328
|
+
readonly isInMiddle: boolean;
|
|
329
|
+
readonly isLast: boolean;
|
|
330
|
+
readonly isOdd: boolean;
|
|
280
331
|
length: number;
|
|
281
332
|
parent: TParent;
|
|
282
|
-
parentContext: ExecutionContext<
|
|
283
|
-
|
|
284
|
-
|
|
333
|
+
parentContext: ExecutionContext<TParent>;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// @public
|
|
337
|
+
export const ExecutionContext: Readonly<{
|
|
338
|
+
default: ExecutionContext<any>;
|
|
339
|
+
getEvent(): Event | null;
|
|
340
|
+
setEvent(event: Event | null): void;
|
|
341
|
+
}>;
|
|
342
|
+
|
|
343
|
+
// @public
|
|
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;
|
|
285
367
|
}
|
|
286
368
|
|
|
287
369
|
// Warning: (ae-internal-missing-underscore) The name "FAST" should be prefixed with an underscore because the declaration is marked as @internal
|
|
@@ -290,35 +372,38 @@ export class ExecutionContext<TParent = any, TGrandparent = any> {
|
|
|
290
372
|
export const FAST: FASTGlobal;
|
|
291
373
|
|
|
292
374
|
// @public
|
|
293
|
-
export interface FASTElement {
|
|
375
|
+
export interface FASTElement extends HTMLElement {
|
|
294
376
|
$emit(type: string, detail?: any, options?: Omit<CustomEventInit, "detail">): boolean | void;
|
|
295
|
-
readonly $fastController:
|
|
296
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
377
|
+
readonly $fastController: ElementController;
|
|
378
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
297
379
|
connectedCallback(): void;
|
|
298
380
|
disconnectedCallback(): void;
|
|
299
381
|
}
|
|
300
382
|
|
|
301
383
|
// @public
|
|
302
|
-
export const FASTElement:
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
define<TType extends Function>(type: TType, nameOrDef?: string | PartialFASTElementDefinition | undefined): TType;
|
|
384
|
+
export const FASTElement: {
|
|
385
|
+
new (): FASTElement;
|
|
386
|
+
define: typeof define;
|
|
387
|
+
compose: typeof compose;
|
|
388
|
+
from: typeof from;
|
|
308
389
|
};
|
|
309
390
|
|
|
310
391
|
// @public
|
|
311
|
-
export class FASTElementDefinition<TType extends
|
|
312
|
-
constructor(type: TType, nameOrConfig?: PartialFASTElementDefinition | string);
|
|
392
|
+
export class FASTElementDefinition<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> {
|
|
313
393
|
readonly attributeLookup: Record<string, AttributeDefinition>;
|
|
314
394
|
readonly attributes: ReadonlyArray<AttributeDefinition>;
|
|
395
|
+
static compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
|
|
315
396
|
define(registry?: CustomElementRegistry): this;
|
|
316
|
-
readonly elementOptions
|
|
317
|
-
static readonly
|
|
397
|
+
readonly elementOptions: ElementDefinitionOptions;
|
|
398
|
+
static readonly getByType: (key: Function) => FASTElementDefinition<Constructable<HTMLElement>> | undefined;
|
|
399
|
+
static readonly getForInstance: (object: any) => FASTElementDefinition<Constructable<HTMLElement>> | undefined;
|
|
318
400
|
get isDefined(): boolean;
|
|
319
401
|
readonly name: string;
|
|
320
402
|
readonly propertyLookup: Record<string, AttributeDefinition>;
|
|
321
|
-
|
|
403
|
+
// @internal
|
|
404
|
+
static registerBaseType(type: Function): void;
|
|
405
|
+
readonly registry: CustomElementRegistry;
|
|
406
|
+
readonly shadowOptions?: ShadowRootOptions;
|
|
322
407
|
readonly styles?: ElementStyles;
|
|
323
408
|
readonly template?: ElementViewTemplate;
|
|
324
409
|
readonly type: TType;
|
|
@@ -328,69 +413,144 @@ export class FASTElementDefinition<TType extends Function = Function> {
|
|
|
328
413
|
//
|
|
329
414
|
// @internal
|
|
330
415
|
export interface FASTGlobal {
|
|
416
|
+
addMessages(messages: Record<number, string>): void;
|
|
417
|
+
error(code: number, values?: Record<string, any>): Error;
|
|
331
418
|
getById<T>(id: string | number): T | null;
|
|
332
419
|
// (undocumented)
|
|
333
420
|
getById<T>(id: string | number, initialize: () => T): T;
|
|
334
421
|
readonly versions: string[];
|
|
422
|
+
warn(code: number, values?: Record<string, any>): void;
|
|
335
423
|
}
|
|
336
424
|
|
|
337
425
|
// @public
|
|
338
|
-
export
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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
|
+
}
|
|
432
|
+
|
|
433
|
+
// @public
|
|
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
|
+
}
|
|
342
443
|
|
|
343
444
|
// @public
|
|
344
445
|
export function html<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: TemplateValue<TSource, TParent>[]): ViewTemplate<TSource, TParent>;
|
|
345
446
|
|
|
346
447
|
// @public
|
|
347
|
-
export class HTMLBindingDirective
|
|
348
|
-
constructor(
|
|
448
|
+
export class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, ViewBehavior, Aspected {
|
|
449
|
+
constructor(dataBinding: Binding);
|
|
450
|
+
aspectType: Aspect;
|
|
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;
|
|
460
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
349
461
|
// (undocumented)
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
462
|
+
dataBinding: Binding;
|
|
463
|
+
// @internal (undocumented)
|
|
464
|
+
handleChange(binding: Expression, observer: ExpressionObserver): void;
|
|
465
|
+
// @internal (undocumented)
|
|
466
|
+
handleEvent(event: Event): void;
|
|
467
|
+
id: string;
|
|
468
|
+
nodeId: string;
|
|
469
|
+
sourceAspect: string;
|
|
470
|
+
targetAspect: string;
|
|
471
|
+
// @internal (undocumented)
|
|
472
|
+
unbind(controller: ViewController): void;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
// @public
|
|
476
|
+
export interface HTMLDirective {
|
|
477
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// @public
|
|
481
|
+
export const HTMLDirective: Readonly<{
|
|
482
|
+
getForInstance: (object: any) => HTMLDirectiveDefinition<Constructable<HTMLDirective>> | undefined;
|
|
483
|
+
getByType: (key: Function) => HTMLDirectiveDefinition<Constructable<HTMLDirective>> | undefined;
|
|
484
|
+
define<TType extends Constructable<HTMLDirective>>(type: TType, options?: PartialHTMLDirectiveDefinition): TType;
|
|
485
|
+
}>;
|
|
486
|
+
|
|
487
|
+
// @public
|
|
488
|
+
export function htmlDirective(options?: PartialHTMLDirectiveDefinition): (type: Constructable<HTMLDirective>) => void;
|
|
489
|
+
|
|
490
|
+
// @public
|
|
491
|
+
export interface HTMLDirectiveDefinition<TType extends Constructable<HTMLDirective> = Constructable<HTMLDirective>> extends Required<PartialHTMLDirectiveDefinition> {
|
|
492
|
+
readonly type: TType;
|
|
355
493
|
}
|
|
356
494
|
|
|
357
495
|
// @public
|
|
358
|
-
export
|
|
359
|
-
|
|
360
|
-
abstract createPlaceholder(index: number): string;
|
|
361
|
-
targetIndex: number;
|
|
496
|
+
export interface HTMLTemplateCompilationResult<TSource = any, TParent = any> {
|
|
497
|
+
createView(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
362
498
|
}
|
|
363
499
|
|
|
364
500
|
// @public
|
|
365
|
-
export class HTMLView implements ElementView, SyntheticView {
|
|
366
|
-
constructor(fragment: DocumentFragment,
|
|
501
|
+
export class HTMLView<TSource = any, TParent = any> implements ElementView<TSource, TParent>, SyntheticView<TSource, TParent>, ExecutionContext<TParent> {
|
|
502
|
+
constructor(fragment: DocumentFragment, factories: ReadonlyArray<ViewBehaviorFactory>, targets: ViewBehaviorTargets);
|
|
367
503
|
appendTo(node: Node): void;
|
|
368
|
-
bind(source:
|
|
369
|
-
context: ExecutionContext
|
|
504
|
+
bind(source: TSource, context?: ExecutionContext<TParent>): void;
|
|
505
|
+
context: ExecutionContext<TParent>;
|
|
370
506
|
dispose(): void;
|
|
371
507
|
static disposeContiguousBatch(views: SyntheticView[]): void;
|
|
508
|
+
get event(): Event;
|
|
509
|
+
eventDetail<TDetail>(): TDetail;
|
|
510
|
+
eventTarget<TTarget extends EventTarget>(): TTarget;
|
|
372
511
|
firstChild: Node;
|
|
512
|
+
index: number;
|
|
373
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;
|
|
374
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>;
|
|
375
528
|
remove(): void;
|
|
376
|
-
source:
|
|
529
|
+
source: TSource | null;
|
|
530
|
+
readonly sourceLifetime: SourceLifetime;
|
|
531
|
+
// (undocumented)
|
|
532
|
+
readonly targets: ViewBehaviorTargets;
|
|
377
533
|
unbind(): void;
|
|
378
534
|
}
|
|
379
535
|
|
|
380
|
-
//
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
export const enum KernelServiceId {
|
|
384
|
-
// (undocumented)
|
|
385
|
-
contextEvent = 3,
|
|
386
|
-
// (undocumented)
|
|
387
|
-
elementRegistry = 4,
|
|
388
|
-
// (undocumented)
|
|
389
|
-
observable = 2,
|
|
390
|
-
// (undocumented)
|
|
391
|
-
updateQueue = 1
|
|
536
|
+
// @public
|
|
537
|
+
export interface LengthObserver extends Subscriber {
|
|
538
|
+
length: number;
|
|
392
539
|
}
|
|
393
540
|
|
|
541
|
+
// @public
|
|
542
|
+
export function lengthOf<T>(array: readonly T[]): number;
|
|
543
|
+
|
|
544
|
+
// @public
|
|
545
|
+
export function listener<T = any>(binding: Expression<T>, options?: AddEventListenerOptions): Binding<T>;
|
|
546
|
+
|
|
547
|
+
// @public
|
|
548
|
+
export const Markup: Readonly<{
|
|
549
|
+
interpolation: (id: string) => string;
|
|
550
|
+
attribute: (id: string) => string;
|
|
551
|
+
comment: (id: string) => string;
|
|
552
|
+
}>;
|
|
553
|
+
|
|
394
554
|
// Warning: (ae-internal-missing-underscore) The name "Mutable" should be prefixed with an underscore because the declaration is marked as @internal
|
|
395
555
|
//
|
|
396
556
|
// @internal
|
|
@@ -398,22 +558,31 @@ export type Mutable<T> = {
|
|
|
398
558
|
-readonly [P in keyof T]: T[P];
|
|
399
559
|
};
|
|
400
560
|
|
|
401
|
-
// @public
|
|
402
|
-
export interface NodeBehaviorFactory {
|
|
403
|
-
createBehavior(target: Node): Behavior;
|
|
404
|
-
targetIndex: number;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
561
|
// @public
|
|
408
562
|
export interface NodeBehaviorOptions<T = any> {
|
|
409
563
|
filter?: ElementsFilter;
|
|
410
564
|
property: T;
|
|
411
565
|
}
|
|
412
566
|
|
|
567
|
+
// @public
|
|
568
|
+
export abstract class NodeObservationDirective<T extends NodeBehaviorOptions> extends StatelessAttachedAttributeDirective<T> {
|
|
569
|
+
bind(controller: ViewController): void;
|
|
570
|
+
protected computeNodes(target: any): Node[];
|
|
571
|
+
protected abstract disconnect(target: any): void;
|
|
572
|
+
protected abstract getNodes(target: any): Node[];
|
|
573
|
+
protected getSource(target: Node): any;
|
|
574
|
+
protected abstract observe(target: any): void;
|
|
575
|
+
unbind(controller: ViewController): void;
|
|
576
|
+
protected updateTarget(source: any, value: ReadonlyArray<any>): void;
|
|
577
|
+
}
|
|
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
|
+
|
|
413
582
|
// @public
|
|
414
583
|
export interface Notifier {
|
|
415
584
|
notify(args: any): void;
|
|
416
|
-
readonly
|
|
585
|
+
readonly subject: any;
|
|
417
586
|
subscribe(subscriber: Subscriber, propertyToWatch?: any): void;
|
|
418
587
|
unsubscribe(subscriber: Subscriber, propertyToUnwatch?: any): void;
|
|
419
588
|
}
|
|
@@ -424,14 +593,14 @@ export const nullableNumberConverter: ValueConverter;
|
|
|
424
593
|
// @public
|
|
425
594
|
export const Observable: Readonly<{
|
|
426
595
|
setArrayObserverFactory(factory: (collection: any[]) => Notifier): void;
|
|
427
|
-
getNotifier: (source: any) =>
|
|
596
|
+
getNotifier: <T extends Notifier = Notifier>(source: any) => T;
|
|
428
597
|
track(source: unknown, propertyName: string): void;
|
|
429
598
|
trackVolatile(): void;
|
|
430
599
|
notify(source: unknown, args: any): void;
|
|
431
600
|
defineProperty(target: {}, nameOrAccessor: string | Accessor): void;
|
|
432
601
|
getAccessors: (target: {}) => Accessor[];
|
|
433
|
-
binding<TSource = any, TReturn = any
|
|
434
|
-
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;
|
|
435
604
|
}>;
|
|
436
605
|
|
|
437
606
|
// @public
|
|
@@ -443,54 +612,67 @@ export interface ObservationRecord {
|
|
|
443
612
|
propertySource: any;
|
|
444
613
|
}
|
|
445
614
|
|
|
615
|
+
// @public
|
|
616
|
+
export function oneTime<T = any>(binding: Expression<T>): Binding<T>;
|
|
617
|
+
|
|
618
|
+
// @public
|
|
619
|
+
export const Parser: Readonly<{
|
|
620
|
+
parse(value: string, factories: Record<string, ViewBehaviorFactory>): (string | ViewBehaviorFactory)[] | null;
|
|
621
|
+
}>;
|
|
622
|
+
|
|
446
623
|
// @public
|
|
447
624
|
export interface PartialFASTElementDefinition {
|
|
448
625
|
readonly attributes?: (AttributeConfiguration | string)[];
|
|
449
626
|
readonly elementOptions?: ElementDefinitionOptions;
|
|
450
627
|
readonly name: string;
|
|
451
|
-
readonly
|
|
628
|
+
readonly registry?: CustomElementRegistry;
|
|
629
|
+
readonly shadowOptions?: Partial<ShadowRootOptions> | null;
|
|
452
630
|
readonly styles?: ComposableStyles | ComposableStyles[];
|
|
453
631
|
readonly template?: ElementViewTemplate;
|
|
454
632
|
}
|
|
455
633
|
|
|
634
|
+
// @public
|
|
635
|
+
export interface PartialHTMLDirectiveDefinition {
|
|
636
|
+
aspected?: boolean;
|
|
637
|
+
}
|
|
638
|
+
|
|
456
639
|
// @public
|
|
457
640
|
export class PropertyChangeNotifier implements Notifier {
|
|
458
|
-
constructor(
|
|
641
|
+
constructor(subject: any);
|
|
459
642
|
notify(propertyName: string): void;
|
|
460
|
-
readonly
|
|
643
|
+
readonly subject: any;
|
|
461
644
|
subscribe(subscriber: Subscriber, propertyToWatch?: string): void;
|
|
462
645
|
unsubscribe(subscriber: Subscriber, propertyToUnwatch?: string): void;
|
|
463
646
|
}
|
|
464
647
|
|
|
465
648
|
// @public
|
|
466
|
-
export
|
|
649
|
+
export const ref: <TSource = any, TParent = any>(propertyName: keyof TSource & string) => CaptureType<TSource, TParent>;
|
|
467
650
|
|
|
468
651
|
// @public
|
|
469
|
-
export class
|
|
470
|
-
|
|
471
|
-
bind(source: any): void;
|
|
472
|
-
unbind(): void;
|
|
652
|
+
export class RefDirective extends StatelessAttachedAttributeDirective<string> {
|
|
653
|
+
bind(controller: ViewController): void;
|
|
473
654
|
}
|
|
474
655
|
|
|
475
656
|
// @public
|
|
476
|
-
export function repeat<TSource = any,
|
|
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>;
|
|
477
658
|
|
|
478
659
|
// @public
|
|
479
|
-
export class RepeatBehavior<TSource = any> implements
|
|
480
|
-
constructor(
|
|
481
|
-
bind(
|
|
482
|
-
|
|
483
|
-
handleChange(source: any, args: Splice[]): void;
|
|
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;
|
|
484
664
|
unbind(): void;
|
|
485
665
|
}
|
|
486
666
|
|
|
487
667
|
// @public
|
|
488
|
-
export class RepeatDirective<TSource = any>
|
|
489
|
-
constructor(
|
|
490
|
-
createBehavior(
|
|
491
|
-
|
|
668
|
+
export class RepeatDirective<TSource = any> implements HTMLDirective, ViewBehaviorFactory {
|
|
669
|
+
constructor(dataBinding: Binding<TSource>, templateBinding: Binding<TSource, SyntheticViewTemplate>, options: RepeatOptions);
|
|
670
|
+
createBehavior(): RepeatBehavior<TSource>;
|
|
671
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
492
672
|
// (undocumented)
|
|
493
|
-
readonly
|
|
673
|
+
readonly dataBinding: Binding<TSource>;
|
|
674
|
+
id: string;
|
|
675
|
+
nodeId: string;
|
|
494
676
|
// (undocumented)
|
|
495
677
|
readonly options: RepeatOptions;
|
|
496
678
|
// (undocumented)
|
|
@@ -504,61 +686,127 @@ export interface RepeatOptions {
|
|
|
504
686
|
}
|
|
505
687
|
|
|
506
688
|
// @public
|
|
507
|
-
export
|
|
689
|
+
export interface ShadowRootOptions extends ShadowRootInit {
|
|
690
|
+
// @beta
|
|
691
|
+
registry?: CustomElementRegistry;
|
|
692
|
+
}
|
|
508
693
|
|
|
509
694
|
// @public
|
|
510
|
-
export
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
695
|
+
export function slotted<TSource = any, TParent = any>(propertyOrOptions: (keyof TSource & string) | SlottedDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
|
|
696
|
+
|
|
697
|
+
// @public
|
|
698
|
+
export class SlottedDirective extends NodeObservationDirective<SlottedDirectiveOptions> {
|
|
699
|
+
disconnect(target: EventSource): void;
|
|
700
|
+
getNodes(target: HTMLSlotElement): Node[];
|
|
701
|
+
// @internal (undocumented)
|
|
702
|
+
handleEvent(event: Event): void;
|
|
703
|
+
observe(target: EventSource): void;
|
|
515
704
|
}
|
|
516
705
|
|
|
517
706
|
// @public
|
|
518
|
-
export interface
|
|
707
|
+
export interface SlottedDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, AssignedNodesOptions {
|
|
519
708
|
}
|
|
520
709
|
|
|
521
710
|
// @public
|
|
522
|
-
export
|
|
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
|
+
|
|
719
|
+
// @public
|
|
720
|
+
export class Splice {
|
|
721
|
+
constructor(index: number, removed: any[], addedCount: number);
|
|
722
|
+
// (undocumented)
|
|
523
723
|
addedCount: number;
|
|
724
|
+
adjustTo(array: any[]): this;
|
|
725
|
+
// (undocumented)
|
|
524
726
|
index: number;
|
|
727
|
+
// (undocumented)
|
|
525
728
|
removed: any[];
|
|
729
|
+
reset?: boolean;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
// @public
|
|
733
|
+
export interface SpliceStrategy {
|
|
734
|
+
normalize(previous: unknown[] | undefined, current: unknown[], changes: Splice[] | undefined): readonly Splice[];
|
|
735
|
+
pop(array: any[], observer: ArrayObserver, pop: typeof Array.prototype.pop, args: any[]): any;
|
|
736
|
+
push(array: any[], observer: ArrayObserver, push: typeof Array.prototype.push, args: any[]): any;
|
|
737
|
+
reverse(array: any[], observer: ArrayObserver, reverse: typeof Array.prototype.reverse, args: any[]): any;
|
|
738
|
+
shift(array: any[], observer: ArrayObserver, shift: typeof Array.prototype.shift, args: any[]): any;
|
|
739
|
+
sort(array: any[], observer: ArrayObserver, sort: typeof Array.prototype.sort, args: any[]): any[];
|
|
740
|
+
splice(array: any[], observer: ArrayObserver, splice: typeof Array.prototype.splice, args: any[]): any;
|
|
741
|
+
readonly support: SpliceStrategySupport;
|
|
742
|
+
unshift(array: any[], observer: ArrayObserver, unshift: typeof Array.prototype.unshift, args: any[]): any[];
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
// @public
|
|
746
|
+
export const SpliceStrategy: Readonly<{
|
|
747
|
+
readonly reset: Splice[];
|
|
748
|
+
readonly setDefaultStrategy: (strategy: SpliceStrategy) => void;
|
|
749
|
+
}>;
|
|
750
|
+
|
|
751
|
+
// @public
|
|
752
|
+
export const SpliceStrategySupport: Readonly<{
|
|
753
|
+
readonly reset: 1;
|
|
754
|
+
readonly splice: 2;
|
|
755
|
+
readonly optimized: 3;
|
|
756
|
+
}>;
|
|
757
|
+
|
|
758
|
+
// @public
|
|
759
|
+
export type SpliceStrategySupport = typeof SpliceStrategySupport[keyof typeof SpliceStrategySupport];
|
|
760
|
+
|
|
761
|
+
// @public
|
|
762
|
+
export abstract class StatelessAttachedAttributeDirective<TOptions> implements HTMLDirective, ViewBehaviorFactory, ViewBehavior {
|
|
763
|
+
constructor(options: TOptions);
|
|
764
|
+
abstract bind(controller: ViewController): void;
|
|
765
|
+
createBehavior(): ViewBehavior;
|
|
766
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
767
|
+
id: string;
|
|
768
|
+
nodeId: string;
|
|
769
|
+
// (undocumented)
|
|
770
|
+
protected options: TOptions;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
// @public
|
|
774
|
+
export interface StyleStrategy {
|
|
775
|
+
addStylesTo(target: StyleTarget): void;
|
|
776
|
+
removeStylesFrom(target: StyleTarget): void;
|
|
526
777
|
}
|
|
527
778
|
|
|
528
779
|
// @public
|
|
529
780
|
export interface StyleTarget {
|
|
530
781
|
adoptedStyleSheets?: CSSStyleSheet[];
|
|
531
782
|
append(styles: HTMLStyleElement): void;
|
|
532
|
-
// @deprecated
|
|
533
|
-
prepend(styles: HTMLStyleElement): void;
|
|
534
783
|
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
|
|
535
784
|
removeChild(styles: HTMLStyleElement): void;
|
|
536
785
|
}
|
|
537
786
|
|
|
538
787
|
// @public
|
|
539
788
|
export interface Subscriber {
|
|
540
|
-
handleChange(
|
|
789
|
+
handleChange(subject: any, args: any): void;
|
|
541
790
|
}
|
|
542
791
|
|
|
543
792
|
// @public
|
|
544
793
|
export class SubscriberSet implements Notifier {
|
|
545
|
-
constructor(
|
|
794
|
+
constructor(subject: any, initialSubscriber?: Subscriber);
|
|
546
795
|
has(subscriber: Subscriber): boolean;
|
|
547
796
|
notify(args: any): void;
|
|
548
|
-
readonly
|
|
797
|
+
readonly subject: any;
|
|
549
798
|
subscribe(subscriber: Subscriber): void;
|
|
550
799
|
unsubscribe(subscriber: Subscriber): void;
|
|
551
800
|
}
|
|
552
801
|
|
|
553
802
|
// @public
|
|
554
|
-
export interface
|
|
803
|
+
export interface SubtreeDirectiveOptions<T = any> extends NodeBehaviorOptions<T>, Omit<MutationObserverInit, "subtree" | "childList"> {
|
|
555
804
|
selector: string;
|
|
556
805
|
subtree: boolean;
|
|
557
806
|
}
|
|
558
807
|
|
|
559
808
|
// @public
|
|
560
|
-
export interface SyntheticView extends View {
|
|
561
|
-
dispose(): void;
|
|
809
|
+
export interface SyntheticView<TSource = any, TParent = any> extends View<TSource, TParent> {
|
|
562
810
|
readonly firstChild: Node;
|
|
563
811
|
insertBefore(node: Node): void;
|
|
564
812
|
readonly lastChild: Node;
|
|
@@ -567,17 +815,11 @@ export interface SyntheticView extends View {
|
|
|
567
815
|
|
|
568
816
|
// @public
|
|
569
817
|
export interface SyntheticViewTemplate<TSource = any, TParent = any> {
|
|
570
|
-
create(): SyntheticView
|
|
818
|
+
create(): SyntheticView<TSource, TParent>;
|
|
571
819
|
}
|
|
572
820
|
|
|
573
821
|
// @public
|
|
574
|
-
export
|
|
575
|
-
createPlaceholder: (index: number) => string;
|
|
576
|
-
abstract targetName: string | undefined;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
// @public
|
|
580
|
-
export type TemplateValue<TScope, TParent = any> = Binding<TScope, any, TParent> | string | number | HTMLDirective | CaptureType<TScope>;
|
|
822
|
+
export type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource, TParent>;
|
|
581
823
|
|
|
582
824
|
// @public
|
|
583
825
|
export type TrustedTypes = {
|
|
@@ -589,6 +831,37 @@ export type TrustedTypesPolicy = {
|
|
|
589
831
|
createHTML(html: string): string;
|
|
590
832
|
};
|
|
591
833
|
|
|
834
|
+
// Warning: (ae-internal-missing-underscore) The name "TypeDefinition" should be prefixed with an underscore because the declaration is marked as @internal
|
|
835
|
+
//
|
|
836
|
+
// @internal
|
|
837
|
+
export interface TypeDefinition {
|
|
838
|
+
// (undocumented)
|
|
839
|
+
type: Function;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
// Warning: (ae-internal-missing-underscore) The name "TypeRegistry" should be prefixed with an underscore because the declaration is marked as @internal
|
|
843
|
+
//
|
|
844
|
+
// @internal
|
|
845
|
+
export interface TypeRegistry<TDefinition extends TypeDefinition> {
|
|
846
|
+
// (undocumented)
|
|
847
|
+
getByType(key: Function): TDefinition | undefined;
|
|
848
|
+
// (undocumented)
|
|
849
|
+
getForInstance(object: any): TDefinition | undefined;
|
|
850
|
+
// (undocumented)
|
|
851
|
+
register(definition: TDefinition): boolean;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
// @public
|
|
855
|
+
export interface UpdateQueue {
|
|
856
|
+
enqueue(callable: Callable): void;
|
|
857
|
+
next(): Promise<void>;
|
|
858
|
+
process(): void;
|
|
859
|
+
setMode(isAsync: boolean): void;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
// @public
|
|
863
|
+
export const Updates: UpdateQueue;
|
|
864
|
+
|
|
592
865
|
// @public
|
|
593
866
|
export interface ValueConverter {
|
|
594
867
|
fromView(value: any): any;
|
|
@@ -596,28 +869,68 @@ export interface ValueConverter {
|
|
|
596
869
|
}
|
|
597
870
|
|
|
598
871
|
// @public
|
|
599
|
-
export interface View {
|
|
600
|
-
bind(source:
|
|
601
|
-
readonly context: ExecutionContext
|
|
602
|
-
|
|
603
|
-
readonly source: any | null;
|
|
872
|
+
export interface View<TSource = any, TParent = any> extends Disposable {
|
|
873
|
+
bind(source: TSource, context?: ExecutionContext<TParent>): void;
|
|
874
|
+
readonly context: ExecutionContext<TParent>;
|
|
875
|
+
readonly source: TSource | null;
|
|
604
876
|
unbind(): void;
|
|
605
877
|
}
|
|
606
878
|
|
|
607
879
|
// @public
|
|
608
|
-
export
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
880
|
+
export interface ViewBehavior<TSource = any, TParent = any> {
|
|
881
|
+
bind(controller: ViewController<TSource, TParent>): void;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
// @public
|
|
885
|
+
export interface ViewBehaviorFactory {
|
|
886
|
+
createBehavior(): ViewBehavior;
|
|
887
|
+
id: string;
|
|
888
|
+
nodeId: string;
|
|
889
|
+
}
|
|
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
|
+
|
|
904
|
+
// @public
|
|
905
|
+
export type ViewBehaviorTargets = {
|
|
906
|
+
[id: string]: Node;
|
|
907
|
+
};
|
|
908
|
+
|
|
909
|
+
// @public
|
|
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> {
|
|
916
|
+
constructor(html: string | HTMLTemplateElement, factories: Record<string, ViewBehaviorFactory>);
|
|
917
|
+
create(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
918
|
+
readonly factories: Record<string, ViewBehaviorFactory>;
|
|
612
919
|
readonly html: string | HTMLTemplateElement;
|
|
613
|
-
render(source: TSource, host: Node
|
|
920
|
+
render(source: TSource, host: Node, hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
614
921
|
}
|
|
615
922
|
|
|
616
923
|
// @public
|
|
617
924
|
export function volatile(target: {}, name: string | Accessor, descriptor: PropertyDescriptor): PropertyDescriptor;
|
|
618
925
|
|
|
619
926
|
// @public
|
|
620
|
-
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
|
|
621
934
|
|
|
622
935
|
// (No @packageDocumentation comment for this package)
|
|
623
936
|
|