@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,7 +1,7 @@
1
1
  {
2
2
  "metadata": {
3
3
  "toolPackage": "@microsoft/api-extractor",
4
- "toolVersion": "7.57.7",
4
+ "toolVersion": "7.58.1",
5
5
  "schemaVersion": 1011,
6
6
  "oldestForwardsCompatibleVersion": 1001,
7
7
  "tsdocConfig": {
@@ -2223,7 +2223,7 @@
2223
2223
  {
2224
2224
  "kind": "PropertySignature",
2225
2225
  "canonicalReference": "@microsoft/fast-element!InterfaceConfiguration#respectConnection:member",
2226
- "docComment": "/**\n * When true, the dependency will be re-resolved when FASTElement connection changes. If the resolved value changes due to connection change, a {@link @microsoft/fast-element#Observable | notification} will be emitted for the property, with the previous and next values provided to any subscriber.\n */\n",
2226
+ "docComment": "/**\n * When true, the dependency will be re-resolved when FASTElement connection changes. If the resolved value changes due to connection change, an observable notification will be emitted for the property, with the previous and next values provided to any subscriber.\n */\n",
2227
2227
  "excerptTokens": [
2228
2228
  {
2229
2229
  "kind": "Content",
@@ -0,0 +1,2 @@
1
+ export { ArrayObserver, type LengthObserver, Sort, type SortObserver, Splice, SpliceStrategy, SpliceStrategySupport, } from "./observation/arrays.js";
2
+ export type { Notifier, Subscriber, SubscriberSet } from "./observation/notifier.js";
@@ -0,0 +1,2 @@
1
+ export { type ArrayObserver, type LengthObserver, lengthOf, Sort, type SortObserver, Splice, SpliceStrategy, SpliceStrategySupport, sortedCount, } from "./observation/arrays.js";
2
+ export type { Notifier, Subscriber, SubscriberSet } from "./observation/notifier.js";
@@ -0,0 +1 @@
1
+ export { AttributeConfiguration, AttributeDefinition, type AttributeMode, attr, booleanConverter, type DecoratorAttributeConfiguration, nullableBooleanConverter, nullableNumberConverter, type ValueConverter, } from "./components/attributes.js";
@@ -1,6 +1,6 @@
1
- import type { Expression } from "../observation/observable.js";
2
- import type { Subscriber } from "../observation/notifier.js";
3
1
  import type { DOMPolicy } from "../dom.js";
2
+ import type { Subscriber } from "../observation/notifier.js";
3
+ import type { Expression } from "../observation/observable.js";
4
4
  import { Binding } from "./binding.js";
5
5
  /**
6
6
  * The gateway to signal APIs.
@@ -9,14 +9,14 @@ import { Binding } from "./binding.js";
9
9
  export declare const Signal: Readonly<{
10
10
  /**
11
11
  * Subscribes to a signal.
12
- * @param signal The signal to subscribe to.
13
- * @param subscriber The subscriber.
12
+ * @param signal - The signal to subscribe to.
13
+ * @param subscriber - The subscriber.
14
14
  */
15
15
  subscribe(signal: string, subscriber: Subscriber): void;
16
16
  /**
17
17
  * Unsubscribes from the signal.
18
- * @param signal The signal to unsubscribe from.
19
- * @param subscriber The subscriber.
18
+ * @param signal - The signal to unsubscribe from.
19
+ * @param subscriber - The subscriber.
20
20
  */
21
21
  unsubscribe(signal: string, subscriber: Subscriber): void;
22
22
  /**
@@ -23,6 +23,7 @@ export interface TwoWaySettings {
23
23
  }
24
24
  /**
25
25
  * Enables configuring two-way binding settings.
26
+ * @public
26
27
  */
27
28
  export declare const TwoWaySettings: Readonly<{
28
29
  /**
@@ -0,0 +1,7 @@
1
+ export { Binding, type BindingDirective } from "./binding/binding.js";
2
+ export { normalizeBinding } from "./binding/normalize.js";
3
+ export { oneTime } from "./binding/one-time.js";
4
+ export { listener, oneWay } from "./binding/one-way.js";
5
+ export type { DOMAspect, DOMPolicy } from "./dom.js";
6
+ export type { Subscriber } from "./observation/notifier.js";
7
+ export type { Expression, ExpressionObserver } from "./observation/observable.js";
@@ -16,8 +16,6 @@ export interface ValueConverter {
16
16
  */
17
17
  fromView(value: any): any;
18
18
  }
19
- declare const booleanMode = "boolean";
20
- declare const reflectMode = "reflect";
21
19
  /**
22
20
  * The mode that specifies the runtime behavior of the attribute.
23
21
  * @remarks
@@ -29,7 +27,7 @@ declare const reflectMode = "reflect";
29
27
  * changes in the DOM, but does not reflect property changes back.
30
28
  * @public
31
29
  */
32
- export type AttributeMode = typeof reflectMode | typeof booleanMode | "fromView";
30
+ export type AttributeMode = "reflect" | "boolean" | "fromView";
33
31
  /**
34
32
  * Metadata used to configure a custom attribute's behavior.
35
33
  * @public
@@ -77,7 +75,7 @@ export declare const nullableBooleanConverter: ValueConverter;
77
75
  */
78
76
  export declare const nullableNumberConverter: ValueConverter;
79
77
  /**
80
- * An implementation of {@link Accessor} that supports reactivity,
78
+ * An implementation of `Accessor` that supports reactivity,
81
79
  * change callbacks, attribute reflection, and type conversion for
82
80
  * custom elements.
83
81
  * @public
@@ -153,4 +151,3 @@ export declare function attr(config?: DecoratorAttributeConfiguration): (target:
153
151
  * @public
154
152
  */
155
153
  export declare function attr(target: {}, prop: string): void;
156
- export {};
@@ -0,0 +1,9 @@
1
+ import type { FASTElementDefinition } from "../components/fast-definitions.js";
2
+ import type { Schema } from "./schema.js";
3
+ export interface DeclarativeSchemaTransformContext {
4
+ definition: FASTElementDefinition;
5
+ schema: Schema;
6
+ }
7
+ export type DeclarativeSchemaTransform = (context: DeclarativeSchemaTransformContext) => void;
8
+ export declare function setDefinitionSchemaTransform(definition: FASTElementDefinition, key: string, transform: DeclarativeSchemaTransform, priority: number): void;
9
+ export declare function getDefinitionSchemaTransforms(definition?: FASTElementDefinition): readonly DeclarativeSchemaTransform[];
@@ -1,4 +1,4 @@
1
- import { PropertyChangeNotifier } from "../observation/notifier.js";
1
+ import type { Notifier, Subscriber } from "../observation/notifier.js";
2
2
  import { ExecutionContext, type ExpressionController, SourceLifetime } from "../observation/observable.js";
3
3
  import { ElementStyles } from "../styles/element-styles.js";
4
4
  import type { HostBehavior, HostController } from "../styles/host.js";
@@ -6,10 +6,6 @@ import type { StyleStrategy, StyleTarget } from "../styles/style-strategy.js";
6
6
  import type { ElementViewTemplate } from "../templating/template.js";
7
7
  import type { ElementView } from "../templating/view.js";
8
8
  import { FASTElementDefinition, type ShadowRootOptions } from "./fast-definitions.js";
9
- /**
10
- * @deprecated Use the export from ./hydration.js instead.
11
- */
12
- export { deferHydrationAttribute } from "./hydration.js";
13
9
  /**
14
10
  * A type that instantiates an ElementController
15
11
  * @public
@@ -35,7 +31,11 @@ export declare const enum Stages {
35
31
  * Controls the lifecycle and rendering of a `FASTElement`.
36
32
  * @public
37
33
  */
38
- export declare class ElementController<TElement extends HTMLElement = HTMLElement> extends PropertyChangeNotifier implements HostController<TElement> {
34
+ export declare class ElementController<TElement extends HTMLElement = HTMLElement> implements Notifier, HostController<TElement> {
35
+ /**
36
+ * Internal notifier used to delegate subscriber management.
37
+ */
38
+ private _notifier;
39
39
  /**
40
40
  * A map of observable properties that were set on the element before upgrade.
41
41
  */
@@ -48,6 +48,26 @@ export declare class ElementController<TElement extends HTMLElement = HTMLElemen
48
48
  * Indicates whether the element has an existing shadow root (e.g. from declarative shadow DOM).
49
49
  */
50
50
  protected hasExistingShadowRoot: boolean;
51
+ /**
52
+ * Resolves the isPrerendered promise.
53
+ */
54
+ private _resolvePrerendered;
55
+ /**
56
+ * Resolves the isHydrated promise.
57
+ */
58
+ private _resolveHydrated;
59
+ /**
60
+ * Resolves `true` when the element had an existing shadow root
61
+ * (from SSR or declarative shadow DOM) at connect time, `false`
62
+ * otherwise.
63
+ */
64
+ readonly isPrerendered: Promise<boolean>;
65
+ /**
66
+ * Resolves `true` after prerendered content has been successfully
67
+ * hydrated, or `false` when the component is client-side rendered
68
+ * or hydration is not enabled.
69
+ */
70
+ readonly isHydrated: Promise<boolean>;
51
71
  /**
52
72
  * The template used to render the component.
53
73
  */
@@ -147,6 +167,27 @@ export declare class ElementController<TElement extends HTMLElement = HTMLElemen
147
167
  * @internal
148
168
  */
149
169
  constructor(element: TElement, definition: FASTElementDefinition);
170
+ /**
171
+ * The subject that subscribers will receive notifications for.
172
+ */
173
+ get subject(): TElement;
174
+ /**
175
+ * Notifies all subscribers of a property change.
176
+ * @param args - The property name that changed.
177
+ */
178
+ notify(args: any): void;
179
+ /**
180
+ * Subscribes to notification of changes in the element's state.
181
+ * @param subscriber - The object that is subscribing for change notification.
182
+ * @param propertyToWatch - The name of the property to watch for changes.
183
+ */
184
+ subscribe(subscriber: Subscriber, propertyToWatch?: any): void;
185
+ /**
186
+ * Unsubscribes from notification of changes in the element's state.
187
+ * @param subscriber - The object that is unsubscribing from change notification.
188
+ * @param propertyToUnwatch - The name of the property to unsubscribe from.
189
+ */
190
+ unsubscribe(subscriber: Subscriber, propertyToUnwatch?: any): void;
150
191
  /**
151
192
  * Registers an unbind handler with the controller.
152
193
  * @param behavior - An object to call when the controller unbinds.
@@ -183,6 +224,22 @@ export declare class ElementController<TElement extends HTMLElement = HTMLElemen
183
224
  * Binds any observables that were set before upgrade.
184
225
  */
185
226
  protected bindObservables(): void;
227
+ /**
228
+ * Captures own-properties that shadow observable accessors on the prototype so
229
+ * they can be rebound through the accessor before rendering.
230
+ */
231
+ protected captureBoundObservables(): void;
232
+ /**
233
+ * Synchronizes late-defined attribute-map attributes from the live DOM to the
234
+ * associated property values before the initial render occurs.
235
+ */
236
+ protected syncLateAttributes(): void;
237
+ /**
238
+ * Observes late-defined attribute-map attributes that the platform does not
239
+ * surface through attributeChangedCallback because they were added after
240
+ * customElements.define() completed.
241
+ */
242
+ protected observeLateAttributes(): void;
186
243
  /**
187
244
  * Connects any existing behaviors on the associated element.
188
245
  */
@@ -219,6 +276,11 @@ export declare class ElementController<TElement extends HTMLElement = HTMLElemen
219
276
  * If `null` is provided, any existing view will be removed.
220
277
  */
221
278
  protected renderTemplate(template: ElementViewTemplate | null | undefined): void;
279
+ /**
280
+ * Standard client-side render: clears any stale content, clones the
281
+ * compiled fragment, binds, and appends to the host.
282
+ */
283
+ private renderClientSide;
222
284
  /**
223
285
  * Locates or creates a controller for the specified element.
224
286
  * @param element - The element to return the controller for.
@@ -235,6 +297,18 @@ export declare class ElementController<TElement extends HTMLElement = HTMLElemen
235
297
  * @param strategy - The strategy to use.
236
298
  */
237
299
  static setStrategy(strategy: ElementControllerStrategy): void;
300
+ /**
301
+ * A hook that, when set, handles prerendered content hydration.
302
+ * Called by renderTemplate when an existing shadow root is detected.
303
+ * Returns true if hydration was performed, false to fall back to client-side.
304
+ * @internal
305
+ */
306
+ private static hydrationHook;
307
+ /**
308
+ * Installs the hydration hook. Called by enableHydration().
309
+ * @internal
310
+ */
311
+ static installHydrationHook(hook: (controller: ElementController, template: ElementViewTemplate, element: HTMLElement, host: Node) => boolean): void;
238
312
  }
239
313
  /**
240
314
  * https://wicg.github.io/construct-stylesheets/
@@ -260,111 +334,3 @@ export declare class StyleElementStrategy implements StyleStrategy {
260
334
  addStylesTo(target: StyleTarget): void;
261
335
  removeStylesFrom(target: StyleTarget): void;
262
336
  }
263
- /**
264
- * The attribute used to indicate that an element needs hydration.
265
- * @public
266
- */
267
- export declare const needsHydrationAttribute = "needs-hydration";
268
- /**
269
- * Lifecycle callbacks for element hydration events
270
- * @public
271
- */
272
- export interface HydrationControllerCallbacks<TElement extends HTMLElement = HTMLElement> {
273
- /**
274
- * Called once when the first element enters the hydration pipeline.
275
- * This is the earliest point at which we know a component has been
276
- * async-defined with `defer-and-hydrate`, a template is pending via
277
- * `<f-template>`, and the element has `needs-hydration`.
278
- */
279
- hydrationStarted?(): void;
280
- /**
281
- * Called before an individual element's hydration begins
282
- */
283
- elementWillHydrate?(source: TElement): void;
284
- /**
285
- * Called after an individual element's hydration has finished
286
- */
287
- elementDidHydrate?(source: TElement): void;
288
- /**
289
- * Called after all elements have completed hydration
290
- */
291
- hydrationComplete?(): void;
292
- }
293
- /**
294
- * An ElementController capable of hydrating FAST elements from
295
- * Declarative Shadow DOM.
296
- *
297
- * @beta
298
- */
299
- export declare class HydratableElementController<TElement extends HTMLElement = HTMLElement> extends ElementController<TElement> {
300
- /**
301
- * Controls whether the controller will hydrate during the connect() method.
302
- * Initialized during the first connect() call to true when the `needs-hydration`
303
- * attribute is present on the element.
304
- */
305
- protected needsHydration?: boolean;
306
- private static hydrationObserver;
307
- /**
308
- * {@inheritdoc ElementController.shadowOptions}
309
- */
310
- get shadowOptions(): ShadowRootOptions | undefined;
311
- set shadowOptions(value: ShadowRootOptions | undefined);
312
- /**
313
- * Lifecycle callbacks for hydration events
314
- */
315
- static lifecycleCallbacks: HydrationControllerCallbacks;
316
- /**
317
- * Whether the hydrationStarted callback has already been invoked.
318
- */
319
- private static hydrationStarted;
320
- /**
321
- * An idle callback ID used to track hydration completion
322
- */
323
- private static idleCallbackId;
324
- /**
325
- * Adds the current element instance to the hydrating instances map
326
- */
327
- private addHydratingInstance;
328
- /**
329
- * Configure lifecycle callbacks for hydration events
330
- */
331
- static config(callbacks: HydrationControllerCallbacks): typeof HydratableElementController;
332
- private static hydrationObserverHandler;
333
- /**
334
- * Checks to see if hydration is complete and if so, invokes the hydrationComplete callback.
335
- * Then resets the ElementController strategy to the default so that future elements
336
- * don't use the HydratableElementController.
337
- *
338
- * @param deadline - the idle deadline object
339
- */
340
- private static checkHydrationComplete;
341
- /**
342
- * Runs connected lifecycle behavior on the associated element.
343
- */
344
- connect(): void;
345
- /**
346
- * A map of element instances by the name of the custom element they are
347
- * associated with. The key is the custom element name, and the value is the
348
- * instances of hydratable elements which currently need to be hydrated.
349
- *
350
- * When all of the instances in the set have been hydrated, the set is
351
- * cleared and removed from the map. If the map is empty, the
352
- * hydrationComplete callback is invoked.
353
- */
354
- private static hydratingInstances?;
355
- /**
356
- * Removes the current element instance from the hydrating instances map
357
- */
358
- private removeHydratingInstance;
359
- /**
360
- * Unregisters the hydration observer when the element is disconnected.
361
- */
362
- disconnect(): void;
363
- /**
364
- * Sets the ElementController strategy to HydratableElementController.
365
- * @remarks
366
- * This method is typically called during application startup to enable
367
- * hydration support for FAST elements.
368
- */
369
- static install(): void;
370
- }
@@ -1,2 +1,2 @@
1
- export { HydratableElementController } from "./element-controller.js";
1
+ export { ElementController } from "./element-controller.js";
2
2
  export * from "./hydration.js";
@@ -0,0 +1,34 @@
1
+ import { type HydrationOptions } from "./hydration-tracker.js";
2
+ export type { HydrationOptions };
3
+ /**
4
+ * Enables hydration support for prerendered FAST elements.
5
+ *
6
+ * @remarks
7
+ * Call this before any FAST elements connect to the DOM. Hydration
8
+ * logic is not active unless this function is called, keeping
9
+ * `FASTElement` lightweight for client-side-only applications.
10
+ *
11
+ * Safe to call multiple times — the hydration hook is installed once
12
+ * and subsequent calls merge their options into the shared tracker.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * import { enableHydration } from "@microsoft/fast-element/hydration.js";
17
+ *
18
+ * enableHydration({
19
+ * hydrationComplete() {
20
+ * console.log("hydration complete");
21
+ * },
22
+ * });
23
+ * ```
24
+ *
25
+ * @param options - Optional callbacks for global hydration events.
26
+ * @public
27
+ */
28
+ export declare function enableHydration(options?: HydrationOptions): void;
29
+ /**
30
+ * The attribute used to defer hydration of an element.
31
+ * Retained for intersection observer viewport hydration rendering.
32
+ * @beta
33
+ */
34
+ export declare const deferHydrationAttribute = "defer-hydration";
@@ -2,7 +2,8 @@ import { type Constructable } from "../interfaces.js";
2
2
  import { type TypeRegistry } from "../platform.js";
3
3
  import { type ComposableStyles, ElementStyles } from "../styles/element-styles.js";
4
4
  import type { ElementViewTemplate } from "../templating/template.js";
5
- import { AttributeConfiguration, AttributeDefinition } from "./attributes.js";
5
+ import { type AttributeConfiguration, AttributeDefinition } from "./attributes.js";
6
+ import type { Schema } from "./schema.js";
6
7
  /**
7
8
  * The FAST custom element registry
8
9
  * @internal
@@ -21,50 +22,99 @@ export interface ShadowRootOptions extends ShadowRootInit {
21
22
  */
22
23
  registry?: CustomElementRegistry;
23
24
  }
24
- /**
25
- * Values for the `templateOptions` property.
26
- * @alpha
27
- */
28
- export declare const TemplateOptions: {
29
- readonly deferAndHydrate: "defer-and-hydrate";
30
- };
31
- /**
32
- * Type for the `TemplateOptions` const enum.
33
- * @alpha
34
- */
35
- export type TemplateOptions = (typeof TemplateOptions)[keyof typeof TemplateOptions];
36
25
  /**
37
26
  * Lifecycle callbacks for template events.
38
27
  * @public
39
28
  */
40
29
  export interface TemplateLifecycleCallbacks {
41
30
  /**
42
- * Called after the template has been assigned to the definition
31
+ * Called after the JS class definition has been registered.
32
+ */
33
+ elementDidRegister?(name: string): void;
34
+ /**
35
+ * Called before the template has been evaluated and assigned.
36
+ */
37
+ templateWillUpdate?(name: string): void;
38
+ /**
39
+ * Called after the template has been assigned to the definition.
43
40
  */
44
41
  templateDidUpdate?(name: string): void;
45
42
  /**
46
- * Called after the custom element has been defined
43
+ * Called after the custom element has been defined.
47
44
  */
48
45
  elementDidDefine?(name: string): void;
46
+ /**
47
+ * Called before an individual element's hydration begins.
48
+ */
49
+ elementWillHydrate?(source: HTMLElement): void;
50
+ /**
51
+ * Called after an individual element's hydration has finished.
52
+ */
53
+ elementDidHydrate?(source: HTMLElement): void;
49
54
  }
55
+ /**
56
+ * A callback that receives a FASTElementDefinition during element registration.
57
+ * Extensions are invoked before the element is registered with the platform,
58
+ * allowing plugins to inspect or act on the resolved definition.
59
+ * @public
60
+ */
61
+ export type FASTElementExtension = (definition: FASTElementDefinition) => void;
62
+ /**
63
+ * Resolves an element template from a composed definition.
64
+ * @public
65
+ */
66
+ export type FASTElementTemplateResolver<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> = (definition: FASTElementDefinition<TType>) => ElementViewTemplate<InstanceType<TType>> | Promise<ElementViewTemplate<InstanceType<TType>>>;
67
+ /**
68
+ * Applies extension callbacks to a FAST element definition.
69
+ * @internal
70
+ */
71
+ export declare function applyFASTElementExtensions(definition: FASTElementDefinition, registry?: CustomElementRegistry, extensions?: FASTElementExtension[]): void;
72
+ /**
73
+ * Tracks attribute definitions that were added after the element was already
74
+ * registered with the platform and therefore are not covered by the browser's
75
+ * static observedAttributes snapshot.
76
+ * @internal
77
+ */
78
+ export declare function trackLateAttributeDefinition(definition: FASTElementDefinition, attribute: AttributeDefinition): void;
79
+ /**
80
+ * Gets the attribute definitions that were added after platform registration.
81
+ * @internal
82
+ */
83
+ export declare function getLateAttributeLookup(definition: FASTElementDefinition): Readonly<Record<string, AttributeDefinition>> | null;
84
+ /**
85
+ * Resolves the concrete template for a FAST element definition when the
86
+ * definition was composed with a template resolver.
87
+ * @internal
88
+ */
89
+ export declare function resolveFASTElementTemplate<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(definition: FASTElementDefinition<TType>): ElementViewTemplate<InstanceType<TType>> | Promise<ElementViewTemplate<InstanceType<TType>> | undefined> | undefined;
90
+ /**
91
+ * Indicates whether a definition still has a pending template resolver.
92
+ * @internal
93
+ */
94
+ export declare function hasFASTElementTemplateResolver<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(definition: FASTElementDefinition<TType>): boolean;
95
+ /**
96
+ * Gets any pending template resolution error for a FAST element definition.
97
+ * @internal
98
+ */
99
+ export declare function getFASTElementTemplateError<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(definition: FASTElementDefinition<TType>): unknown;
100
+ /**
101
+ * Sets or clears the template resolution error for a FAST element definition.
102
+ * @internal
103
+ */
104
+ export declare function setFASTElementTemplateError<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(definition: FASTElementDefinition<TType>, error?: unknown): void;
50
105
  /**
51
106
  * Represents metadata configuration for a custom element.
52
107
  * @public
53
108
  */
54
- export interface PartialFASTElementDefinition {
109
+ export interface PartialFASTElementDefinition<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>> {
55
110
  /**
56
111
  * The name of the custom element.
57
112
  */
58
113
  readonly name: string;
59
114
  /**
60
- * The template to render for the custom element.
61
- */
62
- readonly template?: ElementViewTemplate;
63
- /**
64
- * Options controlling how the template will be created.
65
- * @alpha
115
+ * The template, or template resolver, for the custom element.
66
116
  */
67
- readonly templateOptions?: TemplateOptions;
117
+ readonly template?: ElementViewTemplate<InstanceType<TType>> | FASTElementTemplateResolver<TType>;
68
118
  /**
69
119
  * The styles to associate with the custom element.
70
120
  */
@@ -94,6 +144,12 @@ export interface PartialFASTElementDefinition {
94
144
  * Lifecycle callbacks for template events.
95
145
  */
96
146
  readonly lifecycleCallbacks?: TemplateLifecycleCallbacks;
147
+ /**
148
+ * The optional schema associated with the custom element definition.
149
+ * Declarative templates assign this automatically during template resolution.
150
+ * Non-declarative callers can provide one for schema-driven extensions.
151
+ */
152
+ readonly schema?: Schema;
97
153
  }
98
154
  /**
99
155
  * Defines metadata for a FASTElement.
@@ -128,12 +184,7 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
128
184
  /**
129
185
  * The template to render for the custom element.
130
186
  */
131
- template?: ElementViewTemplate;
132
- /**
133
- * The template options.
134
- * @alpha
135
- */
136
- templateOptions?: TemplateOptions;
187
+ template?: ElementViewTemplate<InstanceType<TType>>;
137
188
  /**
138
189
  * The styles to associate with the custom element.
139
190
  */
@@ -154,6 +205,12 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
154
205
  * Lifecycle callbacks for template events.
155
206
  */
156
207
  readonly lifecycleCallbacks?: TemplateLifecycleCallbacks;
208
+ /**
209
+ * The optional schema associated with the custom element definition.
210
+ * Declarative templates assign this automatically during template resolution.
211
+ * Non-declarative callers can provide one for schema-driven extensions.
212
+ */
213
+ schema?: Schema;
157
214
  /**
158
215
  * The definition has been registered to the FAST element registry.
159
216
  */
@@ -162,17 +219,19 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
162
219
  /**
163
220
  * Defines a custom element based on this definition.
164
221
  * @param registry - The element registry to define the element in.
222
+ * @param extensions - An optional array of extension callbacks to invoke
223
+ * with this definition before platform registration.
165
224
  * @remarks
166
225
  * This operation is idempotent per registry.
167
226
  */
168
- define(registry?: CustomElementRegistry): this;
227
+ define(registry?: CustomElementRegistry, extensions?: FASTElementExtension[]): this;
169
228
  /**
170
229
  * Creates an instance of FASTElementDefinition.
171
230
  * @param type - The type this definition is being created for.
172
231
  * @param nameOrDef - The name of the element to define or a config object
173
232
  * that describes the element to define.
174
233
  */
175
- static compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
234
+ static compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition<TType>): Promise<FASTElementDefinition<TType>>;
176
235
  /**
177
236
  * Registers a FASTElement base type.
178
237
  * @param type - The type to register as a base type.
@@ -194,15 +253,5 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
194
253
  * @param name - The name of the defined custom element.
195
254
  * @alpha
196
255
  */
197
- static registerAsync: (name: string) => Promise<Function>;
198
- /**
199
- * Creates an instance of FASTElementDefinition asynchronously. This option assumes
200
- * that a template and shadowOptions will be provided and completes when those requirements
201
- * are met.
202
- * @param type - The type this definition is being created for.
203
- * @param nameOrDef - The name of the element to define or a config object
204
- * that describes the element to define.
205
- * @alpha
206
- */
207
- static composeAsync<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): Promise<FASTElementDefinition<TType>>;
256
+ static register: (name: string, registry?: CustomElementRegistry) => Promise<Function>;
208
257
  }
@@ -1,6 +1,6 @@
1
1
  import { type Constructable } from "../interfaces.js";
2
2
  import { ElementController } from "./element-controller.js";
3
- import { FASTElementDefinition, type PartialFASTElementDefinition } from "./fast-definitions.js";
3
+ import { FASTElementDefinition, type FASTElementExtension, type PartialFASTElementDefinition } from "./fast-definitions.js";
4
4
  /**
5
5
  * Represents a custom element based on the FASTElement infrastructure.
6
6
  * @public
@@ -45,12 +45,10 @@ export interface FASTElement extends HTMLElement {
45
45
  */
46
46
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
47
47
  }
48
- declare function compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
49
- declare function compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): FASTElementDefinition<TType>;
50
- declare function defineAsync<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition): Promise<FASTElementDefinition<TType>>;
51
- declare function defineAsync<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): Promise<FASTElementDefinition<TType>>;
52
- declare function define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition): TType;
53
- declare function define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition): TType;
48
+ declare function compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition<TType>): Promise<FASTElementDefinition<TType>>;
49
+ declare function compose<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition<TType>): Promise<FASTElementDefinition<TType>>;
50
+ declare function define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(this: TType, nameOrDef: string | PartialFASTElementDefinition<TType>, extensions?: FASTElementExtension[]): Promise<TType>;
51
+ declare function define<TType extends Constructable<HTMLElement> = Constructable<HTMLElement>>(type: TType, nameOrDef?: string | PartialFASTElementDefinition<TType>, extensions?: FASTElementExtension[]): Promise<TType>;
54
52
  declare function from<TBase extends typeof HTMLElement>(BaseType: TBase): new () => InstanceType<TBase> & FASTElement;
55
53
  /**
56
54
  * A minimal base class for FASTElements that also provides
@@ -61,7 +59,6 @@ export declare const FASTElement: {
61
59
  new (): FASTElement;
62
60
  define: typeof define;
63
61
  compose: typeof compose;
64
- defineAsync: typeof defineAsync;
65
62
  from: typeof from;
66
63
  };
67
64
  /**