resuxjs 0.3.11 → 0.4.0-beta.3

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 (361) hide show
  1. package/README.md +23 -1
  2. package/dist/bin.d.ts +1 -2
  3. package/dist/bin.js +5 -0
  4. package/dist/bin.js.map +1 -1
  5. package/dist/build/index.d.ts +29 -0
  6. package/dist/build/index.js +51 -0
  7. package/dist/build/index.js.map +1 -0
  8. package/dist/cli.d.ts +19 -8
  9. package/dist/cli.js +2653 -3688
  10. package/dist/cli.js.map +1 -1
  11. package/dist/compiler/adapter.d.ts +19 -15
  12. package/dist/compiler/adapter.js +69 -93
  13. package/dist/compiler/adapter.js.map +1 -1
  14. package/dist/compiler/dev-warnings.d.ts +14 -10
  15. package/dist/compiler/dev-warnings.js +247 -319
  16. package/dist/compiler/dev-warnings.js.map +1 -1
  17. package/dist/compiler/directives.d.ts +7 -3
  18. package/dist/compiler/directives.js +125 -150
  19. package/dist/compiler/directives.js.map +1 -1
  20. package/dist/compiler/implementation.d.ts +117 -112
  21. package/dist/compiler/implementation.js +2954 -3426
  22. package/dist/compiler/index.d.ts +19 -15
  23. package/dist/compiler/index.js +69 -93
  24. package/dist/compiler/index.js.map +1 -1
  25. package/dist/core/config.d.ts +19 -10
  26. package/dist/core/config.js +42 -25
  27. package/dist/core/config.js.map +1 -1
  28. package/dist/core/hooks.d.ts +133 -131
  29. package/dist/core/hooks.js +45 -55
  30. package/dist/core/hooks.js.map +1 -1
  31. package/dist/core/index.d.ts +5 -4
  32. package/dist/core/index.js +6 -5
  33. package/dist/core/module-container.d.ts +97 -93
  34. package/dist/core/module-container.js +180 -185
  35. package/dist/core/module-container.js.map +1 -1
  36. package/dist/core/resux.d.ts +20 -15
  37. package/dist/core/resux.js +18 -13
  38. package/dist/core/resux.js.map +1 -1
  39. package/dist/create-bin.d.ts +1 -2
  40. package/dist/create-bin.js +5 -0
  41. package/dist/create-bin.js.map +1 -1
  42. package/dist/create.d.ts +6 -2
  43. package/dist/create.js +496 -638
  44. package/dist/create.js.map +1 -1
  45. package/dist/deploy/cloudflare.d.ts +7 -2
  46. package/dist/deploy/cloudflare.js +31 -34
  47. package/dist/deploy/cloudflare.js.map +1 -1
  48. package/dist/deploy/common.d.ts +19 -15
  49. package/dist/deploy/common.js +119 -188
  50. package/dist/deploy/common.js.map +1 -1
  51. package/dist/deploy/framework-runtime.d.ts +5 -1
  52. package/dist/deploy/framework-runtime.js +44 -48
  53. package/dist/deploy/framework-runtime.js.map +1 -1
  54. package/dist/deploy/index.d.ts +8 -3
  55. package/dist/deploy/index.js +56 -80
  56. package/dist/deploy/index.js.map +1 -1
  57. package/dist/deploy/netlify.d.ts +7 -2
  58. package/dist/deploy/netlify.js +41 -41
  59. package/dist/deploy/netlify.js.map +1 -1
  60. package/dist/deploy/node.d.ts +7 -2
  61. package/dist/deploy/node.js +24 -19
  62. package/dist/deploy/node.js.map +1 -1
  63. package/dist/deploy/production-report.d.ts +5 -1
  64. package/dist/deploy/production-report.js +15 -14
  65. package/dist/deploy/production-report.js.map +1 -1
  66. package/dist/deploy/runtime-dependencies.d.ts +8 -4
  67. package/dist/deploy/runtime-dependencies.js +158 -220
  68. package/dist/deploy/runtime-dependencies.js.map +1 -1
  69. package/dist/deploy/static.d.ts +7 -2
  70. package/dist/deploy/static.js +17 -14
  71. package/dist/deploy/static.js.map +1 -1
  72. package/dist/deploy/types.d.ts +33 -29
  73. package/dist/deploy/types.js +1 -2
  74. package/dist/deploy/vercel.d.ts +8 -3
  75. package/dist/deploy/vercel.js +138 -188
  76. package/dist/deploy/vercel.js.map +1 -1
  77. package/dist/fonts/index.d.ts +19 -14
  78. package/dist/fonts/index.js +115 -134
  79. package/dist/fonts/index.js.map +1 -1
  80. package/dist/globals.d.ts +79 -78
  81. package/dist/globals.js +1 -2
  82. package/dist/halal-core/ai/classifyProject.d.ts +9 -4
  83. package/dist/halal-core/ai/classifyProject.js +82 -95
  84. package/dist/halal-core/ai/classifyProject.js.map +1 -1
  85. package/dist/halal-core/ai/classifyRuntimeContent.d.ts +8 -3
  86. package/dist/halal-core/ai/classifyRuntimeContent.js +78 -95
  87. package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
  88. package/dist/halal-core/ai/createProjectSummary.d.ts +40 -36
  89. package/dist/halal-core/ai/createProjectSummary.js +39 -39
  90. package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
  91. package/dist/halal-core/ai/halalClassifierPrompt.d.ts +5 -1
  92. package/dist/halal-core/ai/halalClassifierPrompt.js +5 -1
  93. package/dist/halal-core/ai/halalClassifierPrompt.js.map +1 -1
  94. package/dist/halal-core/ai/redactSensitiveData.d.ts +5 -1
  95. package/dist/halal-core/ai/redactSensitiveData.js +82 -110
  96. package/dist/halal-core/ai/redactSensitiveData.js.map +1 -1
  97. package/dist/halal-core/ai/validateAiResponse.d.ts +7 -2
  98. package/dist/halal-core/ai/validateAiResponse.js +56 -83
  99. package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
  100. package/dist/halal-core/cli/check.d.ts +5 -1
  101. package/dist/halal-core/cli/check.js +28 -30
  102. package/dist/halal-core/cli/check.js.map +1 -1
  103. package/dist/halal-core/cli/explain.d.ts +5 -1
  104. package/dist/halal-core/cli/explain.js +27 -31
  105. package/dist/halal-core/cli/explain.js.map +1 -1
  106. package/dist/halal-core/cli/report.d.ts +5 -1
  107. package/dist/halal-core/cli/report.js +14 -10
  108. package/dist/halal-core/cli/report.js.map +1 -1
  109. package/dist/halal-core/cli/submitReview.d.ts +5 -1
  110. package/dist/halal-core/cli/submitReview.js +13 -9
  111. package/dist/halal-core/cli/submitReview.js.map +1 -1
  112. package/dist/halal-core/cli/verifyReview.d.ts +5 -1
  113. package/dist/halal-core/cli/verifyReview.js +17 -15
  114. package/dist/halal-core/cli/verifyReview.js.map +1 -1
  115. package/dist/halal-core/config.d.ts +39 -35
  116. package/dist/halal-core/config.js +77 -118
  117. package/dist/halal-core/config.js.map +1 -1
  118. package/dist/halal-core/crypto/integrity.d.ts +12 -8
  119. package/dist/halal-core/crypto/integrity.js +65 -87
  120. package/dist/halal-core/crypto/integrity.js.map +1 -1
  121. package/dist/halal-core/enforce.d.ts +9 -5
  122. package/dist/halal-core/enforce.js +90 -105
  123. package/dist/halal-core/enforce.js.map +1 -1
  124. package/dist/halal-core/index.d.ts +20 -16
  125. package/dist/halal-core/index.js +19 -19
  126. package/dist/halal-core/lifecycle.d.ts +5 -1
  127. package/dist/halal-core/lifecycle.js +16 -13
  128. package/dist/halal-core/lifecycle.js.map +1 -1
  129. package/dist/halal-core/policy.d.ts +7 -2
  130. package/dist/halal-core/policy.js +7 -2
  131. package/dist/halal-core/policy.js.map +1 -1
  132. package/dist/halal-core/report/formatBrowserOverlay.d.ts +7 -2
  133. package/dist/halal-core/report/formatBrowserOverlay.js +10 -8
  134. package/dist/halal-core/report/formatBrowserOverlay.js.map +1 -1
  135. package/dist/halal-core/report/formatTerminalReport.d.ts +7 -2
  136. package/dist/halal-core/report/formatTerminalReport.js +27 -37
  137. package/dist/halal-core/report/formatTerminalReport.js.map +1 -1
  138. package/dist/halal-core/report/generateHalalReport.d.ts +11 -6
  139. package/dist/halal-core/report/generateHalalReport.js +25 -27
  140. package/dist/halal-core/report/generateHalalReport.js.map +1 -1
  141. package/dist/halal-core/report/signReport.d.ts +8 -3
  142. package/dist/halal-core/report/signReport.js +17 -12
  143. package/dist/halal-core/report/signReport.js.map +1 -1
  144. package/dist/halal-core/report/verifyReport.d.ts +14 -9
  145. package/dist/halal-core/report/verifyReport.js +52 -41
  146. package/dist/halal-core/report/verifyReport.js.map +1 -1
  147. package/dist/halal-core/review/createReviewRequest.d.ts +7 -2
  148. package/dist/halal-core/review/createReviewRequest.js +21 -17
  149. package/dist/halal-core/review/createReviewRequest.js.map +1 -1
  150. package/dist/halal-core/review/reviewPolicy.d.ts +7 -3
  151. package/dist/halal-core/review/reviewPolicy.js +19 -17
  152. package/dist/halal-core/review/reviewPolicy.js.map +1 -1
  153. package/dist/halal-core/review/signedReviewFile.d.ts +17 -12
  154. package/dist/halal-core/review/signedReviewFile.js +25 -22
  155. package/dist/halal-core/review/signedReviewFile.js.map +1 -1
  156. package/dist/halal-core/review/verifyReviewApproval.d.ts +12 -8
  157. package/dist/halal-core/review/verifyReviewApproval.js +69 -62
  158. package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
  159. package/dist/halal-core/rules/adultContentRules.d.ts +6 -2
  160. package/dist/halal-core/rules/adultContentRules.js +23 -23
  161. package/dist/halal-core/rules/adultContentRules.js.map +1 -1
  162. package/dist/halal-core/rules/alcoholDrugVapeRules.d.ts +6 -2
  163. package/dist/halal-core/rules/alcoholDrugVapeRules.js +22 -22
  164. package/dist/halal-core/rules/alcoholDrugVapeRules.js.map +1 -1
  165. package/dist/halal-core/rules/childSafetyRules.d.ts +6 -2
  166. package/dist/halal-core/rules/childSafetyRules.js +19 -19
  167. package/dist/halal-core/rules/childSafetyRules.js.map +1 -1
  168. package/dist/halal-core/rules/coreCategories.d.ts +10 -6
  169. package/dist/halal-core/rules/coreCategories.js +237 -110
  170. package/dist/halal-core/rules/coreCategories.js.map +1 -1
  171. package/dist/halal-core/rules/cyberAbuseRules.d.ts +6 -2
  172. package/dist/halal-core/rules/cyberAbuseRules.js +27 -27
  173. package/dist/halal-core/rules/cyberAbuseRules.js.map +1 -1
  174. package/dist/halal-core/rules/defaultBlockedRules.d.ts +24 -19
  175. package/dist/halal-core/rules/defaultBlockedRules.js +156 -199
  176. package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
  177. package/dist/halal-core/rules/dependencyRules.d.ts +11 -7
  178. package/dist/halal-core/rules/dependencyRules.js +50 -56
  179. package/dist/halal-core/rules/dependencyRules.js.map +1 -1
  180. package/dist/halal-core/rules/endpointRules.d.ts +9 -5
  181. package/dist/halal-core/rules/endpointRules.js +21 -23
  182. package/dist/halal-core/rules/endpointRules.js.map +1 -1
  183. package/dist/halal-core/rules/environmentalHarmRules.d.ts +6 -2
  184. package/dist/halal-core/rules/environmentalHarmRules.js +17 -17
  185. package/dist/halal-core/rules/environmentalHarmRules.js.map +1 -1
  186. package/dist/halal-core/rules/financeRibaRules.d.ts +6 -2
  187. package/dist/halal-core/rules/financeRibaRules.js +20 -20
  188. package/dist/halal-core/rules/financeRibaRules.js.map +1 -1
  189. package/dist/halal-core/rules/gamblingRules.d.ts +6 -2
  190. package/dist/halal-core/rules/gamblingRules.js +22 -22
  191. package/dist/halal-core/rules/gamblingRules.js.map +1 -1
  192. package/dist/halal-core/rules/generalHarmRules.d.ts +6 -2
  193. package/dist/halal-core/rules/generalHarmRules.js +15 -15
  194. package/dist/halal-core/rules/generalHarmRules.js.map +1 -1
  195. package/dist/halal-core/rules/healthHarmRules.d.ts +6 -2
  196. package/dist/halal-core/rules/healthHarmRules.js +19 -19
  197. package/dist/halal-core/rules/healthHarmRules.js.map +1 -1
  198. package/dist/halal-core/rules/keywordRules.d.ts +13 -9
  199. package/dist/halal-core/rules/keywordRules.js +90 -39
  200. package/dist/halal-core/rules/keywordRules.js.map +1 -1
  201. package/dist/halal-core/rules/privacyAbuseRules.d.ts +6 -2
  202. package/dist/halal-core/rules/privacyAbuseRules.js +21 -21
  203. package/dist/halal-core/rules/privacyAbuseRules.js.map +1 -1
  204. package/dist/halal-core/rules/scamFraudRules.d.ts +6 -2
  205. package/dist/halal-core/rules/scamFraudRules.js +29 -29
  206. package/dist/halal-core/rules/scamFraudRules.js.map +1 -1
  207. package/dist/halal-core/rules/selfHarmRules.d.ts +6 -2
  208. package/dist/halal-core/rules/selfHarmRules.js +17 -17
  209. package/dist/halal-core/rules/selfHarmRules.js.map +1 -1
  210. package/dist/halal-core/rules/violenceExtremismRules.d.ts +6 -2
  211. package/dist/halal-core/rules/violenceExtremismRules.js +30 -30
  212. package/dist/halal-core/rules/violenceExtremismRules.js.map +1 -1
  213. package/dist/halal-core/runtime/guard.d.ts +22 -17
  214. package/dist/halal-core/runtime/guard.js +163 -183
  215. package/dist/halal-core/runtime/guard.js.map +1 -1
  216. package/dist/halal-core/runtime/index.d.ts +5 -4
  217. package/dist/halal-core/runtime/index.js +5 -5
  218. package/dist/halal-core/runtime/reviewedMemory.d.ts +10 -5
  219. package/dist/halal-core/runtime/reviewedMemory.js +75 -110
  220. package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
  221. package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +17 -12
  222. package/dist/halal-core/runtime/serializeRuntimeContent.js +133 -156
  223. package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
  224. package/dist/halal-core/runtime/types.d.ts +55 -50
  225. package/dist/halal-core/runtime/types.js +1 -2
  226. package/dist/halal-core/scanner/scanApiRoutes.d.ts +5 -1
  227. package/dist/halal-core/scanner/scanApiRoutes.js +33 -36
  228. package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
  229. package/dist/halal-core/scanner/scanComponents.d.ts +5 -1
  230. package/dist/halal-core/scanner/scanComponents.js +13 -13
  231. package/dist/halal-core/scanner/scanComponents.js.map +1 -1
  232. package/dist/halal-core/scanner/scanContent.d.ts +8 -4
  233. package/dist/halal-core/scanner/scanContent.js +192 -261
  234. package/dist/halal-core/scanner/scanContent.js.map +1 -1
  235. package/dist/halal-core/scanner/scanDependencies.d.ts +5 -1
  236. package/dist/halal-core/scanner/scanDependencies.js +17 -15
  237. package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
  238. package/dist/halal-core/scanner/scanDomains.d.ts +7 -3
  239. package/dist/halal-core/scanner/scanDomains.js +12 -12
  240. package/dist/halal-core/scanner/scanDomains.js.map +1 -1
  241. package/dist/halal-core/scanner/scanEnvNames.d.ts +5 -1
  242. package/dist/halal-core/scanner/scanEnvNames.js +24 -26
  243. package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
  244. package/dist/halal-core/scanner/scanMetadata.d.ts +9 -5
  245. package/dist/halal-core/scanner/scanMetadata.js +21 -29
  246. package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
  247. package/dist/halal-core/scanner/scanPages.d.ts +5 -1
  248. package/dist/halal-core/scanner/scanPages.js +13 -15
  249. package/dist/halal-core/scanner/scanPages.js.map +1 -1
  250. package/dist/halal-core/scanner/scanProject.d.ts +19 -12
  251. package/dist/halal-core/scanner/scanProject.js +44 -49
  252. package/dist/halal-core/scanner/scanProject.js.map +1 -1
  253. package/dist/halal-core/scanner/scanRoutes.d.ts +5 -1
  254. package/dist/halal-core/scanner/scanRoutes.js +33 -39
  255. package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
  256. package/dist/halal-core/scanner/scanTranslations.d.ts +5 -1
  257. package/dist/halal-core/scanner/scanTranslations.js +22 -29
  258. package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
  259. package/dist/halal-core/status.d.ts +17 -13
  260. package/dist/halal-core/status.js +1 -2
  261. package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +5 -1
  262. package/dist/halal-core/tamper/verifyCoreIntegrity.js +27 -24
  263. package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
  264. package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +5 -1
  265. package/dist/halal-core/tamper/verifyLifecycleHooks.js +13 -12
  266. package/dist/halal-core/tamper/verifyLifecycleHooks.js.map +1 -1
  267. package/dist/halal-core/tamper/verifyReportSignature.d.ts +9 -4
  268. package/dist/halal-core/tamper/verifyReportSignature.js +20 -14
  269. package/dist/halal-core/tamper/verifyReportSignature.js.map +1 -1
  270. package/dist/halal.d.ts +20 -1
  271. package/dist/halal.js +19 -2
  272. package/dist/i18n/index.d.ts +44 -40
  273. package/dist/i18n/index.js +218 -288
  274. package/dist/i18n/index.js.map +1 -1
  275. package/dist/i18n/shared.d.ts +33 -29
  276. package/dist/i18n/shared.js +204 -266
  277. package/dist/i18n/shared.js.map +1 -1
  278. package/dist/icons/index.d.ts +160 -154
  279. package/dist/icons/index.js +323 -273
  280. package/dist/icons/index.js.map +1 -1
  281. package/dist/index.d.ts +8 -1
  282. package/dist/index.js +8 -2
  283. package/dist/kit/index.d.ts +32 -27
  284. package/dist/kit/index.js +46 -43
  285. package/dist/kit/index.js.map +1 -1
  286. package/dist/nitro-server/index.d.ts +10 -6
  287. package/dist/nitro-server/index.js +6 -2
  288. package/dist/nitro-server/index.js.map +1 -1
  289. package/dist/node.d.ts +9 -4
  290. package/dist/node.js +89 -116
  291. package/dist/node.js.map +1 -1
  292. package/dist/reactivity/computed.d.ts +11 -6
  293. package/dist/reactivity/computed.js +46 -53
  294. package/dist/reactivity/computed.js.map +1 -1
  295. package/dist/reactivity/effect.d.ts +23 -18
  296. package/dist/reactivity/effect.js +105 -147
  297. package/dist/reactivity/effect.js.map +1 -1
  298. package/dist/reactivity/index.d.ts +8 -8
  299. package/dist/reactivity/index.js +8 -8
  300. package/dist/reactivity/reactive.d.ts +9 -5
  301. package/dist/reactivity/reactive.js +95 -134
  302. package/dist/reactivity/reactive.js.map +1 -1
  303. package/dist/reactivity/readonly.d.ts +2 -1
  304. package/dist/reactivity/readonly.js +3 -2
  305. package/dist/reactivity/ref.d.ts +23 -21
  306. package/dist/reactivity/ref.js +71 -81
  307. package/dist/reactivity/ref.js.map +1 -1
  308. package/dist/reactivity/scheduler.d.ts +8 -5
  309. package/dist/reactivity/scheduler.js +67 -69
  310. package/dist/reactivity/scheduler.js.map +1 -1
  311. package/dist/reactivity/types.d.ts +29 -25
  312. package/dist/reactivity/types.js +1 -2
  313. package/dist/reactivity/utils.d.ts +17 -13
  314. package/dist/reactivity/utils.js +25 -24
  315. package/dist/reactivity/utils.js.map +1 -1
  316. package/dist/reactivity/watch.d.ts +8 -4
  317. package/dist/reactivity/watch.js +74 -103
  318. package/dist/reactivity/watch.js.map +1 -1
  319. package/dist/runtime/core.d.ts +32 -0
  320. package/dist/runtime/core.js +155 -0
  321. package/dist/runtime/core.js.map +1 -0
  322. package/dist/runtime/index.d.ts +649 -622
  323. package/dist/runtime/index.js +4105 -5243
  324. package/dist/runtime/index.js.map +1 -1
  325. package/dist/runtime/reactivity.d.ts +7 -0
  326. package/dist/runtime/reactivity.js +7 -0
  327. package/dist/runtime/resume.d.ts +80 -0
  328. package/dist/runtime/resume.js +482 -0
  329. package/dist/runtime/resume.js.map +1 -0
  330. package/dist/runtime/router.d.ts +21 -0
  331. package/dist/runtime/router.js +60 -0
  332. package/dist/runtime/router.js.map +1 -0
  333. package/dist/runtime/streaming.d.ts +25 -0
  334. package/dist/runtime/streaming.js +200 -0
  335. package/dist/runtime/streaming.js.map +1 -0
  336. package/dist/security/media-fetch.d.ts +33 -0
  337. package/dist/security/media-fetch.js +302 -0
  338. package/dist/security/media-fetch.js.map +1 -0
  339. package/dist/security/path-boundary.d.ts +8 -0
  340. package/dist/security/path-boundary.js +71 -0
  341. package/dist/security/path-boundary.js.map +1 -0
  342. package/dist/ui/index.d.ts +1774 -1768
  343. package/dist/ui/index.js +974 -674
  344. package/dist/ui/index.js.map +1 -1
  345. package/dist/vite-builder/index.d.ts +9 -5
  346. package/dist/vite-builder/index.js +6 -2
  347. package/dist/vite-builder/index.js.map +1 -1
  348. package/package.json +46 -86
  349. package/dist/compiler/implementation.js.map +0 -1
  350. package/dist/core/index.js.map +0 -1
  351. package/dist/deploy/types.js.map +0 -1
  352. package/dist/globals.js.map +0 -1
  353. package/dist/halal-core/index.js.map +0 -1
  354. package/dist/halal-core/runtime/index.js.map +0 -1
  355. package/dist/halal-core/runtime/types.js.map +0 -1
  356. package/dist/halal-core/status.js.map +0 -1
  357. package/dist/halal.js.map +0 -1
  358. package/dist/index.js.map +0 -1
  359. package/dist/reactivity/index.js.map +0 -1
  360. package/dist/reactivity/readonly.js.map +0 -1
  361. package/dist/reactivity/types.js.map +0 -1
@@ -1,651 +1,678 @@
1
- import { computed, isReactive, isReadonly, isRef, nextTick, reactive, readonly, ref, toRef, toRefs, unref, watch, watchEffect } from "../reactivity/index.js";
2
- import type { Ref, WatchCallback, WatchOptions, WatchSource, WatchStopHandle } from "../reactivity/index.js";
3
- export type JsonValue = null | boolean | number | string | JsonValue[] | {
4
- [key: string]: JsonValue;
1
+ import { ComputedRef, MaybeRef, MaybeRefOrGetter, ReactiveEffectOptions, ReactiveEffectRunner, Ref, WatchCallback, WatchOptions, WatchSource, WatchStopHandle } from "../reactivity/types.js";
2
+ import { isRef, ref, toRef, toRefs, unref } from "../reactivity/ref.js";
3
+ import { isReactive, isReadonly, reactive, readonly } from "../reactivity/reactive.js";
4
+ import { computed } from "../reactivity/computed.js";
5
+ import { watch, watchEffect } from "../reactivity/watch.js";
6
+ import { nextTick } from "../reactivity/scheduler.js";
7
+
8
+ //#region src/runtime/index.d.ts
9
+ type JsonValue = null | boolean | number | string | JsonValue[] | {
10
+ [key: string]: JsonValue;
5
11
  };
6
- export { ref, reactive, computed, watch, watchEffect, readonly, toRef, toRefs, unref, isRef, isReactive, isReadonly, nextTick };
7
- export type { Ref, ComputedRef, MaybeRef, MaybeRefOrGetter, WatchSource, WatchOptions, WatchCallback, WatchStopHandle, ReactiveEffectOptions, ReactiveEffectRunner } from "../reactivity/index.js";
8
- export interface AsyncDataError {
9
- name: string;
10
- message: string;
11
- }
12
- export interface ResuxError extends Error {
13
- statusCode?: number;
14
- fatal?: boolean;
15
- data?: JsonValue;
16
- }
17
- export interface AsyncDataResource<T = unknown> {
18
- data: Ref<T | undefined>;
19
- value: Ref<T | undefined>;
20
- pending: Ref<boolean>;
21
- error: Ref<AsyncDataError | null>;
22
- then<TResult1 = AwaitedAsyncDataResource<T>, TResult2 = never>(onfulfilled?: ((value: AwaitedAsyncDataResource<T>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
23
- }
24
- export interface AwaitedAsyncDataResource<T = unknown> {
25
- data: Ref<T | undefined>;
26
- value: Ref<T | undefined>;
27
- pending: Ref<boolean>;
28
- error: Ref<AsyncDataError | null>;
29
- }
30
- export interface AsyncDataHandlerContext {
31
- signal?: AbortSignal;
32
- }
33
- export interface RouteContext {
34
- path: string;
35
- params: Record<string, string>;
36
- query: Record<string, string | string[]>;
37
- origin?: string;
38
- userAgent?: string;
39
- }
40
- export interface ResuxRouter {
41
- push(to: string): Promise<void> | void;
42
- replace(to: string): Promise<void> | void;
43
- back(): void;
44
- forward(): void;
45
- go(delta: number): void;
46
- }
47
- export interface PageMeta {
48
- layout?: string | false;
49
- middleware?: string | string[];
50
- title?: string | Record<string, string>;
51
- meta?: Array<Record<string, string>>;
52
- }
53
- export interface HeadEntry {
54
- title?: string;
55
- meta?: Array<Record<string, string>>;
56
- link?: Array<Record<string, string>>;
57
- style?: ComponentStyle[];
58
- htmlAttrs?: Record<string, string>;
59
- }
60
- export interface ComponentStyle {
61
- id: string;
62
- css: string;
63
- scoped?: boolean;
64
- }
65
- export type SeoMetaValue = string | number | boolean | null | undefined;
66
- export interface SeoMetaInput {
67
- title?: SeoMetaValue;
68
- description?: SeoMetaValue | SeoMetaValue[];
69
- keywords?: SeoMetaValue | SeoMetaValue[];
70
- robots?: SeoMetaValue;
71
- author?: SeoMetaValue;
72
- themeColor?: SeoMetaValue;
73
- colorScheme?: SeoMetaValue;
74
- applicationName?: SeoMetaValue;
75
- referrer?: SeoMetaValue;
76
- generator?: SeoMetaValue;
77
- ogTitle?: SeoMetaValue;
78
- ogDescription?: SeoMetaValue;
79
- ogImage?: SeoMetaValue | SeoMetaValue[];
80
- ogImageSecureUrl?: SeoMetaValue;
81
- ogImageAlt?: SeoMetaValue;
82
- ogImageWidth?: SeoMetaValue;
83
- ogImageHeight?: SeoMetaValue;
84
- ogUrl?: SeoMetaValue;
85
- ogType?: SeoMetaValue;
86
- ogSiteName?: SeoMetaValue;
87
- ogLocale?: SeoMetaValue;
88
- fbAppId?: SeoMetaValue;
89
- twitterCard?: SeoMetaValue;
90
- twitterTitle?: SeoMetaValue;
91
- twitterDescription?: SeoMetaValue;
92
- twitterImage?: SeoMetaValue | SeoMetaValue[];
93
- twitterImageAlt?: SeoMetaValue;
94
- twitterSite?: SeoMetaValue;
95
- twitterCreator?: SeoMetaValue;
96
- twitterUrl?: SeoMetaValue;
97
- [key: string]: SeoMetaValue | SeoMetaValue[];
98
- }
99
- export interface RuntimeConfig {
100
- public: Record<string, JsonValue>;
101
- [key: string]: unknown;
102
- }
103
- export type ResuxImageFit = "cover" | "contain" | "fill" | "inside" | "outside";
104
- export type ResuxImageCacheInput = boolean | string | number | {
105
- maxAge?: number | string;
106
- expiresIn?: number | string;
107
- ttl?: number | string;
12
+ interface AsyncDataError {
13
+ name: string;
14
+ message: string;
15
+ }
16
+ interface ResuxError extends Error {
17
+ statusCode?: number;
18
+ fatal?: boolean;
19
+ data?: JsonValue;
20
+ }
21
+ interface AsyncDataResource<T = unknown> {
22
+ data: Ref<T | undefined>;
23
+ value: Ref<T | undefined>;
24
+ pending: Ref<boolean>;
25
+ error: Ref<AsyncDataError | null>;
26
+ then<TResult1 = AwaitedAsyncDataResource<T>, TResult2 = never>(onfulfilled?: ((value: AwaitedAsyncDataResource<T>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
27
+ }
28
+ interface AwaitedAsyncDataResource<T = unknown> {
29
+ data: Ref<T | undefined>;
30
+ value: Ref<T | undefined>;
31
+ pending: Ref<boolean>;
32
+ error: Ref<AsyncDataError | null>;
33
+ }
34
+ interface AsyncDataHandlerContext {
35
+ signal?: AbortSignal;
36
+ }
37
+ interface RouteContext {
38
+ path: string;
39
+ params: Record<string, string>;
40
+ query: Record<string, string | string[]>;
41
+ origin?: string;
42
+ userAgent?: string;
43
+ }
44
+ interface ResuxRouter {
45
+ push(to: string): Promise<void> | void;
46
+ replace(to: string): Promise<void> | void;
47
+ back(): void;
48
+ forward(): void;
49
+ go(delta: number): void;
50
+ }
51
+ interface PageMeta {
52
+ layout?: string | false;
53
+ middleware?: string | string[];
54
+ title?: string | Record<string, string>;
55
+ meta?: Array<Record<string, string>>;
56
+ }
57
+ interface HeadEntry {
58
+ title?: string;
59
+ meta?: Array<Record<string, string>>;
60
+ link?: Array<Record<string, string>>;
61
+ style?: ComponentStyle[];
62
+ htmlAttrs?: Record<string, string>;
63
+ }
64
+ interface ComponentStyle {
65
+ id: string;
66
+ css: string;
67
+ scoped?: boolean;
68
+ }
69
+ type SeoMetaValue = string | number | boolean | null | undefined;
70
+ interface SeoMetaInput {
71
+ title?: SeoMetaValue;
72
+ description?: SeoMetaValue | SeoMetaValue[];
73
+ keywords?: SeoMetaValue | SeoMetaValue[];
74
+ robots?: SeoMetaValue;
75
+ author?: SeoMetaValue;
76
+ themeColor?: SeoMetaValue;
77
+ colorScheme?: SeoMetaValue;
78
+ applicationName?: SeoMetaValue;
79
+ referrer?: SeoMetaValue;
80
+ generator?: SeoMetaValue;
81
+ ogTitle?: SeoMetaValue;
82
+ ogDescription?: SeoMetaValue;
83
+ ogImage?: SeoMetaValue | SeoMetaValue[];
84
+ ogImageSecureUrl?: SeoMetaValue;
85
+ ogImageAlt?: SeoMetaValue;
86
+ ogImageWidth?: SeoMetaValue;
87
+ ogImageHeight?: SeoMetaValue;
88
+ ogUrl?: SeoMetaValue;
89
+ ogType?: SeoMetaValue;
90
+ ogSiteName?: SeoMetaValue;
91
+ ogLocale?: SeoMetaValue;
92
+ fbAppId?: SeoMetaValue;
93
+ twitterCard?: SeoMetaValue;
94
+ twitterTitle?: SeoMetaValue;
95
+ twitterDescription?: SeoMetaValue;
96
+ twitterImage?: SeoMetaValue | SeoMetaValue[];
97
+ twitterImageAlt?: SeoMetaValue;
98
+ twitterSite?: SeoMetaValue;
99
+ twitterCreator?: SeoMetaValue;
100
+ twitterUrl?: SeoMetaValue;
101
+ [key: string]: SeoMetaValue | SeoMetaValue[];
102
+ }
103
+ interface RuntimeConfig {
104
+ public: Record<string, JsonValue>;
105
+ [key: string]: unknown;
106
+ }
107
+ type ResuxImageFit = "cover" | "contain" | "fill" | "inside" | "outside";
108
+ type ResuxImageCacheInput = boolean | string | number | {
109
+ maxAge?: number | string;
110
+ expiresIn?: number | string;
111
+ ttl?: number | string;
108
112
  };
109
- export interface ResuxImageModifiers {
110
- width?: number;
111
- height?: number;
112
- quality?: number | false;
113
- format?: string | false;
114
- fit?: ResuxImageFit;
115
- [key: string]: string | number | boolean | undefined;
116
- }
117
- export interface ResuxImageProviderConfig {
118
- baseURL?: string;
119
- modifiers?: ResuxImageModifiers;
120
- }
121
- export interface ResuxImageConfig {
122
- provider?: string;
123
- quality?: number;
124
- format?: string;
125
- cache?: ResuxImageCacheInput;
126
- densities?: number[];
127
- providers?: Record<string, ResuxImageProviderConfig>;
128
- }
129
- export interface UseResuxImageOptions {
130
- provider?: string;
131
- modifiers?: ResuxImageModifiers;
132
- width?: number;
133
- height?: number;
134
- quality?: number;
135
- fit?: ResuxImageFit;
136
- format?: string;
137
- cache?: ResuxImageCacheInput;
138
- }
139
- export type ResuxImageBuilder = (src: string, options?: UseResuxImageOptions) => string;
140
- export interface ResuxAppInjections {
141
- }
142
- export type ResuxSupportMode = "all" | "server" | "client";
143
- export interface ClientPluginManifestRecord {
144
- id: string;
113
+ interface ResuxImageModifiers {
114
+ width?: number;
115
+ height?: number;
116
+ quality?: number | false;
117
+ format?: string | false;
118
+ fit?: ResuxImageFit;
119
+ [key: string]: string | number | boolean | undefined;
120
+ }
121
+ interface ResuxImageProviderConfig {
122
+ baseURL?: string;
123
+ modifiers?: ResuxImageModifiers;
124
+ }
125
+ interface ResuxImageConfig {
126
+ provider?: string;
127
+ quality?: number;
128
+ format?: string;
129
+ cache?: ResuxImageCacheInput;
130
+ densities?: number[];
131
+ providers?: Record<string, ResuxImageProviderConfig>;
132
+ }
133
+ interface UseResuxImageOptions {
134
+ provider?: string;
135
+ modifiers?: ResuxImageModifiers;
136
+ width?: number;
137
+ height?: number;
138
+ quality?: number;
139
+ fit?: ResuxImageFit;
140
+ format?: string;
141
+ cache?: ResuxImageCacheInput;
142
+ }
143
+ type ResuxImageBuilder = (src: string, options?: UseResuxImageOptions) => string;
144
+ interface ResuxAppInjections {}
145
+ type ResuxSupportMode = "all" | "server" | "client";
146
+ interface ClientPluginManifestRecord {
147
+ id: string;
148
+ file: string;
149
+ mode: ResuxSupportMode;
150
+ src: string;
151
+ }
152
+ interface ClientRouteMiddlewareManifestRecord {
153
+ id: string;
154
+ name: string;
155
+ file: string;
156
+ global: boolean;
157
+ mode: ResuxSupportMode;
158
+ src: string;
159
+ }
160
+ type ResuxAppProvides = ResuxAppInjections & Record<string, unknown>;
161
+ interface ResuxAppLike {
162
+ route: RouteContext;
163
+ payload: ResuxPayload;
164
+ $config: RuntimeConfig;
165
+ provides: ResuxAppProvides;
166
+ provide<Key extends keyof ResuxAppInjections & string>(key: Key, value: ResuxAppInjections[Key]): void;
167
+ provide<Key extends string, Value>(key: Key, value: Value): void;
168
+ vueApp?: any;
169
+ }
170
+ type ResuxPlugin = (resuxApp: ResuxAppLike) => unknown | Promise<unknown>;
171
+ interface ResuxModuleContext {
172
+ rootDir: string;
173
+ buildDir: string;
174
+ options: Record<string, unknown>;
175
+ addCss(href: string): void;
176
+ addHead(head: Record<string, unknown>): void;
177
+ addRouteRule(path: string, rule: Record<string, unknown>): void;
178
+ extendRuntimeConfig(config: Record<string, unknown>): void;
179
+ hook(name: string, handler: (payload: unknown) => void | Promise<void>): () => void;
180
+ addComponent(component: string | {
145
181
  file: string;
146
- mode: ResuxSupportMode;
182
+ name?: string;
183
+ global?: boolean;
184
+ mode?: ResuxSupportMode;
185
+ lazy?: boolean;
186
+ }): void;
187
+ addComponentsDir(dir: string | {
188
+ path: string;
189
+ global?: boolean;
190
+ mode?: ResuxSupportMode;
191
+ pathPrefix?: boolean;
192
+ }): void;
193
+ addImports(imports: {
194
+ from: string;
195
+ name: string;
196
+ as?: string;
197
+ } | Array<{
198
+ from: string;
199
+ name: string;
200
+ as?: string;
201
+ }>): void;
202
+ addImportsDir(dir: string): void;
203
+ addPlugin(plugin: string | {
147
204
  src: string;
148
- }
149
- export interface ClientRouteMiddlewareManifestRecord {
150
- id: string;
205
+ mode?: ResuxSupportMode;
206
+ }): void;
207
+ addRouteMiddleware(middleware: {
151
208
  name: string;
152
- file: string;
153
- global: boolean;
154
- mode: ResuxSupportMode;
155
209
  src: string;
156
- }
157
- export type ResuxAppProvides = ResuxAppInjections & Record<string, unknown>;
158
- export interface ResuxAppLike {
159
- route: RouteContext;
160
- payload: ResuxPayload;
161
- $config: RuntimeConfig;
162
- provides: ResuxAppProvides;
163
- provide<Key extends keyof ResuxAppInjections & string>(key: Key, value: ResuxAppInjections[Key]): void;
164
- provide<Key extends string, Value>(key: Key, value: Value): void;
165
- vueApp?: any;
166
- }
167
- export type ResuxPlugin = (resuxApp: ResuxAppLike) => unknown | Promise<unknown>;
168
- export interface ResuxModuleContext {
169
- rootDir: string;
170
- buildDir: string;
171
- options: Record<string, unknown>;
172
- addCss(href: string): void;
173
- addHead(head: Record<string, unknown>): void;
174
- addRouteRule(path: string, rule: Record<string, unknown>): void;
175
- extendRuntimeConfig(config: Record<string, unknown>): void;
176
- hook(name: string, handler: (payload: unknown) => void | Promise<void>): () => void;
177
- addComponent(component: string | {
178
- file: string;
179
- name?: string;
180
- global?: boolean;
181
- mode?: ResuxSupportMode;
182
- lazy?: boolean;
183
- }): void;
184
- addComponentsDir(dir: string | {
185
- path: string;
186
- global?: boolean;
187
- mode?: ResuxSupportMode;
188
- pathPrefix?: boolean;
189
- }): void;
190
- addImports(imports: {
191
- from: string;
192
- name: string;
193
- as?: string;
194
- } | Array<{
195
- from: string;
196
- name: string;
197
- as?: string;
198
- }>): void;
199
- addImportsDir(dir: string): void;
200
- addPlugin(plugin: string | {
201
- src: string;
202
- mode?: ResuxSupportMode;
203
- }): void;
204
- addRouteMiddleware(middleware: {
205
- name: string;
206
- src: string;
207
- global?: boolean;
208
- mode?: ResuxSupportMode;
209
- }): void;
210
- addServerHandler(handler: {
211
- route: string;
212
- handler: string;
213
- middleware?: boolean;
214
- method?: string;
215
- }): void;
216
- addServerPlugin(plugin: string): void;
217
- addTemplate(template: {
218
- filename: string;
219
- getContents: () => string | Promise<string>;
220
- write?: boolean;
221
- }): void;
222
- addTypeTemplate(template: {
223
- filename: string;
224
- getContents: () => string | Promise<string>;
225
- write?: boolean;
226
- }): void;
227
- extendPages(extender: (pages: Array<Record<string, unknown>>) => void | Promise<void>): void;
228
- extendViteConfig(extender: (config: Record<string, unknown>) => void | Promise<void>): void;
229
- extendNitroConfig(extender: (config: Record<string, unknown>) => void | Promise<void>): void;
230
- addVitePlugin(plugin: unknown): void;
231
- addPrerenderRoutes(route: string | string[]): void;
232
- }
233
- export type ResuxModule<TOptions = Record<string, unknown>> = ((options: TOptions, context: ResuxModuleContext) => unknown | Promise<unknown>) | {
234
- meta?: {
235
- name?: string;
236
- configKey?: string;
237
- };
238
- defaults?: TOptions;
239
- setup: (options: TOptions, context: ResuxModuleContext) => unknown | Promise<unknown>;
210
+ global?: boolean;
211
+ mode?: ResuxSupportMode;
212
+ }): void;
213
+ addServerHandler(handler: {
214
+ route: string;
215
+ handler: string;
216
+ middleware?: boolean;
217
+ method?: string;
218
+ }): void;
219
+ addServerPlugin(plugin: string): void;
220
+ addTemplate(template: {
221
+ filename: string;
222
+ getContents: () => string | Promise<string>;
223
+ write?: boolean;
224
+ }): void;
225
+ addTypeTemplate(template: {
226
+ filename: string;
227
+ getContents: () => string | Promise<string>;
228
+ write?: boolean;
229
+ }): void;
230
+ extendPages(extender: (pages: Array<Record<string, unknown>>) => void | Promise<void>): void;
231
+ extendViteConfig(extender: (config: Record<string, unknown>) => void | Promise<void>): void;
232
+ extendNitroConfig(extender: (config: Record<string, unknown>) => void | Promise<void>): void;
233
+ addVitePlugin(plugin: unknown): void;
234
+ addPrerenderRoutes(route: string | string[]): void;
235
+ }
236
+ type ResuxModule<TOptions = Record<string, unknown>> = ((options: TOptions, context: ResuxModuleContext) => unknown | Promise<unknown>) | {
237
+ meta?: {
238
+ name?: string;
239
+ configKey?: string;
240
+ };
241
+ defaults?: TOptions;
242
+ setup: (options: TOptions, context: ResuxModuleContext) => unknown | Promise<unknown>;
240
243
  };
241
- export type ResuxDeployTarget = "auto" | "node" | "vercel" | "netlify" | "cloudflare" | "static";
242
- export interface ResuxDeployOptions {
243
- target?: ResuxDeployTarget;
244
- nitroPreset?: string;
245
- }
246
- export interface ResuxConfigInput extends Record<string, unknown> {
247
- builder?: string;
248
- serverBuilder?: string;
249
- buildDir?: string;
250
- compatibilityDate?: string;
251
- deploy?: ResuxDeployOptions;
252
- i18n?: Record<string, unknown>;
253
- packages?: ResuxPackagesConfig;
254
- video?: Record<string, unknown>;
255
- }
256
- export interface ResuxPackageCssMap {
257
- [packageName: string]: string[];
258
- }
259
- export type ResuxPackageMode = "ssr" | "clientOnly" | "serverOnly" | "progressive";
260
- export interface ResuxPackageModeMap {
261
- [packageName: string]: ResuxPackageMode;
262
- }
263
- export interface ResuxPackagesConfig {
264
- lazy?: boolean | string[];
265
- clientOnly?: string[];
266
- serverOnly?: string[];
267
- mode?: ResuxPackageModeMap;
268
- external?: string[];
269
- noExternal?: string[];
270
- transpile?: string[];
271
- optimizeDeps?: string[];
272
- css?: string[] | ResuxPackageCssMap;
273
- aliases?: Record<string, string>;
274
- guards?: boolean;
275
- diagnostics?: boolean;
276
- }
277
- export interface ResuxClientPackageImportRegistry {
278
- importers?: string[];
279
- css?: Record<string, string[]>;
280
- declared?: string[];
281
- }
282
- export interface ClientRuntimeSourceOptions {
283
- packageRegistry?: ResuxClientPackageImportRegistry;
284
- }
285
- export interface ResuxLazyPackageOptions {
286
- clientOnly?: boolean;
287
- mode?: ResuxPackageMode;
288
- css?: string[];
289
- exportName?: string;
290
- preferDefault?: boolean;
291
- }
292
- export type ResuxLazyPackageLoader<T = unknown> = () => Promise<T>;
293
- export type ClientEnhancementTrigger = "visible" | "interaction" | "idle" | "immediate" | "manual" | "page-load";
294
- export interface ClientEnhancementContext {
244
+ type ResuxDeployTarget = "auto" | "node" | "vercel" | "netlify" | "cloudflare" | "static";
245
+ interface ResuxDeployOptions {
246
+ target?: ResuxDeployTarget;
247
+ nitroPreset?: string;
248
+ }
249
+ interface ResuxConfigInput extends Record<string, unknown> {
250
+ builder?: string;
251
+ serverBuilder?: string;
252
+ buildDir?: string;
253
+ compatibilityDate?: string;
254
+ deploy?: ResuxDeployOptions;
255
+ i18n?: Record<string, unknown>;
256
+ packages?: ResuxPackagesConfig;
257
+ video?: Record<string, unknown>;
258
+ }
259
+ interface ResuxPackageCssMap {
260
+ [packageName: string]: string[];
261
+ }
262
+ type ResuxPackageMode = "ssr" | "clientOnly" | "serverOnly" | "progressive";
263
+ interface ResuxPackageModeMap {
264
+ [packageName: string]: ResuxPackageMode;
265
+ }
266
+ interface ResuxPackagesConfig {
267
+ lazy?: boolean | string[];
268
+ clientOnly?: string[];
269
+ serverOnly?: string[];
270
+ mode?: ResuxPackageModeMap;
271
+ external?: string[];
272
+ noExternal?: string[];
273
+ transpile?: string[];
274
+ optimizeDeps?: string[];
275
+ css?: string[] | ResuxPackageCssMap;
276
+ aliases?: Record<string, string>;
277
+ guards?: boolean;
278
+ diagnostics?: boolean;
279
+ }
280
+ interface ResuxClientPackageImportRegistry {
281
+ importers?: string[];
282
+ css?: Record<string, string[]>;
283
+ declared?: string[];
284
+ }
285
+ interface ClientRuntimeSourceOptions {
286
+ packageRegistry?: ResuxClientPackageImportRegistry;
287
+ }
288
+ interface ResuxLazyPackageOptions {
289
+ clientOnly?: boolean;
290
+ mode?: ResuxPackageMode;
291
+ css?: string[];
292
+ exportName?: string;
293
+ preferDefault?: boolean;
294
+ }
295
+ type ResuxLazyPackageLoader<T = unknown> = () => Promise<T>;
296
+ type ClientEnhancementTrigger = "visible" | "interaction" | "idle" | "immediate" | "manual" | "page-load";
297
+ interface ClientEnhancementContext {
298
+ trigger: ClientEnhancementTrigger;
299
+ options?: Record<string, unknown>;
300
+ __resux?: {
295
301
  trigger: ClientEnhancementTrigger;
296
302
  options?: Record<string, unknown>;
297
- __resux?: {
298
- trigger: ClientEnhancementTrigger;
299
- options?: Record<string, unknown>;
300
- };
301
- [key: string]: unknown;
302
- }
303
- export type ClientEnhancementSetup = (target: Element, context: ClientEnhancementContext) => void | (() => void | Promise<void>) | Promise<void | (() => void | Promise<void>)>;
304
- export interface UseClientEnhancementOptions {
305
- target?: Element | string;
306
- trigger?: ClientEnhancementTrigger;
307
- options?: Record<string, unknown>;
308
- }
309
- export interface PackageAdapterContext {
310
- packageName: string;
311
- mode: ResuxPackageMode;
312
- modules: unknown[];
313
- }
314
- export interface PackageAdapterDefinition<TOptions extends Record<string, unknown> = Record<string, unknown>> {
315
- name: string;
316
- packageName?: string;
317
- mode?: ResuxPackageMode;
318
- imports?: string[];
319
- css?: string[];
320
- defaults?: TOptions;
321
- validateOptions?: (options: TOptions) => void;
322
- enhance: (target: Element, options: TOptions, context: PackageAdapterContext) => void | (() => void | Promise<void>) | Promise<void | (() => void | Promise<void>)>;
323
- }
324
- export type RouteMiddlewareResult = void | string | false | {
325
- redirect: string | {
326
- to: string;
327
- statusCode?: number;
328
- };
329
- } | {
330
- type: "redirect";
303
+ };
304
+ [key: string]: unknown;
305
+ }
306
+ type ClientEnhancementSetup = (target: Element, context: ClientEnhancementContext) => void | (() => void | Promise<void>) | Promise<void | (() => void | Promise<void>)>;
307
+ interface UseClientEnhancementOptions {
308
+ target?: Element | string;
309
+ trigger?: ClientEnhancementTrigger;
310
+ options?: Record<string, unknown>;
311
+ }
312
+ interface PackageAdapterContext {
313
+ packageName: string;
314
+ mode: ResuxPackageMode;
315
+ modules: unknown[];
316
+ }
317
+ interface PackageAdapterDefinition<TOptions extends Record<string, unknown> = Record<string, unknown>> {
318
+ name: string;
319
+ packageName?: string;
320
+ mode?: ResuxPackageMode;
321
+ imports?: string[];
322
+ css?: string[];
323
+ defaults?: TOptions;
324
+ validateOptions?: (options: TOptions) => void;
325
+ enhance: (target: Element, options: TOptions, context: PackageAdapterContext) => void | (() => void | Promise<void>) | Promise<void | (() => void | Promise<void>)>;
326
+ }
327
+ type RouteMiddlewareResult = void | string | false | {
328
+ redirect: string | {
331
329
  to: string;
332
330
  statusCode?: number;
331
+ };
333
332
  } | {
334
- type: "abort";
335
- message?: string;
336
- statusCode?: number;
333
+ type: "redirect";
334
+ to: string;
335
+ statusCode?: number;
336
+ } | {
337
+ type: "abort";
338
+ message?: string;
339
+ statusCode?: number;
337
340
  };
338
- export type ResuxRouteMiddleware = (to: RouteContext, from: RouteContext) => RouteMiddlewareResult | Promise<RouteMiddlewareResult>;
339
- export interface EventHandlerEvent {
340
- path: string;
341
- method: string;
342
- query: Record<string, string | string[]>;
343
- params: Record<string, string>;
344
- node: {
345
- req: unknown;
346
- res: unknown;
347
- };
348
- }
349
- export type EventHandler = (event: EventHandlerEvent) => unknown | Promise<unknown>;
350
- export type ServerMiddlewareResult = unknown | Promise<unknown>;
351
- export type ServerMiddleware = (event: EventHandlerEvent) => ServerMiddlewareResult;
352
- export type TemplateNode = TextTemplateNode | InterpolationTemplateNode | ElementTemplateNode;
353
- export interface TextTemplateNode {
354
- type: "text";
355
- value: string;
356
- }
357
- export interface InterpolationTemplateNode {
358
- type: "interpolation";
359
- expression: string;
360
- bindingId: string;
361
- }
362
- export interface TemplateAttribute {
363
- kind: "static" | "dynamic";
341
+ type ResuxRouteMiddleware = (to: RouteContext, from: RouteContext) => RouteMiddlewareResult | Promise<RouteMiddlewareResult>;
342
+ interface EventHandlerEvent {
343
+ path: string;
344
+ method: string;
345
+ query: Record<string, string | string[]>;
346
+ params: Record<string, string>;
347
+ node: {
348
+ req: unknown;
349
+ res: unknown;
350
+ };
351
+ }
352
+ type EventHandler = (event: EventHandlerEvent) => unknown | Promise<unknown>;
353
+ type ServerMiddlewareResult = unknown | Promise<unknown>;
354
+ type ServerMiddleware = (event: EventHandlerEvent) => ServerMiddlewareResult;
355
+ type TemplateNode = TextTemplateNode | InterpolationTemplateNode | ElementTemplateNode;
356
+ interface TextTemplateNode {
357
+ type: "text";
358
+ value: string;
359
+ }
360
+ interface InterpolationTemplateNode {
361
+ type: "interpolation";
362
+ expression: string;
363
+ bindingId: string;
364
+ }
365
+ interface TemplateAttribute {
366
+ kind: "static" | "dynamic";
367
+ name: string;
368
+ value: string;
369
+ bindingId?: string;
370
+ }
371
+ interface TemplateEvent {
372
+ name: string;
373
+ handler: string;
374
+ modifiers?: string[];
375
+ /** Template-local bindings captured by an inline resumable handler. */
376
+ locals?: string[];
377
+ }
378
+ interface IfDirective {
379
+ expression: string;
380
+ blockId: string;
381
+ }
382
+ interface ForDirective {
383
+ source: string;
384
+ value: string;
385
+ index?: string;
386
+ blockId: string;
387
+ }
388
+ interface HtmlDirective {
389
+ expression: string;
390
+ bindingId: string;
391
+ }
392
+ interface ElementTemplateNode {
393
+ type: "element";
394
+ tag: string;
395
+ attrs: TemplateAttribute[];
396
+ events: TemplateEvent[];
397
+ children: TemplateNode[];
398
+ if?: IfDirective;
399
+ for?: ForDirective;
400
+ html?: HtmlDirective;
401
+ }
402
+ interface SetupContext {
403
+ props: Record<string, unknown>;
404
+ ref: typeof ref;
405
+ reactive: typeof reactive;
406
+ computed: typeof computed;
407
+ watch<T = unknown>(source: WatchSource<T> | WatchSource<T>[], callback: WatchCallback<T>, options?: WatchOptions): WatchStopHandle;
408
+ watchEffect(effect: (onCleanup: (cleanup: () => void) => void) => void, options?: WatchOptions): WatchStopHandle;
409
+ readonly: typeof readonly;
410
+ toRef: typeof toRef;
411
+ toRefs: typeof toRefs;
412
+ unref: typeof unref;
413
+ isRef: typeof isRef;
414
+ isReactive: typeof isReactive;
415
+ isReadonly: typeof isReadonly;
416
+ nextTick: typeof nextTick;
417
+ useState<T>(key: string, factory?: () => T): Ref<T>;
418
+ useGlobalState<T>(key: string, factory?: () => T): Ref<T>;
419
+ useAsyncData<T>(key: string, handler?: (context: AsyncDataHandlerContext) => T | Promise<T>): AsyncDataResource<T>;
420
+ defineProps<T extends Record<string, unknown> = Record<string, unknown>>(): T;
421
+ defineEmits<T = (...args: any[]) => void>(emits?: unknown): (...args: any[]) => void;
422
+ emit(...args: any[]): void;
423
+ defineExpose(exposed?: Record<string, any>): void;
424
+ defineSlots<T = Record<string, any>>(): T;
425
+ defineOptions(options?: Record<string, any>): void;
426
+ defineModel<T>(name?: string, options?: unknown): Ref<T>;
427
+ useRoute(): RouteContext;
428
+ useRouter(): ResuxRouter;
429
+ useHead(input: HeadEntry): void;
430
+ useSeoMeta(input: SeoMetaInput): void;
431
+ useRuntimeConfig(): RuntimeConfig;
432
+ useResuxApp(): ResuxAppLike;
433
+ apiURL(path: string): string;
434
+ useResuxImage(): ResuxImageBuilder;
435
+ useFetch<T>(url: string, init?: RequestInit): AsyncDataResource<T>;
436
+ $fetch<T>(url: string, init?: RequestInit): Promise<T>;
437
+ useError(): Ref<ResuxError | null>;
438
+ clearError(): void;
439
+ showError(input: string | Partial<ResuxError>): never;
440
+ createError(input: string | Partial<ResuxError>): ResuxError;
441
+ useLazyPackage<T = unknown>(name: string, options?: ResuxLazyPackageOptions): Promise<T>;
442
+ useClientPackage<T = unknown>(name: string, options?: Omit<ResuxLazyPackageOptions, "clientOnly" | "mode">): Promise<T>;
443
+ usePackageReady(name: string): boolean;
444
+ defineLazyPackage<T = unknown>(name: string, options?: ResuxLazyPackageOptions): ResuxLazyPackageLoader<T>;
445
+ defineClientOnlyPackage<T = unknown>(name: string, options?: Omit<ResuxLazyPackageOptions, "clientOnly" | "mode">): ResuxLazyPackageLoader<T>;
446
+ definePackageAdapter<TOptions extends Record<string, unknown> = Record<string, unknown>>(definition: PackageAdapterDefinition<TOptions>): {
364
447
  name: string;
365
- value: string;
366
- bindingId?: string;
367
- }
368
- export interface TemplateEvent {
369
- name: string;
370
- handler: string;
371
- modifiers?: string[];
372
- /** Template-local bindings captured by an inline resumable handler. */
373
- locals?: string[];
374
- }
375
- export interface IfDirective {
376
- expression: string;
377
- blockId: string;
378
- }
379
- export interface ForDirective {
380
- source: string;
381
- value: string;
382
- index?: string;
383
- blockId: string;
384
- }
385
- export interface HtmlDirective {
386
- expression: string;
387
- bindingId: string;
388
- }
389
- export interface ElementTemplateNode {
390
- type: "element";
391
- tag: string;
392
- attrs: TemplateAttribute[];
393
- events: TemplateEvent[];
394
- children: TemplateNode[];
395
- if?: IfDirective;
396
- for?: ForDirective;
397
- html?: HtmlDirective;
398
- }
399
- export interface SetupContext {
400
- props: Record<string, unknown>;
401
- ref: typeof ref;
402
- reactive: typeof reactive;
403
- computed: typeof computed;
404
- watch<T = unknown>(source: WatchSource<T> | WatchSource<T>[], callback: WatchCallback<T>, options?: WatchOptions): WatchStopHandle;
405
- watchEffect(effect: (onCleanup: (cleanup: () => void) => void) => void, options?: WatchOptions): WatchStopHandle;
406
- readonly: typeof readonly;
407
- toRef: typeof toRef;
408
- toRefs: typeof toRefs;
409
- unref: typeof unref;
410
- isRef: typeof isRef;
411
- isReactive: typeof isReactive;
412
- isReadonly: typeof isReadonly;
413
- nextTick: typeof nextTick;
414
- useState<T>(key: string, factory?: () => T): Ref<T>;
415
- useGlobalState<T>(key: string, factory?: () => T): Ref<T>;
416
- useAsyncData<T>(key: string, handler?: (context: AsyncDataHandlerContext) => T | Promise<T>): AsyncDataResource<T>;
417
- defineProps<T extends Record<string, unknown> = Record<string, unknown>>(): T;
418
- defineEmits<T = (...args: any[]) => void>(emits?: unknown): (...args: any[]) => void;
419
- emit(...args: any[]): void;
420
- defineExpose(exposed?: Record<string, any>): void;
421
- defineSlots<T = Record<string, any>>(): T;
422
- defineOptions(options?: Record<string, any>): void;
423
- defineModel<T>(name?: string, options?: unknown): Ref<T>;
424
- useRoute(): RouteContext;
425
- useRouter(): ResuxRouter;
426
- useHead(input: HeadEntry): void;
427
- useSeoMeta(input: SeoMetaInput): void;
428
- useRuntimeConfig(): RuntimeConfig;
429
- useResuxApp(): ResuxAppLike;
430
- apiURL(path: string): string;
431
- useResuxImage(): ResuxImageBuilder;
432
- useFetch<T>(url: string, init?: RequestInit): AsyncDataResource<T>;
433
- $fetch<T>(url: string, init?: RequestInit): Promise<T>;
434
- useError(): Ref<ResuxError | null>;
435
- clearError(): void;
436
- showError(input: string | Partial<ResuxError>): never;
437
- createError(input: string | Partial<ResuxError>): ResuxError;
438
- useLazyPackage<T = unknown>(name: string, options?: ResuxLazyPackageOptions): Promise<T>;
439
- useClientPackage<T = unknown>(name: string, options?: Omit<ResuxLazyPackageOptions, "clientOnly" | "mode">): Promise<T>;
440
- usePackageReady(name: string): boolean;
441
- defineLazyPackage<T = unknown>(name: string, options?: ResuxLazyPackageOptions): ResuxLazyPackageLoader<T>;
442
- defineClientOnlyPackage<T = unknown>(name: string, options?: Omit<ResuxLazyPackageOptions, "clientOnly" | "mode">): ResuxLazyPackageLoader<T>;
443
- definePackageAdapter<TOptions extends Record<string, unknown> = Record<string, unknown>>(definition: PackageAdapterDefinition<TOptions>): {
444
- name: string;
445
- setup: ClientEnhancementSetup;
446
- };
447
- defineClientEnhancement(name: string, setup: ClientEnhancementSetup): {
448
- name: string;
449
- setup: ClientEnhancementSetup;
450
- };
451
- useClientEnhancement(name: string, options?: UseClientEnhancementOptions): Promise<{
452
- ready: boolean;
453
- activate: () => Promise<void>;
454
- dispose: () => Promise<void>;
455
- }>;
456
- onMounted(callback: () => unknown | Promise<unknown>): void;
457
- definePageMeta(_meta: PageMeta): void;
458
- useI18n(): any;
459
- useLocalePath(): any;
460
- useSwitchLocalePath(): any;
461
- useDevice(): DeviceInfo;
462
- $device: DeviceInfo;
463
- $t(key: string, params?: Record<string, unknown>): string;
464
- $tm(key: string): unknown;
465
- }
466
- export interface ComponentDefinition {
467
- id: string;
448
+ setup: ClientEnhancementSetup;
449
+ };
450
+ defineClientEnhancement(name: string, setup: ClientEnhancementSetup): {
468
451
  name: string;
469
- file: string;
470
- script: (ctx: SetupContext) => Record<string, unknown> | Promise<Record<string, unknown>>;
471
- template: TemplateNode[];
472
- handlers: string[];
473
- styles?: ComponentStyle[];
474
- styleScopeId?: string;
475
- meta?: PageMeta;
476
- }
477
- export interface SerializedScope {
478
- id: string;
479
- moduleId: string;
480
- props?: Record<string, JsonValue>;
481
- state: Record<string, JsonValue>;
482
- globalStateKeys?: string[];
483
- asyncData: Record<string, SerializedAsyncData>;
484
- }
485
- export interface SerializedAsyncData {
486
- value: JsonValue;
487
- pending: boolean;
488
- error: AsyncDataError | null;
489
- }
490
- export interface ResuxPayload {
491
- route: RouteContext;
492
- scopes: Record<string, SerializedScope>;
493
- globalState?: Record<string, JsonValue>;
494
- modules: Record<string, string>;
495
- vueIslands?: Record<string, string>;
496
- config?: RuntimeConfig;
497
- plugins?: ClientPluginManifestRecord[];
498
- middleware?: ClientRouteMiddlewareManifestRecord[];
499
- pageMeta?: PageMeta;
500
- }
501
- export interface RouteRecord {
502
- id: string;
503
- path: string;
504
- file: string;
505
- params: string[];
506
- component: ComponentDefinition;
507
- match(pathname: string): Record<string, string> | null;
508
- }
509
- export interface RenderAppOptions {
510
- app?: ComponentDefinition;
511
- page: ComponentDefinition;
512
- pageProps?: Record<string, unknown>;
513
- pageMeta?: PageMeta;
514
- route: RouteContext;
515
- components?: Record<string, ComponentDefinition>;
516
- layouts?: Record<string, ComponentDefinition>;
517
- modules?: Record<string, string>;
518
- vueIslands?: Record<string, string>;
519
- runtimeConfig?: RuntimeConfig;
520
- appHead?: HeadEntry;
521
- plugins?: ResuxPlugin[];
522
- }
523
- export interface RenderResult {
524
- html: string;
525
- payload: ResuxPayload;
526
- head: HeadEntry;
527
- }
528
- export interface RenderDocumentOptions {
529
- devReload?: boolean;
530
- isStatic?: boolean;
452
+ setup: ClientEnhancementSetup;
453
+ };
454
+ useClientEnhancement(name: string, options?: UseClientEnhancementOptions): Promise<{
455
+ ready: boolean;
456
+ activate: () => Promise<void>;
457
+ dispose: () => Promise<void>;
458
+ }>;
459
+ onMounted(callback: () => unknown | Promise<unknown>): void;
460
+ definePageMeta(_meta: PageMeta): void;
461
+ useI18n(): any;
462
+ useLocalePath(): any;
463
+ useSwitchLocalePath(): any;
464
+ useDevice(): DeviceInfo;
465
+ $device: DeviceInfo;
466
+ $t(key: string, params?: Record<string, unknown>): string;
467
+ $tm(key: string): unknown;
468
+ }
469
+ interface ComponentDefinition {
470
+ id: string;
471
+ name: string;
472
+ file: string;
473
+ script: (ctx: SetupContext) => Record<string, unknown> | Promise<Record<string, unknown>>;
474
+ template: TemplateNode[];
475
+ handlers: string[];
476
+ styles?: ComponentStyle[];
477
+ styleScopeId?: string;
478
+ meta?: PageMeta;
479
+ }
480
+ interface SerializedScope {
481
+ id: string;
482
+ moduleId: string;
483
+ props?: Record<string, JsonValue>;
484
+ state: Record<string, JsonValue>;
485
+ globalStateKeys?: string[];
486
+ asyncData: Record<string, SerializedAsyncData>;
487
+ }
488
+ interface SerializedAsyncData {
489
+ value: JsonValue;
490
+ pending: boolean;
491
+ error: AsyncDataError | null;
492
+ }
493
+ interface ResuxPayload {
494
+ route: RouteContext;
495
+ scopes: Record<string, SerializedScope>;
496
+ globalState?: Record<string, JsonValue>;
497
+ modules: Record<string, string>;
498
+ vueIslands?: Record<string, string>;
499
+ config?: RuntimeConfig;
500
+ plugins?: ClientPluginManifestRecord[];
501
+ middleware?: ClientRouteMiddlewareManifestRecord[];
502
+ pageMeta?: PageMeta;
503
+ }
504
+ interface RouteRecord {
505
+ id: string;
506
+ path: string;
507
+ file: string;
508
+ params: string[];
509
+ component: ComponentDefinition;
510
+ match(pathname: string): Record<string, string> | null;
511
+ }
512
+ interface RenderAppOptions {
513
+ app?: ComponentDefinition;
514
+ page: ComponentDefinition;
515
+ pageProps?: Record<string, unknown>;
516
+ pageMeta?: PageMeta;
517
+ route: RouteContext;
518
+ components?: Record<string, ComponentDefinition>;
519
+ layouts?: Record<string, ComponentDefinition>;
520
+ modules?: Record<string, string>;
521
+ vueIslands?: Record<string, string>;
522
+ runtimeConfig?: RuntimeConfig;
523
+ appHead?: HeadEntry;
524
+ plugins?: ResuxPlugin[];
525
+ }
526
+ interface RenderResult {
527
+ html: string;
528
+ payload: ResuxPayload;
529
+ head: HeadEntry;
530
+ }
531
+ interface RenderDocumentOptions {
532
+ devReload?: boolean;
533
+ isStatic?: boolean;
531
534
  }
532
535
  interface RenderTemplateContext {
533
- scope: Record<string, unknown>;
534
- scopeId: string;
535
- moduleId: string;
536
- styleScopeId?: string;
537
- route: RouteContext;
538
- runtimeConfig: RuntimeConfig;
539
- components: Record<string, ComponentDefinition>;
540
- layouts: Record<string, ComponentDefinition>;
541
- pageMeta: PageMeta;
542
- addHeadEntry?: (entry: HeadEntry) => void;
543
- renderPage?: () => Promise<string>;
544
- renderSlot?: () => Promise<string>;
545
- renderLayout?: (name: string | false | undefined, slot: () => Promise<string>) => Promise<string>;
536
+ scope: Record<string, unknown>;
537
+ scopeId: string;
538
+ moduleId: string;
539
+ styleScopeId?: string;
540
+ route: RouteContext;
541
+ runtimeConfig: RuntimeConfig;
542
+ components: Record<string, ComponentDefinition>;
543
+ layouts: Record<string, ComponentDefinition>;
544
+ pageMeta: PageMeta;
545
+ addHeadEntry?: (entry: HeadEntry) => void;
546
+ renderPage?: () => Promise<string>;
547
+ renderSlot?: () => Promise<string>;
548
+ renderLayout?: (name: string | false | undefined, slot: () => Promise<string>) => Promise<string>;
546
549
  }
547
550
  type ComponentProps = Record<string, unknown>;
548
- export declare function defineComponent(definition: ComponentDefinition): ComponentDefinition;
549
- export declare function defineResuxConfig<T extends ResuxConfigInput>(config: T): T;
550
- export declare function defineResuxModule<TOptions = Record<string, unknown>>(module: ResuxModule<TOptions>): ResuxModule<TOptions>;
551
- export declare function defineResuxPlugin(plugin: ResuxPlugin): ResuxPlugin;
552
- export declare function defineResuxRouteMiddleware(middleware: ResuxRouteMiddleware): ResuxRouteMiddleware;
553
- export declare function useResuxApp(): ResuxAppLike;
554
- export interface DeviceInfo {
555
- isMobile: boolean;
556
- isTablet: boolean;
557
- isDesktop: boolean;
558
- isIos: boolean;
559
- isAndroid: boolean;
560
- [key: string]: boolean;
561
- }
562
- export declare function parseUserAgent(ua?: string): DeviceInfo;
563
- export declare function useDevice(): DeviceInfo;
564
- export declare function useRoute(): RouteContext;
565
- export declare function useRouter(): ResuxRouter;
566
- export declare function useRuntimeConfig(): RuntimeConfig;
567
- export declare function useResuxImage(): ResuxImageBuilder;
568
- export declare function navigateTo(to: string, options?: {
569
- statusCode?: number;
551
+ declare function defineComponent(definition: ComponentDefinition): ComponentDefinition;
552
+ declare function defineResuxConfig<T extends ResuxConfigInput>(config: T): T;
553
+ declare function defineResuxModule<TOptions = Record<string, unknown>>(module: ResuxModule<TOptions>): ResuxModule<TOptions>;
554
+ declare function defineResuxPlugin(plugin: ResuxPlugin): ResuxPlugin;
555
+ declare function defineResuxRouteMiddleware(middleware: ResuxRouteMiddleware): ResuxRouteMiddleware;
556
+ declare function useResuxApp(): ResuxAppLike;
557
+ interface DeviceInfo {
558
+ isMobile: boolean;
559
+ isTablet: boolean;
560
+ isDesktop: boolean;
561
+ isIos: boolean;
562
+ isAndroid: boolean;
563
+ [key: string]: boolean;
564
+ }
565
+ declare function parseUserAgent(ua?: string): DeviceInfo;
566
+ declare function useDevice(): DeviceInfo;
567
+ declare function useRoute(): RouteContext;
568
+ declare function useRouter(): ResuxRouter;
569
+ declare function useRuntimeConfig(): RuntimeConfig;
570
+ declare function useResuxImage(): ResuxImageBuilder;
571
+ declare function navigateTo(to: string, options?: {
572
+ statusCode?: number;
570
573
  }): RouteMiddlewareResult;
571
- export declare function abortNavigation(message?: string, options?: {
572
- statusCode?: number;
574
+ declare function abortNavigation(message?: string, options?: {
575
+ statusCode?: number;
573
576
  }): RouteMiddlewareResult;
574
- export declare function createError(input: string | Partial<ResuxError>): ResuxError;
575
- export declare function useError(): Ref<ResuxError | null>;
576
- export declare function showError(input: string | Partial<ResuxError>): never;
577
- export declare function clearError(): void;
578
- export declare function useLazyPackage<T = unknown>(name: string, options?: ResuxLazyPackageOptions): Promise<T>;
579
- export declare function useClientPackage<T = unknown>(name: string, options?: Omit<ResuxLazyPackageOptions, "clientOnly" | "mode">): Promise<T>;
580
- export declare function usePackageReady(name: string): boolean;
581
- export declare function defineLazyPackage<T = unknown>(name: string, options?: ResuxLazyPackageOptions): ResuxLazyPackageLoader<T>;
582
- export declare function defineClientOnlyPackage<T = unknown>(name: string, options?: Omit<ResuxLazyPackageOptions, "clientOnly" | "mode">): ResuxLazyPackageLoader<T>;
583
- export declare function definePackageAdapter<TOptions extends Record<string, unknown> = Record<string, unknown>>(definition: PackageAdapterDefinition<TOptions>): {
584
- name: string;
585
- setup: ClientEnhancementSetup;
577
+ declare function createError(input: string | Partial<ResuxError>): ResuxError;
578
+ declare function useError(): Ref<ResuxError | null>;
579
+ declare function showError(input: string | Partial<ResuxError>): never;
580
+ declare function clearError(): void;
581
+ declare function useLazyPackage<T = unknown>(name: string, options?: ResuxLazyPackageOptions): Promise<T>;
582
+ declare function useClientPackage<T = unknown>(name: string, options?: Omit<ResuxLazyPackageOptions, "clientOnly" | "mode">): Promise<T>;
583
+ declare function usePackageReady(name: string): boolean;
584
+ declare function defineLazyPackage<T = unknown>(name: string, options?: ResuxLazyPackageOptions): ResuxLazyPackageLoader<T>;
585
+ declare function defineClientOnlyPackage<T = unknown>(name: string, options?: Omit<ResuxLazyPackageOptions, "clientOnly" | "mode">): ResuxLazyPackageLoader<T>;
586
+ declare function definePackageAdapter<TOptions extends Record<string, unknown> = Record<string, unknown>>(definition: PackageAdapterDefinition<TOptions>): {
587
+ name: string;
588
+ setup: ClientEnhancementSetup;
586
589
  };
587
- export declare function defineClientEnhancement(name: string, setup: ClientEnhancementSetup): {
588
- name: string;
589
- setup: ClientEnhancementSetup;
590
+ declare function defineClientEnhancement(name: string, setup: ClientEnhancementSetup): {
591
+ name: string;
592
+ setup: ClientEnhancementSetup;
590
593
  };
591
- export declare function useClientEnhancement(name: string, options?: UseClientEnhancementOptions): Promise<{
592
- ready: boolean;
593
- activate: () => Promise<void>;
594
- dispose: () => Promise<void>;
594
+ declare function useClientEnhancement(name: string, options?: UseClientEnhancementOptions): Promise<{
595
+ ready: boolean;
596
+ activate: () => Promise<void>;
597
+ dispose: () => Promise<void>;
595
598
  }>;
596
- export declare function disposeClientEnhancements(): Promise<void>;
597
- export declare function hasClientEnhancement(name: string): boolean;
598
- export declare function getClientEnhancement(name: string): ClientEnhancementSetup | undefined;
599
- export declare function scanClientEnhancements(root?: ParentNode): Promise<void>;
600
- export declare function defineEventHandler(handler: EventHandler): EventHandler;
601
- export declare const eventHandler: typeof defineEventHandler;
602
- export declare function defineServerMiddleware(middleware: ServerMiddleware): ServerMiddleware;
603
- export declare function readBody<T = unknown>(event: EventHandlerEvent): Promise<T>;
604
- export declare function getQuery(event: EventHandlerEvent): Record<string, string | string[]>;
605
- export declare function setHeader(event: EventHandlerEvent, name: string, value: number | string | string[]): void;
606
- export declare function renderApp(options: RenderAppOptions): Promise<RenderResult>;
607
- export declare function renderDocument(result: RenderResult, title?: string, options?: RenderDocumentOptions): string;
608
- export declare function createServerSetupContext(route: RouteContext, props: ComponentProps, stateRefs: Record<string, Ref<unknown>>, asyncDataRefs: Record<string, AsyncDataResource<unknown>>, headEntries: HeadEntry[], resuxApp: ResuxAppLike, runtimeConfig: RuntimeConfig, globalStateRefs?: Record<string, Ref<unknown>>, globalStateKeys?: Set<string>): SetupContext;
609
- export declare function renderTemplateNodesAsync(nodes: TemplateNode[], context: RenderTemplateContext, renderComponent: (component: ComponentDefinition, props?: ComponentProps, renderSlot?: () => Promise<string>) => Promise<string>, locals?: Record<string, unknown>): Promise<string>;
610
- export declare class AsyncResuxRenderer {
611
- private readonly route;
612
- private readonly components;
613
- private readonly modules;
614
- private readonly vueIslands;
615
- private readonly layouts;
616
- private readonly pageMeta;
617
- private readonly runtimeConfig;
618
- private nextScopeId;
619
- private readonly scopes;
620
- private readonly globalStateRefs;
621
- private readonly styleIds;
622
- readonly headEntries: HeadEntry[];
623
- readonly resuxApp: ResuxAppLike;
624
- constructor(route: RouteContext, components: Record<string, ComponentDefinition>, modules: Record<string, string>, vueIslands?: Record<string, string>, layouts?: Record<string, ComponentDefinition>, pageMeta?: PageMeta, runtimeConfig?: RuntimeConfig);
625
- renderComponent(definition: ComponentDefinition, renderPage?: () => Promise<string>, renderSlot?: () => Promise<string>, props?: ComponentProps): Promise<string>;
626
- private collectComponentStyles;
627
- renderLayout(name: string | false | undefined, renderSlot: () => Promise<string>): Promise<string>;
628
- createPayload(): ResuxPayload;
629
- }
630
- export declare function renderAppAsync(options: RenderAppOptions): Promise<RenderResult>;
631
- export declare function evaluateExpression(expression: string, scope: Record<string, unknown>, locals?: Record<string, unknown>): unknown;
599
+ declare function disposeClientEnhancements(): Promise<void>;
600
+ declare function hasClientEnhancement(name: string): boolean;
601
+ declare function getClientEnhancement(name: string): ClientEnhancementSetup | undefined;
602
+ declare function scanClientEnhancements(root?: ParentNode): Promise<void>;
603
+ declare function defineEventHandler(handler: EventHandler): EventHandler;
604
+ declare const eventHandler: typeof defineEventHandler;
605
+ declare function defineServerMiddleware(middleware: ServerMiddleware): ServerMiddleware;
606
+ declare function readBody<T = unknown>(event: EventHandlerEvent): Promise<T>;
607
+ declare function getQuery(event: EventHandlerEvent): Record<string, string | string[]>;
608
+ declare function setHeader(event: EventHandlerEvent, name: string, value: number | string | string[]): void;
609
+ declare function renderApp(options: RenderAppOptions): Promise<RenderResult>;
610
+ type ResuxClientBootMode = "none" | "interaction" | "eager";
611
+ interface ResuxClientBootPlan {
612
+ mode: ResuxClientBootMode;
613
+ eventNames: string[];
614
+ deferEnhancements: boolean;
615
+ deferVueIslands: boolean;
616
+ }
617
+ /**
618
+ * Plans the smallest browser boot path needed by a server-rendered document.
619
+ *
620
+ * - `none`: HTML is already complete; ship no Resux client payload or runtime.
621
+ * - `interaction`: ship only the tiny resume bootstrap. It waits for a
622
+ * resumable event or a declared enhancement/island trigger before importing
623
+ * the full browser runtime.
624
+ * - `eager`: preserve startup semantics for work that must begin immediately
625
+ * (pending data, plugins/middleware, immediate islands/enhancements, and
626
+ * managed media).
627
+ */
628
+ declare function getClientRuntimeBootPlan(result: RenderResult): ResuxClientBootPlan;
629
+ /** Returns whether a document needs any Resux browser execution. */
630
+ declare function shouldLoadClientRuntime(result: RenderResult): boolean;
631
+ declare function renderDocument(result: RenderResult, title?: string, options?: RenderDocumentOptions): string;
632
+ declare function createServerSetupContext(route: RouteContext, props: ComponentProps, stateRefs: Record<string, Ref<unknown>>, asyncDataRefs: Record<string, AsyncDataResource<unknown>>, headEntries: HeadEntry[], resuxApp: ResuxAppLike, runtimeConfig: RuntimeConfig, globalStateRefs?: Record<string, Ref<unknown>>, globalStateKeys?: Set<string>): SetupContext;
633
+ declare function renderTemplateNodesAsync(nodes: TemplateNode[], context: RenderTemplateContext, renderComponent: (component: ComponentDefinition, props?: ComponentProps, renderSlot?: () => Promise<string>) => Promise<string>, locals?: Record<string, unknown>): Promise<string>;
634
+ declare class AsyncResuxRenderer {
635
+ private readonly route;
636
+ private readonly components;
637
+ private readonly modules;
638
+ private readonly vueIslands;
639
+ private readonly layouts;
640
+ private readonly pageMeta;
641
+ private readonly runtimeConfig;
642
+ private nextScopeId;
643
+ private readonly scopes;
644
+ private readonly globalStateRefs;
645
+ private readonly styleIds;
646
+ readonly headEntries: HeadEntry[];
647
+ readonly resuxApp: ResuxAppLike;
648
+ constructor(route: RouteContext, components: Record<string, ComponentDefinition>, modules: Record<string, string>, vueIslands?: Record<string, string>, layouts?: Record<string, ComponentDefinition>, pageMeta?: PageMeta, runtimeConfig?: RuntimeConfig);
649
+ renderComponent(definition: ComponentDefinition, renderPage?: () => Promise<string>, renderSlot?: () => Promise<string>, props?: ComponentProps): Promise<string>;
650
+ private collectComponentStyles;
651
+ renderLayout(name: string | false | undefined, renderSlot: () => Promise<string>): Promise<string>;
652
+ createPayload(): ResuxPayload;
653
+ }
654
+ declare function renderAppAsync(options: RenderAppOptions): Promise<RenderResult>;
655
+ declare function evaluateExpression(expression: string, scope: Record<string, unknown>, locals?: Record<string, unknown>): unknown;
632
656
  type ClientPatch = {
633
- type: "text";
634
- id: string;
635
- value: string;
657
+ type: "text";
658
+ id: string;
659
+ value: string;
636
660
  } | {
637
- type: "attr";
638
- id: string;
639
- attr: string;
640
- value: string;
661
+ type: "attr";
662
+ id: string;
663
+ attr: string;
664
+ value: string;
641
665
  } | {
642
- type: "html";
643
- id: string;
644
- value: string;
666
+ type: "html";
667
+ id: string;
668
+ value: string;
645
669
  } | {
646
- type: "block";
647
- id: string;
648
- value: string;
670
+ type: "block";
671
+ id: string;
672
+ value: string;
649
673
  };
650
- export declare function renderClientPatches(template: TemplateNode[], scope: Record<string, unknown>, scopeId: string, styleScopeId?: string): ClientPatch[];
651
- export declare function getClientRuntimeSource(options?: ClientRuntimeSourceOptions): string;
674
+ declare function renderClientPatches(template: TemplateNode[], scope: Record<string, unknown>, scopeId: string, styleScopeId?: string): ClientPatch[];
675
+ declare function getClientRuntimeSource(options?: ClientRuntimeSourceOptions): string;
676
+ //#endregion
677
+ export { AsyncDataError, AsyncDataHandlerContext, AsyncDataResource, AsyncResuxRenderer, AwaitedAsyncDataResource, ClientEnhancementContext, ClientEnhancementSetup, ClientEnhancementTrigger, ClientPluginManifestRecord, ClientRouteMiddlewareManifestRecord, ClientRuntimeSourceOptions, ComponentDefinition, ComponentStyle, type ComputedRef, DeviceInfo, ElementTemplateNode, EventHandler, EventHandlerEvent, ForDirective, HeadEntry, HtmlDirective, IfDirective, InterpolationTemplateNode, JsonValue, type MaybeRef, type MaybeRefOrGetter, PackageAdapterContext, PackageAdapterDefinition, PageMeta, type ReactiveEffectOptions, type ReactiveEffectRunner, type Ref, RenderAppOptions, RenderDocumentOptions, RenderResult, ResuxAppInjections, ResuxAppLike, ResuxAppProvides, ResuxClientBootMode, ResuxClientBootPlan, ResuxClientPackageImportRegistry, ResuxConfigInput, ResuxDeployOptions, ResuxDeployTarget, ResuxError, ResuxImageBuilder, ResuxImageCacheInput, ResuxImageConfig, ResuxImageFit, ResuxImageModifiers, ResuxImageProviderConfig, ResuxLazyPackageLoader, ResuxLazyPackageOptions, ResuxModule, ResuxModuleContext, ResuxPackageCssMap, ResuxPackageMode, ResuxPackageModeMap, ResuxPackagesConfig, ResuxPayload, ResuxPlugin, ResuxRouteMiddleware, ResuxRouter, ResuxSupportMode, RouteContext, RouteMiddlewareResult, RouteRecord, RuntimeConfig, SeoMetaInput, SeoMetaValue, SerializedAsyncData, SerializedScope, ServerMiddleware, ServerMiddlewareResult, SetupContext, TemplateAttribute, TemplateEvent, TemplateNode, TextTemplateNode, UseClientEnhancementOptions, UseResuxImageOptions, type WatchCallback, type WatchOptions, type WatchSource, type WatchStopHandle, abortNavigation, clearError, computed, createError, createServerSetupContext, defineClientEnhancement, defineClientOnlyPackage, defineComponent, defineEventHandler, defineLazyPackage, definePackageAdapter, defineResuxConfig, defineResuxModule, defineResuxPlugin, defineResuxRouteMiddleware, defineServerMiddleware, disposeClientEnhancements, evaluateExpression, eventHandler, getClientEnhancement, getClientRuntimeBootPlan, getClientRuntimeSource, getQuery, hasClientEnhancement, isReactive, isReadonly, isRef, navigateTo, nextTick, parseUserAgent, reactive, readBody, readonly, ref, renderApp, renderAppAsync, renderClientPatches, renderDocument, renderTemplateNodesAsync, scanClientEnhancements, setHeader, shouldLoadClientRuntime, showError, toRef, toRefs, unref, useClientEnhancement, useClientPackage, useDevice, useError, useLazyPackage, usePackageReady, useResuxApp, useResuxImage, useRoute, useRouter, useRuntimeConfig, watch, watchEffect };
678
+ //# sourceMappingURL=index.d.ts.map