@ni/fast-foundation 0.0.2

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 (416) hide show
  1. package/README.md +58 -0
  2. package/dist/dts/accordion/accordion.d.ts +65 -0
  3. package/dist/dts/accordion/accordion.template.d.ts +8 -0
  4. package/dist/dts/accordion/index.d.ts +2 -0
  5. package/dist/dts/accordion-item/accordion-item.d.ts +76 -0
  6. package/dist/dts/accordion-item/accordion-item.template.d.ts +8 -0
  7. package/dist/dts/accordion-item/index.d.ts +2 -0
  8. package/dist/dts/anchor/anchor.d.ts +128 -0
  9. package/dist/dts/anchor/anchor.template.d.ts +8 -0
  10. package/dist/dts/anchor/index.d.ts +2 -0
  11. package/dist/dts/anchored-region/anchored-region-config.d.ts +117 -0
  12. package/dist/dts/anchored-region/anchored-region.d.ts +389 -0
  13. package/dist/dts/anchored-region/anchored-region.template.d.ts +8 -0
  14. package/dist/dts/anchored-region/index.d.ts +3 -0
  15. package/dist/dts/avatar/avatar.d.ts +62 -0
  16. package/dist/dts/avatar/avatar.template.d.ts +8 -0
  17. package/dist/dts/avatar/index.d.ts +2 -0
  18. package/dist/dts/badge/badge.d.ts +36 -0
  19. package/dist/dts/badge/badge.template.d.ts +8 -0
  20. package/dist/dts/badge/index.d.ts +2 -0
  21. package/dist/dts/breadcrumb/breadcrumb.d.ts +27 -0
  22. package/dist/dts/breadcrumb/breadcrumb.template.d.ts +8 -0
  23. package/dist/dts/breadcrumb/index.d.ts +2 -0
  24. package/dist/dts/breadcrumb-item/breadcrumb-item.d.ts +36 -0
  25. package/dist/dts/breadcrumb-item/breadcrumb-item.template.d.ts +8 -0
  26. package/dist/dts/breadcrumb-item/index.d.ts +2 -0
  27. package/dist/dts/button/button.d.ts +167 -0
  28. package/dist/dts/button/button.form-associated.d.ts +16 -0
  29. package/dist/dts/button/button.template.d.ts +8 -0
  30. package/dist/dts/button/index.d.ts +2 -0
  31. package/dist/dts/calendar/calendar.d.ts +178 -0
  32. package/dist/dts/calendar/calendar.template.d.ts +58 -0
  33. package/dist/dts/calendar/date-formatter.d.ts +124 -0
  34. package/dist/dts/calendar/index.d.ts +3 -0
  35. package/dist/dts/card/card.d.ts +10 -0
  36. package/dist/dts/card/card.template.d.ts +8 -0
  37. package/dist/dts/card/index.d.ts +2 -0
  38. package/dist/dts/checkbox/checkbox.d.ts +58 -0
  39. package/dist/dts/checkbox/checkbox.form-associated.d.ts +16 -0
  40. package/dist/dts/checkbox/checkbox.template.d.ts +8 -0
  41. package/dist/dts/checkbox/index.d.ts +2 -0
  42. package/dist/dts/combobox/combobox.d.ts +341 -0
  43. package/dist/dts/combobox/combobox.form-associated.d.ts +16 -0
  44. package/dist/dts/combobox/combobox.options.d.ts +15 -0
  45. package/dist/dts/combobox/combobox.template.d.ts +8 -0
  46. package/dist/dts/combobox/index.d.ts +3 -0
  47. package/dist/dts/data-grid/data-grid-cell.d.ts +62 -0
  48. package/dist/dts/data-grid/data-grid-cell.template.d.ts +9 -0
  49. package/dist/dts/data-grid/data-grid-row.d.ts +119 -0
  50. package/dist/dts/data-grid/data-grid-row.template.d.ts +10 -0
  51. package/dist/dts/data-grid/data-grid.d.ts +218 -0
  52. package/dist/dts/data-grid/data-grid.options.d.ts +49 -0
  53. package/dist/dts/data-grid/data-grid.template.d.ts +10 -0
  54. package/dist/dts/data-grid/index.d.ts +6 -0
  55. package/dist/dts/design-system/component-presentation.d.ts +66 -0
  56. package/dist/dts/design-system/design-system.d.ts +104 -0
  57. package/dist/dts/design-system/index.d.ts +3 -0
  58. package/dist/dts/design-system/registration-context.d.ts +106 -0
  59. package/dist/dts/design-token/custom-property-manager.d.ts +35 -0
  60. package/dist/dts/design-token/design-token.d.ts +139 -0
  61. package/dist/dts/design-token/interfaces.d.ts +31 -0
  62. package/dist/dts/di/di.d.ts +858 -0
  63. package/dist/dts/di/index.d.ts +1 -0
  64. package/dist/dts/dialog/dialog.d.ts +153 -0
  65. package/dist/dts/dialog/dialog.template.d.ts +8 -0
  66. package/dist/dts/dialog/index.d.ts +2 -0
  67. package/dist/dts/directives/reflect-attributes.d.ts +18 -0
  68. package/dist/dts/disclosure/disclosure.d.ts +59 -0
  69. package/dist/dts/disclosure/disclosure.template.d.ts +8 -0
  70. package/dist/dts/disclosure/index.d.ts +2 -0
  71. package/dist/dts/divider/divider.d.ts +28 -0
  72. package/dist/dts/divider/divider.options.d.ts +19 -0
  73. package/dist/dts/divider/divider.template.d.ts +8 -0
  74. package/dist/dts/divider/index.d.ts +2 -0
  75. package/dist/dts/flipper/flipper.d.ts +57 -0
  76. package/dist/dts/flipper/flipper.options.d.ts +13 -0
  77. package/dist/dts/flipper/flipper.template.d.ts +8 -0
  78. package/dist/dts/flipper/index.d.ts +2 -0
  79. package/dist/dts/form-associated/form-associated.d.ts +177 -0
  80. package/dist/dts/form-associated/index.d.ts +1 -0
  81. package/dist/dts/foundation-element/foundation-element.d.ts +120 -0
  82. package/dist/dts/foundation-element/index.d.ts +1 -0
  83. package/dist/dts/horizontal-scroll/horizontal-scroll.d.ts +242 -0
  84. package/dist/dts/horizontal-scroll/horizontal-scroll.template.d.ts +7 -0
  85. package/dist/dts/horizontal-scroll/index.d.ts +2 -0
  86. package/dist/dts/index-rollup.d.ts +2 -0
  87. package/dist/dts/index.d.ts +53 -0
  88. package/dist/dts/interfaces.d.ts +4 -0
  89. package/dist/dts/listbox/index.d.ts +3 -0
  90. package/dist/dts/listbox/listbox.d.ts +314 -0
  91. package/dist/dts/listbox/listbox.element.d.ts +223 -0
  92. package/dist/dts/listbox/listbox.template.d.ts +8 -0
  93. package/dist/dts/listbox-option/index.d.ts +2 -0
  94. package/dist/dts/listbox-option/listbox-option.d.ts +176 -0
  95. package/dist/dts/listbox-option/listbox-option.template.d.ts +8 -0
  96. package/dist/dts/menu/index.d.ts +2 -0
  97. package/dist/dts/menu/menu.d.ts +78 -0
  98. package/dist/dts/menu/menu.template.d.ts +8 -0
  99. package/dist/dts/menu-item/index.d.ts +2 -0
  100. package/dist/dts/menu-item/menu-item.d.ts +160 -0
  101. package/dist/dts/menu-item/menu-item.options.d.ts +29 -0
  102. package/dist/dts/menu-item/menu-item.template.d.ts +10 -0
  103. package/dist/dts/number-field/index.d.ts +2 -0
  104. package/dist/dts/number-field/number-field.d.ts +227 -0
  105. package/dist/dts/number-field/number-field.form-associated.d.ts +16 -0
  106. package/dist/dts/number-field/number-field.template.d.ts +8 -0
  107. package/dist/dts/patterns/aria-global.d.ts +189 -0
  108. package/dist/dts/patterns/index.d.ts +2 -0
  109. package/dist/dts/patterns/start-end.d.ts +65 -0
  110. package/dist/dts/picker/index.d.ts +10 -0
  111. package/dist/dts/picker/picker-list-item.d.ts +38 -0
  112. package/dist/dts/picker/picker-list-item.template.d.ts +8 -0
  113. package/dist/dts/picker/picker-list.d.ts +8 -0
  114. package/dist/dts/picker/picker-list.template.d.ts +8 -0
  115. package/dist/dts/picker/picker-menu-option.d.ts +37 -0
  116. package/dist/dts/picker/picker-menu-option.template.d.ts +8 -0
  117. package/dist/dts/picker/picker-menu.d.ts +46 -0
  118. package/dist/dts/picker/picker-menu.template.d.ts +8 -0
  119. package/dist/dts/picker/picker.d.ts +390 -0
  120. package/dist/dts/picker/picker.form-associated.d.ts +16 -0
  121. package/dist/dts/picker/picker.template.d.ts +8 -0
  122. package/dist/dts/progress/base-progress.d.ts +71 -0
  123. package/dist/dts/progress/index.d.ts +2 -0
  124. package/dist/dts/progress/progress.template.d.ts +8 -0
  125. package/dist/dts/progress-ring/index.d.ts +1 -0
  126. package/dist/dts/progress-ring/progress-ring.template.d.ts +8 -0
  127. package/dist/dts/radio/index.d.ts +2 -0
  128. package/dist/dts/radio/radio.d.ts +70 -0
  129. package/dist/dts/radio/radio.form-associated.d.ts +16 -0
  130. package/dist/dts/radio/radio.template.d.ts +8 -0
  131. package/dist/dts/radio-group/index.d.ts +2 -0
  132. package/dist/dts/radio-group/radio-group.d.ts +101 -0
  133. package/dist/dts/radio-group/radio-group.template.d.ts +8 -0
  134. package/dist/dts/search/index.d.ts +2 -0
  135. package/dist/dts/search/search.d.ts +162 -0
  136. package/dist/dts/search/search.form-associated.d.ts +16 -0
  137. package/dist/dts/search/search.template.d.ts +8 -0
  138. package/dist/dts/select/index.d.ts +3 -0
  139. package/dist/dts/select/select.d.ts +289 -0
  140. package/dist/dts/select/select.form-associated.d.ts +16 -0
  141. package/dist/dts/select/select.options.d.ts +13 -0
  142. package/dist/dts/select/select.template.d.ts +8 -0
  143. package/dist/dts/skeleton/index.d.ts +2 -0
  144. package/dist/dts/skeleton/skeleton.d.ts +47 -0
  145. package/dist/dts/skeleton/skeleton.template.d.ts +8 -0
  146. package/dist/dts/slider/index.d.ts +2 -0
  147. package/dist/dts/slider/slider-utilities.d.ts +5 -0
  148. package/dist/dts/slider/slider.d.ts +230 -0
  149. package/dist/dts/slider/slider.form-associated.d.ts +16 -0
  150. package/dist/dts/slider/slider.template.d.ts +8 -0
  151. package/dist/dts/slider-label/index.d.ts +2 -0
  152. package/dist/dts/slider-label/slider-label.d.ts +81 -0
  153. package/dist/dts/slider-label/slider-label.template.d.ts +8 -0
  154. package/dist/dts/switch/index.d.ts +2 -0
  155. package/dist/dts/switch/switch.d.ts +60 -0
  156. package/dist/dts/switch/switch.form-associated.d.ts +16 -0
  157. package/dist/dts/switch/switch.template.d.ts +8 -0
  158. package/dist/dts/tab/index.d.ts +2 -0
  159. package/dist/dts/tab/tab.d.ts +17 -0
  160. package/dist/dts/tab/tab.template.d.ts +8 -0
  161. package/dist/dts/tab-panel/index.d.ts +2 -0
  162. package/dist/dts/tab-panel/tab-panel.d.ts +10 -0
  163. package/dist/dts/tab-panel/tab-panel.template.d.ts +8 -0
  164. package/dist/dts/tabs/index.d.ts +2 -0
  165. package/dist/dts/tabs/tabs.d.ts +140 -0
  166. package/dist/dts/tabs/tabs.template.d.ts +8 -0
  167. package/dist/dts/test-utilities/fixture.d.ts +89 -0
  168. package/dist/dts/test-utilities/timeout.d.ts +4 -0
  169. package/dist/dts/text-area/index.d.ts +2 -0
  170. package/dist/dts/text-area/text-area.d.ts +149 -0
  171. package/dist/dts/text-area/text-area.form-associated.d.ts +16 -0
  172. package/dist/dts/text-area/text-area.options.d.ts +27 -0
  173. package/dist/dts/text-area/text-area.template.d.ts +8 -0
  174. package/dist/dts/text-field/index.d.ts +2 -0
  175. package/dist/dts/text-field/text-field.d.ts +166 -0
  176. package/dist/dts/text-field/text-field.form-associated.d.ts +16 -0
  177. package/dist/dts/text-field/text-field.options.d.ts +31 -0
  178. package/dist/dts/text-field/text-field.template.d.ts +8 -0
  179. package/dist/dts/toolbar/index.d.ts +2 -0
  180. package/dist/dts/toolbar/toolbar.d.ts +167 -0
  181. package/dist/dts/toolbar/toolbar.template.d.ts +9 -0
  182. package/dist/dts/tooltip/index.d.ts +2 -0
  183. package/dist/dts/tooltip/tooltip.d.ts +239 -0
  184. package/dist/dts/tooltip/tooltip.options.d.ts +69 -0
  185. package/dist/dts/tooltip/tooltip.template.d.ts +8 -0
  186. package/dist/dts/tree-item/index.d.ts +2 -0
  187. package/dist/dts/tree-item/tree-item.d.ts +141 -0
  188. package/dist/dts/tree-item/tree-item.template.d.ts +8 -0
  189. package/dist/dts/tree-view/index.d.ts +2 -0
  190. package/dist/dts/tree-view/tree-view.d.ts +99 -0
  191. package/dist/dts/tree-view/tree-view.template.d.ts +8 -0
  192. package/dist/dts/utilities/apply-mixins.d.ts +6 -0
  193. package/dist/dts/utilities/composed-contains.d.ts +12 -0
  194. package/dist/dts/utilities/composed-parent.d.ts +10 -0
  195. package/dist/dts/utilities/direction.d.ts +7 -0
  196. package/dist/dts/utilities/index.d.ts +8 -0
  197. package/dist/dts/utilities/intersection-service.d.ts +30 -0
  198. package/dist/dts/utilities/match-media-stylesheet-behavior.d.ts +124 -0
  199. package/dist/dts/utilities/property-stylesheet-behavior.d.ts +38 -0
  200. package/dist/dts/utilities/resize-observer.d.ts +31 -0
  201. package/dist/dts/utilities/root-active-element.d.ts +1 -0
  202. package/dist/dts/utilities/style/disabled.d.ts +5 -0
  203. package/dist/dts/utilities/style/display.d.ts +17 -0
  204. package/dist/dts/utilities/style/focus.d.ts +8 -0
  205. package/dist/dts/utilities/style/index.d.ts +3 -0
  206. package/dist/dts/utilities/whitespace-filter.d.ts +9 -0
  207. package/dist/esm/accordion/accordion.js +185 -0
  208. package/dist/esm/accordion/accordion.template.js +11 -0
  209. package/dist/esm/accordion/index.js +2 -0
  210. package/dist/esm/accordion-item/accordion-item.js +72 -0
  211. package/dist/esm/accordion-item/accordion-item.template.js +49 -0
  212. package/dist/esm/accordion-item/index.js +2 -0
  213. package/dist/esm/anchor/anchor.js +85 -0
  214. package/dist/esm/anchor/anchor.template.js +47 -0
  215. package/dist/esm/anchor/index.js +2 -0
  216. package/dist/esm/anchored-region/anchored-region-config.js +59 -0
  217. package/dist/esm/anchored-region/anchored-region.js +964 -0
  218. package/dist/esm/anchored-region/anchored-region.template.js +12 -0
  219. package/dist/esm/anchored-region/index.js +3 -0
  220. package/dist/esm/avatar/avatar.js +39 -0
  221. package/dist/esm/avatar/avatar.template.js +23 -0
  222. package/dist/esm/avatar/index.js +2 -0
  223. package/dist/esm/badge/badge.js +40 -0
  224. package/dist/esm/badge/badge.template.js +12 -0
  225. package/dist/esm/badge/index.js +2 -0
  226. package/dist/esm/breadcrumb/breadcrumb.js +70 -0
  227. package/dist/esm/breadcrumb/breadcrumb.template.js +14 -0
  228. package/dist/esm/breadcrumb/index.js +2 -0
  229. package/dist/esm/breadcrumb-item/breadcrumb-item.js +23 -0
  230. package/dist/esm/breadcrumb-item/breadcrumb-item.template.js +24 -0
  231. package/dist/esm/breadcrumb-item/index.js +2 -0
  232. package/dist/esm/button/button.form-associated.js +15 -0
  233. package/dist/esm/button/button.js +183 -0
  234. package/dist/esm/button/button.template.js +51 -0
  235. package/dist/esm/button/index.js +2 -0
  236. package/dist/esm/calendar/calendar.js +280 -0
  237. package/dist/esm/calendar/calendar.template.js +191 -0
  238. package/dist/esm/calendar/date-formatter.js +144 -0
  239. package/dist/esm/calendar/index.js +3 -0
  240. package/dist/esm/card/card.js +10 -0
  241. package/dist/esm/card/card.template.js +8 -0
  242. package/dist/esm/card/index.js +2 -0
  243. package/dist/esm/checkbox/checkbox.form-associated.js +15 -0
  244. package/dist/esm/checkbox/checkbox.js +75 -0
  245. package/dist/esm/checkbox/checkbox.template.js +35 -0
  246. package/dist/esm/checkbox/index.js +2 -0
  247. package/dist/esm/combobox/combobox.form-associated.js +15 -0
  248. package/dist/esm/combobox/combobox.js +587 -0
  249. package/dist/esm/combobox/combobox.options.js +10 -0
  250. package/dist/esm/combobox/combobox.template.js +66 -0
  251. package/dist/esm/combobox/index.js +3 -0
  252. package/dist/esm/data-grid/data-grid-cell.js +229 -0
  253. package/dist/esm/data-grid/data-grid-cell.template.js +23 -0
  254. package/dist/esm/data-grid/data-grid-row.js +203 -0
  255. package/dist/esm/data-grid/data-grid-row.template.js +47 -0
  256. package/dist/esm/data-grid/data-grid.js +440 -0
  257. package/dist/esm/data-grid/data-grid.options.js +31 -0
  258. package/dist/esm/data-grid/data-grid.template.js +36 -0
  259. package/dist/esm/data-grid/index.js +6 -0
  260. package/dist/esm/design-system/component-presentation.js +86 -0
  261. package/dist/esm/design-system/design-system.js +207 -0
  262. package/dist/esm/design-system/index.js +3 -0
  263. package/dist/esm/design-system/registration-context.js +1 -0
  264. package/dist/esm/design-token/custom-property-manager.js +216 -0
  265. package/dist/esm/design-token/design-token.js +657 -0
  266. package/dist/esm/design-token/interfaces.js +1 -0
  267. package/dist/esm/di/di.js +1341 -0
  268. package/dist/esm/di/index.js +1 -0
  269. package/dist/esm/dialog/dialog.js +280 -0
  270. package/dist/esm/dialog/dialog.template.js +30 -0
  271. package/dist/esm/dialog/index.js +2 -0
  272. package/dist/esm/directives/reflect-attributes.js +88 -0
  273. package/dist/esm/disclosure/disclosure.js +72 -0
  274. package/dist/esm/disclosure/disclosure.template.js +20 -0
  275. package/dist/esm/disclosure/index.js +2 -0
  276. package/dist/esm/divider/divider.js +39 -0
  277. package/dist/esm/divider/divider.options.js +14 -0
  278. package/dist/esm/divider/divider.template.js +8 -0
  279. package/dist/esm/divider/index.js +2 -0
  280. package/dist/esm/flipper/flipper.js +65 -0
  281. package/dist/esm/flipper/flipper.options.js +8 -0
  282. package/dist/esm/flipper/flipper.template.js +30 -0
  283. package/dist/esm/flipper/index.js +2 -0
  284. package/dist/esm/form-associated/form-associated.js +464 -0
  285. package/dist/esm/form-associated/index.js +1 -0
  286. package/dist/esm/foundation-element/foundation-element.js +132 -0
  287. package/dist/esm/foundation-element/index.js +1 -0
  288. package/dist/esm/horizontal-scroll/horizontal-scroll.js +380 -0
  289. package/dist/esm/horizontal-scroll/horizontal-scroll.template.js +62 -0
  290. package/dist/esm/horizontal-scroll/index.js +2 -0
  291. package/dist/esm/index-rollup.js +2 -0
  292. package/dist/esm/index.js +54 -0
  293. package/dist/esm/interfaces.js +1 -0
  294. package/dist/esm/listbox/index.js +3 -0
  295. package/dist/esm/listbox/listbox.element.js +448 -0
  296. package/dist/esm/listbox/listbox.js +528 -0
  297. package/dist/esm/listbox/listbox.template.js +27 -0
  298. package/dist/esm/listbox-option/index.js +2 -0
  299. package/dist/esm/listbox-option/listbox-option.js +200 -0
  300. package/dist/esm/listbox-option/listbox-option.template.js +25 -0
  301. package/dist/esm/menu/index.js +2 -0
  302. package/dist/esm/menu/menu.js +290 -0
  303. package/dist/esm/menu/menu.template.js +15 -0
  304. package/dist/esm/menu-item/index.js +2 -0
  305. package/dist/esm/menu-item/menu-item.js +251 -0
  306. package/dist/esm/menu-item/menu-item.options.js +26 -0
  307. package/dist/esm/menu-item/menu-item.template.js +78 -0
  308. package/dist/esm/number-field/index.js +2 -0
  309. package/dist/esm/number-field/number-field.form-associated.js +15 -0
  310. package/dist/esm/number-field/number-field.js +288 -0
  311. package/dist/esm/number-field/number-field.template.js +84 -0
  312. package/dist/esm/patterns/aria-global.js +70 -0
  313. package/dist/esm/patterns/index.js +2 -0
  314. package/dist/esm/patterns/start-end.js +84 -0
  315. package/dist/esm/picker/index.js +10 -0
  316. package/dist/esm/picker/picker-list-item.js +71 -0
  317. package/dist/esm/picker/picker-list-item.template.js +17 -0
  318. package/dist/esm/picker/picker-list.js +8 -0
  319. package/dist/esm/picker/picker-list.template.js +13 -0
  320. package/dist/esm/picker/picker-menu-option.js +61 -0
  321. package/dist/esm/picker/picker-menu-option.template.js +16 -0
  322. package/dist/esm/picker/picker-menu.js +59 -0
  323. package/dist/esm/picker/picker-menu.template.js +29 -0
  324. package/dist/esm/picker/picker.form-associated.js +15 -0
  325. package/dist/esm/picker/picker.js +759 -0
  326. package/dist/esm/picker/picker.template.js +97 -0
  327. package/dist/esm/progress/base-progress.js +69 -0
  328. package/dist/esm/progress/index.js +2 -0
  329. package/dist/esm/progress/progress.template.js +31 -0
  330. package/dist/esm/progress-ring/index.js +1 -0
  331. package/dist/esm/progress-ring/progress-ring.template.js +45 -0
  332. package/dist/esm/radio/index.js +2 -0
  333. package/dist/esm/radio/radio.form-associated.js +15 -0
  334. package/dist/esm/radio/radio.js +108 -0
  335. package/dist/esm/radio/radio.template.js +31 -0
  336. package/dist/esm/radio-group/index.js +2 -0
  337. package/dist/esm/radio-group/radio-group.js +390 -0
  338. package/dist/esm/radio-group/radio-group.template.js +29 -0
  339. package/dist/esm/search/index.js +2 -0
  340. package/dist/esm/search/search.form-associated.js +15 -0
  341. package/dist/esm/search/search.js +157 -0
  342. package/dist/esm/search/search.template.js +93 -0
  343. package/dist/esm/select/index.js +3 -0
  344. package/dist/esm/select/select.form-associated.js +15 -0
  345. package/dist/esm/select/select.js +490 -0
  346. package/dist/esm/select/select.options.js +8 -0
  347. package/dist/esm/select/select.template.js +72 -0
  348. package/dist/esm/skeleton/index.js +2 -0
  349. package/dist/esm/skeleton/skeleton.js +35 -0
  350. package/dist/esm/skeleton/skeleton.template.js +20 -0
  351. package/dist/esm/slider/index.js +2 -0
  352. package/dist/esm/slider/slider-utilities.js +11 -0
  353. package/dist/esm/slider/slider.form-associated.js +15 -0
  354. package/dist/esm/slider/slider.js +452 -0
  355. package/dist/esm/slider/slider.template.js +40 -0
  356. package/dist/esm/slider-label/index.js +2 -0
  357. package/dist/esm/slider-label/slider-label.js +158 -0
  358. package/dist/esm/slider-label/slider-label.template.js +24 -0
  359. package/dist/esm/switch/index.js +2 -0
  360. package/dist/esm/switch/switch.form-associated.js +15 -0
  361. package/dist/esm/switch/switch.js +79 -0
  362. package/dist/esm/switch/switch.template.js +37 -0
  363. package/dist/esm/tab/index.js +2 -0
  364. package/dist/esm/tab/tab.js +15 -0
  365. package/dist/esm/tab/tab.template.js +10 -0
  366. package/dist/esm/tab-panel/index.js +2 -0
  367. package/dist/esm/tab-panel/tab-panel.js +10 -0
  368. package/dist/esm/tab-panel/tab-panel.template.js +10 -0
  369. package/dist/esm/tabs/index.js +2 -0
  370. package/dist/esm/tabs/tabs.js +375 -0
  371. package/dist/esm/tabs/tabs.template.js +26 -0
  372. package/dist/esm/test-utilities/fixture.js +90 -0
  373. package/dist/esm/test-utilities/timeout.js +13 -0
  374. package/dist/esm/text-area/index.js +2 -0
  375. package/dist/esm/text-area/text-area.form-associated.js +15 -0
  376. package/dist/esm/text-area/text-area.js +146 -0
  377. package/dist/esm/text-area/text-area.options.js +22 -0
  378. package/dist/esm/text-area/text-area.template.js +64 -0
  379. package/dist/esm/text-field/index.js +2 -0
  380. package/dist/esm/text-field/text-field.form-associated.js +15 -0
  381. package/dist/esm/text-field/text-field.js +183 -0
  382. package/dist/esm/text-field/text-field.options.js +26 -0
  383. package/dist/esm/text-field/text-field.template.js +70 -0
  384. package/dist/esm/toolbar/index.js +2 -0
  385. package/dist/esm/toolbar/toolbar.js +271 -0
  386. package/dist/esm/toolbar/toolbar.template.js +37 -0
  387. package/dist/esm/tooltip/index.js +2 -0
  388. package/dist/esm/tooltip/tooltip.js +512 -0
  389. package/dist/esm/tooltip/tooltip.options.js +63 -0
  390. package/dist/esm/tooltip/tooltip.template.js +32 -0
  391. package/dist/esm/tree-item/index.js +2 -0
  392. package/dist/esm/tree-item/tree-item.js +150 -0
  393. package/dist/esm/tree-item/tree-item.template.js +52 -0
  394. package/dist/esm/tree-view/index.js +2 -0
  395. package/dist/esm/tree-view/tree-view.js +268 -0
  396. package/dist/esm/tree-view/tree-view.template.js +18 -0
  397. package/dist/esm/utilities/apply-mixins.js +20 -0
  398. package/dist/esm/utilities/composed-contains.js +22 -0
  399. package/dist/esm/utilities/composed-parent.js +23 -0
  400. package/dist/esm/utilities/direction.js +10 -0
  401. package/dist/esm/utilities/index.js +8 -0
  402. package/dist/esm/utilities/intersection-service.js +91 -0
  403. package/dist/esm/utilities/match-media-stylesheet-behavior.js +140 -0
  404. package/dist/esm/utilities/property-stylesheet-behavior.js +52 -0
  405. package/dist/esm/utilities/resize-observer.js +5 -0
  406. package/dist/esm/utilities/root-active-element.js +8 -0
  407. package/dist/esm/utilities/style/disabled.js +5 -0
  408. package/dist/esm/utilities/style/display.js +14 -0
  409. package/dist/esm/utilities/style/focus.js +9 -0
  410. package/dist/esm/utilities/style/index.js +3 -0
  411. package/dist/esm/utilities/whitespace-filter.js +13 -0
  412. package/dist/fast-foundation.d.ts +9744 -0
  413. package/dist/fast-foundation.js +19097 -0
  414. package/dist/fast-foundation.min.js +19 -0
  415. package/dist/tsdoc-metadata.json +11 -0
  416. package/package.json +101 -0
@@ -0,0 +1,858 @@
1
+ /**
2
+ * Big thanks to https://github.com/fkleuver and the https://github.com/aurelia/aurelia project
3
+ * for the bulk of this code and many of the associated tests.
4
+ */
5
+ import { Constructable } from "@ni/fast-element";
6
+ /**
7
+ * Represents a custom callback for resolving a request from the container.
8
+ * The handler is the container that is invoking the callback. The requestor
9
+ * is the original container that made the request. The handler and the requestor
10
+ * may not be the same if the request has bubbled up to a parent container in the DI hierarchy.
11
+ * The resolver is the instance of the resolver that stores the callback. This is provided in case
12
+ * the callback needs a place or key against which to store state across resolutions.
13
+ * @public
14
+ */
15
+ export type ResolveCallback<T = any> = (handler: Container, requestor: Container, resolver: Resolver<T>) => T;
16
+ /**
17
+ * A constant key that can be used to represent an interface to a registered dependency.
18
+ * The key can be used in DI registrations but also doubles as a decorator for
19
+ * resolving the associated, registered dependency.
20
+ * @public
21
+ */
22
+ export type InterfaceSymbol<K = any> = (target: any, property: string, index?: number) => void;
23
+ interface ResolverLike<C, K = any> {
24
+ readonly $isResolver: true;
25
+ resolve(handler: C, requestor: C): Resolved<K>;
26
+ getFactory?(container: C): (K extends Constructable ? Factory<K> : never) | null;
27
+ }
28
+ /**
29
+ * Internally, the DI system maps "keys" to "resolvers". A resolver controls
30
+ * how a dependency is resolved. Resolvers for transient, singleton, etc. are
31
+ * provided out of the box, but you can also implement Resolver yourself and supply
32
+ * custom logic for resolution.
33
+ * @public
34
+ */
35
+ export interface Resolver<K = any> extends ResolverLike<Container, K> {
36
+ }
37
+ /**
38
+ * Implemented by objects that wish to register dependencies in the container
39
+ * by creating resolvers.
40
+ * @public
41
+ */
42
+ export interface Registration<K = any> {
43
+ /**
44
+ * Creates a resolver for a desired dependency.
45
+ * @param container - The container to register the dependency within.
46
+ * @param key - The key to register dependency under, if overridden.
47
+ */
48
+ register(container: Container): Resolver<K>;
49
+ }
50
+ /**
51
+ * Transforms an object after it is created but before it is returned
52
+ * to the requestor.
53
+ * @public
54
+ */
55
+ export type Transformer<K> = (instance: Resolved<K>) => Resolved<K>;
56
+ /**
57
+ * Used by the default Resolver to create instances of objects when needed.
58
+ * @public
59
+ */
60
+ export interface Factory<T extends Constructable = any> {
61
+ /**
62
+ * The concrete type this factory creates.
63
+ */
64
+ readonly Type: T;
65
+ /**
66
+ * Registers a transformer function to alter the object after instantiation but before
67
+ * returning the final constructed instance.
68
+ * @param transformer - The transformer function.
69
+ */
70
+ registerTransformer(transformer: Transformer<T>): void;
71
+ /**
72
+ * Constructs an instance of the factory's object.
73
+ * @param container - The container the object is being constructor for.
74
+ * @param dynamicDependencies - Dynamic dependencies supplied to the constructor.
75
+ */
76
+ construct(container: Container, dynamicDependencies?: Key[]): Resolved<T>;
77
+ }
78
+ /**
79
+ * Implemented by objects capable of resolving services and other dependencies.
80
+ * @public
81
+ */
82
+ export interface ServiceLocator {
83
+ /**
84
+ * Determines whether the locator has the ability to provide an implementation
85
+ * for the requested key.
86
+ * @param key - The dependency key to lookup.
87
+ * @param searchAncestors - Indicates whether to search the entire hierarchy of service locators.
88
+ */
89
+ has<K extends Key>(key: K | Key, searchAncestors: boolean): boolean;
90
+ /**
91
+ * Gets a dependency by key.
92
+ * @param key - The key to lookup.
93
+ */
94
+ get<K extends Key>(key: K): Resolved<K>;
95
+ /**
96
+ * Gets a dependency by key.
97
+ * @param key - The key to lookup.
98
+ */
99
+ get<K extends Key>(key: Key): Resolved<K>;
100
+ /**
101
+ * Gets a dependency by key.
102
+ * @param key - The key to lookup.
103
+ */
104
+ get<K extends Key>(key: K | Key): Resolved<K>;
105
+ /**
106
+ * Gets an array of all dependencies by key.
107
+ * @param key - The key to lookup.
108
+ * @param searchAncestors - Indicates whether to search the entire hierarchy of service locators.
109
+ */
110
+ getAll<K extends Key>(key: K, searchAncestors?: boolean): readonly Resolved<K>[];
111
+ /**
112
+ * Gets an array of all dependencies by key.
113
+ * @param key - The key to lookup.
114
+ * @param searchAncestors - Indicates whether to search the entire hierarchy of service locators.
115
+ */
116
+ getAll<K extends Key>(key: Key, searchAncestors?: boolean): readonly Resolved<K>[];
117
+ /**
118
+ * Gets an array of all dependencies by key.
119
+ * @param key - The key to lookup.
120
+ * @param searchAncestors - Indicates whether to search the entire hierarchy of service locators.
121
+ */
122
+ getAll<K extends Key>(key: K | Key, searchAncestors?: boolean): readonly Resolved<K>[];
123
+ }
124
+ /**
125
+ * Implemented by objects that which to register dependencies in a container.
126
+ * @public
127
+ */
128
+ export interface Registry {
129
+ /**
130
+ * Registers dependencies in the specified container.
131
+ * @param container - The container to register dependencies in.
132
+ * @param params - Parameters that affect the registration process.
133
+ * @remarks
134
+ * If this registry doubles as a Registration, it should return a Resolver
135
+ * for the registered dependency.
136
+ */
137
+ register(container: Container, ...params: unknown[]): void | Resolver;
138
+ }
139
+ /**
140
+ * Implemented by dependency injection containers.
141
+ * @public
142
+ */
143
+ export interface Container extends ServiceLocator {
144
+ /**
145
+ * Registers dependencies with the container via registration objects.
146
+ * @param params - The registration objects.
147
+ */
148
+ register(...params: any[]): Container;
149
+ /**
150
+ * Registers dependencies with the container via registration objects, providing
151
+ * the specified context to each register invocation.
152
+ * @param context - The context object to pass to the registration objects.
153
+ * @param params - The registration objects.
154
+ */
155
+ registerWithContext(context: any, ...params: any[]): Container;
156
+ /**
157
+ * Registers a resolver with the container for the specified key.
158
+ * @param key - The key to register the resolver under.
159
+ * @param resolver - The resolver to register.
160
+ */
161
+ registerResolver<K extends Key, T = K>(key: K, resolver: Resolver<T>): Resolver<T>;
162
+ /**
163
+ * Registers a transformer with the container for the specified key.
164
+ * @param key - The key to resolved to register the transformer with.
165
+ * @param transformer - The transformer to register.
166
+ */
167
+ registerTransformer<K extends Key, T = K>(key: K, transformer: Transformer<T>): boolean;
168
+ /**
169
+ * Gets a resolver for the specified key.
170
+ * @param key - The key to get the resolver for.
171
+ * @param autoRegister - Indicates whether or not to try to auto-register a dependency for
172
+ * the key if one is not explicitly registered.
173
+ */
174
+ getResolver<K extends Key, T = K>(key: K | Key, autoRegister?: boolean): Resolver<T> | null;
175
+ /**
176
+ * Registers a factory with the container for the specified key.
177
+ * @param key - The key to register the factory under.
178
+ * @param factory - The factory to register.
179
+ */
180
+ registerFactory<T extends Constructable>(key: T, factory: Factory<T>): void;
181
+ /**
182
+ * Gets the factory for the specified key.
183
+ * @param key - The key to get the factory for.
184
+ */
185
+ getFactory<T extends Constructable>(key: T): Factory<T>;
186
+ /**
187
+ * Creates a child dependency injection container parented to this container.
188
+ * @param config - The configuration for the new container.
189
+ */
190
+ createChild(config?: Partial<Omit<ContainerConfiguration, "parentLocator">>): Container;
191
+ }
192
+ /**
193
+ * A utility class used that constructs and registers resolvers for a dependency
194
+ * injection container. Supports a standard set of object lifetimes.
195
+ * @public
196
+ */
197
+ export declare class ResolverBuilder<K> {
198
+ private container;
199
+ private key;
200
+ /**
201
+ *
202
+ * @param container - The container to create resolvers for.
203
+ * @param key - The key to register resolvers under.
204
+ */
205
+ constructor(container: Container, key: Key);
206
+ /**
207
+ * Creates a resolver for an existing object instance.
208
+ * @param value - The instance to resolve.
209
+ * @returns The resolver.
210
+ */
211
+ instance(value: K): Resolver<K>;
212
+ /**
213
+ * Creates a resolver that enforces a singleton lifetime.
214
+ * @param value - The type to create and cache the singleton for.
215
+ * @returns The resolver.
216
+ */
217
+ singleton(value: Constructable): Resolver<K>;
218
+ /**
219
+ * Creates a resolver that creates a new instance for every dependency request.
220
+ * @param value - The type to create instances of.
221
+ * @returns - The resolver.
222
+ */
223
+ transient(value: Constructable): Resolver<K>;
224
+ /**
225
+ * Creates a resolver that invokes a callback function for every dependency resolution
226
+ * request, allowing custom logic to return the dependency.
227
+ * @param value - The callback to call during resolution.
228
+ * @returns The resolver.
229
+ */
230
+ callback(value: ResolveCallback<K>): Resolver<K>;
231
+ /**
232
+ * Creates a resolver that invokes a callback function the first time that a dependency
233
+ * resolution is requested. The returned value is then cached and provided for all
234
+ * subsequent requests.
235
+ * @param value - The callback to call during the first resolution.
236
+ * @returns The resolver.
237
+ */
238
+ cachedCallback(value: ResolveCallback<K>): Resolver<K>;
239
+ /**
240
+ * Aliases the current key to a different key.
241
+ * @param destinationKey - The key to point the alias to.
242
+ * @returns The resolver.
243
+ */
244
+ aliasTo(destinationKey: Key): Resolver<K>;
245
+ private registerResolver;
246
+ }
247
+ /**
248
+ * Represents an object that can register itself.
249
+ * @public
250
+ */
251
+ export type RegisterSelf<T extends Constructable> = {
252
+ /**
253
+ * Registers itself with the container.
254
+ * @param container - The container to register with.
255
+ */
256
+ register(container: Container): Resolver<InstanceType<T>>;
257
+ /**
258
+ * Indicates whether during auto registration the object should be
259
+ * registered in the requesting container rather than the handling container.
260
+ */
261
+ registerInRequestor: boolean;
262
+ };
263
+ /**
264
+ * A key that is used to register dependencies with a dependency injection container.
265
+ * @public
266
+ */
267
+ export type Key = PropertyKey | object | InterfaceSymbol | Constructable | Resolver;
268
+ /**
269
+ * Represents something resolved from a service locator.
270
+ * @public
271
+ */
272
+ export type Resolved<K> = K extends InterfaceSymbol<infer T> ? T : K extends Constructable ? InstanceType<K> : K extends ResolverLike<any, infer T1> ? T1 extends Constructable ? InstanceType<T1> : T1 : K;
273
+ /**
274
+ * A class that declares constructor injected dependencies through
275
+ * a static "inject" field array of keys.
276
+ * @public
277
+ */
278
+ export type Injectable<T = {}> = Constructable<T> & {
279
+ inject?: Key[];
280
+ };
281
+ /**
282
+ * A function capable of locating the parent container based on a container's owner.
283
+ * @remarks
284
+ * A container owner is usually an HTMLElement instance.
285
+ * @public
286
+ */
287
+ export type ParentLocator = (owner: any) => Container | null;
288
+ /**
289
+ * Configuration for a dependency injection container.
290
+ * @public
291
+ */
292
+ export interface ContainerConfiguration {
293
+ /**
294
+ * The locator function used to find the parent of the container.
295
+ */
296
+ parentLocator: ParentLocator;
297
+ /**
298
+ * Indicates whether this container should resolve dependencies that are directly made
299
+ * by its owner. The default is "false" which results in the parent container being used.
300
+ */
301
+ responsibleForOwnerRequests: boolean;
302
+ /**
303
+ * Gets the default resolver to use during auto-registration.
304
+ * @param key - The key to register the dependency with.
305
+ * @param handler - The container that is handling the auto-registration request.
306
+ */
307
+ defaultResolver(key: Key, handler: Container): Resolver;
308
+ }
309
+ /**
310
+ * A set of default resolvers useful in configuring a container.
311
+ * @public
312
+ */
313
+ export declare const DefaultResolver: Readonly<{
314
+ /**
315
+ * Disables auto-registration and throws for all un-registered dependencies.
316
+ * @param key - The key to create the resolver for.
317
+ */
318
+ none(key: Key): Resolver;
319
+ /**
320
+ * Provides default singleton resolution behavior during auto-registration.
321
+ * @param key - The key to create the resolver for.
322
+ * @returns The resolver.
323
+ */
324
+ singleton(key: Key): Resolver;
325
+ /**
326
+ * Provides default transient resolution behavior during auto-registration.
327
+ * @param key - The key to create the resolver for.
328
+ * @returns The resolver.
329
+ */
330
+ transient(key: Key): Resolver;
331
+ }>;
332
+ /**
333
+ * Configuration for a dependency injection container.
334
+ * @public
335
+ */
336
+ export declare const ContainerConfiguration: Readonly<{
337
+ /**
338
+ * The default configuration used when creating a DOM-disconnected container.
339
+ * @remarks
340
+ * The default creates a root container, with no parent container. It does not handle
341
+ * owner requests and it uses singleton resolution behavior for auto-registration.
342
+ */
343
+ default: Readonly<ContainerConfiguration>;
344
+ }>;
345
+ /**
346
+ * Used to configure a dependency injection interface key.
347
+ * @public
348
+ */
349
+ export interface InterfaceConfiguration {
350
+ /**
351
+ * The friendly name for the interface. Useful for debugging.
352
+ */
353
+ friendlyName?: string;
354
+ /**
355
+ * When true, the dependency will be re-resolved when FASTElement connection changes.
356
+ * If the resolved value changes due to connection change, a {@link @ni/fast-element#Observable | notification }
357
+ * will be emitted for the property, with the previous and next values provided to any subscriber.
358
+ */
359
+ respectConnection?: boolean;
360
+ }
361
+ /**
362
+ * The gateway to dependency injection APIs.
363
+ * @public
364
+ */
365
+ export declare const DI: Readonly<{
366
+ /**
367
+ * Creates a new dependency injection container.
368
+ * @param config - The configuration for the container.
369
+ * @returns A newly created dependency injection container.
370
+ */
371
+ createContainer(config?: Partial<ContainerConfiguration>): Container;
372
+ /**
373
+ * Finds the dependency injection container responsible for providing dependencies
374
+ * to the specified node.
375
+ * @param node - The node to find the responsible container for.
376
+ * @returns The container responsible for providing dependencies to the node.
377
+ * @remarks
378
+ * This will be the same as the parent container if the specified node
379
+ * does not itself host a container configured with responsibleForOwnerRequests.
380
+ */
381
+ findResponsibleContainer(node: Node): Container;
382
+ /**
383
+ * Find the dependency injection container up the DOM tree from this node.
384
+ * @param node - The node to find the parent container for.
385
+ * @returns The parent container of this node.
386
+ * @remarks
387
+ * This will be the same as the responsible container if the specified node
388
+ * does not itself host a container configured with responsibleForOwnerRequests.
389
+ */
390
+ findParentContainer(node: Node): Container;
391
+ /**
392
+ * Returns a dependency injection container if one is explicitly owned by the specified
393
+ * node. If one is not owned, then a new container is created and assigned to the node.
394
+ * @param node - The node to find or create the container for.
395
+ * @param config - The configuration for the container if one needs to be created.
396
+ * @returns The located or created container.
397
+ * @remarks
398
+ * This API does not search for a responsible or parent container. It looks only for a container
399
+ * directly defined on the specified node and creates one at that location if one does not
400
+ * already exist.
401
+ */
402
+ getOrCreateDOMContainer(node?: Node, config?: Partial<Omit<ContainerConfiguration, "parentLocator">>): Container;
403
+ /**
404
+ * Gets the "design:paramtypes" metadata for the specified type.
405
+ * @param Type - The type to get the metadata for.
406
+ * @returns The metadata array or undefined if no metadata is found.
407
+ */
408
+ getDesignParamtypes: (Type: Constructable | Injectable) => readonly Key[] | undefined;
409
+ /**
410
+ * Gets the "di:paramtypes" metadata for the specified type.
411
+ * @param Type - The type to get the metadata for.
412
+ * @returns The metadata array or undefined if no metadata is found.
413
+ */
414
+ getAnnotationParamtypes: (Type: Constructable | Injectable) => readonly Key[] | undefined;
415
+ /**
416
+ *
417
+ * @param Type - Gets the "di:paramtypes" metadata for the specified type. If none is found,
418
+ * an empty metadata array is created and added.
419
+ * @returns The metadata array.
420
+ */
421
+ getOrCreateAnnotationParamTypes(Type: Constructable | Injectable): Key[];
422
+ /**
423
+ * Gets the dependency keys representing what is needed to instantiate the specified type.
424
+ * @param Type - The type to get the dependencies for.
425
+ * @returns An array of dependency keys.
426
+ */
427
+ getDependencies(Type: Constructable | Injectable): Key[];
428
+ /**
429
+ * Defines a property on a web component class. The value of this property will
430
+ * be resolved from the dependency injection container responsible for the element
431
+ * instance, based on where it is connected in the DOM.
432
+ * @param target - The target to define the property on.
433
+ * @param propertyName - The name of the property to define.
434
+ * @param key - The dependency injection key.
435
+ * @param respectConnection - Indicates whether or not to update the property value if the
436
+ * hosting component is disconnected and then re-connected at a different location in the DOM.
437
+ * @remarks
438
+ * The respectConnection option is only applicable to elements that descend from FASTElement.
439
+ */
440
+ defineProperty(target: {}, propertyName: string, key: Key, respectConnection?: boolean): void;
441
+ /**
442
+ * Creates a dependency injection key.
443
+ * @param nameConfigOrCallback - A friendly name for the key or a lambda that configures a
444
+ * default resolution for the dependency.
445
+ * @param configuror - If a friendly name was provided for the first parameter, then an optional
446
+ * lambda that configures a default resolution for the dependency can be provided second.
447
+ * @returns The created key.
448
+ * @remarks
449
+ * The created key can be used as a property decorator or constructor parameter decorator,
450
+ * in addition to its standard use in an inject array or through direct container APIs.
451
+ */
452
+ createInterface<K extends Key>(nameConfigOrCallback?: string | InterfaceConfiguration | ((builder: ResolverBuilder<K>) => Resolver<K>) | undefined, configuror?: ((builder: ResolverBuilder<K>) => Resolver<K>) | undefined): InterfaceSymbol<K>;
453
+ /**
454
+ * A decorator that specifies what to inject into its target.
455
+ * @param dependencies - The dependencies to inject.
456
+ * @returns The decorator to be applied to the target class.
457
+ * @remarks
458
+ * The decorator can be used to decorate a class, listing all of the classes dependencies.
459
+ * Or it can be used to decorate a constructor paramter, indicating what to inject for that
460
+ * parameter.
461
+ * Or it can be used for a web component property, indicating what that property should resolve to.
462
+ */
463
+ inject(...dependencies: Key[]): (target: any, key?: string | number, descriptor?: PropertyDescriptor | number) => void;
464
+ /**
465
+ * Registers the `target` class as a transient dependency; each time the dependency is resolved
466
+ * a new instance will be created.
467
+ *
468
+ * @param target - The class / constructor function to register as transient.
469
+ * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver.
470
+ *
471
+ * @example
472
+ * On an existing class
473
+ * ```ts
474
+ * class Foo { }
475
+ * DI.transient(Foo);
476
+ * ```
477
+ *
478
+ * @example
479
+ * Inline declaration
480
+ *
481
+ * ```ts
482
+ * const Foo = DI.transient(class { });
483
+ * // Foo is now strongly typed with register
484
+ * Foo.register(container);
485
+ * ```
486
+ *
487
+ * @public
488
+ */
489
+ transient<T extends Constructable<{}>>(target: T & Partial<RegisterSelf<T>>): T & RegisterSelf<T>;
490
+ /**
491
+ * Registers the `target` class as a singleton dependency; the class will only be created once. Each
492
+ * consecutive time the dependency is resolved, the same instance will be returned.
493
+ *
494
+ * @param target - The class / constructor function to register as a singleton.
495
+ * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver.
496
+ * @example
497
+ * On an existing class
498
+ * ```ts
499
+ * class Foo { }
500
+ * DI.singleton(Foo);
501
+ * ```
502
+ *
503
+ * @example
504
+ * Inline declaration
505
+ * ```ts
506
+ * const Foo = DI.singleton(class { });
507
+ * // Foo is now strongly typed with register
508
+ * Foo.register(container);
509
+ * ```
510
+ *
511
+ * @public
512
+ */
513
+ singleton<T_1 extends Constructable<{}>>(target: T_1 & Partial<RegisterSelf<T_1>>, options?: SingletonOptions): T_1 & RegisterSelf<T_1>;
514
+ }>;
515
+ /**
516
+ * The interface key that resolves the dependency injection container itself.
517
+ * @public
518
+ */
519
+ export declare const Container: InterfaceSymbol<Container>;
520
+ /**
521
+ * The interface key that resolves the service locator itself.
522
+ * @public
523
+ */
524
+ export declare const ServiceLocator: InterfaceSymbol<ServiceLocator>;
525
+ /**
526
+ * A decorator that specifies what to inject into its target.
527
+ * @param dependencies - The dependencies to inject.
528
+ * @returns The decorator to be applied to the target class.
529
+ * @remarks
530
+ * The decorator can be used to decorate a class, listing all of the classes dependencies.
531
+ * Or it can be used to decorate a constructor paramter, indicating what to inject for that
532
+ * parameter.
533
+ * Or it can be used for a web component property, indicating what that property should resolve to.
534
+ *
535
+ * @public
536
+ */
537
+ export declare const inject: (...dependencies: Key[]) => (target: any, key?: string | number, descriptor?: PropertyDescriptor | number) => void;
538
+ declare function transientDecorator<T extends Constructable>(target: T & Partial<RegisterSelf<T>>): T & RegisterSelf<T>;
539
+ /**
540
+ * Registers the decorated class as a transient dependency; each time the dependency is resolved
541
+ * a new instance will be created.
542
+ *
543
+ * @example
544
+ * ```ts
545
+ * @transient()
546
+ * class Foo { }
547
+ * ```
548
+ *
549
+ * @public
550
+ */
551
+ export declare function transient<T extends Constructable>(): typeof transientDecorator;
552
+ /**
553
+ * Registers the `target` class as a transient dependency; each time the dependency is resolved
554
+ * a new instance will be created.
555
+ *
556
+ * @param target - The class / constructor function to register as transient.
557
+ *
558
+ * @example
559
+ * ```ts
560
+ * @transient()
561
+ * class Foo { }
562
+ * ```
563
+ *
564
+ * @public
565
+ */
566
+ export declare function transient<T extends Constructable>(target: T & Partial<RegisterSelf<T>>): T & RegisterSelf<T>;
567
+ type SingletonOptions = {
568
+ scoped: boolean;
569
+ };
570
+ declare function singletonDecorator<T extends Constructable>(target: T & Partial<RegisterSelf<T>>): T & RegisterSelf<T>;
571
+ /**
572
+ * Registers the decorated class as a singleton dependency; the class will only be created once. Each
573
+ * consecutive time the dependency is resolved, the same instance will be returned.
574
+ *
575
+ * @example
576
+ * ```ts
577
+ * @singleton()
578
+ * class Foo { }
579
+ * ```
580
+ *
581
+ * @public
582
+ */
583
+ export declare function singleton<T extends Constructable>(): typeof singletonDecorator;
584
+ /**
585
+ * @public
586
+ */
587
+ export declare function singleton<T extends Constructable>(options?: SingletonOptions): typeof singletonDecorator;
588
+ /**
589
+ * Registers the `target` class as a singleton dependency; the class will only be created once. Each
590
+ * consecutive time the dependency is resolved, the same instance will be returned.
591
+ *
592
+ * @param target - The class / constructor function to register as a singleton.
593
+ *
594
+ * @example
595
+ * ```ts
596
+ * @singleton()
597
+ * class Foo { }
598
+ * ```
599
+ *
600
+ * @public
601
+ */
602
+ export declare function singleton<T extends Constructable>(target: T & Partial<RegisterSelf<T>>): T & RegisterSelf<T>;
603
+ /**
604
+ * A decorator and DI resolver that will resolve an array of all dependencies
605
+ * registered with the specified key.
606
+ * @param key - The key to resolve all dependencies for.
607
+ * @param searchAncestors - [optional] Indicates whether to search ancestor containers.
608
+ * @public
609
+ */
610
+ export declare const all: (key: any, searchAncestors?: boolean) => ReturnType<typeof DI.inject>;
611
+ /**
612
+ * A decorator that lazily injects a dependency depending on whether the `Key` is present at the time of function call.
613
+ *
614
+ * @example
615
+ * You need to make your argument a function that returns the type, for example
616
+ * ```ts
617
+ * class Foo {
618
+ * constructor( @lazy('random') public random: () => number )
619
+ * }
620
+ * const foo = container.get(Foo); // instanceof Foo
621
+ * foo.random(); // throws
622
+ * ```
623
+ * would throw an exception because you haven't registered `'random'` before calling the method.
624
+ * @example
625
+ * This, would give you a new 'Math.random()' number each time.
626
+ * ```ts
627
+ * class Foo {
628
+ * constructor( @lazy('random') public random: () => random )
629
+ * }
630
+ * container.register(Registration.callback('random', Math.random ));
631
+ * container.get(Foo).random(); // some random number
632
+ * container.get(Foo).random(); // another random number
633
+ * ```
634
+ *
635
+ * `@lazy` does not manage the lifecycle of the underlying key. If you want a singleton, you have to register as a
636
+ * `singleton`, `transient` would also behave as you would expect, providing you a new instance each time.
637
+ *
638
+ * @param key - The key to lazily resolve.
639
+ * see {@link DI.createInterface} on interactions with interfaces
640
+ *
641
+ * @public
642
+ */
643
+ export declare const lazy: (key: any) => any;
644
+ /**
645
+ * A decorator that allows you to optionally inject a dependency depending on whether the [[`Key`]] is present, for example:
646
+ * @example
647
+ * ```ts
648
+ * class Foo {
649
+ * constructor( @inject('mystring') public str: string = 'somestring' )
650
+ * }
651
+ * container.get(Foo); // throws
652
+ * ```
653
+ * would fail
654
+ *
655
+ * @example
656
+ * ```ts
657
+ * class Foo {
658
+ * constructor( @optional('mystring') public str: string = 'somestring' )
659
+ * }
660
+ * container.get(Foo).str // somestring
661
+ * ```
662
+ * if you use it without a default it will inject `undefined`, so remember to mark your input type as
663
+ * possibly `undefined`!
664
+ *
665
+ * @param key - The key to optionally resolve.
666
+ * see {@link DI.createInterface} on interactions with interfaces
667
+ *
668
+ * @public
669
+ */
670
+ export declare const optional: (key: any) => any;
671
+ /**
672
+ * A decorator that tells the container not to try to inject a dependency.
673
+ *
674
+ * @public
675
+ */
676
+ export declare function ignore(target: Injectable, property?: string | number, descriptor?: PropertyDescriptor | number): void;
677
+ /**
678
+ * A decorator that indicates that a new instance should be injected scoped to the
679
+ * container that requested the instance.
680
+ * @param key - The dependency key for the new instance.
681
+ * @remarks
682
+ * This creates a resolver with an instance strategy pointing to the new instance, effectively
683
+ * making this a singleton, scoped to the container or DOM's subtree.
684
+ *
685
+ * @public
686
+ */
687
+ export declare const newInstanceForScope: (key: any) => any;
688
+ /**
689
+ * A decorator that indicates that a new instance should be injected.
690
+ * @param key - The dependency key for the new instance.
691
+ * @remarks
692
+ * The instance is not internally cached with a resolver as newInstanceForScope does.
693
+ *
694
+ * @public
695
+ */
696
+ export declare const newInstanceOf: (key: any) => any;
697
+ /** @internal */
698
+ export declare const enum ResolverStrategy {
699
+ instance = 0,
700
+ singleton = 1,
701
+ transient = 2,
702
+ callback = 3,
703
+ array = 4,
704
+ alias = 5
705
+ }
706
+ /** @internal */
707
+ export declare class ResolverImpl implements Resolver, Registration {
708
+ key: Key;
709
+ strategy: ResolverStrategy;
710
+ state: any;
711
+ constructor(key: Key, strategy: ResolverStrategy, state: any);
712
+ get $isResolver(): true;
713
+ private resolving;
714
+ register(container: Container): Resolver;
715
+ resolve(handler: Container, requestor: Container): any;
716
+ getFactory(container: Container): Factory | null;
717
+ }
718
+ /** @internal */
719
+ export declare class FactoryImpl<T extends Constructable = any> implements Factory<T> {
720
+ Type: T;
721
+ private readonly dependencies;
722
+ private transformers;
723
+ constructor(Type: T, dependencies: Key[]);
724
+ construct(container: Container, dynamicDependencies?: Key[]): Resolved<T>;
725
+ registerTransformer(transformer: (instance: any) => any): void;
726
+ }
727
+ /**
728
+ * @internal
729
+ */
730
+ export declare class ContainerImpl implements Container {
731
+ protected owner: any;
732
+ protected config: ContainerConfiguration;
733
+ private _parent;
734
+ private registerDepth;
735
+ private resolvers;
736
+ private context;
737
+ get parent(): ContainerImpl | null;
738
+ get depth(): number;
739
+ get responsibleForOwnerRequests(): boolean;
740
+ constructor(owner: any, config: ContainerConfiguration);
741
+ registerWithContext(context: any, ...params: any[]): Container;
742
+ register(...params: any[]): Container;
743
+ registerResolver<K extends Key, T = K>(key: K, resolver: Resolver<T>): Resolver<T>;
744
+ registerTransformer<K extends Key, T = K>(key: K, transformer: Transformer<T>): boolean;
745
+ getResolver<K extends Key, T = K>(key: K | Key, autoRegister?: boolean): Resolver<T> | null;
746
+ has<K extends Key>(key: K, searchAncestors?: boolean): boolean;
747
+ get<K extends Key>(key: K): Resolved<K>;
748
+ getAll<K extends Key>(key: K, searchAncestors?: boolean): readonly Resolved<K>[];
749
+ getFactory<K extends Constructable>(Type: K): Factory<K>;
750
+ registerFactory<K extends Constructable>(key: K, factory: Factory<K>): void;
751
+ createChild(config?: Partial<Omit<ContainerConfiguration, "parentLocator">>): Container;
752
+ private jitRegister;
753
+ }
754
+ /**
755
+ * You can use the resulting Registration of any of the factory methods
756
+ * to register with the container.
757
+ *
758
+ * @example
759
+ * ```
760
+ * class Foo {}
761
+ * const container = DI.createContainer();
762
+ * container.register(Registration.instance(Foo, new Foo()));
763
+ * container.get(Foo);
764
+ * ```
765
+ *
766
+ * @public
767
+ */
768
+ export declare const Registration: Readonly<{
769
+ /**
770
+ * Allows you to pass an instance.
771
+ * Every time you request this {@link Key} you will get this instance back.
772
+ *
773
+ * @example
774
+ * ```
775
+ * Registration.instance(Foo, new Foo()));
776
+ * ```
777
+ *
778
+ * @param key - The key to register the instance under.
779
+ * @param value - The instance to return when the key is requested.
780
+ */
781
+ instance<T>(key: Key, value: T): Registration<T>;
782
+ /**
783
+ * Creates an instance from the class.
784
+ * Every time you request this {@link Key} you will get the same one back.
785
+ *
786
+ * @example
787
+ * ```
788
+ * Registration.singleton(Foo, Foo);
789
+ * ```
790
+ *
791
+ * @param key - The key to register the singleton under.
792
+ * @param value - The class to instantiate as a singleton when first requested.
793
+ */
794
+ singleton<T_1 extends Constructable<{}>>(key: Key, value: T_1): Registration<InstanceType<T_1>>;
795
+ /**
796
+ * Creates an instance from a class.
797
+ * Every time you request this {@link Key} you will get a new instance.
798
+ *
799
+ * @example
800
+ * ```
801
+ * Registration.instance(Foo, Foo);
802
+ * ```
803
+ *
804
+ * @param key - The key to register the instance type under.
805
+ * @param value - The class to instantiate each time the key is requested.
806
+ */
807
+ transient<T_2 extends Constructable<{}>>(key: Key, value: T_2): Registration<InstanceType<T_2>>;
808
+ /**
809
+ * Delegates to a callback function to provide the dependency.
810
+ * Every time you request this {@link Key} the callback will be invoked to provide
811
+ * the dependency.
812
+ *
813
+ * @example
814
+ * ```
815
+ * Registration.callback(Foo, () => new Foo());
816
+ * Registration.callback(Bar, (c: Container) => new Bar(c.get(Foo)));
817
+ * ```
818
+ *
819
+ * @param key - The key to register the callback for.
820
+ * @param callback - The function that is expected to return the dependency.
821
+ */
822
+ callback<T_3>(key: Key, callback: ResolveCallback<T_3>): Registration<Resolved<T_3>>;
823
+ /**
824
+ * Delegates to a callback function to provide the dependency and then caches the
825
+ * dependency for future requests.
826
+ *
827
+ * @example
828
+ * ```
829
+ * Registration.cachedCallback(Foo, () => new Foo());
830
+ * Registration.cachedCallback(Bar, (c: Container) => new Bar(c.get(Foo)));
831
+ * ```
832
+ *
833
+ * @param key - The key to register the callback for.
834
+ * @param callback - The function that is expected to return the dependency.
835
+ * @remarks
836
+ * If you pass the same Registration to another container, the same cached value will be used.
837
+ * Should all references to the resolver returned be removed, the cache will expire.
838
+ */
839
+ cachedCallback<T_4>(key: Key, callback: ResolveCallback<T_4>): Registration<Resolved<T_4>>;
840
+ /**
841
+ * Creates an alternate {@link Key} to retrieve an instance by.
842
+ *
843
+ * @example
844
+ * ```
845
+ * Register.singleton(Foo, Foo)
846
+ * Register.aliasTo(Foo, MyFoos);
847
+ *
848
+ * container.getAll(MyFoos) // contains an instance of Foo
849
+ * ```
850
+ *
851
+ * @param originalKey - The original key that has been registered.
852
+ * @param aliasKey - The alias to the original key.
853
+ */
854
+ aliasTo<T_5>(originalKey: T_5, aliasKey: Key): Registration<Resolved<T_5>>;
855
+ }>;
856
+ /** @internal */
857
+ export declare function validateKey(key: any): void;
858
+ export {};