lumen-plus 0.0.6 → 0.0.8

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 (335) hide show
  1. package/dist/components/Affix/Affix.svelte.d.ts +14 -0
  2. package/dist/components/Affix/index.d.ts +4 -0
  3. package/dist/components/Affix/types.d.ts +11 -0
  4. package/dist/components/Alert/Alert.svelte.d.ts +16 -0
  5. package/dist/components/Alert/index.d.ts +4 -0
  6. package/dist/components/Alert/types.d.ts +23 -0
  7. package/dist/components/Autocomplete/Autocomplete.svelte.d.ts +20 -0
  8. package/dist/components/Autocomplete/index.d.ts +3 -0
  9. package/dist/components/Avatar/Avatar.svelte.d.ts +14 -0
  10. package/dist/components/Avatar/index.d.ts +4 -0
  11. package/dist/components/Avatar/types.d.ts +26 -0
  12. package/dist/components/Backtop/Backtop.svelte.d.ts +13 -0
  13. package/dist/components/Backtop/index.d.ts +4 -0
  14. package/dist/components/Backtop/types.d.ts +18 -0
  15. package/dist/components/Badge/Badge.svelte.d.ts +13 -0
  16. package/dist/components/Badge/index.d.ts +4 -0
  17. package/dist/components/Badge/types.d.ts +20 -0
  18. package/dist/components/Breadcrumb/Breadcrumb.svelte.d.ts +6 -0
  19. package/dist/components/Breadcrumb/index.d.ts +4 -0
  20. package/dist/components/Breadcrumb/types.d.ts +10 -0
  21. package/dist/components/Button/Button.svelte.d.ts +4 -0
  22. package/dist/components/Button/index.d.ts +4 -0
  23. package/dist/components/Button/types.d.ts +42 -0
  24. package/dist/components/Calendar/Calendar.svelte.d.ts +7 -0
  25. package/dist/components/Calendar/index.d.ts +3 -0
  26. package/dist/components/Card/Card.svelte.d.ts +4 -0
  27. package/dist/components/Card/index.d.ts +4 -0
  28. package/dist/components/Card/types.d.ts +26 -0
  29. package/dist/components/Carousel/Carousel.svelte.d.ts +19 -0
  30. package/dist/components/Carousel/CarouselContext.d.ts +6 -0
  31. package/dist/components/Carousel/CarouselItem.svelte.d.ts +11 -0
  32. package/dist/components/Carousel/index.d.ts +5 -0
  33. package/dist/components/Carousel/types.d.ts +43 -0
  34. package/dist/components/Cascader/Cascader.svelte.d.ts +4 -0
  35. package/dist/components/Cascader/index.d.ts +4 -0
  36. package/dist/components/Cascader/types.d.ts +19 -0
  37. package/dist/components/Checkbox/Checkbox.svelte.d.ts +15 -0
  38. package/dist/components/Checkbox/index.d.ts +4 -0
  39. package/dist/components/Checkbox/types.d.ts +24 -0
  40. package/dist/components/Collapse/Collapse.svelte.d.ts +11 -0
  41. package/dist/components/Collapse/CollapseContext.d.ts +6 -0
  42. package/dist/components/Collapse/CollapseItem.svelte.d.ts +11 -0
  43. package/dist/components/Collapse/index.d.ts +5 -0
  44. package/dist/components/Collapse/types.d.ts +27 -0
  45. package/dist/components/ColorPicker/ColorPicker.svelte.d.ts +12 -0
  46. package/dist/components/ColorPicker/index.d.ts +4 -0
  47. package/dist/components/ColorPicker/types.d.ts +17 -0
  48. package/dist/components/Container/Aside.svelte.d.ts +9 -0
  49. package/dist/components/Container/Container.svelte.d.ts +9 -0
  50. package/dist/components/Container/Footer.svelte.d.ts +9 -0
  51. package/dist/components/Container/Header.svelte.d.ts +9 -0
  52. package/dist/components/Container/Main.svelte.d.ts +8 -0
  53. package/dist/components/Container/index.d.ts +6 -0
  54. package/dist/components/Container/types.d.ts +46 -0
  55. package/dist/components/DatePicker/DatePicker.svelte.d.ts +17 -0
  56. package/dist/components/DatePicker/index.d.ts +4 -0
  57. package/dist/components/DatePicker/types.d.ts +29 -0
  58. package/dist/components/DateTimePicker/DateTimePicker.svelte.d.ts +4 -0
  59. package/dist/components/DateTimePicker/index.d.ts +4 -0
  60. package/dist/components/DateTimePicker/types.d.ts +21 -0
  61. package/dist/components/Descriptions/Descriptions.svelte.d.ts +15 -0
  62. package/dist/components/Descriptions/DescriptionsContext.d.ts +8 -0
  63. package/dist/components/Descriptions/DescriptionsItem.svelte.d.ts +13 -0
  64. package/dist/components/Descriptions/index.d.ts +5 -0
  65. package/dist/components/Descriptions/types.d.ts +41 -0
  66. package/dist/components/Dialog/Dialog.svelte.d.ts +20 -0
  67. package/dist/components/Dialog/index.d.ts +4 -0
  68. package/dist/components/Dialog/types.d.ts +32 -0
  69. package/dist/components/Divider/Divider.svelte.d.ts +11 -0
  70. package/dist/components/Divider/index.d.ts +4 -0
  71. package/dist/components/Divider/types.d.ts +20 -0
  72. package/dist/components/Drawer/Drawer.svelte.d.ts +26 -0
  73. package/dist/components/Drawer/index.d.ts +4 -0
  74. package/dist/components/Drawer/types.d.ts +40 -0
  75. package/dist/components/Dropdown/Dropdown.svelte.d.ts +4 -0
  76. package/dist/components/Dropdown/DropdownContext.d.ts +7 -0
  77. package/dist/components/Dropdown/DropdownItem.svelte.d.ts +4 -0
  78. package/dist/components/Dropdown/DropdownMenu.svelte.d.ts +4 -0
  79. package/dist/components/Dropdown/index.d.ts +5 -0
  80. package/dist/components/Dropdown/types.d.ts +81 -0
  81. package/dist/components/Empty/Empty.svelte.d.ts +11 -0
  82. package/dist/components/Empty/index.d.ts +4 -0
  83. package/dist/components/Empty/types.d.ts +14 -0
  84. package/dist/components/Form/Form.svelte.d.ts +15 -0
  85. package/dist/components/Form/FormContext.d.ts +19 -0
  86. package/dist/components/Form/FormInternals.d.ts +40 -0
  87. package/dist/components/Form/FormItem.svelte.d.ts +8 -0
  88. package/dist/components/Form/index.d.ts +3 -0
  89. package/dist/components/Form/types.d.ts +61 -0
  90. package/dist/components/Icon/Icon.svelte.d.ts +11 -0
  91. package/dist/components/Icon/index.d.ts +5 -0
  92. package/dist/components/Icon/types.d.ts +14 -0
  93. package/dist/components/Image/Image.svelte.d.ts +20 -0
  94. package/dist/components/Image/index.d.ts +4 -0
  95. package/dist/components/Image/types.d.ts +32 -0
  96. package/dist/components/Input/Input.svelte.d.ts +4 -0
  97. package/dist/components/Input/index.d.ts +4 -0
  98. package/dist/components/Input/types.d.ts +72 -0
  99. package/dist/components/InputNumber/InputNumber.svelte.d.ts +18 -0
  100. package/dist/components/InputNumber/index.d.ts +4 -0
  101. package/dist/components/InputNumber/types.d.ts +29 -0
  102. package/dist/components/InputTag/InputTag.svelte.d.ts +4 -0
  103. package/dist/components/InputTag/index.d.ts +4 -0
  104. package/dist/components/InputTag/types.d.ts +21 -0
  105. package/dist/components/Link/Link.svelte.d.ts +15 -0
  106. package/dist/components/Link/index.d.ts +4 -0
  107. package/dist/components/Link/types.d.ts +26 -0
  108. package/dist/components/Loading/Loading.svelte.d.ts +14 -0
  109. package/dist/components/Loading/index.d.ts +4 -0
  110. package/dist/components/Loading/types.d.ts +20 -0
  111. package/dist/components/Menu/Menu.svelte.d.ts +4 -0
  112. package/dist/components/Menu/index.d.ts +4 -0
  113. package/dist/components/Menu/types.d.ts +18 -0
  114. package/dist/components/Message/MessageBox.svelte.d.ts +10 -0
  115. package/dist/components/Message/index.d.ts +15 -0
  116. package/dist/components/Message/types.d.ts +28 -0
  117. package/dist/components/MessageBox/MessageBox.svelte.d.ts +7 -0
  118. package/dist/components/MessageBox/index.d.ts +4 -0
  119. package/dist/components/MessageBox/types.d.ts +21 -0
  120. package/dist/components/Notification/Notification.svelte.d.ts +7 -0
  121. package/dist/components/Notification/index.d.ts +4 -0
  122. package/dist/components/Notification/types.d.ts +24 -0
  123. package/dist/components/Pagination/Pagination.svelte.d.ts +21 -0
  124. package/dist/components/Pagination/index.d.ts +4 -0
  125. package/dist/components/Pagination/types.d.ts +35 -0
  126. package/dist/components/PinInput/PinInput.svelte.d.ts +4 -0
  127. package/dist/components/PinInput/index.d.ts +4 -0
  128. package/dist/components/PinInput/types.d.ts +31 -0
  129. package/dist/components/Popconfirm/Popconfirm.svelte.d.ts +24 -0
  130. package/dist/components/Popconfirm/index.d.ts +4 -0
  131. package/dist/components/Popconfirm/types.d.ts +21 -0
  132. package/dist/components/Popover/Popover.svelte.d.ts +7 -0
  133. package/dist/components/Popover/index.d.ts +4 -0
  134. package/dist/components/Popover/types.d.ts +24 -0
  135. package/dist/components/Progress/Progress.svelte.d.ts +11 -0
  136. package/dist/components/Progress/index.d.ts +4 -0
  137. package/dist/components/Progress/types.d.ts +17 -0
  138. package/dist/components/Radio/Radio.svelte.d.ts +15 -0
  139. package/dist/components/Radio/index.d.ts +4 -0
  140. package/dist/components/Radio/types.d.ts +24 -0
  141. package/dist/components/Rating/Rating.svelte.d.ts +27 -0
  142. package/dist/components/Rating/index.d.ts +4 -0
  143. package/dist/components/Rating/types.d.ts +43 -0
  144. package/dist/components/Result/Result.svelte.d.ts +14 -0
  145. package/dist/components/Result/index.d.ts +4 -0
  146. package/dist/components/Result/types.d.ts +20 -0
  147. package/dist/components/Segmented/Segmented.svelte.d.ts +12 -0
  148. package/dist/components/Segmented/index.d.ts +4 -0
  149. package/dist/components/Segmented/types.d.ts +29 -0
  150. package/dist/components/Select/Select.svelte.d.ts +4 -0
  151. package/dist/components/Select/index.d.ts +4 -0
  152. package/dist/components/Select/types.d.ts +41 -0
  153. package/dist/components/Skeleton/Skeleton.svelte.d.ts +13 -0
  154. package/dist/components/Skeleton/SkeletonItem.svelte.d.ts +8 -0
  155. package/dist/components/Skeleton/index.d.ts +5 -0
  156. package/dist/components/Skeleton/types.d.ts +27 -0
  157. package/dist/components/Slider/Slider.svelte.d.ts +18 -0
  158. package/dist/components/Slider/index.d.ts +4 -0
  159. package/dist/components/Slider/types.d.ts +28 -0
  160. package/dist/components/Space/Space.svelte.d.ts +17 -0
  161. package/dist/components/Space/index.d.ts +4 -0
  162. package/dist/components/Space/types.d.ts +32 -0
  163. package/dist/components/Statistic/Countdown.svelte.d.ts +14 -0
  164. package/dist/components/Statistic/Statistic.svelte.d.ts +15 -0
  165. package/dist/components/Statistic/index.d.ts +5 -0
  166. package/dist/components/Statistic/types.d.ts +41 -0
  167. package/dist/components/Steps/Step.svelte.d.ts +14 -0
  168. package/dist/components/Steps/Steps.svelte.d.ts +15 -0
  169. package/dist/components/Steps/StepsContext.d.ts +12 -0
  170. package/dist/components/Steps/index.d.ts +5 -0
  171. package/dist/components/Steps/types.d.ts +41 -0
  172. package/dist/components/Switch/Switch.svelte.d.ts +22 -0
  173. package/dist/components/Switch/index.d.ts +4 -0
  174. package/dist/components/Switch/types.d.ts +37 -0
  175. package/dist/components/Table/Table.svelte.d.ts +11 -0
  176. package/dist/components/Table/index.d.ts +4 -0
  177. package/dist/components/Table/types.d.ts +180 -0
  178. package/dist/components/Tabs/TabPane.svelte.d.ts +13 -0
  179. package/dist/components/Tabs/Tabs.svelte.d.ts +13 -0
  180. package/dist/components/Tabs/TabsContext.d.ts +11 -0
  181. package/dist/components/Tabs/index.d.ts +3 -0
  182. package/dist/components/Tabs/types.d.ts +39 -0
  183. package/dist/components/Tag/Tag.svelte.d.ts +13 -0
  184. package/dist/components/Tag/index.d.ts +4 -0
  185. package/dist/components/Tag/types.d.ts +22 -0
  186. package/dist/components/Textarea/Textarea.svelte.d.ts +16 -0
  187. package/dist/components/Textarea/index.d.ts +4 -0
  188. package/dist/components/Textarea/types.d.ts +25 -0
  189. package/dist/components/TimePicker/TimePicker.svelte.d.ts +14 -0
  190. package/dist/components/TimePicker/index.d.ts +3 -0
  191. package/dist/components/Timeline/Timeline.svelte.d.ts +8 -0
  192. package/dist/components/Timeline/TimelineItem.svelte.d.ts +18 -0
  193. package/dist/components/Timeline/index.d.ts +5 -0
  194. package/dist/components/Timeline/types.d.ts +39 -0
  195. package/dist/components/Tooltip/OverflowTooltip.svelte.d.ts +4 -0
  196. package/dist/components/Tooltip/Tooltip.svelte.d.ts +16 -0
  197. package/dist/components/Tooltip/index.d.ts +6 -0
  198. package/dist/components/Tooltip/types.d.ts +51 -0
  199. package/dist/components/Transfer/Transfer.svelte.d.ts +14 -0
  200. package/dist/components/Transfer/index.d.ts +4 -0
  201. package/dist/components/Transfer/types.d.ts +16 -0
  202. package/dist/components/Tree/Tree.svelte.d.ts +17 -0
  203. package/dist/components/Tree/TreeNode.svelte.d.ts +19 -0
  204. package/dist/components/Tree/index.d.ts +4 -0
  205. package/dist/components/Tree/types.d.ts +65 -0
  206. package/dist/components/TreeSelect/TreeSelect.svelte.d.ts +4 -0
  207. package/dist/components/TreeSelect/index.d.ts +4 -0
  208. package/dist/components/TreeSelect/types.d.ts +98 -0
  209. package/dist/components/Upload/Upload.svelte.d.ts +28 -0
  210. package/dist/components/Upload/index.d.ts +4 -0
  211. package/dist/components/Upload/types.d.ts +67 -0
  212. package/dist/components/Watermark/Watermark.svelte.d.ts +20 -0
  213. package/dist/components/Watermark/index.d.ts +4 -0
  214. package/dist/components/Watermark/types.d.ts +32 -0
  215. package/dist/index.d.ts +80 -0
  216. package/dist/utils/index.d.ts +1 -0
  217. package/dist/utils/node_modules/svelte/action.d.ts +1 -0
  218. package/dist/utils/node_modules/svelte/animate.d.ts +1 -0
  219. package/dist/utils/node_modules/svelte/compiler.d.ts +1 -0
  220. package/dist/utils/node_modules/svelte/easing.d.ts +1 -0
  221. package/dist/utils/node_modules/svelte/elements.d.ts +2095 -0
  222. package/dist/utils/node_modules/svelte/index.d.ts +1 -0
  223. package/dist/utils/node_modules/svelte/legacy.d.ts +1 -0
  224. package/dist/utils/node_modules/svelte/motion.d.ts +1 -0
  225. package/dist/utils/node_modules/svelte/store.d.ts +1 -0
  226. package/dist/utils/node_modules/svelte/svelte-html.d.ts +245 -0
  227. package/dist/utils/node_modules/svelte/transition.d.ts +1 -0
  228. package/dist/utils/node_modules/svelte/types/compiler/interfaces.d.ts +1 -0
  229. package/dist/utils/node_modules/svelte/types/compiler/preprocess.d.ts +1 -0
  230. package/dist/utils/node_modules/svelte/types/index.d.ts +3706 -0
  231. package/dist/utils/node_modules/svelte/types/index.d.ts.map +280 -0
  232. package/dist/utils/node_modules/typescript/lib/lib.d.ts +22 -0
  233. package/dist/utils/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
  234. package/dist/utils/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
  235. package/dist/utils/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
  236. package/dist/utils/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
  237. package/dist/utils/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
  238. package/dist/utils/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
  239. package/dist/utils/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
  240. package/dist/utils/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
  241. package/dist/utils/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
  242. package/dist/utils/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
  243. package/dist/utils/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
  244. package/dist/utils/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
  245. package/dist/utils/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
  246. package/dist/utils/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
  247. package/dist/utils/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
  248. package/dist/utils/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
  249. package/dist/utils/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
  250. package/dist/utils/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
  251. package/dist/utils/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
  252. package/dist/utils/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
  253. package/dist/utils/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
  254. package/dist/utils/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
  255. package/dist/utils/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
  256. package/dist/utils/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
  257. package/dist/utils/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
  258. package/dist/utils/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
  259. package/dist/utils/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
  260. package/dist/utils/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
  261. package/dist/utils/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
  262. package/dist/utils/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
  263. package/dist/utils/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
  264. package/dist/utils/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
  265. package/dist/utils/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
  266. package/dist/utils/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
  267. package/dist/utils/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
  268. package/dist/utils/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
  269. package/dist/utils/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
  270. package/dist/utils/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
  271. package/dist/utils/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
  272. package/dist/utils/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
  273. package/dist/utils/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
  274. package/dist/utils/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
  275. package/dist/utils/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
  276. package/dist/utils/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
  277. package/dist/utils/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
  278. package/dist/utils/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
  279. package/dist/utils/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
  280. package/dist/utils/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
  281. package/dist/utils/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
  282. package/dist/utils/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
  283. package/dist/utils/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
  284. package/dist/utils/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
  285. package/dist/utils/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
  286. package/dist/utils/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
  287. package/dist/utils/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
  288. package/dist/utils/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
  289. package/dist/utils/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
  290. package/dist/utils/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
  291. package/dist/utils/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
  292. package/dist/utils/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
  293. package/dist/utils/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
  294. package/dist/utils/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
  295. package/dist/utils/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
  296. package/dist/utils/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
  297. package/dist/utils/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
  298. package/dist/utils/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
  299. package/dist/utils/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
  300. package/dist/utils/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
  301. package/dist/utils/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
  302. package/dist/utils/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
  303. package/dist/utils/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
  304. package/dist/utils/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
  305. package/dist/utils/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
  306. package/dist/utils/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
  307. package/dist/utils/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
  308. package/dist/utils/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
  309. package/dist/utils/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
  310. package/dist/utils/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
  311. package/dist/utils/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
  312. package/dist/utils/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
  313. package/dist/utils/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
  314. package/dist/utils/node_modules/typescript/lib/lib.es6.d.ts +23 -0
  315. package/dist/utils/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
  316. package/dist/utils/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
  317. package/dist/utils/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
  318. package/dist/utils/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
  319. package/dist/utils/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
  320. package/dist/utils/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
  321. package/dist/utils/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
  322. package/dist/utils/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
  323. package/dist/utils/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
  324. package/dist/utils/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
  325. package/dist/utils/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
  326. package/dist/utils/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
  327. package/dist/utils/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
  328. package/dist/utils/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
  329. package/dist/utils/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
  330. package/dist/utils/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
  331. package/dist/utils/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
  332. package/dist/utils/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
  333. package/dist/utils/node_modules/typescript/lib/typescript.d.ts +11437 -0
  334. package/dist/utils/transitions.d.ts +7 -0
  335. package/package.json +3 -4
@@ -0,0 +1,3706 @@
1
+ /// <reference types="esrap" />
2
+
3
+ declare module 'svelte' {
4
+ /**
5
+ * @deprecated In Svelte 4, components are classes. In Svelte 5, they are functions.
6
+ * Use `mount` instead to instantiate components.
7
+ * See [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes)
8
+ * for more info.
9
+ */
10
+ export interface ComponentConstructorOptions<
11
+ Props extends Record<string, any> = Record<string, any>
12
+ > {
13
+ target: Element | Document | ShadowRoot;
14
+ anchor?: Element;
15
+ props?: Props;
16
+ context?: Map<any, any>;
17
+ hydrate?: boolean;
18
+ intro?: boolean;
19
+ recover?: boolean;
20
+ sync?: boolean;
21
+ idPrefix?: string;
22
+ $$inline?: boolean;
23
+ }
24
+
25
+ /**
26
+ * Utility type for ensuring backwards compatibility on a type level that if there's a default slot, add 'children' to the props
27
+ */
28
+ type Properties<Props, Slots> = Props &
29
+ (Slots extends { default: any }
30
+ ? // This is unfortunate because it means "accepts no props" turns into "accepts any prop"
31
+ // but the alternative is non-fixable type errors because of the way TypeScript index
32
+ // signatures work (they will always take precedence and make an impossible-to-satisfy children type).
33
+ Props extends Record<string, never>
34
+ ? any
35
+ : { children?: any }
36
+ : {});
37
+
38
+ /**
39
+ * This was the base class for Svelte components in Svelte 4. Svelte 5+ components
40
+ * are completely different under the hood. For typing, use `Component` instead.
41
+ * To instantiate components, use `mount` instead.
42
+ * See [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes) for more info.
43
+ */
44
+ export class SvelteComponent<
45
+ Props extends Record<string, any> = Record<string, any>,
46
+ Events extends Record<string, any> = any,
47
+ Slots extends Record<string, any> = any
48
+ > {
49
+ /** The custom element version of the component. Only present if compiled with the `customElement` compiler option */
50
+ static element?: typeof HTMLElement;
51
+
52
+ [prop: string]: any;
53
+ /**
54
+ * @deprecated This constructor only exists when using the `asClassComponent` compatibility helper, which
55
+ * is a stop-gap solution. Migrate towards using `mount` instead. See
56
+ * [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes) for more info.
57
+ */
58
+ constructor(options: ComponentConstructorOptions<Properties<Props, Slots>>);
59
+ /**
60
+ * For type checking capabilities only.
61
+ * Does not exist at runtime.
62
+ * ### DO NOT USE!
63
+ */
64
+ $$prop_def: Props; // Without Properties: unnecessary, causes type bugs
65
+ /**
66
+ * For type checking capabilities only.
67
+ * Does not exist at runtime.
68
+ * ### DO NOT USE!
69
+ */
70
+ $$events_def: Events;
71
+ /**
72
+ * For type checking capabilities only.
73
+ * Does not exist at runtime.
74
+ * ### DO NOT USE!
75
+ */
76
+ $$slot_def: Slots;
77
+ /**
78
+ * For type checking capabilities only.
79
+ * Does not exist at runtime.
80
+ * ### DO NOT USE!
81
+ */
82
+ $$bindings?: string;
83
+
84
+ /**
85
+ * @deprecated This method only exists when using one of the legacy compatibility helpers, which
86
+ * is a stop-gap solution. See [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes)
87
+ * for more info.
88
+ */
89
+ $destroy(): void;
90
+
91
+ /**
92
+ * @deprecated This method only exists when using one of the legacy compatibility helpers, which
93
+ * is a stop-gap solution. See [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes)
94
+ * for more info.
95
+ */
96
+ $on<K extends Extract<keyof Events, string>>(
97
+ type: K,
98
+ callback: (e: Events[K]) => void
99
+ ): () => void;
100
+
101
+ /**
102
+ * @deprecated This method only exists when using one of the legacy compatibility helpers, which
103
+ * is a stop-gap solution. See [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes)
104
+ * for more info.
105
+ */
106
+ $set(props: Partial<Props>): void;
107
+ }
108
+
109
+ const brand: unique symbol;
110
+ type Brand<B> = { [brand]: B };
111
+ type Branded<T, B> = T & Brand<B>;
112
+
113
+ /**
114
+ * Internal implementation details that vary between environments
115
+ */
116
+ export type ComponentInternals = Branded<{}, 'ComponentInternals'>;
117
+
118
+ /**
119
+ * Can be used to create strongly typed Svelte components.
120
+ *
121
+ * #### Example:
122
+ *
123
+ * You have component library on npm called `component-library`, from which
124
+ * you export a component called `MyComponent`. For Svelte+TypeScript users,
125
+ * you want to provide typings. Therefore you create a `index.d.ts`:
126
+ * ```ts
127
+ * import type { Component } from 'svelte';
128
+ * export declare const MyComponent: Component<{ foo: string }> {}
129
+ * ```
130
+ * Typing this makes it possible for IDEs like VS Code with the Svelte extension
131
+ * to provide intellisense and to use the component like this in a Svelte file
132
+ * with TypeScript:
133
+ * ```svelte
134
+ * <script lang="ts">
135
+ * import { MyComponent } from "component-library";
136
+ * </script>
137
+ * <MyComponent foo={'bar'} />
138
+ * ```
139
+ */
140
+ export interface Component<
141
+ Props extends Record<string, any> = {},
142
+ Exports extends Record<string, any> = {},
143
+ Bindings extends keyof Props | '' = string
144
+ > {
145
+ /**
146
+ * @param internal An internal object used by Svelte. Do not use or modify.
147
+ * @param props The props passed to the component.
148
+ */
149
+ (
150
+ this: void,
151
+ internals: ComponentInternals,
152
+ props: Props
153
+ ): {
154
+ /**
155
+ * @deprecated This method only exists when using one of the legacy compatibility helpers, which
156
+ * is a stop-gap solution. See [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes)
157
+ * for more info.
158
+ */
159
+ $on?(type: string, callback: (e: any) => void): () => void;
160
+ /**
161
+ * @deprecated This method only exists when using one of the legacy compatibility helpers, which
162
+ * is a stop-gap solution. See [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes)
163
+ * for more info.
164
+ */
165
+ $set?(props: Partial<Props>): void;
166
+ } & Exports;
167
+ /** The custom element version of the component. Only present if compiled with the `customElement` compiler option */
168
+ element?: typeof HTMLElement;
169
+ /** Does not exist at runtime, for typing capabilities only. DO NOT USE */
170
+ z_$$bindings?: Bindings;
171
+ }
172
+
173
+ /**
174
+ * @deprecated Use `Component` instead. See [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes) for more information.
175
+ */
176
+ export class SvelteComponentTyped<
177
+ Props extends Record<string, any> = Record<string, any>,
178
+ Events extends Record<string, any> = any,
179
+ Slots extends Record<string, any> = any
180
+ > extends SvelteComponent<Props, Events, Slots> {}
181
+
182
+ /**
183
+ * @deprecated The new `Component` type does not have a dedicated Events type. Use `ComponentProps` instead.
184
+ *
185
+ * @description
186
+ * Convenience type to get the events the given component expects. Example:
187
+ * ```html
188
+ * <script lang="ts">
189
+ * import type { ComponentEvents } from 'svelte';
190
+ * import Component from './Component.svelte';
191
+ *
192
+ * function handleCloseEvent(event: ComponentEvents<Component>['close']) {
193
+ * console.log(event.detail);
194
+ * }
195
+ * </script>
196
+ *
197
+ * <Component on:close={handleCloseEvent} />
198
+ * ```
199
+ */
200
+ export type ComponentEvents<Comp extends SvelteComponent> =
201
+ Comp extends SvelteComponent<any, infer Events> ? Events : never;
202
+
203
+ /**
204
+ * Convenience type to get the props the given component expects.
205
+ *
206
+ * Example: Ensure a variable contains the props expected by `MyComponent`:
207
+ *
208
+ * ```ts
209
+ * import type { ComponentProps } from 'svelte';
210
+ * import MyComponent from './MyComponent.svelte';
211
+ *
212
+ * // Errors if these aren't the correct props expected by MyComponent.
213
+ * const props: ComponentProps<typeof MyComponent> = { foo: 'bar' };
214
+ * ```
215
+ *
216
+ * > [!NOTE] In Svelte 4, you would do `ComponentProps<MyComponent>` because `MyComponent` was a class.
217
+ *
218
+ * Example: A generic function that accepts some component and infers the type of its props:
219
+ *
220
+ * ```ts
221
+ * import type { Component, ComponentProps } from 'svelte';
222
+ * import MyComponent from './MyComponent.svelte';
223
+ *
224
+ * function withProps<TComponent extends Component<any>>(
225
+ * component: TComponent,
226
+ * props: ComponentProps<TComponent>
227
+ * ) {};
228
+ *
229
+ * // Errors if the second argument is not the correct props expected by the component in the first argument.
230
+ * withProps(MyComponent, { foo: 'bar' });
231
+ * ```
232
+ */
233
+ export type ComponentProps<Comp extends SvelteComponent | Component<any, any>> =
234
+ Comp extends SvelteComponent<infer Props>
235
+ ? Props
236
+ : Comp extends Component<infer Props, any>
237
+ ? Props
238
+ : never;
239
+
240
+ /**
241
+ * @deprecated This type is obsolete when working with the new `Component` type.
242
+ *
243
+ * @description
244
+ * Convenience type to get the type of a Svelte component. Useful for example in combination with
245
+ * dynamic components using `<svelte:component>`.
246
+ *
247
+ * Example:
248
+ * ```html
249
+ * <script lang="ts">
250
+ * import type { ComponentType, SvelteComponent } from 'svelte';
251
+ * import Component1 from './Component1.svelte';
252
+ * import Component2 from './Component2.svelte';
253
+ *
254
+ * const component: ComponentType = someLogic() ? Component1 : Component2;
255
+ * const componentOfCertainSubType: ComponentType<SvelteComponent<{ needsThisProp: string }>> = someLogic() ? Component1 : Component2;
256
+ * </script>
257
+ *
258
+ * <svelte:component this={component} />
259
+ * <svelte:component this={componentOfCertainSubType} needsThisProp="hello" />
260
+ * ```
261
+ */
262
+ export type ComponentType<Comp extends SvelteComponent = SvelteComponent> = (new (
263
+ options: ComponentConstructorOptions<
264
+ Comp extends SvelteComponent<infer Props> ? Props : Record<string, any>
265
+ >
266
+ ) => Comp) & {
267
+ /** The custom element version of the component. Only present if compiled with the `customElement` compiler option */
268
+ element?: typeof HTMLElement;
269
+ };
270
+
271
+ const SnippetReturn: unique symbol;
272
+
273
+ // Use an interface instead of a type, makes for better intellisense info because the type is named in more situations.
274
+ /**
275
+ * The type of a `#snippet` block. You can use it to (for example) express that your component expects a snippet of a certain type:
276
+ * ```ts
277
+ * let { banner }: { banner: Snippet<[{ text: string }]> } = $props();
278
+ * ```
279
+ * You can only call a snippet through the `{@render ...}` tag.
280
+ *
281
+ * See the [snippet documentation](https://svelte.dev/docs/svelte/snippet) for more info.
282
+ *
283
+ * @template Parameters the parameters that the snippet expects (if any) as a tuple.
284
+ */
285
+ export interface Snippet<Parameters extends unknown[] = []> {
286
+ (
287
+ this: void,
288
+ // this conditional allows tuples but not arrays. Arrays would indicate a
289
+ // rest parameter type, which is not supported. If rest parameters are added
290
+ // in the future, the condition can be removed.
291
+ ...args: number extends Parameters['length'] ? never : Parameters
292
+ ): {
293
+ '{@render ...} must be called with a Snippet': "import type { Snippet } from 'svelte'";
294
+ } & typeof SnippetReturn;
295
+ }
296
+
297
+ interface DispatchOptions {
298
+ cancelable?: boolean;
299
+ }
300
+
301
+ export interface EventDispatcher<EventMap extends Record<string, any>> {
302
+ // Implementation notes:
303
+ // - undefined extends X instead of X extends undefined makes this work better with both strict and nonstrict mode
304
+ // - | null | undefined is added for convenience, as they are equivalent for the custom event constructor (both result in a null detail)
305
+ <Type extends keyof EventMap>(
306
+ ...args: null extends EventMap[Type]
307
+ ? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions]
308
+ : undefined extends EventMap[Type]
309
+ ? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions]
310
+ : [type: Type, parameter: EventMap[Type], options?: DispatchOptions]
311
+ ): boolean;
312
+ }
313
+
314
+ /**
315
+ * Defines the options accepted by the `mount()` function.
316
+ */
317
+ export type MountOptions<Props extends Record<string, any> = Record<string, any>> = {
318
+ /**
319
+ * Target element where the component will be mounted.
320
+ */
321
+ target: Document | Element | ShadowRoot;
322
+ /**
323
+ * Optional node inside `target`. When specified, it is used to render the component immediately before it.
324
+ */
325
+ anchor?: Node;
326
+ /**
327
+ * Allows the specification of events.
328
+ * @deprecated Use callback props instead.
329
+ */
330
+ events?: Record<string, (e: any) => any>;
331
+ /**
332
+ * Can be accessed via `getContext()` at the component level.
333
+ */
334
+ context?: Map<any, any>;
335
+ /**
336
+ * Whether or not to play transitions on initial render.
337
+ * @default true
338
+ */
339
+ intro?: boolean;
340
+ } & ({} extends Props
341
+ ? {
342
+ /**
343
+ * Component properties.
344
+ */
345
+ props?: Props;
346
+ }
347
+ : {
348
+ /**
349
+ * Component properties.
350
+ */
351
+ props: Props;
352
+ });
353
+
354
+ /**
355
+ * Represents work that is happening off-screen, such as data being preloaded
356
+ * in anticipation of the user navigating
357
+ * @since 5.42
358
+ */
359
+ export interface Fork {
360
+ /**
361
+ * Commit the fork. The promise will resolve once the state change has been applied
362
+ */
363
+ commit(): Promise<void>;
364
+ /**
365
+ * Discard the fork
366
+ */
367
+ discard(): void;
368
+ }
369
+ /**
370
+ * Returns an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that aborts when the current [derived](https://svelte.dev/docs/svelte/$derived) or [effect](https://svelte.dev/docs/svelte/$effect) re-runs or is destroyed.
371
+ *
372
+ * Must be called while a derived or effect is running.
373
+ *
374
+ * ```svelte
375
+ * <script>
376
+ * import { getAbortSignal } from 'svelte';
377
+ *
378
+ * let { id } = $props();
379
+ *
380
+ * async function getData(id) {
381
+ * const response = await fetch(`/items/${id}`, {
382
+ * signal: getAbortSignal()
383
+ * });
384
+ *
385
+ * return await response.json();
386
+ * }
387
+ *
388
+ * const data = $derived(await getData(id));
389
+ * </script>
390
+ * ```
391
+ */
392
+ export function getAbortSignal(): AbortSignal;
393
+ /**
394
+ * `onMount`, like [`$effect`](https://svelte.dev/docs/svelte/$effect), schedules a function to run as soon as the component has been mounted to the DOM.
395
+ * Unlike `$effect`, the provided function only runs once.
396
+ *
397
+ * It must be called during the component's initialisation (but doesn't need to live _inside_ the component;
398
+ * it can be called from an external module). If a function is returned _synchronously_ from `onMount`,
399
+ * it will be called when the component is unmounted.
400
+ *
401
+ * `onMount` functions do not run during [server-side rendering](https://svelte.dev/docs/svelte/svelte-server#render).
402
+ *
403
+ * */
404
+ export function onMount<T>(fn: () => NotFunction<T> | Promise<NotFunction<T>> | (() => any)): void;
405
+ /**
406
+ * Schedules a callback to run immediately before the component is unmounted.
407
+ *
408
+ * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the
409
+ * only one that runs inside a server-side component.
410
+ *
411
+ * */
412
+ export function onDestroy(fn: () => any): void;
413
+ /**
414
+ * Creates an event dispatcher that can be used to dispatch [component events](https://svelte.dev/docs/svelte/legacy-on#Component-events).
415
+ * Event dispatchers are functions that can take two arguments: `name` and `detail`.
416
+ *
417
+ * Component events created with `createEventDispatcher` create a
418
+ * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).
419
+ * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).
420
+ * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)
421
+ * property and can contain any type of data.
422
+ *
423
+ * The event dispatcher can be typed to narrow the allowed event names and the type of the `detail` argument:
424
+ * ```ts
425
+ * const dispatch = createEventDispatcher<{
426
+ * loaded: null; // does not take a detail argument
427
+ * change: string; // takes a detail argument of type string, which is required
428
+ * optional: number | null; // takes an optional detail argument of type number
429
+ * }>();
430
+ * ```
431
+ *
432
+ * @deprecated Use callback props and/or the `$host()` rune instead — see [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Event-changes-Component-events)
433
+ * */
434
+ export function createEventDispatcher<EventMap extends Record<string, any> = any>(): EventDispatcher<EventMap>;
435
+ /**
436
+ * Schedules a callback to run immediately before the component is updated after any state change.
437
+ *
438
+ * The first time the callback runs will be before the initial `onMount`.
439
+ *
440
+ * In runes mode use `$effect.pre` instead.
441
+ *
442
+ * @deprecated Use [`$effect.pre`](https://svelte.dev/docs/svelte/$effect#$effect.pre) instead
443
+ * */
444
+ export function beforeUpdate(fn: () => void): void;
445
+ /**
446
+ * Schedules a callback to run immediately after the component has been updated.
447
+ *
448
+ * The first time the callback runs will be after the initial `onMount`.
449
+ *
450
+ * In runes mode use `$effect` instead.
451
+ *
452
+ * @deprecated Use [`$effect`](https://svelte.dev/docs/svelte/$effect) instead
453
+ * */
454
+ export function afterUpdate(fn: () => void): void;
455
+ export function hydratable<T>(key: string, fn: () => T): T;
456
+ /**
457
+ * Create a snippet programmatically
458
+ * */
459
+ export function createRawSnippet<Params extends unknown[]>(fn: (...params: Getters<Params>) => {
460
+ render: () => string;
461
+ setup?: (element: Element) => void | (() => void);
462
+ }): Snippet<Params>;
463
+ /** Anything except a function */
464
+ type NotFunction<T> = T extends Function ? never : T;
465
+ /**
466
+ * Synchronously flush any pending updates.
467
+ * Returns void if no callback is provided, otherwise returns the result of calling the callback.
468
+ * */
469
+ export function flushSync<T = void>(fn?: (() => T) | undefined): T;
470
+ /**
471
+ * Creates a 'fork', in which state changes are evaluated but not applied to the DOM.
472
+ * This is useful for speculatively loading data (for example) when you suspect that
473
+ * the user is about to take some action.
474
+ *
475
+ * Frameworks like SvelteKit can use this to preload data when the user touches or
476
+ * hovers over a link, making any subsequent navigation feel instantaneous.
477
+ *
478
+ * The `fn` parameter is a synchronous function that modifies some state. The
479
+ * state changes will be reverted after the fork is initialised, then reapplied
480
+ * if and when the fork is eventually committed.
481
+ *
482
+ * When it becomes clear that a fork will _not_ be committed (e.g. because the
483
+ * user navigated elsewhere), it must be discarded to avoid leaking memory.
484
+ *
485
+ * @since 5.42
486
+ */
487
+ export function fork(fn: () => void): Fork;
488
+ /**
489
+ * Returns a `[get, set]` pair of functions for working with context in a type-safe way.
490
+ *
491
+ * `get` will throw an error if no parent component called `set`.
492
+ *
493
+ * @since 5.40.0
494
+ */
495
+ export function createContext<T>(): [() => T, (context: T) => T];
496
+ /**
497
+ * Retrieves the context that belongs to the closest parent component with the specified `key`.
498
+ * Must be called during component initialisation.
499
+ *
500
+ * [`createContext`](https://svelte.dev/docs/svelte/svelte#createContext) is a type-safe alternative.
501
+ *
502
+ * */
503
+ export function getContext<T>(key: any): T;
504
+ /**
505
+ * Associates an arbitrary `context` object with the current component and the specified `key`
506
+ * and returns that object. The context is then available to children of the component
507
+ * (including slotted content) with `getContext`.
508
+ *
509
+ * Like lifecycle functions, this must be called during component initialisation.
510
+ *
511
+ * [`createContext`](https://svelte.dev/docs/svelte/svelte#createContext) is a type-safe alternative.
512
+ *
513
+ * */
514
+ export function setContext<T>(key: any, context: T): T;
515
+ /**
516
+ * Checks whether a given `key` has been set in the context of a parent component.
517
+ * Must be called during component initialisation.
518
+ *
519
+ * */
520
+ export function hasContext(key: any): boolean;
521
+ /**
522
+ * Retrieves the whole context map that belongs to the closest parent component.
523
+ * Must be called during component initialisation. Useful, for example, if you
524
+ * programmatically create a component and want to pass the existing context to it.
525
+ *
526
+ * */
527
+ export function getAllContexts<T extends Map<any, any> = Map<any, any>>(): T;
528
+ /**
529
+ * Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.
530
+ * Transitions will play during the initial render unless the `intro` option is set to `false`.
531
+ *
532
+ * */
533
+ export function mount<Props extends Record<string, any>, Exports extends Record<string, any>>(component: ComponentType<SvelteComponent<Props>> | Component<Props, Exports, any>, options: MountOptions<Props>): Exports;
534
+ /**
535
+ * Hydrates a component on the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component
536
+ *
537
+ * */
538
+ export function hydrate<Props extends Record<string, any>, Exports extends Record<string, any>>(component: ComponentType<SvelteComponent<Props>> | Component<Props, Exports, any>, options: {} extends Props ? {
539
+ target: Document | Element | ShadowRoot;
540
+ props?: Props;
541
+ events?: Record<string, (e: any) => any>;
542
+ context?: Map<any, any>;
543
+ intro?: boolean;
544
+ recover?: boolean;
545
+ } : {
546
+ target: Document | Element | ShadowRoot;
547
+ props: Props;
548
+ events?: Record<string, (e: any) => any>;
549
+ context?: Map<any, any>;
550
+ intro?: boolean;
551
+ recover?: boolean;
552
+ }): Exports;
553
+ /**
554
+ * Unmounts a component that was previously mounted using `mount` or `hydrate`.
555
+ *
556
+ * Since 5.13.0, if `options.outro` is `true`, [transitions](https://svelte.dev/docs/svelte/transition) will play before the component is removed from the DOM.
557
+ *
558
+ * Returns a `Promise` that resolves after transitions have completed if `options.outro` is true, or immediately otherwise (prior to 5.13.0, returns `void`).
559
+ *
560
+ * ```js
561
+ * import { mount, unmount } from 'svelte';
562
+ * import App from './App.svelte';
563
+ *
564
+ * const app = mount(App, { target: document.body });
565
+ *
566
+ * // later...
567
+ * unmount(app, { outro: true });
568
+ * ```
569
+ * */
570
+ export function unmount(component: Record<string, any>, options?: {
571
+ outro?: boolean;
572
+ } | undefined): Promise<void>;
573
+ /**
574
+ * Returns a promise that resolves once any pending state changes have been applied.
575
+ * */
576
+ export function tick(): Promise<void>;
577
+ /**
578
+ * Returns a promise that resolves once any state changes, and asynchronous work resulting from them,
579
+ * have resolved and the DOM has been updated
580
+ * @since 5.36
581
+ */
582
+ export function settled(): Promise<void>;
583
+ /**
584
+ * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),
585
+ * any state read inside `fn` will not be treated as a dependency.
586
+ *
587
+ * ```ts
588
+ * $effect(() => {
589
+ * // this will run when `data` changes, but not when `time` changes
590
+ * save(data, {
591
+ * timestamp: untrack(() => time)
592
+ * });
593
+ * });
594
+ * ```
595
+ * */
596
+ export function untrack<T>(fn: () => T): T;
597
+ type Getters<T> = {
598
+ [K in keyof T]: () => T[K];
599
+ };
600
+
601
+ export {};
602
+ }
603
+
604
+ declare module 'svelte/action' {
605
+ /**
606
+ * Actions can return an object containing the two properties defined in this interface. Both are optional.
607
+ * - update: An action can have a parameter. This method will be called whenever that parameter changes,
608
+ * immediately after Svelte has applied updates to the markup. `ActionReturn` and `ActionReturn<undefined>` both
609
+ * mean that the action accepts no parameters.
610
+ * - destroy: Method that is called after the element is unmounted
611
+ *
612
+ * Additionally, you can specify which additional attributes and events the action enables on the applied element.
613
+ * This applies to TypeScript typings only and has no effect at runtime.
614
+ *
615
+ * Example usage:
616
+ * ```ts
617
+ * interface Attributes {
618
+ * newprop?: string;
619
+ * 'on:event': (e: CustomEvent<boolean>) => void;
620
+ * }
621
+ *
622
+ * export function myAction(node: HTMLElement, parameter: Parameter): ActionReturn<Parameter, Attributes> {
623
+ * // ...
624
+ * return {
625
+ * update: (updatedParameter) => {...},
626
+ * destroy: () => {...}
627
+ * };
628
+ * }
629
+ * ```
630
+ */
631
+ export interface ActionReturn<
632
+ Parameter = undefined,
633
+ Attributes extends Record<string, any> = Record<never, any>
634
+ > {
635
+ update?: (parameter: Parameter) => void;
636
+ destroy?: () => void;
637
+ /**
638
+ * ### DO NOT USE THIS
639
+ * This exists solely for type-checking and has no effect at runtime.
640
+ * Set this through the `Attributes` generic instead.
641
+ */
642
+ $$_attributes?: Attributes;
643
+ }
644
+
645
+ /**
646
+ * Actions are functions that are called when an element is created.
647
+ * You can use this interface to type such actions.
648
+ * The following example defines an action that only works on `<div>` elements
649
+ * and optionally accepts a parameter which it has a default value for:
650
+ * ```ts
651
+ * export const myAction: Action<HTMLDivElement, { someProperty: boolean } | undefined> = (node, param = { someProperty: true }) => {
652
+ * // ...
653
+ * }
654
+ * ```
655
+ * `Action<HTMLDivElement>` and `Action<HTMLDivElement, undefined>` both signal that the action accepts no parameters.
656
+ *
657
+ * You can return an object with methods `update` and `destroy` from the function and type which additional attributes and events it has.
658
+ * See interface `ActionReturn` for more details.
659
+ */
660
+ export interface Action<
661
+ Element = HTMLElement,
662
+ Parameter = undefined,
663
+ Attributes extends Record<string, any> = Record<never, any>
664
+ > {
665
+ <Node extends Element>(
666
+ ...args: undefined extends Parameter
667
+ ? [node: Node, parameter?: Parameter]
668
+ : [node: Node, parameter: Parameter]
669
+ ): void | ActionReturn<Parameter, Attributes>;
670
+ }
671
+
672
+ // Implementation notes:
673
+ // - undefined extends X instead of X extends undefined makes this work better with both strict and nonstrict mode
674
+
675
+ export {};
676
+ }
677
+
678
+ declare module 'svelte/animate' {
679
+ // todo: same as Transition, should it be shared?
680
+ export interface AnimationConfig {
681
+ delay?: number;
682
+ duration?: number;
683
+ easing?: (t: number) => number;
684
+ css?: (t: number, u: number) => string;
685
+ tick?: (t: number, u: number) => void;
686
+ }
687
+
688
+ export interface FlipParams {
689
+ delay?: number;
690
+ duration?: number | ((len: number) => number);
691
+ easing?: (t: number) => number;
692
+ }
693
+ /**
694
+ * The flip function calculates the start and end position of an element and animates between them, translating the x and y values.
695
+ * `flip` stands for [First, Last, Invert, Play](https://aerotwist.com/blog/flip-your-animations/).
696
+ *
697
+ * */
698
+ export function flip(node: Element, { from, to }: {
699
+ from: DOMRect;
700
+ to: DOMRect;
701
+ }, params?: FlipParams): AnimationConfig;
702
+
703
+ export {};
704
+ }
705
+
706
+ declare module 'svelte/attachments' {
707
+ /**
708
+ * An [attachment](https://svelte.dev/docs/svelte/@attach) is a function that runs when an element is mounted
709
+ * to the DOM, and optionally returns a function that is called when the element is later removed.
710
+ *
711
+ * It can be attached to an element with an `{@attach ...}` tag, or by spreading an object containing
712
+ * a property created with [`createAttachmentKey`](https://svelte.dev/docs/svelte/svelte-attachments#createAttachmentKey).
713
+ */
714
+ export interface Attachment<T extends EventTarget = Element> {
715
+ (element: T): void | (() => void);
716
+ }
717
+ /**
718
+ * Creates an object key that will be recognised as an attachment when the object is spread onto an element,
719
+ * as a programmatic alternative to using `{@attach ...}`. This can be useful for library authors, though
720
+ * is generally not needed when building an app.
721
+ *
722
+ * ```svelte
723
+ * <script>
724
+ * import { createAttachmentKey } from 'svelte/attachments';
725
+ *
726
+ * const props = {
727
+ * class: 'cool',
728
+ * onclick: () => alert('clicked'),
729
+ * [createAttachmentKey()]: (node) => {
730
+ * node.textContent = 'attached!';
731
+ * }
732
+ * };
733
+ * </script>
734
+ *
735
+ * <button {...props}>click me</button>
736
+ * ```
737
+ * @since 5.29
738
+ */
739
+ export function createAttachmentKey(): symbol;
740
+ /**
741
+ * Converts an [action](https://svelte.dev/docs/svelte/use) into an [attachment](https://svelte.dev/docs/svelte/@attach) keeping the same behavior.
742
+ * It's useful if you want to start using attachments on components but you have actions provided by a library.
743
+ *
744
+ * Note that the second argument, if provided, must be a function that _returns_ the argument to the
745
+ * action function, not the argument itself.
746
+ *
747
+ * ```svelte
748
+ * <!-- with an action -->
749
+ * <div use:foo={bar}>...</div>
750
+ *
751
+ * <!-- with an attachment -->
752
+ * <div {@attach fromAction(foo, () => bar)}>...</div>
753
+ * ```
754
+ * */
755
+ export function fromAction<E extends EventTarget, T extends unknown>(action: Action<E, T> | ((element: E, arg: T) => void | ActionReturn<T>), fn: () => T): Attachment<E>;
756
+ /**
757
+ * Converts an [action](https://svelte.dev/docs/svelte/use) into an [attachment](https://svelte.dev/docs/svelte/@attach) keeping the same behavior.
758
+ * It's useful if you want to start using attachments on components but you have actions provided by a library.
759
+ *
760
+ * Note that the second argument, if provided, must be a function that _returns_ the argument to the
761
+ * action function, not the argument itself.
762
+ *
763
+ * ```svelte
764
+ * <!-- with an action -->
765
+ * <div use:foo={bar}>...</div>
766
+ *
767
+ * <!-- with an attachment -->
768
+ * <div {@attach fromAction(foo, () => bar)}>...</div>
769
+ * ```
770
+ * */
771
+ export function fromAction<E extends EventTarget>(action: Action<E, void> | ((element: E) => void | ActionReturn<void>)): Attachment<E>;
772
+ /**
773
+ * Actions can return an object containing the two properties defined in this interface. Both are optional.
774
+ * - update: An action can have a parameter. This method will be called whenever that parameter changes,
775
+ * immediately after Svelte has applied updates to the markup. `ActionReturn` and `ActionReturn<undefined>` both
776
+ * mean that the action accepts no parameters.
777
+ * - destroy: Method that is called after the element is unmounted
778
+ *
779
+ * Additionally, you can specify which additional attributes and events the action enables on the applied element.
780
+ * This applies to TypeScript typings only and has no effect at runtime.
781
+ *
782
+ * Example usage:
783
+ * ```ts
784
+ * interface Attributes {
785
+ * newprop?: string;
786
+ * 'on:event': (e: CustomEvent<boolean>) => void;
787
+ * }
788
+ *
789
+ * export function myAction(node: HTMLElement, parameter: Parameter): ActionReturn<Parameter, Attributes> {
790
+ * // ...
791
+ * return {
792
+ * update: (updatedParameter) => {...},
793
+ * destroy: () => {...}
794
+ * };
795
+ * }
796
+ * ```
797
+ */
798
+ interface ActionReturn<
799
+ Parameter = undefined,
800
+ Attributes extends Record<string, any> = Record<never, any>
801
+ > {
802
+ update?: (parameter: Parameter) => void;
803
+ destroy?: () => void;
804
+ /**
805
+ * ### DO NOT USE THIS
806
+ * This exists solely for type-checking and has no effect at runtime.
807
+ * Set this through the `Attributes` generic instead.
808
+ */
809
+ $$_attributes?: Attributes;
810
+ }
811
+
812
+ /**
813
+ * Actions are functions that are called when an element is created.
814
+ * You can use this interface to type such actions.
815
+ * The following example defines an action that only works on `<div>` elements
816
+ * and optionally accepts a parameter which it has a default value for:
817
+ * ```ts
818
+ * export const myAction: Action<HTMLDivElement, { someProperty: boolean } | undefined> = (node, param = { someProperty: true }) => {
819
+ * // ...
820
+ * }
821
+ * ```
822
+ * `Action<HTMLDivElement>` and `Action<HTMLDivElement, undefined>` both signal that the action accepts no parameters.
823
+ *
824
+ * You can return an object with methods `update` and `destroy` from the function and type which additional attributes and events it has.
825
+ * See interface `ActionReturn` for more details.
826
+ */
827
+ interface Action<
828
+ Element = HTMLElement,
829
+ Parameter = undefined,
830
+ Attributes extends Record<string, any> = Record<never, any>
831
+ > {
832
+ <Node extends Element>(
833
+ ...args: undefined extends Parameter
834
+ ? [node: Node, parameter?: Parameter]
835
+ : [node: Node, parameter: Parameter]
836
+ ): void | ActionReturn<Parameter, Attributes>;
837
+ }
838
+
839
+ // Implementation notes:
840
+ // - undefined extends X instead of X extends undefined makes this work better with both strict and nonstrict mode
841
+
842
+ export {};
843
+ }
844
+
845
+ declare module 'svelte/compiler' {
846
+ import type { SourceMap } from 'magic-string';
847
+ import type { ArrayExpression, ArrowFunctionExpression, VariableDeclaration, VariableDeclarator, Expression, Identifier, MemberExpression, Node, ObjectExpression, Pattern, Program, ChainExpression, SimpleCallExpression, SequenceExpression, SourceLocation } from 'estree';
848
+ import type { Location } from 'locate-character';
849
+ import type { default as ts } from 'esrap/languages/ts';
850
+ /**
851
+ * `compile` converts your `.svelte` source code into a JavaScript module that exports a component
852
+ *
853
+ * @param source The component source code
854
+ * @param options The compiler options
855
+ * */
856
+ export function compile(source: string, options: CompileOptions): CompileResult;
857
+ /**
858
+ * `compileModule` takes your JavaScript source code containing runes, and turns it into a JavaScript module.
859
+ *
860
+ * @param source The component source code
861
+ * */
862
+ export function compileModule(source: string, options: ModuleCompileOptions): CompileResult;
863
+ /**
864
+ * The parse function parses a component, returning only its abstract syntax tree.
865
+ *
866
+ * The `modern` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.
867
+ * `modern` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.
868
+ *
869
+ * */
870
+ export function parse(source: string, options: {
871
+ filename?: string;
872
+ modern: true;
873
+ loose?: boolean;
874
+ }): AST.Root;
875
+ /**
876
+ * The parse function parses a component, returning only its abstract syntax tree.
877
+ *
878
+ * The `modern` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.
879
+ * `modern` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.
880
+ *
881
+ * */
882
+ export function parse(source: string, options?: {
883
+ filename?: string;
884
+ modern?: false;
885
+ loose?: boolean;
886
+ } | undefined): Record<string, any>;
887
+ /**
888
+ * The parseCss function parses a CSS stylesheet, returning its abstract syntax tree.
889
+ *
890
+ * @param source The CSS source code
891
+ * */
892
+ export function parseCss(source: string): Omit<AST.CSS.StyleSheet, "attributes" | "content">;
893
+ /**
894
+ * @deprecated Replace this with `import { walk } from 'estree-walker'`
895
+ * */
896
+ export function walk(): never;
897
+ /**
898
+ * The result of a preprocessor run. If the preprocessor does not return a result, it is assumed that the code is unchanged.
899
+ */
900
+ export interface Processed {
901
+ /**
902
+ * The new code
903
+ */
904
+ code: string;
905
+ /**
906
+ * A source map mapping back to the original code
907
+ */
908
+ map?: string | object; // we are opaque with the type here to avoid dependency on the remapping module for our public types.
909
+ /**
910
+ * A list of additional files to watch for changes
911
+ */
912
+ dependencies?: string[];
913
+ /**
914
+ * Only for script/style preprocessors: The updated attributes to set on the tag. If undefined, attributes stay unchanged.
915
+ */
916
+ attributes?: Record<string, string | boolean>;
917
+ toString?: () => string;
918
+ }
919
+
920
+ /**
921
+ * A markup preprocessor that takes a string of code and returns a processed version.
922
+ */
923
+ export type MarkupPreprocessor = (options: {
924
+ /**
925
+ * The whole Svelte file content
926
+ */
927
+ content: string;
928
+ /**
929
+ * The filename of the Svelte file
930
+ */
931
+ filename?: string;
932
+ }) => Processed | void | Promise<Processed | void>;
933
+
934
+ /**
935
+ * A script/style preprocessor that takes a string of code and returns a processed version.
936
+ */
937
+ export type Preprocessor = (options: {
938
+ /**
939
+ * The script/style tag content
940
+ */
941
+ content: string;
942
+ /**
943
+ * The attributes on the script/style tag
944
+ */
945
+ attributes: Record<string, string | boolean>;
946
+ /**
947
+ * The whole Svelte file content
948
+ */
949
+ markup: string;
950
+ /**
951
+ * The filename of the Svelte file
952
+ */
953
+ filename?: string;
954
+ }) => Processed | void | Promise<Processed | void>;
955
+
956
+ /**
957
+ * A preprocessor group is a set of preprocessors that are applied to a Svelte file.
958
+ */
959
+ export interface PreprocessorGroup {
960
+ /** Name of the preprocessor. Will be a required option in the next major version */
961
+ name?: string;
962
+ markup?: MarkupPreprocessor;
963
+ style?: Preprocessor;
964
+ script?: Preprocessor;
965
+ }
966
+ /** The return value of `compile` from `svelte/compiler` */
967
+ export interface CompileResult {
968
+ /** The compiled JavaScript */
969
+ js: {
970
+ /** The generated code */
971
+ code: string;
972
+ /** A source map */
973
+ map: SourceMap;
974
+ };
975
+ /** The compiled CSS */
976
+ css: null | {
977
+ /** The generated code */
978
+ code: string;
979
+ /** A source map */
980
+ map: SourceMap;
981
+ /** Whether or not the CSS includes global rules */
982
+ hasGlobal: boolean;
983
+ };
984
+ /**
985
+ * An array of warning objects that were generated during compilation. Each warning has several properties:
986
+ * - `code` is a string identifying the category of warning
987
+ * - `message` describes the issue in human-readable terms
988
+ * - `start` and `end`, if the warning relates to a specific location, are objects with `line`, `column` and `character` properties
989
+ */
990
+ warnings: Warning[];
991
+ /**
992
+ * Metadata about the compiled component
993
+ */
994
+ metadata: {
995
+ /**
996
+ * Whether the file was compiled in runes mode, either because of an explicit option or inferred from usage.
997
+ * For `compileModule`, this is always `true`
998
+ */
999
+ runes: boolean;
1000
+ };
1001
+ /** The AST */
1002
+ ast: any;
1003
+ }
1004
+
1005
+ export interface Warning extends ICompileDiagnostic {}
1006
+
1007
+ export interface CompileError extends ICompileDiagnostic {}
1008
+
1009
+ type CssHashGetter = (args: {
1010
+ name: string;
1011
+ filename: string;
1012
+ css: string;
1013
+ hash: (input: string) => string;
1014
+ }) => string;
1015
+
1016
+ export interface CompileOptions extends ModuleCompileOptions {
1017
+ /**
1018
+ * Sets the name of the resulting JavaScript class (though the compiler will rename it if it would otherwise conflict with other variables in scope).
1019
+ * If unspecified, will be inferred from `filename`
1020
+ */
1021
+ name?: string;
1022
+ /**
1023
+ * If `true`, tells the compiler to generate a custom element constructor instead of a regular Svelte component.
1024
+ *
1025
+ * @default false
1026
+ */
1027
+ customElement?: boolean;
1028
+ /**
1029
+ * If `true`, getters and setters will be created for the component's props. If `false`, they will only be created for readonly exported values (i.e. those declared with `const`, `class` and `function`). If compiling with `customElement: true` this option defaults to `true`.
1030
+ *
1031
+ * @default false
1032
+ * @deprecated This will have no effect in runes mode
1033
+ */
1034
+ accessors?: boolean;
1035
+ /**
1036
+ * The namespace of the element; e.g., `"html"`, `"svg"`, `"mathml"`.
1037
+ *
1038
+ * @default 'html'
1039
+ */
1040
+ namespace?: Namespace;
1041
+ /**
1042
+ * If `true`, tells the compiler that you promise not to mutate any objects.
1043
+ * This allows it to be less conservative about checking whether values have changed.
1044
+ *
1045
+ * @default false
1046
+ * @deprecated This will have no effect in runes mode
1047
+ */
1048
+ immutable?: boolean;
1049
+ /**
1050
+ * - `'injected'`: styles will be included in the `head` when using `render(...)`, and injected into the document (if not already present) when the component mounts. For components compiled as custom elements, styles are injected to the shadow root.
1051
+ * - `'external'`: the CSS will only be returned in the `css` field of the compilation result. Most Svelte bundler plugins will set this to `'external'` and use the CSS that is statically generated for better performance, as it will result in smaller JavaScript bundles and the output can be served as cacheable `.css` files.
1052
+ * This is always `'injected'` when compiling with `customElement` mode.
1053
+ */
1054
+ css?: 'injected' | 'external';
1055
+ /**
1056
+ * A function that takes a `{ hash, css, name, filename }` argument and returns the string that is used as a classname for scoped CSS.
1057
+ * It defaults to returning `svelte-${hash(filename ?? css)}`.
1058
+ *
1059
+ * @default undefined
1060
+ */
1061
+ cssHash?: CssHashGetter;
1062
+ /**
1063
+ * If `true`, your HTML comments will be preserved in the output. By default, they are stripped out.
1064
+ *
1065
+ * @default false
1066
+ */
1067
+ preserveComments?: boolean;
1068
+ /**
1069
+ * If `true`, whitespace inside and between elements is kept as you typed it, rather than removed or collapsed to a single space where possible.
1070
+ *
1071
+ * @default false
1072
+ */
1073
+ preserveWhitespace?: boolean;
1074
+ /**
1075
+ * Which strategy to use when cloning DOM fragments:
1076
+ *
1077
+ * - `html` populates a `<template>` with `innerHTML` and clones it. This is faster, but cannot be used if your app's [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) includes [`require-trusted-types-for 'script'`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/require-trusted-types-for)
1078
+ * - `tree` creates the fragment one element at a time and _then_ clones it. This is slower, but works everywhere
1079
+ *
1080
+ * @default 'html'
1081
+ * @since 5.33
1082
+ */
1083
+ fragments?: 'html' | 'tree';
1084
+ /**
1085
+ * Set to `true` to force the compiler into runes mode, even if there are no indications of runes usage.
1086
+ * Set to `false` to force the compiler into ignoring runes, even if there are indications of runes usage.
1087
+ * Set to `undefined` (the default) to infer runes mode from the component code.
1088
+ * Is always `true` for JS/TS modules compiled with Svelte.
1089
+ * Will be `true` by default in Svelte 6.
1090
+ * Note that setting this to `true` in your `svelte.config.js` will force runes mode for your entire project, including components in `node_modules`,
1091
+ * which is likely not what you want. If you're using Vite, consider using [dynamicCompileOptions](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#dynamiccompileoptions) instead.
1092
+ * @default undefined
1093
+ */
1094
+ runes?: boolean | undefined;
1095
+ /**
1096
+ * If `true`, exposes the Svelte major version in the browser by adding it to a `Set` stored in the global `window.__svelte.v`.
1097
+ *
1098
+ * @default true
1099
+ */
1100
+ discloseVersion?: boolean;
1101
+ /**
1102
+ * @deprecated Use these only as a temporary solution before migrating your code
1103
+ */
1104
+ compatibility?: {
1105
+ /**
1106
+ * Applies a transformation so that the default export of Svelte files can still be instantiated the same way as in Svelte 4 —
1107
+ * as a class when compiling for the browser (as though using `createClassComponent(MyComponent, {...})` from `svelte/legacy`)
1108
+ * or as an object with a `.render(...)` method when compiling for the server
1109
+ * @default 5
1110
+ */
1111
+ componentApi?: 4 | 5;
1112
+ };
1113
+ /**
1114
+ * An initial sourcemap that will be merged into the final output sourcemap.
1115
+ * This is usually the preprocessor sourcemap.
1116
+ *
1117
+ * @default null
1118
+ */
1119
+ sourcemap?: object | string;
1120
+ /**
1121
+ * Used for your JavaScript sourcemap.
1122
+ *
1123
+ * @default null
1124
+ */
1125
+ outputFilename?: string;
1126
+ /**
1127
+ * Used for your CSS sourcemap.
1128
+ *
1129
+ * @default null
1130
+ */
1131
+ cssOutputFilename?: string;
1132
+ /**
1133
+ * If `true`, compiles components with hot reloading support.
1134
+ *
1135
+ * @default false
1136
+ */
1137
+ hmr?: boolean;
1138
+ /**
1139
+ * If `true`, returns the modern version of the AST.
1140
+ * Will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.
1141
+ *
1142
+ * @default false
1143
+ */
1144
+ modernAst?: boolean;
1145
+ }
1146
+
1147
+ export interface ModuleCompileOptions {
1148
+ /**
1149
+ * If `true`, causes extra code to be added that will perform runtime checks and provide debugging information during development.
1150
+ *
1151
+ * @default false
1152
+ */
1153
+ dev?: boolean;
1154
+ /**
1155
+ * If `"client"`, Svelte emits code designed to run in the browser.
1156
+ * If `"server"`, Svelte emits code suitable for server-side rendering.
1157
+ * If `false`, nothing is generated. Useful for tooling that is only interested in warnings.
1158
+ *
1159
+ * @default 'client'
1160
+ */
1161
+ generate?: 'client' | 'server' | false;
1162
+ /**
1163
+ * Used for debugging hints and sourcemaps. Your bundler plugin will set it automatically.
1164
+ */
1165
+ filename?: string;
1166
+ /**
1167
+ * Used for ensuring filenames don't leak filesystem information. Your bundler plugin will set it automatically.
1168
+ * @default process.cwd() on node-like environments, undefined elsewhere
1169
+ */
1170
+ rootDir?: string;
1171
+ /**
1172
+ * A function that gets a `Warning` as an argument and returns a boolean.
1173
+ * Use this to filter out warnings. Return `true` to keep the warning, `false` to discard it.
1174
+ */
1175
+ warningFilter?: (warning: Warning) => boolean;
1176
+ /**
1177
+ * Experimental options
1178
+ * @since 5.36
1179
+ */
1180
+ experimental?: {
1181
+ /**
1182
+ * Allow `await` keyword in deriveds, template expressions, and the top level of components
1183
+ * @since 5.36
1184
+ */
1185
+ async?: boolean;
1186
+ };
1187
+ }
1188
+ /**
1189
+ * - `html` — the default, for e.g. `<div>` or `<span>`
1190
+ * - `svg` — for e.g. `<svg>` or `<g>`
1191
+ * - `mathml` — for e.g. `<math>` or `<mrow>`
1192
+ */
1193
+ type Namespace = 'html' | 'svg' | 'mathml';
1194
+
1195
+ export namespace AST {
1196
+ export interface BaseNode {
1197
+ type: string;
1198
+ start: number;
1199
+ end: number;
1200
+ }
1201
+
1202
+ export interface Fragment {
1203
+ type: 'Fragment';
1204
+ nodes: Array<Text | Tag | ElementLike | Block | Comment>;
1205
+ }
1206
+
1207
+ export interface Root extends BaseNode {
1208
+ type: 'Root';
1209
+ /**
1210
+ * Inline options provided by `<svelte:options>` — these override options passed to `compile(...)`
1211
+ */
1212
+ options: SvelteOptions | null;
1213
+ fragment: Fragment;
1214
+ /** The parsed `<style>` element, if exists */
1215
+ css: AST.CSS.StyleSheet | null;
1216
+ /** The parsed `<script>` element, if exists */
1217
+ instance: Script | null;
1218
+ /** The parsed `<script module>` element, if exists */
1219
+ module: Script | null;
1220
+ /** Comments found in <script> and {expressions} */
1221
+ comments: JSComment[];
1222
+ }
1223
+
1224
+ export interface SvelteOptions {
1225
+ // start/end info (needed for warnings and for our Prettier plugin)
1226
+ start: number;
1227
+ end: number;
1228
+ // options
1229
+ runes?: boolean;
1230
+ immutable?: boolean;
1231
+ accessors?: boolean;
1232
+ preserveWhitespace?: boolean;
1233
+ namespace?: Namespace;
1234
+ css?: 'injected';
1235
+ customElement?: {
1236
+ tag?: string;
1237
+ shadow?: 'open' | 'none';
1238
+ props?: Record<
1239
+ string,
1240
+ {
1241
+ attribute?: string;
1242
+ reflect?: boolean;
1243
+ type?: 'Array' | 'Boolean' | 'Number' | 'Object' | 'String';
1244
+ }
1245
+ >;
1246
+ /**
1247
+ * Is of type
1248
+ * ```ts
1249
+ * (ceClass: new () => HTMLElement) => new () => HTMLElement
1250
+ * ```
1251
+ */
1252
+ extend?: ArrowFunctionExpression | Identifier;
1253
+ };
1254
+ attributes: Attribute[];
1255
+ }
1256
+
1257
+ /** Static text */
1258
+ export interface Text extends BaseNode {
1259
+ type: 'Text';
1260
+ /** Text with decoded HTML entities */
1261
+ data: string;
1262
+ /** The original text, with undecoded HTML entities */
1263
+ raw: string;
1264
+ }
1265
+
1266
+ /** A (possibly reactive) template expression — `{...}` */
1267
+ export interface ExpressionTag extends BaseNode {
1268
+ type: 'ExpressionTag';
1269
+ expression: Expression;
1270
+ }
1271
+
1272
+ /** A (possibly reactive) HTML template expression — `{@html ...}` */
1273
+ export interface HtmlTag extends BaseNode {
1274
+ type: 'HtmlTag';
1275
+ expression: Expression;
1276
+ }
1277
+
1278
+ /** An HTML comment */
1279
+ // TODO rename to disambiguate
1280
+ export interface Comment extends BaseNode {
1281
+ type: 'Comment';
1282
+ /** the contents of the comment */
1283
+ data: string;
1284
+ }
1285
+
1286
+ /** A `{@const ...}` tag */
1287
+ export interface ConstTag extends BaseNode {
1288
+ type: 'ConstTag';
1289
+ declaration: VariableDeclaration & {
1290
+ declarations: [VariableDeclarator & { id: Pattern; init: Expression }];
1291
+ };
1292
+ }
1293
+
1294
+ /** A `{@debug ...}` tag */
1295
+ export interface DebugTag extends BaseNode {
1296
+ type: 'DebugTag';
1297
+ identifiers: Identifier[];
1298
+ }
1299
+
1300
+ /** A `{@render foo(...)} tag */
1301
+ export interface RenderTag extends BaseNode {
1302
+ type: 'RenderTag';
1303
+ expression: SimpleCallExpression | (ChainExpression & { expression: SimpleCallExpression });
1304
+ }
1305
+
1306
+ /** A `{@attach foo(...)} tag */
1307
+ export interface AttachTag extends BaseNode {
1308
+ type: 'AttachTag';
1309
+ expression: Expression;
1310
+ }
1311
+
1312
+ /** An `animate:` directive */
1313
+ export interface AnimateDirective extends BaseAttribute {
1314
+ type: 'AnimateDirective';
1315
+ /** The 'x' in `animate:x` */
1316
+ name: string;
1317
+ /** The y in `animate:x={y}` */
1318
+ expression: null | Expression;
1319
+ }
1320
+
1321
+ /** A `bind:` directive */
1322
+ export interface BindDirective extends BaseAttribute {
1323
+ type: 'BindDirective';
1324
+ /** The 'x' in `bind:x` */
1325
+ name: string;
1326
+ /** The y in `bind:x={y}` */
1327
+ expression: Identifier | MemberExpression | SequenceExpression;
1328
+ }
1329
+
1330
+ /** A `class:` directive */
1331
+ export interface ClassDirective extends BaseAttribute {
1332
+ type: 'ClassDirective';
1333
+ /** The 'x' in `class:x` */
1334
+ name: 'class';
1335
+ /** The 'y' in `class:x={y}`, or the `x` in `class:x` */
1336
+ expression: Expression;
1337
+ }
1338
+
1339
+ /** A `let:` directive */
1340
+ export interface LetDirective extends BaseAttribute {
1341
+ type: 'LetDirective';
1342
+ /** The 'x' in `let:x` */
1343
+ name: string;
1344
+ /** The 'y' in `let:x={y}` */
1345
+ expression: null | Identifier | ArrayExpression | ObjectExpression;
1346
+ }
1347
+
1348
+ /** An `on:` directive */
1349
+ export interface OnDirective extends BaseAttribute {
1350
+ type: 'OnDirective';
1351
+ /** The 'x' in `on:x` */
1352
+ name: string;
1353
+ /** The 'y' in `on:x={y}` */
1354
+ expression: null | Expression;
1355
+ modifiers: Array<
1356
+ | 'capture'
1357
+ | 'nonpassive'
1358
+ | 'once'
1359
+ | 'passive'
1360
+ | 'preventDefault'
1361
+ | 'self'
1362
+ | 'stopImmediatePropagation'
1363
+ | 'stopPropagation'
1364
+ | 'trusted'
1365
+ >;
1366
+ }
1367
+
1368
+ /** A `style:` directive */
1369
+ export interface StyleDirective extends BaseAttribute {
1370
+ type: 'StyleDirective';
1371
+ /** The 'x' in `style:x` */
1372
+ name: string;
1373
+ /** The 'y' in `style:x={y}` */
1374
+ value: true | ExpressionTag | Array<ExpressionTag | Text>;
1375
+ modifiers: Array<'important'>;
1376
+ }
1377
+
1378
+ // TODO have separate in/out/transition directives
1379
+ /** A `transition:`, `in:` or `out:` directive */
1380
+ export interface TransitionDirective extends BaseAttribute {
1381
+ type: 'TransitionDirective';
1382
+ /** The 'x' in `transition:x` */
1383
+ name: string;
1384
+ /** The 'y' in `transition:x={y}` */
1385
+ expression: null | Expression;
1386
+ modifiers: Array<'local' | 'global'>;
1387
+ /** True if this is a `transition:` or `in:` directive */
1388
+ intro: boolean;
1389
+ /** True if this is a `transition:` or `out:` directive */
1390
+ outro: boolean;
1391
+ }
1392
+
1393
+ /** A `use:` directive */
1394
+ export interface UseDirective extends BaseAttribute {
1395
+ type: 'UseDirective';
1396
+ /** The 'x' in `use:x` */
1397
+ name: string;
1398
+ /** The 'y' in `use:x={y}` */
1399
+ expression: null | Expression;
1400
+ }
1401
+
1402
+ export interface BaseElement extends BaseNode {
1403
+ name: string;
1404
+ name_loc: SourceLocation;
1405
+ attributes: Array<Attribute | SpreadAttribute | Directive | AttachTag>;
1406
+ fragment: Fragment;
1407
+ }
1408
+
1409
+ export interface Component extends BaseElement {
1410
+ type: 'Component';
1411
+ }
1412
+
1413
+ export interface TitleElement extends BaseElement {
1414
+ type: 'TitleElement';
1415
+ name: 'title';
1416
+ }
1417
+
1418
+ export interface SlotElement extends BaseElement {
1419
+ type: 'SlotElement';
1420
+ name: 'slot';
1421
+ }
1422
+
1423
+ export interface RegularElement extends BaseElement {
1424
+ type: 'RegularElement';
1425
+ }
1426
+
1427
+ export interface SvelteBody extends BaseElement {
1428
+ type: 'SvelteBody';
1429
+ name: 'svelte:body';
1430
+ }
1431
+
1432
+ export interface SvelteComponent extends BaseElement {
1433
+ type: 'SvelteComponent';
1434
+ name: 'svelte:component';
1435
+ expression: Expression;
1436
+ }
1437
+
1438
+ export interface SvelteDocument extends BaseElement {
1439
+ type: 'SvelteDocument';
1440
+ name: 'svelte:document';
1441
+ }
1442
+
1443
+ export interface SvelteElement extends BaseElement {
1444
+ type: 'SvelteElement';
1445
+ name: 'svelte:element';
1446
+ tag: Expression;
1447
+ }
1448
+
1449
+ export interface SvelteFragment extends BaseElement {
1450
+ type: 'SvelteFragment';
1451
+ name: 'svelte:fragment';
1452
+ }
1453
+
1454
+ export interface SvelteBoundary extends BaseElement {
1455
+ type: 'SvelteBoundary';
1456
+ name: 'svelte:boundary';
1457
+ }
1458
+
1459
+ export interface SvelteHead extends BaseElement {
1460
+ type: 'SvelteHead';
1461
+ name: 'svelte:head';
1462
+ }
1463
+
1464
+ /** This is only an intermediate representation while parsing, it doesn't exist in the final AST */
1465
+ export interface SvelteOptionsRaw extends BaseElement {
1466
+ type: 'SvelteOptions';
1467
+ name: 'svelte:options';
1468
+ }
1469
+
1470
+ export interface SvelteSelf extends BaseElement {
1471
+ type: 'SvelteSelf';
1472
+ name: 'svelte:self';
1473
+ }
1474
+
1475
+ export interface SvelteWindow extends BaseElement {
1476
+ type: 'SvelteWindow';
1477
+ name: 'svelte:window';
1478
+ }
1479
+
1480
+ /** An `{#each ...}` block */
1481
+ export interface EachBlock extends BaseNode {
1482
+ type: 'EachBlock';
1483
+ expression: Expression;
1484
+ /** The `entry` in `{#each item as entry}`. `null` if `as` part is omitted */
1485
+ context: Pattern | null;
1486
+ body: Fragment;
1487
+ fallback?: Fragment;
1488
+ index?: string;
1489
+ key?: Expression;
1490
+ }
1491
+
1492
+ /** An `{#if ...}` block */
1493
+ export interface IfBlock extends BaseNode {
1494
+ type: 'IfBlock';
1495
+ elseif: boolean;
1496
+ test: Expression;
1497
+ consequent: Fragment;
1498
+ alternate: Fragment | null;
1499
+ }
1500
+
1501
+ /** An `{#await ...}` block */
1502
+ export interface AwaitBlock extends BaseNode {
1503
+ type: 'AwaitBlock';
1504
+ expression: Expression;
1505
+ // TODO can/should we move these inside the ThenBlock and CatchBlock?
1506
+ /** The resolved value inside the `then` block */
1507
+ value: Pattern | null;
1508
+ /** The rejection reason inside the `catch` block */
1509
+ error: Pattern | null;
1510
+ pending: Fragment | null;
1511
+ then: Fragment | null;
1512
+ catch: Fragment | null;
1513
+ }
1514
+
1515
+ export interface KeyBlock extends BaseNode {
1516
+ type: 'KeyBlock';
1517
+ expression: Expression;
1518
+ fragment: Fragment;
1519
+ }
1520
+
1521
+ export interface SnippetBlock extends BaseNode {
1522
+ type: 'SnippetBlock';
1523
+ expression: Identifier;
1524
+ parameters: Pattern[];
1525
+ typeParams?: string;
1526
+ body: Fragment;
1527
+ }
1528
+
1529
+ export interface BaseAttribute extends BaseNode {
1530
+ name: string;
1531
+ name_loc: SourceLocation | null;
1532
+ }
1533
+
1534
+ export interface Attribute extends BaseAttribute {
1535
+ type: 'Attribute';
1536
+ /**
1537
+ * Quoted/string values are represented by an array, even if they contain a single expression like `"{x}"`
1538
+ */
1539
+ value: true | ExpressionTag | Array<Text | ExpressionTag>;
1540
+ }
1541
+
1542
+ export interface SpreadAttribute extends BaseNode {
1543
+ type: 'SpreadAttribute';
1544
+ expression: Expression;
1545
+ }
1546
+
1547
+ export interface Script extends BaseNode {
1548
+ type: 'Script';
1549
+ context: 'default' | 'module';
1550
+ content: Program;
1551
+ attributes: Attribute[];
1552
+ }
1553
+
1554
+ export interface JSComment {
1555
+ type: 'Line' | 'Block';
1556
+ value: string;
1557
+ start: number;
1558
+ end: number;
1559
+ loc: {
1560
+ start: { line: number; column: number };
1561
+ end: { line: number; column: number };
1562
+ };
1563
+ }
1564
+
1565
+ export type AttributeLike = Attribute | SpreadAttribute | Directive;
1566
+
1567
+ export type Directive =
1568
+ | AST.AnimateDirective
1569
+ | AST.BindDirective
1570
+ | AST.ClassDirective
1571
+ | AST.LetDirective
1572
+ | AST.OnDirective
1573
+ | AST.StyleDirective
1574
+ | AST.TransitionDirective
1575
+ | AST.UseDirective;
1576
+
1577
+ export type Block =
1578
+ | AST.EachBlock
1579
+ | AST.IfBlock
1580
+ | AST.AwaitBlock
1581
+ | AST.KeyBlock
1582
+ | AST.SnippetBlock;
1583
+
1584
+ export type ElementLike =
1585
+ | AST.Component
1586
+ | AST.TitleElement
1587
+ | AST.SlotElement
1588
+ | AST.RegularElement
1589
+ | AST.SvelteBody
1590
+ | AST.SvelteBoundary
1591
+ | AST.SvelteComponent
1592
+ | AST.SvelteDocument
1593
+ | AST.SvelteElement
1594
+ | AST.SvelteFragment
1595
+ | AST.SvelteHead
1596
+ | AST.SvelteOptionsRaw
1597
+ | AST.SvelteSelf
1598
+ | AST.SvelteWindow
1599
+ | AST.SvelteBoundary;
1600
+
1601
+ export type Tag =
1602
+ | AST.AttachTag
1603
+ | AST.ConstTag
1604
+ | AST.DebugTag
1605
+ | AST.ExpressionTag
1606
+ | AST.HtmlTag
1607
+ | AST.RenderTag;
1608
+
1609
+ export type TemplateNode =
1610
+ | AST.Root
1611
+ | AST.Text
1612
+ | Tag
1613
+ | ElementLike
1614
+ | AST.Attribute
1615
+ | AST.SpreadAttribute
1616
+ | Directive
1617
+ | AST.AttachTag
1618
+ | AST.Comment
1619
+ | Block;
1620
+
1621
+ export type SvelteNode = Node | TemplateNode | AST.Fragment | _CSS.Node | Script;
1622
+
1623
+ export type { _CSS as CSS };
1624
+ }
1625
+ /**
1626
+ * The preprocess function provides convenient hooks for arbitrarily transforming component source code.
1627
+ * For example, it can be used to convert a `<style lang="sass">` block into vanilla CSS.
1628
+ *
1629
+ * */
1630
+ export function preprocess(source: string, preprocessor: PreprocessorGroup | PreprocessorGroup[], options?: {
1631
+ filename?: string;
1632
+ } | undefined): Promise<Processed>;
1633
+ /**
1634
+ * `print` converts a Svelte AST node back into Svelte source code.
1635
+ * It is primarily intended for tools that parse and transform components using the compiler’s modern AST representation.
1636
+ *
1637
+ * `print(ast)` requires an AST node produced by parse with modern: true, or any sub-node within that modern AST.
1638
+ * The result contains the generated source and a corresponding source map.
1639
+ * The output is valid Svelte, but formatting details such as whitespace or quoting may differ from the original.
1640
+ * */
1641
+ export function print(ast: AST.SvelteNode, options?: Options | undefined): {
1642
+ code: string;
1643
+ map: any;
1644
+ };
1645
+ /**
1646
+ * The current version, as set in package.json.
1647
+ * */
1648
+ export const VERSION: string;
1649
+ /**
1650
+ * Does a best-effort migration of Svelte code towards using runes, event attributes and render tags.
1651
+ * May throw an error if the code is too complex to migrate automatically.
1652
+ *
1653
+ * */
1654
+ export function migrate(source: string, { filename, use_ts }?: {
1655
+ filename?: string;
1656
+ use_ts?: boolean;
1657
+ } | undefined): {
1658
+ code: string;
1659
+ };
1660
+ type ICompileDiagnostic = {
1661
+ code: string;
1662
+ message: string;
1663
+ stack?: string;
1664
+ filename?: string;
1665
+ start?: Location;
1666
+ end?: Location;
1667
+ position?: [number, number];
1668
+ frame?: string;
1669
+ };
1670
+ namespace _CSS {
1671
+ export interface BaseNode {
1672
+ start: number;
1673
+ end: number;
1674
+ }
1675
+
1676
+ export interface StyleSheet extends BaseNode {
1677
+ type: 'StyleSheet';
1678
+ attributes: any[]; // TODO
1679
+ children: Array<Atrule | Rule>;
1680
+ content: {
1681
+ start: number;
1682
+ end: number;
1683
+ styles: string;
1684
+ /** Possible comment atop the style tag */
1685
+ comment: AST.Comment | null;
1686
+ };
1687
+ }
1688
+
1689
+ export interface Atrule extends BaseNode {
1690
+ type: 'Atrule';
1691
+ name: string;
1692
+ prelude: string;
1693
+ block: Block | null;
1694
+ }
1695
+
1696
+ export interface Rule extends BaseNode {
1697
+ type: 'Rule';
1698
+ prelude: SelectorList;
1699
+ block: Block;
1700
+ }
1701
+
1702
+ /**
1703
+ * A list of selectors, e.g. `a, b, c {}`
1704
+ */
1705
+ export interface SelectorList extends BaseNode {
1706
+ type: 'SelectorList';
1707
+ /**
1708
+ * The `a`, `b` and `c` in `a, b, c {}`
1709
+ */
1710
+ children: ComplexSelector[];
1711
+ }
1712
+
1713
+ /**
1714
+ * A complex selector, e.g. `a b c {}`
1715
+ */
1716
+ export interface ComplexSelector extends BaseNode {
1717
+ type: 'ComplexSelector';
1718
+ /**
1719
+ * The `a`, `b` and `c` in `a b c {}`
1720
+ */
1721
+ children: RelativeSelector[];
1722
+ }
1723
+
1724
+ /**
1725
+ * A relative selector, e.g the `a` and `> b` in `a > b {}`
1726
+ */
1727
+ export interface RelativeSelector extends BaseNode {
1728
+ type: 'RelativeSelector';
1729
+ /**
1730
+ * In `a > b`, `> b` forms one relative selector, and `>` is the combinator. `null` for the first selector.
1731
+ */
1732
+ combinator: null | Combinator;
1733
+ /**
1734
+ * The `b:is(...)` in `> b:is(...)`
1735
+ */
1736
+ selectors: SimpleSelector[];
1737
+ }
1738
+
1739
+ export interface TypeSelector extends BaseNode {
1740
+ type: 'TypeSelector';
1741
+ name: string;
1742
+ }
1743
+
1744
+ export interface IdSelector extends BaseNode {
1745
+ type: 'IdSelector';
1746
+ name: string;
1747
+ }
1748
+
1749
+ export interface ClassSelector extends BaseNode {
1750
+ type: 'ClassSelector';
1751
+ name: string;
1752
+ }
1753
+
1754
+ export interface AttributeSelector extends BaseNode {
1755
+ type: 'AttributeSelector';
1756
+ name: string;
1757
+ matcher: string | null;
1758
+ value: string | null;
1759
+ flags: string | null;
1760
+ }
1761
+
1762
+ export interface PseudoElementSelector extends BaseNode {
1763
+ type: 'PseudoElementSelector';
1764
+ name: string;
1765
+ }
1766
+
1767
+ export interface PseudoClassSelector extends BaseNode {
1768
+ type: 'PseudoClassSelector';
1769
+ name: string;
1770
+ args: SelectorList | null;
1771
+ }
1772
+
1773
+ export interface Percentage extends BaseNode {
1774
+ type: 'Percentage';
1775
+ value: string;
1776
+ }
1777
+
1778
+ export interface NestingSelector extends BaseNode {
1779
+ type: 'NestingSelector';
1780
+ name: '&';
1781
+ }
1782
+
1783
+ export interface Nth extends BaseNode {
1784
+ type: 'Nth';
1785
+ value: string;
1786
+ }
1787
+
1788
+ export type SimpleSelector =
1789
+ | TypeSelector
1790
+ | IdSelector
1791
+ | ClassSelector
1792
+ | AttributeSelector
1793
+ | PseudoElementSelector
1794
+ | PseudoClassSelector
1795
+ | Percentage
1796
+ | Nth
1797
+ | NestingSelector;
1798
+
1799
+ export interface Combinator extends BaseNode {
1800
+ type: 'Combinator';
1801
+ name: string;
1802
+ }
1803
+
1804
+ export interface Block extends BaseNode {
1805
+ type: 'Block';
1806
+ children: Array<Declaration | Rule | Atrule>;
1807
+ }
1808
+
1809
+ export interface Declaration extends BaseNode {
1810
+ type: 'Declaration';
1811
+ property: string;
1812
+ value: string;
1813
+ }
1814
+
1815
+ // for zimmerframe
1816
+ export type Node =
1817
+ | StyleSheet
1818
+ | Rule
1819
+ | Atrule
1820
+ | SelectorList
1821
+ | Block
1822
+ | ComplexSelector
1823
+ | RelativeSelector
1824
+ | Combinator
1825
+ | SimpleSelector
1826
+ | Declaration;
1827
+ }
1828
+ type Options = {
1829
+ getLeadingComments?: NonNullable<Parameters<typeof ts>[0]>['getLeadingComments'] | undefined;
1830
+ getTrailingComments?: NonNullable<Parameters<typeof ts>[0]>['getTrailingComments'] | undefined;
1831
+ };
1832
+
1833
+ export {};
1834
+ }
1835
+
1836
+ declare module 'svelte/easing' {
1837
+ export function linear(t: number): number;
1838
+
1839
+ export function backInOut(t: number): number;
1840
+
1841
+ export function backIn(t: number): number;
1842
+
1843
+ export function backOut(t: number): number;
1844
+
1845
+ export function bounceOut(t: number): number;
1846
+
1847
+ export function bounceInOut(t: number): number;
1848
+
1849
+ export function bounceIn(t: number): number;
1850
+
1851
+ export function circInOut(t: number): number;
1852
+
1853
+ export function circIn(t: number): number;
1854
+
1855
+ export function circOut(t: number): number;
1856
+
1857
+ export function cubicInOut(t: number): number;
1858
+
1859
+ export function cubicIn(t: number): number;
1860
+
1861
+ export function cubicOut(t: number): number;
1862
+
1863
+ export function elasticInOut(t: number): number;
1864
+
1865
+ export function elasticIn(t: number): number;
1866
+
1867
+ export function elasticOut(t: number): number;
1868
+
1869
+ export function expoInOut(t: number): number;
1870
+
1871
+ export function expoIn(t: number): number;
1872
+
1873
+ export function expoOut(t: number): number;
1874
+
1875
+ export function quadInOut(t: number): number;
1876
+
1877
+ export function quadIn(t: number): number;
1878
+
1879
+ export function quadOut(t: number): number;
1880
+
1881
+ export function quartInOut(t: number): number;
1882
+
1883
+ export function quartIn(t: number): number;
1884
+
1885
+ export function quartOut(t: number): number;
1886
+
1887
+ export function quintInOut(t: number): number;
1888
+
1889
+ export function quintIn(t: number): number;
1890
+
1891
+ export function quintOut(t: number): number;
1892
+
1893
+ export function sineInOut(t: number): number;
1894
+
1895
+ export function sineIn(t: number): number;
1896
+
1897
+ export function sineOut(t: number): number;
1898
+
1899
+ export {};
1900
+ }
1901
+
1902
+ declare module 'svelte/legacy' {
1903
+ import type { ComponentConstructorOptions, SvelteComponent, ComponentType, Component } from 'svelte';
1904
+ /**
1905
+ * Takes the same options as a Svelte 4 component and the component function and returns a Svelte 4 compatible component.
1906
+ *
1907
+ * @deprecated Use this only as a temporary solution to migrate your imperative component code to Svelte 5.
1908
+ *
1909
+ * */
1910
+ export function createClassComponent<Props extends Record<string, any>, Exports extends Record<string, any>, Events extends Record<string, any>, Slots extends Record<string, any>>(options: ComponentConstructorOptions<Props> & {
1911
+ component: ComponentType<SvelteComponent<Props, Events, Slots>> | Component<Props>;
1912
+ }): SvelteComponent<Props, Events, Slots> & Exports;
1913
+ /**
1914
+ * Takes the component function and returns a Svelte 4 compatible component constructor.
1915
+ *
1916
+ * @deprecated Use this only as a temporary solution to migrate your imperative component code to Svelte 5.
1917
+ *
1918
+ * */
1919
+ export function asClassComponent<Props extends Record<string, any>, Exports extends Record<string, any>, Events extends Record<string, any>, Slots extends Record<string, any>>(component: SvelteComponent<Props, Events, Slots> | Component<Props>): ComponentType<SvelteComponent<Props, Events, Slots> & Exports>;
1920
+ /**
1921
+ * Runs the given function once immediately on the server, and works like `$effect.pre` on the client.
1922
+ *
1923
+ * @deprecated Use this only as a temporary solution to migrate your component code to Svelte 5.
1924
+ * */
1925
+ export function run(fn: () => void | (() => void)): void;
1926
+ /**
1927
+ * Function to mimic the multiple listeners available in svelte 4
1928
+ * @deprecated
1929
+ * */
1930
+ export function handlers(...handlers: EventListener[]): EventListener;
1931
+ /**
1932
+ * Function to create a `bubble` function that mimic the behavior of `on:click` without handler available in svelte 4.
1933
+ * @deprecated Use this only as a temporary solution to migrate your automatically delegated events in Svelte 5.
1934
+ */
1935
+ export function createBubbler(): (type: string) => (event: Event) => boolean;
1936
+ /**
1937
+ * Support using the component as both a class and function during the transition period
1938
+ */
1939
+ export type LegacyComponentType = {
1940
+ new (o: ComponentConstructorOptions): SvelteComponent;
1941
+ (...args: Parameters<Component<Record<string, any>>>): ReturnType<Component<Record<string, any>, Record<string, any>>>;
1942
+ };
1943
+ /**
1944
+ * Substitute for the `trusted` event modifier
1945
+ * @deprecated
1946
+ * */
1947
+ export function trusted(fn: (event: Event, ...args: Array<unknown>) => void): (event: Event, ...args: unknown[]) => void;
1948
+ /**
1949
+ * Substitute for the `self` event modifier
1950
+ * @deprecated
1951
+ * */
1952
+ export function self(fn: (event: Event, ...args: Array<unknown>) => void): (event: Event, ...args: unknown[]) => void;
1953
+ /**
1954
+ * Substitute for the `stopPropagation` event modifier
1955
+ * @deprecated
1956
+ * */
1957
+ export function stopPropagation(fn: (event: Event, ...args: Array<unknown>) => void): (event: Event, ...args: unknown[]) => void;
1958
+ /**
1959
+ * Substitute for the `once` event modifier
1960
+ * @deprecated
1961
+ * */
1962
+ export function once(fn: (event: Event, ...args: Array<unknown>) => void): (event: Event, ...args: unknown[]) => void;
1963
+ /**
1964
+ * Substitute for the `stopImmediatePropagation` event modifier
1965
+ * @deprecated
1966
+ * */
1967
+ export function stopImmediatePropagation(fn: (event: Event, ...args: Array<unknown>) => void): (event: Event, ...args: unknown[]) => void;
1968
+ /**
1969
+ * Substitute for the `preventDefault` event modifier
1970
+ * @deprecated
1971
+ * */
1972
+ export function preventDefault(fn: (event: Event, ...args: Array<unknown>) => void): (event: Event, ...args: unknown[]) => void;
1973
+ /**
1974
+ * Substitute for the `passive` event modifier, implemented as an action
1975
+ * @deprecated
1976
+ * */
1977
+ export function passive(node: HTMLElement, [event, handler]: [event: string, handler: () => EventListener]): void;
1978
+ /**
1979
+ * Substitute for the `nonpassive` event modifier, implemented as an action
1980
+ * @deprecated
1981
+ * */
1982
+ export function nonpassive(node: HTMLElement, [event, handler]: [event: string, handler: () => EventListener]): void;
1983
+
1984
+ export {};
1985
+ }
1986
+
1987
+ declare module 'svelte/motion' {
1988
+ import type { MediaQuery } from 'svelte/reactivity';
1989
+ // TODO we do declaration merging here in order to not have a breaking change (renaming the Spring interface)
1990
+ // this means both the Spring class and the Spring interface are merged into one with some things only
1991
+ // existing on one side. In Svelte 6, remove the type definition and move the jsdoc onto the class in spring.js
1992
+
1993
+ export interface Spring<T> extends Readable<T> {
1994
+ set(new_value: T, opts?: SpringUpdateOpts): Promise<void>;
1995
+ /**
1996
+ * @deprecated Only exists on the legacy `spring` store, not the `Spring` class
1997
+ */
1998
+ update: (fn: Updater<T>, opts?: SpringUpdateOpts) => Promise<void>;
1999
+ /**
2000
+ * @deprecated Only exists on the legacy `spring` store, not the `Spring` class
2001
+ */
2002
+ subscribe(fn: (value: T) => void): Unsubscriber;
2003
+ precision: number;
2004
+ damping: number;
2005
+ stiffness: number;
2006
+ }
2007
+
2008
+ /**
2009
+ * A wrapper for a value that behaves in a spring-like fashion. Changes to `spring.target` will cause `spring.current` to
2010
+ * move towards it over time, taking account of the `spring.stiffness` and `spring.damping` parameters.
2011
+ *
2012
+ * ```svelte
2013
+ * <script>
2014
+ * import { Spring } from 'svelte/motion';
2015
+ *
2016
+ * const spring = new Spring(0);
2017
+ * </script>
2018
+ *
2019
+ * <input type="range" bind:value={spring.target} />
2020
+ * <input type="range" bind:value={spring.current} disabled />
2021
+ * ```
2022
+ * @since 5.8.0
2023
+ */
2024
+ export class Spring<T> {
2025
+ constructor(value: T, options?: SpringOpts);
2026
+
2027
+ /**
2028
+ * Create a spring whose value is bound to the return value of `fn`. This must be called
2029
+ * inside an effect root (for example, during component initialisation).
2030
+ *
2031
+ * ```svelte
2032
+ * <script>
2033
+ * import { Spring } from 'svelte/motion';
2034
+ *
2035
+ * let { number } = $props();
2036
+ *
2037
+ * const spring = Spring.of(() => number);
2038
+ * </script>
2039
+ * ```
2040
+ */
2041
+ static of<U>(fn: () => U, options?: SpringOpts): Spring<U>;
2042
+
2043
+ /**
2044
+ * Sets `spring.target` to `value` and returns a `Promise` that resolves if and when `spring.current` catches up to it.
2045
+ *
2046
+ * If `options.instant` is `true`, `spring.current` immediately matches `spring.target`.
2047
+ *
2048
+ * If `options.preserveMomentum` is provided, the spring will continue on its current trajectory for
2049
+ * the specified number of milliseconds. This is useful for things like 'fling' gestures.
2050
+ */
2051
+ set(value: T, options?: SpringUpdateOpts): Promise<void>;
2052
+
2053
+ damping: number;
2054
+ precision: number;
2055
+ stiffness: number;
2056
+ /**
2057
+ * The end value of the spring.
2058
+ * This property only exists on the `Spring` class, not the legacy `spring` store.
2059
+ */
2060
+ target: T;
2061
+ /**
2062
+ * The current value of the spring.
2063
+ * This property only exists on the `Spring` class, not the legacy `spring` store.
2064
+ */
2065
+ get current(): T;
2066
+ }
2067
+
2068
+ export interface Tweened<T> extends Readable<T> {
2069
+ set(value: T, opts?: TweenedOptions<T>): Promise<void>;
2070
+ update(updater: Updater<T>, opts?: TweenedOptions<T>): Promise<void>;
2071
+ }
2072
+ /** Callback to inform of a value updates. */
2073
+ type Subscriber<T> = (value: T) => void;
2074
+
2075
+ /** Unsubscribes from value updates. */
2076
+ type Unsubscriber = () => void;
2077
+
2078
+ /** Readable interface for subscribing. */
2079
+ interface Readable<T> {
2080
+ /**
2081
+ * Subscribe on value changes.
2082
+ * @param run subscription callback
2083
+ * @param invalidate cleanup callback
2084
+ */
2085
+ subscribe(this: void, run: Subscriber<T>, invalidate?: () => void): Unsubscriber;
2086
+ }
2087
+ interface SpringOpts {
2088
+ stiffness?: number;
2089
+ damping?: number;
2090
+ precision?: number;
2091
+ }
2092
+
2093
+ interface SpringUpdateOpts {
2094
+ /**
2095
+ * @deprecated Only use this for the spring store; does nothing when set on the Spring class
2096
+ */
2097
+ hard?: any;
2098
+ /**
2099
+ * @deprecated Only use this for the spring store; does nothing when set on the Spring class
2100
+ */
2101
+ soft?: string | number | boolean;
2102
+ /**
2103
+ * Only use this for the Spring class; does nothing when set on the spring store
2104
+ */
2105
+ instant?: boolean;
2106
+ /**
2107
+ * Only use this for the Spring class; does nothing when set on the spring store
2108
+ */
2109
+ preserveMomentum?: number;
2110
+ }
2111
+
2112
+ type Updater<T> = (target_value: T, value: T) => T;
2113
+
2114
+ interface TweenedOptions<T> {
2115
+ delay?: number;
2116
+ duration?: number | ((from: T, to: T) => number);
2117
+ easing?: (t: number) => number;
2118
+ interpolate?: (a: T, b: T) => (t: number) => T;
2119
+ }
2120
+ /**
2121
+ * A [media query](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery) that matches if the user [prefers reduced motion](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion).
2122
+ *
2123
+ * ```svelte
2124
+ * <script>
2125
+ * import { prefersReducedMotion } from 'svelte/motion';
2126
+ * import { fly } from 'svelte/transition';
2127
+ *
2128
+ * let visible = $state(false);
2129
+ * </script>
2130
+ *
2131
+ * <button onclick={() => visible = !visible}>
2132
+ * toggle
2133
+ * </button>
2134
+ *
2135
+ * {#if visible}
2136
+ * <p transition:fly={{ y: prefersReducedMotion.current ? 0 : 200 }}>
2137
+ * flies in, unless the user prefers reduced motion
2138
+ * </p>
2139
+ * {/if}
2140
+ * ```
2141
+ * @since 5.7.0
2142
+ */
2143
+ export const prefersReducedMotion: MediaQuery;
2144
+ /**
2145
+ * The spring function in Svelte creates a store whose value is animated, with a motion that simulates the behavior of a spring. This means when the value changes, instead of transitioning at a steady rate, it "bounces" like a spring would, depending on the physics parameters provided. This adds a level of realism to the transitions and can enhance the user experience.
2146
+ *
2147
+ * @deprecated Use [`Spring`](https://svelte.dev/docs/svelte/svelte-motion#Spring) instead
2148
+ * */
2149
+ export function spring<T = any>(value?: T | undefined, opts?: SpringOpts | undefined): Spring<T>;
2150
+ /**
2151
+ * A tweened store in Svelte is a special type of store that provides smooth transitions between state values over time.
2152
+ *
2153
+ * @deprecated Use [`Tween`](https://svelte.dev/docs/svelte/svelte-motion#Tween) instead
2154
+ * */
2155
+ export function tweened<T>(value?: T | undefined, defaults?: TweenedOptions<T> | undefined): Tweened<T>;
2156
+ /**
2157
+ * A wrapper for a value that tweens smoothly to its target value. Changes to `tween.target` will cause `tween.current` to
2158
+ * move towards it over time, taking account of the `delay`, `duration` and `easing` options.
2159
+ *
2160
+ * ```svelte
2161
+ * <script>
2162
+ * import { Tween } from 'svelte/motion';
2163
+ *
2164
+ * const tween = new Tween(0);
2165
+ * </script>
2166
+ *
2167
+ * <input type="range" bind:value={tween.target} />
2168
+ * <input type="range" bind:value={tween.current} disabled />
2169
+ * ```
2170
+ * @since 5.8.0
2171
+ */
2172
+ export class Tween<T> {
2173
+ /**
2174
+ * Create a tween whose value is bound to the return value of `fn`. This must be called
2175
+ * inside an effect root (for example, during component initialisation).
2176
+ *
2177
+ * ```svelte
2178
+ * <script>
2179
+ * import { Tween } from 'svelte/motion';
2180
+ *
2181
+ * let { number } = $props();
2182
+ *
2183
+ * const tween = Tween.of(() => number);
2184
+ * </script>
2185
+ * ```
2186
+ *
2187
+ */
2188
+ static of<U>(fn: () => U, options?: TweenedOptions<U> | undefined): Tween<U>;
2189
+
2190
+ constructor(value: T, options?: TweenedOptions<T>);
2191
+ /**
2192
+ * Sets `tween.target` to `value` and returns a `Promise` that resolves if and when `tween.current` catches up to it.
2193
+ *
2194
+ * If `options` are provided, they will override the tween's defaults.
2195
+ * */
2196
+ set(value: T, options?: TweenedOptions<T> | undefined): Promise<void>;
2197
+ get current(): T;
2198
+ set target(v: T);
2199
+ get target(): T;
2200
+ #private;
2201
+ }
2202
+
2203
+ export {};
2204
+ }
2205
+
2206
+ declare module 'svelte/reactivity' {
2207
+ /**
2208
+ * A reactive version of the built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) object.
2209
+ * Reading the date (whether with methods like `date.getTime()` or `date.toString()`, or via things like [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat))
2210
+ * in an [effect](https://svelte.dev/docs/svelte/$effect) or [derived](https://svelte.dev/docs/svelte/$derived)
2211
+ * will cause it to be re-evaluated when the value of the date changes.
2212
+ *
2213
+ * ```svelte
2214
+ * <script>
2215
+ * import { SvelteDate } from 'svelte/reactivity';
2216
+ *
2217
+ * const date = new SvelteDate();
2218
+ *
2219
+ * const formatter = new Intl.DateTimeFormat(undefined, {
2220
+ * hour: 'numeric',
2221
+ * minute: 'numeric',
2222
+ * second: 'numeric'
2223
+ * });
2224
+ *
2225
+ * $effect(() => {
2226
+ * const interval = setInterval(() => {
2227
+ * date.setTime(Date.now());
2228
+ * }, 1000);
2229
+ *
2230
+ * return () => {
2231
+ * clearInterval(interval);
2232
+ * };
2233
+ * });
2234
+ * </script>
2235
+ *
2236
+ * <p>The time is {formatter.format(date)}</p>
2237
+ * ```
2238
+ */
2239
+ export class SvelteDate extends Date {
2240
+
2241
+ constructor(...params: any[]);
2242
+ #private;
2243
+ }
2244
+ /**
2245
+ * A reactive version of the built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) object.
2246
+ * Reading contents of the set (by iterating, or by reading `set.size` or calling `set.has(...)` as in the [example](https://svelte.dev/playground/53438b51194b4882bcc18cddf9f96f15) below) in an [effect](https://svelte.dev/docs/svelte/$effect) or [derived](https://svelte.dev/docs/svelte/$derived)
2247
+ * will cause it to be re-evaluated as necessary when the set is updated.
2248
+ *
2249
+ * Note that values in a reactive set are _not_ made [deeply reactive](https://svelte.dev/docs/svelte/$state#Deep-state).
2250
+ *
2251
+ * ```svelte
2252
+ * <script>
2253
+ * import { SvelteSet } from 'svelte/reactivity';
2254
+ * let monkeys = new SvelteSet();
2255
+ *
2256
+ * function toggle(monkey) {
2257
+ * if (monkeys.has(monkey)) {
2258
+ * monkeys.delete(monkey);
2259
+ * } else {
2260
+ * monkeys.add(monkey);
2261
+ * }
2262
+ * }
2263
+ * </script>
2264
+ *
2265
+ * {#each ['🙈', '🙉', '🙊'] as monkey}
2266
+ * <button onclick={() => toggle(monkey)}>{monkey}</button>
2267
+ * {/each}
2268
+ *
2269
+ * <button onclick={() => monkeys.clear()}>clear</button>
2270
+ *
2271
+ * {#if monkeys.has('🙈')}<p>see no evil</p>{/if}
2272
+ * {#if monkeys.has('🙉')}<p>hear no evil</p>{/if}
2273
+ * {#if monkeys.has('🙊')}<p>speak no evil</p>{/if}
2274
+ * ```
2275
+ *
2276
+ *
2277
+ */
2278
+ export class SvelteSet<T> extends Set<T> {
2279
+
2280
+ constructor(value?: Iterable<T> | null | undefined);
2281
+
2282
+ add(value: T): this;
2283
+ #private;
2284
+ }
2285
+ /**
2286
+ * A reactive version of the built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) object.
2287
+ * Reading contents of the map (by iterating, or by reading `map.size` or calling `map.get(...)` or `map.has(...)` as in the [tic-tac-toe example](https://svelte.dev/playground/0b0ff4aa49c9443f9b47fe5203c78293) below) in an [effect](https://svelte.dev/docs/svelte/$effect) or [derived](https://svelte.dev/docs/svelte/$derived)
2288
+ * will cause it to be re-evaluated as necessary when the map is updated.
2289
+ *
2290
+ * Note that values in a reactive map are _not_ made [deeply reactive](https://svelte.dev/docs/svelte/$state#Deep-state).
2291
+ *
2292
+ * ```svelte
2293
+ * <script>
2294
+ * import { SvelteMap } from 'svelte/reactivity';
2295
+ * import { result } from './game.js';
2296
+ *
2297
+ * let board = new SvelteMap();
2298
+ * let player = $state('x');
2299
+ * let winner = $derived(result(board));
2300
+ *
2301
+ * function reset() {
2302
+ * player = 'x';
2303
+ * board.clear();
2304
+ * }
2305
+ * </script>
2306
+ *
2307
+ * <div class="board">
2308
+ * {#each Array(9), i}
2309
+ * <button
2310
+ * disabled={board.has(i) || winner}
2311
+ * onclick={() => {
2312
+ * board.set(i, player);
2313
+ * player = player === 'x' ? 'o' : 'x';
2314
+ * }}
2315
+ * >{board.get(i)}</button>
2316
+ * {/each}
2317
+ * </div>
2318
+ *
2319
+ * {#if winner}
2320
+ * <p>{winner} wins!</p>
2321
+ * <button onclick={reset}>reset</button>
2322
+ * {:else}
2323
+ * <p>{player} is next</p>
2324
+ * {/if}
2325
+ * ```
2326
+ *
2327
+ *
2328
+ */
2329
+ export class SvelteMap<K, V> extends Map<K, V> {
2330
+
2331
+ constructor(value?: Iterable<readonly [K, V]> | null | undefined);
2332
+
2333
+ set(key: K, value: V): this;
2334
+ #private;
2335
+ }
2336
+ /**
2337
+ * A reactive version of the built-in [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL) object.
2338
+ * Reading properties of the URL (such as `url.href` or `url.pathname`) in an [effect](https://svelte.dev/docs/svelte/$effect) or [derived](https://svelte.dev/docs/svelte/$derived)
2339
+ * will cause it to be re-evaluated as necessary when the URL changes.
2340
+ *
2341
+ * The `searchParams` property is an instance of [SvelteURLSearchParams](https://svelte.dev/docs/svelte/svelte-reactivity#SvelteURLSearchParams).
2342
+ *
2343
+ * [Example](https://svelte.dev/playground/5a694758901b448c83dc40dc31c71f2a):
2344
+ *
2345
+ * ```svelte
2346
+ * <script>
2347
+ * import { SvelteURL } from 'svelte/reactivity';
2348
+ *
2349
+ * const url = new SvelteURL('https://example.com/path');
2350
+ * </script>
2351
+ *
2352
+ * <!-- changes to these... -->
2353
+ * <input bind:value={url.protocol} />
2354
+ * <input bind:value={url.hostname} />
2355
+ * <input bind:value={url.pathname} />
2356
+ *
2357
+ * <hr />
2358
+ *
2359
+ * <!-- will update `href` and vice versa -->
2360
+ * <input bind:value={url.href} size="65" />
2361
+ * ```
2362
+ */
2363
+ export class SvelteURL extends URL {
2364
+ get searchParams(): SvelteURLSearchParams;
2365
+ #private;
2366
+ }
2367
+ const REPLACE: unique symbol;
2368
+ /**
2369
+ * A reactive version of the built-in [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) object.
2370
+ * Reading its contents (by iterating, or by calling `params.get(...)` or `params.getAll(...)` as in the [example](https://svelte.dev/playground/b3926c86c5384bab9f2cf993bc08c1c8) below) in an [effect](https://svelte.dev/docs/svelte/$effect) or [derived](https://svelte.dev/docs/svelte/$derived)
2371
+ * will cause it to be re-evaluated as necessary when the params are updated.
2372
+ *
2373
+ * ```svelte
2374
+ * <script>
2375
+ * import { SvelteURLSearchParams } from 'svelte/reactivity';
2376
+ *
2377
+ * const params = new SvelteURLSearchParams('message=hello');
2378
+ *
2379
+ * let key = $state('key');
2380
+ * let value = $state('value');
2381
+ * </script>
2382
+ *
2383
+ * <input bind:value={key} />
2384
+ * <input bind:value={value} />
2385
+ * <button onclick={() => params.append(key, value)}>append</button>
2386
+ *
2387
+ * <p>?{params.toString()}</p>
2388
+ *
2389
+ * {#each params as [key, value]}
2390
+ * <p>{key}: {value}</p>
2391
+ * {/each}
2392
+ * ```
2393
+ */
2394
+ export class SvelteURLSearchParams extends URLSearchParams {
2395
+
2396
+ [REPLACE](params: URLSearchParams): void;
2397
+ #private;
2398
+ }
2399
+ /**
2400
+ * Creates a media query and provides a `current` property that reflects whether or not it matches.
2401
+ *
2402
+ * Use it carefully — during server-side rendering, there is no way to know what the correct value should be, potentially causing content to change upon hydration.
2403
+ * If you can use the media query in CSS to achieve the same effect, do that.
2404
+ *
2405
+ * ```svelte
2406
+ * <script>
2407
+ * import { MediaQuery } from 'svelte/reactivity';
2408
+ *
2409
+ * const large = new MediaQuery('min-width: 800px');
2410
+ * </script>
2411
+ *
2412
+ * <h1>{large.current ? 'large screen' : 'small screen'}</h1>
2413
+ * ```
2414
+ * @extends {ReactiveValue<boolean>}
2415
+ * @since 5.7.0
2416
+ */
2417
+ export class MediaQuery extends ReactiveValue<boolean> {
2418
+ /**
2419
+ * @param query A media query string
2420
+ * @param fallback Fallback value for the server
2421
+ */
2422
+ constructor(query: string, fallback?: boolean | undefined);
2423
+ }
2424
+ /**
2425
+ * Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.
2426
+ * It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.
2427
+ *
2428
+ * If `subscribe` is called inside an effect (including indirectly, for example inside a getter),
2429
+ * the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.
2430
+ *
2431
+ * If `start` returns a cleanup function, it will be called when the effect is destroyed.
2432
+ *
2433
+ * If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects
2434
+ * are active, and the returned teardown function will only be called when all effects are destroyed.
2435
+ *
2436
+ * It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):
2437
+ *
2438
+ * ```js
2439
+ * import { createSubscriber } from 'svelte/reactivity';
2440
+ * import { on } from 'svelte/events';
2441
+ *
2442
+ * export class MediaQuery {
2443
+ * #query;
2444
+ * #subscribe;
2445
+ *
2446
+ * constructor(query) {
2447
+ * this.#query = window.matchMedia(`(${query})`);
2448
+ *
2449
+ * this.#subscribe = createSubscriber((update) => {
2450
+ * // when the `change` event occurs, re-run any effects that read `this.current`
2451
+ * const off = on(this.#query, 'change', update);
2452
+ *
2453
+ * // stop listening when all the effects are destroyed
2454
+ * return () => off();
2455
+ * });
2456
+ * }
2457
+ *
2458
+ * get current() {
2459
+ * // This makes the getter reactive, if read in an effect
2460
+ * this.#subscribe();
2461
+ *
2462
+ * // Return the current state of the query, whether or not we're in an effect
2463
+ * return this.#query.matches;
2464
+ * }
2465
+ * }
2466
+ * ```
2467
+ * @since 5.7.0
2468
+ */
2469
+ export function createSubscriber(start: (update: () => void) => (() => void) | void): () => void;
2470
+ class ReactiveValue<T> {
2471
+
2472
+ constructor(fn: () => T, onsubscribe: (update: () => void) => void);
2473
+ get current(): T;
2474
+ #private;
2475
+ }
2476
+
2477
+ export {};
2478
+ }
2479
+
2480
+ declare module 'svelte/reactivity/window' {
2481
+ /**
2482
+ * `scrollX.current` is a reactive view of `window.scrollX`. On the server it is `undefined`.
2483
+ * @since 5.11.0
2484
+ */
2485
+ export const scrollX: ReactiveValue<number | undefined>;
2486
+ /**
2487
+ * `scrollY.current` is a reactive view of `window.scrollY`. On the server it is `undefined`.
2488
+ * @since 5.11.0
2489
+ */
2490
+ export const scrollY: ReactiveValue<number | undefined>;
2491
+ /**
2492
+ * `innerWidth.current` is a reactive view of `window.innerWidth`. On the server it is `undefined`.
2493
+ * @since 5.11.0
2494
+ */
2495
+ export const innerWidth: ReactiveValue<number | undefined>;
2496
+ /**
2497
+ * `innerHeight.current` is a reactive view of `window.innerHeight`. On the server it is `undefined`.
2498
+ * @since 5.11.0
2499
+ */
2500
+ export const innerHeight: ReactiveValue<number | undefined>;
2501
+ /**
2502
+ * `outerWidth.current` is a reactive view of `window.outerWidth`. On the server it is `undefined`.
2503
+ * @since 5.11.0
2504
+ */
2505
+ export const outerWidth: ReactiveValue<number | undefined>;
2506
+ /**
2507
+ * `outerHeight.current` is a reactive view of `window.outerHeight`. On the server it is `undefined`.
2508
+ * @since 5.11.0
2509
+ */
2510
+ export const outerHeight: ReactiveValue<number | undefined>;
2511
+ /**
2512
+ * `screenLeft.current` is a reactive view of `window.screenLeft`. It is updated inside a `requestAnimationFrame` callback. On the server it is `undefined`.
2513
+ * @since 5.11.0
2514
+ */
2515
+ export const screenLeft: ReactiveValue<number | undefined>;
2516
+ /**
2517
+ * `screenTop.current` is a reactive view of `window.screenTop`. It is updated inside a `requestAnimationFrame` callback. On the server it is `undefined`.
2518
+ * @since 5.11.0
2519
+ */
2520
+ export const screenTop: ReactiveValue<number | undefined>;
2521
+ /**
2522
+ * `online.current` is a reactive view of `navigator.onLine`. On the server it is `undefined`.
2523
+ * @since 5.11.0
2524
+ */
2525
+ export const online: ReactiveValue<boolean | undefined>;
2526
+ /**
2527
+ * `devicePixelRatio.current` is a reactive view of `window.devicePixelRatio`. On the server it is `undefined`.
2528
+ * Note that behaviour differs between browsers — on Chrome it will respond to the current zoom level,
2529
+ * on Firefox and Safari it won't.
2530
+ * @since 5.11.0
2531
+ */
2532
+ export const devicePixelRatio: {
2533
+ get current(): number | undefined;
2534
+ };
2535
+ class ReactiveValue<T> {
2536
+
2537
+ constructor(fn: () => T, onsubscribe: (update: () => void) => void);
2538
+ get current(): T;
2539
+ #private;
2540
+ }
2541
+
2542
+ export {};
2543
+ }
2544
+
2545
+ declare module 'svelte/server' {
2546
+ import type { ComponentProps, Component, SvelteComponent, ComponentType } from 'svelte';
2547
+ /**
2548
+ * Only available on the server and when compiling with the `server` option.
2549
+ * Takes a component and returns an object with `body` and `head` properties on it, which you can use to populate the HTML when server-rendering your app.
2550
+ */
2551
+ export function render<
2552
+ Comp extends SvelteComponent<any> | Component<any>,
2553
+ Props extends ComponentProps<Comp> = ComponentProps<Comp>
2554
+ >(
2555
+ ...args: {} extends Props
2556
+ ? [
2557
+ component: Comp extends SvelteComponent<any> ? ComponentType<Comp> : Comp,
2558
+ options?: {
2559
+ props?: Omit<Props, '$$slots' | '$$events'>;
2560
+ context?: Map<any, any>;
2561
+ idPrefix?: string;
2562
+ csp?: Csp;
2563
+ }
2564
+ ]
2565
+ : [
2566
+ component: Comp extends SvelteComponent<any> ? ComponentType<Comp> : Comp,
2567
+ options: {
2568
+ props: Omit<Props, '$$slots' | '$$events'>;
2569
+ context?: Map<any, any>;
2570
+ idPrefix?: string;
2571
+ csp?: Csp;
2572
+ }
2573
+ ]
2574
+ ): RenderOutput;
2575
+ type Csp = { nonce?: string; hash?: boolean };
2576
+
2577
+ type Sha256Source = `sha256-${string}`;
2578
+
2579
+ interface SyncRenderOutput {
2580
+ /** HTML that goes into the `<head>` */
2581
+ head: string;
2582
+ /** @deprecated use `body` instead */
2583
+ html: string;
2584
+ /** HTML that goes somewhere into the `<body>` */
2585
+ body: string;
2586
+ hashes: {
2587
+ script: Sha256Source[];
2588
+ };
2589
+ }
2590
+
2591
+ type RenderOutput = SyncRenderOutput & PromiseLike<SyncRenderOutput>;
2592
+
2593
+ export {};
2594
+ }
2595
+
2596
+ declare module 'svelte/store' {
2597
+ /** Callback to inform of a value updates. */
2598
+ export type Subscriber<T> = (value: T) => void;
2599
+
2600
+ /** Unsubscribes from value updates. */
2601
+ export type Unsubscriber = () => void;
2602
+
2603
+ /** Callback to update a value. */
2604
+ export type Updater<T> = (value: T) => T;
2605
+
2606
+ /**
2607
+ * Start and stop notification callbacks.
2608
+ * This function is called when the first subscriber subscribes.
2609
+ *
2610
+ * @param set Function that sets the value of the store.
2611
+ * @param update Function that sets the value of the store after passing the current value to the update function.
2612
+ * @returns Optionally, a cleanup function that is called when the last remaining
2613
+ * subscriber unsubscribes.
2614
+ */
2615
+ export type StartStopNotifier<T> = (
2616
+ set: (value: T) => void,
2617
+ update: (fn: Updater<T>) => void
2618
+ ) => void | (() => void);
2619
+
2620
+ /** Readable interface for subscribing. */
2621
+ export interface Readable<T> {
2622
+ /**
2623
+ * Subscribe on value changes.
2624
+ * @param run subscription callback
2625
+ * @param invalidate cleanup callback
2626
+ */
2627
+ subscribe(this: void, run: Subscriber<T>, invalidate?: () => void): Unsubscriber;
2628
+ }
2629
+
2630
+ /** Writable interface for both updating and subscribing. */
2631
+ export interface Writable<T> extends Readable<T> {
2632
+ /**
2633
+ * Set value and inform subscribers.
2634
+ * @param value to set
2635
+ */
2636
+ set(this: void, value: T): void;
2637
+
2638
+ /**
2639
+ * Update value using callback and inform subscribers.
2640
+ * @param updater callback
2641
+ */
2642
+ update(this: void, updater: Updater<T>): void;
2643
+ }
2644
+ export function toStore<V>(get: () => V, set: (v: V) => void): Writable<V>;
2645
+
2646
+ export function toStore<V>(get: () => V): Readable<V>;
2647
+
2648
+ export function fromStore<V>(store: Writable<V>): {
2649
+ current: V;
2650
+ };
2651
+
2652
+ export function fromStore<V>(store: Readable<V>): {
2653
+ readonly current: V;
2654
+ };
2655
+ /**
2656
+ * Creates a `Readable` store that allows reading by subscription.
2657
+ *
2658
+ * @param value initial value
2659
+ * */
2660
+ export function readable<T>(value?: T | undefined, start?: StartStopNotifier<T> | undefined): Readable<T>;
2661
+ /**
2662
+ * Create a `Writable` store that allows both updating and reading by subscription.
2663
+ *
2664
+ * @param value initial value
2665
+ * */
2666
+ export function writable<T>(value?: T | undefined, start?: StartStopNotifier<T> | undefined): Writable<T>;
2667
+ /**
2668
+ * Derived value store by synchronizing one or more readable stores and
2669
+ * applying an aggregation function over its input values.
2670
+ *
2671
+ * */
2672
+ export function derived<S extends Stores, T>(stores: S, fn: (values: StoresValues<S>, set: (value: T) => void, update: (fn: Updater<T>) => void) => Unsubscriber | void, initial_value?: T | undefined): Readable<T>;
2673
+ /**
2674
+ * Derived value store by synchronizing one or more readable stores and
2675
+ * applying an aggregation function over its input values.
2676
+ *
2677
+ * */
2678
+ export function derived<S extends Stores, T>(stores: S, fn: (values: StoresValues<S>) => T, initial_value?: T | undefined): Readable<T>;
2679
+ /**
2680
+ * Takes a store and returns a new one derived from the old one that is readable.
2681
+ *
2682
+ * @param store - store to make readonly
2683
+ * */
2684
+ export function readonly<T>(store: Readable<T>): Readable<T>;
2685
+ /**
2686
+ * Get the current value from a store by subscribing and immediately unsubscribing.
2687
+ *
2688
+ * */
2689
+ export function get<T>(store: Readable<T>): T;
2690
+ /** One or more `Readable`s. */
2691
+ type Stores = Readable<any> | [Readable<any>, ...Array<Readable<any>>] | Array<Readable<any>>;
2692
+
2693
+ /** One or more values from `Readable` stores. */
2694
+ type StoresValues<T> =
2695
+ T extends Readable<infer U> ? U : { [K in keyof T]: T[K] extends Readable<infer U> ? U : never };
2696
+
2697
+ export {};
2698
+ }
2699
+
2700
+ declare module 'svelte/transition' {
2701
+ export type EasingFunction = (t: number) => number;
2702
+
2703
+ export interface TransitionConfig {
2704
+ delay?: number;
2705
+ duration?: number;
2706
+ easing?: EasingFunction;
2707
+ css?: (t: number, u: number) => string;
2708
+ tick?: (t: number, u: number) => void;
2709
+ }
2710
+
2711
+ export interface BlurParams {
2712
+ delay?: number;
2713
+ duration?: number;
2714
+ easing?: EasingFunction;
2715
+ amount?: number | string;
2716
+ opacity?: number;
2717
+ }
2718
+
2719
+ export interface FadeParams {
2720
+ delay?: number;
2721
+ duration?: number;
2722
+ easing?: EasingFunction;
2723
+ }
2724
+
2725
+ export interface FlyParams {
2726
+ delay?: number;
2727
+ duration?: number;
2728
+ easing?: EasingFunction;
2729
+ x?: number | string;
2730
+ y?: number | string;
2731
+ opacity?: number;
2732
+ }
2733
+
2734
+ export interface SlideParams {
2735
+ delay?: number;
2736
+ duration?: number;
2737
+ easing?: EasingFunction;
2738
+ axis?: 'x' | 'y';
2739
+ }
2740
+
2741
+ export interface ScaleParams {
2742
+ delay?: number;
2743
+ duration?: number;
2744
+ easing?: EasingFunction;
2745
+ start?: number;
2746
+ opacity?: number;
2747
+ }
2748
+
2749
+ export interface DrawParams {
2750
+ delay?: number;
2751
+ speed?: number;
2752
+ duration?: number | ((len: number) => number);
2753
+ easing?: EasingFunction;
2754
+ }
2755
+
2756
+ export interface CrossfadeParams {
2757
+ delay?: number;
2758
+ duration?: number | ((len: number) => number);
2759
+ easing?: EasingFunction;
2760
+ }
2761
+ /**
2762
+ * Animates a `blur` filter alongside an element's opacity.
2763
+ *
2764
+ * */
2765
+ export function blur(node: Element, { delay, duration, easing, amount, opacity }?: BlurParams | undefined): TransitionConfig;
2766
+ /**
2767
+ * Animates the opacity of an element from 0 to the current opacity for `in` transitions and from the current opacity to 0 for `out` transitions.
2768
+ *
2769
+ * */
2770
+ export function fade(node: Element, { delay, duration, easing }?: FadeParams | undefined): TransitionConfig;
2771
+ /**
2772
+ * Animates the x and y positions and the opacity of an element. `in` transitions animate from the provided values, passed as parameters to the element's default values. `out` transitions animate from the element's default values to the provided values.
2773
+ *
2774
+ * */
2775
+ export function fly(node: Element, { delay, duration, easing, x, y, opacity }?: FlyParams | undefined): TransitionConfig;
2776
+ /**
2777
+ * Slides an element in and out.
2778
+ *
2779
+ * */
2780
+ export function slide(node: Element, { delay, duration, easing, axis }?: SlideParams | undefined): TransitionConfig;
2781
+ /**
2782
+ * Animates the opacity and scale of an element. `in` transitions animate from the provided values, passed as parameters, to an element's current (default) values. `out` transitions animate from an element's default values to the provided values.
2783
+ *
2784
+ * */
2785
+ export function scale(node: Element, { delay, duration, easing, start, opacity }?: ScaleParams | undefined): TransitionConfig;
2786
+ /**
2787
+ * Animates the stroke of an SVG element, like a snake in a tube. `in` transitions begin with the path invisible and draw the path to the screen over time. `out` transitions start in a visible state and gradually erase the path. `draw` only works with elements that have a `getTotalLength` method, like `<path>` and `<polyline>`.
2788
+ *
2789
+ * */
2790
+ export function draw(node: SVGElement & {
2791
+ getTotalLength(): number;
2792
+ }, { delay, speed, duration, easing }?: DrawParams | undefined): TransitionConfig;
2793
+ /**
2794
+ * The `crossfade` function creates a pair of [transitions](https://svelte.dev/docs/svelte/transition) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used.
2795
+ *
2796
+ * */
2797
+ export function crossfade({ fallback, ...defaults }: CrossfadeParams & {
2798
+ fallback?: (node: Element, params: CrossfadeParams, intro: boolean) => TransitionConfig;
2799
+ }): [(node: any, params: CrossfadeParams & {
2800
+ key: any;
2801
+ }) => () => TransitionConfig, (node: any, params: CrossfadeParams & {
2802
+ key: any;
2803
+ }) => () => TransitionConfig];
2804
+
2805
+ export {};
2806
+ }
2807
+
2808
+ declare module 'svelte/events' {
2809
+ // Once https://github.com/microsoft/TypeScript/issues/59980 is fixed we can put these overloads into the JSDoc comments of the `on` function
2810
+
2811
+ /**
2812
+ * Attaches an event handler to the window and returns a function that removes the handler. Using this
2813
+ * rather than `addEventListener` will preserve the correct order relative to handlers added declaratively
2814
+ * (with attributes like `onclick`), which use event delegation for performance reasons
2815
+ */
2816
+ export function on<Type extends keyof WindowEventMap>(
2817
+ window: Window,
2818
+ type: Type,
2819
+ handler: (this: Window, event: WindowEventMap[Type] & { currentTarget: Window }) => any,
2820
+ options?: AddEventListenerOptions | undefined
2821
+ ): () => void;
2822
+ /**
2823
+ * Attaches an event handler to the document and returns a function that removes the handler. Using this
2824
+ * rather than `addEventListener` will preserve the correct order relative to handlers added declaratively
2825
+ * (with attributes like `onclick`), which use event delegation for performance reasons
2826
+ */
2827
+ export function on<Type extends keyof DocumentEventMap>(
2828
+ document: Document,
2829
+ type: Type,
2830
+ handler: (this: Document, event: DocumentEventMap[Type] & { currentTarget: Document }) => any,
2831
+ options?: AddEventListenerOptions | undefined
2832
+ ): () => void;
2833
+ /**
2834
+ * Attaches an event handler to an element and returns a function that removes the handler. Using this
2835
+ * rather than `addEventListener` will preserve the correct order relative to handlers added declaratively
2836
+ * (with attributes like `onclick`), which use event delegation for performance reasons
2837
+ */
2838
+ export function on<Element extends HTMLElement, Type extends keyof HTMLElementEventMap>(
2839
+ element: Element,
2840
+ type: Type,
2841
+ handler: (this: Element, event: HTMLElementEventMap[Type] & { currentTarget: Element }) => any,
2842
+ options?: AddEventListenerOptions | undefined
2843
+ ): () => void;
2844
+ /**
2845
+ * Attaches an event handler to an element and returns a function that removes the handler. Using this
2846
+ * rather than `addEventListener` will preserve the correct order relative to handlers added declaratively
2847
+ * (with attributes like `onclick`), which use event delegation for performance reasons
2848
+ */
2849
+ export function on<Element extends MediaQueryList, Type extends keyof MediaQueryListEventMap>(
2850
+ element: Element,
2851
+ type: Type,
2852
+ handler: (this: Element, event: MediaQueryListEventMap[Type] & { currentTarget: Element }) => any,
2853
+ options?: AddEventListenerOptions | undefined
2854
+ ): () => void;
2855
+ /**
2856
+ * Attaches an event handler to an element and returns a function that removes the handler. Using this
2857
+ * rather than `addEventListener` will preserve the correct order relative to handlers added declaratively
2858
+ * (with attributes like `onclick`), which use event delegation for performance reasons
2859
+ */
2860
+ export function on(
2861
+ element: EventTarget,
2862
+ type: string,
2863
+ handler: EventListener,
2864
+ options?: AddEventListenerOptions | undefined
2865
+ ): () => void;
2866
+
2867
+ export {};
2868
+ }
2869
+
2870
+ declare module 'svelte/types/compiler/preprocess' {
2871
+ /** @deprecated import this from 'svelte/preprocess' instead */
2872
+ export type MarkupPreprocessor = MarkupPreprocessor_1;
2873
+ /** @deprecated import this from 'svelte/preprocess' instead */
2874
+ export type Preprocessor = Preprocessor_1;
2875
+ /** @deprecated import this from 'svelte/preprocess' instead */
2876
+ export type PreprocessorGroup = PreprocessorGroup_1;
2877
+ /** @deprecated import this from 'svelte/preprocess' instead */
2878
+ export type Processed = Processed_1;
2879
+ /** @deprecated import this from 'svelte/preprocess' instead */
2880
+ export type SveltePreprocessor<PreprocessorType extends keyof PreprocessorGroup_1, Options = any> = SveltePreprocessor_1<
2881
+ PreprocessorType,
2882
+ Options
2883
+ >;
2884
+ /**
2885
+ * The result of a preprocessor run. If the preprocessor does not return a result, it is assumed that the code is unchanged.
2886
+ */
2887
+ interface Processed_1 {
2888
+ /**
2889
+ * The new code
2890
+ */
2891
+ code: string;
2892
+ /**
2893
+ * A source map mapping back to the original code
2894
+ */
2895
+ map?: string | object; // we are opaque with the type here to avoid dependency on the remapping module for our public types.
2896
+ /**
2897
+ * A list of additional files to watch for changes
2898
+ */
2899
+ dependencies?: string[];
2900
+ /**
2901
+ * Only for script/style preprocessors: The updated attributes to set on the tag. If undefined, attributes stay unchanged.
2902
+ */
2903
+ attributes?: Record<string, string | boolean>;
2904
+ toString?: () => string;
2905
+ }
2906
+
2907
+ /**
2908
+ * A markup preprocessor that takes a string of code and returns a processed version.
2909
+ */
2910
+ type MarkupPreprocessor_1 = (options: {
2911
+ /**
2912
+ * The whole Svelte file content
2913
+ */
2914
+ content: string;
2915
+ /**
2916
+ * The filename of the Svelte file
2917
+ */
2918
+ filename?: string;
2919
+ }) => Processed_1 | void | Promise<Processed_1 | void>;
2920
+
2921
+ /**
2922
+ * A script/style preprocessor that takes a string of code and returns a processed version.
2923
+ */
2924
+ type Preprocessor_1 = (options: {
2925
+ /**
2926
+ * The script/style tag content
2927
+ */
2928
+ content: string;
2929
+ /**
2930
+ * The attributes on the script/style tag
2931
+ */
2932
+ attributes: Record<string, string | boolean>;
2933
+ /**
2934
+ * The whole Svelte file content
2935
+ */
2936
+ markup: string;
2937
+ /**
2938
+ * The filename of the Svelte file
2939
+ */
2940
+ filename?: string;
2941
+ }) => Processed_1 | void | Promise<Processed_1 | void>;
2942
+
2943
+ /**
2944
+ * A preprocessor group is a set of preprocessors that are applied to a Svelte file.
2945
+ */
2946
+ interface PreprocessorGroup_1 {
2947
+ /** Name of the preprocessor. Will be a required option in the next major version */
2948
+ name?: string;
2949
+ markup?: MarkupPreprocessor_1;
2950
+ style?: Preprocessor_1;
2951
+ script?: Preprocessor_1;
2952
+ }
2953
+
2954
+ /**
2955
+ * @description Utility type to extract the type of a preprocessor from a preprocessor group
2956
+ * @deprecated Create this utility type yourself instead
2957
+ */
2958
+ interface SveltePreprocessor_1<
2959
+ PreprocessorType extends keyof PreprocessorGroup_1,
2960
+ Options = any
2961
+ > {
2962
+ (options?: Options): Required<Pick<PreprocessorGroup_1, PreprocessorType>>;
2963
+ }
2964
+
2965
+ export {};
2966
+ }
2967
+
2968
+ declare module 'svelte/types/compiler/interfaces' {
2969
+ import type { Location } from 'locate-character';
2970
+ /** @deprecated import this from 'svelte' instead */
2971
+ export type CompileOptions = CompileOptions_1;
2972
+ /** @deprecated import this from 'svelte' instead */
2973
+ export type Warning = Warning_1;
2974
+ interface Warning_1 extends ICompileDiagnostic {}
2975
+
2976
+ type CssHashGetter = (args: {
2977
+ name: string;
2978
+ filename: string;
2979
+ css: string;
2980
+ hash: (input: string) => string;
2981
+ }) => string;
2982
+
2983
+ interface CompileOptions_1 extends ModuleCompileOptions {
2984
+ /**
2985
+ * Sets the name of the resulting JavaScript class (though the compiler will rename it if it would otherwise conflict with other variables in scope).
2986
+ * If unspecified, will be inferred from `filename`
2987
+ */
2988
+ name?: string;
2989
+ /**
2990
+ * If `true`, tells the compiler to generate a custom element constructor instead of a regular Svelte component.
2991
+ *
2992
+ * @default false
2993
+ */
2994
+ customElement?: boolean;
2995
+ /**
2996
+ * If `true`, getters and setters will be created for the component's props. If `false`, they will only be created for readonly exported values (i.e. those declared with `const`, `class` and `function`). If compiling with `customElement: true` this option defaults to `true`.
2997
+ *
2998
+ * @default false
2999
+ * @deprecated This will have no effect in runes mode
3000
+ */
3001
+ accessors?: boolean;
3002
+ /**
3003
+ * The namespace of the element; e.g., `"html"`, `"svg"`, `"mathml"`.
3004
+ *
3005
+ * @default 'html'
3006
+ */
3007
+ namespace?: Namespace;
3008
+ /**
3009
+ * If `true`, tells the compiler that you promise not to mutate any objects.
3010
+ * This allows it to be less conservative about checking whether values have changed.
3011
+ *
3012
+ * @default false
3013
+ * @deprecated This will have no effect in runes mode
3014
+ */
3015
+ immutable?: boolean;
3016
+ /**
3017
+ * - `'injected'`: styles will be included in the `head` when using `render(...)`, and injected into the document (if not already present) when the component mounts. For components compiled as custom elements, styles are injected to the shadow root.
3018
+ * - `'external'`: the CSS will only be returned in the `css` field of the compilation result. Most Svelte bundler plugins will set this to `'external'` and use the CSS that is statically generated for better performance, as it will result in smaller JavaScript bundles and the output can be served as cacheable `.css` files.
3019
+ * This is always `'injected'` when compiling with `customElement` mode.
3020
+ */
3021
+ css?: 'injected' | 'external';
3022
+ /**
3023
+ * A function that takes a `{ hash, css, name, filename }` argument and returns the string that is used as a classname for scoped CSS.
3024
+ * It defaults to returning `svelte-${hash(filename ?? css)}`.
3025
+ *
3026
+ * @default undefined
3027
+ */
3028
+ cssHash?: CssHashGetter;
3029
+ /**
3030
+ * If `true`, your HTML comments will be preserved in the output. By default, they are stripped out.
3031
+ *
3032
+ * @default false
3033
+ */
3034
+ preserveComments?: boolean;
3035
+ /**
3036
+ * If `true`, whitespace inside and between elements is kept as you typed it, rather than removed or collapsed to a single space where possible.
3037
+ *
3038
+ * @default false
3039
+ */
3040
+ preserveWhitespace?: boolean;
3041
+ /**
3042
+ * Which strategy to use when cloning DOM fragments:
3043
+ *
3044
+ * - `html` populates a `<template>` with `innerHTML` and clones it. This is faster, but cannot be used if your app's [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) includes [`require-trusted-types-for 'script'`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/require-trusted-types-for)
3045
+ * - `tree` creates the fragment one element at a time and _then_ clones it. This is slower, but works everywhere
3046
+ *
3047
+ * @default 'html'
3048
+ * @since 5.33
3049
+ */
3050
+ fragments?: 'html' | 'tree';
3051
+ /**
3052
+ * Set to `true` to force the compiler into runes mode, even if there are no indications of runes usage.
3053
+ * Set to `false` to force the compiler into ignoring runes, even if there are indications of runes usage.
3054
+ * Set to `undefined` (the default) to infer runes mode from the component code.
3055
+ * Is always `true` for JS/TS modules compiled with Svelte.
3056
+ * Will be `true` by default in Svelte 6.
3057
+ * Note that setting this to `true` in your `svelte.config.js` will force runes mode for your entire project, including components in `node_modules`,
3058
+ * which is likely not what you want. If you're using Vite, consider using [dynamicCompileOptions](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#dynamiccompileoptions) instead.
3059
+ * @default undefined
3060
+ */
3061
+ runes?: boolean | undefined;
3062
+ /**
3063
+ * If `true`, exposes the Svelte major version in the browser by adding it to a `Set` stored in the global `window.__svelte.v`.
3064
+ *
3065
+ * @default true
3066
+ */
3067
+ discloseVersion?: boolean;
3068
+ /**
3069
+ * @deprecated Use these only as a temporary solution before migrating your code
3070
+ */
3071
+ compatibility?: {
3072
+ /**
3073
+ * Applies a transformation so that the default export of Svelte files can still be instantiated the same way as in Svelte 4 —
3074
+ * as a class when compiling for the browser (as though using `createClassComponent(MyComponent, {...})` from `svelte/legacy`)
3075
+ * or as an object with a `.render(...)` method when compiling for the server
3076
+ * @default 5
3077
+ */
3078
+ componentApi?: 4 | 5;
3079
+ };
3080
+ /**
3081
+ * An initial sourcemap that will be merged into the final output sourcemap.
3082
+ * This is usually the preprocessor sourcemap.
3083
+ *
3084
+ * @default null
3085
+ */
3086
+ sourcemap?: object | string;
3087
+ /**
3088
+ * Used for your JavaScript sourcemap.
3089
+ *
3090
+ * @default null
3091
+ */
3092
+ outputFilename?: string;
3093
+ /**
3094
+ * Used for your CSS sourcemap.
3095
+ *
3096
+ * @default null
3097
+ */
3098
+ cssOutputFilename?: string;
3099
+ /**
3100
+ * If `true`, compiles components with hot reloading support.
3101
+ *
3102
+ * @default false
3103
+ */
3104
+ hmr?: boolean;
3105
+ /**
3106
+ * If `true`, returns the modern version of the AST.
3107
+ * Will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.
3108
+ *
3109
+ * @default false
3110
+ */
3111
+ modernAst?: boolean;
3112
+ }
3113
+
3114
+ interface ModuleCompileOptions {
3115
+ /**
3116
+ * If `true`, causes extra code to be added that will perform runtime checks and provide debugging information during development.
3117
+ *
3118
+ * @default false
3119
+ */
3120
+ dev?: boolean;
3121
+ /**
3122
+ * If `"client"`, Svelte emits code designed to run in the browser.
3123
+ * If `"server"`, Svelte emits code suitable for server-side rendering.
3124
+ * If `false`, nothing is generated. Useful for tooling that is only interested in warnings.
3125
+ *
3126
+ * @default 'client'
3127
+ */
3128
+ generate?: 'client' | 'server' | false;
3129
+ /**
3130
+ * Used for debugging hints and sourcemaps. Your bundler plugin will set it automatically.
3131
+ */
3132
+ filename?: string;
3133
+ /**
3134
+ * Used for ensuring filenames don't leak filesystem information. Your bundler plugin will set it automatically.
3135
+ * @default process.cwd() on node-like environments, undefined elsewhere
3136
+ */
3137
+ rootDir?: string;
3138
+ /**
3139
+ * A function that gets a `Warning` as an argument and returns a boolean.
3140
+ * Use this to filter out warnings. Return `true` to keep the warning, `false` to discard it.
3141
+ */
3142
+ warningFilter?: (warning: Warning_1) => boolean;
3143
+ /**
3144
+ * Experimental options
3145
+ * @since 5.36
3146
+ */
3147
+ experimental?: {
3148
+ /**
3149
+ * Allow `await` keyword in deriveds, template expressions, and the top level of components
3150
+ * @since 5.36
3151
+ */
3152
+ async?: boolean;
3153
+ };
3154
+ }
3155
+ /**
3156
+ * - `html` — the default, for e.g. `<div>` or `<span>`
3157
+ * - `svg` — for e.g. `<svg>` or `<g>`
3158
+ * - `mathml` — for e.g. `<math>` or `<mrow>`
3159
+ */
3160
+ type Namespace = 'html' | 'svg' | 'mathml';
3161
+ type ICompileDiagnostic = {
3162
+ code: string;
3163
+ message: string;
3164
+ stack?: string;
3165
+ filename?: string;
3166
+ start?: Location;
3167
+ end?: Location;
3168
+ position?: [number, number];
3169
+ frame?: string;
3170
+ };
3171
+
3172
+ export {};
3173
+ }declare module '*.svelte' {
3174
+ // use prettier-ignore for a while because of https://github.com/sveltejs/language-tools/commit/026111228b5814a9109cc4d779d37fb02955fb8b
3175
+ // prettier-ignore
3176
+ import { SvelteComponent } from 'svelte'
3177
+ import { LegacyComponentType } from 'svelte/legacy';
3178
+ const Comp: LegacyComponentType;
3179
+ type Comp = SvelteComponent;
3180
+ export default Comp;
3181
+ }
3182
+
3183
+ /**
3184
+ * Declares reactive state.
3185
+ *
3186
+ * Example:
3187
+ * ```ts
3188
+ * let count = $state(0);
3189
+ * ```
3190
+ *
3191
+ * https://svelte.dev/docs/svelte/$state
3192
+ *
3193
+ * @param initial The initial value
3194
+ */
3195
+ declare function $state<T>(initial: T): T;
3196
+ declare function $state<T>(): T | undefined;
3197
+
3198
+ declare namespace $state {
3199
+ type Primitive = string | number | boolean | null | undefined;
3200
+
3201
+ type TypedArray =
3202
+ | Int8Array
3203
+ | Uint8Array
3204
+ | Uint8ClampedArray
3205
+ | Int16Array
3206
+ | Uint16Array
3207
+ | Int32Array
3208
+ | Uint32Array
3209
+ | Float32Array
3210
+ | Float64Array
3211
+ | BigInt64Array
3212
+ | BigUint64Array;
3213
+
3214
+ /** The things that `structuredClone` can handle — https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm */
3215
+ export type Cloneable =
3216
+ | ArrayBuffer
3217
+ | DataView
3218
+ | Date
3219
+ | Error
3220
+ | Map<any, any>
3221
+ | RegExp
3222
+ | Set<any>
3223
+ | TypedArray
3224
+ // web APIs
3225
+ | Blob
3226
+ | CryptoKey
3227
+ | DOMException
3228
+ | DOMMatrix
3229
+ | DOMMatrixReadOnly
3230
+ | DOMPoint
3231
+ | DOMPointReadOnly
3232
+ | DOMQuad
3233
+ | DOMRect
3234
+ | DOMRectReadOnly
3235
+ | File
3236
+ | FileList
3237
+ | FileSystemDirectoryHandle
3238
+ | FileSystemFileHandle
3239
+ | FileSystemHandle
3240
+ | ImageBitmap
3241
+ | ImageData
3242
+ | RTCCertificate
3243
+ | VideoFrame;
3244
+
3245
+ /** Turn `SvelteDate`, `SvelteMap` and `SvelteSet` into their non-reactive counterparts. (`URL` is uncloneable.) */
3246
+ type NonReactive<T> = T extends Date
3247
+ ? Date
3248
+ : T extends Map<infer K, infer V>
3249
+ ? Map<K, V>
3250
+ : T extends Set<infer K>
3251
+ ? Set<K>
3252
+ : T;
3253
+
3254
+ type Snapshot<T> = T extends Primitive
3255
+ ? T
3256
+ : T extends Cloneable
3257
+ ? NonReactive<T>
3258
+ : T extends { toJSON(): infer R }
3259
+ ? R
3260
+ : T extends readonly unknown[]
3261
+ ? { [K in keyof T]: Snapshot<T[K]> }
3262
+ : T extends Array<infer U>
3263
+ ? Array<Snapshot<U>>
3264
+ : T extends object
3265
+ ? T extends { [key: string]: any }
3266
+ ? { [K in keyof T]: Snapshot<T[K]> }
3267
+ : never
3268
+ : never;
3269
+
3270
+ /**
3271
+ * Returns the latest `value`, even if the rest of the UI is suspending
3272
+ * while async work (such as data loading) completes.
3273
+ *
3274
+ * ```svelte
3275
+ * <nav>
3276
+ * <a href="/" aria-current={$state.eager(pathname) === '/' ? 'page' : null}>home</a>
3277
+ * <a href="/about" aria-current={$state.eager(pathname) === '/about' ? 'page' : null}>about</a>
3278
+ * </nav>
3279
+ * ```
3280
+ */
3281
+ export function eager<T>(value: T): T;
3282
+ /**
3283
+ * Declares state that is _not_ made deeply reactive — instead of mutating it,
3284
+ * you must reassign it.
3285
+ *
3286
+ * Example:
3287
+ * ```svelte
3288
+ * <script>
3289
+ * let items = $state.raw([0]);
3290
+ *
3291
+ * const addItem = () => {
3292
+ * items = [...items, items.length];
3293
+ * };
3294
+ * </script>
3295
+ *
3296
+ * <button onclick={addItem}>
3297
+ * {items.join(', ')}
3298
+ * </button>
3299
+ * ```
3300
+ *
3301
+ * https://svelte.dev/docs/svelte/$state#$state.raw
3302
+ *
3303
+ * @param initial The initial value
3304
+ */
3305
+ export function raw<T>(initial: T): T;
3306
+ export function raw<T>(): T | undefined;
3307
+ /**
3308
+ * To take a static snapshot of a deeply reactive `$state` proxy, use `$state.snapshot`:
3309
+ *
3310
+ * Example:
3311
+ * ```svelte
3312
+ * <script>
3313
+ * let counter = $state({ count: 0 });
3314
+ *
3315
+ * function onclick() {
3316
+ * // Will log `{ count: ... }` rather than `Proxy { ... }`
3317
+ * console.log($state.snapshot(counter));
3318
+ * };
3319
+ * </script>
3320
+ * ```
3321
+ *
3322
+ * https://svelte.dev/docs/svelte/$state#$state.snapshot
3323
+ *
3324
+ * @param state The value to snapshot
3325
+ */
3326
+ export function snapshot<T>(state: T): Snapshot<T>;
3327
+
3328
+ // prevent intellisense from being unhelpful
3329
+ /** @deprecated */
3330
+ export const apply: never;
3331
+ /** @deprecated */
3332
+ // @ts-ignore
3333
+ export const arguments: never;
3334
+ /** @deprecated */
3335
+ export const bind: never;
3336
+ /** @deprecated */
3337
+ export const call: never;
3338
+ /** @deprecated */
3339
+ export const caller: never;
3340
+ /** @deprecated */
3341
+ export const length: never;
3342
+ /** @deprecated */
3343
+ export const name: never;
3344
+ /** @deprecated */
3345
+ export const prototype: never;
3346
+ /** @deprecated */
3347
+ export const toString: never;
3348
+ }
3349
+
3350
+ /**
3351
+ * Declares derived state, i.e. one that depends on other state variables.
3352
+ * The expression inside `$derived(...)` should be free of side-effects.
3353
+ *
3354
+ * Example:
3355
+ * ```ts
3356
+ * let double = $derived(count * 2);
3357
+ * ```
3358
+ *
3359
+ * https://svelte.dev/docs/svelte/$derived
3360
+ *
3361
+ * @param expression The derived state expression
3362
+ */
3363
+ declare function $derived<T>(expression: T): T;
3364
+
3365
+ declare namespace $derived {
3366
+ /**
3367
+ * Sometimes you need to create complex derivations that don't fit inside a short expression.
3368
+ * In these cases, you can use `$derived.by` which accepts a function as its argument.
3369
+ *
3370
+ * Example:
3371
+ * ```ts
3372
+ * let total = $derived.by(() => {
3373
+ * let result = 0;
3374
+ * for (const n of numbers) {
3375
+ * result += n;
3376
+ * }
3377
+ * return result;
3378
+ * });
3379
+ * ```
3380
+ *
3381
+ * https://svelte.dev/docs/svelte/$derived#$derived.by
3382
+ */
3383
+ export function by<T>(fn: () => T): T;
3384
+
3385
+ // prevent intellisense from being unhelpful
3386
+ /** @deprecated */
3387
+ export const apply: never;
3388
+ /** @deprecated */
3389
+ // @ts-ignore
3390
+ export const arguments: never;
3391
+ /** @deprecated */
3392
+ export const bind: never;
3393
+ /** @deprecated */
3394
+ export const call: never;
3395
+ /** @deprecated */
3396
+ export const caller: never;
3397
+ /** @deprecated */
3398
+ export const length: never;
3399
+ /** @deprecated */
3400
+ export const name: never;
3401
+ /** @deprecated */
3402
+ export const prototype: never;
3403
+ /** @deprecated */
3404
+ export const toString: never;
3405
+ }
3406
+
3407
+ /**
3408
+ * Runs code when a component is mounted to the DOM, and then whenever its dependencies change, i.e. `$state` or `$derived` values.
3409
+ * The timing of the execution is after the DOM has been updated.
3410
+ *
3411
+ * Example:
3412
+ * ```ts
3413
+ * $effect(() => console.log('The count is now ' + count));
3414
+ * ```
3415
+ *
3416
+ * If you return a function from the effect, it will be called right before the effect is run again, or when the component is unmounted.
3417
+ *
3418
+ * Does not run during server-side rendering.
3419
+ *
3420
+ * https://svelte.dev/docs/svelte/$effect
3421
+ * @param fn The function to execute
3422
+ */
3423
+ declare function $effect(fn: () => void | (() => void)): void;
3424
+
3425
+ declare namespace $effect {
3426
+ /**
3427
+ * Runs code right before a component is mounted to the DOM, and then whenever its dependencies change, i.e. `$state` or `$derived` values.
3428
+ * The timing of the execution is right before the DOM is updated.
3429
+ *
3430
+ * Example:
3431
+ * ```ts
3432
+ * $effect.pre(() => console.log('The count is now ' + count));
3433
+ * ```
3434
+ *
3435
+ * If you return a function from the effect, it will be called right before the effect is run again, or when the component is unmounted.
3436
+ *
3437
+ * Does not run during server-side rendering.
3438
+ *
3439
+ * https://svelte.dev/docs/svelte/$effect#$effect.pre
3440
+ * @param fn The function to execute
3441
+ */
3442
+ export function pre(fn: () => void | (() => void)): void;
3443
+
3444
+ /**
3445
+ * Returns the number of promises that are pending in the current boundary, not including child boundaries.
3446
+ *
3447
+ * https://svelte.dev/docs/svelte/$effect#$effect.pending
3448
+ */
3449
+ export function pending(): number;
3450
+
3451
+ /**
3452
+ * The `$effect.tracking` rune is an advanced feature that tells you whether or not the code is running inside a tracking context, such as an effect or inside your template.
3453
+ *
3454
+ * Example:
3455
+ * ```svelte
3456
+ * <script>
3457
+ * console.log('in component setup:', $effect.tracking()); // false
3458
+ *
3459
+ * $effect(() => {
3460
+ * console.log('in effect:', $effect.tracking()); // true
3461
+ * });
3462
+ * </script>
3463
+ *
3464
+ * <p>in template: {$effect.tracking()}</p> <!-- true -->
3465
+ * ```
3466
+ *
3467
+ * This allows you to (for example) add things like subscriptions without causing memory leaks, by putting them in child effects.
3468
+ *
3469
+ * https://svelte.dev/docs/svelte/$effect#$effect.tracking
3470
+ */
3471
+ export function tracking(): boolean;
3472
+
3473
+ /**
3474
+ * The `$effect.root` rune is an advanced feature that creates a non-tracked scope that doesn't auto-cleanup. This is useful for
3475
+ * nested effects that you want to manually control. This rune also allows for creation of effects outside of the component
3476
+ * initialisation phase.
3477
+ *
3478
+ * Example:
3479
+ * ```svelte
3480
+ * <script>
3481
+ * let count = $state(0);
3482
+ *
3483
+ * const cleanup = $effect.root(() => {
3484
+ * $effect(() => {
3485
+ * console.log(count);
3486
+ * })
3487
+ *
3488
+ * return () => {
3489
+ * console.log('effect root cleanup');
3490
+ * }
3491
+ * });
3492
+ * </script>
3493
+ *
3494
+ * <button onclick={() => cleanup()}>cleanup</button>
3495
+ * ```
3496
+ *
3497
+ * https://svelte.dev/docs/svelte/$effect#$effect.root
3498
+ */
3499
+ export function root(fn: () => void | (() => void)): () => void;
3500
+
3501
+ // prevent intellisense from being unhelpful
3502
+ /** @deprecated */
3503
+ export const apply: never;
3504
+ /** @deprecated */
3505
+ // @ts-ignore
3506
+ export const arguments: never;
3507
+ /** @deprecated */
3508
+ export const bind: never;
3509
+ /** @deprecated */
3510
+ export const call: never;
3511
+ /** @deprecated */
3512
+ export const caller: never;
3513
+ /** @deprecated */
3514
+ export const length: never;
3515
+ /** @deprecated */
3516
+ export const name: never;
3517
+ /** @deprecated */
3518
+ export const prototype: never;
3519
+ /** @deprecated */
3520
+ export const toString: never;
3521
+ }
3522
+
3523
+ /**
3524
+ * Declares the props that a component accepts. Example:
3525
+ *
3526
+ * ```ts
3527
+ * let { optionalProp = 42, requiredProp, bindableProp = $bindable() }: { optionalProp?: number; requiredProps: string; bindableProp: boolean } = $props();
3528
+ * ```
3529
+ *
3530
+ * https://svelte.dev/docs/svelte/$props
3531
+ */
3532
+ declare function $props(): any;
3533
+
3534
+ declare namespace $props {
3535
+ /**
3536
+ * Generates an ID that is unique to the current component instance. When hydrating a server-rendered component,
3537
+ * the value will be consistent between server and client.
3538
+ *
3539
+ * This is useful for linking elements via attributes like `for` and `aria-labelledby`.
3540
+ * @since 5.20.0
3541
+ */
3542
+ export function id(): string;
3543
+
3544
+ // prevent intellisense from being unhelpful
3545
+ /** @deprecated */
3546
+ export const apply: never;
3547
+ /** @deprecated */
3548
+ // @ts-ignore
3549
+ export const arguments: never;
3550
+ /** @deprecated */
3551
+ export const bind: never;
3552
+ /** @deprecated */
3553
+ export const call: never;
3554
+ /** @deprecated */
3555
+ export const caller: never;
3556
+ /** @deprecated */
3557
+ export const length: never;
3558
+ /** @deprecated */
3559
+ export const name: never;
3560
+ /** @deprecated */
3561
+ export const prototype: never;
3562
+ /** @deprecated */
3563
+ export const toString: never;
3564
+ }
3565
+
3566
+ /**
3567
+ * Declares a prop as bindable, meaning the parent component can use `bind:propName={value}` to bind to it.
3568
+ *
3569
+ * ```ts
3570
+ * let { propName = $bindable() }: { propName: boolean } = $props();
3571
+ * ```
3572
+ *
3573
+ * https://svelte.dev/docs/svelte/$bindable
3574
+ */
3575
+ declare function $bindable<T>(fallback?: T): T;
3576
+
3577
+ declare namespace $bindable {
3578
+ // prevent intellisense from being unhelpful
3579
+ /** @deprecated */
3580
+ export const apply: never;
3581
+ /** @deprecated */
3582
+ // @ts-ignore
3583
+ export const arguments: never;
3584
+ /** @deprecated */
3585
+ export const bind: never;
3586
+ /** @deprecated */
3587
+ export const call: never;
3588
+ /** @deprecated */
3589
+ export const caller: never;
3590
+ /** @deprecated */
3591
+ export const length: never;
3592
+ /** @deprecated */
3593
+ export const name: never;
3594
+ /** @deprecated */
3595
+ export const prototype: never;
3596
+ /** @deprecated */
3597
+ export const toString: never;
3598
+ }
3599
+
3600
+ /**
3601
+ * Inspects one or more values whenever they, or the properties they contain, change. Example:
3602
+ *
3603
+ * ```ts
3604
+ * $inspect(someValue, someOtherValue)
3605
+ * ```
3606
+ *
3607
+ * `$inspect` returns a `with` function, which you can invoke with a callback function that
3608
+ * will be called with the value and the event type (`'init'` or `'update'`) on every change.
3609
+ * By default, the values will be logged to the console.
3610
+ *
3611
+ * ```ts
3612
+ * $inspect(x).with(console.trace);
3613
+ * $inspect(x, y).with(() => { debugger; });
3614
+ * ```
3615
+ *
3616
+ * https://svelte.dev/docs/svelte/$inspect
3617
+ */
3618
+ declare function $inspect<T extends any[]>(
3619
+ ...values: T
3620
+ ): { with: (fn: (type: 'init' | 'update', ...values: T) => void) => void };
3621
+
3622
+ declare namespace $inspect {
3623
+ /**
3624
+ * Tracks which reactive state changes caused an effect to re-run. Must be the first
3625
+ * statement of a function body. Example:
3626
+ *
3627
+ * ```svelte
3628
+ * <script>
3629
+ * let count = $state(0);
3630
+ *
3631
+ * $effect(() => {
3632
+ * $inspect.trace('my effect');
3633
+ *
3634
+ * count;
3635
+ * });
3636
+ * </script>
3637
+ */
3638
+ export function trace(name?: string): void;
3639
+
3640
+ // prevent intellisense from being unhelpful
3641
+ /** @deprecated */
3642
+ export const apply: never;
3643
+ /** @deprecated */
3644
+ // @ts-ignore
3645
+ export const arguments: never;
3646
+ /** @deprecated */
3647
+ export const bind: never;
3648
+ /** @deprecated */
3649
+ export const call: never;
3650
+ /** @deprecated */
3651
+ export const caller: never;
3652
+ /** @deprecated */
3653
+ export const length: never;
3654
+ /** @deprecated */
3655
+ export const name: never;
3656
+ /** @deprecated */
3657
+ export const prototype: never;
3658
+ /** @deprecated */
3659
+ export const toString: never;
3660
+ }
3661
+
3662
+ /**
3663
+ * Retrieves the `this` reference of the custom element that contains this component. Example:
3664
+ *
3665
+ * ```svelte
3666
+ * <svelte:options customElement="my-element" />
3667
+ *
3668
+ * <script>
3669
+ * function greet(greeting) {
3670
+ * $host().dispatchEvent(new CustomEvent('greeting', { detail: greeting }))
3671
+ * }
3672
+ * </script>
3673
+ *
3674
+ * <button onclick={() => greet('hello')}>say hello</button>
3675
+ * ```
3676
+ *
3677
+ * Only available inside custom element components, and only on the client-side.
3678
+ *
3679
+ * https://svelte.dev/docs/svelte/$host
3680
+ */
3681
+ declare function $host<El extends HTMLElement = HTMLElement>(): El;
3682
+
3683
+ declare namespace $host {
3684
+ // prevent intellisense from being unhelpful
3685
+ /** @deprecated */
3686
+ export const apply: never;
3687
+ /** @deprecated */
3688
+ // @ts-ignore
3689
+ export const arguments: never;
3690
+ /** @deprecated */
3691
+ export const bind: never;
3692
+ /** @deprecated */
3693
+ export const call: never;
3694
+ /** @deprecated */
3695
+ export const caller: never;
3696
+ /** @deprecated */
3697
+ export const length: never;
3698
+ /** @deprecated */
3699
+ export const name: never;
3700
+ /** @deprecated */
3701
+ export const prototype: never;
3702
+ /** @deprecated */
3703
+ export const toString: never;
3704
+ }
3705
+
3706
+ //# sourceMappingURL=index.d.ts.map