acrylblends 1.0.4 → 1.0.6

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 (351) hide show
  1. package/docs/framework/agents/index.md +7 -5
  2. package/lib/accept-CNNHu4Cf.js +193 -0
  3. package/lib/{accepts-XBuZPVRI.js → accepts-Btq83xPd.js} +1 -1
  4. package/lib/accepts.js +1 -1
  5. package/lib/acryl-base.js +1 -331
  6. package/lib/adapter-CaZ6FZUU.js +37 -0
  7. package/lib/adapter.js +1 -36
  8. package/lib/{app-BM0rTCp7.js → app-CQcGWjrk.js} +4 -4
  9. package/lib/app-base-CpRMZL4v.js +332 -0
  10. package/lib/{audit-D5z9uwOP.d.ts → audit-GcLtvNLV.d.ts} +4 -2
  11. package/lib/{base-NSN_SNv-.js → base-D_6kfOr-.js} +1 -1
  12. package/lib/basic-auth-C0HTRpXh.js +20 -0
  13. package/lib/basic-auth-DFLflXNe.js +95 -0
  14. package/lib/basic-auth.js +1 -94
  15. package/lib/bearer-auth-Cwxt-vgS.js +94 -0
  16. package/lib/bearer-auth.js +1 -93
  17. package/lib/body-D7f4e7w_.js +94 -0
  18. package/lib/body-limit-WmIjWRLt.js +66 -0
  19. package/lib/body-limit.js +1 -65
  20. package/lib/buffer-CkEOJCcY.js +51 -0
  21. package/lib/bun.js +3 -3
  22. package/lib/cache-B0bHH7s5.js +169 -0
  23. package/lib/cache.js +1 -168
  24. package/lib/{client-DDLXwhBo.js → client-BrMFnMEd.js} +1 -1
  25. package/lib/{client-modules-CLvWOjbd.js → client-modules-drj4mjhj.js} +4 -4
  26. package/lib/client.js +1 -1
  27. package/lib/color-COa3DplO.js +37 -0
  28. package/lib/combine-TWuGdcbC.js +137 -0
  29. package/lib/combine.js +1 -136
  30. package/lib/{components-cEW3ovK0.js → components-B2ka9Ax1.js} +4 -4
  31. package/lib/{components-JXVm45kK.js → components-PVXwaOaC.js} +2 -2
  32. package/lib/compress-BzWqsHF1.js +79 -0
  33. package/lib/compress-C-9vK4B2.d.ts +11 -0
  34. package/lib/compress-DCyrrQ5D.js +11 -0
  35. package/lib/compress.d.ts +1 -1
  36. package/lib/compress.js +2 -78
  37. package/lib/concurrent-DrF3d2c-.js +30 -0
  38. package/lib/conninfo-BCROmdnf.d.ts +11 -0
  39. package/lib/conninfo-CWJwieh4.js +19 -0
  40. package/lib/constants-CBSEudrb.js +7 -0
  41. package/lib/{context-DDO0cfuP.js → context-CkOh7Ygv.js} +2 -2
  42. package/lib/context-storage-iuPoI_CR.js +52 -0
  43. package/lib/context-storage.js +1 -51
  44. package/lib/cookie-B1LlkzOe.js +125 -0
  45. package/lib/cookie-BHIduy2T.js +82 -0
  46. package/lib/cookie.js +1 -81
  47. package/lib/cordis/db-sqlite.d.ts +1 -1
  48. package/lib/cordis/door.d.ts +99 -5
  49. package/lib/cordis/door.js +562 -20
  50. package/lib/cordis/inspect.js +4 -4
  51. package/lib/cordis/kv-db.d.ts +1 -1
  52. package/lib/cordis/kv-db.js +1 -1
  53. package/lib/cordis/kv-json.d.ts +1 -1
  54. package/lib/cordis/kv-json.js +1 -1
  55. package/lib/cordis/node-server.d.ts +1 -1
  56. package/lib/cordis/node-server.js +3 -116
  57. package/lib/cordis/router-http.js +2 -2
  58. package/lib/cordis/router.js +4 -4
  59. package/lib/cordis/state.js +7 -7
  60. package/lib/{core-CaY8XDZ6.js → core-BOu1jYua.js} +1 -1
  61. package/lib/cors-CbAQ-8qU.js +106 -0
  62. package/lib/cors.js +1 -105
  63. package/lib/crypto-iVP-N-tS.js +34 -0
  64. package/lib/csrf-DqqOZtgy.js +101 -0
  65. package/lib/csrf.js +1 -100
  66. package/lib/css-C5CPVMvM.js +134 -0
  67. package/lib/css.js +2 -133
  68. package/lib/db/sqlite.d.ts +1 -25
  69. package/lib/dev-CLgu-JRe.js +50 -0
  70. package/lib/dev.js +1 -49
  71. package/lib/dom-YjND9Jt3.js +74 -0
  72. package/lib/door/host.d.ts +2 -2
  73. package/lib/door/host.js +1 -1
  74. package/lib/door/page.d.ts +3 -1
  75. package/lib/door/page.js +2 -2
  76. package/lib/door/protocol.d.ts +1 -1
  77. package/lib/door/protocol.js +1 -212
  78. package/lib/encode-BhbNLrjp.js +33 -0
  79. package/lib/factory-CLdSf-xS.js +30 -0
  80. package/lib/factory.js +1 -29
  81. package/lib/handler-C0wZ0KwO.js +12 -0
  82. package/lib/helpers-BEjcdbgw.js +5 -0
  83. package/lib/{hooks-w72iLeFR.js → hooks-CfC07ri0.js} +1 -1
  84. package/lib/html-CgNa89xw.js +31 -0
  85. package/lib/html-DGExBFNg.js +103 -0
  86. package/lib/html.d.ts +2 -5
  87. package/lib/html.js +2 -30
  88. package/lib/http-exception-MjWkT89V.js +54 -0
  89. package/lib/http-exception.js +1 -53
  90. package/lib/index-dAzQsJG9.d.ts +6 -0
  91. package/lib/index.js +3 -3
  92. package/lib/ip-restriction-jKtKCRM_.js +166 -0
  93. package/lib/ip-restriction.js +1 -165
  94. package/lib/ipaddr-DCoIo528.js +238 -0
  95. package/lib/jsx/dom/client.js +1 -1
  96. package/lib/jsx/dom/jsx-dev-runtime.js +1 -1
  97. package/lib/jsx/dom/jsx-runtime.js +2 -1
  98. package/lib/jsx/dom/server.js +3 -3
  99. package/lib/jsx/dom.js +5 -73
  100. package/lib/jsx/jsx-dev-runtime.d.ts +2 -5
  101. package/lib/jsx/jsx-dev-runtime.js +2 -13
  102. package/lib/jsx/jsx-runtime.d.ts +2 -2
  103. package/lib/jsx/jsx-runtime.js +4 -4
  104. package/lib/jsx/streaming.js +1 -1
  105. package/lib/jsx-CUQgttxU.js +47 -0
  106. package/lib/jsx-dev-runtime-B4WTyq8r.js +14 -0
  107. package/lib/{jsx-dev-runtime-CWLRA2F3.js → jsx-dev-runtime-BLfA-EhI.js} +2 -2
  108. package/lib/jsx-dev-runtime-CGt4kNYr.d.ts +6 -0
  109. package/lib/jsx-renderer-CfifM4hT.js +99 -0
  110. package/lib/jsx-renderer.js +1 -98
  111. package/lib/jsx-runtime-COCRWBJ9.js +2 -0
  112. package/lib/jsx.js +5 -46
  113. package/lib/{jwk-LkzeoaU8.js → jwk-CDPpYQpD.js} +3 -3
  114. package/lib/jwk.js +1 -1
  115. package/lib/{jwt-BGJBw5AF.js → jwt-BXoIA2fQ.js} +2 -2
  116. package/lib/{jwt-CskdhEW9.js → jwt-lyS4Q3mT.js} +3 -3
  117. package/lib/jwt.js +2 -2
  118. package/lib/kv/db.d.ts +1 -10
  119. package/lib/kv/db.js +1 -56
  120. package/lib/kv/json.d.ts +1 -9
  121. package/lib/kv/json.js +1 -223
  122. package/lib/{language-D9a4zqvn.js → language-DeGRtLJt.js} +2 -2
  123. package/lib/language.js +1 -1
  124. package/lib/{linear-router-C3FPib6h.js → linear-router-CmZn_JLV.js} +2 -2
  125. package/lib/logger-Ckxu8diz.js +54 -0
  126. package/lib/logger.js +1 -53
  127. package/lib/loopback-only-BbasoF7R.js +90 -0
  128. package/lib/loopback-only.js +1 -89
  129. package/lib/method-not-allowed-TO2_hnfl.js +82 -0
  130. package/lib/method-not-allowed.js +1 -81
  131. package/lib/method-override-DnZKfJbV.js +103 -0
  132. package/lib/method-override.js +1 -102
  133. package/lib/middleware-BfG_fp8P.js +12 -0
  134. package/lib/mime-BnScXkQn.js +77 -0
  135. package/lib/mount-QkK_3NtJ.js +67 -0
  136. package/lib/mount.js +1 -66
  137. package/lib/node-server/conninfo.d.ts +1 -10
  138. package/lib/node-server/conninfo.js +1 -18
  139. package/lib/node-server/register.js +25 -2
  140. package/lib/node-server/serve-static.d.ts +1 -17
  141. package/lib/node-server/serve-static.js +1 -1
  142. package/lib/node-server.d.ts +2 -2
  143. package/lib/node-server.js +4 -4
  144. package/lib/open-BqK4D2Wn.d.ts +11 -0
  145. package/lib/open-But9E2rL.js +57 -0
  146. package/lib/open-CULVJgOc.d.ts +12 -0
  147. package/lib/open-Dp4sxspc.js +224 -0
  148. package/lib/open-T7kgbO2O.d.ts +27 -0
  149. package/lib/{pattern-router-HZxjDGEQ.js → pattern-router-CJBecJBd.js} +1 -1
  150. package/lib/powered-by-CXQNjNIX.js +24 -0
  151. package/lib/powered-by.js +1 -23
  152. package/lib/pretty-json-CeC1yvYt.js +39 -0
  153. package/lib/pretty-json.js +1 -38
  154. package/lib/{protocol-C37gPePD.d.ts → protocol-CR31M7K_.d.ts} +2 -0
  155. package/lib/protocol-Dt0AZBOz.js +213 -0
  156. package/lib/proxy-C2w_mH7k.js +121 -0
  157. package/lib/proxy.js +1 -120
  158. package/lib/quick.js +4 -4
  159. package/lib/{reg-exp-router-DC1R3qoY.js → reg-exp-router-C_WV84eV.js} +2 -2
  160. package/lib/request-DvMgGtlW.js +323 -0
  161. package/lib/request.js +1 -322
  162. package/lib/route-D8m-a2I1.js +126 -0
  163. package/lib/route.js +1 -125
  164. package/lib/router/linear-router.js +1 -1
  165. package/lib/router/pattern-router.js +1 -1
  166. package/lib/router/reg-exp-router.js +1 -1
  167. package/lib/router/smart-router.js +1 -1
  168. package/lib/router/trie-router.js +1 -1
  169. package/lib/router-Be_o6nFu.js +35 -0
  170. package/lib/router.js +1 -34
  171. package/lib/schema-validator-EK3cUUCt.js +22 -0
  172. package/lib/schema-validator.js +1 -21
  173. package/lib/{secure-headers-mP3j6Hm6.js → secure-headers-C5ZOcXqk.js} +1 -1
  174. package/lib/secure-headers.js +1 -1
  175. package/lib/serve-static-B7sqnftW.d.ts +18 -0
  176. package/lib/{serve-static-3uo_9rjF.js → serve-static-C1Nkj_xB.js} +2 -2
  177. package/lib/{serve-static-Cp5adzGo.js → serve-static-EiJf1zkO.js} +4 -4
  178. package/lib/serve-static.js +1 -1
  179. package/lib/{smart-router-C5CZ5XSM.js → smart-router-BjxkDQCE.js} +1 -1
  180. package/lib/{snapshot-text-BLz8nlSc.js → snapshot-text-CtQm3n8n.js} +23 -14
  181. package/lib/{src-dy3Fk9tA.js → src-BTBm4OPD.js} +6 -6
  182. package/lib/src-LX0E4ec4.js +117 -0
  183. package/lib/{ssg-BwjcA-Ge.js → ssg-BEl7MHqg.js} +5 -5
  184. package/lib/ssg.js +1 -1
  185. package/lib/stream-CzM_SHkq.js +88 -0
  186. package/lib/{streaming-DHST3Scg.js → streaming-BlDaph8U.js} +3 -3
  187. package/lib/streaming.js +1 -1
  188. package/lib/{test-websocket-D8WWqE5G.js → test-websocket-BLeEvybj.js} +2 -2
  189. package/lib/testing-BQx5T_UX.js +17 -0
  190. package/lib/testing.js +1 -16
  191. package/lib/timeout-FeqZ9A-0.js +42 -0
  192. package/lib/timeout.js +1 -41
  193. package/lib/tiny.js +2 -2
  194. package/lib/trailing-slash-DwTx-1sk.js +85 -0
  195. package/lib/trailing-slash.js +1 -84
  196. package/lib/{trie-router-CfFbapzL.js → trie-router-JydLKUa2.js} +2 -2
  197. package/lib/url-BPh4d6j-.js +197 -0
  198. package/lib/utils/accept.js +1 -192
  199. package/lib/utils/basic-auth.js +1 -19
  200. package/lib/utils/body.js +1 -93
  201. package/lib/utils/buffer.js +1 -50
  202. package/lib/utils/color.js +1 -36
  203. package/lib/utils/compress.d.ts +1 -10
  204. package/lib/utils/compress.js +1 -10
  205. package/lib/utils/concurrent.js +1 -29
  206. package/lib/utils/constants.js +1 -6
  207. package/lib/utils/cookie.js +1 -124
  208. package/lib/utils/crypto.js +1 -33
  209. package/lib/utils/encode.js +1 -32
  210. package/lib/utils/handler.js +1 -11
  211. package/lib/utils/html.js +1 -102
  212. package/lib/utils/ipaddr.js +1 -237
  213. package/lib/utils/jwt.js +1 -1
  214. package/lib/utils/mime.js +1 -76
  215. package/lib/utils/stream.js +1 -87
  216. package/lib/utils/url.js +1 -196
  217. package/lib/{validator-D84mq-dO.js → validator-Btiyt5VJ.js} +3 -3
  218. package/lib/validator.js +1 -1
  219. package/lib/websocket-DsyBIKVA.js +56 -0
  220. package/lib/ws.js +1 -55
  221. package/package.json +1 -1
  222. package/plugins/acryl-door/src/cli/acryl.ts +36 -5
  223. package/plugins/acryl-door/src/host/channel.ts +14 -6
  224. package/plugins/acryl-door/src/host/chat-tools.ts +2 -0
  225. package/plugins/acryl-door/src/host/door.ts +97 -12
  226. package/plugins/acryl-door/src/host/page-routes.ts +3 -1
  227. package/plugins/acryl-door/src/host/shell.ts +147 -0
  228. package/plugins/acryl-door/src/host/shim.ts +39 -3
  229. package/plugins/acryl-door/src/host/verbs.ts +39 -2
  230. package/plugins/acryl-door/src/index.ts +22 -3
  231. package/plugins/acryl-door/src/page/channel.ts +3 -1
  232. package/plugins/acryl-door/src/page/index.ts +2 -1
  233. package/plugins/acryl-door/src/page/protocol.ts +2 -0
  234. package/plugins/acryl-door/src/shell/protocol.ts +130 -0
  235. package/plugins/acryl-node-server/src/register.ts +29 -2
  236. package/plugins/agent/model.ts +6 -1
  237. package/plugins/agent/tools.ts +12 -2
  238. package/plugins/agent-panel/client/describe.ts +44 -0
  239. package/plugins/agent-panel/client/main.ts +4 -1
  240. package/plugins/agent-panel/headless.ts +29 -8
  241. package/plugins/agent-panel/index.ts +22 -10
  242. package/plugins/agent-panel/launch.ts +67 -0
  243. package/plugins/desktop/attach.ts +72 -0
  244. package/plugins/desktop/door-shell.ts +379 -0
  245. package/plugins/desktop/main.ts +82 -15
  246. package/plugins/extensions/index.ts +3 -4
  247. package/plugins/extensions/stage.ts +33 -5
  248. package/plugins/openai/index.ts +1 -1
  249. package/templates/agent/AGENTS.md +4 -0
  250. package/templates/agent/blend.yaml +4 -1
  251. package/templates/agent/src/app.ts +2 -0
  252. package/templates/agent/src/routes.ts +1 -1
  253. package/templates/agent/template.json +1 -0
  254. package/templates/agent/test/builder.test.ts +26 -21
  255. package/lib/helpers-CvTauQT5.js +0 -5
  256. package/lib/middleware-CPQ8himN.js +0 -12
  257. package/plugins/acryl-router/src/connection.d.ts +0 -25
  258. package/plugins/acryl-router/src/core/app-base.d.ts +0 -215
  259. package/plugins/acryl-router/src/core/app.d.ts +0 -19
  260. package/plugins/acryl-router/src/core/client/client.d.ts +0 -4
  261. package/plugins/acryl-router/src/core/client/fetch-result-please.d.ts +0 -35
  262. package/plugins/acryl-router/src/core/client/index.d.ts +0 -7
  263. package/plugins/acryl-router/src/core/client/types.d.ts +0 -229
  264. package/plugins/acryl-router/src/core/client/utils.d.ts +0 -18
  265. package/plugins/acryl-router/src/core/compose.d.ts +0 -14
  266. package/plugins/acryl-router/src/core/context.d.ts +0 -443
  267. package/plugins/acryl-router/src/core/helper/accepts/accepts.d.ts +0 -30
  268. package/plugins/acryl-router/src/core/helper/accepts/index.d.ts +0 -5
  269. package/plugins/acryl-router/src/core/helper/conninfo/index.d.ts +0 -5
  270. package/plugins/acryl-router/src/core/helper/conninfo/types.d.ts +0 -36
  271. package/plugins/acryl-router/src/core/helper/cookie/index.d.ts +0 -25
  272. package/plugins/acryl-router/src/core/helper/css/common.d.ts +0 -59
  273. package/plugins/acryl-router/src/core/helper/css/index.d.ts +0 -80
  274. package/plugins/acryl-router/src/core/helper/dev/index.d.ts +0 -20
  275. package/plugins/acryl-router/src/core/helper/factory/index.d.ts +0 -82
  276. package/plugins/acryl-router/src/core/helper/html/index.d.ts +0 -8
  277. package/plugins/acryl-router/src/core/helper/proxy/index.d.ts +0 -73
  278. package/plugins/acryl-router/src/core/helper/route/index.d.ts +0 -75
  279. package/plugins/acryl-router/src/core/helper/ssg/index.d.ts +0 -7
  280. package/plugins/acryl-router/src/core/helper/ssg/middleware.d.ts +0 -44
  281. package/plugins/acryl-router/src/core/helper/ssg/plugins.d.ts +0 -27
  282. package/plugins/acryl-router/src/core/helper/ssg/ssg.d.ts +0 -91
  283. package/plugins/acryl-router/src/core/helper/ssg/utils.d.ts +0 -16
  284. package/plugins/acryl-router/src/core/helper/streaming/index.d.ts +0 -8
  285. package/plugins/acryl-router/src/core/helper/streaming/sse.d.ts +0 -13
  286. package/plugins/acryl-router/src/core/helper/streaming/stream.d.ts +0 -3
  287. package/plugins/acryl-router/src/core/helper/streaming/text.d.ts +0 -3
  288. package/plugins/acryl-router/src/core/helper/streaming/utils.d.ts +0 -1
  289. package/plugins/acryl-router/src/core/helper/testing/index.d.ts +0 -13
  290. package/plugins/acryl-router/src/core/helper/websocket/index.d.ts +0 -70
  291. package/plugins/acryl-router/src/core/http-exception.d.ts +0 -58
  292. package/plugins/acryl-router/src/core/index.d.ts +0 -37
  293. package/plugins/acryl-router/src/core/jsx/base.d.ts +0 -61
  294. package/plugins/acryl-router/src/core/jsx/children.d.ts +0 -9
  295. package/plugins/acryl-router/src/core/jsx/components.d.ts +0 -15
  296. package/plugins/acryl-router/src/core/jsx/constants.d.ts +0 -6
  297. package/plugins/acryl-router/src/core/jsx/context.d.ts +0 -51
  298. package/plugins/acryl-router/src/core/jsx/dom/components.d.ts +0 -10
  299. package/plugins/acryl-router/src/core/jsx/dom/context.d.ts +0 -3
  300. package/plugins/acryl-router/src/core/jsx/dom/css.d.ts +0 -83
  301. package/plugins/acryl-router/src/core/jsx/dom/hooks/index.d.ts +0 -39
  302. package/plugins/acryl-router/src/core/jsx/dom/intrinsic-element/components.d.ts +0 -16
  303. package/plugins/acryl-router/src/core/jsx/dom/jsx-dev-runtime.d.ts +0 -8
  304. package/plugins/acryl-router/src/core/jsx/dom/jsx-runtime.d.ts +0 -7
  305. package/plugins/acryl-router/src/core/jsx/dom/render.d.ts +0 -73
  306. package/plugins/acryl-router/src/core/jsx/dom/utils.d.ts +0 -1
  307. package/plugins/acryl-router/src/core/jsx/hooks/index.d.ts +0 -47
  308. package/plugins/acryl-router/src/core/jsx/index.d.ts +0 -76
  309. package/plugins/acryl-router/src/core/jsx/intrinsic-element/common.d.ts +0 -6
  310. package/plugins/acryl-router/src/core/jsx/intrinsic-element/components.d.ts +0 -13
  311. package/plugins/acryl-router/src/core/jsx/intrinsic-elements.d.ts +0 -735
  312. package/plugins/acryl-router/src/core/jsx/streaming.d.ts +0 -36
  313. package/plugins/acryl-router/src/core/jsx/types.d.ts +0 -36
  314. package/plugins/acryl-router/src/core/jsx/utils.d.ts +0 -4
  315. package/plugins/acryl-router/src/core/request/constants.d.ts +0 -1
  316. package/plugins/acryl-router/src/core/request.d.ts +0 -306
  317. package/plugins/acryl-router/src/core/router/reg-exp-router/index.d.ts +0 -6
  318. package/plugins/acryl-router/src/core/router/reg-exp-router/matcher.d.ts +0 -7
  319. package/plugins/acryl-router/src/core/router/reg-exp-router/node.d.ts +0 -13
  320. package/plugins/acryl-router/src/core/router/reg-exp-router/prepared-router.d.ts +0 -17
  321. package/plugins/acryl-router/src/core/router/reg-exp-router/router.d.ts +0 -11
  322. package/plugins/acryl-router/src/core/router/reg-exp-router/trie.d.ts +0 -8
  323. package/plugins/acryl-router/src/core/router/smart-router/index.d.ts +0 -5
  324. package/plugins/acryl-router/src/core/router/smart-router/router.d.ts +0 -11
  325. package/plugins/acryl-router/src/core/router/trie-router/index.d.ts +0 -5
  326. package/plugins/acryl-router/src/core/router/trie-router/node.d.ts +0 -6
  327. package/plugins/acryl-router/src/core/router/trie-router/router.d.ts +0 -7
  328. package/plugins/acryl-router/src/core/router/utils.d.ts +0 -1
  329. package/plugins/acryl-router/src/core/router.d.ts +0 -97
  330. package/plugins/acryl-router/src/core/types.d.ts +0 -573
  331. package/plugins/acryl-router/src/core/utils/accept.d.ts +0 -6
  332. package/plugins/acryl-router/src/core/utils/body.d.ts +0 -79
  333. package/plugins/acryl-router/src/core/utils/buffer.d.ts +0 -17
  334. package/plugins/acryl-router/src/core/utils/color.d.ts +0 -21
  335. package/plugins/acryl-router/src/core/utils/concurrent.d.ts +0 -11
  336. package/plugins/acryl-router/src/core/utils/constants.d.ts +0 -4
  337. package/plugins/acryl-router/src/core/utils/cookie.d.ts +0 -41
  338. package/plugins/acryl-router/src/core/utils/crypto.d.ts +0 -15
  339. package/plugins/acryl-router/src/core/utils/handler.d.ts +0 -6
  340. package/plugins/acryl-router/src/core/utils/headers.d.ts +0 -8
  341. package/plugins/acryl-router/src/core/utils/html.d.ts +0 -44
  342. package/plugins/acryl-router/src/core/utils/http-status.d.ts +0 -32
  343. package/plugins/acryl-router/src/core/utils/mime.d.ts +0 -70
  344. package/plugins/acryl-router/src/core/utils/stream.d.ts +0 -31
  345. package/plugins/acryl-router/src/core/utils/types.d.ts +0 -128
  346. package/plugins/acryl-router/src/core/utils/url.d.ts +0 -44
  347. package/plugins/acryl-router/src/core/validator/index.d.ts +0 -7
  348. package/plugins/acryl-router/src/core/validator/utils.d.ts +0 -29
  349. package/plugins/acryl-router/src/core/validator/validator.d.ts +0 -16
  350. package/plugins/acryl-router/src/helpers/index.d.ts +0 -17
  351. package/plugins/acryl-router/src/helpers/schema-validator.d.ts +0 -54
@@ -1,443 +0,0 @@
1
- import { AcrylRequest } from './request.ts';
2
- import type { Result } from './router.ts';
3
- import type { Env, FetchEventLike, H, Input, NotFoundHandler, RouterRoute, TypedResponse } from './types.ts';
4
- import type { ResponseHeader } from './utils/headers.ts';
5
- import type { ContentfulStatusCode, RedirectStatusCode, StatusCode } from './utils/http-status.ts';
6
- import type { BaseMime } from './utils/mime.ts';
7
- import type { InvalidJSONValue, IsAny, JSONParsed, JSONValue } from './utils/types.ts';
8
- type HeaderRecord = Record<'Content-Type', BaseMime> | Record<ResponseHeader, string | string[]> | Record<string, string | string[]>;
9
- /**
10
- * Data type can be a string, ArrayBuffer, Blob, Uint8Array (buffer), or ReadableStream.
11
- */
12
- export type Data = string | ArrayBuffer | Blob | ReadableStream | Uint8Array<ArrayBuffer>;
13
- /**
14
- * Interface for the execution context in a web worker or similar environment.
15
- */
16
- export interface ExecutionContext {
17
- /**
18
- * Extends the lifetime of the event callback until the promise is settled.
19
- *
20
- * @param promise - A promise to wait for.
21
- */
22
- waitUntil(promise: Promise<unknown>): void;
23
- /**
24
- * Allows the event to be passed through to subsequent event listeners.
25
- */
26
- passThroughOnException(): void;
27
- /**
28
- * For compatibility with Wrangler 4.x.
29
- */
30
- props: any;
31
- /**
32
- * For compatibility with Wrangler 4.x.
33
- */
34
- exports?: any;
35
- }
36
- /**
37
- * Interface for context variable mapping.
38
- */
39
- export interface ContextVariableMap {
40
- }
41
- /**
42
- * Interface for context renderer.
43
- */
44
- export interface ContextRenderer {
45
- }
46
- /**
47
- * Interface representing a renderer for content.
48
- *
49
- * @interface DefaultRenderer
50
- * @param {string | Promise<string>} content - The content to be rendered, which can be either a string or a Promise resolving to a string.
51
- * @returns {Response | Promise<Response>} - The response after rendering the content, which can be either a Response or a Promise resolving to a Response.
52
- */
53
- interface DefaultRenderer {
54
- (content: string | Promise<string>): Response | Promise<Response>;
55
- }
56
- /**
57
- * Renderer type which can either be a ContextRenderer or DefaultRenderer.
58
- */
59
- export type Renderer = ContextRenderer extends Function ? ContextRenderer : DefaultRenderer;
60
- /**
61
- * Extracts the props for the renderer.
62
- */
63
- export type PropsForRenderer = [...Required<Parameters<Renderer>>] extends [unknown, infer Props] ? Props : unknown;
64
- export type Layout<T = Record<string, any>> = (props: T) => any;
65
- /**
66
- * Interface for getting context variables.
67
- *
68
- * @template E - Environment type.
69
- */
70
- interface Get<E extends Env> {
71
- <Key extends keyof E['Variables']>(key: Key): E['Variables'][Key];
72
- <Key extends keyof ContextVariableMap>(key: Key): ContextVariableMap[Key];
73
- }
74
- /**
75
- * Interface for setting context variables.
76
- *
77
- * @template E - Environment type.
78
- */
79
- interface Set<E extends Env> {
80
- <Key extends keyof E['Variables']>(key: Key, value: E['Variables'][Key]): void;
81
- <Key extends keyof ContextVariableMap>(key: Key, value: ContextVariableMap[Key]): void;
82
- }
83
- /**
84
- * Interface for creating a new response.
85
- */
86
- interface NewResponse {
87
- (data: Data | null, status?: StatusCode, headers?: HeaderRecord): Response;
88
- (data: Data | null, init?: ResponseOrInit): Response;
89
- }
90
- /**
91
- * Interface for responding with a body.
92
- */
93
- interface BodyRespond {
94
- <T extends Data, U extends ContentfulStatusCode>(data: T, status?: U, headers?: HeaderRecord): Response & TypedResponse<T, U, 'body'>;
95
- <T extends Data, U extends ContentfulStatusCode>(data: T, init?: ResponseOrInit<U>): Response & TypedResponse<T, U, 'body'>;
96
- <T extends null, U extends StatusCode>(data: T, status?: U, headers?: HeaderRecord): Response & TypedResponse<null, U, 'body'>;
97
- <T extends null, U extends StatusCode>(data: T, init?: ResponseOrInit<U>): Response & TypedResponse<null, U, 'body'>;
98
- }
99
- /**
100
- * Interface for responding with text.
101
- *
102
- * @interface TextRespond
103
- * @template T - The type of the text content.
104
- * @template U - The type of the status code.
105
- *
106
- * @param {T} text - The text content to be included in the response.
107
- * @param {U} [status] - An optional status code for the response.
108
- * @param {HeaderRecord} [headers] - An optional record of headers to include in the response.
109
- *
110
- * @returns {Response & TypedResponse<T, U, 'text'>} - The response after rendering the text content, typed with the provided text and status code types.
111
- */
112
- interface TextRespond {
113
- <T extends string, U extends ContentfulStatusCode = ContentfulStatusCode>(text: T, status?: U, headers?: HeaderRecord): Response & TypedResponse<T, U, 'text'>;
114
- <T extends string, U extends ContentfulStatusCode = ContentfulStatusCode>(text: T, init?: ResponseOrInit<U>): Response & TypedResponse<T, U, 'text'>;
115
- }
116
- /**
117
- * Interface for responding with JSON.
118
- *
119
- * @interface JSONRespond
120
- * @template T - The type of the JSON value or simplified unknown type.
121
- * @template U - The type of the status code.
122
- *
123
- * @param {T} object - The JSON object to be included in the response.
124
- * @param {U} [status] - An optional status code for the response.
125
- * @param {HeaderRecord} [headers] - An optional record of headers to include in the response.
126
- *
127
- * @returns {JSONRespondReturn<T, U>} - The response after rendering the JSON object, typed with the provided object and status code types.
128
- */
129
- interface JSONRespond {
130
- <T extends JSONValue | {} | InvalidJSONValue, U extends ContentfulStatusCode = ContentfulStatusCode>(object: T, status?: U, headers?: HeaderRecord): JSONRespondReturn<T, U>;
131
- <T extends JSONValue | {} | InvalidJSONValue, U extends ContentfulStatusCode = ContentfulStatusCode>(object: T, init?: ResponseOrInit<U>): JSONRespondReturn<T, U>;
132
- }
133
- /**
134
- * @template T - The type of the JSON value or simplified unknown type.
135
- * @template U - The type of the status code.
136
- *
137
- * @returns {Response & TypedResponse<JSONParsed<T>, U, 'json'>} - The response after rendering the JSON object, typed with the provided object and status code types.
138
- */
139
- type JSONRespondReturn<T extends JSONValue | {} | InvalidJSONValue, U extends ContentfulStatusCode> = Response & TypedResponse<JSONParsed<T>, U, 'json'>;
140
- /**
141
- * Interface representing a function that responds with HTML content.
142
- *
143
- * @param html - The HTML content to respond with, which can be a string or a Promise that resolves to a string.
144
- * @param status - (Optional) The HTTP status code for the response.
145
- * @param headers - (Optional) A record of headers to include in the response.
146
- * @param init - (Optional) The response initialization object.
147
- *
148
- * @returns A Response object or a Promise that resolves to a Response object.
149
- */
150
- interface HTMLRespond {
151
- <T extends string | Promise<string>>(html: T, status?: ContentfulStatusCode, headers?: HeaderRecord): T extends string ? Response : Promise<Response>;
152
- <T extends string | Promise<string>>(html: T, init?: ResponseOrInit<ContentfulStatusCode>): T extends string ? Response : Promise<Response>;
153
- }
154
- /**
155
- * Options for configuring the context.
156
- *
157
- * @template E - Environment type.
158
- */
159
- type ContextOptions<E extends Env> = {
160
- /**
161
- * Bindings for the environment.
162
- */
163
- env: E['Bindings'];
164
- /**
165
- * Execution context for the request.
166
- */
167
- executionCtx?: FetchEventLike | ExecutionContext | undefined;
168
- /**
169
- * Handler for not found responses.
170
- */
171
- notFoundHandler?: NotFoundHandler<E>;
172
- matchResult?: Result<[H, RouterRoute]>;
173
- path?: string;
174
- };
175
- interface SetHeadersOptions {
176
- append?: boolean;
177
- }
178
- interface SetHeaders {
179
- (name: 'Content-Type', value?: BaseMime, options?: SetHeadersOptions): void;
180
- (name: ResponseHeader, value?: string, options?: SetHeadersOptions): void;
181
- (name: string, value?: string, options?: SetHeadersOptions): void;
182
- }
183
- type ResponseHeadersInit = [string, string][] | Record<'Content-Type', BaseMime> | Record<ResponseHeader, string> | Record<string, string> | Headers;
184
- interface ResponseInit<T extends StatusCode = StatusCode> {
185
- headers?: ResponseHeadersInit;
186
- status?: T;
187
- statusText?: string;
188
- }
189
- type ResponseOrInit<T extends StatusCode = StatusCode> = ResponseInit<T> | Response;
190
- export declare const TEXT_PLAIN = "text/plain; charset=UTF-8";
191
- export declare class Context<E extends Env = any, P extends string = any, I extends Input = {}> {
192
- #private;
193
- /**
194
- * `.env` can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers.
195
- *
196
- *
197
- * @example
198
- * ```ts
199
- * // Environment object for Cloudflare Workers
200
- * app.get('*', async c => {
201
- * const counter = c.env.COUNTER
202
- * })
203
- * ```
204
- */
205
- env: E['Bindings'];
206
- finalized: boolean;
207
- /**
208
- * `.error` can get the error object from the middleware if the Handler throws an error.
209
- *
210
- *
211
- * @example
212
- * ```ts
213
- * app.use('*', async (c, next) => {
214
- * await next()
215
- * if (c.error) {
216
- * // do something...
217
- * }
218
- * })
219
- * ```
220
- */
221
- error: Error | undefined;
222
- /**
223
- * Creates an instance of the Context class.
224
- *
225
- * @param req - The Request object.
226
- * @param options - Optional configuration options for the context.
227
- */
228
- constructor(req: Request, options?: ContextOptions<E>);
229
- /**
230
- * `.req` is the instance of {@link AcrylRequest}.
231
- */
232
- get req(): AcrylRequest<P, I['out']>;
233
- /**
234
- * The FetchEvent associated with the current request.
235
- *
236
- * @throws Will throw an error if the context does not have a FetchEvent.
237
- */
238
- get event(): FetchEventLike;
239
- /**
240
- * The ExecutionContext associated with the current request.
241
- *
242
- * @throws Will throw an error if the context does not have an ExecutionContext.
243
- */
244
- get executionCtx(): ExecutionContext;
245
- /**
246
- * The Response object for the current request.
247
- */
248
- get res(): Response;
249
- /**
250
- * Sets the Response object for the current request.
251
- *
252
- * @param _res - The Response object to set.
253
- */
254
- set res(_res: Response | undefined);
255
- /**
256
- * `.render()` can create a response within a layout.
257
- *
258
- *
259
- * @example
260
- * ```ts
261
- * app.get('/', (c) => {
262
- * return c.render('Hello!')
263
- * })
264
- * ```
265
- */
266
- render: Renderer;
267
- /**
268
- * Sets the layout for the response.
269
- *
270
- * @param layout - The layout to set.
271
- * @returns The layout function.
272
- */
273
- setLayout: (layout: Layout<PropsForRenderer & {
274
- Layout: Layout;
275
- }>) => Layout<PropsForRenderer & {
276
- Layout: Layout;
277
- }>;
278
- /**
279
- * Gets the current layout for the response.
280
- *
281
- * @returns The current layout function.
282
- */
283
- getLayout: () => Layout<PropsForRenderer & {
284
- Layout: Layout;
285
- }> | undefined;
286
- /**
287
- * `.setRenderer()` can set the layout in the custom middleware.
288
- *
289
- *
290
- * @example
291
- * ```tsx
292
- * app.use('*', async (c, next) => {
293
- * c.setRenderer((content) => {
294
- * return c.html(
295
- * <html>
296
- * <body>
297
- * <p>{content}</p>
298
- * </body>
299
- * </html>
300
- * )
301
- * })
302
- * await next()
303
- * })
304
- * ```
305
- */
306
- setRenderer: (renderer: Renderer) => void;
307
- /**
308
- * `.header()` can set headers.
309
- *
310
- *
311
- * @example
312
- * ```ts
313
- * app.get('/welcome', (c) => {
314
- * // Set headers
315
- * c.header('X-Message', 'Hello!')
316
- * c.header('Content-Type', 'text/plain')
317
- *
318
- * // Append multiple headers using the append option (e.g. Vary)
319
- * c.header('Vary', 'Accept-Encoding', { append: true })
320
- * c.header('Vary', 'User-Agent', { append: true })
321
- *
322
- * return c.body('Thank you for coming')
323
- * })
324
- * ```
325
- */
326
- header: SetHeaders;
327
- status: (status: StatusCode) => void;
328
- /**
329
- * `.set()` can set the value specified by the key.
330
- *
331
- *
332
- * @example
333
- * ```ts
334
- * app.use('*', async (c, next) => {
335
- * c.set('message', 'Acryl is hot!!')
336
- * await next()
337
- * })
338
- * ```
339
- */
340
- set: Set<IsAny<E> extends true ? {
341
- Variables: ContextVariableMap & Record<PropertyKey, any>;
342
- } : E>;
343
- /**
344
- * `.get()` can use the value specified by the key.
345
- *
346
- *
347
- * @example
348
- * ```ts
349
- * app.get('/', (c) => {
350
- * const message = c.get('message')
351
- * return c.text(`The message is "${message}"`)
352
- * })
353
- * ```
354
- */
355
- get: Get<IsAny<E> extends true ? {
356
- Variables: ContextVariableMap & Record<PropertyKey, any>;
357
- } : E>;
358
- /**
359
- * `.var` can access the value of a variable.
360
- *
361
- *
362
- * @example
363
- * ```ts
364
- * const result = c.var.client.oneMethod()
365
- * ```
366
- */
367
- get var(): Readonly<ContextVariableMap & (IsAny<E['Variables']> extends true ? Record<string, any> : E['Variables'])>;
368
- newResponse: NewResponse;
369
- /**
370
- * `.body()` can return the HTTP response.
371
- * You can set headers with `.header()` and set HTTP status code with `.status`.
372
- * This can also be set in `.text()`, `.json()` and so on.
373
- *
374
- *
375
- * @example
376
- * ```ts
377
- * app.get('/welcome', (c) => {
378
- * // Set headers
379
- * c.header('X-Message', 'Hello!')
380
- * c.header('Content-Type', 'text/plain')
381
- * // Set HTTP status code
382
- * c.status(201)
383
- *
384
- * // Return the response body
385
- * return c.body('Thank you for coming')
386
- * })
387
- * ```
388
- */
389
- body: BodyRespond;
390
- /**
391
- * `.text()` can render text as `Content-Type:text/plain`.
392
- *
393
- *
394
- * @example
395
- * ```ts
396
- * app.get('/say', (c) => {
397
- * return c.text('Hello!')
398
- * })
399
- * ```
400
- */
401
- text: TextRespond;
402
- /**
403
- * `.json()` can render JSON as `Content-Type:application/json`.
404
- *
405
- *
406
- * @example
407
- * ```ts
408
- * app.get('/api', (c) => {
409
- * return c.json({ message: 'Hello!' })
410
- * })
411
- * ```
412
- */
413
- json: JSONRespond;
414
- html: HTMLRespond;
415
- /**
416
- * `.redirect()` can Redirect, default status code is 302.
417
- *
418
- *
419
- * @example
420
- * ```ts
421
- * app.get('/redirect', (c) => {
422
- * return c.redirect('/')
423
- * })
424
- * app.get('/redirect-permanently', (c) => {
425
- * return c.redirect('/', 301)
426
- * })
427
- * ```
428
- */
429
- redirect: <T extends RedirectStatusCode = 302>(location: string | URL, status?: T) => Response & TypedResponse<undefined, T, "redirect">;
430
- /**
431
- * `.notFound()` can return the Not Found Response.
432
- *
433
- *
434
- * @example
435
- * ```ts
436
- * app.get('/notfound', (c) => {
437
- * return c.notFound()
438
- * })
439
- * ```
440
- */
441
- notFound: () => ReturnType<NotFoundHandler>;
442
- }
443
- export {};
@@ -1,30 +0,0 @@
1
- import type { Context } from '../../context.ts';
2
- import type { AcceptHeader } from '../../utils/headers.ts';
3
- export interface Accept {
4
- type: string;
5
- params: Record<string, string>;
6
- q: number;
7
- }
8
- export interface acceptsConfig {
9
- header: AcceptHeader;
10
- supports: string[];
11
- default: string;
12
- }
13
- export interface acceptsOptions extends acceptsConfig {
14
- match?: (accepts: Accept[], config: acceptsConfig) => string;
15
- }
16
- export declare const defaultMatch: (accepts: Accept[], config: acceptsConfig) => string;
17
- /**
18
- * Match the accept header with the given options.
19
- * @example
20
- * ```ts
21
- * app.get('/users', (c) => {
22
- * const lang = accepts(c, {
23
- * header: 'Accept-Language',
24
- * supports: ['en', 'zh'],
25
- * default: 'en',
26
- * })
27
- * })
28
- * ```
29
- */
30
- export declare const accepts: (c: Context, options: acceptsOptions) => string;
@@ -1,5 +0,0 @@
1
- /**
2
- * @module
3
- * Accepts Helper for Acryl.
4
- */
5
- export { accepts } from './accepts.ts';
@@ -1,5 +0,0 @@
1
- /**
2
- * @module
3
- * ConnInfo Helper for Acryl.
4
- */
5
- export type { AddressType, NetAddrInfo, ConnInfo, GetConnInfo } from './types.ts';
@@ -1,36 +0,0 @@
1
- import type { Context } from '../../context.ts';
2
- export type AddressType = 'IPv6' | 'IPv4' | undefined;
3
- export type NetAddrInfo = {
4
- /**
5
- * Transport protocol type
6
- */
7
- transport?: 'tcp' | 'udp';
8
- /**
9
- * Transport port number
10
- */
11
- port?: number;
12
- address?: string;
13
- addressType?: AddressType;
14
- } & ({
15
- /**
16
- * Host name such as IP Addr
17
- */
18
- address: string;
19
- /**
20
- * Host name type
21
- */
22
- addressType: AddressType;
23
- } | {});
24
- /**
25
- * HTTP Connection information
26
- */
27
- export interface ConnInfo {
28
- /**
29
- * Remote information
30
- */
31
- remote: NetAddrInfo;
32
- }
33
- /**
34
- * Helper type
35
- */
36
- export type GetConnInfo = (c: Context) => ConnInfo;
@@ -1,25 +0,0 @@
1
- /**
2
- * @module
3
- * Cookie Helper for Acryl.
4
- */
5
- import type { Context } from '../../context.ts';
6
- import type { Cookie, CookieOptions, CookiePrefixOptions, SignedCookie } from '../../utils/cookie.ts';
7
- import type { BufferSource } from '../../utils/types.ts';
8
- interface GetCookie {
9
- (c: Context, key: string): string | undefined;
10
- (c: Context): Cookie;
11
- (c: Context, key: string, prefixOptions?: CookiePrefixOptions): string | undefined;
12
- }
13
- interface GetSignedCookie {
14
- (c: Context, secret: string | BufferSource, key: string): Promise<string | undefined | false>;
15
- (c: Context, secret: string | BufferSource): Promise<SignedCookie>;
16
- (c: Context, secret: string | BufferSource, key: string, prefixOptions?: CookiePrefixOptions): Promise<string | undefined | false>;
17
- }
18
- export declare const getCookie: GetCookie;
19
- export declare const getSignedCookie: GetSignedCookie;
20
- export declare const generateCookie: (name: string, value: string, opt?: CookieOptions) => string;
21
- export declare const setCookie: (c: Context, name: string, value: string, opt?: CookieOptions) => void;
22
- export declare const generateSignedCookie: (name: string, value: string, secret: string | BufferSource, opt?: CookieOptions) => Promise<string>;
23
- export declare const setSignedCookie: (c: Context, name: string, value: string, secret: string | BufferSource, opt?: CookieOptions) => Promise<void>;
24
- export declare const deleteCookie: (c: Context, name: string, opt?: CookieOptions) => string | undefined;
25
- export {};
@@ -1,59 +0,0 @@
1
- export declare const PSEUDO_GLOBAL_SELECTOR = ":-acryl-global";
2
- export declare const isPseudoGlobalSelectorRe: RegExp;
3
- export declare const DEFAULT_STYLE_ID = "acryl-css";
4
- export declare const SELECTOR: unique symbol;
5
- export declare const CLASS_NAME: unique symbol;
6
- export declare const STYLE_STRING: unique symbol;
7
- export declare const SELECTORS: unique symbol;
8
- export declare const EXTERNAL_CLASS_NAMES: unique symbol;
9
- declare const CSS_ESCAPED: unique symbol;
10
- export interface CssClassName {
11
- [SELECTOR]: string;
12
- [CLASS_NAME]: string;
13
- [STYLE_STRING]: string;
14
- [SELECTORS]: CssClassName[];
15
- [EXTERNAL_CLASS_NAMES]: string[];
16
- }
17
- export declare const IS_CSS_ESCAPED: unique symbol;
18
- interface CssEscapedString {
19
- [CSS_ESCAPED]: string;
20
- }
21
- /**
22
- * @experimental
23
- * `rawCssString` is an experimental feature.
24
- * The API might be changed.
25
- */
26
- export declare const rawCssString: (value: string) => CssEscapedString;
27
- export declare const minify: (css: string) => string;
28
- type CssVariableBasicType = CssClassName | CssEscapedString | string | number | boolean | null | undefined;
29
- type CssVariableAsyncType = Promise<CssVariableBasicType>;
30
- type CssVariableArrayType = (CssVariableBasicType | CssVariableAsyncType)[];
31
- export type CssVariableType = CssVariableBasicType | CssVariableAsyncType | CssVariableArrayType;
32
- /**
33
- * A function that customizes generated CSS class names.
34
- *
35
- * @param hash - The default hash-based class name (e.g. `css-1234567890`)
36
- * @param label - The comment label extracted from the CSS template, may be empty.
37
- * Whitespace is trimmed and inner spaces are replaced with hyphens.
38
- * @param styleString - The minified CSS style string
39
- * @returns The custom class name to use. Must be a safe CSS identifier;
40
- * otherwise, the default hash is used as a fallback.
41
- */
42
- export type ClassNameSlug = (hash: string, label: string, styleString: string) => string;
43
- /**
44
- * A callback function called when an invalid slug is returned from ClassNameSlug.
45
- *
46
- * @param slug - The invalid slug
47
- */
48
- export type OnInvalidSlug = (slug: string) => void;
49
- export declare const buildStyleString: (strings: TemplateStringsArray, values: CssVariableType[]) => [string, string, CssClassName[], string[]];
50
- export declare const cssCommon: (strings: TemplateStringsArray, values: CssVariableType[], classNameSlug?: ClassNameSlug, onInvalidSlug?: OnInvalidSlug) => CssClassName;
51
- export declare const cxCommon: (args: (string | boolean | null | undefined | CssClassName)[]) => (string | boolean | null | undefined | CssClassName)[];
52
- export declare const keyframesCommon: (strings: TemplateStringsArray, values: CssVariableType[], classNameSlug?: ClassNameSlug, onInvalidSlug?: OnInvalidSlug) => CssClassName;
53
- type ViewTransitionType = {
54
- (strings: TemplateStringsArray, values: CssVariableType[], classNameSlug?: ClassNameSlug, onInvalidSlug?: OnInvalidSlug): CssClassName;
55
- (content: CssClassName): CssClassName;
56
- (): CssClassName;
57
- };
58
- export declare const viewTransitionCommon: ViewTransitionType;
59
- export {};
@@ -1,80 +0,0 @@
1
- /**
2
- * @module
3
- * css Helper for Acryl.
4
- */
5
- import type { HtmlEscapedString } from '../../utils/html.ts';
6
- import type { ClassNameSlug, CssClassName as CssClassNameCommon, CssVariableType, OnInvalidSlug } from './common.ts';
7
- export { rawCssString } from './common.ts';
8
- export type { ClassNameSlug, OnInvalidSlug } from './common.ts';
9
- type CssClassName = HtmlEscapedString & CssClassNameCommon;
10
- interface CssType {
11
- (strings: TemplateStringsArray, ...values: CssVariableType[]): Promise<string>;
12
- }
13
- interface CxType {
14
- (...args: (CssClassName | Promise<string> | string | boolean | null | undefined)[]): Promise<string>;
15
- }
16
- interface KeyframesType {
17
- (strings: TemplateStringsArray, ...values: CssVariableType[]): CssClassNameCommon;
18
- }
19
- interface ViewTransitionType {
20
- (strings: TemplateStringsArray, ...values: CssVariableType[]): Promise<string>;
21
- (content: Promise<string>): Promise<string>;
22
- (): Promise<string>;
23
- }
24
- interface StyleType {
25
- (args?: {
26
- children?: Promise<string>;
27
- nonce?: string;
28
- }): HtmlEscapedString;
29
- }
30
- /**
31
- * @experimental
32
- * `createCssContext` is an experimental feature.
33
- * The API might be changed.
34
- *
35
- * @param options.id - The ID for the style element
36
- * @param options.classNameSlug - Optional function to customize generated CSS class names
37
- * @param options.onInvalidSlug - Optional callback function called when an invalid slug is returned from ClassNameSlug
38
- */
39
- export declare const createCssContext: ({ id, classNameSlug, onInvalidSlug, }: {
40
- id: Readonly<string>;
41
- classNameSlug?: ClassNameSlug;
42
- onInvalidSlug?: OnInvalidSlug;
43
- }) => DefaultContextType;
44
- interface DefaultContextType {
45
- css: CssType;
46
- cx: CxType;
47
- keyframes: KeyframesType;
48
- viewTransition: ViewTransitionType;
49
- Style: StyleType;
50
- }
51
- /**
52
- * @experimental
53
- * `css` is an experimental feature.
54
- * The API might be changed.
55
- */
56
- export declare const css: CssType;
57
- /**
58
- * @experimental
59
- * `cx` is an experimental feature.
60
- * The API might be changed.
61
- */
62
- export declare const cx: CxType;
63
- /**
64
- * @experimental
65
- * `keyframes` is an experimental feature.
66
- * The API might be changed.
67
- */
68
- export declare const keyframes: KeyframesType;
69
- /**
70
- * @experimental
71
- * `viewTransition` is an experimental feature.
72
- * The API might be changed.
73
- */
74
- export declare const viewTransition: ViewTransitionType;
75
- /**
76
- * @experimental
77
- * `Style` is an experimental feature.
78
- * The API might be changed.
79
- */
80
- export declare const Style: StyleType;