@microsoft/fast-element 2.10.4 → 3.0.0-rc.1
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/ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md +1 -1
- package/ARCHITECTURE_OVERVIEW.md +2 -2
- package/CHANGELOG.json +1 -1
- package/CHANGELOG.md +2 -2
- package/DECLARATIVE_DESIGN.md +806 -0
- package/DECLARATIVE_HTML.md +470 -0
- package/DECLARATIVE_MIGRATION.md +215 -0
- package/DECLARATIVE_RENDERING.md +530 -0
- package/DECLARATIVE_RENDERING_LIFECYCLE.md +288 -0
- package/DECLARATIVE_SCHEMA_OBSERVER_MAP.md +489 -0
- package/DESIGN.md +138 -33
- package/MIGRATION.md +387 -0
- package/README.md +208 -1
- package/SIZES.md +25 -0
- package/api-extractor.arrays.json +15 -0
- package/api-extractor.context.json +1 -0
- package/api-extractor.declarative.json +15 -0
- package/api-extractor.di.json +1 -0
- package/api-extractor.hydration.json +15 -0
- package/api-extractor.styles.json +15 -0
- package/dist/arrays/arrays.api.json +2621 -0
- package/dist/declarative/declarative.api.json +7844 -0
- package/dist/di/di.api.json +1 -1
- package/dist/dts/array-observer.d.ts +2 -0
- package/dist/dts/arrays.d.ts +2 -0
- package/dist/dts/attr.d.ts +1 -0
- package/dist/dts/binding/signal.d.ts +6 -6
- package/dist/dts/binding/two-way.d.ts +1 -0
- package/dist/dts/binding.d.ts +7 -0
- package/dist/dts/components/attributes.d.ts +2 -5
- package/dist/dts/components/definition-schema-transforms.d.ts +9 -0
- package/dist/dts/components/element-controller.d.ts +80 -114
- package/dist/dts/components/element-hydration.d.ts +1 -1
- package/dist/dts/components/enable-hydration.d.ts +34 -0
- package/dist/dts/components/fast-definitions.d.ts +91 -42
- package/dist/dts/components/fast-element.d.ts +5 -8
- package/dist/dts/components/hydration-tracker.d.ts +40 -0
- package/dist/dts/components/hydration.d.ts +18 -53
- package/dist/dts/components/schema.d.ts +205 -0
- package/dist/dts/context.d.ts +6 -6
- package/dist/dts/css.d.ts +3 -0
- package/dist/dts/debug.d.ts +5 -1
- package/dist/dts/declarative/attribute-map.d.ts +58 -0
- package/dist/dts/declarative/debug.d.ts +5 -0
- package/dist/dts/declarative/index.d.ts +13 -0
- package/dist/dts/declarative/interfaces.d.ts +9 -0
- package/dist/dts/declarative/observer-map-utilities.d.ts +58 -0
- package/dist/dts/declarative/observer-map.d.ts +89 -0
- package/dist/dts/declarative/runtime.d.ts +5 -0
- package/dist/dts/declarative/syntax.d.ts +21 -0
- package/dist/dts/declarative/template-bridge.d.ts +33 -0
- package/dist/dts/declarative/template-parser.d.ts +98 -0
- package/dist/dts/declarative/template.d.ts +9 -0
- package/dist/dts/declarative/utilities.d.ts +312 -0
- package/dist/dts/di/di.d.ts +1 -1
- package/dist/dts/directives/children.d.ts +2 -0
- package/dist/dts/directives/node-observation.d.ts +2 -0
- package/dist/dts/directives/ref.d.ts +2 -0
- package/dist/dts/directives/repeat.d.ts +4 -0
- package/dist/dts/directives/slotted.d.ts +2 -0
- package/dist/dts/directives/when.d.ts +3 -0
- package/dist/dts/dom-policy.d.ts +1 -1
- package/dist/dts/html.d.ts +5 -0
- package/dist/dts/hydration/runtime.d.ts +7 -0
- package/dist/dts/hydration/target-builder.d.ts +15 -12
- package/dist/dts/hydration.d.ts +14 -0
- package/dist/dts/index.d.ts +38 -42
- package/dist/dts/index.debug.d.ts +0 -1
- package/dist/dts/index.rollup.debug.d.ts +0 -1
- package/dist/dts/interfaces.d.ts +1 -49
- package/dist/dts/observable.d.ts +3 -6
- package/dist/dts/observation/arrays.d.ts +1 -1
- package/dist/dts/observation/update-queue.d.ts +1 -1
- package/dist/dts/platform.d.ts +25 -4
- package/dist/dts/render.d.ts +7 -0
- package/dist/dts/schema.d.ts +1 -0
- package/dist/dts/state/exports.d.ts +1 -1
- package/dist/dts/state/state.d.ts +2 -2
- package/dist/dts/styles/css-directive.d.ts +5 -12
- package/dist/dts/styles/css.d.ts +5 -7
- package/dist/dts/styles/element-styles.d.ts +0 -10
- package/dist/dts/styles.d.ts +6 -0
- package/dist/dts/templating/children.d.ts +1 -1
- package/dist/dts/templating/html-binding-directive.d.ts +4 -0
- package/dist/dts/templating/html-directive.d.ts +17 -0
- package/dist/dts/templating/hydration-view.d.ts +109 -0
- package/dist/dts/templating/ref.d.ts +1 -1
- package/dist/dts/templating/render.d.ts +1 -1
- package/dist/dts/templating/repeat.d.ts +2 -2
- package/dist/dts/templating/slotted.d.ts +1 -1
- package/dist/dts/templating/template.d.ts +17 -9
- package/dist/dts/templating/view.d.ts +25 -102
- package/dist/dts/templating/when.d.ts +1 -1
- package/dist/dts/templating.d.ts +10 -0
- package/dist/dts/testing/exports.d.ts +2 -2
- package/dist/dts/updates.d.ts +1 -0
- package/dist/dts/volatile.d.ts +2 -0
- package/dist/esm/array-observer.js +1 -0
- package/dist/esm/arrays.js +1 -0
- package/dist/esm/attr.js +1 -0
- package/dist/esm/binding/normalize.js +1 -1
- package/dist/esm/binding/signal.js +4 -4
- package/dist/esm/binding/two-way.js +2 -1
- package/dist/esm/binding.js +4 -0
- package/dist/esm/components/attributes.js +8 -5
- package/dist/esm/components/definition-schema-transforms.js +23 -0
- package/dist/esm/components/element-controller.js +200 -269
- package/dist/esm/components/element-hydration.js +1 -1
- package/dist/esm/components/enable-hydration.js +100 -0
- package/dist/esm/components/fast-definitions.js +211 -49
- package/dist/esm/components/fast-element.js +18 -27
- package/dist/esm/components/hydration-tracker.js +93 -0
- package/dist/esm/components/hydration.js +62 -144
- package/dist/esm/components/schema.js +253 -0
- package/dist/esm/context.js +6 -6
- package/dist/esm/css.js +3 -0
- package/dist/esm/debug.js +26 -26
- package/dist/esm/declarative/attribute-map.js +121 -0
- package/dist/esm/declarative/debug.js +5 -0
- package/dist/esm/declarative/index.js +3 -0
- package/dist/esm/declarative/interfaces.js +10 -0
- package/dist/esm/declarative/observer-map-utilities.js +562 -0
- package/dist/esm/declarative/observer-map.js +216 -0
- package/dist/esm/declarative/runtime.js +14 -0
- package/dist/esm/declarative/syntax.js +36 -0
- package/dist/esm/declarative/template-bridge.js +170 -0
- package/dist/esm/declarative/template-parser.js +306 -0
- package/dist/esm/declarative/template.js +142 -0
- package/dist/esm/declarative/utilities.js +834 -0
- package/dist/esm/di/di.js +6 -8
- package/dist/esm/directives/children.js +1 -0
- package/dist/esm/directives/node-observation.js +1 -0
- package/dist/esm/directives/ref.js +1 -0
- package/dist/esm/directives/repeat.js +1 -0
- package/dist/esm/directives/slotted.js +1 -0
- package/dist/esm/directives/when.js +1 -0
- package/dist/esm/dom-policy.js +2 -2
- package/dist/esm/dom.js +1 -1
- package/dist/esm/html.js +2 -0
- package/dist/esm/hydration/runtime.js +33 -0
- package/dist/esm/hydration/target-builder.js +97 -90
- package/dist/esm/hydration.js +4 -0
- package/dist/esm/index.debug.js +2 -1
- package/dist/esm/index.js +34 -29
- package/dist/esm/index.rollup.debug.js +3 -2
- package/dist/esm/index.rollup.js +1 -1
- package/dist/esm/interfaces.js +1 -45
- package/dist/esm/observable.js +1 -4
- package/dist/esm/observation/arrays.js +1 -1
- package/dist/esm/observation/observable.js +5 -5
- package/dist/esm/observation/update-queue.js +47 -58
- package/dist/esm/platform.js +31 -30
- package/dist/esm/render.js +1 -0
- package/dist/esm/schema.js +1 -0
- package/dist/esm/state/exports.js +1 -1
- package/dist/esm/styles/css-directive.js +1 -2
- package/dist/esm/styles/css.js +15 -56
- package/dist/esm/styles/element-styles.js +69 -15
- package/dist/esm/styles.js +2 -0
- package/dist/esm/templating/html-binding-directive.js +10 -8
- package/dist/esm/templating/hydration-view.js +235 -0
- package/dist/esm/templating/render.js +1 -1
- package/dist/esm/templating/repeat.js +36 -34
- package/dist/esm/templating/template.js +7 -7
- package/dist/esm/templating/view.js +24 -233
- package/dist/esm/templating.js +7 -0
- package/dist/esm/testing/exports.js +2 -2
- package/dist/esm/updates.js +1 -0
- package/dist/esm/volatile.js +1 -0
- package/dist/fast-element.api.json +9016 -6995
- package/dist/fast-element.d.ts +3557 -796
- package/dist/fast-element.debug.js +5088 -4437
- package/dist/fast-element.debug.min.js +2 -2
- package/dist/fast-element.js +5369 -4649
- package/dist/fast-element.min.js +2 -2
- package/dist/fast-element.untrimmed.d.ts +863 -475
- package/dist/hydration/hydration.api.json +5237 -0
- package/dist/styles/styles.api.json +2672 -0
- package/docs/api-report.api.md +343 -166
- package/docs/arrays/api-report.api.md +114 -0
- package/docs/declarative/api-report.api.md +397 -0
- package/docs/hydration/api-report.api.md +285 -0
- package/docs/styles/api-report.api.md +135 -0
- package/package.json +149 -41
- package/playwright.declarative.config.ts +26 -0
- package/playwright.declarative.webui.config.ts +20 -0
- package/scripts/declarative/build-fixtures-with-webui.js +135 -0
- package/scripts/declarative/build-fixtures.js +49 -0
- package/scripts/declarative/build-fixtures.utilities.js +101 -0
- package/scripts/measure-sizes.js +219 -0
- package/scripts/run-api-extractor.js +39 -20
- package/test/declarative/fixtures/README.md +72 -0
- package/test/declarative/fixtures/WRITING_FIXTURES.md +330 -0
- package/test/declarative/fixtures/bindings/README.md +12 -0
- package/test/declarative/fixtures/bindings/attribute/entry.html +13 -0
- package/test/declarative/fixtures/bindings/attribute/fast-build.config.json +6 -0
- package/test/declarative/fixtures/bindings/attribute/index.html +25 -0
- package/test/declarative/fixtures/bindings/attribute/main.ts +41 -0
- package/test/declarative/fixtures/bindings/attribute/state.json +8 -0
- package/test/declarative/fixtures/bindings/attribute/templates.html +11 -0
- package/test/declarative/fixtures/bindings/content/entry.html +12 -0
- package/test/declarative/fixtures/bindings/content/fast-build.config.json +6 -0
- package/test/declarative/fixtures/bindings/content/index.html +19 -0
- package/test/declarative/fixtures/bindings/content/main.ts +27 -0
- package/test/declarative/fixtures/bindings/content/state.json +4 -0
- package/test/declarative/fixtures/bindings/content/templates.html +6 -0
- package/test/declarative/fixtures/bindings/dot-syntax/entry.html +11 -0
- package/test/declarative/fixtures/bindings/dot-syntax/fast-build.config.json +6 -0
- package/test/declarative/fixtures/bindings/dot-syntax/index.html +47 -0
- package/test/declarative/fixtures/bindings/dot-syntax/main.ts +59 -0
- package/test/declarative/fixtures/bindings/dot-syntax/state.json +16 -0
- package/test/declarative/fixtures/bindings/dot-syntax/templates.html +17 -0
- package/test/declarative/fixtures/bindings/event/entry.html +11 -0
- package/test/declarative/fixtures/bindings/event/fast-build.config.json +6 -0
- package/test/declarative/fixtures/bindings/event/index.html +43 -0
- package/test/declarative/fixtures/bindings/event/main.ts +43 -0
- package/test/declarative/fixtures/bindings/event/state.json +3 -0
- package/test/declarative/fixtures/bindings/event/templates.html +18 -0
- package/test/declarative/fixtures/bindings/host/entry.html +40 -0
- package/test/declarative/fixtures/bindings/host/fast-build.config.json +6 -0
- package/test/declarative/fixtures/bindings/host/index.html +96 -0
- package/test/declarative/fixtures/bindings/host/main.ts +222 -0
- package/test/declarative/fixtures/bindings/host/state.json +9 -0
- package/test/declarative/fixtures/bindings/host/templates.html +55 -0
- package/test/declarative/fixtures/directives/README.md +12 -0
- package/test/declarative/fixtures/directives/children/entry.html +11 -0
- package/test/declarative/fixtures/directives/children/fast-build.config.json +6 -0
- package/test/declarative/fixtures/directives/children/index.html +15 -0
- package/test/declarative/fixtures/directives/children/main.ts +22 -0
- package/test/declarative/fixtures/directives/children/state.json +3 -0
- package/test/declarative/fixtures/directives/children/templates.html +3 -0
- package/test/declarative/fixtures/directives/ref/entry.html +11 -0
- package/test/declarative/fixtures/directives/ref/fast-build.config.json +6 -0
- package/test/declarative/fixtures/directives/ref/index.html +15 -0
- package/test/declarative/fixtures/directives/ref/main.ts +17 -0
- package/test/declarative/fixtures/directives/ref/state.json +1 -0
- package/test/declarative/fixtures/directives/ref/templates.html +3 -0
- package/test/declarative/fixtures/directives/repeat/entry.html +21 -0
- package/test/declarative/fixtures/directives/repeat/fast-build.config.json +6 -0
- package/test/declarative/fixtures/directives/repeat/index.html +133 -0
- package/test/declarative/fixtures/directives/repeat/main.ts +110 -0
- package/test/declarative/fixtures/directives/repeat/sprites.svg +8 -0
- package/test/declarative/fixtures/directives/repeat/state.json +10 -0
- package/test/declarative/fixtures/directives/repeat/templates.html +75 -0
- package/test/declarative/fixtures/directives/slotted/entry.html +17 -0
- package/test/declarative/fixtures/directives/slotted/fast-build.config.json +6 -0
- package/test/declarative/fixtures/directives/slotted/index.html +27 -0
- package/test/declarative/fixtures/directives/slotted/main.ts +29 -0
- package/test/declarative/fixtures/directives/slotted/state.json +1 -0
- package/test/declarative/fixtures/directives/slotted/templates.html +7 -0
- package/test/declarative/fixtures/directives/when/entry.html +51 -0
- package/test/declarative/fixtures/directives/when/fast-build.config.json +6 -0
- package/test/declarative/fixtures/directives/when/index.html +136 -0
- package/test/declarative/fixtures/directives/when/main.ts +172 -0
- package/test/declarative/fixtures/directives/when/state.json +12 -0
- package/test/declarative/fixtures/directives/when/templates.html +75 -0
- package/test/declarative/fixtures/ecosystem/README.md +11 -0
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/entry.html +12 -0
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/fast-build.config.json +6 -0
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/index.html +20 -0
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/main.ts +68 -0
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/state.json +4 -0
- package/test/declarative/fixtures/ecosystem/declarative-no-hydration/templates.html +7 -0
- package/test/declarative/fixtures/ecosystem/errors/entry.html +12 -0
- package/test/declarative/fixtures/ecosystem/errors/fast-build.config.json +6 -0
- package/test/declarative/fixtures/ecosystem/errors/index.html +20 -0
- package/test/declarative/fixtures/ecosystem/errors/main.ts +17 -0
- package/test/declarative/fixtures/ecosystem/errors/state.json +1 -0
- package/test/declarative/fixtures/ecosystem/errors/templates.html +7 -0
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/entry.html +17 -0
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/fast-build.config.json +6 -0
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/index.html +56 -0
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/main.ts +134 -0
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/state.json +12 -0
- package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/templates.html +34 -0
- package/test/declarative/fixtures/ecosystem/performance-metrics/entry.html +25 -0
- package/test/declarative/fixtures/ecosystem/performance-metrics/fast-build.config.json +6 -0
- package/test/declarative/fixtures/ecosystem/performance-metrics/fast-card.css +10 -0
- package/test/declarative/fixtures/ecosystem/performance-metrics/index.html +181 -0
- package/test/declarative/fixtures/ecosystem/performance-metrics/main.ts +58 -0
- package/test/declarative/fixtures/ecosystem/performance-metrics/state.json +6 -0
- package/test/declarative/fixtures/ecosystem/performance-metrics/templates.html +15 -0
- package/test/declarative/fixtures/extensions/README.md +15 -0
- package/test/declarative/fixtures/extensions/attribute-map/entry.html +14 -0
- package/test/declarative/fixtures/extensions/attribute-map/fast-build.config.json +6 -0
- package/test/declarative/fixtures/extensions/attribute-map/index.html +31 -0
- package/test/declarative/fixtures/extensions/attribute-map/main.ts +40 -0
- package/test/declarative/fixtures/extensions/attribute-map/state.json +4 -0
- package/test/declarative/fixtures/extensions/attribute-map/templates.html +14 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/entry.html +12 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/fast-build.config.json +7 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/index.html +25 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/main.ts +31 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/state.json +5 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/templates.html +11 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/entry.html +13 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/fast-build.config.json +7 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/index.html +23 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/main.ts +37 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/state.json +1 -0
- package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/templates.html +9 -0
- package/test/declarative/fixtures/extensions/observer-map/entry.html +15 -0
- package/test/declarative/fixtures/extensions/observer-map/fast-build.config.json +6 -0
- package/test/declarative/fixtures/extensions/observer-map/index.html +442 -0
- package/test/declarative/fixtures/extensions/observer-map/main.ts +482 -0
- package/test/declarative/fixtures/extensions/observer-map/state.json +158 -0
- package/test/declarative/fixtures/extensions/observer-map/templates.html +172 -0
- package/test/declarative/fixtures/extensions/observer-map-config-object/entry.html +16 -0
- package/test/declarative/fixtures/extensions/observer-map-config-object/fast-build.config.json +6 -0
- package/test/declarative/fixtures/extensions/observer-map-config-object/index.html +27 -0
- package/test/declarative/fixtures/extensions/observer-map-config-object/main.ts +53 -0
- package/test/declarative/fixtures/extensions/observer-map-config-object/state.json +9 -0
- package/test/declarative/fixtures/extensions/observer-map-config-object/templates.html +12 -0
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/README.md +98 -0
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/entry.html +156 -0
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/fast-build.config.json +6 -0
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/index.html +376 -0
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/main.ts +366 -0
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/state.json +69 -0
- package/test/declarative/fixtures/extensions/observer-map-deep-merge/templates.html +91 -0
- package/test/declarative/fixtures/extensions/observer-map-properties/entry.html +14 -0
- package/test/declarative/fixtures/extensions/observer-map-properties/fast-build.config.json +6 -0
- package/test/declarative/fixtures/extensions/observer-map-properties/index.html +110 -0
- package/test/declarative/fixtures/extensions/observer-map-properties/main.ts +175 -0
- package/test/declarative/fixtures/extensions/observer-map-properties/state.json +29 -0
- package/test/declarative/fixtures/extensions/observer-map-properties/templates.html +55 -0
- package/test/declarative/fixtures/scenarios/README.md +7 -0
- package/test/declarative/fixtures/scenarios/nested-elements/entry.html +16 -0
- package/test/declarative/fixtures/scenarios/nested-elements/fast-build.config.json +6 -0
- package/test/declarative/fixtures/scenarios/nested-elements/index.html +126 -0
- package/test/declarative/fixtures/scenarios/nested-elements/main.ts +214 -0
- package/test/declarative/fixtures/scenarios/nested-elements/state.json +10 -0
- package/test/declarative/fixtures/scenarios/nested-elements/templates.html +54 -0
- package/test/declarative/index.html +12 -0
- package/test/declarative/vite.config.ts +55 -0
- package/test/declarative-main.ts +6 -0
- package/test/extension-subpaths-main.ts +9 -0
- package/test/main.ts +38 -33
- package/test/pure-declarative-main.ts +1 -0
- package/dist/dts/components/install-hydration.d.ts +0 -1
- package/dist/dts/pending-task.d.ts +0 -32
- package/dist/dts/polyfills.d.ts +0 -0
- package/dist/dts/styles/css-binding-directive.d.ts +0 -60
- package/dist/dts/templating/install-hydratable-view-templates.d.ts +0 -1
- package/dist/esm/components/install-hydration.js +0 -3
- package/dist/esm/pending-task.js +0 -28
- package/dist/esm/polyfills.js +0 -60
- package/dist/esm/styles/css-binding-directive.js +0 -76
- package/dist/esm/templating/install-hydratable-view-templates.js +0 -23
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A path discovered from an access expression.
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export declare interface AccessCachedPath extends CachedPathCommon {
|
|
6
|
+
type: "access";
|
|
7
|
+
}
|
|
8
|
+
|
|
1
9
|
/**
|
|
2
10
|
* Represents a getter/setter property accessor on an object.
|
|
3
11
|
* @public
|
|
@@ -20,12 +28,6 @@ export declare interface Accessor {
|
|
|
20
28
|
setValue(source: any, value: any): void;
|
|
21
29
|
}
|
|
22
30
|
|
|
23
|
-
/**
|
|
24
|
-
* Used to add behaviors when constructing styles.
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
export declare type AddBehavior = (behavior: HostBehavior<HTMLElement>) => void;
|
|
28
|
-
|
|
29
31
|
/**
|
|
30
32
|
* Used to add behavior factories when constructing templates.
|
|
31
33
|
* @public
|
|
@@ -80,7 +82,7 @@ export declare const ArrayObserver: Readonly<{
|
|
|
80
82
|
* Enables the array observation mechanism.
|
|
81
83
|
* @remarks
|
|
82
84
|
* Array observation is enabled automatically when using the
|
|
83
|
-
*
|
|
85
|
+
* `RepeatDirective`, so calling this API manually is
|
|
84
86
|
* not typically necessary.
|
|
85
87
|
*/
|
|
86
88
|
readonly enable: () => void;
|
|
@@ -147,7 +149,7 @@ export declare const AttributeConfiguration: Readonly<{
|
|
|
147
149
|
}>;
|
|
148
150
|
|
|
149
151
|
/**
|
|
150
|
-
* An implementation of
|
|
152
|
+
* An implementation of `Accessor` that supports reactivity,
|
|
151
153
|
* change callbacks, attribute reflection, and type conversion for
|
|
152
154
|
* custom elements.
|
|
153
155
|
* @public
|
|
@@ -222,7 +224,7 @@ export declare class AttributeDefinition implements Accessor {
|
|
|
222
224
|
* changes in the DOM, but does not reflect property changes back.
|
|
223
225
|
* @public
|
|
224
226
|
*/
|
|
225
|
-
export declare type AttributeMode =
|
|
227
|
+
export declare type AttributeMode = "reflect" | "boolean" | "fromView";
|
|
226
228
|
|
|
227
229
|
/**
|
|
228
230
|
* Captures a binding expression along with related information and capabilities.
|
|
@@ -231,7 +233,7 @@ export declare type AttributeMode = typeof reflectMode | typeof booleanMode | "f
|
|
|
231
233
|
*/
|
|
232
234
|
export declare abstract class Binding<TSource = any, TReturn = any, TParent = any> {
|
|
233
235
|
evaluate: Expression<TSource, TReturn, TParent>;
|
|
234
|
-
policy?:
|
|
236
|
+
policy?: DOMPolicy_2 | undefined;
|
|
235
237
|
isVolatile: boolean;
|
|
236
238
|
/**
|
|
237
239
|
* Options associated with the binding.
|
|
@@ -243,7 +245,7 @@ export declare abstract class Binding<TSource = any, TReturn = any, TParent = an
|
|
|
243
245
|
* @param policy - The security policy to associate with this binding.
|
|
244
246
|
* @param isVolatile - Indicates whether the binding is volatile.
|
|
245
247
|
*/
|
|
246
|
-
constructor(evaluate: Expression<TSource, TReturn, TParent>, policy?:
|
|
248
|
+
constructor(evaluate: Expression<TSource, TReturn, TParent>, policy?: DOMPolicy_2 | undefined, isVolatile?: boolean);
|
|
247
249
|
/**
|
|
248
250
|
* Creates an observer capable of notifying a subscriber when the output of a binding changes.
|
|
249
251
|
* @param subscriber - The subscriber to changes in the binding.
|
|
@@ -280,7 +282,27 @@ export declare interface BindingDirective {
|
|
|
280
282
|
*/
|
|
281
283
|
export declare const booleanConverter: ValueConverter;
|
|
282
284
|
|
|
283
|
-
|
|
285
|
+
/**
|
|
286
|
+
* A path discovered while parsing a template.
|
|
287
|
+
* @public
|
|
288
|
+
*/
|
|
289
|
+
export declare type CachedPath = DefaultCachedPath | RepeatCachedPath | AccessCachedPath | EventCachedPath;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Common metadata for paths cached while parsing a template.
|
|
293
|
+
* @public
|
|
294
|
+
*/
|
|
295
|
+
export declare interface CachedPathCommon {
|
|
296
|
+
parentContext: string | null;
|
|
297
|
+
currentContext: string | null;
|
|
298
|
+
path: string;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* A map from element names and root properties to JSON schemas.
|
|
303
|
+
* @public
|
|
304
|
+
*/
|
|
305
|
+
export declare type CachedPathMap = Map<string, Map<string, JSONSchema>>;
|
|
284
306
|
|
|
285
307
|
/**
|
|
286
308
|
* Represents a callable type such as a function or an object with a "call" method.
|
|
@@ -295,7 +317,7 @@ export declare type Callable = typeof Function.prototype.call | {
|
|
|
295
317
|
* into templates.
|
|
296
318
|
* @public
|
|
297
319
|
*/
|
|
298
|
-
export declare interface CaptureType
|
|
320
|
+
export declare interface CaptureType {
|
|
299
321
|
}
|
|
300
322
|
|
|
301
323
|
/**
|
|
@@ -311,7 +333,7 @@ export declare interface ChildListDirectiveOptions<T = any> extends NodeBehavior
|
|
|
311
333
|
* @param propertyOrOptions - The options used to configure child node observation.
|
|
312
334
|
* @public
|
|
313
335
|
*/
|
|
314
|
-
export declare function children<TSource = any
|
|
336
|
+
export declare function children<TSource = any>(propertyOrOptions: (keyof TSource & string) | ChildrenDirectiveOptions<keyof TSource & string>): CaptureType;
|
|
315
337
|
|
|
316
338
|
/**
|
|
317
339
|
* The runtime behavior for child node observation.
|
|
@@ -347,6 +369,15 @@ export declare class ChildrenDirective extends NodeObservationDirective<Children
|
|
|
347
369
|
*/
|
|
348
370
|
export declare type ChildrenDirectiveOptions<T = any> = ChildListDirectiveOptions<T> | SubtreeDirectiveOptions<T>;
|
|
349
371
|
|
|
372
|
+
/**
|
|
373
|
+
* Describes a child custom element binding referenced by a schema path.
|
|
374
|
+
* @public
|
|
375
|
+
*/
|
|
376
|
+
export declare interface ChildrenMap {
|
|
377
|
+
customElementName: string;
|
|
378
|
+
attributeName: string;
|
|
379
|
+
}
|
|
380
|
+
|
|
350
381
|
/**
|
|
351
382
|
* Represents a constructable class with a prototype.
|
|
352
383
|
* @public
|
|
@@ -375,7 +406,7 @@ factories: Record<string, ViewBehaviorFactory>,
|
|
|
375
406
|
/**
|
|
376
407
|
* The security policy to compile the html with.
|
|
377
408
|
*/
|
|
378
|
-
policy:
|
|
409
|
+
policy: DOMPolicy_2) => HTMLTemplateCompilationResult;
|
|
379
410
|
|
|
380
411
|
/**
|
|
381
412
|
* Represents a ViewBehaviorFactory after the compilation process has completed.
|
|
@@ -400,7 +431,7 @@ export declare const Compiler: {
|
|
|
400
431
|
* it is recommended that you clone the original and pass the clone to this API.
|
|
401
432
|
* @public
|
|
402
433
|
*/
|
|
403
|
-
compile<TSource = any, TParent = any>(html: string | HTMLTemplateElement, factories: Record<string, ViewBehaviorFactory>, policy?:
|
|
434
|
+
compile<TSource = any, TParent = any>(html: string | HTMLTemplateElement, factories: Record<string, ViewBehaviorFactory>, policy?: DOMPolicy_2): HTMLTemplateCompilationResult<TSource, TParent>;
|
|
404
435
|
/**
|
|
405
436
|
* Sets the default compilation strategy that will be used by the ViewTemplate whenever
|
|
406
437
|
* it needs to compile a view preprocessed with the html template function.
|
|
@@ -414,7 +445,7 @@ export declare const Compiler: {
|
|
|
414
445
|
* @param policy - The security policy to use with the aggregated bindings.
|
|
415
446
|
* @returns A single inline directive that aggregates the behavior of all the parts.
|
|
416
447
|
*/
|
|
417
|
-
aggregate(parts: (string | ViewBehaviorFactory)[], policy?:
|
|
448
|
+
aggregate(parts: (string | ViewBehaviorFactory)[], policy?: DOMPolicy_2): ViewBehaviorFactory;
|
|
418
449
|
};
|
|
419
450
|
|
|
420
451
|
/**
|
|
@@ -423,9 +454,88 @@ export declare const Compiler: {
|
|
|
423
454
|
*/
|
|
424
455
|
export declare type ComposableStyles = string | ElementStyles | CSSStyleSheet;
|
|
425
456
|
|
|
426
|
-
declare function compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition): FASTElementDefinition<TType
|
|
457
|
+
declare function compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition<TType>): Promise<FASTElementDefinition<TType>>;
|
|
458
|
+
|
|
459
|
+
declare function compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition<TType>): Promise<FASTElementDefinition<TType>>;
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Determines if the reference element contains the test element in a "composed" DOM tree that
|
|
463
|
+
* ignores shadow DOM boundaries.
|
|
464
|
+
*
|
|
465
|
+
* Returns true of the test element is a descendent of the reference, or exists in
|
|
466
|
+
* a shadow DOM that is a logical descendent of the reference. Otherwise returns false.
|
|
467
|
+
* @param reference - The element to test for containment against.
|
|
468
|
+
* @param test - The element being tested for containment.
|
|
469
|
+
*
|
|
470
|
+
* @public
|
|
471
|
+
*/
|
|
472
|
+
export declare function composedContains(reference: HTMLElement, test: HTMLElement): boolean;
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Retrieves the "composed parent" element of a node, ignoring DOM tree boundaries.
|
|
476
|
+
* When the parent of a node is a shadow-root, it will return the host
|
|
477
|
+
* element of the shadow root. Otherwise it will return the parent node or null if
|
|
478
|
+
* no parent node exists.
|
|
479
|
+
* @param element - The element for which to retrieve the composed parent
|
|
480
|
+
*
|
|
481
|
+
* @public
|
|
482
|
+
*/
|
|
483
|
+
export declare function composedParent<T extends HTMLElement>(element: T): HTMLElement | null;
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Provides computed state capabilities.
|
|
487
|
+
* @beta
|
|
488
|
+
*/
|
|
489
|
+
export declare type ComputedBuilder = {
|
|
490
|
+
/**
|
|
491
|
+
* Callbacks related to computed state.
|
|
492
|
+
*/
|
|
493
|
+
on: {
|
|
494
|
+
/**
|
|
495
|
+
* Provides a setup callback for the computation.
|
|
496
|
+
* @param callback - The callback to run to setup the computation.
|
|
497
|
+
*/
|
|
498
|
+
setup(callback: ComputedSetupCallback): void;
|
|
499
|
+
};
|
|
500
|
+
};
|
|
427
501
|
|
|
428
|
-
|
|
502
|
+
/**
|
|
503
|
+
* A callback that initializes the computation.
|
|
504
|
+
* @beta
|
|
505
|
+
*/
|
|
506
|
+
export declare type ComputedInitializer<T> = (builder: ComputedBuilder) => () => T;
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* A callback that enables computation setup.
|
|
510
|
+
* @beta
|
|
511
|
+
*/
|
|
512
|
+
export declare type ComputedSetupCallback = () => (() => void) | void;
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* State whose value is computed from other dependencies.
|
|
516
|
+
* @beta
|
|
517
|
+
*/
|
|
518
|
+
export declare type ComputedState<T> = ReadonlyState<T> & Disposable & {
|
|
519
|
+
/**
|
|
520
|
+
* Subscribes to notification of changes in the state.
|
|
521
|
+
* @param subscriber - The object that is subscribing for change notification.
|
|
522
|
+
*/
|
|
523
|
+
subscribe(subscriber: Subscriber): void;
|
|
524
|
+
/**
|
|
525
|
+
* Unsubscribes from notification of changes in the state.
|
|
526
|
+
* @param subscriber - The object that is unsubscribing from change notification.
|
|
527
|
+
*/
|
|
528
|
+
unsubscribe(subscriber: Subscriber): void;
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Creates a ComputedState.
|
|
533
|
+
* @param initialize - The initialization callback.
|
|
534
|
+
* @param name - A friendly name for this computation.
|
|
535
|
+
* @returns A ComputedState
|
|
536
|
+
* @beta
|
|
537
|
+
*/
|
|
538
|
+
export declare function computedState<T>(initialize: ComputedInitializer<T>, name?: string): ComputedState<T>;
|
|
429
539
|
|
|
430
540
|
/**
|
|
431
541
|
* Represents a type which can be constructed with the new operator.
|
|
@@ -492,82 +602,26 @@ export declare interface ContentView {
|
|
|
492
602
|
* @param strings - The string fragments that are interpolated with the values.
|
|
493
603
|
* @param values - The values that are interpolated with the string fragments.
|
|
494
604
|
* @remarks
|
|
495
|
-
* The css helper supports interpolation of
|
|
605
|
+
* The css helper supports interpolation of static composable styles and CSS directives.
|
|
496
606
|
* @public
|
|
497
607
|
*/
|
|
498
608
|
export declare const css: CSSTemplateTag;
|
|
499
609
|
|
|
500
610
|
/**
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
* @public
|
|
504
|
-
*/
|
|
505
|
-
export declare class CSSBindingDirective implements HostBehavior, Subscriber, CSSDirective, BindingDirective {
|
|
506
|
-
readonly dataBinding: Binding;
|
|
507
|
-
readonly targetAspect: string;
|
|
508
|
-
/**
|
|
509
|
-
* Creates an instance of CSSBindingDirective.
|
|
510
|
-
* @param dataBinding - The binding to use in CSS.
|
|
511
|
-
* @param targetAspect - The CSS property to target.
|
|
512
|
-
*/
|
|
513
|
-
constructor(dataBinding: Binding, targetAspect: string);
|
|
514
|
-
/**
|
|
515
|
-
* Creates a CSS fragment to interpolate into the CSS document.
|
|
516
|
-
* @returns - the string to interpolate into CSS
|
|
517
|
-
*/
|
|
518
|
-
createCSS(add: AddBehavior): ComposableStyles;
|
|
519
|
-
/**
|
|
520
|
-
* Executed when this behavior is attached to a controller.
|
|
521
|
-
* @param controller - Controls the behavior lifecycle.
|
|
522
|
-
*/
|
|
523
|
-
addedCallback(controller: HostController<HTMLElement & {
|
|
524
|
-
$cssBindings: Map<CSSBindingDirective, CSSBindingEntry>;
|
|
525
|
-
}>): void;
|
|
526
|
-
/**
|
|
527
|
-
* Executed when this behavior's host is connected.
|
|
528
|
-
* @param controller - Controls the behavior lifecycle.
|
|
529
|
-
*/
|
|
530
|
-
connectedCallback(controller: HostController<HTMLElement & {
|
|
531
|
-
$cssBindings: Map<CSSBindingDirective, CSSBindingEntry>;
|
|
532
|
-
}>): void;
|
|
533
|
-
/**
|
|
534
|
-
* Executed when this behavior is detached from a controller.
|
|
535
|
-
* @param controller - Controls the behavior lifecycle.
|
|
536
|
-
*/
|
|
537
|
-
removedCallback(controller: HostController<HTMLElement & {
|
|
538
|
-
$cssBindings: Map<CSSBindingDirective, CSSBindingEntry>;
|
|
539
|
-
}>): void;
|
|
540
|
-
/**
|
|
541
|
-
* Called when a subject this instance has subscribed to changes.
|
|
542
|
-
* @param subject - The subject of the change.
|
|
543
|
-
* @param args - The event args detailing the change that occurred.
|
|
544
|
-
*
|
|
545
|
-
* @internal
|
|
546
|
-
*/
|
|
547
|
-
handleChange(_: any, observer: ExpressionObserver): void;
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
declare type CSSBindingEntry = {
|
|
551
|
-
observer: ExpressionObserver;
|
|
552
|
-
controller: HostController;
|
|
553
|
-
};
|
|
554
|
-
|
|
555
|
-
/**
|
|
556
|
-
* Directive for use in {@link css}.
|
|
611
|
+
* Directive for use in CSS templates.
|
|
557
612
|
*
|
|
558
613
|
* @public
|
|
559
614
|
*/
|
|
560
615
|
export declare interface CSSDirective {
|
|
561
616
|
/**
|
|
562
|
-
* Creates
|
|
563
|
-
* @returns - the
|
|
617
|
+
* Creates static styles to interpolate into the CSS document.
|
|
618
|
+
* @returns - the styles to interpolate into CSS
|
|
564
619
|
*/
|
|
565
|
-
createCSS(
|
|
620
|
+
createCSS(): ComposableStyles;
|
|
566
621
|
}
|
|
567
622
|
|
|
568
623
|
/**
|
|
569
|
-
* Instructs the css engine to provide
|
|
570
|
-
* associate behaviors with styles.
|
|
624
|
+
* Instructs the css engine to provide styles during CSS template composition.
|
|
571
625
|
* @public
|
|
572
626
|
*/
|
|
573
627
|
export declare const CSSDirective: Readonly<{
|
|
@@ -610,25 +664,25 @@ export declare interface CSSDirectiveDefinition<TType extends Constructable<CSSD
|
|
|
610
664
|
* @param strings - The string fragments that are interpolated with the values.
|
|
611
665
|
* @param values - The values that are interpolated with the string fragments.
|
|
612
666
|
* @remarks
|
|
613
|
-
* The css helper supports interpolation of
|
|
667
|
+
* The css helper supports interpolation of static composable styles and CSS directives.
|
|
614
668
|
* Use the .partial method to create partial CSS fragments.
|
|
615
669
|
* @public
|
|
616
670
|
*/
|
|
617
|
-
export declare type CSSTemplateTag = (
|
|
671
|
+
export declare type CSSTemplateTag = ((strings: TemplateStringsArray, ...values: CSSValue[]) => ElementStyles) & {
|
|
618
672
|
/**
|
|
619
673
|
* Transforms a template literal string into partial CSS.
|
|
620
674
|
* @param strings - The string fragments that are interpolated with the values.
|
|
621
675
|
* @param values - The values that are interpolated with the string fragments.
|
|
622
676
|
* @public
|
|
623
677
|
*/
|
|
624
|
-
partial
|
|
678
|
+
partial(strings: TemplateStringsArray, ...values: CSSValue[]): CSSDirective;
|
|
625
679
|
};
|
|
626
680
|
|
|
627
681
|
/**
|
|
628
682
|
* Represents the types of values that can be interpolated into a template.
|
|
629
683
|
* @public
|
|
630
684
|
*/
|
|
631
|
-
export declare type CSSValue
|
|
685
|
+
export declare type CSSValue = ComposableStyles | CSSDirective;
|
|
632
686
|
|
|
633
687
|
/**
|
|
634
688
|
* Decorator: Defines a platform custom element based on `FASTElement`.
|
|
@@ -644,7 +698,19 @@ export declare function customElement(nameOrDef: string | PartialFASTElementDefi
|
|
|
644
698
|
*/
|
|
645
699
|
export declare type DecoratorAttributeConfiguration = Omit<AttributeConfiguration, "property">;
|
|
646
700
|
|
|
647
|
-
|
|
701
|
+
/**
|
|
702
|
+
* A path discovered from a default binding.
|
|
703
|
+
* @public
|
|
704
|
+
*/
|
|
705
|
+
export declare interface DefaultCachedPath extends CachedPathCommon {
|
|
706
|
+
type: "default";
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* The default execution context for template views.
|
|
711
|
+
* @public
|
|
712
|
+
*/
|
|
713
|
+
export declare class DefaultExecutionContext<TParent> implements ExecutionContext<TParent> {
|
|
648
714
|
/**
|
|
649
715
|
* The index of the current item within a repeat context.
|
|
650
716
|
*/
|
|
@@ -700,19 +766,9 @@ declare class DefaultExecutionContext<TParent> implements ExecutionContext<TPare
|
|
|
700
766
|
eventTarget<TTarget extends EventTarget>(): TTarget;
|
|
701
767
|
}
|
|
702
768
|
|
|
703
|
-
|
|
704
|
-
* The attribute used to defer hydration of an element.
|
|
705
|
-
* @beta
|
|
706
|
-
*/
|
|
707
|
-
export declare const deferHydrationAttribute = "defer-hydration";
|
|
708
|
-
|
|
709
|
-
declare function define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition): TType;
|
|
769
|
+
declare function define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition<TType>, extensions?: FASTElementExtension[]): Promise<TType>;
|
|
710
770
|
|
|
711
|
-
declare function define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): TType
|
|
712
|
-
|
|
713
|
-
declare function defineAsync<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition): Promise<FASTElementDefinition<TType>>;
|
|
714
|
-
|
|
715
|
-
declare function defineAsync<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): Promise<FASTElementDefinition<TType>>;
|
|
771
|
+
declare function define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition<TType>, extensions?: FASTElementExtension[]): Promise<TType>;
|
|
716
772
|
|
|
717
773
|
/**
|
|
718
774
|
* Provides a mechanism for releasing resources.
|
|
@@ -733,7 +789,7 @@ export declare const DOM: Readonly<{
|
|
|
733
789
|
/**
|
|
734
790
|
* Gets the dom policy used by the templating system.
|
|
735
791
|
*/
|
|
736
|
-
readonly policy:
|
|
792
|
+
readonly policy: DOMPolicy_2;
|
|
737
793
|
/**
|
|
738
794
|
* Sets the dom policy used by the templating system.
|
|
739
795
|
* @param policy - The policy to set.
|
|
@@ -741,7 +797,7 @@ export declare const DOM: Readonly<{
|
|
|
741
797
|
* This API can only be called once, for security reasons. It should be
|
|
742
798
|
* called by the application developer at the start of their program.
|
|
743
799
|
*/
|
|
744
|
-
setPolicy(value:
|
|
800
|
+
setPolicy(value: DOMPolicy_2): void;
|
|
745
801
|
/**
|
|
746
802
|
* Sets an attribute value on an element.
|
|
747
803
|
* @param element - The element to set the attribute value on.
|
|
@@ -804,11 +860,76 @@ export declare const DOMAspect: Readonly<{
|
|
|
804
860
|
*/
|
|
805
861
|
export declare type DOMAspect = (typeof DOMAspect)[Exclude<keyof typeof DOMAspect, "none">];
|
|
806
862
|
|
|
863
|
+
/**
|
|
864
|
+
* Aspect-specific guards for a DOM Policy.
|
|
865
|
+
* @public
|
|
866
|
+
*/
|
|
867
|
+
export declare type DOMAspectGuards = {
|
|
868
|
+
/**
|
|
869
|
+
* Guards for attributes.
|
|
870
|
+
*/
|
|
871
|
+
[DOMAspect.attribute]?: DOMSinkGuards;
|
|
872
|
+
/**
|
|
873
|
+
* Guards for boolean attributes.
|
|
874
|
+
*/
|
|
875
|
+
[DOMAspect.booleanAttribute]?: DOMSinkGuards;
|
|
876
|
+
/**
|
|
877
|
+
* Guards for properties.
|
|
878
|
+
*/
|
|
879
|
+
[DOMAspect.property]?: DOMSinkGuards;
|
|
880
|
+
/**
|
|
881
|
+
* Guards for content.
|
|
882
|
+
*/
|
|
883
|
+
[DOMAspect.content]?: DOMSinkGuards;
|
|
884
|
+
/**
|
|
885
|
+
* Guards for token list manipulation.
|
|
886
|
+
*/
|
|
887
|
+
[DOMAspect.tokenList]?: DOMSinkGuards;
|
|
888
|
+
/**
|
|
889
|
+
* Guards for events.
|
|
890
|
+
*/
|
|
891
|
+
[DOMAspect.event]?: DOMSinkGuards;
|
|
892
|
+
};
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* Element-specific guards for a DOM Policy.
|
|
896
|
+
* @public
|
|
897
|
+
*/
|
|
898
|
+
export declare type DOMElementGuards = Record<string, DOMAspectGuards>;
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Guard configuration for a DOM Policy.
|
|
902
|
+
* @public
|
|
903
|
+
*/
|
|
904
|
+
export declare type DOMGuards = {
|
|
905
|
+
/**
|
|
906
|
+
* Guards for specific elements.
|
|
907
|
+
*/
|
|
908
|
+
elements: DOMElementGuards;
|
|
909
|
+
/**
|
|
910
|
+
* General aspect guards independent of the element type.
|
|
911
|
+
*/
|
|
912
|
+
aspects: DOMAspectGuards;
|
|
913
|
+
};
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* A helper for creating DOM policies.
|
|
917
|
+
* @public
|
|
918
|
+
*/
|
|
919
|
+
export declare const DOMPolicy: Readonly<{
|
|
920
|
+
/**
|
|
921
|
+
* Creates a new DOM Policy object.
|
|
922
|
+
* @param options - The options to use in creating the policy.
|
|
923
|
+
* @returns The newly created DOMPolicy.
|
|
924
|
+
*/
|
|
925
|
+
create(options?: DOMPolicyOptions): Readonly<DOMPolicy_2>;
|
|
926
|
+
}>;
|
|
927
|
+
|
|
807
928
|
/**
|
|
808
929
|
* A security policy that FAST can use to interact with the DOM.
|
|
809
930
|
* @public
|
|
810
931
|
*/
|
|
811
|
-
|
|
932
|
+
declare interface DOMPolicy_2 {
|
|
812
933
|
/**
|
|
813
934
|
* Creates safe HTML from the provided value.
|
|
814
935
|
* @param value - The source to convert to safe HTML.
|
|
@@ -824,17 +945,42 @@ export declare interface DOMPolicy {
|
|
|
824
945
|
protect(tagName: string | null, aspect: DOMAspect, aspectName: string, sink: DOMSink): DOMSink;
|
|
825
946
|
}
|
|
826
947
|
|
|
948
|
+
/**
|
|
949
|
+
* Options for creating a DOM Policy.
|
|
950
|
+
* @public
|
|
951
|
+
*/
|
|
952
|
+
export declare type DOMPolicyOptions = {
|
|
953
|
+
/**
|
|
954
|
+
* The trusted type to use for HTML creation.
|
|
955
|
+
*/
|
|
956
|
+
trustedType?: TrustedTypesPolicy;
|
|
957
|
+
/**
|
|
958
|
+
* The DOM guards used to override or extend the defaults.
|
|
959
|
+
*/
|
|
960
|
+
guards?: Partial<DOMGuards>;
|
|
961
|
+
};
|
|
962
|
+
|
|
827
963
|
/**
|
|
828
964
|
* A function used to send values to a DOM sink.
|
|
829
965
|
* @public
|
|
830
966
|
*/
|
|
831
967
|
export declare type DOMSink = (target: Node, aspectName: string, value: any, ...args: any[]) => void;
|
|
832
968
|
|
|
969
|
+
/**
|
|
970
|
+
* A specific DOM sink guard for a node aspect.
|
|
971
|
+
* @public
|
|
972
|
+
*/
|
|
973
|
+
export declare type DOMSinkGuards = Record<string, (tagName: string | null, aspect: DOMAspect, aspectName: string, sink: DOMSink) => DOMSink>;
|
|
974
|
+
|
|
833
975
|
/**
|
|
834
976
|
* Controls the lifecycle and rendering of a `FASTElement`.
|
|
835
977
|
* @public
|
|
836
978
|
*/
|
|
837
|
-
export declare class ElementController<TElement extends HTMLElement = HTMLElement>
|
|
979
|
+
export declare class ElementController<TElement extends HTMLElement = HTMLElement> implements Notifier, HostController<TElement> {
|
|
980
|
+
/**
|
|
981
|
+
* Internal notifier used to delegate subscriber management.
|
|
982
|
+
*/
|
|
983
|
+
private _notifier;
|
|
838
984
|
/**
|
|
839
985
|
* A map of observable properties that were set on the element before upgrade.
|
|
840
986
|
*/
|
|
@@ -847,6 +993,26 @@ export declare class ElementController<TElement extends HTMLElement = HTMLElemen
|
|
|
847
993
|
* Indicates whether the element has an existing shadow root (e.g. from declarative shadow DOM).
|
|
848
994
|
*/
|
|
849
995
|
protected hasExistingShadowRoot: boolean;
|
|
996
|
+
/**
|
|
997
|
+
* Resolves the isPrerendered promise.
|
|
998
|
+
*/
|
|
999
|
+
private _resolvePrerendered;
|
|
1000
|
+
/**
|
|
1001
|
+
* Resolves the isHydrated promise.
|
|
1002
|
+
*/
|
|
1003
|
+
private _resolveHydrated;
|
|
1004
|
+
/**
|
|
1005
|
+
* Resolves `true` when the element had an existing shadow root
|
|
1006
|
+
* (from SSR or declarative shadow DOM) at connect time, `false`
|
|
1007
|
+
* otherwise.
|
|
1008
|
+
*/
|
|
1009
|
+
readonly isPrerendered: Promise<boolean>;
|
|
1010
|
+
/**
|
|
1011
|
+
* Resolves `true` after prerendered content has been successfully
|
|
1012
|
+
* hydrated, or `false` when the component is client-side rendered
|
|
1013
|
+
* or hydration is not enabled.
|
|
1014
|
+
*/
|
|
1015
|
+
readonly isHydrated: Promise<boolean>;
|
|
850
1016
|
/**
|
|
851
1017
|
* The template used to render the component.
|
|
852
1018
|
*/
|
|
@@ -946,6 +1112,27 @@ export declare class ElementController<TElement extends HTMLElement = HTMLElemen
|
|
|
946
1112
|
* @internal
|
|
947
1113
|
*/
|
|
948
1114
|
constructor(element: TElement, definition: FASTElementDefinition);
|
|
1115
|
+
/**
|
|
1116
|
+
* The subject that subscribers will receive notifications for.
|
|
1117
|
+
*/
|
|
1118
|
+
get subject(): TElement;
|
|
1119
|
+
/**
|
|
1120
|
+
* Notifies all subscribers of a property change.
|
|
1121
|
+
* @param args - The property name that changed.
|
|
1122
|
+
*/
|
|
1123
|
+
notify(args: any): void;
|
|
1124
|
+
/**
|
|
1125
|
+
* Subscribes to notification of changes in the element's state.
|
|
1126
|
+
* @param subscriber - The object that is subscribing for change notification.
|
|
1127
|
+
* @param propertyToWatch - The name of the property to watch for changes.
|
|
1128
|
+
*/
|
|
1129
|
+
subscribe(subscriber: Subscriber, propertyToWatch?: any): void;
|
|
1130
|
+
/**
|
|
1131
|
+
* Unsubscribes from notification of changes in the element's state.
|
|
1132
|
+
* @param subscriber - The object that is unsubscribing from change notification.
|
|
1133
|
+
* @param propertyToUnwatch - The name of the property to unsubscribe from.
|
|
1134
|
+
*/
|
|
1135
|
+
unsubscribe(subscriber: Subscriber, propertyToUnwatch?: any): void;
|
|
949
1136
|
/**
|
|
950
1137
|
* Registers an unbind handler with the controller.
|
|
951
1138
|
* @param behavior - An object to call when the controller unbinds.
|
|
@@ -982,6 +1169,22 @@ export declare class ElementController<TElement extends HTMLElement = HTMLElemen
|
|
|
982
1169
|
* Binds any observables that were set before upgrade.
|
|
983
1170
|
*/
|
|
984
1171
|
protected bindObservables(): void;
|
|
1172
|
+
/**
|
|
1173
|
+
* Captures own-properties that shadow observable accessors on the prototype so
|
|
1174
|
+
* they can be rebound through the accessor before rendering.
|
|
1175
|
+
*/
|
|
1176
|
+
protected captureBoundObservables(): void;
|
|
1177
|
+
/**
|
|
1178
|
+
* Synchronizes late-defined attribute-map attributes from the live DOM to the
|
|
1179
|
+
* associated property values before the initial render occurs.
|
|
1180
|
+
*/
|
|
1181
|
+
protected syncLateAttributes(): void;
|
|
1182
|
+
/**
|
|
1183
|
+
* Observes late-defined attribute-map attributes that the platform does not
|
|
1184
|
+
* surface through attributeChangedCallback because they were added after
|
|
1185
|
+
* customElements.define() completed.
|
|
1186
|
+
*/
|
|
1187
|
+
protected observeLateAttributes(): void;
|
|
985
1188
|
/**
|
|
986
1189
|
* Connects any existing behaviors on the associated element.
|
|
987
1190
|
*/
|
|
@@ -1018,6 +1221,11 @@ export declare class ElementController<TElement extends HTMLElement = HTMLElemen
|
|
|
1018
1221
|
* If `null` is provided, any existing view will be removed.
|
|
1019
1222
|
*/
|
|
1020
1223
|
protected renderTemplate(template: ElementViewTemplate | null | undefined): void;
|
|
1224
|
+
/**
|
|
1225
|
+
* Standard client-side render: clears any stale content, clones the
|
|
1226
|
+
* compiled fragment, binds, and appends to the host.
|
|
1227
|
+
*/
|
|
1228
|
+
private renderClientSide;
|
|
1021
1229
|
/**
|
|
1022
1230
|
* Locates or creates a controller for the specified element.
|
|
1023
1231
|
* @param element - The element to return the controller for.
|
|
@@ -1034,6 +1242,18 @@ export declare class ElementController<TElement extends HTMLElement = HTMLElemen
|
|
|
1034
1242
|
* @param strategy - The strategy to use.
|
|
1035
1243
|
*/
|
|
1036
1244
|
static setStrategy(strategy: ElementControllerStrategy): void;
|
|
1245
|
+
/**
|
|
1246
|
+
* A hook that, when set, handles prerendered content hydration.
|
|
1247
|
+
* Called by renderTemplate when an existing shadow root is detected.
|
|
1248
|
+
* Returns true if hydration was performed, false to fall back to client-side.
|
|
1249
|
+
* @internal
|
|
1250
|
+
*/
|
|
1251
|
+
private static hydrationHook;
|
|
1252
|
+
/**
|
|
1253
|
+
* Installs the hydration hook. Called by enableHydration().
|
|
1254
|
+
* @internal
|
|
1255
|
+
*/
|
|
1256
|
+
static installHydrationHook(hook: (controller: ElementController, template: ElementViewTemplate, element: HTMLElement, host: Node) => boolean): void;
|
|
1037
1257
|
}
|
|
1038
1258
|
|
|
1039
1259
|
/**
|
|
@@ -1066,10 +1286,6 @@ export declare class ElementStyles {
|
|
|
1066
1286
|
readonly styles: ReadonlyArray<ComposableStyles>;
|
|
1067
1287
|
private targets;
|
|
1068
1288
|
private _strategy;
|
|
1069
|
-
/**
|
|
1070
|
-
* The behaviors associated with this set of styles.
|
|
1071
|
-
*/
|
|
1072
|
-
readonly behaviors: ReadonlyArray<HostBehavior<HTMLElement>> | null;
|
|
1073
1289
|
/**
|
|
1074
1290
|
* Gets the StyleStrategy associated with these element styles.
|
|
1075
1291
|
*/
|
|
@@ -1085,11 +1301,6 @@ export declare class ElementStyles {
|
|
|
1085
1301
|
removeStylesFrom(target: StyleTarget): void;
|
|
1086
1302
|
/** @internal */
|
|
1087
1303
|
isAttachedTo(target: StyleTarget): boolean;
|
|
1088
|
-
/**
|
|
1089
|
-
* Associates behaviors with this set of styles.
|
|
1090
|
-
* @param behaviors - The behaviors to associate.
|
|
1091
|
-
*/
|
|
1092
|
-
withBehaviors(...behaviors: HostBehavior<HTMLElement>[]): this;
|
|
1093
1304
|
/**
|
|
1094
1305
|
* Sets the strategy that handles adding/removing these styles for an element.
|
|
1095
1306
|
* @param strategy - The strategy to use.
|
|
@@ -1164,6 +1375,20 @@ export declare interface ElementViewTemplate<TSource = any, TParent = any> {
|
|
|
1164
1375
|
*/
|
|
1165
1376
|
export declare const emptyArray: readonly never[];
|
|
1166
1377
|
|
|
1378
|
+
/**
|
|
1379
|
+
* Enables human-readable FAST debug messages.
|
|
1380
|
+
* @public
|
|
1381
|
+
*/
|
|
1382
|
+
export declare function enableDebug(): void;
|
|
1383
|
+
|
|
1384
|
+
/**
|
|
1385
|
+
* A path discovered from an event binding.
|
|
1386
|
+
* @public
|
|
1387
|
+
*/
|
|
1388
|
+
export declare interface EventCachedPath extends CachedPathCommon {
|
|
1389
|
+
type: "event";
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1167
1392
|
/**
|
|
1168
1393
|
* Provides additional contextual information available to behaviors and expressions.
|
|
1169
1394
|
* @public
|
|
@@ -1323,10 +1548,28 @@ export declare interface ExpressionObserver<TSource = any, TReturn = any, TParen
|
|
|
1323
1548
|
}
|
|
1324
1549
|
|
|
1325
1550
|
/**
|
|
1326
|
-
* The FAST
|
|
1551
|
+
* The FAST messaging API for warnings and errors.
|
|
1327
1552
|
* @public
|
|
1328
1553
|
*/
|
|
1329
|
-
export declare const FAST:
|
|
1554
|
+
export declare const FAST: {
|
|
1555
|
+
/**
|
|
1556
|
+
* Sends a warning to the developer.
|
|
1557
|
+
* @param code - The warning code to send.
|
|
1558
|
+
* @param values - Values relevant for the warning message.
|
|
1559
|
+
*/
|
|
1560
|
+
warn(_code: number, _values?: Record<string, any>): void;
|
|
1561
|
+
/**
|
|
1562
|
+
* Creates an error from a code.
|
|
1563
|
+
* @param code - The error code.
|
|
1564
|
+
* @param values - Values relevant for the error message.
|
|
1565
|
+
*/
|
|
1566
|
+
error(code: number, _values?: Record<string, any>): Error;
|
|
1567
|
+
/**
|
|
1568
|
+
* Adds debug messages for errors and warnings.
|
|
1569
|
+
* @param messages - The message dictionary to add.
|
|
1570
|
+
*/
|
|
1571
|
+
addMessages(messages: Record<number, string>): void;
|
|
1572
|
+
};
|
|
1330
1573
|
|
|
1331
1574
|
/**
|
|
1332
1575
|
* Represents a custom element based on the FASTElement infrastructure.
|
|
@@ -1382,7 +1625,6 @@ export declare const FASTElement: {
|
|
|
1382
1625
|
new (): FASTElement;
|
|
1383
1626
|
define: typeof define;
|
|
1384
1627
|
compose: typeof compose;
|
|
1385
|
-
defineAsync: typeof defineAsync;
|
|
1386
1628
|
from: typeof from;
|
|
1387
1629
|
};
|
|
1388
1630
|
|
|
@@ -1419,12 +1661,7 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
|
|
|
1419
1661
|
/**
|
|
1420
1662
|
* The template to render for the custom element.
|
|
1421
1663
|
*/
|
|
1422
|
-
template?: ElementViewTemplate
|
|
1423
|
-
/**
|
|
1424
|
-
* The template options.
|
|
1425
|
-
* @alpha
|
|
1426
|
-
*/
|
|
1427
|
-
templateOptions?: TemplateOptions;
|
|
1664
|
+
template?: ElementViewTemplate<InstanceType<TType>>;
|
|
1428
1665
|
/**
|
|
1429
1666
|
* The styles to associate with the custom element.
|
|
1430
1667
|
*/
|
|
@@ -1445,6 +1682,12 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
|
|
|
1445
1682
|
* Lifecycle callbacks for template events.
|
|
1446
1683
|
*/
|
|
1447
1684
|
readonly lifecycleCallbacks?: TemplateLifecycleCallbacks;
|
|
1685
|
+
/**
|
|
1686
|
+
* The optional schema associated with the custom element definition.
|
|
1687
|
+
* Declarative templates assign this automatically during template resolution.
|
|
1688
|
+
* Non-declarative callers can provide one for schema-driven extensions.
|
|
1689
|
+
*/
|
|
1690
|
+
schema?: Schema;
|
|
1448
1691
|
/**
|
|
1449
1692
|
* The definition has been registered to the FAST element registry.
|
|
1450
1693
|
*/
|
|
@@ -1453,17 +1696,19 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
|
|
|
1453
1696
|
/**
|
|
1454
1697
|
* Defines a custom element based on this definition.
|
|
1455
1698
|
* @param registry - The element registry to define the element in.
|
|
1699
|
+
* @param extensions - An optional array of extension callbacks to invoke
|
|
1700
|
+
* with this definition before platform registration.
|
|
1456
1701
|
* @remarks
|
|
1457
1702
|
* This operation is idempotent per registry.
|
|
1458
1703
|
*/
|
|
1459
|
-
define(registry?: CustomElementRegistry): this;
|
|
1704
|
+
define(registry?: CustomElementRegistry, extensions?: FASTElementExtension[]): this;
|
|
1460
1705
|
/**
|
|
1461
1706
|
* Creates an instance of FASTElementDefinition.
|
|
1462
1707
|
* @param type - The type this definition is being created for.
|
|
1463
1708
|
* @param nameOrDef - The name of the element to define or a config object
|
|
1464
1709
|
* that describes the element to define.
|
|
1465
1710
|
*/
|
|
1466
|
-
static compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType
|
|
1711
|
+
static compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition<TType>): Promise<FASTElementDefinition<TType>>;
|
|
1467
1712
|
/**
|
|
1468
1713
|
* Registers a FASTElement base type.
|
|
1469
1714
|
* @param type - The type to register as a base type.
|
|
@@ -1485,19 +1730,17 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
|
|
|
1485
1730
|
* @param name - The name of the defined custom element.
|
|
1486
1731
|
* @alpha
|
|
1487
1732
|
*/
|
|
1488
|
-
static
|
|
1489
|
-
/**
|
|
1490
|
-
* Creates an instance of FASTElementDefinition asynchronously. This option assumes
|
|
1491
|
-
* that a template and shadowOptions will be provided and completes when those requirements
|
|
1492
|
-
* are met.
|
|
1493
|
-
* @param type - The type this definition is being created for.
|
|
1494
|
-
* @param nameOrDef - The name of the element to define or a config object
|
|
1495
|
-
* that describes the element to define.
|
|
1496
|
-
* @alpha
|
|
1497
|
-
*/
|
|
1498
|
-
static composeAsync<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): Promise<FASTElementDefinition<TType>>;
|
|
1733
|
+
static register: (name: string, registry?: CustomElementRegistry) => Promise<Function>;
|
|
1499
1734
|
}
|
|
1500
1735
|
|
|
1736
|
+
/**
|
|
1737
|
+
* A callback that receives a FASTElementDefinition during element registration.
|
|
1738
|
+
* Extensions are invoked before the element is registered with the platform,
|
|
1739
|
+
* allowing plugins to inspect or act on the resolved definition.
|
|
1740
|
+
* @public
|
|
1741
|
+
*/
|
|
1742
|
+
export declare type FASTElementExtension = (definition: FASTElementDefinition) => void;
|
|
1743
|
+
|
|
1501
1744
|
/**
|
|
1502
1745
|
* The FAST custom element registry
|
|
1503
1746
|
* @internal
|
|
@@ -1505,42 +1748,10 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
|
|
|
1505
1748
|
export declare const fastElementRegistry: TypeRegistry<FASTElementDefinition>;
|
|
1506
1749
|
|
|
1507
1750
|
/**
|
|
1508
|
-
*
|
|
1751
|
+
* Resolves an element template from a composed definition.
|
|
1509
1752
|
* @public
|
|
1510
1753
|
*/
|
|
1511
|
-
export declare
|
|
1512
|
-
/**
|
|
1513
|
-
* The list of loaded versions.
|
|
1514
|
-
*/
|
|
1515
|
-
readonly versions: string[];
|
|
1516
|
-
/**
|
|
1517
|
-
* Gets a kernel value.
|
|
1518
|
-
* @param id - The id to get the value for.
|
|
1519
|
-
* @param initialize - Creates the initial value for the id if not already existing.
|
|
1520
|
-
*/
|
|
1521
|
-
getById<T>(id: string | number): T | null;
|
|
1522
|
-
getById<T>(id: string | number, initialize: () => T): T;
|
|
1523
|
-
/**
|
|
1524
|
-
* Sends a warning to the developer.
|
|
1525
|
-
* @param code - The warning code to send.
|
|
1526
|
-
* @param values - Values relevant for the warning message.
|
|
1527
|
-
*/
|
|
1528
|
-
warn(code: number, values?: Record<string, any>): void;
|
|
1529
|
-
/**
|
|
1530
|
-
* Creates an error.
|
|
1531
|
-
* @param code - The error code to send.
|
|
1532
|
-
* @param values - Values relevant for the error message.
|
|
1533
|
-
*/
|
|
1534
|
-
error(code: number, values?: Record<string, any>): Error;
|
|
1535
|
-
/**
|
|
1536
|
-
* Adds debug messages for errors and warnings.
|
|
1537
|
-
* @param messages - The message dictionary to add.
|
|
1538
|
-
* @remarks
|
|
1539
|
-
* Message can include placeholders like $\{name\} which can be
|
|
1540
|
-
* replaced by values passed at runtime.
|
|
1541
|
-
*/
|
|
1542
|
-
addMessages(messages: Record<number, string>): void;
|
|
1543
|
-
}
|
|
1754
|
+
export declare type FASTElementTemplateResolver<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> = (definition: FASTElementDefinition<TType>) => ElementViewTemplate<InstanceType<TType>> | Promise<ElementViewTemplate<InstanceType<TType>>>;
|
|
1544
1755
|
|
|
1545
1756
|
declare function from<TBase extends typeof HTMLElement>(BaseType: TBase): new () => InstanceType<TBase> & FASTElement;
|
|
1546
1757
|
|
|
@@ -1654,7 +1865,7 @@ export declare class HTMLBindingDirective implements HTMLDirective, ViewBehavior
|
|
|
1654
1865
|
/**
|
|
1655
1866
|
* The policy that the created behavior must run under.
|
|
1656
1867
|
*/
|
|
1657
|
-
policy:
|
|
1868
|
+
policy: DOMPolicy_2;
|
|
1658
1869
|
/**
|
|
1659
1870
|
* The original source aspect exactly as represented in markup.
|
|
1660
1871
|
*/
|
|
@@ -1841,6 +2052,24 @@ export declare class HTMLView<TSource = any, TParent = any> extends DefaultExecu
|
|
|
1841
2052
|
* Indicates how the source's lifetime relates to the controller's lifetime.
|
|
1842
2053
|
*/
|
|
1843
2054
|
readonly sourceLifetime: SourceLifetime;
|
|
2055
|
+
/**
|
|
2056
|
+
* When true, directives skip attribute/booleanAttribute DOM
|
|
2057
|
+
* updates during bind(). Set only during the prerendered bind
|
|
2058
|
+
* window and cleared immediately after.
|
|
2059
|
+
* @internal
|
|
2060
|
+
*/
|
|
2061
|
+
_skipAttrUpdates: boolean;
|
|
2062
|
+
/**
|
|
2063
|
+
* A promise that resolves with `true` after prerendered content
|
|
2064
|
+
* has been hydrated, or `false` when the view is client-side
|
|
2065
|
+
* rendered. Resolves once the first bind completes.
|
|
2066
|
+
*/
|
|
2067
|
+
isPrerendered: Promise<boolean>;
|
|
2068
|
+
/**
|
|
2069
|
+
* Resolves `true` after prerendered content has been hydrated,
|
|
2070
|
+
* `false` when client-side rendered or hydration not enabled.
|
|
2071
|
+
*/
|
|
2072
|
+
isHydrated: Promise<boolean>;
|
|
1844
2073
|
/**
|
|
1845
2074
|
* The execution context the view is running within.
|
|
1846
2075
|
*/
|
|
@@ -1903,233 +2132,12 @@ export declare class HTMLView<TSource = any, TParent = any> extends DefaultExecu
|
|
|
1903
2132
|
* Unbinds a view's behaviors from its binding source.
|
|
1904
2133
|
*/
|
|
1905
2134
|
unbind(): void;
|
|
1906
|
-
private evaluateUnbindables;
|
|
1907
|
-
/**
|
|
1908
|
-
* Efficiently disposes of a contiguous range of synthetic view instances.
|
|
1909
|
-
* @param views - A contiguous range of views to be disposed.
|
|
1910
|
-
*/
|
|
1911
|
-
static disposeContiguousBatch(views: SyntheticView[]): void;
|
|
1912
|
-
}
|
|
1913
|
-
|
|
1914
|
-
/**
|
|
1915
|
-
* @internal
|
|
1916
|
-
*/
|
|
1917
|
-
declare const Hydratable: unique symbol;
|
|
1918
|
-
|
|
1919
|
-
declare interface HydratableContentTemplate extends ContentTemplate {
|
|
1920
|
-
/**
|
|
1921
|
-
* Hydrates a content view from first/last nodes.
|
|
1922
|
-
*/
|
|
1923
|
-
hydrate(first: Node, last: Node): ContentView;
|
|
1924
|
-
}
|
|
1925
|
-
|
|
1926
|
-
/**
|
|
1927
|
-
* An ElementController capable of hydrating FAST elements from
|
|
1928
|
-
* Declarative Shadow DOM.
|
|
1929
|
-
*
|
|
1930
|
-
* @beta
|
|
1931
|
-
*/
|
|
1932
|
-
export declare class HydratableElementController<TElement extends HTMLElement = HTMLElement> extends ElementController<TElement> {
|
|
1933
|
-
/**
|
|
1934
|
-
* Controls whether the controller will hydrate during the connect() method.
|
|
1935
|
-
* Initialized during the first connect() call to true when the `needs-hydration`
|
|
1936
|
-
* attribute is present on the element.
|
|
1937
|
-
*/
|
|
1938
|
-
protected needsHydration?: boolean;
|
|
1939
|
-
private static hydrationObserver;
|
|
1940
|
-
/**
|
|
1941
|
-
* {@inheritdoc ElementController.shadowOptions}
|
|
1942
|
-
*/
|
|
1943
|
-
get shadowOptions(): ShadowRootOptions | undefined;
|
|
1944
|
-
set shadowOptions(value: ShadowRootOptions | undefined);
|
|
1945
|
-
/**
|
|
1946
|
-
* Lifecycle callbacks for hydration events
|
|
1947
|
-
*/
|
|
1948
|
-
static lifecycleCallbacks: HydrationControllerCallbacks;
|
|
1949
|
-
/**
|
|
1950
|
-
* Whether the hydrationStarted callback has already been invoked.
|
|
1951
|
-
*/
|
|
1952
|
-
private static hydrationStarted;
|
|
1953
|
-
/**
|
|
1954
|
-
* An idle callback ID used to track hydration completion
|
|
1955
|
-
*/
|
|
1956
|
-
private static idleCallbackId;
|
|
1957
|
-
/**
|
|
1958
|
-
* Adds the current element instance to the hydrating instances map
|
|
1959
|
-
*/
|
|
1960
|
-
private addHydratingInstance;
|
|
1961
|
-
/**
|
|
1962
|
-
* Configure lifecycle callbacks for hydration events
|
|
1963
|
-
*/
|
|
1964
|
-
static config(callbacks: HydrationControllerCallbacks): typeof HydratableElementController;
|
|
1965
|
-
private static hydrationObserverHandler;
|
|
1966
|
-
/**
|
|
1967
|
-
* Checks to see if hydration is complete and if so, invokes the hydrationComplete callback.
|
|
1968
|
-
* Then resets the ElementController strategy to the default so that future elements
|
|
1969
|
-
* don't use the HydratableElementController.
|
|
1970
|
-
*
|
|
1971
|
-
* @param deadline - the idle deadline object
|
|
1972
|
-
*/
|
|
1973
|
-
private static checkHydrationComplete;
|
|
1974
|
-
/**
|
|
1975
|
-
* Runs connected lifecycle behavior on the associated element.
|
|
1976
|
-
*/
|
|
1977
|
-
connect(): void;
|
|
1978
|
-
/**
|
|
1979
|
-
* A map of element instances by the name of the custom element they are
|
|
1980
|
-
* associated with. The key is the custom element name, and the value is the
|
|
1981
|
-
* instances of hydratable elements which currently need to be hydrated.
|
|
1982
|
-
*
|
|
1983
|
-
* When all of the instances in the set have been hydrated, the set is
|
|
1984
|
-
* cleared and removed from the map. If the map is empty, the
|
|
1985
|
-
* hydrationComplete callback is invoked.
|
|
1986
|
-
*/
|
|
1987
|
-
private static hydratingInstances?;
|
|
1988
|
-
/**
|
|
1989
|
-
* Removes the current element instance from the hydrating instances map
|
|
1990
|
-
*/
|
|
1991
|
-
private removeHydratingInstance;
|
|
1992
|
-
/**
|
|
1993
|
-
* Unregisters the hydration observer when the element is disconnected.
|
|
1994
|
-
*/
|
|
1995
|
-
disconnect(): void;
|
|
1996
|
-
/**
|
|
1997
|
-
* Sets the ElementController strategy to HydratableElementController.
|
|
1998
|
-
* @remarks
|
|
1999
|
-
* This method is typically called during application startup to enable
|
|
2000
|
-
* hydration support for FAST elements.
|
|
2001
|
-
*/
|
|
2002
|
-
static install(): void;
|
|
2003
|
-
}
|
|
2004
|
-
|
|
2005
|
-
declare interface HydratableElementViewTemplate<TSource = any, TParent = any> extends ElementViewTemplate<TSource, TParent> {
|
|
2006
|
-
hydrate(firstChild: Node, lastChild: Node, hostBindingTarget?: Element): ElementView<TSource, TParent>;
|
|
2007
|
-
}
|
|
2008
|
-
|
|
2009
|
-
declare interface HydratableSyntheticViewTemplate<TSource = any, TParent = any> extends SyntheticViewTemplate {
|
|
2010
|
-
hydrate(firstChild: Node, lastChild: Node): SyntheticView<TSource, TParent>;
|
|
2011
|
-
}
|
|
2012
|
-
|
|
2013
|
-
/** @public */
|
|
2014
|
-
export declare interface HydratableView<TSource = any, TParent = any> extends ElementView, SyntheticView, DefaultExecutionContext<TParent> {
|
|
2015
|
-
[Hydratable]: symbol;
|
|
2016
|
-
readonly bindingViewBoundaries: Record<string, ViewNodes>;
|
|
2017
|
-
readonly hydrationStage: keyof typeof HydrationStage;
|
|
2018
|
-
}
|
|
2019
|
-
|
|
2020
|
-
/** @public */
|
|
2021
|
-
export declare class HydrationBindingError extends Error {
|
|
2022
|
-
/**
|
|
2023
|
-
* The factory that was unable to be bound
|
|
2024
|
-
*/
|
|
2025
|
-
readonly factory: ViewBehaviorFactory;
|
|
2026
|
-
/**
|
|
2027
|
-
* A DocumentFragment containing a clone of the
|
|
2028
|
-
* view's Nodes.
|
|
2029
|
-
*/
|
|
2030
|
-
readonly fragment: DocumentFragment;
|
|
2031
|
-
/**
|
|
2032
|
-
* String representation of the HTML in the template that
|
|
2033
|
-
* threw the binding error.
|
|
2034
|
-
*/
|
|
2035
|
-
readonly templateString: string;
|
|
2036
|
-
constructor(
|
|
2037
|
-
/**
|
|
2038
|
-
* The error message
|
|
2039
|
-
*/
|
|
2040
|
-
message: string | undefined,
|
|
2041
|
-
/**
|
|
2042
|
-
* The factory that was unable to be bound
|
|
2043
|
-
*/
|
|
2044
|
-
factory: ViewBehaviorFactory,
|
|
2045
|
-
/**
|
|
2046
|
-
* A DocumentFragment containing a clone of the
|
|
2047
|
-
* view's Nodes.
|
|
2048
|
-
*/
|
|
2049
|
-
fragment: DocumentFragment,
|
|
2050
|
-
/**
|
|
2051
|
-
* String representation of the HTML in the template that
|
|
2052
|
-
* threw the binding error.
|
|
2053
|
-
*/
|
|
2054
|
-
templateString: string);
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2057
|
-
/**
|
|
2058
|
-
* Lifecycle callbacks for element hydration events
|
|
2059
|
-
* @public
|
|
2060
|
-
*/
|
|
2061
|
-
export declare interface HydrationControllerCallbacks<TElement extends HTMLElement = HTMLElement> {
|
|
2062
|
-
/**
|
|
2063
|
-
* Called once when the first element enters the hydration pipeline.
|
|
2064
|
-
* This is the earliest point at which we know a component has been
|
|
2065
|
-
* async-defined with `defer-and-hydrate`, a template is pending via
|
|
2066
|
-
* `<f-template>`, and the element has `needs-hydration`.
|
|
2067
|
-
*/
|
|
2068
|
-
hydrationStarted?(): void;
|
|
2069
|
-
/**
|
|
2070
|
-
* Called before an individual element's hydration begins
|
|
2071
|
-
*/
|
|
2072
|
-
elementWillHydrate?(source: TElement): void;
|
|
2073
|
-
/**
|
|
2074
|
-
* Called after an individual element's hydration has finished
|
|
2075
|
-
*/
|
|
2076
|
-
elementDidHydrate?(source: TElement): void;
|
|
2077
|
-
/**
|
|
2078
|
-
* Called after all elements have completed hydration
|
|
2079
|
-
*/
|
|
2080
|
-
hydrationComplete?(): void;
|
|
2081
|
-
}
|
|
2082
|
-
|
|
2083
|
-
declare const HydrationStage: {
|
|
2084
|
-
readonly unhydrated: "unhydrated";
|
|
2085
|
-
readonly hydrating: "hydrating";
|
|
2086
|
-
readonly hydrated: "hydrated";
|
|
2087
|
-
};
|
|
2088
|
-
|
|
2089
|
-
declare class HydrationView<TSource = any, TParent = any> extends DefaultExecutionContext<TParent> implements HydratableView {
|
|
2090
|
-
readonly firstChild: Node;
|
|
2091
|
-
readonly lastChild: Node;
|
|
2092
|
-
private sourceTemplate;
|
|
2093
|
-
private hostBindingTarget?;
|
|
2094
|
-
[Hydratable]: symbol;
|
|
2095
|
-
context: ExecutionContext<any>;
|
|
2096
|
-
source: TSource | null;
|
|
2097
|
-
isBound: boolean;
|
|
2098
|
-
get hydrationStage(): "unhydrated" | "hydrating" | "hydrated";
|
|
2099
|
-
get targets(): ViewBehaviorTargets;
|
|
2100
|
-
get bindingViewBoundaries(): ViewBehaviorBoundaries;
|
|
2101
|
-
readonly sourceLifetime: SourceLifetime;
|
|
2102
|
-
private unbindables;
|
|
2103
|
-
private fragment;
|
|
2104
|
-
private behaviors;
|
|
2105
|
-
private factories;
|
|
2106
|
-
private _hydrationStage;
|
|
2107
|
-
private _bindingViewBoundaries;
|
|
2108
|
-
private _targets;
|
|
2109
|
-
constructor(firstChild: Node, lastChild: Node, sourceTemplate: ViewTemplate, hostBindingTarget?: Element | undefined);
|
|
2110
|
-
/**
|
|
2111
|
-
* no-op. Hydrated views are don't need to be moved from a documentFragment
|
|
2112
|
-
* to the target node.
|
|
2113
|
-
*/
|
|
2114
|
-
insertBefore(node: Node): void;
|
|
2115
|
-
/**
|
|
2116
|
-
* Appends the view to a node. In cases where this is called before the
|
|
2117
|
-
* view has been removed, the method will no-op.
|
|
2118
|
-
* @param node - the node to append the view to.
|
|
2119
|
-
*/
|
|
2120
|
-
appendTo(node: Node): void;
|
|
2121
|
-
remove(): void;
|
|
2122
|
-
bind(source: TSource, context?: ExecutionContext<any>): void;
|
|
2123
|
-
unbind(): void;
|
|
2135
|
+
private evaluateUnbindables;
|
|
2124
2136
|
/**
|
|
2125
|
-
*
|
|
2126
|
-
*
|
|
2137
|
+
* Efficiently disposes of a contiguous range of synthetic view instances.
|
|
2138
|
+
* @param views - A contiguous range of views to be disposed.
|
|
2127
2139
|
*/
|
|
2128
|
-
|
|
2129
|
-
onUnbind(behavior: {
|
|
2130
|
-
unbind(controller: ViewController<TSource, TParent>): void;
|
|
2131
|
-
}): void;
|
|
2132
|
-
private evaluateUnbindables;
|
|
2140
|
+
static disposeContiguousBatch(views: SyntheticView[]): void;
|
|
2133
2141
|
}
|
|
2134
2142
|
|
|
2135
2143
|
/**
|
|
@@ -2156,20 +2164,41 @@ export declare class InlineTemplateDirective implements HTMLDirective {
|
|
|
2156
2164
|
}
|
|
2157
2165
|
|
|
2158
2166
|
/**
|
|
2159
|
-
*
|
|
2160
|
-
*
|
|
2161
|
-
* @beta
|
|
2167
|
+
* A JSON schema describing a root property.
|
|
2168
|
+
* @public
|
|
2162
2169
|
*/
|
|
2163
|
-
export declare
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2170
|
+
export declare interface JSONSchema extends JSONSchemaCommon {
|
|
2171
|
+
$schema: string;
|
|
2172
|
+
$id: string;
|
|
2173
|
+
$defs?: Record<string, JSONSchemaDefinition>;
|
|
2174
|
+
}
|
|
2167
2175
|
|
|
2168
|
-
/**
|
|
2169
|
-
|
|
2176
|
+
/**
|
|
2177
|
+
* Common properties shared by schema nodes.
|
|
2178
|
+
* @public
|
|
2179
|
+
*/
|
|
2180
|
+
export declare interface JSONSchemaCommon {
|
|
2181
|
+
type?: string;
|
|
2182
|
+
properties?: any;
|
|
2183
|
+
items?: any;
|
|
2184
|
+
anyOf?: Array<any>;
|
|
2185
|
+
$ref?: string;
|
|
2186
|
+
/**
|
|
2187
|
+
* Stamped by `applyConfigToSchema` when an `ObserverMapConfig` excludes
|
|
2188
|
+
* this path. When `false`, the proxy system skips observation for this
|
|
2189
|
+
* node and (if all descendants are also `false`) its subtree.
|
|
2190
|
+
*/
|
|
2191
|
+
$observe?: boolean;
|
|
2192
|
+
}
|
|
2170
2193
|
|
|
2171
|
-
/**
|
|
2172
|
-
|
|
2194
|
+
/**
|
|
2195
|
+
* A reusable JSON schema definition.
|
|
2196
|
+
* @public
|
|
2197
|
+
*/
|
|
2198
|
+
export declare interface JSONSchemaDefinition extends JSONSchemaCommon {
|
|
2199
|
+
$fast_context: string;
|
|
2200
|
+
$fast_parent_contexts: Array<string>;
|
|
2201
|
+
}
|
|
2173
2202
|
|
|
2174
2203
|
/**
|
|
2175
2204
|
* Observes array lengths.
|
|
@@ -2230,12 +2259,6 @@ export declare const Markup: Readonly<{
|
|
|
2230
2259
|
comment: (id: string) => string;
|
|
2231
2260
|
}>;
|
|
2232
2261
|
|
|
2233
|
-
/**
|
|
2234
|
-
* The attribute used to indicate that an element needs hydration.
|
|
2235
|
-
* @public
|
|
2236
|
-
*/
|
|
2237
|
-
export declare const needsHydrationAttribute = "needs-hydration";
|
|
2238
|
-
|
|
2239
2262
|
/**
|
|
2240
2263
|
* Options for configuring node observation behavior.
|
|
2241
2264
|
* @public
|
|
@@ -2474,7 +2497,7 @@ export declare interface ObservationRecord {
|
|
|
2474
2497
|
* @returns A binding configuration.
|
|
2475
2498
|
* @public
|
|
2476
2499
|
*/
|
|
2477
|
-
export declare function oneTime<T = any>(expression: Expression<T>, policy?:
|
|
2500
|
+
export declare function oneTime<T = any>(expression: Expression<T>, policy?: DOMPolicy_2): Binding<T>;
|
|
2478
2501
|
|
|
2479
2502
|
/**
|
|
2480
2503
|
* Creates an standard binding.
|
|
@@ -2484,7 +2507,33 @@ export declare function oneTime<T = any>(expression: Expression<T>, policy?: DOM
|
|
|
2484
2507
|
* @returns A binding configuration.
|
|
2485
2508
|
* @public
|
|
2486
2509
|
*/
|
|
2487
|
-
export declare function oneWay<T = any>(expression: Expression<T>, policy?:
|
|
2510
|
+
export declare function oneWay<T = any>(expression: Expression<T>, policy?: DOMPolicy_2, isVolatile?: boolean): Binding<T>;
|
|
2511
|
+
|
|
2512
|
+
/**
|
|
2513
|
+
* A read/write stateful value associated with an owner.
|
|
2514
|
+
* @beta
|
|
2515
|
+
*/
|
|
2516
|
+
export declare type OwnedState<T> = ReadonlyOwnedState<T> & {
|
|
2517
|
+
/**
|
|
2518
|
+
* Sets
|
|
2519
|
+
* @param owner - The object to set the state for the owner.
|
|
2520
|
+
* @param value - The new state value.
|
|
2521
|
+
*/
|
|
2522
|
+
set(owner: any, value: T): void;
|
|
2523
|
+
/**
|
|
2524
|
+
* Creates a readonly version of the state.
|
|
2525
|
+
*/
|
|
2526
|
+
asReadonly(): ReadonlyOwnedState<T>;
|
|
2527
|
+
};
|
|
2528
|
+
|
|
2529
|
+
/**
|
|
2530
|
+
* Creates a reactive state that has its value associated with a specific owner.
|
|
2531
|
+
* @param value - The initial value or a factory that provides an initial value for each owner.
|
|
2532
|
+
* @param options - Options to customize the state or a friendly name.
|
|
2533
|
+
* @returns An OwnedState instance.
|
|
2534
|
+
* @beta
|
|
2535
|
+
*/
|
|
2536
|
+
export declare function ownedState<T>(value: T | (() => T), options?: string | StateOptions): OwnedState<T>;
|
|
2488
2537
|
|
|
2489
2538
|
/**
|
|
2490
2539
|
* Common APIs related to content parsing.
|
|
@@ -2506,20 +2555,15 @@ export declare const Parser: Readonly<{
|
|
|
2506
2555
|
* Represents metadata configuration for a custom element.
|
|
2507
2556
|
* @public
|
|
2508
2557
|
*/
|
|
2509
|
-
export declare interface PartialFASTElementDefinition {
|
|
2558
|
+
export declare interface PartialFASTElementDefinition<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> {
|
|
2510
2559
|
/**
|
|
2511
2560
|
* The name of the custom element.
|
|
2512
2561
|
*/
|
|
2513
2562
|
readonly name: string;
|
|
2514
2563
|
/**
|
|
2515
|
-
* The template
|
|
2516
|
-
*/
|
|
2517
|
-
readonly template?: ElementViewTemplate;
|
|
2518
|
-
/**
|
|
2519
|
-
* Options controlling how the template will be created.
|
|
2520
|
-
* @alpha
|
|
2564
|
+
* The template, or template resolver, for the custom element.
|
|
2521
2565
|
*/
|
|
2522
|
-
readonly
|
|
2566
|
+
readonly template?: ElementViewTemplate<InstanceType<TType>> | FASTElementTemplateResolver<TType>;
|
|
2523
2567
|
/**
|
|
2524
2568
|
* The styles to associate with the custom element.
|
|
2525
2569
|
*/
|
|
@@ -2549,6 +2593,12 @@ export declare interface PartialFASTElementDefinition {
|
|
|
2549
2593
|
* Lifecycle callbacks for template events.
|
|
2550
2594
|
*/
|
|
2551
2595
|
readonly lifecycleCallbacks?: TemplateLifecycleCallbacks;
|
|
2596
|
+
/**
|
|
2597
|
+
* The optional schema associated with the custom element definition.
|
|
2598
|
+
* Declarative templates assign this automatically during template resolution.
|
|
2599
|
+
* Non-declarative callers can provide one for schema-driven extensions.
|
|
2600
|
+
*/
|
|
2601
|
+
readonly schema?: Schema;
|
|
2552
2602
|
}
|
|
2553
2603
|
|
|
2554
2604
|
/**
|
|
@@ -2599,12 +2649,47 @@ export declare class PropertyChangeNotifier implements Notifier {
|
|
|
2599
2649
|
unsubscribe(subscriber: Subscriber, propertyToUnwatch?: string): void;
|
|
2600
2650
|
}
|
|
2601
2651
|
|
|
2652
|
+
/**
|
|
2653
|
+
* Converts a plain object to a reactive, observable object.
|
|
2654
|
+
* @param object - The object to make reactive.
|
|
2655
|
+
* @param deep - Indicates whether or not to deeply convert the oject.
|
|
2656
|
+
* @returns The converted object.
|
|
2657
|
+
* @beta
|
|
2658
|
+
*/
|
|
2659
|
+
export declare function reactive<T>(object: T, deep?: boolean): T;
|
|
2660
|
+
|
|
2661
|
+
/**
|
|
2662
|
+
* A readonly stateful value associated with an object owner.
|
|
2663
|
+
* @beta
|
|
2664
|
+
*/
|
|
2665
|
+
export declare type ReadonlyOwnedState<T> = {
|
|
2666
|
+
/**
|
|
2667
|
+
* Gets the current stateful value for the owner.
|
|
2668
|
+
*/
|
|
2669
|
+
(owner: any): T;
|
|
2670
|
+
};
|
|
2671
|
+
|
|
2672
|
+
/**
|
|
2673
|
+
* A readonly stateful value.
|
|
2674
|
+
* @beta
|
|
2675
|
+
*/
|
|
2676
|
+
export declare type ReadonlyState<T> = {
|
|
2677
|
+
/**
|
|
2678
|
+
* Gets the current state value.
|
|
2679
|
+
*/
|
|
2680
|
+
(): T;
|
|
2681
|
+
/**
|
|
2682
|
+
* Gets the current state value.
|
|
2683
|
+
*/
|
|
2684
|
+
readonly current: T;
|
|
2685
|
+
};
|
|
2686
|
+
|
|
2602
2687
|
/**
|
|
2603
2688
|
* A directive that observes the updates a property with a reference to the element.
|
|
2604
2689
|
* @param propertyName - The name of the property to assign the reference to.
|
|
2605
2690
|
* @public
|
|
2606
2691
|
*/
|
|
2607
|
-
export declare const ref: <TSource = any
|
|
2692
|
+
export declare const ref: <TSource = any>(propertyName: keyof TSource & string) => CaptureType;
|
|
2608
2693
|
|
|
2609
2694
|
/**
|
|
2610
2695
|
* The runtime behavior for template references.
|
|
@@ -2622,7 +2707,15 @@ export declare class RefDirective extends StatelessAttachedAttributeDirective<st
|
|
|
2622
2707
|
bind(controller: ViewController): void;
|
|
2623
2708
|
}
|
|
2624
2709
|
|
|
2625
|
-
|
|
2710
|
+
/**
|
|
2711
|
+
* Configuration for registering a path with a schema.
|
|
2712
|
+
* @public
|
|
2713
|
+
*/
|
|
2714
|
+
export declare interface RegisterPathConfig {
|
|
2715
|
+
rootPropertyName: string;
|
|
2716
|
+
pathConfig: CachedPath;
|
|
2717
|
+
childrenMap: ChildrenMap | null;
|
|
2718
|
+
}
|
|
2626
2719
|
|
|
2627
2720
|
/**
|
|
2628
2721
|
* Creates a RenderDirective for use in advanced rendering scenarios.
|
|
@@ -2640,7 +2733,7 @@ declare const reflectMode = "reflect";
|
|
|
2640
2733
|
* RenderInstruction to determine the view.
|
|
2641
2734
|
* @public
|
|
2642
2735
|
*/
|
|
2643
|
-
export declare function render<TSource = any, TItem = any, TParent = any>(value?: Expression<TSource, TItem> | Binding<TSource, TItem> | {}, template?: ContentTemplate | string | Expression<TSource, ContentTemplate | string | Node, TParent> | Binding<TSource, ContentTemplate | string | Node, TParent>): CaptureType
|
|
2736
|
+
export declare function render<TSource = any, TItem = any, TParent = any>(value?: Expression<TSource, TItem> | Binding<TSource, TItem> | {}, template?: ContentTemplate | string | Expression<TSource, ContentTemplate | string | Node, TParent> | Binding<TSource, ContentTemplate | string | Node, TParent>): CaptureType;
|
|
2644
2737
|
|
|
2645
2738
|
/**
|
|
2646
2739
|
* A Behavior that enables advanced rendering.
|
|
@@ -2720,7 +2813,7 @@ export declare class RenderDirective<TSource = any> implements HTMLDirective, Vi
|
|
|
2720
2813
|
* @param options - Options used to turn on special repeat features.
|
|
2721
2814
|
* @public
|
|
2722
2815
|
*/
|
|
2723
|
-
export declare 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
|
|
2816
|
+
export declare 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;
|
|
2724
2817
|
|
|
2725
2818
|
/**
|
|
2726
2819
|
* A behavior that renders a template for each item in an array.
|
|
@@ -2771,6 +2864,14 @@ export declare class RepeatBehavior<TSource = any> implements ViewBehavior, Subs
|
|
|
2771
2864
|
private hydrateViews;
|
|
2772
2865
|
}
|
|
2773
2866
|
|
|
2867
|
+
/**
|
|
2868
|
+
* A path discovered from a repeat directive.
|
|
2869
|
+
* @public
|
|
2870
|
+
*/
|
|
2871
|
+
export declare interface RepeatCachedPath extends CachedPathCommon {
|
|
2872
|
+
type: "repeat";
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2774
2875
|
/**
|
|
2775
2876
|
* A directive that configures list rendering.
|
|
2776
2877
|
* @public
|
|
@@ -2817,6 +2918,108 @@ export declare interface RepeatOptions {
|
|
|
2817
2918
|
recycle?: boolean;
|
|
2818
2919
|
}
|
|
2819
2920
|
|
|
2921
|
+
/**
|
|
2922
|
+
* A constructed JSON schema from a template
|
|
2923
|
+
* @public
|
|
2924
|
+
*/
|
|
2925
|
+
export declare class Schema {
|
|
2926
|
+
/**
|
|
2927
|
+
* The name of the custom element
|
|
2928
|
+
*/
|
|
2929
|
+
private customElementName;
|
|
2930
|
+
/**
|
|
2931
|
+
* Instance-level JSON schema map describing each root property
|
|
2932
|
+
*/
|
|
2933
|
+
private schemaMap;
|
|
2934
|
+
constructor(name: string);
|
|
2935
|
+
/**
|
|
2936
|
+
* Add a path to a schema
|
|
2937
|
+
* @param config - The path registration configuration.
|
|
2938
|
+
*/
|
|
2939
|
+
addPath(config: RegisterPathConfig): void;
|
|
2940
|
+
/**
|
|
2941
|
+
* Gets the JSON schema for a property name
|
|
2942
|
+
* @param rootPropertyName - the root property the JSON schema is mapped to
|
|
2943
|
+
* @returns The JSON schema for the root property
|
|
2944
|
+
*/
|
|
2945
|
+
getSchema(rootPropertyName: string): JSONSchema | null;
|
|
2946
|
+
/**
|
|
2947
|
+
* Gets root properties
|
|
2948
|
+
* @returns IterableIterator<string>
|
|
2949
|
+
*/
|
|
2950
|
+
getRootProperties(): IterableIterator<string>;
|
|
2951
|
+
/**
|
|
2952
|
+
* Get a path split into property names
|
|
2953
|
+
* @param path - The dot syntax path, e.g. `a.b.c`.
|
|
2954
|
+
* @returns An array of items in the path
|
|
2955
|
+
*/
|
|
2956
|
+
private getSplitPath;
|
|
2957
|
+
/**
|
|
2958
|
+
* Gets the path to the $def
|
|
2959
|
+
* @param context - The context name. For example, `item in items` creates the `item` context.
|
|
2960
|
+
* @returns A string to use as a $ref
|
|
2961
|
+
*/
|
|
2962
|
+
private getDefsPath;
|
|
2963
|
+
/**
|
|
2964
|
+
* Get the schema $id
|
|
2965
|
+
* @param customElementName - The custom element name
|
|
2966
|
+
* @param propertyName - The property name
|
|
2967
|
+
* @returns The ID that can be used in the JSON schema as $id
|
|
2968
|
+
*/
|
|
2969
|
+
private getSchemaId;
|
|
2970
|
+
/**
|
|
2971
|
+
* Add a new JSON schema to the JSON schema map
|
|
2972
|
+
* @param propertyName - The name of the property to assign this JSON schema to.
|
|
2973
|
+
*/
|
|
2974
|
+
private addNewSchema;
|
|
2975
|
+
/**
|
|
2976
|
+
* Add properties to a context
|
|
2977
|
+
* @param schema - The schema to add the properties to.
|
|
2978
|
+
* @param splitPath - The path split into property/context names.
|
|
2979
|
+
* @param context - The path context.
|
|
2980
|
+
*/
|
|
2981
|
+
private addPropertiesToAContext;
|
|
2982
|
+
/**
|
|
2983
|
+
* Add properties to an object
|
|
2984
|
+
* @param schema - The schema to add the properties to.
|
|
2985
|
+
* @param splitPath - The path split into property/context names.
|
|
2986
|
+
* @param context - The path context.
|
|
2987
|
+
* @param type - The data type (see JSON schema for details).
|
|
2988
|
+
*/
|
|
2989
|
+
private addPropertiesToAnObject;
|
|
2990
|
+
/**
|
|
2991
|
+
* Add an array to an object property
|
|
2992
|
+
* @param schema - The schema to add the properties to.
|
|
2993
|
+
* @param context - The name of the context.
|
|
2994
|
+
*/
|
|
2995
|
+
private addArrayToAnObject;
|
|
2996
|
+
/**
|
|
2997
|
+
* Add a context to the $defs property
|
|
2998
|
+
* @param schema - The schema to use.
|
|
2999
|
+
* @param propertyName - The name of the property the context belongs to.
|
|
3000
|
+
* @param currentContext - The current context.
|
|
3001
|
+
* @param parentContext - The parent context.
|
|
3002
|
+
* @returns
|
|
3003
|
+
*/
|
|
3004
|
+
private addContext;
|
|
3005
|
+
/**
|
|
3006
|
+
* Get parent contexts
|
|
3007
|
+
* @param schema - The schema to use.
|
|
3008
|
+
* @param parentContext - The parent context.
|
|
3009
|
+
* @param contexts - A list of parent contexts.
|
|
3010
|
+
* @returns
|
|
3011
|
+
*/
|
|
3012
|
+
private getParentContexts;
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3015
|
+
/**
|
|
3016
|
+
* Module-level registry that maps custom element names to their schema maps.
|
|
3017
|
+
* Used for cross-element `$ref` resolution (e.g. nested element schemas).
|
|
3018
|
+
* Each Schema instance registers itself here on construction.
|
|
3019
|
+
* @public
|
|
3020
|
+
*/
|
|
3021
|
+
export declare const schemaRegistry: CachedPathMap;
|
|
3022
|
+
|
|
2820
3023
|
/**
|
|
2821
3024
|
* Shadow root initialization options.
|
|
2822
3025
|
* @public
|
|
@@ -2830,13 +3033,47 @@ export declare interface ShadowRootOptions extends ShadowRootInit {
|
|
|
2830
3033
|
registry?: CustomElementRegistry;
|
|
2831
3034
|
}
|
|
2832
3035
|
|
|
3036
|
+
/**
|
|
3037
|
+
* The gateway to signal APIs.
|
|
3038
|
+
* @public
|
|
3039
|
+
*/
|
|
3040
|
+
export declare const Signal: Readonly<{
|
|
3041
|
+
/**
|
|
3042
|
+
* Subscribes to a signal.
|
|
3043
|
+
* @param signal - The signal to subscribe to.
|
|
3044
|
+
* @param subscriber - The subscriber.
|
|
3045
|
+
*/
|
|
3046
|
+
subscribe(signal: string, subscriber: Subscriber): void;
|
|
3047
|
+
/**
|
|
3048
|
+
* Unsubscribes from the signal.
|
|
3049
|
+
* @param signal - The signal to unsubscribe from.
|
|
3050
|
+
* @param subscriber - The subscriber.
|
|
3051
|
+
*/
|
|
3052
|
+
unsubscribe(signal: string, subscriber: Subscriber): void;
|
|
3053
|
+
/**
|
|
3054
|
+
* Sends the specified signal to subscribers.
|
|
3055
|
+
* @param signal - The signal to send.
|
|
3056
|
+
*/
|
|
3057
|
+
send(signal: string): void;
|
|
3058
|
+
}>;
|
|
3059
|
+
|
|
3060
|
+
/**
|
|
3061
|
+
* Creates a signal binding configuration with the supplied options.
|
|
3062
|
+
* @param expression - The binding to refresh when signaled.
|
|
3063
|
+
* @param options - The signal name or a binding to use to retrieve the signal name.
|
|
3064
|
+
* @param policy - The security policy to associate with th binding.
|
|
3065
|
+
* @returns A binding configuration.
|
|
3066
|
+
* @public
|
|
3067
|
+
*/
|
|
3068
|
+
export declare function signal<T = any>(expression: Expression<T>, options: string | Expression<T>, policy?: DOMPolicy_2): Binding<T>;
|
|
3069
|
+
|
|
2833
3070
|
/**
|
|
2834
3071
|
* A directive that observes the `assignedNodes()` of a slot and updates a property
|
|
2835
3072
|
* whenever they change.
|
|
2836
3073
|
* @param propertyOrOptions - The options used to configure slotted node observation.
|
|
2837
3074
|
* @public
|
|
2838
3075
|
*/
|
|
2839
|
-
export declare function slotted<TSource = any
|
|
3076
|
+
export declare function slotted<TSource = any>(propertyOrOptions: (keyof TSource & string) | SlottedDirectiveOptions<keyof TSource & string>): CaptureType;
|
|
2840
3077
|
|
|
2841
3078
|
/**
|
|
2842
3079
|
* The runtime behavior for slotted node observation.
|
|
@@ -3091,6 +3328,35 @@ export declare const enum Stages {
|
|
|
3091
3328
|
disconnected = 3
|
|
3092
3329
|
}
|
|
3093
3330
|
|
|
3331
|
+
/**
|
|
3332
|
+
* A read/write stateful value.
|
|
3333
|
+
* @beta
|
|
3334
|
+
*/
|
|
3335
|
+
export declare type State<T> = ReadonlyState<T> & {
|
|
3336
|
+
/**
|
|
3337
|
+
* Gets or sets the current state value.
|
|
3338
|
+
*/
|
|
3339
|
+
current: T;
|
|
3340
|
+
/**
|
|
3341
|
+
* Sets the current state value.
|
|
3342
|
+
* @param value - The new state value.
|
|
3343
|
+
*/
|
|
3344
|
+
set(value: T): void;
|
|
3345
|
+
/**
|
|
3346
|
+
* Creates a readonly version of the state.
|
|
3347
|
+
*/
|
|
3348
|
+
asReadonly(): ReadonlyState<T>;
|
|
3349
|
+
};
|
|
3350
|
+
|
|
3351
|
+
/**
|
|
3352
|
+
* Creates a reactive state value.
|
|
3353
|
+
* @param value - The initial state value.
|
|
3354
|
+
* @param options - Options to customize the state or a friendly name.
|
|
3355
|
+
* @returns A State instance.
|
|
3356
|
+
* @beta
|
|
3357
|
+
*/
|
|
3358
|
+
export declare function state<T>(value: T, options?: string | StateOptions): State<T>;
|
|
3359
|
+
|
|
3094
3360
|
/**
|
|
3095
3361
|
* A base class used for attribute directives that don't need internal state.
|
|
3096
3362
|
* @public
|
|
@@ -3121,6 +3387,21 @@ export declare abstract class StatelessAttachedAttributeDirective<TOptions> impl
|
|
|
3121
3387
|
abstract bind(controller: ViewController): void;
|
|
3122
3388
|
}
|
|
3123
3389
|
|
|
3390
|
+
/**
|
|
3391
|
+
* Options for creating state.
|
|
3392
|
+
* @beta
|
|
3393
|
+
*/
|
|
3394
|
+
export declare type StateOptions = {
|
|
3395
|
+
/**
|
|
3396
|
+
* Indicates whether to deeply make the state value observable.
|
|
3397
|
+
*/
|
|
3398
|
+
deep?: boolean;
|
|
3399
|
+
/**
|
|
3400
|
+
* A friendly name for the state.
|
|
3401
|
+
*/
|
|
3402
|
+
name?: string;
|
|
3403
|
+
};
|
|
3404
|
+
|
|
3124
3405
|
/**
|
|
3125
3406
|
* Implemented to provide specific behavior when adding/removing styles
|
|
3126
3407
|
* for elements.
|
|
@@ -3278,7 +3559,7 @@ export declare interface SyntheticViewTemplate<TSource = any, TParent = any> {
|
|
|
3278
3559
|
/**
|
|
3279
3560
|
* Returns a directive that can inline the template.
|
|
3280
3561
|
*/
|
|
3281
|
-
inline(): CaptureType
|
|
3562
|
+
inline(): CaptureType;
|
|
3282
3563
|
}
|
|
3283
3564
|
|
|
3284
3565
|
/**
|
|
@@ -3287,34 +3568,36 @@ export declare interface SyntheticViewTemplate<TSource = any, TParent = any> {
|
|
|
3287
3568
|
*/
|
|
3288
3569
|
export declare interface TemplateLifecycleCallbacks {
|
|
3289
3570
|
/**
|
|
3290
|
-
* Called after the
|
|
3571
|
+
* Called after the JS class definition has been registered.
|
|
3572
|
+
*/
|
|
3573
|
+
elementDidRegister?(name: string): void;
|
|
3574
|
+
/**
|
|
3575
|
+
* Called before the template has been evaluated and assigned.
|
|
3576
|
+
*/
|
|
3577
|
+
templateWillUpdate?(name: string): void;
|
|
3578
|
+
/**
|
|
3579
|
+
* Called after the template has been assigned to the definition.
|
|
3291
3580
|
*/
|
|
3292
3581
|
templateDidUpdate?(name: string): void;
|
|
3293
3582
|
/**
|
|
3294
|
-
* Called after the custom element has been defined
|
|
3583
|
+
* Called after the custom element has been defined.
|
|
3295
3584
|
*/
|
|
3296
3585
|
elementDidDefine?(name: string): void;
|
|
3586
|
+
/**
|
|
3587
|
+
* Called before an individual element's hydration begins.
|
|
3588
|
+
*/
|
|
3589
|
+
elementWillHydrate?(source: HTMLElement): void;
|
|
3590
|
+
/**
|
|
3591
|
+
* Called after an individual element's hydration has finished.
|
|
3592
|
+
*/
|
|
3593
|
+
elementDidHydrate?(source: HTMLElement): void;
|
|
3297
3594
|
}
|
|
3298
3595
|
|
|
3299
|
-
/**
|
|
3300
|
-
* Values for the `templateOptions` property.
|
|
3301
|
-
* @alpha
|
|
3302
|
-
*/
|
|
3303
|
-
export declare const TemplateOptions: {
|
|
3304
|
-
readonly deferAndHydrate: "defer-and-hydrate";
|
|
3305
|
-
};
|
|
3306
|
-
|
|
3307
|
-
/**
|
|
3308
|
-
* Type for the `TemplateOptions` const enum.
|
|
3309
|
-
* @alpha
|
|
3310
|
-
*/
|
|
3311
|
-
export declare type TemplateOptions = (typeof TemplateOptions)[keyof typeof TemplateOptions];
|
|
3312
|
-
|
|
3313
3596
|
/**
|
|
3314
3597
|
* Represents the types of values that can be interpolated into a template.
|
|
3315
3598
|
* @public
|
|
3316
3599
|
*/
|
|
3317
|
-
export declare type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType
|
|
3600
|
+
export declare type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType;
|
|
3318
3601
|
|
|
3319
3602
|
/**
|
|
3320
3603
|
* A policy for use with the standard trustedTypes platform API.
|
|
@@ -3328,6 +3611,51 @@ export declare type TrustedTypesPolicy = {
|
|
|
3328
3611
|
createHTML(html: string): string;
|
|
3329
3612
|
};
|
|
3330
3613
|
|
|
3614
|
+
/**
|
|
3615
|
+
* Creates a default binding.
|
|
3616
|
+
* @param expression - The binding to refresh when changed.
|
|
3617
|
+
* @param optionsOrChangeEvent - The binding options or the name of the change event to use.
|
|
3618
|
+
* @param policy - The security policy to associate with the binding.
|
|
3619
|
+
* @param isBindingVolatile - Indicates whether the binding is volatile or not.
|
|
3620
|
+
* @returns A binding.
|
|
3621
|
+
* @public
|
|
3622
|
+
*/
|
|
3623
|
+
export declare function twoWay<T = any>(expression: Expression<T>, optionsOrChangeEvent?: TwoWayBindingOptions | string, policy?: DOMPolicy_2, isBindingVolatile?: boolean): Binding<T>;
|
|
3624
|
+
|
|
3625
|
+
/**
|
|
3626
|
+
* The twoWay binding options.
|
|
3627
|
+
* @public
|
|
3628
|
+
*/
|
|
3629
|
+
export declare type TwoWayBindingOptions = {
|
|
3630
|
+
changeEvent?: string;
|
|
3631
|
+
fromView?: (value: any) => any;
|
|
3632
|
+
};
|
|
3633
|
+
|
|
3634
|
+
/**
|
|
3635
|
+
* The settings required to enable two-way binding.
|
|
3636
|
+
* @public
|
|
3637
|
+
*/
|
|
3638
|
+
export declare interface TwoWaySettings {
|
|
3639
|
+
/**
|
|
3640
|
+
* Determines which event to listen to, to detect changes in the view.
|
|
3641
|
+
* @param bindingSource - The directive to determine the change event for.
|
|
3642
|
+
* @param target - The target element to determine the change event for.
|
|
3643
|
+
*/
|
|
3644
|
+
determineChangeEvent(bindingSource: BindingDirective, target: HTMLElement): string;
|
|
3645
|
+
}
|
|
3646
|
+
|
|
3647
|
+
/**
|
|
3648
|
+
* Enables configuring two-way binding settings.
|
|
3649
|
+
* @public
|
|
3650
|
+
*/
|
|
3651
|
+
export declare const TwoWaySettings: Readonly<{
|
|
3652
|
+
/**
|
|
3653
|
+
* Configures two-way binding.
|
|
3654
|
+
* @param settings - The settings to use for the two-way binding system.
|
|
3655
|
+
*/
|
|
3656
|
+
configure(settings: TwoWaySettings): void;
|
|
3657
|
+
}>;
|
|
3658
|
+
|
|
3331
3659
|
/**
|
|
3332
3660
|
* Do not change. Part of shared kernel contract.
|
|
3333
3661
|
* @internal
|
|
@@ -3346,6 +3674,22 @@ export declare interface TypeRegistry<TDefinition extends TypeDefinition> {
|
|
|
3346
3674
|
getForInstance(object: any): TDefinition | undefined;
|
|
3347
3675
|
}
|
|
3348
3676
|
|
|
3677
|
+
/**
|
|
3678
|
+
* An extension of MutationObserver that supports unobserving nodes.
|
|
3679
|
+
* @internal
|
|
3680
|
+
*/
|
|
3681
|
+
export declare class UnobservableMutationObserver extends MutationObserver {
|
|
3682
|
+
private readonly callback;
|
|
3683
|
+
private observedNodes;
|
|
3684
|
+
/**
|
|
3685
|
+
* Creates an instance of UnobservableMutationObserver.
|
|
3686
|
+
* @param callback - The callback to invoke when observed nodes are changed.
|
|
3687
|
+
*/
|
|
3688
|
+
constructor(callback: MutationCallback);
|
|
3689
|
+
observe(target: Node, options?: MutationObserverInit | undefined): void;
|
|
3690
|
+
unobserve(target: Node): void;
|
|
3691
|
+
}
|
|
3692
|
+
|
|
3349
3693
|
/**
|
|
3350
3694
|
* A work queue used to synchronize writes to the DOM.
|
|
3351
3695
|
* @public
|
|
@@ -3445,14 +3789,6 @@ export declare interface ViewBehavior<TSource = any, TParent = any> {
|
|
|
3445
3789
|
bind(controller: ViewController<TSource, TParent>): void;
|
|
3446
3790
|
}
|
|
3447
3791
|
|
|
3448
|
-
/**
|
|
3449
|
-
* Stores relationships between a {@link ViewBehaviorFactory} and
|
|
3450
|
-
* the {@link ViewBoundaries} the factory created.
|
|
3451
|
-
*/
|
|
3452
|
-
declare interface ViewBehaviorBoundaries {
|
|
3453
|
-
[factoryId: string]: ViewBoundaries;
|
|
3454
|
-
}
|
|
3455
|
-
|
|
3456
3792
|
/**
|
|
3457
3793
|
* A factory that can create a {@link ViewBehavior} associated with a particular
|
|
3458
3794
|
* location within a DOM fragment.
|
|
@@ -3474,13 +3810,52 @@ export declare interface ViewBehaviorFactory {
|
|
|
3474
3810
|
/**
|
|
3475
3811
|
* The policy that the created behavior must run under.
|
|
3476
3812
|
*/
|
|
3477
|
-
policy?:
|
|
3813
|
+
policy?: DOMPolicy_2;
|
|
3478
3814
|
/**
|
|
3479
3815
|
* Creates a behavior.
|
|
3480
3816
|
*/
|
|
3481
3817
|
createBehavior(): ViewBehavior;
|
|
3482
3818
|
}
|
|
3483
3819
|
|
|
3820
|
+
/**
|
|
3821
|
+
* Bridges between ViewBehaviors and HostBehaviors, enabling a host to
|
|
3822
|
+
* control ViewBehaviors.
|
|
3823
|
+
* @public
|
|
3824
|
+
*/
|
|
3825
|
+
export declare interface ViewBehaviorOrchestrator<TSource = any, TParent = any> extends ViewController<TSource, TParent>, HostBehavior<TSource> {
|
|
3826
|
+
/**
|
|
3827
|
+
*
|
|
3828
|
+
* @param nodeId - The structural id of the DOM node to which a behavior will apply.
|
|
3829
|
+
* @param target - The DOM node associated with the id.
|
|
3830
|
+
*/
|
|
3831
|
+
addTarget(nodeId: string, target: Node): void;
|
|
3832
|
+
/**
|
|
3833
|
+
* Adds a behavior.
|
|
3834
|
+
* @param behavior - The behavior to add.
|
|
3835
|
+
*/
|
|
3836
|
+
addBehavior(behavior: ViewBehavior): void;
|
|
3837
|
+
/**
|
|
3838
|
+
* Adds a behavior factory.
|
|
3839
|
+
* @param factory - The behavior factory to add.
|
|
3840
|
+
* @param target - The target the factory will create behaviors for.
|
|
3841
|
+
*/
|
|
3842
|
+
addBehaviorFactory(factory: ViewBehaviorFactory, target: Node): void;
|
|
3843
|
+
}
|
|
3844
|
+
|
|
3845
|
+
/**
|
|
3846
|
+
* Bridges between ViewBehaviors and HostBehaviors, enabling a host to
|
|
3847
|
+
* control ViewBehaviors.
|
|
3848
|
+
* @public
|
|
3849
|
+
*/
|
|
3850
|
+
export declare const ViewBehaviorOrchestrator: Readonly<{
|
|
3851
|
+
/**
|
|
3852
|
+
* Creates a ViewBehaviorOrchestrator.
|
|
3853
|
+
* @param source - The source to to associate behaviors with.
|
|
3854
|
+
* @returns A ViewBehaviorOrchestrator.
|
|
3855
|
+
*/
|
|
3856
|
+
create<TSource = any, TParent = any>(source: TSource): ViewBehaviorOrchestrator<TSource, TParent>;
|
|
3857
|
+
}>;
|
|
3858
|
+
|
|
3484
3859
|
/**
|
|
3485
3860
|
* The target nodes available to a behavior.
|
|
3486
3861
|
* @public
|
|
@@ -3489,14 +3864,6 @@ export declare type ViewBehaviorTargets = {
|
|
|
3489
3864
|
[id: string]: Node;
|
|
3490
3865
|
};
|
|
3491
3866
|
|
|
3492
|
-
/**
|
|
3493
|
-
* Represents the DOM boundaries controlled by a view
|
|
3494
|
-
*/
|
|
3495
|
-
declare interface ViewBoundaries {
|
|
3496
|
-
first: Node;
|
|
3497
|
-
last: Node;
|
|
3498
|
-
}
|
|
3499
|
-
|
|
3500
3867
|
/**
|
|
3501
3868
|
* Controls the lifecycle of a view and provides relevant context.
|
|
3502
3869
|
* @public
|
|
@@ -3506,11 +3873,23 @@ export declare interface ViewController<TSource = any, TParent = any> extends Ex
|
|
|
3506
3873
|
* The parts of the view that are targeted by view behaviors.
|
|
3507
3874
|
*/
|
|
3508
3875
|
readonly targets: ViewBehaviorTargets;
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3876
|
+
/**
|
|
3877
|
+
* When true, directives skip attribute/booleanAttribute DOM
|
|
3878
|
+
* updates during bind(). This is an internal flag set only
|
|
3879
|
+
* during the prerendered bind window.
|
|
3880
|
+
* @internal
|
|
3881
|
+
*/
|
|
3882
|
+
readonly _skipAttrUpdates?: boolean;
|
|
3883
|
+
/**
|
|
3884
|
+
* Resolves `true` when the view's host element had prerendered
|
|
3885
|
+
* content (existing shadow root).
|
|
3886
|
+
*/
|
|
3887
|
+
readonly isPrerendered?: Promise<boolean>;
|
|
3888
|
+
/**
|
|
3889
|
+
* Resolves `true` after prerendered content has been hydrated,
|
|
3890
|
+
* `false` when client-side rendered or hydration not enabled.
|
|
3891
|
+
*/
|
|
3892
|
+
readonly isHydrated?: Promise<boolean>;
|
|
3514
3893
|
}
|
|
3515
3894
|
|
|
3516
3895
|
/**
|
|
@@ -3535,20 +3914,15 @@ export declare class ViewTemplate<TSource = any, TParent = any> implements Eleme
|
|
|
3535
3914
|
* @param factories - The directives that will be connected to placeholders in the html.
|
|
3536
3915
|
* @param policy - The security policy to use when compiling this template.
|
|
3537
3916
|
*/
|
|
3538
|
-
constructor(html: string | HTMLTemplateElement, factories?: Record<string, ViewBehaviorFactory>, policy?:
|
|
3917
|
+
constructor(html: string | HTMLTemplateElement, factories?: Record<string, ViewBehaviorFactory>, policy?: DOMPolicy_2 | undefined);
|
|
3539
3918
|
/**
|
|
3540
3919
|
* @internal
|
|
3541
3920
|
*/
|
|
3542
3921
|
compile(): HTMLTemplateCompilationResult<TSource, TParent>;
|
|
3543
|
-
/**
|
|
3544
|
-
* Creates an HTMLView instance based on this template definition.
|
|
3545
|
-
* @param hostBindingTarget - The element that host behaviors will be bound to.
|
|
3546
|
-
*/
|
|
3547
|
-
create(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
3548
3922
|
/**
|
|
3549
3923
|
* Returns a directive that can inline the template.
|
|
3550
3924
|
*/
|
|
3551
|
-
inline(): CaptureType
|
|
3925
|
+
inline(): CaptureType;
|
|
3552
3926
|
/**
|
|
3553
3927
|
* Sets the DOMPolicy for this template.
|
|
3554
3928
|
* @param policy - The policy to associated with this template.
|
|
@@ -3557,7 +3931,7 @@ export declare class ViewTemplate<TSource = any, TParent = any> implements Eleme
|
|
|
3557
3931
|
* The DOMPolicy can only be set once for a template and cannot be
|
|
3558
3932
|
* set after the template is compiled.
|
|
3559
3933
|
*/
|
|
3560
|
-
withPolicy(policy:
|
|
3934
|
+
withPolicy(policy: DOMPolicy_2): this;
|
|
3561
3935
|
/**
|
|
3562
3936
|
* Creates an HTMLView from this template, binds it to the source, and then appends it to the host.
|
|
3563
3937
|
* @param source - The data source to bind the template to.
|
|
@@ -3566,6 +3940,11 @@ export declare class ViewTemplate<TSource = any, TParent = any> implements Eleme
|
|
|
3566
3940
|
* host that the template is being attached to.
|
|
3567
3941
|
*/
|
|
3568
3942
|
render(source: TSource, host: Node, hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
3943
|
+
/**
|
|
3944
|
+
* Creates an HTMLView instance based on this template definition.
|
|
3945
|
+
* @param hostBindingTarget - The element that host behaviors will be bound to.
|
|
3946
|
+
*/
|
|
3947
|
+
create(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
3569
3948
|
/**
|
|
3570
3949
|
* Processes the tagged template literal's static strings and interpolated values and
|
|
3571
3950
|
* creates a ViewTemplate.
|
|
@@ -3597,7 +3976,7 @@ export declare class ViewTemplate<TSource = any, TParent = any> implements Eleme
|
|
|
3597
3976
|
* and also be sure to manually sanitize all static strings particularly if they can
|
|
3598
3977
|
* come from user input.
|
|
3599
3978
|
*/
|
|
3600
|
-
static create<TSource = any, TParent = any>(strings: string[], values: TemplateValue<TSource, TParent>[], policy?:
|
|
3979
|
+
static create<TSource = any, TParent = any>(strings: string[], values: TemplateValue<TSource, TParent>[], policy?: DOMPolicy_2): ViewTemplate<TSource, TParent>;
|
|
3601
3980
|
}
|
|
3602
3981
|
|
|
3603
3982
|
/**
|
|
@@ -3609,6 +3988,15 @@ export declare class ViewTemplate<TSource = any, TParent = any> implements Eleme
|
|
|
3609
3988
|
*/
|
|
3610
3989
|
export declare function volatile(target: {}, name: string | Accessor, descriptor: PropertyDescriptor): PropertyDescriptor;
|
|
3611
3990
|
|
|
3991
|
+
/**
|
|
3992
|
+
* Deeply subscribes to changes in existing observable objects.
|
|
3993
|
+
* @param object - The observable object to watch.
|
|
3994
|
+
* @param subscriber - The handler to call when changes are made to the object.
|
|
3995
|
+
* @returns A disposable that can be used to unsubscribe from change updates.
|
|
3996
|
+
* @beta
|
|
3997
|
+
*/
|
|
3998
|
+
export declare function watch(object: any, subscriber: Subscriber | ((subject: any, args: any) => void)): Disposable;
|
|
3999
|
+
|
|
3612
4000
|
/**
|
|
3613
4001
|
* A directive that enables basic conditional rendering in a template.
|
|
3614
4002
|
* @param condition - The condition to test for rendering.
|
|
@@ -3618,6 +4006,6 @@ export declare function volatile(target: {}, name: string | Accessor, descriptor
|
|
|
3618
4006
|
* gets the template to render when the conditional is false.
|
|
3619
4007
|
* @public
|
|
3620
4008
|
*/
|
|
3621
|
-
export declare function when<TSource = any, TReturn = any, TParent = any>(condition: Expression<TSource, TReturn, TParent> | boolean, templateOrTemplateBinding: SyntheticViewTemplate<TSource, TParent> | Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>, elseTemplateOrTemplateBinding?: SyntheticViewTemplate<TSource, TParent> | Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>): CaptureType
|
|
4009
|
+
export declare function when<TSource = any, TReturn = any, TParent = any>(condition: Expression<TSource, TReturn, TParent> | boolean, templateOrTemplateBinding: SyntheticViewTemplate<TSource, TParent> | Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>, elseTemplateOrTemplateBinding?: SyntheticViewTemplate<TSource, TParent> | Expression<TSource, SyntheticViewTemplate<TSource, TParent>, TParent>): CaptureType;
|
|
3622
4010
|
|
|
3623
4011
|
export { }
|