resuxjs 0.3.11 → 0.4.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/README.md +23 -1
  2. package/dist/bin.d.ts +1 -2
  3. package/dist/bin.js +4 -0
  4. package/dist/bin.js.map +1 -1
  5. package/dist/build/index.d.ts +28 -0
  6. package/dist/build/index.js +51 -0
  7. package/dist/build/index.js.map +1 -0
  8. package/dist/cli.d.ts +15 -5
  9. package/dist/cli.js +2648 -3671
  10. package/dist/cli.js.map +1 -1
  11. package/dist/compiler/adapter.d.ts +14 -11
  12. package/dist/compiler/adapter.js +68 -93
  13. package/dist/compiler/adapter.js.map +1 -1
  14. package/dist/compiler/dev-warnings.d.ts +8 -5
  15. package/dist/compiler/dev-warnings.js +248 -321
  16. package/dist/compiler/dev-warnings.js.map +1 -1
  17. package/dist/compiler/directives.d.ts +3 -0
  18. package/dist/compiler/directives.js +124 -150
  19. package/dist/compiler/directives.js.map +1 -1
  20. package/dist/compiler/implementation.d.ts +96 -93
  21. package/dist/compiler/implementation.js +2967 -3430
  22. package/dist/compiler/index.d.ts +14 -11
  23. package/dist/compiler/index.js +68 -93
  24. package/dist/compiler/index.js.map +1 -1
  25. package/dist/core/config.d.ts +12 -5
  26. package/dist/core/config.js +42 -25
  27. package/dist/core/config.js.map +1 -1
  28. package/dist/core/hooks.d.ts +127 -126
  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 +5 -5
  33. package/dist/core/module-container.d.ts +76 -74
  34. package/dist/core/module-container.js +181 -186
  35. package/dist/core/module-container.js.map +1 -1
  36. package/dist/core/resux.d.ts +15 -12
  37. package/dist/core/resux.js +17 -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 +4 -0
  41. package/dist/create-bin.js.map +1 -1
  42. package/dist/create.d.ts +3 -0
  43. package/dist/create.js +499 -638
  44. package/dist/create.js.map +1 -1
  45. package/dist/deploy/cloudflare.d.ts +4 -1
  46. package/dist/deploy/cloudflare.js +30 -34
  47. package/dist/deploy/cloudflare.js.map +1 -1
  48. package/dist/deploy/common.d.ts +6 -4
  49. package/dist/deploy/common.js +118 -188
  50. package/dist/deploy/common.js.map +1 -1
  51. package/dist/deploy/framework-runtime.d.ts +3 -0
  52. package/dist/deploy/framework-runtime.js +43 -48
  53. package/dist/deploy/framework-runtime.js.map +1 -1
  54. package/dist/deploy/index.d.ts +4 -1
  55. package/dist/deploy/index.js +58 -80
  56. package/dist/deploy/index.js.map +1 -1
  57. package/dist/deploy/netlify.d.ts +4 -1
  58. package/dist/deploy/netlify.js +40 -41
  59. package/dist/deploy/netlify.js.map +1 -1
  60. package/dist/deploy/node.d.ts +4 -1
  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 +3 -0
  64. package/dist/deploy/production-report.js +14 -14
  65. package/dist/deploy/production-report.js.map +1 -1
  66. package/dist/deploy/runtime-dependencies.d.ts +3 -0
  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 +4 -1
  70. package/dist/deploy/static.js +16 -14
  71. package/dist/deploy/static.js.map +1 -1
  72. package/dist/deploy/types.d.ts +25 -22
  73. package/dist/deploy/types.js +0 -1
  74. package/dist/deploy/vercel.d.ts +4 -1
  75. package/dist/deploy/vercel.js +137 -188
  76. package/dist/deploy/vercel.js.map +1 -1
  77. package/dist/fonts/index.d.ts +15 -11
  78. package/dist/fonts/index.js +114 -134
  79. package/dist/fonts/index.js.map +1 -1
  80. package/dist/globals.d.ts +79 -78
  81. package/dist/globals.js +0 -1
  82. package/dist/halal-core/ai/classifyProject.d.ts +4 -1
  83. package/dist/halal-core/ai/classifyProject.js +81 -95
  84. package/dist/halal-core/ai/classifyProject.js.map +1 -1
  85. package/dist/halal-core/ai/classifyRuntimeContent.d.ts +5 -2
  86. package/dist/halal-core/ai/classifyRuntimeContent.js +77 -95
  87. package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
  88. package/dist/halal-core/ai/createProjectSummary.d.ts +38 -35
  89. package/dist/halal-core/ai/createProjectSummary.js +38 -39
  90. package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
  91. package/dist/halal-core/ai/halalClassifierPrompt.d.ts +3 -0
  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 +3 -0
  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 +4 -1
  98. package/dist/halal-core/ai/validateAiResponse.js +58 -85
  99. package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
  100. package/dist/halal-core/cli/check.d.ts +3 -0
  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 +3 -0
  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 +3 -0
  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 +3 -0
  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 +3 -0
  113. package/dist/halal-core/cli/verifyReview.js +18 -15
  114. package/dist/halal-core/cli/verifyReview.js.map +1 -1
  115. package/dist/halal-core/config.d.ts +30 -27
  116. package/dist/halal-core/config.js +76 -118
  117. package/dist/halal-core/config.js.map +1 -1
  118. package/dist/halal-core/crypto/integrity.d.ts +6 -3
  119. package/dist/halal-core/crypto/integrity.js +64 -87
  120. package/dist/halal-core/crypto/integrity.js.map +1 -1
  121. package/dist/halal-core/enforce.d.ts +3 -0
  122. package/dist/halal-core/enforce.js +92 -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 +18 -19
  126. package/dist/halal-core/lifecycle.d.ts +3 -0
  127. package/dist/halal-core/lifecycle.js +15 -13
  128. package/dist/halal-core/lifecycle.js.map +1 -1
  129. package/dist/halal-core/policy.d.ts +4 -1
  130. package/dist/halal-core/policy.js +6 -2
  131. package/dist/halal-core/policy.js.map +1 -1
  132. package/dist/halal-core/report/formatBrowserOverlay.d.ts +4 -1
  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 +4 -1
  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 +7 -4
  139. package/dist/halal-core/report/generateHalalReport.js +26 -26
  140. package/dist/halal-core/report/generateHalalReport.js.map +1 -1
  141. package/dist/halal-core/report/signReport.d.ts +4 -1
  142. package/dist/halal-core/report/signReport.js +16 -12
  143. package/dist/halal-core/report/signReport.js.map +1 -1
  144. package/dist/halal-core/report/verifyReport.d.ts +9 -6
  145. package/dist/halal-core/report/verifyReport.js +51 -41
  146. package/dist/halal-core/report/verifyReport.js.map +1 -1
  147. package/dist/halal-core/review/createReviewRequest.d.ts +4 -1
  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 +3 -0
  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 +11 -8
  154. package/dist/halal-core/review/signedReviewFile.js +24 -22
  155. package/dist/halal-core/review/signedReviewFile.js.map +1 -1
  156. package/dist/halal-core/review/verifyReviewApproval.d.ts +9 -6
  157. package/dist/halal-core/review/verifyReviewApproval.js +68 -62
  158. package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
  159. package/dist/halal-core/rules/adultContentRules.d.ts +3 -0
  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 +3 -0
  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 +3 -0
  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 +7 -4
  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 +3 -0
  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 +21 -18
  175. package/dist/halal-core/rules/defaultBlockedRules.js +158 -199
  176. package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
  177. package/dist/halal-core/rules/dependencyRules.d.ts +8 -5
  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 +6 -3
  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 +3 -0
  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 +3 -0
  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 +3 -0
  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 +3 -0
  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 +3 -0
  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 +11 -8
  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 +3 -0
  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 +3 -0
  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 +3 -0
  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 +3 -0
  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 +17 -14
  214. package/dist/halal-core/runtime/guard.js +162 -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 +4 -5
  218. package/dist/halal-core/runtime/reviewedMemory.d.ts +4 -1
  219. package/dist/halal-core/runtime/reviewedMemory.js +74 -110
  220. package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
  221. package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +10 -7
  222. package/dist/halal-core/runtime/serializeRuntimeContent.js +132 -156
  223. package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
  224. package/dist/halal-core/runtime/types.d.ts +44 -41
  225. package/dist/halal-core/runtime/types.js +0 -1
  226. package/dist/halal-core/scanner/scanApiRoutes.d.ts +3 -0
  227. package/dist/halal-core/scanner/scanApiRoutes.js +32 -36
  228. package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
  229. package/dist/halal-core/scanner/scanComponents.d.ts +3 -0
  230. package/dist/halal-core/scanner/scanComponents.js +12 -13
  231. package/dist/halal-core/scanner/scanComponents.js.map +1 -1
  232. package/dist/halal-core/scanner/scanContent.d.ts +5 -2
  233. package/dist/halal-core/scanner/scanContent.js +193 -263
  234. package/dist/halal-core/scanner/scanContent.js.map +1 -1
  235. package/dist/halal-core/scanner/scanDependencies.d.ts +3 -0
  236. package/dist/halal-core/scanner/scanDependencies.js +16 -15
  237. package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
  238. package/dist/halal-core/scanner/scanDomains.d.ts +5 -2
  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 +3 -0
  242. package/dist/halal-core/scanner/scanEnvNames.js +23 -26
  243. package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
  244. package/dist/halal-core/scanner/scanMetadata.d.ts +6 -3
  245. package/dist/halal-core/scanner/scanMetadata.js +20 -29
  246. package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
  247. package/dist/halal-core/scanner/scanPages.d.ts +3 -0
  248. package/dist/halal-core/scanner/scanPages.js +12 -15
  249. package/dist/halal-core/scanner/scanPages.js.map +1 -1
  250. package/dist/halal-core/scanner/scanProject.d.ts +15 -10
  251. package/dist/halal-core/scanner/scanProject.js +43 -49
  252. package/dist/halal-core/scanner/scanProject.js.map +1 -1
  253. package/dist/halal-core/scanner/scanRoutes.d.ts +3 -0
  254. package/dist/halal-core/scanner/scanRoutes.js +32 -39
  255. package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
  256. package/dist/halal-core/scanner/scanTranslations.d.ts +3 -0
  257. package/dist/halal-core/scanner/scanTranslations.js +21 -29
  258. package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
  259. package/dist/halal-core/status.d.ts +14 -11
  260. package/dist/halal-core/status.js +0 -1
  261. package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +3 -0
  262. package/dist/halal-core/tamper/verifyCoreIntegrity.js +26 -24
  263. package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
  264. package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +3 -0
  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 +6 -3
  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 +18 -2
  272. package/dist/i18n/index.d.ts +34 -31
  273. package/dist/i18n/index.js +219 -288
  274. package/dist/i18n/index.js.map +1 -1
  275. package/dist/i18n/shared.d.ts +18 -15
  276. package/dist/i18n/shared.js +204 -266
  277. package/dist/i18n/shared.js.map +1 -1
  278. package/dist/icons/index.d.ts +143 -139
  279. package/dist/icons/index.js +322 -273
  280. package/dist/icons/index.js.map +1 -1
  281. package/dist/index.d.ts +8 -1
  282. package/dist/index.js +7 -2
  283. package/dist/kit/index.d.ts +9 -6
  284. package/dist/kit/index.js +45 -43
  285. package/dist/kit/index.js.map +1 -1
  286. package/dist/nitro-server/index.d.ts +7 -4
  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 +6 -3
  290. package/dist/node.js +88 -116
  291. package/dist/node.js.map +1 -1
  292. package/dist/reactivity/computed.d.ts +6 -3
  293. package/dist/reactivity/computed.js +46 -53
  294. package/dist/reactivity/computed.js.map +1 -1
  295. package/dist/reactivity/effect.d.ts +8 -5
  296. package/dist/reactivity/effect.js +105 -146
  297. package/dist/reactivity/effect.js.map +1 -1
  298. package/dist/reactivity/index.d.ts +8 -8
  299. package/dist/reactivity/index.js +7 -8
  300. package/dist/reactivity/reactive.d.ts +3 -0
  301. package/dist/reactivity/reactive.js +93 -133
  302. package/dist/reactivity/reactive.js.map +1 -1
  303. package/dist/reactivity/readonly.d.ts +2 -1
  304. package/dist/reactivity/readonly.js +2 -2
  305. package/dist/reactivity/ref.d.ts +15 -15
  306. package/dist/reactivity/ref.js +73 -81
  307. package/dist/reactivity/ref.js.map +1 -1
  308. package/dist/reactivity/scheduler.d.ts +3 -1
  309. package/dist/reactivity/scheduler.js +67 -69
  310. package/dist/reactivity/scheduler.js.map +1 -1
  311. package/dist/reactivity/types.d.ts +17 -14
  312. package/dist/reactivity/types.js +0 -1
  313. package/dist/reactivity/utils.d.ts +7 -4
  314. package/dist/reactivity/utils.js +25 -24
  315. package/dist/reactivity/utils.js.map +1 -1
  316. package/dist/reactivity/watch.d.ts +4 -2
  317. package/dist/reactivity/watch.js +75 -103
  318. package/dist/reactivity/watch.js.map +1 -1
  319. package/dist/runtime/core.d.ts +31 -0
  320. package/dist/runtime/core.js +156 -0
  321. package/dist/runtime/core.js.map +1 -0
  322. package/dist/runtime/index.d.ts +487 -461
  323. package/dist/runtime/index.js +4129 -5254
  324. package/dist/runtime/index.js.map +1 -1
  325. package/dist/runtime/reactivity.d.ts +7 -0
  326. package/dist/runtime/reactivity.js +6 -0
  327. package/dist/runtime/resume.d.ts +79 -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 +20 -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 +24 -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 +32 -0
  337. package/dist/security/media-fetch.js +301 -0
  338. package/dist/security/media-fetch.js.map +1 -0
  339. package/dist/security/path-boundary.d.ts +7 -0
  340. package/dist/security/path-boundary.js +70 -0
  341. package/dist/security/path-boundary.js.map +1 -0
  342. package/dist/ui/index.d.ts +1580 -1576
  343. package/dist/ui/index.js +975 -674
  344. package/dist/ui/index.js.map +1 -1
  345. package/dist/vite-builder/index.d.ts +6 -3
  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,28 +1,30 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import path from "node:path";
3
- export function verifyCoreIntegrity(appRoot) {
4
- // Check that core files are present in the framework source tree
5
- const criticalFiles = [
6
- "index",
7
- "enforce",
8
- "config",
9
- "policy",
10
- "rules/defaultBlockedRules",
11
- "rules/coreCategories",
12
- "report/signReport"
13
- ];
14
- // We find the framework dir by locating halal-core
15
- const pathname = decodeURIComponent(new URL(import.meta.url).pathname);
16
- const cleanPath = pathname.startsWith("/") && pathname[2] === ":" ? pathname.substring(1) : pathname;
17
- const normalizedDir = path.dirname(cleanPath);
18
- for (const file of criticalFiles) {
19
- const tsPath = path.join(normalizedDir, "..", `${file}.ts`);
20
- const jsPath = path.join(normalizedDir, "..", `${file}.js`);
21
- if (!existsSync(tsPath) && !existsSync(jsPath)) {
22
- console.error(`[resux-halal-core] Critical framework security file missing: ${file}`);
23
- return false;
24
- }
25
- }
26
- return true;
3
+ //#region src/halal-core/tamper/verifyCoreIntegrity.ts
4
+ function verifyCoreIntegrity(appRoot) {
5
+ const criticalFiles = [
6
+ "index",
7
+ "enforce",
8
+ "config",
9
+ "policy",
10
+ "rules/defaultBlockedRules",
11
+ "rules/coreCategories",
12
+ "report/signReport"
13
+ ];
14
+ const pathname = decodeURIComponent(new URL(import.meta.url).pathname);
15
+ const cleanPath = pathname.startsWith("/") && pathname[2] === ":" ? pathname.substring(1) : pathname;
16
+ const normalizedDir = path.dirname(cleanPath);
17
+ for (const file of criticalFiles) {
18
+ const tsPath = path.join(normalizedDir, "..", `${file}.ts`);
19
+ const jsPath = path.join(normalizedDir, "..", `${file}.js`);
20
+ if (!existsSync(tsPath) && !existsSync(jsPath)) {
21
+ console.error(`[resux-halal-core] Critical framework security file missing: ${file}`);
22
+ return false;
23
+ }
24
+ }
25
+ return true;
27
26
  }
27
+ //#endregion
28
+ export { verifyCoreIntegrity };
29
+
28
30
  //# sourceMappingURL=verifyCoreIntegrity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"verifyCoreIntegrity.js","sourceRoot":"","sources":["../../../src/halal-core/tamper/verifyCoreIntegrity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgB,MAAM,SAAS,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,iEAAiE;IACjE,MAAM,aAAa,GAAG;QACpB,OAAO;QACP,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,2BAA2B;QAC3B,sBAAsB;QACtB,mBAAmB;KACpB,CAAC;IAEF,mDAAmD;IACnD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IACrG,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAE9C,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,GAAG,IAAI,KAAK,CAAC,CAAC;QAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,GAAG,IAAI,KAAK,CAAC,CAAC;QAC5D,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/C,OAAO,CAAC,KAAK,CAAC,gEAAgE,IAAI,EAAE,CAAC,CAAC;YACtF,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"verifyCoreIntegrity.js","names":[],"sources":["../../../src/halal-core/tamper/verifyCoreIntegrity.ts"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport path from \"node:path\";\n\nexport function verifyCoreIntegrity(appRoot: string): boolean {\n // Check that core files are present in the framework source tree\n const criticalFiles = [\n \"index\",\n \"enforce\",\n \"config\",\n \"policy\",\n \"rules/defaultBlockedRules\",\n \"rules/coreCategories\",\n \"report/signReport\"\n ];\n\n // We find the framework dir by locating halal-core\n const pathname = decodeURIComponent(new URL(import.meta.url).pathname);\n const cleanPath = pathname.startsWith(\"/\") && pathname[2] === \":\" ? pathname.substring(1) : pathname;\n const normalizedDir = path.dirname(cleanPath);\n\n for (const file of criticalFiles) {\n const tsPath = path.join(normalizedDir, \"..\", `${file}.ts`);\n const jsPath = path.join(normalizedDir, \"..\", `${file}.js`);\n if (!existsSync(tsPath) && !existsSync(jsPath)) {\n console.error(`[resux-halal-core] Critical framework security file missing: ${file}`);\n return false;\n }\n }\n\n return true;\n}\n"],"mappings":";;;AAGA,SAAgB,oBAAoB,SAA0B;CAE5D,MAAM,gBAAgB;EACpB;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CAGA,MAAM,WAAW,mBAAmB,IAAI,IAAI,YAAY,GAAG,CAAC,CAAC,QAAQ;CACrE,MAAM,YAAY,SAAS,WAAW,GAAG,KAAK,SAAS,OAAO,MAAM,SAAS,UAAU,CAAC,IAAI;CAC5F,MAAM,gBAAgB,KAAK,QAAQ,SAAS;CAE5C,KAAK,MAAM,QAAQ,eAAe;EAChC,MAAM,SAAS,KAAK,KAAK,eAAe,MAAM,GAAG,KAAK,IAAI;EAC1D,MAAM,SAAS,KAAK,KAAK,eAAe,MAAM,GAAG,KAAK,IAAI;EAC1D,IAAI,CAAC,WAAW,MAAM,KAAK,CAAC,WAAW,MAAM,GAAG;GAC9C,QAAQ,MAAM,gEAAgE,MAAM;GACpF,OAAO;EACT;CACF;CAEA,OAAO;AACT"}
@@ -1 +1,4 @@
1
+ //#region src/halal-core/tamper/verifyLifecycleHooks.d.ts
1
2
  export declare function verifyLifecycleHooksRegistered(hooks: any): boolean;
3
+ //#endregion
4
+ //# sourceMappingURL=verifyLifecycleHooks.d.ts.map
@@ -1,14 +1,15 @@
1
- export function verifyLifecycleHooksRegistered(hooks) {
2
- if (!hooks) {
3
- return false;
4
- }
5
- // Ensure our safety check hooks are present in the hook register
6
- const hasBuildStartHook = typeof hooks.hook === "function" || hooks._hooks?.["build:before"];
7
- const hasDevHook = typeof hooks.hook === "function" || hooks._hooks?.["dev:before"];
8
- if (!hasBuildStartHook && !hasDevHook) {
9
- console.error("[resux-halal-core] Safety lifecycle hooks have been bypassed or altered.");
10
- return false;
11
- }
12
- return true;
1
+ //#region src/halal-core/tamper/verifyLifecycleHooks.ts
2
+ function verifyLifecycleHooksRegistered(hooks) {
3
+ if (!hooks) return false;
4
+ const hasBuildStartHook = typeof hooks.hook === "function" || hooks._hooks?.["build:before"];
5
+ const hasDevHook = typeof hooks.hook === "function" || hooks._hooks?.["dev:before"];
6
+ if (!hasBuildStartHook && !hasDevHook) {
7
+ console.error("[resux-halal-core] Safety lifecycle hooks have been bypassed or altered.");
8
+ return false;
9
+ }
10
+ return true;
13
11
  }
12
+ //#endregion
13
+ export { verifyLifecycleHooksRegistered };
14
+
14
15
  //# sourceMappingURL=verifyLifecycleHooks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"verifyLifecycleHooks.js","sourceRoot":"","sources":["../../../src/halal-core/tamper/verifyLifecycleHooks.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,8BAA8B,CAAC,KAAU;IACvD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACf,CAAC;IAED,iEAAiE;IACjE,MAAM,iBAAiB,GAAG,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,cAAc,CAAC,CAAC;IAC7F,MAAM,UAAU,GAAG,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,YAAY,CAAC,CAAC;IAEpF,IAAI,CAAC,iBAAiB,IAAI,CAAC,UAAU,EAAE,CAAC;QACtC,OAAO,CAAC,KAAK,CAAC,0EAA0E,CAAC,CAAC;QAC1F,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"verifyLifecycleHooks.js","names":[],"sources":["../../../src/halal-core/tamper/verifyLifecycleHooks.ts"],"sourcesContent":["export function verifyLifecycleHooksRegistered(hooks: any): boolean {\n if (!hooks) {\n return false;\n }\n\n // Ensure our safety check hooks are present in the hook register\n const hasBuildStartHook = typeof hooks.hook === \"function\" || hooks._hooks?.[\"build:before\"];\n const hasDevHook = typeof hooks.hook === \"function\" || hooks._hooks?.[\"dev:before\"];\n\n if (!hasBuildStartHook && !hasDevHook) {\n console.error(\"[resux-halal-core] Safety lifecycle hooks have been bypassed or altered.\");\n return false;\n }\n\n return true;\n}\n"],"mappings":";AAAA,SAAgB,+BAA+B,OAAqB;CAClE,IAAI,CAAC,OACH,OAAO;CAIT,MAAM,oBAAoB,OAAO,MAAM,SAAS,cAAc,MAAM,SAAS;CAC7E,MAAM,aAAa,OAAO,MAAM,SAAS,cAAc,MAAM,SAAS;CAEtE,IAAI,CAAC,qBAAqB,CAAC,YAAY;EACrC,QAAQ,MAAM,0EAA0E;EACxF,OAAO;CACT;CAEA,OAAO;AACT"}
@@ -1,5 +1,8 @@
1
- import { type ReportVerificationOptions } from "../report/verifyReport.js";
1
+ import { ReportVerificationOptions } from "../report/verifyReport.js";
2
+ //#region src/halal-core/tamper/verifyReportSignature.d.ts
2
3
  export declare function checkOnDiskReportSignature(outDir: string, options?: ReportVerificationOptions): {
3
- valid: boolean;
4
- reason?: string;
4
+ valid: boolean;
5
+ reason?: string;
5
6
  };
7
+ //#endregion
8
+ //# sourceMappingURL=verifyReportSignature.d.ts.map
@@ -1,18 +1,24 @@
1
+ import { isReportValid } from "../report/verifyReport.js";
1
2
  import { existsSync, readFileSync } from "node:fs";
2
3
  import path from "node:path";
3
- import { isReportValid, } from "../report/verifyReport.js";
4
- export function checkOnDiskReportSignature(outDir, options = {}) {
5
- const reportPath = path.join(outDir, "halal-report.json");
6
- if (!existsSync(reportPath)) {
7
- return { valid: false, reason: "Halal Core report file is missing." };
8
- }
9
- try {
10
- const content = JSON.parse(readFileSync(reportPath, "utf8"));
11
- return isReportValid(content, options);
12
- }
13
- catch (error) {
14
- const message = error instanceof Error ? error.message : String(error);
15
- return { valid: false, reason: `Failed to read or parse Halal Core report: ${message}` };
16
- }
4
+ //#region src/halal-core/tamper/verifyReportSignature.ts
5
+ function checkOnDiskReportSignature(outDir, options = {}) {
6
+ const reportPath = path.join(outDir, "halal-report.json");
7
+ if (!existsSync(reportPath)) return {
8
+ valid: false,
9
+ reason: "Halal Core report file is missing."
10
+ };
11
+ try {
12
+ const content = JSON.parse(readFileSync(reportPath, "utf8"));
13
+ return isReportValid(content, options);
14
+ } catch (error) {
15
+ return {
16
+ valid: false,
17
+ reason: `Failed to read or parse Halal Core report: ${error instanceof Error ? error.message : String(error)}`
18
+ };
19
+ }
17
20
  }
21
+ //#endregion
22
+ export { checkOnDiskReportSignature };
23
+
18
24
  //# sourceMappingURL=verifyReportSignature.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"verifyReportSignature.js","sourceRoot":"","sources":["../../../src/halal-core/tamper/verifyReportSignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,aAAa,GAEd,MAAM,2BAA2B,CAAC;AAEnC,MAAM,UAAU,0BAA0B,CACxC,MAAc,EACd,UAAqC,EAAE;IAEvC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC1D,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,oCAAoC,EAAE,CAAC;IACxE,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;QAC7D,OAAO,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,8CAA8C,OAAO,EAAE,EAAE,CAAC;IAC3F,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"verifyReportSignature.js","names":[],"sources":["../../../src/halal-core/tamper/verifyReportSignature.ts"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport {\n isReportValid,\n type ReportVerificationOptions,\n} from \"../report/verifyReport.js\";\n\nexport function checkOnDiskReportSignature(\n outDir: string,\n options: ReportVerificationOptions = {},\n): { valid: boolean; reason?: string } {\n const reportPath = path.join(outDir, \"halal-report.json\");\n if (!existsSync(reportPath)) {\n return { valid: false, reason: \"Halal Core report file is missing.\" };\n }\n\n try {\n const content = JSON.parse(readFileSync(reportPath, \"utf8\"));\n return isReportValid(content, options);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n return { valid: false, reason: `Failed to read or parse Halal Core report: ${message}` };\n }\n}\n"],"mappings":";;;;AAOA,SAAgB,2BACd,QACA,UAAqC,CAAC,GACD;CACrC,MAAM,aAAa,KAAK,KAAK,QAAQ,mBAAmB;CACxD,IAAI,CAAC,WAAW,UAAU,GACxB,OAAO;EAAE,OAAO;EAAO,QAAQ;CAAqC;CAGtE,IAAI;EACF,MAAM,UAAU,KAAK,MAAM,aAAa,YAAY,MAAM,CAAC;EAC3D,OAAO,cAAc,SAAS,OAAO;CACvC,SAAS,OAAO;EAEd,OAAO;GAAE,OAAO;GAAO,QAAQ,8CADf,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACkB;CACzF;AACF"}
package/dist/halal.d.ts CHANGED
@@ -1 +1,20 @@
1
- export * from "./halal-core/index.js";
1
+ import { HalalCheckResult, HalalGuardStatus } from "./halal-core/status.js";
2
+ import { HalalAIConfig, ResuxHalalPolicy, ReviewContact, ReviewEvidence, StricterRules, loadMainResuxConfig, loadProjectPolicy, validatePolicyConfig } from "./halal-core/config.js";
3
+ import { HalalRuntimeAiOptions, HalalRuntimeContent, HalalRuntimeContentKind, HalalRuntimeDecision, HalalRuntimeDecisionSource, HalalRuntimeGuardOptions, HalalRuntimeReviewDecision, HalalRuntimeReviewInput, SignedHalalRuntimeDecision } from "./halal-core/runtime/types.js";
4
+ import { classifyRuntimeContentWithAi } from "./halal-core/ai/classifyRuntimeContent.js";
5
+ import { runHalalCheck } from "./halal-core/cli/check.js";
6
+ import { runHalalExplain } from "./halal-core/cli/explain.js";
7
+ import { runHalalReport } from "./halal-core/cli/report.js";
8
+ import { runHalalSubmitReview } from "./halal-core/cli/submitReview.js";
9
+ import { runHalalVerifyReview } from "./halal-core/cli/verifyReview.js";
10
+ import { enforceBuildGuard, enforceDeploymentGuard, enforceDevGuard, enforcePreviewGuard, enforceProductionServerGuard } from "./halal-core/enforce.js";
11
+ import { defineResuxHalalPolicy } from "./halal-core/policy.js";
12
+ import { registerHalalCoreHooks } from "./halal-core/lifecycle.js";
13
+ import { PreparedRuntimeContent, RuntimeContentInspectionIssue, prepareRuntimeContent, serializeRuntimeContent, serializeRuntimeContentCanonical } from "./halal-core/runtime/serializeRuntimeContent.js";
14
+ import { createRuntimeContentFingerprint, createSignedHalalRuntimeDecision, findReviewedRuntimeDecision, verifySignedHalalRuntimeDecision } from "./halal-core/runtime/reviewedMemory.js";
15
+ import { HalalRuntimeBlockedError, createHalalRuntimeGuard, evaluateHalalRuntimeContent } from "./halal-core/runtime/guard.js";
16
+ import { verifyCoreIntegrity } from "./halal-core/tamper/verifyCoreIntegrity.js";
17
+ import { scanProject } from "./halal-core/scanner/scanProject.js";
18
+ import { evaluateRules } from "./halal-core/rules/defaultBlockedRules.js";
19
+ import { formatBrowserOverlayScript } from "./halal-core/report/formatBrowserOverlay.js";
20
+ export { HalalAIConfig, HalalCheckResult, HalalGuardStatus, HalalRuntimeAiOptions, HalalRuntimeBlockedError, HalalRuntimeContent, HalalRuntimeContentKind, HalalRuntimeDecision, HalalRuntimeDecisionSource, HalalRuntimeGuardOptions, HalalRuntimeReviewDecision, HalalRuntimeReviewInput, PreparedRuntimeContent, ResuxHalalPolicy, ReviewContact, ReviewEvidence, RuntimeContentInspectionIssue, SignedHalalRuntimeDecision, StricterRules, classifyRuntimeContentWithAi, createHalalRuntimeGuard, createRuntimeContentFingerprint, createSignedHalalRuntimeDecision, defineResuxHalalPolicy, enforceBuildGuard, enforceDeploymentGuard, enforceDevGuard, enforcePreviewGuard, enforceProductionServerGuard, evaluateHalalRuntimeContent, evaluateRules, findReviewedRuntimeDecision, formatBrowserOverlayScript, loadMainResuxConfig, loadProjectPolicy, prepareRuntimeContent, registerHalalCoreHooks, runHalalCheck, runHalalExplain, runHalalReport, runHalalSubmitReview, runHalalVerifyReview, scanProject, serializeRuntimeContent, serializeRuntimeContentCanonical, validatePolicyConfig, verifyCoreIntegrity, verifySignedHalalRuntimeDecision };
package/dist/halal.js CHANGED
@@ -1,2 +1,18 @@
1
- export * from "./halal-core/index.js";
2
- //# sourceMappingURL=halal.js.map
1
+ import { loadMainResuxConfig, loadProjectPolicy, validatePolicyConfig } from "./halal-core/config.js";
2
+ import { defineResuxHalalPolicy } from "./halal-core/policy.js";
3
+ import { scanProject } from "./halal-core/scanner/scanProject.js";
4
+ import { evaluateRules } from "./halal-core/rules/defaultBlockedRules.js";
5
+ import { verifyCoreIntegrity } from "./halal-core/tamper/verifyCoreIntegrity.js";
6
+ import { enforceBuildGuard, enforceDeploymentGuard, enforceDevGuard, enforcePreviewGuard, enforceProductionServerGuard } from "./halal-core/enforce.js";
7
+ import { registerHalalCoreHooks } from "./halal-core/lifecycle.js";
8
+ import { prepareRuntimeContent, serializeRuntimeContent, serializeRuntimeContentCanonical } from "./halal-core/runtime/serializeRuntimeContent.js";
9
+ import { createRuntimeContentFingerprint, createSignedHalalRuntimeDecision, findReviewedRuntimeDecision, verifySignedHalalRuntimeDecision } from "./halal-core/runtime/reviewedMemory.js";
10
+ import { classifyRuntimeContentWithAi } from "./halal-core/ai/classifyRuntimeContent.js";
11
+ import { HalalRuntimeBlockedError, createHalalRuntimeGuard, evaluateHalalRuntimeContent } from "./halal-core/runtime/guard.js";
12
+ import { runHalalCheck } from "./halal-core/cli/check.js";
13
+ import { runHalalReport } from "./halal-core/cli/report.js";
14
+ import { runHalalExplain } from "./halal-core/cli/explain.js";
15
+ import { runHalalSubmitReview } from "./halal-core/cli/submitReview.js";
16
+ import { runHalalVerifyReview } from "./halal-core/cli/verifyReview.js";
17
+ import { formatBrowserOverlayScript } from "./halal-core/report/formatBrowserOverlay.js";
18
+ export { HalalRuntimeBlockedError, classifyRuntimeContentWithAi, createHalalRuntimeGuard, createRuntimeContentFingerprint, createSignedHalalRuntimeDecision, defineResuxHalalPolicy, enforceBuildGuard, enforceDeploymentGuard, enforceDevGuard, enforcePreviewGuard, enforceProductionServerGuard, evaluateHalalRuntimeContent, evaluateRules, findReviewedRuntimeDecision, formatBrowserOverlayScript, loadMainResuxConfig, loadProjectPolicy, prepareRuntimeContent, registerHalalCoreHooks, runHalalCheck, runHalalExplain, runHalalReport, runHalalSubmitReview, runHalalVerifyReview, scanProject, serializeRuntimeContent, serializeRuntimeContentCanonical, validatePolicyConfig, verifyCoreIntegrity, verifySignedHalalRuntimeDecision };
@@ -1,45 +1,48 @@
1
- import { computed } from "../runtime/index.js";
2
- import { type ResuxI18nLocale, type ResuxI18nStrategy, type ResuxI18nTranslationParams } from "./shared.js";
1
+ import { computed } from "../reactivity/computed.js";
2
+ import { ResuxModule } from "../runtime/index.js";
3
+ import { ResuxI18nLocale, ResuxI18nStrategy, ResuxI18nTranslationParams } from "./shared.js";
4
+ //#region src/i18n/index.d.ts
3
5
  type MessageRecord = Record<string, unknown>;
4
6
  export interface ResuxI18nLocaleInput {
5
- code: string;
6
- name?: string;
7
- dir?: "ltr" | "rtl";
7
+ code: string;
8
+ name?: string;
9
+ dir?: "ltr" | "rtl";
8
10
  }
9
11
  export type ResuxI18nMessageSource = MessageRecord | string | (() => unknown | Promise<unknown>);
10
12
  export interface ResuxI18nConfigInput {
11
- defaultLocale: string;
12
- fallbackLocale?: string;
13
- strategy?: ResuxI18nStrategy;
14
- locales: ResuxI18nLocaleInput[];
15
- messages?: Record<string, ResuxI18nMessageSource>;
16
- seo?: {
17
- hreflang?: boolean;
18
- };
19
- }
20
- export interface ResuxI18nModuleOptions extends Partial<ResuxI18nConfigInput> {
13
+ defaultLocale: string;
14
+ fallbackLocale?: string;
15
+ strategy?: ResuxI18nStrategy;
16
+ locales: ResuxI18nLocaleInput[];
17
+ messages?: Record<string, ResuxI18nMessageSource>;
18
+ seo?: {
19
+ hreflang?: boolean;
20
+ };
21
21
  }
22
+ export interface ResuxI18nModuleOptions extends Partial<ResuxI18nConfigInput> {}
22
23
  export interface UseI18nResult {
23
- locale: ReturnType<typeof computed<string>>;
24
- dir: ReturnType<typeof computed<"ltr" | "rtl">>;
25
- locales: ResuxI18nLocale[];
26
- defaultLocale: string;
27
- fallbackLocale: string;
28
- strategy: ResuxI18nStrategy;
29
- t: (key: string, params?: ResuxI18nTranslationParams) => string;
30
- tm: (key: string) => unknown;
31
- resolveLocalized: (value: unknown) => string | null;
32
- localePath: (to: string, localeCode?: string) => string;
33
- switchLocalePath: (localeCode: string, to?: string) => string;
34
- setLocale: (localeCode: string, to?: string) => Promise<void> | void;
24
+ locale: ReturnType<typeof computed<string>>;
25
+ dir: ReturnType<typeof computed<"ltr" | "rtl">>;
26
+ locales: ResuxI18nLocale[];
27
+ defaultLocale: string;
28
+ fallbackLocale: string;
29
+ strategy: ResuxI18nStrategy;
30
+ t: (key: string, params?: ResuxI18nTranslationParams) => string;
31
+ tm: (key: string) => unknown;
32
+ resolveLocalized: (value: unknown) => string | null;
33
+ localePath: (to: string, localeCode?: string) => string;
34
+ switchLocalePath: (localeCode: string, to?: string) => string;
35
+ setLocale: (localeCode: string, to?: string) => Promise<void> | void;
35
36
  }
36
37
  export declare function useI18n(): UseI18nResult;
37
38
  export declare function useLocalePath(): (to: string, localeCode?: string) => string;
38
39
  export declare function useSwitchLocalePath(): (localeCode: string, to?: string) => string;
39
40
  export declare function defineI18nConfig<T extends ResuxI18nConfigInput>(config: T): T;
40
41
  export declare function createI18nHeadEntry(routePath: string, routeOrigin?: string): {
41
- htmlAttrs: Record<string, string>;
42
- link: Array<Record<string, string>>;
42
+ htmlAttrs: Record<string, string>;
43
+ link: Array<Record<string, string>>;
43
44
  };
44
- declare const _default: import("../runtime/index.js").ResuxModule<ResuxI18nModuleOptions>;
45
- export default _default;
45
+ declare const _default: ResuxModule<ResuxI18nModuleOptions>;
46
+ //#endregion
47
+ export { _default as default };
48
+ //# sourceMappingURL=index.d.ts.map