@microsoft/fast-element 2.10.3 → 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.
Files changed (351) hide show
  1. package/ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md +1 -1
  2. package/ARCHITECTURE_OVERVIEW.md +2 -2
  3. package/CHANGELOG.json +31 -1
  4. package/CHANGELOG.md +10 -2
  5. package/DECLARATIVE_DESIGN.md +806 -0
  6. package/DECLARATIVE_HTML.md +470 -0
  7. package/DECLARATIVE_MIGRATION.md +215 -0
  8. package/DECLARATIVE_RENDERING.md +530 -0
  9. package/DECLARATIVE_RENDERING_LIFECYCLE.md +288 -0
  10. package/DECLARATIVE_SCHEMA_OBSERVER_MAP.md +489 -0
  11. package/DESIGN.md +143 -34
  12. package/MIGRATION.md +387 -0
  13. package/README.md +208 -1
  14. package/SIZES.md +25 -0
  15. package/api-extractor.arrays.json +15 -0
  16. package/api-extractor.context.json +1 -0
  17. package/api-extractor.declarative.json +15 -0
  18. package/api-extractor.di.json +1 -0
  19. package/api-extractor.hydration.json +15 -0
  20. package/api-extractor.styles.json +15 -0
  21. package/dist/arrays/arrays.api.json +2621 -0
  22. package/dist/context/context.api.json +1 -1
  23. package/dist/declarative/declarative.api.json +7844 -0
  24. package/dist/di/di.api.json +2 -2
  25. package/dist/dts/array-observer.d.ts +2 -0
  26. package/dist/dts/arrays.d.ts +2 -0
  27. package/dist/dts/attr.d.ts +1 -0
  28. package/dist/dts/binding/signal.d.ts +6 -6
  29. package/dist/dts/binding/two-way.d.ts +1 -0
  30. package/dist/dts/binding.d.ts +7 -0
  31. package/dist/dts/components/attributes.d.ts +2 -5
  32. package/dist/dts/components/definition-schema-transforms.d.ts +9 -0
  33. package/dist/dts/components/element-controller.d.ts +80 -114
  34. package/dist/dts/components/element-hydration.d.ts +1 -1
  35. package/dist/dts/components/enable-hydration.d.ts +34 -0
  36. package/dist/dts/components/fast-definitions.d.ts +91 -42
  37. package/dist/dts/components/fast-element.d.ts +5 -8
  38. package/dist/dts/components/hydration-tracker.d.ts +40 -0
  39. package/dist/dts/components/hydration.d.ts +18 -53
  40. package/dist/dts/components/schema.d.ts +205 -0
  41. package/dist/dts/context.d.ts +6 -6
  42. package/dist/dts/css.d.ts +3 -0
  43. package/dist/dts/debug.d.ts +5 -1
  44. package/dist/dts/declarative/attribute-map.d.ts +58 -0
  45. package/dist/dts/declarative/debug.d.ts +5 -0
  46. package/dist/dts/declarative/index.d.ts +13 -0
  47. package/dist/dts/declarative/interfaces.d.ts +9 -0
  48. package/dist/dts/declarative/observer-map-utilities.d.ts +58 -0
  49. package/dist/dts/declarative/observer-map.d.ts +89 -0
  50. package/dist/dts/declarative/runtime.d.ts +5 -0
  51. package/dist/dts/declarative/syntax.d.ts +21 -0
  52. package/dist/dts/declarative/template-bridge.d.ts +33 -0
  53. package/dist/dts/declarative/template-parser.d.ts +98 -0
  54. package/dist/dts/declarative/template.d.ts +9 -0
  55. package/dist/dts/declarative/utilities.d.ts +312 -0
  56. package/dist/dts/di/di.d.ts +1 -1
  57. package/dist/dts/directives/children.d.ts +2 -0
  58. package/dist/dts/directives/node-observation.d.ts +2 -0
  59. package/dist/dts/directives/ref.d.ts +2 -0
  60. package/dist/dts/directives/repeat.d.ts +4 -0
  61. package/dist/dts/directives/slotted.d.ts +2 -0
  62. package/dist/dts/directives/when.d.ts +3 -0
  63. package/dist/dts/dom-policy.d.ts +1 -1
  64. package/dist/dts/html.d.ts +5 -0
  65. package/dist/dts/hydration/runtime.d.ts +7 -0
  66. package/dist/dts/hydration/target-builder.d.ts +15 -12
  67. package/dist/dts/hydration.d.ts +14 -0
  68. package/dist/dts/index.d.ts +38 -42
  69. package/dist/dts/index.debug.d.ts +0 -1
  70. package/dist/dts/index.rollup.debug.d.ts +0 -1
  71. package/dist/dts/interfaces.d.ts +1 -49
  72. package/dist/dts/observable.d.ts +3 -6
  73. package/dist/dts/observation/arrays.d.ts +1 -1
  74. package/dist/dts/observation/update-queue.d.ts +1 -1
  75. package/dist/dts/platform.d.ts +25 -4
  76. package/dist/dts/render.d.ts +7 -0
  77. package/dist/dts/schema.d.ts +1 -0
  78. package/dist/dts/state/exports.d.ts +1 -1
  79. package/dist/dts/state/state.d.ts +2 -2
  80. package/dist/dts/styles/css-directive.d.ts +5 -12
  81. package/dist/dts/styles/css.d.ts +5 -7
  82. package/dist/dts/styles/element-styles.d.ts +0 -10
  83. package/dist/dts/styles.d.ts +6 -0
  84. package/dist/dts/templating/children.d.ts +1 -1
  85. package/dist/dts/templating/html-binding-directive.d.ts +10 -0
  86. package/dist/dts/templating/html-directive.d.ts +17 -0
  87. package/dist/dts/templating/hydration-view.d.ts +109 -0
  88. package/dist/dts/templating/ref.d.ts +1 -1
  89. package/dist/dts/templating/render.d.ts +8 -2
  90. package/dist/dts/templating/repeat.d.ts +2 -2
  91. package/dist/dts/templating/slotted.d.ts +1 -1
  92. package/dist/dts/templating/template.d.ts +17 -9
  93. package/dist/dts/templating/view.d.ts +25 -102
  94. package/dist/dts/templating/when.d.ts +1 -1
  95. package/dist/dts/templating.d.ts +10 -0
  96. package/dist/dts/testing/exports.d.ts +2 -2
  97. package/dist/dts/tsdoc-metadata.json +1 -1
  98. package/dist/dts/updates.d.ts +1 -0
  99. package/dist/dts/volatile.d.ts +2 -0
  100. package/dist/esm/array-observer.js +1 -0
  101. package/dist/esm/arrays.js +1 -0
  102. package/dist/esm/attr.js +1 -0
  103. package/dist/esm/binding/normalize.js +1 -1
  104. package/dist/esm/binding/signal.js +4 -4
  105. package/dist/esm/binding/two-way.js +2 -1
  106. package/dist/esm/binding.js +4 -0
  107. package/dist/esm/components/attributes.js +8 -5
  108. package/dist/esm/components/definition-schema-transforms.js +23 -0
  109. package/dist/esm/components/element-controller.js +200 -269
  110. package/dist/esm/components/element-hydration.js +1 -1
  111. package/dist/esm/components/enable-hydration.js +100 -0
  112. package/dist/esm/components/fast-definitions.js +211 -49
  113. package/dist/esm/components/fast-element.js +18 -27
  114. package/dist/esm/components/hydration-tracker.js +93 -0
  115. package/dist/esm/components/hydration.js +62 -144
  116. package/dist/esm/components/schema.js +253 -0
  117. package/dist/esm/context.js +6 -6
  118. package/dist/esm/css.js +3 -0
  119. package/dist/esm/debug.js +26 -26
  120. package/dist/esm/declarative/attribute-map.js +121 -0
  121. package/dist/esm/declarative/debug.js +5 -0
  122. package/dist/esm/declarative/index.js +3 -0
  123. package/dist/esm/declarative/interfaces.js +10 -0
  124. package/dist/esm/declarative/observer-map-utilities.js +562 -0
  125. package/dist/esm/declarative/observer-map.js +216 -0
  126. package/dist/esm/declarative/runtime.js +14 -0
  127. package/dist/esm/declarative/syntax.js +36 -0
  128. package/dist/esm/declarative/template-bridge.js +170 -0
  129. package/dist/esm/declarative/template-parser.js +306 -0
  130. package/dist/esm/declarative/template.js +142 -0
  131. package/dist/esm/declarative/utilities.js +834 -0
  132. package/dist/esm/di/di.js +6 -8
  133. package/dist/esm/directives/children.js +1 -0
  134. package/dist/esm/directives/node-observation.js +1 -0
  135. package/dist/esm/directives/ref.js +1 -0
  136. package/dist/esm/directives/repeat.js +1 -0
  137. package/dist/esm/directives/slotted.js +1 -0
  138. package/dist/esm/directives/when.js +1 -0
  139. package/dist/esm/dom-policy.js +2 -2
  140. package/dist/esm/dom.js +1 -1
  141. package/dist/esm/html.js +2 -0
  142. package/dist/esm/hydration/runtime.js +33 -0
  143. package/dist/esm/hydration/target-builder.js +97 -90
  144. package/dist/esm/hydration.js +4 -0
  145. package/dist/esm/index.debug.js +2 -1
  146. package/dist/esm/index.js +34 -29
  147. package/dist/esm/index.rollup.debug.js +3 -2
  148. package/dist/esm/index.rollup.js +1 -1
  149. package/dist/esm/interfaces.js +1 -45
  150. package/dist/esm/observable.js +1 -4
  151. package/dist/esm/observation/arrays.js +1 -1
  152. package/dist/esm/observation/observable.js +5 -5
  153. package/dist/esm/observation/update-queue.js +47 -58
  154. package/dist/esm/platform.js +31 -30
  155. package/dist/esm/render.js +1 -0
  156. package/dist/esm/schema.js +1 -0
  157. package/dist/esm/state/exports.js +1 -1
  158. package/dist/esm/styles/css-directive.js +1 -2
  159. package/dist/esm/styles/css.js +15 -56
  160. package/dist/esm/styles/element-styles.js +69 -15
  161. package/dist/esm/styles.js +2 -0
  162. package/dist/esm/templating/html-binding-directive.js +24 -10
  163. package/dist/esm/templating/hydration-view.js +235 -0
  164. package/dist/esm/templating/render.js +13 -2
  165. package/dist/esm/templating/repeat.js +36 -34
  166. package/dist/esm/templating/template.js +7 -7
  167. package/dist/esm/templating/view.js +24 -233
  168. package/dist/esm/templating.js +7 -0
  169. package/dist/esm/testing/exports.js +2 -2
  170. package/dist/esm/updates.js +1 -0
  171. package/dist/esm/volatile.js +1 -0
  172. package/dist/fast-element.api.json +9017 -6996
  173. package/dist/fast-element.d.ts +3557 -796
  174. package/dist/fast-element.debug.js +5093 -4419
  175. package/dist/fast-element.debug.min.js +2 -2
  176. package/dist/fast-element.js +5398 -4655
  177. package/dist/fast-element.min.js +2 -2
  178. package/dist/fast-element.untrimmed.d.ts +881 -481
  179. package/dist/hydration/hydration.api.json +5237 -0
  180. package/dist/styles/styles.api.json +2672 -0
  181. package/docs/api-report.api.md +344 -167
  182. package/docs/arrays/api-report.api.md +114 -0
  183. package/docs/declarative/api-report.api.md +397 -0
  184. package/docs/hydration/api-report.api.md +285 -0
  185. package/docs/styles/api-report.api.md +135 -0
  186. package/package.json +149 -40
  187. package/playwright.declarative.config.ts +26 -0
  188. package/playwright.declarative.webui.config.ts +20 -0
  189. package/scripts/declarative/build-fixtures-with-webui.js +135 -0
  190. package/scripts/declarative/build-fixtures.js +49 -0
  191. package/scripts/declarative/build-fixtures.utilities.js +101 -0
  192. package/scripts/measure-sizes.js +219 -0
  193. package/scripts/run-api-extractor.js +39 -20
  194. package/test/declarative/fixtures/README.md +72 -0
  195. package/test/declarative/fixtures/WRITING_FIXTURES.md +330 -0
  196. package/test/declarative/fixtures/bindings/README.md +12 -0
  197. package/test/declarative/fixtures/bindings/attribute/entry.html +13 -0
  198. package/test/declarative/fixtures/bindings/attribute/fast-build.config.json +6 -0
  199. package/test/declarative/fixtures/bindings/attribute/index.html +25 -0
  200. package/test/declarative/fixtures/bindings/attribute/main.ts +41 -0
  201. package/test/declarative/fixtures/bindings/attribute/state.json +8 -0
  202. package/test/declarative/fixtures/bindings/attribute/templates.html +11 -0
  203. package/test/declarative/fixtures/bindings/content/entry.html +12 -0
  204. package/test/declarative/fixtures/bindings/content/fast-build.config.json +6 -0
  205. package/test/declarative/fixtures/bindings/content/index.html +19 -0
  206. package/test/declarative/fixtures/bindings/content/main.ts +27 -0
  207. package/test/declarative/fixtures/bindings/content/state.json +4 -0
  208. package/test/declarative/fixtures/bindings/content/templates.html +6 -0
  209. package/test/declarative/fixtures/bindings/dot-syntax/entry.html +11 -0
  210. package/test/declarative/fixtures/bindings/dot-syntax/fast-build.config.json +6 -0
  211. package/test/declarative/fixtures/bindings/dot-syntax/index.html +47 -0
  212. package/test/declarative/fixtures/bindings/dot-syntax/main.ts +59 -0
  213. package/test/declarative/fixtures/bindings/dot-syntax/state.json +16 -0
  214. package/test/declarative/fixtures/bindings/dot-syntax/templates.html +17 -0
  215. package/test/declarative/fixtures/bindings/event/entry.html +11 -0
  216. package/test/declarative/fixtures/bindings/event/fast-build.config.json +6 -0
  217. package/test/declarative/fixtures/bindings/event/index.html +43 -0
  218. package/test/declarative/fixtures/bindings/event/main.ts +43 -0
  219. package/test/declarative/fixtures/bindings/event/state.json +3 -0
  220. package/test/declarative/fixtures/bindings/event/templates.html +18 -0
  221. package/test/declarative/fixtures/bindings/host/entry.html +40 -0
  222. package/test/declarative/fixtures/bindings/host/fast-build.config.json +6 -0
  223. package/test/declarative/fixtures/bindings/host/index.html +96 -0
  224. package/test/declarative/fixtures/bindings/host/main.ts +222 -0
  225. package/test/declarative/fixtures/bindings/host/state.json +9 -0
  226. package/test/declarative/fixtures/bindings/host/templates.html +55 -0
  227. package/test/declarative/fixtures/directives/README.md +12 -0
  228. package/test/declarative/fixtures/directives/children/entry.html +11 -0
  229. package/test/declarative/fixtures/directives/children/fast-build.config.json +6 -0
  230. package/test/declarative/fixtures/directives/children/index.html +15 -0
  231. package/test/declarative/fixtures/directives/children/main.ts +22 -0
  232. package/test/declarative/fixtures/directives/children/state.json +3 -0
  233. package/test/declarative/fixtures/directives/children/templates.html +3 -0
  234. package/test/declarative/fixtures/directives/ref/entry.html +11 -0
  235. package/test/declarative/fixtures/directives/ref/fast-build.config.json +6 -0
  236. package/test/declarative/fixtures/directives/ref/index.html +15 -0
  237. package/test/declarative/fixtures/directives/ref/main.ts +17 -0
  238. package/test/declarative/fixtures/directives/ref/state.json +1 -0
  239. package/test/declarative/fixtures/directives/ref/templates.html +3 -0
  240. package/test/declarative/fixtures/directives/repeat/entry.html +21 -0
  241. package/test/declarative/fixtures/directives/repeat/fast-build.config.json +6 -0
  242. package/test/declarative/fixtures/directives/repeat/index.html +133 -0
  243. package/test/declarative/fixtures/directives/repeat/main.ts +110 -0
  244. package/test/declarative/fixtures/directives/repeat/sprites.svg +8 -0
  245. package/test/declarative/fixtures/directives/repeat/state.json +10 -0
  246. package/test/declarative/fixtures/directives/repeat/templates.html +75 -0
  247. package/test/declarative/fixtures/directives/slotted/entry.html +17 -0
  248. package/test/declarative/fixtures/directives/slotted/fast-build.config.json +6 -0
  249. package/test/declarative/fixtures/directives/slotted/index.html +27 -0
  250. package/test/declarative/fixtures/directives/slotted/main.ts +29 -0
  251. package/test/declarative/fixtures/directives/slotted/state.json +1 -0
  252. package/test/declarative/fixtures/directives/slotted/templates.html +7 -0
  253. package/test/declarative/fixtures/directives/when/entry.html +51 -0
  254. package/test/declarative/fixtures/directives/when/fast-build.config.json +6 -0
  255. package/test/declarative/fixtures/directives/when/index.html +136 -0
  256. package/test/declarative/fixtures/directives/when/main.ts +172 -0
  257. package/test/declarative/fixtures/directives/when/state.json +12 -0
  258. package/test/declarative/fixtures/directives/when/templates.html +75 -0
  259. package/test/declarative/fixtures/ecosystem/README.md +11 -0
  260. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/entry.html +12 -0
  261. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/fast-build.config.json +6 -0
  262. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/index.html +20 -0
  263. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/main.ts +68 -0
  264. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/state.json +4 -0
  265. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/templates.html +7 -0
  266. package/test/declarative/fixtures/ecosystem/errors/entry.html +12 -0
  267. package/test/declarative/fixtures/ecosystem/errors/fast-build.config.json +6 -0
  268. package/test/declarative/fixtures/ecosystem/errors/index.html +20 -0
  269. package/test/declarative/fixtures/ecosystem/errors/main.ts +17 -0
  270. package/test/declarative/fixtures/ecosystem/errors/state.json +1 -0
  271. package/test/declarative/fixtures/ecosystem/errors/templates.html +7 -0
  272. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/entry.html +17 -0
  273. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/fast-build.config.json +6 -0
  274. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/index.html +56 -0
  275. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/main.ts +134 -0
  276. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/state.json +12 -0
  277. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/templates.html +34 -0
  278. package/test/declarative/fixtures/ecosystem/performance-metrics/entry.html +25 -0
  279. package/test/declarative/fixtures/ecosystem/performance-metrics/fast-build.config.json +6 -0
  280. package/test/declarative/fixtures/ecosystem/performance-metrics/fast-card.css +10 -0
  281. package/test/declarative/fixtures/ecosystem/performance-metrics/index.html +181 -0
  282. package/test/declarative/fixtures/ecosystem/performance-metrics/main.ts +58 -0
  283. package/test/declarative/fixtures/ecosystem/performance-metrics/state.json +6 -0
  284. package/test/declarative/fixtures/ecosystem/performance-metrics/templates.html +15 -0
  285. package/test/declarative/fixtures/extensions/README.md +15 -0
  286. package/test/declarative/fixtures/extensions/attribute-map/entry.html +14 -0
  287. package/test/declarative/fixtures/extensions/attribute-map/fast-build.config.json +6 -0
  288. package/test/declarative/fixtures/extensions/attribute-map/index.html +31 -0
  289. package/test/declarative/fixtures/extensions/attribute-map/main.ts +40 -0
  290. package/test/declarative/fixtures/extensions/attribute-map/state.json +4 -0
  291. package/test/declarative/fixtures/extensions/attribute-map/templates.html +14 -0
  292. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/entry.html +12 -0
  293. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/fast-build.config.json +7 -0
  294. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/index.html +25 -0
  295. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/main.ts +31 -0
  296. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/state.json +5 -0
  297. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/templates.html +11 -0
  298. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/entry.html +13 -0
  299. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/fast-build.config.json +7 -0
  300. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/index.html +23 -0
  301. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/main.ts +37 -0
  302. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/state.json +1 -0
  303. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/templates.html +9 -0
  304. package/test/declarative/fixtures/extensions/observer-map/entry.html +15 -0
  305. package/test/declarative/fixtures/extensions/observer-map/fast-build.config.json +6 -0
  306. package/test/declarative/fixtures/extensions/observer-map/index.html +442 -0
  307. package/test/declarative/fixtures/extensions/observer-map/main.ts +482 -0
  308. package/test/declarative/fixtures/extensions/observer-map/state.json +158 -0
  309. package/test/declarative/fixtures/extensions/observer-map/templates.html +172 -0
  310. package/test/declarative/fixtures/extensions/observer-map-config-object/entry.html +16 -0
  311. package/test/declarative/fixtures/extensions/observer-map-config-object/fast-build.config.json +6 -0
  312. package/test/declarative/fixtures/extensions/observer-map-config-object/index.html +27 -0
  313. package/test/declarative/fixtures/extensions/observer-map-config-object/main.ts +53 -0
  314. package/test/declarative/fixtures/extensions/observer-map-config-object/state.json +9 -0
  315. package/test/declarative/fixtures/extensions/observer-map-config-object/templates.html +12 -0
  316. package/test/declarative/fixtures/extensions/observer-map-deep-merge/README.md +98 -0
  317. package/test/declarative/fixtures/extensions/observer-map-deep-merge/entry.html +156 -0
  318. package/test/declarative/fixtures/extensions/observer-map-deep-merge/fast-build.config.json +6 -0
  319. package/test/declarative/fixtures/extensions/observer-map-deep-merge/index.html +376 -0
  320. package/test/declarative/fixtures/extensions/observer-map-deep-merge/main.ts +366 -0
  321. package/test/declarative/fixtures/extensions/observer-map-deep-merge/state.json +69 -0
  322. package/test/declarative/fixtures/extensions/observer-map-deep-merge/templates.html +91 -0
  323. package/test/declarative/fixtures/extensions/observer-map-properties/entry.html +14 -0
  324. package/test/declarative/fixtures/extensions/observer-map-properties/fast-build.config.json +6 -0
  325. package/test/declarative/fixtures/extensions/observer-map-properties/index.html +110 -0
  326. package/test/declarative/fixtures/extensions/observer-map-properties/main.ts +175 -0
  327. package/test/declarative/fixtures/extensions/observer-map-properties/state.json +29 -0
  328. package/test/declarative/fixtures/extensions/observer-map-properties/templates.html +55 -0
  329. package/test/declarative/fixtures/scenarios/README.md +7 -0
  330. package/test/declarative/fixtures/scenarios/nested-elements/entry.html +16 -0
  331. package/test/declarative/fixtures/scenarios/nested-elements/fast-build.config.json +6 -0
  332. package/test/declarative/fixtures/scenarios/nested-elements/index.html +126 -0
  333. package/test/declarative/fixtures/scenarios/nested-elements/main.ts +214 -0
  334. package/test/declarative/fixtures/scenarios/nested-elements/state.json +10 -0
  335. package/test/declarative/fixtures/scenarios/nested-elements/templates.html +54 -0
  336. package/test/declarative/index.html +12 -0
  337. package/test/declarative/vite.config.ts +55 -0
  338. package/test/declarative-main.ts +6 -0
  339. package/test/extension-subpaths-main.ts +9 -0
  340. package/test/main.ts +38 -33
  341. package/test/pure-declarative-main.ts +1 -0
  342. package/dist/dts/components/install-hydration.d.ts +0 -1
  343. package/dist/dts/pending-task.d.ts +0 -32
  344. package/dist/dts/polyfills.d.ts +0 -0
  345. package/dist/dts/styles/css-binding-directive.d.ts +0 -60
  346. package/dist/dts/templating/install-hydratable-view-templates.d.ts +0 -1
  347. package/dist/esm/components/install-hydration.js +0 -3
  348. package/dist/esm/pending-task.js +0 -28
  349. package/dist/esm/polyfills.js +0 -60
  350. package/dist/esm/styles/css-binding-directive.js +0 -76
  351. 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
- * {@link RepeatDirective}, so calling this API manually is
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 {@link Accessor} that supports reactivity,
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 = typeof reflectMode | typeof booleanMode | "fromView";
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?: DOMPolicy | undefined;
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?: DOMPolicy | undefined, isVolatile?: boolean);
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
- declare const booleanMode = "boolean";
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<TSource, TParent> {
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, TParent = any>(propertyOrOptions: (keyof TSource & string) | ChildrenDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
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: DOMPolicy) => HTMLTemplateCompilationResult;
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?: DOMPolicy): HTMLTemplateCompilationResult<TSource, TParent>;
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?: DOMPolicy): ViewBehaviorFactory;
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>>;
427
460
 
428
- declare function compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
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
+ };
501
+
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 strings and ElementStyle instances.
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
- * Enables bindings in CSS.
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 a CSS fragment to interpolate into the CSS document.
563
- * @returns - the string to interpolate into CSS
617
+ * Creates static styles to interpolate into the CSS document.
618
+ * @returns - the styles to interpolate into CSS
564
619
  */
565
- createCSS(add: AddBehavior): ComposableStyles;
620
+ createCSS(): ComposableStyles;
566
621
  }
567
622
 
568
623
  /**
569
- * Instructs the css engine to provide dynamic styles or
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 strings and ElementStyle instances.
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 = (<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: CSSValue<TSource, TParent>[]) => ElementStyles) & {
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<TSource = any, TParent = any>(strings: TemplateStringsArray, ...values: CSSValue<TSource, TParent>[]): CSSDirective;
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<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | ComposableStyles | CSSDirective;
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
- declare class DefaultExecutionContext<TParent> implements ExecutionContext<TParent> {
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";
769
+ declare function define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition<TType>, extensions?: FASTElementExtension[]): Promise<TType>;
708
770
 
709
- declare function define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition): TType;
710
-
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: DOMPolicy;
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: DOMPolicy): void;
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
- export declare interface DOMPolicy {
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> extends PropertyChangeNotifier implements HostController<TElement> {
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 global.
1551
+ * The FAST messaging API for warnings and errors.
1327
1552
  * @public
1328
1553
  */
1329
- export declare const FAST: FASTGlobal;
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 registerAsync: (name: string) => Promise<Function>;
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
- * The FAST global.
1751
+ * Resolves an element template from a composed definition.
1509
1752
  * @public
1510
1753
  */
1511
- export declare interface FASTGlobal {
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: DOMPolicy;
1868
+ policy: DOMPolicy_2;
1658
1869
  /**
1659
1870
  * The original source aspect exactly as represented in markup.
1660
1871
  */
@@ -1710,6 +1921,12 @@ export declare class HTMLBindingDirective implements HTMLDirective, ViewBehavior
1710
1921
  * Re-evaluates the binding expression via observer.bind() and pushes
1711
1922
  * the new value to the DOM through the updateTarget sink function.
1712
1923
  * This is the reactive update path that keeps the DOM in sync with data.
1924
+ *
1925
+ * Guards against stale notifications: when a view is unbound (e.g., after
1926
+ * a parent `when` directive tears down a child element), coupled-lifetime
1927
+ * observers may still hold active subscriptions. If a property change fires
1928
+ * on the source element while the view is inactive, this guard prevents
1929
+ * the binding expression from evaluating with a null source.
1713
1930
  * @internal
1714
1931
  */
1715
1932
  handleChange(binding: Expression, observer: ExpressionObserver): void;
@@ -1835,6 +2052,24 @@ export declare class HTMLView<TSource = any, TParent = any> extends DefaultExecu
1835
2052
  * Indicates how the source's lifetime relates to the controller's lifetime.
1836
2053
  */
1837
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>;
1838
2073
  /**
1839
2074
  * The execution context the view is running within.
1840
2075
  */
@@ -1893,237 +2128,16 @@ export declare class HTMLView<TSource = any, TParent = any> extends DefaultExecu
1893
2128
  * @param context - The execution context to run the behaviors within.
1894
2129
  */
1895
2130
  bind(source: TSource, context?: ExecutionContext<TParent>): void;
1896
- /**
1897
- * Unbinds a view's behaviors from its binding source.
1898
- */
1899
- unbind(): void;
1900
- private evaluateUnbindables;
1901
- /**
1902
- * Efficiently disposes of a contiguous range of synthetic view instances.
1903
- * @param views - A contiguous range of views to be disposed.
1904
- */
1905
- static disposeContiguousBatch(views: SyntheticView[]): void;
1906
- }
1907
-
1908
- /**
1909
- * @internal
1910
- */
1911
- declare const Hydratable: unique symbol;
1912
-
1913
- declare interface HydratableContentTemplate extends ContentTemplate {
1914
- /**
1915
- * Hydrates a content view from first/last nodes.
1916
- */
1917
- hydrate(first: Node, last: Node): ContentView;
1918
- }
1919
-
1920
- /**
1921
- * An ElementController capable of hydrating FAST elements from
1922
- * Declarative Shadow DOM.
1923
- *
1924
- * @beta
1925
- */
1926
- export declare class HydratableElementController<TElement extends HTMLElement = HTMLElement> extends ElementController<TElement> {
1927
- /**
1928
- * Controls whether the controller will hydrate during the connect() method.
1929
- * Initialized during the first connect() call to true when the `needs-hydration`
1930
- * attribute is present on the element.
1931
- */
1932
- protected needsHydration?: boolean;
1933
- private static hydrationObserver;
1934
- /**
1935
- * {@inheritdoc ElementController.shadowOptions}
1936
- */
1937
- get shadowOptions(): ShadowRootOptions | undefined;
1938
- set shadowOptions(value: ShadowRootOptions | undefined);
1939
- /**
1940
- * Lifecycle callbacks for hydration events
1941
- */
1942
- static lifecycleCallbacks: HydrationControllerCallbacks;
1943
- /**
1944
- * Whether the hydrationStarted callback has already been invoked.
1945
- */
1946
- private static hydrationStarted;
1947
- /**
1948
- * An idle callback ID used to track hydration completion
1949
- */
1950
- private static idleCallbackId;
1951
- /**
1952
- * Adds the current element instance to the hydrating instances map
1953
- */
1954
- private addHydratingInstance;
1955
- /**
1956
- * Configure lifecycle callbacks for hydration events
1957
- */
1958
- static config(callbacks: HydrationControllerCallbacks): typeof HydratableElementController;
1959
- private static hydrationObserverHandler;
1960
- /**
1961
- * Checks to see if hydration is complete and if so, invokes the hydrationComplete callback.
1962
- * Then resets the ElementController strategy to the default so that future elements
1963
- * don't use the HydratableElementController.
1964
- *
1965
- * @param deadline - the idle deadline object
1966
- */
1967
- private static checkHydrationComplete;
1968
- /**
1969
- * Runs connected lifecycle behavior on the associated element.
1970
- */
1971
- connect(): void;
1972
- /**
1973
- * A map of element instances by the name of the custom element they are
1974
- * associated with. The key is the custom element name, and the value is the
1975
- * instances of hydratable elements which currently need to be hydrated.
1976
- *
1977
- * When all of the instances in the set have been hydrated, the set is
1978
- * cleared and removed from the map. If the map is empty, the
1979
- * hydrationComplete callback is invoked.
1980
- */
1981
- private static hydratingInstances?;
1982
- /**
1983
- * Removes the current element instance from the hydrating instances map
1984
- */
1985
- private removeHydratingInstance;
1986
- /**
1987
- * Unregisters the hydration observer when the element is disconnected.
1988
- */
1989
- disconnect(): void;
1990
- /**
1991
- * Sets the ElementController strategy to HydratableElementController.
1992
- * @remarks
1993
- * This method is typically called during application startup to enable
1994
- * hydration support for FAST elements.
1995
- */
1996
- static install(): void;
1997
- }
1998
-
1999
- declare interface HydratableElementViewTemplate<TSource = any, TParent = any> extends ElementViewTemplate<TSource, TParent> {
2000
- hydrate(firstChild: Node, lastChild: Node, hostBindingTarget?: Element): ElementView<TSource, TParent>;
2001
- }
2002
-
2003
- declare interface HydratableSyntheticViewTemplate<TSource = any, TParent = any> extends SyntheticViewTemplate {
2004
- hydrate(firstChild: Node, lastChild: Node): SyntheticView<TSource, TParent>;
2005
- }
2006
-
2007
- /** @public */
2008
- export declare interface HydratableView<TSource = any, TParent = any> extends ElementView, SyntheticView, DefaultExecutionContext<TParent> {
2009
- [Hydratable]: symbol;
2010
- readonly bindingViewBoundaries: Record<string, ViewNodes>;
2011
- readonly hydrationStage: keyof typeof HydrationStage;
2012
- }
2013
-
2014
- /** @public */
2015
- export declare class HydrationBindingError extends Error {
2016
- /**
2017
- * The factory that was unable to be bound
2018
- */
2019
- readonly factory: ViewBehaviorFactory;
2020
- /**
2021
- * A DocumentFragment containing a clone of the
2022
- * view's Nodes.
2023
- */
2024
- readonly fragment: DocumentFragment;
2025
- /**
2026
- * String representation of the HTML in the template that
2027
- * threw the binding error.
2028
- */
2029
- readonly templateString: string;
2030
- constructor(
2031
- /**
2032
- * The error message
2033
- */
2034
- message: string | undefined,
2035
- /**
2036
- * The factory that was unable to be bound
2037
- */
2038
- factory: ViewBehaviorFactory,
2039
- /**
2040
- * A DocumentFragment containing a clone of the
2041
- * view's Nodes.
2042
- */
2043
- fragment: DocumentFragment,
2044
- /**
2045
- * String representation of the HTML in the template that
2046
- * threw the binding error.
2047
- */
2048
- templateString: string);
2049
- }
2050
-
2051
- /**
2052
- * Lifecycle callbacks for element hydration events
2053
- * @public
2054
- */
2055
- export declare interface HydrationControllerCallbacks<TElement extends HTMLElement = HTMLElement> {
2056
- /**
2057
- * Called once when the first element enters the hydration pipeline.
2058
- * This is the earliest point at which we know a component has been
2059
- * async-defined with `defer-and-hydrate`, a template is pending via
2060
- * `<f-template>`, and the element has `needs-hydration`.
2061
- */
2062
- hydrationStarted?(): void;
2063
- /**
2064
- * Called before an individual element's hydration begins
2065
- */
2066
- elementWillHydrate?(source: TElement): void;
2067
- /**
2068
- * Called after an individual element's hydration has finished
2069
- */
2070
- elementDidHydrate?(source: TElement): void;
2071
- /**
2072
- * Called after all elements have completed hydration
2073
- */
2074
- hydrationComplete?(): void;
2075
- }
2076
-
2077
- declare const HydrationStage: {
2078
- readonly unhydrated: "unhydrated";
2079
- readonly hydrating: "hydrating";
2080
- readonly hydrated: "hydrated";
2081
- };
2082
-
2083
- declare class HydrationView<TSource = any, TParent = any> extends DefaultExecutionContext<TParent> implements HydratableView {
2084
- readonly firstChild: Node;
2085
- readonly lastChild: Node;
2086
- private sourceTemplate;
2087
- private hostBindingTarget?;
2088
- [Hydratable]: symbol;
2089
- context: ExecutionContext<any>;
2090
- source: TSource | null;
2091
- isBound: boolean;
2092
- get hydrationStage(): "unhydrated" | "hydrating" | "hydrated";
2093
- get targets(): ViewBehaviorTargets;
2094
- get bindingViewBoundaries(): ViewBehaviorBoundaries;
2095
- readonly sourceLifetime: SourceLifetime;
2096
- private unbindables;
2097
- private fragment;
2098
- private behaviors;
2099
- private factories;
2100
- private _hydrationStage;
2101
- private _bindingViewBoundaries;
2102
- private _targets;
2103
- constructor(firstChild: Node, lastChild: Node, sourceTemplate: ViewTemplate, hostBindingTarget?: Element | undefined);
2104
- /**
2105
- * no-op. Hydrated views are don't need to be moved from a documentFragment
2106
- * to the target node.
2107
- */
2108
- insertBefore(node: Node): void;
2109
- /**
2110
- * Appends the view to a node. In cases where this is called before the
2111
- * view has been removed, the method will no-op.
2112
- * @param node - the node to append the view to.
2113
- */
2114
- appendTo(node: Node): void;
2115
- remove(): void;
2116
- bind(source: TSource, context?: ExecutionContext<any>): void;
2117
- unbind(): void;
2118
- /**
2119
- * Removes the view and unbinds its behaviors, disposing of DOM nodes afterward.
2120
- * Once a view has been disposed, it cannot be inserted or bound again.
2121
- */
2122
- dispose(): void;
2123
- onUnbind(behavior: {
2124
- unbind(controller: ViewController<TSource, TParent>): void;
2125
- }): void;
2131
+ /**
2132
+ * Unbinds a view's behaviors from its binding source.
2133
+ */
2134
+ unbind(): void;
2126
2135
  private evaluateUnbindables;
2136
+ /**
2137
+ * Efficiently disposes of a contiguous range of synthetic view instances.
2138
+ * @param views - A contiguous range of views to be disposed.
2139
+ */
2140
+ static disposeContiguousBatch(views: SyntheticView[]): void;
2127
2141
  }
2128
2142
 
2129
2143
  /**
@@ -2150,20 +2164,41 @@ export declare class InlineTemplateDirective implements HTMLDirective {
2150
2164
  }
2151
2165
 
2152
2166
  /**
2153
- * Tests if a template or ViewController is hydratable.
2154
- *
2155
- * @beta
2167
+ * A JSON schema describing a root property.
2168
+ * @public
2156
2169
  */
2157
- export declare function isHydratable(view: ViewController): view is HydrationView;
2158
-
2159
- /** @beta */
2160
- export declare function isHydratable<TSource = any, TParent = any>(template: SyntheticViewTemplate<TSource, TParent>): template is HydratableSyntheticViewTemplate<TSource, TParent>;
2170
+ export declare interface JSONSchema extends JSONSchemaCommon {
2171
+ $schema: string;
2172
+ $id: string;
2173
+ $defs?: Record<string, JSONSchemaDefinition>;
2174
+ }
2161
2175
 
2162
- /** @beta */
2163
- export declare function isHydratable<TSource = any, TParent = any>(template: ElementViewTemplate<TSource, TParent>): template is HydratableElementViewTemplate<TSource, TParent>;
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
+ }
2164
2193
 
2165
- /** @beta */
2166
- export declare function isHydratable(template: ContentTemplate): template is HydratableContentTemplate;
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
+ }
2167
2202
 
2168
2203
  /**
2169
2204
  * Observes array lengths.
@@ -2224,12 +2259,6 @@ export declare const Markup: Readonly<{
2224
2259
  comment: (id: string) => string;
2225
2260
  }>;
2226
2261
 
2227
- /**
2228
- * The attribute used to indicate that an element needs hydration.
2229
- * @public
2230
- */
2231
- export declare const needsHydrationAttribute = "needs-hydration";
2232
-
2233
2262
  /**
2234
2263
  * Options for configuring node observation behavior.
2235
2264
  * @public
@@ -2468,7 +2497,7 @@ export declare interface ObservationRecord {
2468
2497
  * @returns A binding configuration.
2469
2498
  * @public
2470
2499
  */
2471
- export declare function oneTime<T = any>(expression: Expression<T>, policy?: DOMPolicy): Binding<T>;
2500
+ export declare function oneTime<T = any>(expression: Expression<T>, policy?: DOMPolicy_2): Binding<T>;
2472
2501
 
2473
2502
  /**
2474
2503
  * Creates an standard binding.
@@ -2478,7 +2507,33 @@ export declare function oneTime<T = any>(expression: Expression<T>, policy?: DOM
2478
2507
  * @returns A binding configuration.
2479
2508
  * @public
2480
2509
  */
2481
- export declare function oneWay<T = any>(expression: Expression<T>, policy?: DOMPolicy, isVolatile?: boolean): Binding<T>;
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>;
2482
2537
 
2483
2538
  /**
2484
2539
  * Common APIs related to content parsing.
@@ -2500,20 +2555,15 @@ export declare const Parser: Readonly<{
2500
2555
  * Represents metadata configuration for a custom element.
2501
2556
  * @public
2502
2557
  */
2503
- export declare interface PartialFASTElementDefinition {
2558
+ export declare interface PartialFASTElementDefinition<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> {
2504
2559
  /**
2505
2560
  * The name of the custom element.
2506
2561
  */
2507
2562
  readonly name: string;
2508
2563
  /**
2509
- * The template to render for the custom element.
2510
- */
2511
- readonly template?: ElementViewTemplate;
2512
- /**
2513
- * Options controlling how the template will be created.
2514
- * @alpha
2564
+ * The template, or template resolver, for the custom element.
2515
2565
  */
2516
- readonly templateOptions?: TemplateOptions;
2566
+ readonly template?: ElementViewTemplate<InstanceType<TType>> | FASTElementTemplateResolver<TType>;
2517
2567
  /**
2518
2568
  * The styles to associate with the custom element.
2519
2569
  */
@@ -2543,6 +2593,12 @@ export declare interface PartialFASTElementDefinition {
2543
2593
  * Lifecycle callbacks for template events.
2544
2594
  */
2545
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;
2546
2602
  }
2547
2603
 
2548
2604
  /**
@@ -2593,12 +2649,47 @@ export declare class PropertyChangeNotifier implements Notifier {
2593
2649
  unsubscribe(subscriber: Subscriber, propertyToUnwatch?: string): void;
2594
2650
  }
2595
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
+
2596
2687
  /**
2597
2688
  * A directive that observes the updates a property with a reference to the element.
2598
2689
  * @param propertyName - The name of the property to assign the reference to.
2599
2690
  * @public
2600
2691
  */
2601
- export declare const ref: <TSource = any, TParent = any>(propertyName: keyof TSource & string) => CaptureType<TSource, TParent>;
2692
+ export declare const ref: <TSource = any>(propertyName: keyof TSource & string) => CaptureType;
2602
2693
 
2603
2694
  /**
2604
2695
  * The runtime behavior for template references.
@@ -2616,7 +2707,15 @@ export declare class RefDirective extends StatelessAttachedAttributeDirective<st
2616
2707
  bind(controller: ViewController): void;
2617
2708
  }
2618
2709
 
2619
- declare const reflectMode = "reflect";
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
+ }
2620
2719
 
2621
2720
  /**
2622
2721
  * Creates a RenderDirective for use in advanced rendering scenarios.
@@ -2634,7 +2733,7 @@ declare const reflectMode = "reflect";
2634
2733
  * RenderInstruction to determine the view.
2635
2734
  * @public
2636
2735
  */
2637
- 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<TSource, TParent>;
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;
2638
2737
 
2639
2738
  /**
2640
2739
  * A Behavior that enables advanced rendering.
@@ -2664,7 +2763,13 @@ export declare class RenderBehavior<TSource = any> implements ViewBehavior, Subs
2664
2763
  * @param controller - The view controller that manages the lifecycle of this behavior.
2665
2764
  */
2666
2765
  unbind(controller: ViewController): void;
2667
- /** @internal */
2766
+ /**
2767
+ * Handles changes from data or template binding observers.
2768
+ * Guards against stale notifications that may arrive after the
2769
+ * controller's view has been unbound (e.g., when a parent `when`
2770
+ * directive tears down and later recreates a child element).
2771
+ * @internal
2772
+ */
2668
2773
  handleChange(source: any, observer: ExpressionObserver): void;
2669
2774
  private bindView;
2670
2775
  private refreshView;
@@ -2708,7 +2813,7 @@ export declare class RenderDirective<TSource = any> implements HTMLDirective, Vi
2708
2813
  * @param options - Options used to turn on special repeat features.
2709
2814
  * @public
2710
2815
  */
2711
- 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<TSource, TParent>;
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;
2712
2817
 
2713
2818
  /**
2714
2819
  * A behavior that renders a template for each item in an array.
@@ -2759,6 +2864,14 @@ export declare class RepeatBehavior<TSource = any> implements ViewBehavior, Subs
2759
2864
  private hydrateViews;
2760
2865
  }
2761
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
+
2762
2875
  /**
2763
2876
  * A directive that configures list rendering.
2764
2877
  * @public
@@ -2805,6 +2918,108 @@ export declare interface RepeatOptions {
2805
2918
  recycle?: boolean;
2806
2919
  }
2807
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
+
2808
3023
  /**
2809
3024
  * Shadow root initialization options.
2810
3025
  * @public
@@ -2818,13 +3033,47 @@ export declare interface ShadowRootOptions extends ShadowRootInit {
2818
3033
  registry?: CustomElementRegistry;
2819
3034
  }
2820
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
+
2821
3070
  /**
2822
3071
  * A directive that observes the `assignedNodes()` of a slot and updates a property
2823
3072
  * whenever they change.
2824
3073
  * @param propertyOrOptions - The options used to configure slotted node observation.
2825
3074
  * @public
2826
3075
  */
2827
- export declare function slotted<TSource = any, TParent = any>(propertyOrOptions: (keyof TSource & string) | SlottedDirectiveOptions<keyof TSource & string>): CaptureType<TSource, TParent>;
3076
+ export declare function slotted<TSource = any>(propertyOrOptions: (keyof TSource & string) | SlottedDirectiveOptions<keyof TSource & string>): CaptureType;
2828
3077
 
2829
3078
  /**
2830
3079
  * The runtime behavior for slotted node observation.
@@ -3079,6 +3328,35 @@ export declare const enum Stages {
3079
3328
  disconnected = 3
3080
3329
  }
3081
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
+
3082
3360
  /**
3083
3361
  * A base class used for attribute directives that don't need internal state.
3084
3362
  * @public
@@ -3109,6 +3387,21 @@ export declare abstract class StatelessAttachedAttributeDirective<TOptions> impl
3109
3387
  abstract bind(controller: ViewController): void;
3110
3388
  }
3111
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
+
3112
3405
  /**
3113
3406
  * Implemented to provide specific behavior when adding/removing styles
3114
3407
  * for elements.
@@ -3266,7 +3559,7 @@ export declare interface SyntheticViewTemplate<TSource = any, TParent = any> {
3266
3559
  /**
3267
3560
  * Returns a directive that can inline the template.
3268
3561
  */
3269
- inline(): CaptureType<TSource, TParent>;
3562
+ inline(): CaptureType;
3270
3563
  }
3271
3564
 
3272
3565
  /**
@@ -3275,34 +3568,36 @@ export declare interface SyntheticViewTemplate<TSource = any, TParent = any> {
3275
3568
  */
3276
3569
  export declare interface TemplateLifecycleCallbacks {
3277
3570
  /**
3278
- * Called after the template has been assigned to the definition
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.
3279
3580
  */
3280
3581
  templateDidUpdate?(name: string): void;
3281
3582
  /**
3282
- * Called after the custom element has been defined
3583
+ * Called after the custom element has been defined.
3283
3584
  */
3284
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;
3285
3594
  }
3286
3595
 
3287
- /**
3288
- * Values for the `templateOptions` property.
3289
- * @alpha
3290
- */
3291
- export declare const TemplateOptions: {
3292
- readonly deferAndHydrate: "defer-and-hydrate";
3293
- };
3294
-
3295
- /**
3296
- * Type for the `TemplateOptions` const enum.
3297
- * @alpha
3298
- */
3299
- export declare type TemplateOptions = (typeof TemplateOptions)[keyof typeof TemplateOptions];
3300
-
3301
3596
  /**
3302
3597
  * Represents the types of values that can be interpolated into a template.
3303
3598
  * @public
3304
3599
  */
3305
- export declare type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType<TSource, TParent>;
3600
+ export declare type TemplateValue<TSource, TParent = any> = Expression<TSource, any, TParent> | Binding<TSource, any, TParent> | HTMLDirective | CaptureType;
3306
3601
 
3307
3602
  /**
3308
3603
  * A policy for use with the standard trustedTypes platform API.
@@ -3316,6 +3611,51 @@ export declare type TrustedTypesPolicy = {
3316
3611
  createHTML(html: string): string;
3317
3612
  };
3318
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
+
3319
3659
  /**
3320
3660
  * Do not change. Part of shared kernel contract.
3321
3661
  * @internal
@@ -3334,6 +3674,22 @@ export declare interface TypeRegistry<TDefinition extends TypeDefinition> {
3334
3674
  getForInstance(object: any): TDefinition | undefined;
3335
3675
  }
3336
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
+
3337
3693
  /**
3338
3694
  * A work queue used to synchronize writes to the DOM.
3339
3695
  * @public
@@ -3433,14 +3789,6 @@ export declare interface ViewBehavior<TSource = any, TParent = any> {
3433
3789
  bind(controller: ViewController<TSource, TParent>): void;
3434
3790
  }
3435
3791
 
3436
- /**
3437
- * Stores relationships between a {@link ViewBehaviorFactory} and
3438
- * the {@link ViewBoundaries} the factory created.
3439
- */
3440
- declare interface ViewBehaviorBoundaries {
3441
- [factoryId: string]: ViewBoundaries;
3442
- }
3443
-
3444
3792
  /**
3445
3793
  * A factory that can create a {@link ViewBehavior} associated with a particular
3446
3794
  * location within a DOM fragment.
@@ -3462,13 +3810,52 @@ export declare interface ViewBehaviorFactory {
3462
3810
  /**
3463
3811
  * The policy that the created behavior must run under.
3464
3812
  */
3465
- policy?: DOMPolicy;
3813
+ policy?: DOMPolicy_2;
3466
3814
  /**
3467
3815
  * Creates a behavior.
3468
3816
  */
3469
3817
  createBehavior(): ViewBehavior;
3470
3818
  }
3471
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
+
3472
3859
  /**
3473
3860
  * The target nodes available to a behavior.
3474
3861
  * @public
@@ -3477,14 +3864,6 @@ export declare type ViewBehaviorTargets = {
3477
3864
  [id: string]: Node;
3478
3865
  };
3479
3866
 
3480
- /**
3481
- * Represents the DOM boundaries controlled by a view
3482
- */
3483
- declare interface ViewBoundaries {
3484
- first: Node;
3485
- last: Node;
3486
- }
3487
-
3488
3867
  /**
3489
3868
  * Controls the lifecycle of a view and provides relevant context.
3490
3869
  * @public
@@ -3494,11 +3873,23 @@ export declare interface ViewController<TSource = any, TParent = any> extends Ex
3494
3873
  * The parts of the view that are targeted by view behaviors.
3495
3874
  */
3496
3875
  readonly targets: ViewBehaviorTargets;
3497
- }
3498
-
3499
- declare interface ViewNodes {
3500
- first: Node;
3501
- last: Node;
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>;
3502
3893
  }
3503
3894
 
3504
3895
  /**
@@ -3523,20 +3914,15 @@ export declare class ViewTemplate<TSource = any, TParent = any> implements Eleme
3523
3914
  * @param factories - The directives that will be connected to placeholders in the html.
3524
3915
  * @param policy - The security policy to use when compiling this template.
3525
3916
  */
3526
- constructor(html: string | HTMLTemplateElement, factories?: Record<string, ViewBehaviorFactory>, policy?: DOMPolicy | undefined);
3917
+ constructor(html: string | HTMLTemplateElement, factories?: Record<string, ViewBehaviorFactory>, policy?: DOMPolicy_2 | undefined);
3527
3918
  /**
3528
3919
  * @internal
3529
3920
  */
3530
3921
  compile(): HTMLTemplateCompilationResult<TSource, TParent>;
3531
- /**
3532
- * Creates an HTMLView instance based on this template definition.
3533
- * @param hostBindingTarget - The element that host behaviors will be bound to.
3534
- */
3535
- create(hostBindingTarget?: Element): HTMLView<TSource, TParent>;
3536
3922
  /**
3537
3923
  * Returns a directive that can inline the template.
3538
3924
  */
3539
- inline(): CaptureType<TSource, TParent>;
3925
+ inline(): CaptureType;
3540
3926
  /**
3541
3927
  * Sets the DOMPolicy for this template.
3542
3928
  * @param policy - The policy to associated with this template.
@@ -3545,7 +3931,7 @@ export declare class ViewTemplate<TSource = any, TParent = any> implements Eleme
3545
3931
  * The DOMPolicy can only be set once for a template and cannot be
3546
3932
  * set after the template is compiled.
3547
3933
  */
3548
- withPolicy(policy: DOMPolicy): this;
3934
+ withPolicy(policy: DOMPolicy_2): this;
3549
3935
  /**
3550
3936
  * Creates an HTMLView from this template, binds it to the source, and then appends it to the host.
3551
3937
  * @param source - The data source to bind the template to.
@@ -3554,6 +3940,11 @@ export declare class ViewTemplate<TSource = any, TParent = any> implements Eleme
3554
3940
  * host that the template is being attached to.
3555
3941
  */
3556
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>;
3557
3948
  /**
3558
3949
  * Processes the tagged template literal's static strings and interpolated values and
3559
3950
  * creates a ViewTemplate.
@@ -3585,7 +3976,7 @@ export declare class ViewTemplate<TSource = any, TParent = any> implements Eleme
3585
3976
  * and also be sure to manually sanitize all static strings particularly if they can
3586
3977
  * come from user input.
3587
3978
  */
3588
- static create<TSource = any, TParent = any>(strings: string[], values: TemplateValue<TSource, TParent>[], policy?: DOMPolicy): ViewTemplate<TSource, TParent>;
3979
+ static create<TSource = any, TParent = any>(strings: string[], values: TemplateValue<TSource, TParent>[], policy?: DOMPolicy_2): ViewTemplate<TSource, TParent>;
3589
3980
  }
3590
3981
 
3591
3982
  /**
@@ -3597,6 +3988,15 @@ export declare class ViewTemplate<TSource = any, TParent = any> implements Eleme
3597
3988
  */
3598
3989
  export declare function volatile(target: {}, name: string | Accessor, descriptor: PropertyDescriptor): PropertyDescriptor;
3599
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
+
3600
4000
  /**
3601
4001
  * A directive that enables basic conditional rendering in a template.
3602
4002
  * @param condition - The condition to test for rendering.
@@ -3606,6 +4006,6 @@ export declare function volatile(target: {}, name: string | Accessor, descriptor
3606
4006
  * gets the template to render when the conditional is false.
3607
4007
  * @public
3608
4008
  */
3609
- 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<TSource, TParent>;
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;
3610
4010
 
3611
4011
  export { }