@microsoft/fast-element 2.10.4 → 3.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (349) hide show
  1. package/ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md +1 -1
  2. package/ARCHITECTURE_OVERVIEW.md +2 -2
  3. package/CHANGELOG.json +1 -1
  4. package/CHANGELOG.md +2 -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 +138 -33
  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/declarative/declarative.api.json +7844 -0
  23. package/dist/di/di.api.json +1 -1
  24. package/dist/dts/array-observer.d.ts +2 -0
  25. package/dist/dts/arrays.d.ts +2 -0
  26. package/dist/dts/attr.d.ts +1 -0
  27. package/dist/dts/binding/signal.d.ts +6 -6
  28. package/dist/dts/binding/two-way.d.ts +1 -0
  29. package/dist/dts/binding.d.ts +7 -0
  30. package/dist/dts/components/attributes.d.ts +2 -5
  31. package/dist/dts/components/definition-schema-transforms.d.ts +9 -0
  32. package/dist/dts/components/element-controller.d.ts +80 -114
  33. package/dist/dts/components/element-hydration.d.ts +1 -1
  34. package/dist/dts/components/enable-hydration.d.ts +34 -0
  35. package/dist/dts/components/fast-definitions.d.ts +91 -42
  36. package/dist/dts/components/fast-element.d.ts +5 -8
  37. package/dist/dts/components/hydration-tracker.d.ts +40 -0
  38. package/dist/dts/components/hydration.d.ts +18 -53
  39. package/dist/dts/components/schema.d.ts +205 -0
  40. package/dist/dts/context.d.ts +6 -6
  41. package/dist/dts/css.d.ts +3 -0
  42. package/dist/dts/debug.d.ts +5 -1
  43. package/dist/dts/declarative/attribute-map.d.ts +58 -0
  44. package/dist/dts/declarative/debug.d.ts +5 -0
  45. package/dist/dts/declarative/index.d.ts +13 -0
  46. package/dist/dts/declarative/interfaces.d.ts +9 -0
  47. package/dist/dts/declarative/observer-map-utilities.d.ts +58 -0
  48. package/dist/dts/declarative/observer-map.d.ts +89 -0
  49. package/dist/dts/declarative/runtime.d.ts +5 -0
  50. package/dist/dts/declarative/syntax.d.ts +21 -0
  51. package/dist/dts/declarative/template-bridge.d.ts +33 -0
  52. package/dist/dts/declarative/template-parser.d.ts +98 -0
  53. package/dist/dts/declarative/template.d.ts +9 -0
  54. package/dist/dts/declarative/utilities.d.ts +312 -0
  55. package/dist/dts/di/di.d.ts +1 -1
  56. package/dist/dts/directives/children.d.ts +2 -0
  57. package/dist/dts/directives/node-observation.d.ts +2 -0
  58. package/dist/dts/directives/ref.d.ts +2 -0
  59. package/dist/dts/directives/repeat.d.ts +4 -0
  60. package/dist/dts/directives/slotted.d.ts +2 -0
  61. package/dist/dts/directives/when.d.ts +3 -0
  62. package/dist/dts/dom-policy.d.ts +1 -1
  63. package/dist/dts/html.d.ts +5 -0
  64. package/dist/dts/hydration/runtime.d.ts +7 -0
  65. package/dist/dts/hydration/target-builder.d.ts +15 -12
  66. package/dist/dts/hydration.d.ts +14 -0
  67. package/dist/dts/index.d.ts +38 -42
  68. package/dist/dts/index.debug.d.ts +0 -1
  69. package/dist/dts/index.rollup.debug.d.ts +0 -1
  70. package/dist/dts/interfaces.d.ts +1 -49
  71. package/dist/dts/observable.d.ts +3 -6
  72. package/dist/dts/observation/arrays.d.ts +1 -1
  73. package/dist/dts/observation/update-queue.d.ts +1 -1
  74. package/dist/dts/platform.d.ts +25 -4
  75. package/dist/dts/render.d.ts +7 -0
  76. package/dist/dts/schema.d.ts +1 -0
  77. package/dist/dts/state/exports.d.ts +1 -1
  78. package/dist/dts/state/state.d.ts +2 -2
  79. package/dist/dts/styles/css-directive.d.ts +5 -12
  80. package/dist/dts/styles/css.d.ts +5 -7
  81. package/dist/dts/styles/element-styles.d.ts +0 -10
  82. package/dist/dts/styles.d.ts +6 -0
  83. package/dist/dts/templating/children.d.ts +1 -1
  84. package/dist/dts/templating/html-binding-directive.d.ts +4 -0
  85. package/dist/dts/templating/html-directive.d.ts +17 -0
  86. package/dist/dts/templating/hydration-view.d.ts +109 -0
  87. package/dist/dts/templating/ref.d.ts +1 -1
  88. package/dist/dts/templating/render.d.ts +1 -1
  89. package/dist/dts/templating/repeat.d.ts +2 -2
  90. package/dist/dts/templating/slotted.d.ts +1 -1
  91. package/dist/dts/templating/template.d.ts +17 -9
  92. package/dist/dts/templating/view.d.ts +25 -102
  93. package/dist/dts/templating/when.d.ts +1 -1
  94. package/dist/dts/templating.d.ts +10 -0
  95. package/dist/dts/testing/exports.d.ts +2 -2
  96. package/dist/dts/updates.d.ts +1 -0
  97. package/dist/dts/volatile.d.ts +2 -0
  98. package/dist/esm/array-observer.js +1 -0
  99. package/dist/esm/arrays.js +1 -0
  100. package/dist/esm/attr.js +1 -0
  101. package/dist/esm/binding/normalize.js +1 -1
  102. package/dist/esm/binding/signal.js +4 -4
  103. package/dist/esm/binding/two-way.js +2 -1
  104. package/dist/esm/binding.js +4 -0
  105. package/dist/esm/components/attributes.js +8 -5
  106. package/dist/esm/components/definition-schema-transforms.js +23 -0
  107. package/dist/esm/components/element-controller.js +200 -269
  108. package/dist/esm/components/element-hydration.js +1 -1
  109. package/dist/esm/components/enable-hydration.js +100 -0
  110. package/dist/esm/components/fast-definitions.js +211 -49
  111. package/dist/esm/components/fast-element.js +18 -27
  112. package/dist/esm/components/hydration-tracker.js +93 -0
  113. package/dist/esm/components/hydration.js +62 -144
  114. package/dist/esm/components/schema.js +253 -0
  115. package/dist/esm/context.js +6 -6
  116. package/dist/esm/css.js +3 -0
  117. package/dist/esm/debug.js +26 -26
  118. package/dist/esm/declarative/attribute-map.js +121 -0
  119. package/dist/esm/declarative/debug.js +5 -0
  120. package/dist/esm/declarative/index.js +3 -0
  121. package/dist/esm/declarative/interfaces.js +10 -0
  122. package/dist/esm/declarative/observer-map-utilities.js +562 -0
  123. package/dist/esm/declarative/observer-map.js +216 -0
  124. package/dist/esm/declarative/runtime.js +14 -0
  125. package/dist/esm/declarative/syntax.js +36 -0
  126. package/dist/esm/declarative/template-bridge.js +170 -0
  127. package/dist/esm/declarative/template-parser.js +306 -0
  128. package/dist/esm/declarative/template.js +142 -0
  129. package/dist/esm/declarative/utilities.js +834 -0
  130. package/dist/esm/di/di.js +6 -8
  131. package/dist/esm/directives/children.js +1 -0
  132. package/dist/esm/directives/node-observation.js +1 -0
  133. package/dist/esm/directives/ref.js +1 -0
  134. package/dist/esm/directives/repeat.js +1 -0
  135. package/dist/esm/directives/slotted.js +1 -0
  136. package/dist/esm/directives/when.js +1 -0
  137. package/dist/esm/dom-policy.js +2 -2
  138. package/dist/esm/dom.js +1 -1
  139. package/dist/esm/html.js +2 -0
  140. package/dist/esm/hydration/runtime.js +33 -0
  141. package/dist/esm/hydration/target-builder.js +97 -90
  142. package/dist/esm/hydration.js +4 -0
  143. package/dist/esm/index.debug.js +2 -1
  144. package/dist/esm/index.js +34 -29
  145. package/dist/esm/index.rollup.debug.js +3 -2
  146. package/dist/esm/index.rollup.js +1 -1
  147. package/dist/esm/interfaces.js +1 -45
  148. package/dist/esm/observable.js +1 -4
  149. package/dist/esm/observation/arrays.js +1 -1
  150. package/dist/esm/observation/observable.js +5 -5
  151. package/dist/esm/observation/update-queue.js +47 -58
  152. package/dist/esm/platform.js +31 -30
  153. package/dist/esm/render.js +1 -0
  154. package/dist/esm/schema.js +1 -0
  155. package/dist/esm/state/exports.js +1 -1
  156. package/dist/esm/styles/css-directive.js +1 -2
  157. package/dist/esm/styles/css.js +15 -56
  158. package/dist/esm/styles/element-styles.js +69 -15
  159. package/dist/esm/styles.js +2 -0
  160. package/dist/esm/templating/html-binding-directive.js +10 -8
  161. package/dist/esm/templating/hydration-view.js +235 -0
  162. package/dist/esm/templating/render.js +1 -1
  163. package/dist/esm/templating/repeat.js +36 -34
  164. package/dist/esm/templating/template.js +7 -7
  165. package/dist/esm/templating/view.js +24 -233
  166. package/dist/esm/templating.js +7 -0
  167. package/dist/esm/testing/exports.js +2 -2
  168. package/dist/esm/updates.js +1 -0
  169. package/dist/esm/volatile.js +1 -0
  170. package/dist/fast-element.api.json +9016 -6995
  171. package/dist/fast-element.d.ts +3557 -796
  172. package/dist/fast-element.debug.js +5088 -4437
  173. package/dist/fast-element.debug.min.js +2 -2
  174. package/dist/fast-element.js +5369 -4649
  175. package/dist/fast-element.min.js +2 -2
  176. package/dist/fast-element.untrimmed.d.ts +863 -475
  177. package/dist/hydration/hydration.api.json +5237 -0
  178. package/dist/styles/styles.api.json +2672 -0
  179. package/docs/api-report.api.md +343 -166
  180. package/docs/arrays/api-report.api.md +114 -0
  181. package/docs/declarative/api-report.api.md +397 -0
  182. package/docs/hydration/api-report.api.md +285 -0
  183. package/docs/styles/api-report.api.md +135 -0
  184. package/package.json +149 -41
  185. package/playwright.declarative.config.ts +26 -0
  186. package/playwright.declarative.webui.config.ts +20 -0
  187. package/scripts/declarative/build-fixtures-with-webui.js +135 -0
  188. package/scripts/declarative/build-fixtures.js +49 -0
  189. package/scripts/declarative/build-fixtures.utilities.js +101 -0
  190. package/scripts/measure-sizes.js +219 -0
  191. package/scripts/run-api-extractor.js +39 -20
  192. package/test/declarative/fixtures/README.md +72 -0
  193. package/test/declarative/fixtures/WRITING_FIXTURES.md +330 -0
  194. package/test/declarative/fixtures/bindings/README.md +12 -0
  195. package/test/declarative/fixtures/bindings/attribute/entry.html +13 -0
  196. package/test/declarative/fixtures/bindings/attribute/fast-build.config.json +6 -0
  197. package/test/declarative/fixtures/bindings/attribute/index.html +25 -0
  198. package/test/declarative/fixtures/bindings/attribute/main.ts +41 -0
  199. package/test/declarative/fixtures/bindings/attribute/state.json +8 -0
  200. package/test/declarative/fixtures/bindings/attribute/templates.html +11 -0
  201. package/test/declarative/fixtures/bindings/content/entry.html +12 -0
  202. package/test/declarative/fixtures/bindings/content/fast-build.config.json +6 -0
  203. package/test/declarative/fixtures/bindings/content/index.html +19 -0
  204. package/test/declarative/fixtures/bindings/content/main.ts +27 -0
  205. package/test/declarative/fixtures/bindings/content/state.json +4 -0
  206. package/test/declarative/fixtures/bindings/content/templates.html +6 -0
  207. package/test/declarative/fixtures/bindings/dot-syntax/entry.html +11 -0
  208. package/test/declarative/fixtures/bindings/dot-syntax/fast-build.config.json +6 -0
  209. package/test/declarative/fixtures/bindings/dot-syntax/index.html +47 -0
  210. package/test/declarative/fixtures/bindings/dot-syntax/main.ts +59 -0
  211. package/test/declarative/fixtures/bindings/dot-syntax/state.json +16 -0
  212. package/test/declarative/fixtures/bindings/dot-syntax/templates.html +17 -0
  213. package/test/declarative/fixtures/bindings/event/entry.html +11 -0
  214. package/test/declarative/fixtures/bindings/event/fast-build.config.json +6 -0
  215. package/test/declarative/fixtures/bindings/event/index.html +43 -0
  216. package/test/declarative/fixtures/bindings/event/main.ts +43 -0
  217. package/test/declarative/fixtures/bindings/event/state.json +3 -0
  218. package/test/declarative/fixtures/bindings/event/templates.html +18 -0
  219. package/test/declarative/fixtures/bindings/host/entry.html +40 -0
  220. package/test/declarative/fixtures/bindings/host/fast-build.config.json +6 -0
  221. package/test/declarative/fixtures/bindings/host/index.html +96 -0
  222. package/test/declarative/fixtures/bindings/host/main.ts +222 -0
  223. package/test/declarative/fixtures/bindings/host/state.json +9 -0
  224. package/test/declarative/fixtures/bindings/host/templates.html +55 -0
  225. package/test/declarative/fixtures/directives/README.md +12 -0
  226. package/test/declarative/fixtures/directives/children/entry.html +11 -0
  227. package/test/declarative/fixtures/directives/children/fast-build.config.json +6 -0
  228. package/test/declarative/fixtures/directives/children/index.html +15 -0
  229. package/test/declarative/fixtures/directives/children/main.ts +22 -0
  230. package/test/declarative/fixtures/directives/children/state.json +3 -0
  231. package/test/declarative/fixtures/directives/children/templates.html +3 -0
  232. package/test/declarative/fixtures/directives/ref/entry.html +11 -0
  233. package/test/declarative/fixtures/directives/ref/fast-build.config.json +6 -0
  234. package/test/declarative/fixtures/directives/ref/index.html +15 -0
  235. package/test/declarative/fixtures/directives/ref/main.ts +17 -0
  236. package/test/declarative/fixtures/directives/ref/state.json +1 -0
  237. package/test/declarative/fixtures/directives/ref/templates.html +3 -0
  238. package/test/declarative/fixtures/directives/repeat/entry.html +21 -0
  239. package/test/declarative/fixtures/directives/repeat/fast-build.config.json +6 -0
  240. package/test/declarative/fixtures/directives/repeat/index.html +133 -0
  241. package/test/declarative/fixtures/directives/repeat/main.ts +110 -0
  242. package/test/declarative/fixtures/directives/repeat/sprites.svg +8 -0
  243. package/test/declarative/fixtures/directives/repeat/state.json +10 -0
  244. package/test/declarative/fixtures/directives/repeat/templates.html +75 -0
  245. package/test/declarative/fixtures/directives/slotted/entry.html +17 -0
  246. package/test/declarative/fixtures/directives/slotted/fast-build.config.json +6 -0
  247. package/test/declarative/fixtures/directives/slotted/index.html +27 -0
  248. package/test/declarative/fixtures/directives/slotted/main.ts +29 -0
  249. package/test/declarative/fixtures/directives/slotted/state.json +1 -0
  250. package/test/declarative/fixtures/directives/slotted/templates.html +7 -0
  251. package/test/declarative/fixtures/directives/when/entry.html +51 -0
  252. package/test/declarative/fixtures/directives/when/fast-build.config.json +6 -0
  253. package/test/declarative/fixtures/directives/when/index.html +136 -0
  254. package/test/declarative/fixtures/directives/when/main.ts +172 -0
  255. package/test/declarative/fixtures/directives/when/state.json +12 -0
  256. package/test/declarative/fixtures/directives/when/templates.html +75 -0
  257. package/test/declarative/fixtures/ecosystem/README.md +11 -0
  258. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/entry.html +12 -0
  259. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/fast-build.config.json +6 -0
  260. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/index.html +20 -0
  261. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/main.ts +68 -0
  262. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/state.json +4 -0
  263. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/templates.html +7 -0
  264. package/test/declarative/fixtures/ecosystem/errors/entry.html +12 -0
  265. package/test/declarative/fixtures/ecosystem/errors/fast-build.config.json +6 -0
  266. package/test/declarative/fixtures/ecosystem/errors/index.html +20 -0
  267. package/test/declarative/fixtures/ecosystem/errors/main.ts +17 -0
  268. package/test/declarative/fixtures/ecosystem/errors/state.json +1 -0
  269. package/test/declarative/fixtures/ecosystem/errors/templates.html +7 -0
  270. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/entry.html +17 -0
  271. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/fast-build.config.json +6 -0
  272. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/index.html +56 -0
  273. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/main.ts +134 -0
  274. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/state.json +12 -0
  275. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/templates.html +34 -0
  276. package/test/declarative/fixtures/ecosystem/performance-metrics/entry.html +25 -0
  277. package/test/declarative/fixtures/ecosystem/performance-metrics/fast-build.config.json +6 -0
  278. package/test/declarative/fixtures/ecosystem/performance-metrics/fast-card.css +10 -0
  279. package/test/declarative/fixtures/ecosystem/performance-metrics/index.html +181 -0
  280. package/test/declarative/fixtures/ecosystem/performance-metrics/main.ts +58 -0
  281. package/test/declarative/fixtures/ecosystem/performance-metrics/state.json +6 -0
  282. package/test/declarative/fixtures/ecosystem/performance-metrics/templates.html +15 -0
  283. package/test/declarative/fixtures/extensions/README.md +15 -0
  284. package/test/declarative/fixtures/extensions/attribute-map/entry.html +14 -0
  285. package/test/declarative/fixtures/extensions/attribute-map/fast-build.config.json +6 -0
  286. package/test/declarative/fixtures/extensions/attribute-map/index.html +31 -0
  287. package/test/declarative/fixtures/extensions/attribute-map/main.ts +40 -0
  288. package/test/declarative/fixtures/extensions/attribute-map/state.json +4 -0
  289. package/test/declarative/fixtures/extensions/attribute-map/templates.html +14 -0
  290. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/entry.html +12 -0
  291. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/fast-build.config.json +7 -0
  292. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/index.html +25 -0
  293. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/main.ts +31 -0
  294. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/state.json +5 -0
  295. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/templates.html +11 -0
  296. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/entry.html +13 -0
  297. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/fast-build.config.json +7 -0
  298. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/index.html +23 -0
  299. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/main.ts +37 -0
  300. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/state.json +1 -0
  301. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/templates.html +9 -0
  302. package/test/declarative/fixtures/extensions/observer-map/entry.html +15 -0
  303. package/test/declarative/fixtures/extensions/observer-map/fast-build.config.json +6 -0
  304. package/test/declarative/fixtures/extensions/observer-map/index.html +442 -0
  305. package/test/declarative/fixtures/extensions/observer-map/main.ts +482 -0
  306. package/test/declarative/fixtures/extensions/observer-map/state.json +158 -0
  307. package/test/declarative/fixtures/extensions/observer-map/templates.html +172 -0
  308. package/test/declarative/fixtures/extensions/observer-map-config-object/entry.html +16 -0
  309. package/test/declarative/fixtures/extensions/observer-map-config-object/fast-build.config.json +6 -0
  310. package/test/declarative/fixtures/extensions/observer-map-config-object/index.html +27 -0
  311. package/test/declarative/fixtures/extensions/observer-map-config-object/main.ts +53 -0
  312. package/test/declarative/fixtures/extensions/observer-map-config-object/state.json +9 -0
  313. package/test/declarative/fixtures/extensions/observer-map-config-object/templates.html +12 -0
  314. package/test/declarative/fixtures/extensions/observer-map-deep-merge/README.md +98 -0
  315. package/test/declarative/fixtures/extensions/observer-map-deep-merge/entry.html +156 -0
  316. package/test/declarative/fixtures/extensions/observer-map-deep-merge/fast-build.config.json +6 -0
  317. package/test/declarative/fixtures/extensions/observer-map-deep-merge/index.html +376 -0
  318. package/test/declarative/fixtures/extensions/observer-map-deep-merge/main.ts +366 -0
  319. package/test/declarative/fixtures/extensions/observer-map-deep-merge/state.json +69 -0
  320. package/test/declarative/fixtures/extensions/observer-map-deep-merge/templates.html +91 -0
  321. package/test/declarative/fixtures/extensions/observer-map-properties/entry.html +14 -0
  322. package/test/declarative/fixtures/extensions/observer-map-properties/fast-build.config.json +6 -0
  323. package/test/declarative/fixtures/extensions/observer-map-properties/index.html +110 -0
  324. package/test/declarative/fixtures/extensions/observer-map-properties/main.ts +175 -0
  325. package/test/declarative/fixtures/extensions/observer-map-properties/state.json +29 -0
  326. package/test/declarative/fixtures/extensions/observer-map-properties/templates.html +55 -0
  327. package/test/declarative/fixtures/scenarios/README.md +7 -0
  328. package/test/declarative/fixtures/scenarios/nested-elements/entry.html +16 -0
  329. package/test/declarative/fixtures/scenarios/nested-elements/fast-build.config.json +6 -0
  330. package/test/declarative/fixtures/scenarios/nested-elements/index.html +126 -0
  331. package/test/declarative/fixtures/scenarios/nested-elements/main.ts +214 -0
  332. package/test/declarative/fixtures/scenarios/nested-elements/state.json +10 -0
  333. package/test/declarative/fixtures/scenarios/nested-elements/templates.html +54 -0
  334. package/test/declarative/index.html +12 -0
  335. package/test/declarative/vite.config.ts +55 -0
  336. package/test/declarative-main.ts +6 -0
  337. package/test/extension-subpaths-main.ts +9 -0
  338. package/test/main.ts +38 -33
  339. package/test/pure-declarative-main.ts +1 -0
  340. package/dist/dts/components/install-hydration.d.ts +0 -1
  341. package/dist/dts/pending-task.d.ts +0 -32
  342. package/dist/dts/polyfills.d.ts +0 -0
  343. package/dist/dts/styles/css-binding-directive.d.ts +0 -60
  344. package/dist/dts/templating/install-hydratable-view-templates.d.ts +0 -1
  345. package/dist/esm/components/install-hydration.js +0 -3
  346. package/dist/esm/pending-task.js +0 -28
  347. package/dist/esm/polyfills.js +0 -60
  348. package/dist/esm/styles/css-binding-directive.js +0 -76
  349. package/dist/esm/templating/install-hydratable-view-templates.js +0 -23
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Options for configuring global hydration lifecycle events.
3
+ * @public
4
+ */
5
+ export interface HydrationOptions {
6
+ /** Called once when the first prerendered element begins hydrating. */
7
+ hydrationStarted?(): void;
8
+ /** Called after all prerendered elements have completed hydration. */
9
+ hydrationComplete?(): void;
10
+ }
11
+ /**
12
+ * Tracks prerendered elements through the hydration lifecycle and
13
+ * fires global callbacks at start and completion. Per-element callbacks
14
+ * (`elementWillHydrate`, `elementDidHydrate`) are handled through
15
+ * definition-level `TemplateLifecycleCallbacks`.
16
+ *
17
+ * @public
18
+ */
19
+ export declare class HydrationTracker {
20
+ private options;
21
+ private elements;
22
+ private started;
23
+ private checkTimer;
24
+ constructor(options: HydrationOptions);
25
+ /**
26
+ * Registers an element as pending hydration.
27
+ * Fires `hydrationStarted` on the first call.
28
+ */
29
+ add(element: HTMLElement): void;
30
+ /**
31
+ * Removes an element from the pending set and schedules
32
+ * a debounced completion check.
33
+ */
34
+ remove(element: HTMLElement): void;
35
+ /**
36
+ * Merges additional options into the tracker, chaining
37
+ * callbacks so both the original and new callbacks fire.
38
+ */
39
+ mergeOptions(incoming: HydrationOptions): void;
40
+ }
@@ -1,63 +1,33 @@
1
1
  import type { ContentTemplate, HydratableContentTemplate } from "../templating/html-binding-directive.js";
2
2
  import type { ViewController } from "../templating/html-directive.js";
3
+ import type { HydratableViewController } from "../templating/hydration-view.js";
3
4
  import type { ElementViewTemplate, HydratableElementViewTemplate, HydratableSyntheticViewTemplate, SyntheticViewTemplate } from "../templating/template.js";
4
- import type { HydrationView } from "../templating/view.js";
5
5
  /**
6
6
  * Markup utilities to aid in template hydration.
7
7
  * @internal
8
8
  */
9
9
  export declare const HydrationMarkup: Readonly<{
10
- attributeMarkerName: "data-fe-b";
11
- compactAttributeMarkerName: "data-fe-c";
12
- attributeBindingSeparator: " ";
13
- contentBindingStartMarker(index: number, uniqueId: string): string;
14
- contentBindingEndMarker(index: number, uniqueId: string): string;
15
- repeatStartMarker(index: number): string;
16
- repeatEndMarker(index: number): string;
17
- isContentBindingStartMarker(content: string): boolean;
18
- isContentBindingEndMarker(content: string): boolean;
19
- isRepeatViewStartMarker(content: string): boolean;
20
- isRepeatViewEndMarker(content: string): boolean;
10
+ attributeMarkerName: "data-fe";
11
+ contentBindingStartMarker(): string;
12
+ contentBindingEndMarker(): string;
13
+ repeatStartMarker(): string;
14
+ repeatEndMarker(): string;
15
+ elementBoundaryStartMarker(): string;
16
+ elementBoundaryEndMarker(): string;
17
+ isContentBindingStartMarker(data: string): boolean;
18
+ isContentBindingEndMarker(data: string): boolean;
19
+ isRepeatViewStartMarker(data: string): boolean;
20
+ isRepeatViewEndMarker(data: string): boolean;
21
21
  isElementBoundaryStartMarker(node: Node): boolean;
22
22
  isElementBoundaryEndMarker(node: Node): boolean;
23
23
  /**
24
- * Returns the indexes of the ViewBehaviorFactories affecting
25
- * attributes for the element, or null if no factories were found.
24
+ * Returns the count of attribute bindings on the element, or null
25
+ * if no attribute binding marker is present.
26
26
  *
27
- * This method parses the space-separated format: `data-fe-b="0 1 2"`.
27
+ * Parses the `data-fe="N"` attribute format where N is the count
28
+ * of attribute binding factories targeting this element.
28
29
  */
29
- parseAttributeBinding(node: Element): null | number[];
30
- /**
31
- * Returns the indexes of the ViewBehaviorFactories affecting
32
- * attributes for the element, or null if no factories were found.
33
- *
34
- * This method parses the enumerated format: `data-fe-b-0`, `data-fe-b-1`, `data-fe-b-2`.
35
- * This is an alternative format that uses separate attributes for each binding index.
36
- */
37
- parseEnumeratedAttributeBinding(node: Element): null | number[];
38
- /**
39
- * Returns the indexes of the ViewBehaviorFactories affecting
40
- * attributes for the element, or null if no factories were found.
41
- *
42
- * This method parses the compact format: `data-fe-c-{index}-{count}`.
43
- */
44
- parseCompactAttributeBinding(node: Element): null | number[];
45
- /**
46
- * Parses the ViewBehaviorFactory index from string data. Returns
47
- * the binding index or null if the index cannot be retrieved.
48
- */
49
- parseContentBindingStartMarker(content: string): null | [index: number, id: string];
50
- parseContentBindingEndMarker(content: string): null | [index: number, id: string];
51
- /**
52
- * Parses the index of a repeat directive from a content string.
53
- */
54
- parseRepeatStartMarker(content: string): null | number;
55
- parseRepeatEndMarker(content: string): null | number;
56
- /**
57
- * Parses element Id from element boundary markers
58
- */
59
- parseElementBoundaryStartMarker(content: string): null | string;
60
- parseElementBoundaryEndMarker(content: string): null | string;
30
+ parseAttributeBindingCount(node: Element): number | null;
61
31
  }>;
62
32
  /**
63
33
  * @internal
@@ -68,15 +38,10 @@ export declare const Hydratable: unique symbol;
68
38
  *
69
39
  * @beta
70
40
  */
71
- export declare function isHydratable(view: ViewController): view is HydrationView;
41
+ export declare function isHydratable(view: ViewController): view is HydratableViewController;
72
42
  /** @beta */
73
43
  export declare function isHydratable<TSource = any, TParent = any>(template: SyntheticViewTemplate<TSource, TParent>): template is HydratableSyntheticViewTemplate<TSource, TParent>;
74
44
  /** @beta */
75
45
  export declare function isHydratable<TSource = any, TParent = any>(template: ElementViewTemplate<TSource, TParent>): template is HydratableElementViewTemplate<TSource, TParent>;
76
46
  /** @beta */
77
47
  export declare function isHydratable(template: ContentTemplate): template is HydratableContentTemplate;
78
- /**
79
- * The attribute used to defer hydration of an element.
80
- * @beta
81
- */
82
- export declare const deferHydrationAttribute = "defer-hydration";
@@ -0,0 +1,205 @@
1
+ type FastContextMetaData = "$fast_context";
2
+ type FastContextsMetaData = "$fast_parent_contexts";
3
+ /**
4
+ * Describes a child custom element binding referenced by a schema path.
5
+ * @public
6
+ */
7
+ export interface ChildrenMap {
8
+ customElementName: string;
9
+ attributeName: string;
10
+ }
11
+ /**
12
+ * A reusable JSON schema definition.
13
+ * @public
14
+ */
15
+ export interface JSONSchemaDefinition extends JSONSchemaCommon {
16
+ $fast_context: string;
17
+ $fast_parent_contexts: Array<string>;
18
+ }
19
+ /**
20
+ * Common properties shared by schema nodes.
21
+ * @public
22
+ */
23
+ export interface JSONSchemaCommon {
24
+ type?: string;
25
+ properties?: any;
26
+ items?: any;
27
+ anyOf?: Array<any>;
28
+ $ref?: string;
29
+ /**
30
+ * Stamped by `applyConfigToSchema` when an `ObserverMapConfig` excludes
31
+ * this path. When `false`, the proxy system skips observation for this
32
+ * node and (if all descendants are also `false`) its subtree.
33
+ */
34
+ $observe?: boolean;
35
+ }
36
+ /**
37
+ * A JSON schema describing a root property.
38
+ * @public
39
+ */
40
+ export interface JSONSchema extends JSONSchemaCommon {
41
+ $schema: string;
42
+ $id: string;
43
+ $defs?: Record<string, JSONSchemaDefinition>;
44
+ }
45
+ /**
46
+ * Common metadata for paths cached while parsing a template.
47
+ * @public
48
+ */
49
+ export interface CachedPathCommon {
50
+ parentContext: string | null;
51
+ currentContext: string | null;
52
+ path: string;
53
+ }
54
+ /**
55
+ * A path discovered from an access expression.
56
+ * @public
57
+ */
58
+ export interface AccessCachedPath extends CachedPathCommon {
59
+ type: "access";
60
+ }
61
+ /**
62
+ * A path discovered from a default binding.
63
+ * @public
64
+ */
65
+ export interface DefaultCachedPath extends CachedPathCommon {
66
+ type: "default";
67
+ }
68
+ /**
69
+ * A path discovered from an event binding.
70
+ * @public
71
+ */
72
+ export interface EventCachedPath extends CachedPathCommon {
73
+ type: "event";
74
+ }
75
+ /**
76
+ * A path discovered from a repeat directive.
77
+ * @public
78
+ */
79
+ export interface RepeatCachedPath extends CachedPathCommon {
80
+ type: "repeat";
81
+ }
82
+ /**
83
+ * A path discovered while parsing a template.
84
+ * @public
85
+ */
86
+ export type CachedPath = DefaultCachedPath | RepeatCachedPath | AccessCachedPath | EventCachedPath;
87
+ /**
88
+ * A map from element names and root properties to JSON schemas.
89
+ * @public
90
+ */
91
+ export type CachedPathMap = Map<string, Map<string, JSONSchema>>;
92
+ /**
93
+ * Configuration for registering a path with a schema.
94
+ * @public
95
+ */
96
+ export interface RegisterPathConfig {
97
+ rootPropertyName: string;
98
+ pathConfig: CachedPath;
99
+ childrenMap: ChildrenMap | null;
100
+ }
101
+ export declare const fastContextMetaData: FastContextMetaData;
102
+ export declare const fastContextsMetaData: FastContextsMetaData;
103
+ export declare const defsPropertyName = "$defs";
104
+ export declare const refPropertyName = "$ref";
105
+ /**
106
+ * Module-level registry that maps custom element names to their schema maps.
107
+ * Used for cross-element `$ref` resolution (e.g. nested element schemas).
108
+ * Each Schema instance registers itself here on construction.
109
+ * @public
110
+ */
111
+ export declare const schemaRegistry: CachedPathMap;
112
+ /**
113
+ * A constructed JSON schema from a template
114
+ * @public
115
+ */
116
+ export declare class Schema {
117
+ /**
118
+ * The name of the custom element
119
+ */
120
+ private customElementName;
121
+ /**
122
+ * Instance-level JSON schema map describing each root property
123
+ */
124
+ private schemaMap;
125
+ constructor(name: string);
126
+ /**
127
+ * Add a path to a schema
128
+ * @param config - The path registration configuration.
129
+ */
130
+ addPath(config: RegisterPathConfig): void;
131
+ /**
132
+ * Gets the JSON schema for a property name
133
+ * @param rootPropertyName - the root property the JSON schema is mapped to
134
+ * @returns The JSON schema for the root property
135
+ */
136
+ getSchema(rootPropertyName: string): JSONSchema | null;
137
+ /**
138
+ * Gets root properties
139
+ * @returns IterableIterator<string>
140
+ */
141
+ getRootProperties(): IterableIterator<string>;
142
+ /**
143
+ * Get a path split into property names
144
+ * @param path - The dot syntax path, e.g. `a.b.c`.
145
+ * @returns An array of items in the path
146
+ */
147
+ private getSplitPath;
148
+ /**
149
+ * Gets the path to the $def
150
+ * @param context - The context name. For example, `item in items` creates the `item` context.
151
+ * @returns A string to use as a $ref
152
+ */
153
+ private getDefsPath;
154
+ /**
155
+ * Get the schema $id
156
+ * @param customElementName - The custom element name
157
+ * @param propertyName - The property name
158
+ * @returns The ID that can be used in the JSON schema as $id
159
+ */
160
+ private getSchemaId;
161
+ /**
162
+ * Add a new JSON schema to the JSON schema map
163
+ * @param propertyName - The name of the property to assign this JSON schema to.
164
+ */
165
+ private addNewSchema;
166
+ /**
167
+ * Add properties to a context
168
+ * @param schema - The schema to add the properties to.
169
+ * @param splitPath - The path split into property/context names.
170
+ * @param context - The path context.
171
+ */
172
+ private addPropertiesToAContext;
173
+ /**
174
+ * Add properties to an object
175
+ * @param schema - The schema to add the properties to.
176
+ * @param splitPath - The path split into property/context names.
177
+ * @param context - The path context.
178
+ * @param type - The data type (see JSON schema for details).
179
+ */
180
+ private addPropertiesToAnObject;
181
+ /**
182
+ * Add an array to an object property
183
+ * @param schema - The schema to add the properties to.
184
+ * @param context - The name of the context.
185
+ */
186
+ private addArrayToAnObject;
187
+ /**
188
+ * Add a context to the $defs property
189
+ * @param schema - The schema to use.
190
+ * @param propertyName - The name of the property the context belongs to.
191
+ * @param currentContext - The current context.
192
+ * @param parentContext - The parent context.
193
+ * @returns
194
+ */
195
+ private addContext;
196
+ /**
197
+ * Get parent contexts
198
+ * @param schema - The schema to use.
199
+ * @param parentContext - The parent context.
200
+ * @param contexts - A list of parent contexts.
201
+ * @returns
202
+ */
203
+ private getParentContexts;
204
+ }
205
+ export {};
@@ -99,9 +99,9 @@ export declare const Context: Readonly<{
99
99
  dispatch<T_4 extends UnknownContext>(target: EventTarget, context: T_4, callback: ContextCallback<ContextType<T_4>>, multiple?: boolean): void;
100
100
  /**
101
101
  * Enables an event target to provide a context value.
102
- * @param target The target to provide the context value for.
103
- * @param context The context to provide the value for.
104
- * @param value The value to provide for the context.
102
+ * @param target - The target to provide the context value for.
103
+ * @param context - The context to provide the value for.
104
+ * @param value - The value to provide for the context.
105
105
  */
106
106
  provide<T_5 extends UnknownContext>(target: EventTarget, context: T_5, value: ContextType<T_5>): void;
107
107
  /**
@@ -117,9 +117,9 @@ export declare const Context: Readonly<{
117
117
  /**
118
118
  * Defines a getter-only property on the target that will return the context
119
119
  * value for the target.
120
- * @param target The target to define the property on.
121
- * @param propertyName The name of the property to define.
122
- * @param context The context that will be used to retrieve the property value.
120
+ * @param target - The target to define the property on.
121
+ * @param propertyName - The name of the property to define.
122
+ * @param context - The context that will be used to retrieve the property value.
123
123
  * @remarks
124
124
  * Uses the default request strategy to locate the context and will return the
125
125
  * initialValue if the context isn't handled.
@@ -0,0 +1,3 @@
1
+ export { type CSSTemplateTag, type CSSValue, css } from "./styles/css.js";
2
+ export { CSSDirective, type CSSDirectiveDefinition, cssDirective, } from "./styles/css-directive.js";
3
+ export { type ComposableStyles, ElementStyles, } from "./styles/element-styles.js";
@@ -1 +1,5 @@
1
- export {};
1
+ /**
2
+ * Enables human-readable FAST debug messages.
3
+ * @public
4
+ */
5
+ export declare function enableDebug(): void;
@@ -0,0 +1,58 @@
1
+ import { type FASTElementExtension } from "../components/fast-definitions.js";
2
+ import type { Schema } from "../components/schema.js";
3
+ export { type AccessCachedPath, type CachedPath, type CachedPathCommon, type CachedPathMap, type ChildrenMap, type DefaultCachedPath, type EventCachedPath, type JSONSchema, type JSONSchemaCommon, type JSONSchemaDefinition, type RegisterPathConfig, type RepeatCachedPath, Schema, schemaRegistry, } from "../components/schema.js";
4
+ /**
5
+ * Configuration object for the attributeMap extension.
6
+ * Omitting all fields uses the default attribute-mapping behavior.
7
+ * @public
8
+ */
9
+ export interface AttributeMapConfig {
10
+ /**
11
+ * Strategy for mapping template binding keys to HTML attribute names.
12
+ *
13
+ * - `"camelCase"` (default): the binding key is treated as a camelCase property
14
+ * name and the attribute name is derived by converting it to
15
+ * kebab-case (e.g. `{{fooBar}}` → property `fooBar`, attribute
16
+ * `foo-bar`). This matches the build-time `attribute-name-strategy`
17
+ * option in `@microsoft/fast-build`.
18
+ * - `"none"`: the binding key is used as-is for both the
19
+ * property name and the attribute name (e.g. `{{foo-bar}}` →
20
+ * property `foo-bar`, attribute `foo-bar`).
21
+ */
22
+ "attribute-name-strategy"?: "none" | "camelCase";
23
+ }
24
+ /**
25
+ * Creates a FAST element extension that enables schema-driven attribute mapping
26
+ * for the resolved definition. When called without arguments, uses the default
27
+ * attribute-mapping behavior. The extension uses `definition.schema` immediately
28
+ * for manual schemas, or the schema generated/augmented by `declarativeTemplate()`.
29
+ * @public
30
+ */
31
+ export declare function attributeMap(config?: AttributeMapConfig): FASTElementExtension;
32
+ /**
33
+ * AttributeMap provides functionality for detecting simple (leaf) properties in
34
+ * a generated JSON schema and defining them as attr properties on a class prototype.
35
+ *
36
+ * A property is a candidate for attr when its schema entry has no nested `properties`,
37
+ * no `type`, and no `anyOf` — for example, a plain `foo` binding.
38
+ *
39
+ * When `attribute-name-strategy` is `"camelCase"` (the default), the binding key is treated as a
40
+ * camelCase property name and the HTML attribute name is derived by converting it to
41
+ * kebab-case (e.g. property `fooBar` → attribute `foo-bar`). This matches the
42
+ * build-time `attribute-name-strategy` option in `@microsoft/fast-build`.
43
+ *
44
+ * When `attribute-name-strategy` is `"none"`, the binding key is used
45
+ * as both the attribute name and property name — no normalization is applied.
46
+ *
47
+ * Properties already decorated with `attr` or `observable` on the class are left
48
+ * untouched.
49
+ * @public
50
+ */
51
+ export declare class AttributeMap {
52
+ private schema;
53
+ private classPrototype;
54
+ private definition;
55
+ private config;
56
+ constructor(classPrototype: any, schema: Schema, definition?: any, config?: AttributeMapConfig);
57
+ defineProperties(): void;
58
+ }
@@ -0,0 +1,5 @@
1
+ export declare const debugMessages: {
2
+ 2000: string;
3
+ 2001: string;
4
+ 2002: string;
5
+ };
@@ -0,0 +1,13 @@
1
+ export type { AttributeConfiguration, AttributeDefinition, AttributeMode, ValueConverter, } from "../components/attributes.js";
2
+ export type { FASTElementDefinition, FASTElementExtension, FASTElementTemplateResolver, PartialFASTElementDefinition, ShadowRootOptions, TemplateLifecycleCallbacks, } from "../components/fast-definitions.js";
3
+ export { type AccessCachedPath, type CachedPath, type CachedPathCommon, type CachedPathMap, type ChildrenMap, type DefaultCachedPath, type EventCachedPath, type JSONSchema, type JSONSchemaCommon, type JSONSchemaDefinition, type RegisterPathConfig, type RepeatCachedPath, Schema, schemaRegistry, } from "../components/schema.js";
4
+ export type { DOMPolicy } from "../dom.js";
5
+ export type { Constructable } from "../interfaces.js";
6
+ export type { Accessor } from "../observation/observable.js";
7
+ export type { ComposableStyles, ConstructibleStyleStrategy, ElementStyles, } from "../styles/element-styles.js";
8
+ export type { StyleStrategy, StyleTarget } from "../styles/style-strategy.js";
9
+ export type { ViewBehavior, ViewBehaviorFactory, } from "../templating/html-directive.js";
10
+ export type { CaptureType, ElementViewTemplate, HTMLTemplateCompilationResult, SyntheticViewTemplate, TemplateValue, ViewTemplate, } from "../templating/template.js";
11
+ export type { ElementView, HTMLView } from "../templating/view.js";
12
+ export { declarativeTemplate } from "./template.js";
13
+ export { type ResolvedStringsAndValues, TemplateParser } from "./template-parser.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Warning and error messages.
3
+ * @internal
4
+ */
5
+ export declare const enum Message {
6
+ noTemplateProvided = 2000,
7
+ moreThanOneTemplateProvided = 2001,
8
+ moreThanOneMatchingTemplateProvided = 2002
9
+ }
@@ -0,0 +1,58 @@
1
+ import { type JSONSchema, type JSONSchemaDefinition } from "../components/schema.js";
2
+ /**
3
+ * Find a definition
4
+ * This may exist as a $ref at the root or as a $ref in any anyOf or not at all
5
+ * if the Observer Map has not been enabled on a child component
6
+ * @param schema - The JSON schema to find the ref in
7
+ * @returns The definition or null
8
+ * @public
9
+ */
10
+ export declare function findDef(schema: JSONSchema | JSONSchemaDefinition): string | null;
11
+ /**
12
+ * Assign observables to data
13
+ * @param schema - The schema
14
+ * @param rootSchema - The root schema mapping to the root property
15
+ * @param data - The data
16
+ * @param target - The target custom element
17
+ * @param rootProperty - The root property
18
+ * @returns
19
+ * @public
20
+ */
21
+ export declare function assignObservables(schema: JSONSchema | JSONSchemaDefinition, rootSchema: JSONSchema, data: any, target: any, rootProperty: string): typeof Proxy;
22
+ /**
23
+ * Assign a proxy to an object
24
+ * @param schema - The current schema
25
+ * @param rootSchema - The root schema for the root property
26
+ * @param target - The target custom element
27
+ * @param rootProperty - The root property
28
+ * @param object - The object to assign the proxy to
29
+ * @returns Proxy object
30
+ * @public
31
+ */
32
+ export declare function assignProxy(schema: JSONSchema | JSONSchemaDefinition, rootSchema: JSONSchema, target: any, rootProperty: string, object: any): typeof Proxy;
33
+ /**
34
+ * Deeply compares two objects for equality.
35
+ *
36
+ * @param obj1 - First object to compare
37
+ * @param obj2 - Second object to compare
38
+ * @returns True if the objects are deeply equal, false otherwise
39
+ * @public
40
+ */
41
+ export declare function deepEqual(obj1: any, obj2: any): boolean;
42
+ /**
43
+ * Checks if a value is a plain object (not an array, null, or other type).
44
+ *
45
+ * @param value - The value to check
46
+ * @returns True if the value is a plain object, false otherwise
47
+ * @public
48
+ */
49
+ export declare function isPlainObject(value: any): value is Record<string, any>;
50
+ /**
51
+ * Deeply merges the source object into the target object.
52
+ *
53
+ * @param target - The target object to merge into
54
+ * @param source - The source object to merge from
55
+ * @returns boolean indicating whether changes were made
56
+ * @public
57
+ */
58
+ export declare function deepMerge(target: any, source: any): boolean;
@@ -0,0 +1,89 @@
1
+ import { type FASTElementExtension } from "../components/fast-definitions.js";
2
+ import type { Schema } from "../components/schema.js";
3
+ export { type AccessCachedPath, type CachedPath, type CachedPathCommon, type CachedPathMap, type ChildrenMap, type DefaultCachedPath, type EventCachedPath, type JSONSchema, type JSONSchemaCommon, type JSONSchemaDefinition, type RegisterPathConfig, type RepeatCachedPath, Schema, schemaRegistry, } from "../components/schema.js";
4
+ /**
5
+ * A node in the observer-map path tree.
6
+ *
7
+ * - `true` → observe this path and all descendants (unless overridden by children).
8
+ * - `false` → do NOT observe this path or its descendants (unless overridden by children).
9
+ * - `ObserverMapPathNode` → configure child paths individually;
10
+ * the node itself is observed if `$observe` is true (default when parent is observed).
11
+ * @public
12
+ */
13
+ export type ObserverMapPathEntry = boolean | ObserverMapPathNode;
14
+ /**
15
+ * A node object in the observer-map path tree.
16
+ *
17
+ * `$observe` controls whether this node itself is observed.
18
+ * When omitted the value is inherited from the nearest ancestor
19
+ * that explicitly sets `$observe`. At the root level the default is `true`.
20
+ *
21
+ * Child property overrides are keyed by property name.
22
+ * @public
23
+ */
24
+ export interface ObserverMapPathNode {
25
+ $observe?: boolean;
26
+ [propertyName: string]: ObserverMapPathEntry | undefined;
27
+ }
28
+ /**
29
+ * Configuration object for the observerMap extension.
30
+ * `schema` enables non-declarative/manual schema use.
31
+ * When `properties` is omitted, every root property is observed. When
32
+ * `properties` is present, only listed root properties participate in
33
+ * observer-map observation.
34
+ * @public
35
+ */
36
+ export interface ObserverMapConfig {
37
+ /**
38
+ * The schema to use for observer-map configuration.
39
+ * Pass this for non-declarative/manual schema use. When omitted, the
40
+ * extension uses the schema on the FAST element definition.
41
+ */
42
+ schema?: Schema;
43
+ /**
44
+ * Per-root-property observation control.
45
+ * Keys are root property names discovered in the template schema.
46
+ * Only root properties listed here participate in observer-map observation.
47
+ * Omitting this field observes every discovered root property.
48
+ */
49
+ properties?: {
50
+ [rootProperty: string]: ObserverMapPathEntry;
51
+ };
52
+ }
53
+ /**
54
+ * Creates a FAST element extension that enables schema-driven observer mapping
55
+ * for the resolved definition. When called without arguments, observes every
56
+ * discovered root property. The extension uses `config.schema`,
57
+ * `definition.schema`, or the schema generated by `declarativeTemplate()`.
58
+ * @public
59
+ */
60
+ export declare function observerMap(config?: ObserverMapConfig): FASTElementExtension;
61
+ /**
62
+ * ObserverMap provides functionality for caching binding paths, extracting root properties,
63
+ * and defining observable properties on class prototypes
64
+ * @public
65
+ */
66
+ export declare class ObserverMap {
67
+ private schema;
68
+ private classPrototype;
69
+ private config;
70
+ constructor(classPrototype: any, schema: Schema, config?: ObserverMapConfig);
71
+ defineProperties(): void;
72
+ /**
73
+ * Creates a proxy for an object that intercepts property mutations and triggers Observable notifications
74
+ * @param target - The target instance that owns the root property
75
+ * @param rootProperty - The name of the root property for notification purposes
76
+ * @param object - The object to wrap with a proxy
77
+ * @param schema - The schema for the element
78
+ * @returns A proxy that triggers notifications on property mutations
79
+ */
80
+ private getAndAssignObservables;
81
+ /**
82
+ * Creates a property change handler function for observable properties
83
+ * This handler is called when an observable property transitions from undefined to a defined value
84
+ * @param propertyName - The name of the property for which to create the change handler
85
+ * @param existingChangedMethod - Optional existing changed method to call after the instance resolver logic
86
+ * @returns A function that handles property changes and sets up proxies for object values
87
+ */
88
+ private defineChanged;
89
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Installs the declarative runtime debug messages.
3
+ * @internal
4
+ */
5
+ export declare function ensureDeclarativeRuntime(): void;
@@ -0,0 +1,21 @@
1
+ export declare const attributeDirectivePrefix: string;
2
+ export declare const clientSideCloseExpression: string;
3
+ export declare const clientSideOpenExpression: string;
4
+ export declare const closeExpression: string;
5
+ /**
6
+ * Event argument accessor for declarative event bindings.
7
+ * @public
8
+ */
9
+ export declare const eventArgAccessor: string;
10
+ /**
11
+ * Execution context accessor for declarative event bindings.
12
+ * @public
13
+ */
14
+ export declare const executionContextAccessor: string;
15
+ export declare const openExpression: string;
16
+ export declare const repeatDirectiveClose: string;
17
+ export declare const repeatDirectiveOpen: string;
18
+ export declare const unescapedCloseExpression: string;
19
+ export declare const unescapedOpenExpression: string;
20
+ export declare const whenDirectiveClose: string;
21
+ export declare const whenDirectiveOpen: string;