@farm.js/core 0.1.78 → 0.1.81

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 (467) hide show
  1. package/dist/{agent-mcp-handler-EDJNU224.mjs → agent-mcp-handler-GDY5CPPW.mjs} +5 -5
  2. package/dist/{agent-mcp-handler-LNBYLRTZ.cjs → agent-mcp-handler-IUL6OPC3.cjs} +6 -6
  3. package/dist/{agent-mcp.d-BErtnhV2.d.ts → agent-mcp.d-Cxi3214_.d.ts} +1 -1
  4. package/dist/{agent-mcp.d-CYHfcjur.d.mts → agent-mcp.d-DMqOqnOA.d.mts} +1 -1
  5. package/dist/agent-runtime.cjs +2 -2
  6. package/dist/agent-runtime.d.mts +5 -4
  7. package/dist/agent-runtime.d.ts +5 -4
  8. package/dist/agent-runtime.mjs +1 -1
  9. package/dist/analyzer-435DCIQ6.cjs +17 -0
  10. package/dist/{analyzer-M2BG6QYU.mjs → analyzer-IC66UJCU.mjs} +3 -2
  11. package/dist/api/client.cjs +1 -1
  12. package/dist/api/client.mjs +1 -1
  13. package/dist/api/client.native.cjs +1 -1
  14. package/dist/api/client.native.mjs +1 -1
  15. package/dist/api/node.cjs +7 -7
  16. package/dist/api/node.d.mts +7 -6
  17. package/dist/api/node.d.ts +7 -6
  18. package/dist/api/node.mjs +6 -6
  19. package/dist/api/route-manager.cjs +10 -10
  20. package/dist/api/route-manager.d.mts +7 -6
  21. package/dist/api/route-manager.d.ts +7 -6
  22. package/dist/api/route-manager.mjs +9 -9
  23. package/dist/api/runtime.cjs +6 -6
  24. package/dist/api/runtime.d.mts +6 -5
  25. package/dist/api/runtime.d.ts +6 -5
  26. package/dist/api/runtime.mjs +5 -5
  27. package/dist/api.cjs +12 -12
  28. package/dist/api.d.mts +8 -7
  29. package/dist/api.d.ts +8 -7
  30. package/dist/api.mjs +11 -11
  31. package/dist/{app-manifest.d-6NCkLQ1y.d.mts → app-manifest.d-Bbxp5kes.d.mts} +1 -1
  32. package/dist/{app-manifest.d-DuqLBcmi.d.ts → app-manifest.d-C8Cswd31.d.ts} +1 -1
  33. package/dist/app-markdown.cjs +5 -5
  34. package/dist/app-markdown.d.mts +8 -7
  35. package/dist/app-markdown.d.ts +8 -7
  36. package/dist/app-markdown.mjs +4 -4
  37. package/dist/{app.d-Dk2HkvPh.d.mts → app.d-BJuSurgy.d.mts} +13 -4
  38. package/dist/{app.d-Bz6vYBFF.d.ts → app.d-DGIoFt5D.d.ts} +13 -4
  39. package/dist/cache.cjs +3 -3
  40. package/dist/cache.mjs +2 -2
  41. package/dist/{chunk-PG7J7XYT.cjs → chunk-26WP75W5.cjs} +38 -22
  42. package/dist/{chunk-QYOAGT3E.cjs → chunk-2BEGVSDF.cjs} +6 -5
  43. package/dist/{chunk-GCRT6GJG.mjs → chunk-2HMSSPCZ.mjs} +26 -0
  44. package/dist/{chunk-2YJ4DHTD.cjs → chunk-2NOHVIJ3.cjs} +2 -2
  45. package/dist/{chunk-GDM3ZD2O.cjs → chunk-2OFP3IVA.cjs} +5 -1
  46. package/dist/{chunk-7KDCVSTR.mjs → chunk-2PFGA6PB.mjs} +2 -2
  47. package/dist/chunk-2UYYXSUS.mjs +401 -0
  48. package/dist/{chunk-DD2ANOEF.cjs → chunk-2Y2HRZQY.cjs} +843 -627
  49. package/dist/{chunk-PL7MCYYD.mjs → chunk-3AV4DCXY.mjs} +58 -358
  50. package/dist/{chunk-3GNHJ3RN.cjs → chunk-3BTN3NP7.cjs} +2 -2
  51. package/dist/{chunk-XT2CHTDN.mjs → chunk-3RVLJTFZ.mjs} +6 -6
  52. package/dist/{chunk-VJ6L7TII.cjs → chunk-3SPECQXI.cjs} +31 -20
  53. package/dist/{chunk-ODYKCC6W.cjs → chunk-46UV2E7I.cjs} +156 -104
  54. package/dist/{chunk-F4ID7BGO.cjs → chunk-4OFWG4IK.cjs} +7 -7
  55. package/dist/{chunk-VRI43FDN.mjs → chunk-4WXNTAOM.mjs} +1 -1
  56. package/dist/{chunk-QMR2TUVZ.cjs → chunk-52Q4OB4A.cjs} +4 -4
  57. package/dist/chunk-5MMKNW7Q.cjs +54 -0
  58. package/dist/{chunk-RIMEFQYO.mjs → chunk-5N526T7Q.mjs} +116 -86
  59. package/dist/{chunk-CYNQPKA4.cjs → chunk-5ZHC6QGD.cjs} +2 -2
  60. package/dist/{chunk-ALEUMLJN.mjs → chunk-67JTJCAS.mjs} +3 -2
  61. package/dist/{chunk-CBP7AKZH.mjs → chunk-6GJZJAED.mjs} +1 -1
  62. package/dist/{chunk-5REIO5DT.mjs → chunk-6WVRVGKC.mjs} +6 -6
  63. package/dist/{chunk-GC5ROI3A.cjs → chunk-7U4XF76R.cjs} +1 -1
  64. package/dist/{chunk-FOULIN4S.cjs → chunk-ADQ2LATR.cjs} +2 -2
  65. package/dist/{chunk-K3ZELA6U.cjs → chunk-AHVF5GI2.cjs} +10 -10
  66. package/dist/{chunk-CSAIIMY3.mjs → chunk-ATISIC6G.mjs} +1 -1
  67. package/dist/{chunk-MGKWYPE3.mjs → chunk-AYDVUCXD.mjs} +1 -0
  68. package/dist/chunk-B7L24VPX.cjs +401 -0
  69. package/dist/{chunk-DPBQRDWW.cjs → chunk-BBVLOEND.cjs} +4 -4
  70. package/dist/{chunk-DASQJ5UD.mjs → chunk-BCQIXH7L.mjs} +1 -1
  71. package/dist/{chunk-BNCKXPCU.cjs → chunk-BIAGSYIZ.cjs} +30 -30
  72. package/dist/{chunk-R77D7TCZ.mjs → chunk-BJWJP5A4.mjs} +20 -13
  73. package/dist/{chunk-X2SEYK7I.mjs → chunk-BPWTSPK6.mjs} +3 -3
  74. package/dist/{chunk-CKNZJFK5.cjs → chunk-BSX5OGSD.cjs} +4 -4
  75. package/dist/{chunk-ERT6HQAI.mjs → chunk-BVJUFVCU.mjs} +2 -2
  76. package/dist/chunk-C5QHZ626.cjs +85 -0
  77. package/dist/{chunk-HVMQAVZK.cjs → chunk-CL7BUGVB.cjs} +656 -521
  78. package/dist/{chunk-TZ2YPXLB.cjs → chunk-CN2JOTRO.cjs} +7 -7
  79. package/dist/{chunk-ZCYGYIC2.cjs → chunk-CPZZBCPO.cjs} +22 -21
  80. package/dist/{chunk-RK4MGL6Q.mjs → chunk-CYRO3WP4.mjs} +4 -3
  81. package/dist/chunk-D2VAANBS.mjs +48 -0
  82. package/dist/{chunk-VRJAMU34.mjs → chunk-D77OGI6X.mjs} +1 -1
  83. package/dist/{chunk-6XDDE7M6.cjs → chunk-DJ3PVHTW.cjs} +3 -3
  84. package/dist/{chunk-XGS76V7L.cjs → chunk-E3HBD2K3.cjs} +22 -22
  85. package/dist/{chunk-F35C3TJZ.mjs → chunk-E4E4Y5FD.mjs} +1 -1
  86. package/dist/{chunk-KUXEII7V.mjs → chunk-ECVSRE4Y.mjs} +3 -2
  87. package/dist/{chunk-2DA7CLY7.mjs → chunk-EILUVBKS.mjs} +14 -0
  88. package/dist/chunk-EZYKV24V.mjs +385 -0
  89. package/dist/{chunk-TVCFY3KK.cjs → chunk-FB4CWSC2.cjs} +12 -12
  90. package/dist/{chunk-ZO6TOLHL.mjs → chunk-FS55CNTC.mjs} +1 -1
  91. package/dist/{chunk-IYFBLWXU.cjs → chunk-FULX5RYX.cjs} +61 -361
  92. package/dist/{chunk-5KISFWD2.cjs → chunk-FYZD7DUS.cjs} +12 -12
  93. package/dist/{chunk-H5OVJHXY.cjs → chunk-GAWSWJJ2.cjs} +27 -27
  94. package/dist/{chunk-A37D6LOS.mjs → chunk-GY63XD6K.mjs} +1 -1
  95. package/dist/{chunk-OVUU2RCQ.mjs → chunk-HD5FLXP2.mjs} +1 -1
  96. package/dist/{chunk-5QZT2EQN.cjs → chunk-HQEYZSF3.cjs} +4 -3
  97. package/dist/{chunk-JA6RML7C.mjs → chunk-HR4N2K4V.mjs} +2 -2
  98. package/dist/{chunk-6D3CJFNU.cjs → chunk-HR5GU4UU.cjs} +7 -7
  99. package/dist/{chunk-7RQ5KAK6.mjs → chunk-HTNJ7A4D.mjs} +88 -36
  100. package/dist/chunk-I4WZRG73.mjs +54 -0
  101. package/dist/{chunk-BGUTIQII.mjs → chunk-ICOJ2BC6.mjs} +24 -8
  102. package/dist/{chunk-SX535SU5.cjs → chunk-IJPRCQHW.cjs} +10 -10
  103. package/dist/{chunk-E7V2GYBP.mjs → chunk-IM3UINTZ.mjs} +67 -9
  104. package/dist/{chunk-MNIR7I7B.mjs → chunk-INKVDO42.mjs} +1 -1
  105. package/dist/{chunk-AHGOHPRN.mjs → chunk-IPG6B25T.mjs} +235 -100
  106. package/dist/{chunk-PE2LEWXA.mjs → chunk-J2VUPCCR.mjs} +4 -4
  107. package/dist/{chunk-Q2EKSSEG.cjs → chunk-JB4BHRFK.cjs} +17 -17
  108. package/dist/{chunk-YN7G22MP.cjs → chunk-JCYDWJVO.cjs} +3 -3
  109. package/dist/{chunk-LPXJEZJK.mjs → chunk-KCJBIWBM.mjs} +2 -2
  110. package/dist/{chunk-NSNQLBHR.cjs → chunk-KMGHXIDA.cjs} +2 -2
  111. package/dist/{chunk-SVCUSOEF.mjs → chunk-KR5DF7WK.mjs} +1 -1
  112. package/dist/{chunk-5DREJN4G.cjs → chunk-LKIG5SM6.cjs} +17 -17
  113. package/dist/{chunk-OGVOKAQU.mjs → chunk-LTOT5KVJ.mjs} +2 -2
  114. package/dist/{chunk-Z2FFLTF5.mjs → chunk-LTXKRIST.mjs} +2 -2
  115. package/dist/{chunk-67MZTLTF.cjs → chunk-M6DAIE4T.cjs} +27 -1
  116. package/dist/{chunk-IWGGRXD2.cjs → chunk-MHKPXX3J.cjs} +2 -2
  117. package/dist/{chunk-F7PKUP6P.cjs → chunk-MOGRRZMW.cjs} +38 -38
  118. package/dist/{chunk-DZZHTMWM.cjs → chunk-N3H7UPBM.cjs} +3 -2
  119. package/dist/{chunk-WGNGM6MJ.mjs → chunk-N3VMHPIY.mjs} +2 -2
  120. package/dist/{chunk-EBFTAVGD.mjs → chunk-NOYKBGUK.mjs} +672 -456
  121. package/dist/{chunk-LMXGCFAM.cjs → chunk-NSLRK5DK.cjs} +1 -1
  122. package/dist/{chunk-EVVV2XZ2.cjs → chunk-NW3DL2PM.cjs} +53 -7
  123. package/dist/{chunk-6ZFGWB75.cjs → chunk-OFVCWV2D.cjs} +5 -5
  124. package/dist/{chunk-NB2ZEBIS.cjs → chunk-OIWDEDUO.cjs} +540 -510
  125. package/dist/{chunk-WRWJ7IWT.cjs → chunk-OLKYHTLN.cjs} +5 -5
  126. package/dist/{chunk-QES76U42.mjs → chunk-ONSZP5JK.mjs} +4 -4
  127. package/dist/{chunk-H76C5AOU.mjs → chunk-OO4GVGM3.mjs} +4 -4
  128. package/dist/{chunk-BZJYPIFZ.cjs → chunk-OUDNUFVR.cjs} +12 -12
  129. package/dist/{chunk-EVIWKPJV.cjs → chunk-PLJMEUAN.cjs} +15 -1
  130. package/dist/{chunk-GFXKO4UW.mjs → chunk-PO5MZIWK.mjs} +49 -49
  131. package/dist/{chunk-VCW6BR6U.mjs → chunk-POL5RCVU.mjs} +2 -2
  132. package/dist/{chunk-EMTN5ABC.mjs → chunk-POVHO46S.mjs} +1 -1
  133. package/dist/{chunk-ASYOWPSR.cjs → chunk-PWDBWXQI.cjs} +2 -1
  134. package/dist/{chunk-X3Y6JWJG.cjs → chunk-PWMJBCAN.cjs} +3 -3
  135. package/dist/{chunk-IGE5BAWK.mjs → chunk-QBJ6N5MT.mjs} +53 -7
  136. package/dist/{chunk-62DZHPDK.cjs → chunk-QCKSYYXK.cjs} +10 -10
  137. package/dist/{chunk-PKXGFQZS.mjs → chunk-QD34VE4N.mjs} +1 -1
  138. package/dist/{chunk-57QAQU4F.mjs → chunk-QRNYSISP.mjs} +1 -1
  139. package/dist/{chunk-PRL7FXG4.cjs → chunk-RDNKQ5MK.cjs} +12 -13
  140. package/dist/{chunk-VJI2LWTL.cjs → chunk-RFNQTQ44.cjs} +2 -2
  141. package/dist/{chunk-IG2JE6WJ.mjs → chunk-RLEAVG6G.mjs} +1 -1
  142. package/dist/{chunk-VO5XDZHK.mjs → chunk-RPA45OQS.mjs} +2 -2
  143. package/dist/{chunk-PNWRH6TR.mjs → chunk-RZ6XUEQS.mjs} +4 -4
  144. package/dist/{chunk-S6RUJRWI.mjs → chunk-S3IWDDQ3.mjs} +1 -1
  145. package/dist/{chunk-EGHPFXPZ.cjs → chunk-SAPG45RA.cjs} +23 -23
  146. package/dist/{chunk-FE6KYDHC.cjs → chunk-SHDCKRP4.cjs} +3 -3
  147. package/dist/{chunk-DUSTJ6A5.mjs → chunk-SLEHAGGV.mjs} +2 -2
  148. package/dist/{chunk-26CNCIFI.cjs → chunk-T3SMMLSB.cjs} +2 -2
  149. package/dist/{chunk-K6DXKHFE.mjs → chunk-TE7AX6HB.mjs} +1 -1
  150. package/dist/{chunk-A7EJATEW.mjs → chunk-TLSGRK7E.mjs} +4 -4
  151. package/dist/{chunk-KHS3T3E5.mjs → chunk-TYHWZOA2.mjs} +1 -1
  152. package/dist/{chunk-Z3QXQN4U.mjs → chunk-U6GMCDRS.mjs} +1 -1
  153. package/dist/{chunk-URQW27KO.mjs → chunk-UBLKPREL.mjs} +1 -1
  154. package/dist/chunk-UDMBUTJD.mjs +85 -0
  155. package/dist/{chunk-WJ4NUY2H.mjs → chunk-UF4BNKKJ.mjs} +4 -4
  156. package/dist/{chunk-L7Y65BQU.cjs → chunk-UGD53SNO.cjs} +50 -50
  157. package/dist/{chunk-DD22NQFX.cjs → chunk-UGLTOLTJ.cjs} +2 -2
  158. package/dist/{chunk-G7B6NU4X.cjs → chunk-VFMHE5D3.cjs} +3 -3
  159. package/dist/{chunk-4SLHSODZ.cjs → chunk-VGHDPEPQ.cjs} +15 -15
  160. package/dist/{chunk-IXO6O2EL.cjs → chunk-VGVRGGP4.cjs} +2 -2
  161. package/dist/{chunk-47R7CX4A.mjs → chunk-VPGEYX5Y.mjs} +4 -4
  162. package/dist/chunk-VS7HLH4S.cjs +385 -0
  163. package/dist/{chunk-YRXPDKMM.cjs → chunk-W53Z4WDI.cjs} +8 -8
  164. package/dist/{chunk-NNGBTJCX.cjs → chunk-W6C3LEXX.cjs} +83 -25
  165. package/dist/{chunk-4VLXQ55O.cjs → chunk-WIZRYFB2.cjs} +3 -3
  166. package/dist/chunk-WMRGIQTA.cjs +48 -0
  167. package/dist/{chunk-52LTENRE.cjs → chunk-WOAXQ5MZ.cjs} +9 -9
  168. package/dist/{chunk-C6HGUTXB.mjs → chunk-XBSIGZ4J.mjs} +2 -3
  169. package/dist/{chunk-S7QEQCVV.mjs → chunk-XGL42MQ7.mjs} +1 -1
  170. package/dist/{chunk-JHZ6HULQ.cjs → chunk-XOFJUSWC.cjs} +4 -4
  171. package/dist/{chunk-LJKTJNOF.cjs → chunk-XOGCNKB7.cjs} +3 -3
  172. package/dist/{chunk-7JTVN6IJ.mjs → chunk-XOXCQGAF.mjs} +7 -6
  173. package/dist/{chunk-LIC6CMLB.mjs → chunk-YH7ENV3K.mjs} +18 -18
  174. package/dist/{chunk-ZJGFAW5U.mjs → chunk-YHHOTKUT.mjs} +5 -1
  175. package/dist/{chunk-B3IRRANH.mjs → chunk-YHM4PXJY.mjs} +1 -1
  176. package/dist/{chunk-PDACTAVX.mjs → chunk-YOVSWY2E.mjs} +1 -1
  177. package/dist/{chunk-ZEWIWAS2.mjs → chunk-YSU3WCW6.mjs} +2 -2
  178. package/dist/{chunk-R5X7FDOG.mjs → chunk-YU2MNIIY.mjs} +1 -1
  179. package/dist/{chunk-42EUEYW6.cjs → chunk-YUQUGVSV.cjs} +8 -8
  180. package/dist/{chunk-4STJ6LGR.mjs → chunk-Z3RM3VA2.mjs} +1 -1
  181. package/dist/{chunk-MBD34AS5.cjs → chunk-Z5BANEQD.cjs} +6 -6
  182. package/dist/{chunk-4PWGLPL6.mjs → chunk-ZIEO3DQ3.mjs} +26 -15
  183. package/dist/{chunk-2G6JPLSL.cjs → chunk-ZIYJWJV2.cjs} +27 -20
  184. package/dist/{chunk-KZ5BOWJS.cjs → chunk-ZKNXCRUQ.cjs} +28 -28
  185. package/dist/{cli-runtime.d-CGMGs1Zz.d.mts → cli-runtime.d-D8O1v2_X.d.mts} +7 -6
  186. package/dist/{cli-runtime.d-BG9q2_vC.d.ts → cli-runtime.d-hf4L1MNP.d.ts} +7 -6
  187. package/dist/client/lifecycle.d.mts +1 -1
  188. package/dist/client/lifecycle.d.ts +1 -1
  189. package/dist/{client-component.d-B84GPb_u.d.ts → client-component.d-CX8UCQh-.d.ts} +1 -1
  190. package/dist/{client-component.d-CdsG1E7p.d.mts → client-component.d-DFwUHlOz.d.mts} +1 -1
  191. package/dist/{client-plugins.d-DX-iCJWE.d.mts → client-plugins.d-BflSNO-b.d.mts} +5 -16
  192. package/dist/{client-plugins.d-FptsHgls.d.ts → client-plugins.d-qWp8hNwd.d.ts} +5 -16
  193. package/dist/client-plugins.d.mts +5 -4
  194. package/dist/client-plugins.d.ts +5 -4
  195. package/dist/client.cjs +9 -8
  196. package/dist/client.d.mts +23 -154
  197. package/dist/client.d.ts +23 -154
  198. package/dist/client.mjs +8 -7
  199. package/dist/config.d.mts +5 -4
  200. package/dist/config.d.ts +5 -4
  201. package/dist/cron.cjs +3 -3
  202. package/dist/cron.mjs +2 -2
  203. package/dist/desktop.d.mts +6 -5
  204. package/dist/desktop.d.ts +6 -5
  205. package/dist/{devtools-TMATFNUY.cjs → devtools-EI5N366Z.cjs} +17 -17
  206. package/dist/{devtools-7P3OUNLV.mjs → devtools-XJHODO5H.mjs} +14 -14
  207. package/dist/docs.cjs +18 -18
  208. package/dist/docs.d.mts +7 -6
  209. package/dist/docs.d.ts +7 -6
  210. package/dist/docs.mjs +17 -17
  211. package/dist/environment/vite.cjs +8 -7
  212. package/dist/environment/vite.d.mts +9 -0
  213. package/dist/environment/vite.d.ts +9 -0
  214. package/dist/environment/vite.mjs +7 -6
  215. package/dist/{handler.d-Cy3XbY_W.d.ts → handler.d-C2oRihfa.d.ts} +1 -1
  216. package/dist/{handler.d-DSwLTpa5.d.mts → handler.d-DoH5Krkq.d.mts} +1 -1
  217. package/dist/{headers.d-DiL9YTH3.d.mts → headers.d-BrX53wFQ.d.mts} +1 -1
  218. package/dist/{headers.d-Qbjo38a0.d.ts → headers.d-Dj0mfYpb.d.ts} +1 -1
  219. package/dist/index.cjs +90 -82
  220. package/dist/{index.d-OccJoC6I.d.ts → index.d-Dhc2scRl.d.ts} +1 -1
  221. package/dist/{index.d-CqQKX3s6.d.mts → index.d-DzDHOttz.d.mts} +1 -1
  222. package/dist/index.d.mts +29 -27
  223. package/dist/index.d.ts +29 -27
  224. package/dist/index.mjs +92 -84
  225. package/dist/instrumentation.cjs +3 -3
  226. package/dist/instrumentation.mjs +2 -2
  227. package/dist/integrations/orm.cjs +3 -3
  228. package/dist/integrations/orm.d.mts +5 -4
  229. package/dist/integrations/orm.d.ts +5 -4
  230. package/dist/integrations/orm.mjs +2 -2
  231. package/dist/integrations.cjs +2 -2
  232. package/dist/integrations.d.mts +5 -4
  233. package/dist/integrations.d.ts +5 -4
  234. package/dist/integrations.mjs +1 -1
  235. package/dist/internal/app-markdown-runtime.cjs +4 -4
  236. package/dist/internal/app-markdown-runtime.d.mts +15 -8
  237. package/dist/internal/app-markdown-runtime.d.ts +15 -8
  238. package/dist/internal/app-markdown-runtime.mjs +3 -3
  239. package/dist/internal/build-runtime.cjs +63 -62
  240. package/dist/internal/build-runtime.d.mts +8 -7
  241. package/dist/internal/build-runtime.d.ts +8 -7
  242. package/dist/internal/build-runtime.mjs +62 -61
  243. package/dist/internal/cli-runtime.cjs +37 -34
  244. package/dist/internal/cli-runtime.d.mts +12 -11
  245. package/dist/internal/cli-runtime.d.ts +12 -11
  246. package/dist/internal/cli-runtime.mjs +39 -36
  247. package/dist/internal/client-error-overlay.cjs +4 -4
  248. package/dist/internal/client-error-overlay.mjs +1 -1
  249. package/dist/internal/client-runtime.cjs +112 -14
  250. package/dist/internal/client-runtime.d.mts +29 -22
  251. package/dist/internal/client-runtime.d.ts +29 -22
  252. package/dist/internal/client-runtime.mjs +104 -6
  253. package/dist/internal/compression-runtime.d.mts +5 -4
  254. package/dist/internal/compression-runtime.d.ts +5 -4
  255. package/dist/internal/config-runtime.cjs +16 -16
  256. package/dist/internal/config-runtime.d.mts +7 -6
  257. package/dist/internal/config-runtime.d.ts +7 -6
  258. package/dist/internal/config-runtime.mjs +15 -15
  259. package/dist/internal/docs-precompiled-runtime.cjs +1 -1
  260. package/dist/internal/docs-precompiled-runtime.mjs +1 -1
  261. package/dist/internal/form-actions.cjs +3 -3
  262. package/dist/internal/form-actions.mjs +2 -2
  263. package/dist/internal/infra-analytics-runtime.cjs +11 -11
  264. package/dist/internal/infra-analytics-runtime.mjs +9 -9
  265. package/dist/internal/island-codec.cjs +3 -3
  266. package/dist/internal/island-codec.mjs +2 -2
  267. package/dist/internal/island-value-store.d.mts +1 -1
  268. package/dist/internal/island-value-store.d.ts +1 -1
  269. package/dist/internal/islands-boot.cjs +39 -5
  270. package/dist/internal/islands-boot.d.mts +19 -1
  271. package/dist/internal/islands-boot.d.ts +19 -1
  272. package/dist/internal/islands-boot.mjs +38 -4
  273. package/dist/internal/islands-runtime.cjs +10 -56
  274. package/dist/internal/islands-runtime.mjs +6 -52
  275. package/dist/internal/islands-server.cjs +4 -4
  276. package/dist/internal/islands-server.mjs +3 -3
  277. package/dist/internal/islx-actions-client.cjs +36 -0
  278. package/dist/internal/islx-actions-client.d.mts +13 -0
  279. package/dist/internal/islx-actions-client.d.ts +13 -0
  280. package/dist/internal/islx-actions-client.mjs +36 -0
  281. package/dist/internal/islx-actions-server.cjs +8 -0
  282. package/dist/internal/islx-actions-server.d.mts +6 -0
  283. package/dist/internal/islx-actions-server.d.ts +6 -0
  284. package/dist/internal/islx-actions-server.mjs +8 -0
  285. package/dist/internal/islx-client.d.mts +0 -4
  286. package/dist/internal/islx-client.d.ts +0 -4
  287. package/dist/internal/isolated-boundary.cjs +3 -3
  288. package/dist/internal/isolated-boundary.d.mts +1 -1
  289. package/dist/internal/isolated-boundary.d.ts +1 -1
  290. package/dist/internal/isolated-boundary.mjs +2 -2
  291. package/dist/internal/metadata-image-runtime.cjs +4 -2
  292. package/dist/internal/metadata-image-runtime.d.mts +18 -2
  293. package/dist/internal/metadata-image-runtime.d.ts +18 -2
  294. package/dist/internal/metadata-image-runtime.mjs +5 -3
  295. package/dist/internal/native-server-fns.cjs +5 -4
  296. package/dist/internal/native-server-fns.mjs +4 -3
  297. package/dist/internal/navigation-neutral.cjs +36 -0
  298. package/dist/internal/navigation-neutral.d.mts +14 -0
  299. package/dist/internal/navigation-neutral.d.ts +14 -0
  300. package/dist/internal/navigation-neutral.mjs +36 -0
  301. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  302. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  303. package/dist/internal/production-runtime.cjs +36 -36
  304. package/dist/internal/production-runtime.d.mts +15 -13
  305. package/dist/internal/production-runtime.d.ts +15 -13
  306. package/dist/internal/production-runtime.mjs +46 -46
  307. package/dist/internal/server-tree.cjs +5 -4
  308. package/dist/internal/server-tree.d.mts +3 -4
  309. package/dist/internal/server-tree.d.ts +3 -4
  310. package/dist/internal/server-tree.mjs +4 -3
  311. package/dist/internal/spa-router.cjs +44 -0
  312. package/dist/internal/spa-router.d.mts +42 -0
  313. package/dist/internal/spa-router.d.ts +42 -0
  314. package/dist/internal/spa-router.mjs +44 -0
  315. package/dist/internal/start-manifest.d.mts +5 -4
  316. package/dist/internal/start-manifest.d.ts +5 -4
  317. package/dist/internal/vercel-edge-middleware.cjs +4 -4
  318. package/dist/internal/vercel-edge-middleware.mjs +3 -3
  319. package/dist/island-value-protocol.d-fEoc1m8e.d.mts +27 -0
  320. package/dist/island-value-protocol.d-fEoc1m8e.d.ts +27 -0
  321. package/dist/{layers-5ZD4764G.mjs → layers-744BBUY5.mjs} +2 -2
  322. package/dist/layers-XLOMMQP7.cjs +21 -0
  323. package/dist/{lifecycle.d-VzcXyEyn.d.ts → lifecycle.d-OtGWAvJT.d.mts} +1 -1
  324. package/dist/{lifecycle.d-VzcXyEyn.d.mts → lifecycle.d-OtGWAvJT.d.ts} +1 -1
  325. package/dist/markdown.cjs +3 -3
  326. package/dist/markdown.d.mts +5 -4
  327. package/dist/markdown.d.ts +5 -4
  328. package/dist/markdown.mjs +2 -2
  329. package/dist/middleware.cjs +10 -10
  330. package/dist/middleware.d.mts +5 -4
  331. package/dist/middleware.d.ts +5 -4
  332. package/dist/middleware.mjs +9 -9
  333. package/dist/{mount.d-AcJaUtHF.d.mts → mount.d-DOaeUoWq.d.mts} +1 -1
  334. package/dist/{mount.d-CPzqOm-a.d.ts → mount.d-DwXjaOHY.d.ts} +1 -1
  335. package/dist/{native-server-fn-handler-XRTZR7SZ.cjs → native-server-fn-handler-57TCQPSM.cjs} +6 -6
  336. package/dist/{native-server-fn-handler-WYYY4YBN.mjs → native-server-fn-handler-PYK65A46.mjs} +5 -5
  337. package/dist/{native-tree-MNUFN5G6.cjs → native-tree-5TENEQ7Y.cjs} +4 -4
  338. package/dist/{native-tree-JDI3LJSH.mjs → native-tree-LNO7K6JR.mjs} +3 -3
  339. package/dist/{navigation-delegate.d-C4i5Y39E.d.mts → navigation-delegate.d-BElGUMgt.d.mts} +1 -1
  340. package/dist/{navigation-delegate.d-_Df9DnPY.d.ts → navigation-delegate.d-o3pPd9VI.d.ts} +1 -1
  341. package/dist/navigation-errors.d-DwHtoMyR.d.mts +13 -0
  342. package/dist/navigation-errors.d-DwHtoMyR.d.ts +13 -0
  343. package/dist/navigation.cjs +6 -6
  344. package/dist/navigation.d.mts +10 -9
  345. package/dist/navigation.d.ts +10 -9
  346. package/dist/navigation.mjs +5 -5
  347. package/dist/{nitro-NUCTYEKJ.cjs → nitro-XGIO6EQN.cjs} +7 -7
  348. package/dist/{nitro-VCJ6QQSI.mjs → nitro-YLTGVGK4.mjs} +3 -3
  349. package/dist/node-module-bundle-TNSY5PAC.cjs +15 -0
  350. package/dist/{node-module-bundle-XPLBMXRD.mjs → node-module-bundle-ZWCQJCKA.mjs} +3 -1
  351. package/dist/observability.cjs +8 -2
  352. package/dist/{observability.d-DdJRiaIX.d.mts → observability.d-mXSbp4jc.d.mts} +17 -1
  353. package/dist/{observability.d-DdJRiaIX.d.ts → observability.d-mXSbp4jc.d.ts} +17 -1
  354. package/dist/observability.d.mts +1 -1
  355. package/dist/observability.d.ts +1 -1
  356. package/dist/observability.mjs +7 -1
  357. package/dist/{plugin-TV6W7YNK.mjs → plugin-33I3V42N.mjs} +1 -1
  358. package/dist/{plugin-AGEFSU7K.cjs → plugin-LN3JBZRR.cjs} +2 -2
  359. package/dist/plugin.cjs +50 -48
  360. package/dist/plugin.d.mts +9 -8
  361. package/dist/plugin.d.ts +9 -8
  362. package/dist/plugin.mjs +49 -47
  363. package/dist/query/client.cjs +10 -10
  364. package/dist/query/client.mjs +5 -5
  365. package/dist/{render-plan.d-CslZE7o7.d.ts → render-plan.d-BD06tqFA.d.ts} +1 -1
  366. package/dist/{render-plan.d-4V_NmaA6.d.mts → render-plan.d-xWCRAJeR.d.mts} +1 -1
  367. package/dist/renderer/none/server.cjs +5 -1
  368. package/dist/renderer/none/server.d.mts +3 -1
  369. package/dist/renderer/none/server.d.ts +3 -1
  370. package/dist/renderer/none/server.mjs +4 -0
  371. package/dist/renderer/react/server.cjs +6 -6
  372. package/dist/renderer/react/server.mjs +3 -3
  373. package/dist/renderer-client.cjs +34 -15
  374. package/dist/renderer-client.d.mts +16 -100
  375. package/dist/renderer-client.d.ts +16 -100
  376. package/dist/renderer-client.mjs +23 -4
  377. package/dist/renderer.cjs +4 -2
  378. package/dist/renderer.d.mts +49 -6
  379. package/dist/renderer.d.ts +49 -6
  380. package/dist/renderer.mjs +3 -1
  381. package/dist/{request.d-CbV3y7j3.d.ts → request.d-DUMuWxSN.d.ts} +1 -1
  382. package/dist/{request.d-CmLTxEgS.d.mts → request.d-Dx82V8bz.d.mts} +1 -1
  383. package/dist/request.d.mts +6 -5
  384. package/dist/request.d.ts +6 -5
  385. package/dist/{route-rendering.d-CETnXNez.d.ts → route-rendering.d-BwBVpLtD.d.ts} +1 -1
  386. package/dist/{route-rendering.d-CmoqfOmj.d.mts → route-rendering.d-DJh6GauM.d.mts} +1 -1
  387. package/dist/{router.d-ktz7pwYm.d.mts → router.d-BtkKDxUB.d.mts} +1 -1
  388. package/dist/{router.d-Dga3N5YO.d.ts → router.d-CJBSG5jr.d.ts} +1 -1
  389. package/dist/routes.cjs +5 -5
  390. package/dist/routes.d.mts +5 -4
  391. package/dist/routes.d.ts +5 -4
  392. package/dist/routes.mjs +4 -4
  393. package/dist/{rsc-pipeline-N7CWJW7T.mjs → rsc-pipeline-GD6KLOIG.mjs} +20 -20
  394. package/dist/{rsc-pipeline-JLYD26AR.cjs → rsc-pipeline-H5AXQA7A.cjs} +21 -21
  395. package/dist/{runtime-QXX2A4TS.mjs → runtime-OJ7FXFUI.mjs} +22 -22
  396. package/dist/{runtime-F5NSS4DD.cjs → runtime-YWQVBC3V.cjs} +32 -32
  397. package/dist/{runtime.d-BWLZUOfA.d.ts → runtime.d-BQnD0cfC.d.ts} +1 -1
  398. package/dist/{runtime.d-DuaXEM0p.d.mts → runtime.d-C4SuZXf6.d.mts} +1 -1
  399. package/dist/{schema-dev-notice-2GN5V7Y2.mjs → schema-dev-notice-EUPAUJVN.mjs} +2 -2
  400. package/dist/{schema-dev-notice-6VCOZGG2.cjs → schema-dev-notice-ZSCL47CT.cjs} +5 -5
  401. package/dist/search-client-A7YJT7JZ.cjs +15 -0
  402. package/dist/{search-client-W4PEFAQB.mjs → search-client-GIXIEU75.mjs} +1 -1
  403. package/dist/server-action-security.cjs +1 -1
  404. package/dist/server-action-security.mjs +1 -1
  405. package/dist/{server-components-status.d-CqxtJmqP.d.mts → server-components-status.d-9rH7ZoEq.d.mts} +1 -1
  406. package/dist/{server-components-status.d-C5JpC7_Y.d.ts → server-components-status.d-rfKOcE0N.d.ts} +1 -1
  407. package/dist/server-fn.cjs +5 -5
  408. package/dist/server-fn.mjs +4 -4
  409. package/dist/server-plugins.cjs +1 -1
  410. package/dist/server-plugins.d.mts +7 -6
  411. package/dist/server-plugins.d.ts +7 -6
  412. package/dist/server-plugins.mjs +1 -1
  413. package/dist/server-query.cjs +6 -6
  414. package/dist/server-query.mjs +5 -5
  415. package/dist/server.cjs +95 -90
  416. package/dist/server.d.mts +16 -15
  417. package/dist/server.d.ts +16 -15
  418. package/dist/server.mjs +61 -56
  419. package/dist/{session-AK2OA5UZ.mjs → session-4IB34X35.mjs} +2 -2
  420. package/dist/session-MOYQJ7E6.cjs +24 -0
  421. package/dist/{spa-router.d-C3LzwTlY.d.ts → spa-router.d-DMKiBsHH.d.ts} +20 -4
  422. package/dist/{spa-router.d-BLE188EL.d.mts → spa-router.d-V6XLSTCy.d.mts} +20 -4
  423. package/dist/{ssg.d-QrFyU6T4.d.mts → ssg.d-BnCKPQL0.d.mts} +2 -2
  424. package/dist/{ssg.d-DisOfj0I.d.ts → ssg.d-MNedvvMB.d.ts} +2 -2
  425. package/dist/storage.cjs +2 -2
  426. package/dist/storage.d.mts +112 -96
  427. package/dist/storage.d.ts +112 -96
  428. package/dist/storage.mjs +1 -1
  429. package/dist/store-core.d-Ad5biajo.d.ts +301 -0
  430. package/dist/store-core.d-BqJI1-ix.d.mts +301 -0
  431. package/dist/testing.cjs +13 -13
  432. package/dist/testing.d.mts +5 -4
  433. package/dist/testing.d.ts +5 -4
  434. package/dist/testing.mjs +10 -10
  435. package/dist/{types.d-DW2vyaUq.d.mts → types.d-C5hlNbHa.d.mts} +8 -1
  436. package/dist/{types.d-DW2vyaUq.d.ts → types.d-C5hlNbHa.d.ts} +8 -1
  437. package/dist/{utils.d-BlWZFgdL.d.mts → utils.d-BEKLWa0Z.d.mts} +1 -1
  438. package/dist/{utils.d-7YcgfTCK.d.ts → utils.d-BdjHKDuT.d.ts} +1 -1
  439. package/dist/version.cjs +2 -2
  440. package/dist/version.mjs +1 -1
  441. package/dist/vite.cjs +55 -49
  442. package/dist/vite.d.mts +26 -10
  443. package/dist/vite.d.ts +26 -10
  444. package/dist/vite.mjs +54 -48
  445. package/dist/workflows.cjs +3 -3
  446. package/dist/workflows.mjs +2 -2
  447. package/package.json +23 -2
  448. package/types/images.d.ts +9 -0
  449. package/dist/analyzer-KVTUYGTT.cjs +0 -16
  450. package/dist/chunk-CQL5ZGFU.cjs +0 -50
  451. package/dist/chunk-HONTCUK6.mjs +0 -203
  452. package/dist/chunk-K6PGK7DC.cjs +0 -203
  453. package/dist/chunk-NBIVGHAT.mjs +0 -50
  454. package/dist/island-value-protocol.d-BRayRghM.d.mts +0 -12
  455. package/dist/island-value-protocol.d-BRayRghM.d.ts +0 -12
  456. package/dist/layers-HMEGUEXM.cjs +0 -21
  457. package/dist/node-module-bundle-M6BISE2P.cjs +0 -13
  458. package/dist/search-client-6NVC6HM2.cjs +0 -15
  459. package/dist/session-H4TWP73H.cjs +0 -24
  460. package/dist/{chunk-JKFN3YVG.mjs → chunk-6JWXHPVR.mjs} +0 -0
  461. package/dist/{chunk-522K362I.mjs → chunk-C2OLXVUC.mjs} +0 -0
  462. package/dist/{chunk-MALGIHIC.cjs → chunk-HS4JPIGR.cjs} +0 -0
  463. package/dist/{chunk-PBJ7MEOV.cjs → chunk-OZUINP2P.cjs} +2 -2
  464. package/dist/{chunk-CUZT7474.cjs → chunk-TCMRLW3K.cjs} +0 -0
  465. package/dist/{chunk-Q3DO7MVK.mjs → chunk-URBP6DLH.mjs} +0 -0
  466. package/dist/{chunk-7FQFK3OA.mjs → chunk-V7HNYR76.mjs} +3 -3
  467. /package/dist/{chunk-AOTD2N5P.cjs → chunk-WGWWRV2M.cjs} +0 -0
@@ -0,0 +1,301 @@
1
+ import { FarmRouterPathParams, FarmRouterPathParam, FarmRouterBuildOptions, FarmRouterRouteInput } from './router.js';
2
+ import { b as FarmViewTransitionMode, a as FarmNavigationState, c as FarmNavigateOptions } from './spa-router.d-DMKiBsHH.js';
3
+ import { F as FarmClientCacheStatus } from './client-cache.d-Deoqq-nM.js';
4
+ import { ServerFn } from './server-fn.js';
5
+ import { ServerQuery } from './server-query.js';
6
+ import { S as ServerQueryFetchOptions } from './server-query-runtime.d-DXRNhX_3.js';
7
+ import { F as FarmThemeSnapshot, a as FarmThemePreference } from './types.d-DQnyD3VD.js';
8
+ import { f as FarmI18nLocale, b as FarmI18nClientSnapshot, o as FarmTranslator } from './types.d-euATAbE4.js';
9
+ import './navigation-delegate.d-o3pPd9VI.js';
10
+
11
+ /**
12
+ * Prefetch strategy (TanStack Router–style):
13
+ * - "intent": prefetch on hover and touchstart (with prefetchDelay)
14
+ * - "viewport": prefetch when link enters viewport (IntersectionObserver)
15
+ * - "render": prefetch as soon as the link is mounted
16
+ * - "none" | false: no prefetch
17
+ */
18
+ type PrefetchBehavior = false | "intent" | "viewport" | "render" | "none";
19
+ /** @internal Legacy prefetch mode for backward compatibility */
20
+ type PrefetchLegacy = boolean | "hover" | "viewport" | "none";
21
+ /**
22
+ * Augment this interface via the generated farm.d.ts so Link href is typed
23
+ * without passing a generic. Defaults to string when not augmented.
24
+ */
25
+ interface LinkDefaultRoute {
26
+ }
27
+ type DefaultRoutePath = LinkDefaultRoute extends {
28
+ _: infer TRoute extends string;
29
+ } ? TRoute : string;
30
+ type DefaultRoutePattern = LinkDefaultRoute extends {
31
+ pattern: infer TRoute extends string;
32
+ } ? TRoute : DefaultRoutePath;
33
+ type DefaultRouteHref = DefaultRoutePath | DefaultRoutePattern;
34
+ type RouteHref<TRoute extends string> = TRoute | `${TRoute}?${string}` | `${TRoute}#${string}` | `${TRoute}?${string}#${string}`;
35
+ type RouteParamValue = Exclude<FarmRouterPathParam, null | undefined>;
36
+ type RouteOptionalParamValue = FarmRouterPathParam;
37
+ type RouteParams<TRoute extends string> = string extends TRoute ? FarmRouterPathParams : ExtractRouteParams<StripRouteSuffix<TRoute>>;
38
+ /** URI schemes recognized as typed external Link targets. Apps may augment this interface. */
39
+ interface LinkExternalUriSchemes {
40
+ about: true;
41
+ blob: true;
42
+ data: true;
43
+ file: true;
44
+ ftp: true;
45
+ ftps: true;
46
+ geo: true;
47
+ git: true;
48
+ http: true;
49
+ https: true;
50
+ im: true;
51
+ intent: true;
52
+ irc: true;
53
+ ircs: true;
54
+ magnet: true;
55
+ mailto: true;
56
+ market: true;
57
+ sms: true;
58
+ ssh: true;
59
+ tel: true;
60
+ urn: true;
61
+ vscode: true;
62
+ webcal: true;
63
+ ws: true;
64
+ wss: true;
65
+ }
66
+ type ExternalUriScheme = Extract<keyof LinkExternalUriSchemes, string>;
67
+ type UriSchemeLetter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z";
68
+ type UriSchemeStart = UriSchemeLetter | Uppercase<UriSchemeLetter>;
69
+ type UriSchemeCharacter = UriSchemeStart | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "+" | "-" | ".";
70
+ type IsUriSchemeTail<TValue extends string> = TValue extends "" ? true : TValue extends `${infer First}${infer Rest}` ? First extends UriSchemeCharacter ? IsUriSchemeTail<Rest> : false : false;
71
+ type IsUriScheme<TValue extends string> = TValue extends `${infer First}${infer Rest}` ? First extends UriSchemeStart ? IsUriSchemeTail<Rest> : false : false;
72
+ type KnownExternalHref = `//${string}` | `${ExternalUriScheme}:${string}`;
73
+ /** External URLs; these are never type-checked as routes. */
74
+ type ExternalHref<THref extends string = string> = string extends THref ? KnownExternalHref : THref extends `//${string}` ? THref : THref extends `${infer Scheme}:${string}` ? IsUriScheme<Scheme> extends true ? THref : never : never;
75
+ type StripRouteSuffix<TRoute extends string> = TRoute extends `${infer Path}?${string}` ? StripRouteSuffix<Path> : TRoute extends `${infer Path}#${string}` ? StripRouteSuffix<Path> : TRoute;
76
+ type ExtractRouteParams<TRoute extends string> = Simplify<ExtractOptionalCatchAllParams<TRoute> & ExtractCatchAllParams<TRoute> & ExtractDynamicParams<TRoute>>;
77
+ type ExtractOptionalCatchAllParams<TRoute extends string> = TRoute extends `${string}[[...${infer Param}]]${infer Rest}` ? {
78
+ [Key in Param]?: RouteOptionalParamValue;
79
+ } & ExtractOptionalCatchAllParams<Rest> : {};
80
+ type ExtractCatchAllParams<TRoute extends string> = TRoute extends `${string}[...${infer Param}]${infer Rest}` ? Param extends `[...${string}` ? ExtractCatchAllParams<Rest> : {
81
+ [Key in Param]: RouteParamValue;
82
+ } & ExtractCatchAllParams<Rest> : {};
83
+ type ExtractDynamicParams<TRoute extends string> = TRoute extends `${string}[${infer Param}]${infer Rest}` ? Param extends `...${string}` | `[...${string}` ? ExtractDynamicParams<Rest> : {
84
+ [Key in Param]: RouteParamValue;
85
+ } & ExtractDynamicParams<Rest> : {};
86
+ type Simplify<T> = {
87
+ [Key in keyof T]: T[Key];
88
+ } & {};
89
+ type HasRouteParams<TRoute extends string> = keyof RouteParams<TRoute> extends never ? false : true;
90
+ type RoutesWithRequiredParams<TRoute extends string> = TRoute extends string ? HasRouteParams<TRoute> extends true ? TRoute : never : never;
91
+ type LinkRouteParamsProps<TRoute extends string> = string extends TRoute ? {
92
+ params?: FarmRouterPathParams;
93
+ } : HasRouteParams<TRoute> extends true ? {
94
+ params: RouteParams<TRoute>;
95
+ } : {
96
+ params?: FarmRouterPathParams;
97
+ };
98
+ type LinkRouteTargetProps<TRoute extends string> = [RoutesWithRequiredParams<TRoute>] extends [
99
+ never
100
+ ] ? {
101
+ /** Internal route path with all params already resolved. */
102
+ href: RouteHref<TRoute>;
103
+ params?: FarmRouterPathParams;
104
+ } : TRoute extends string ? {
105
+ /** Internal route path or route pattern. */
106
+ href: RouteHref<TRoute>;
107
+ } & LinkRouteParamsProps<TRoute> : never;
108
+ type LinkExternalTargetProps<THref extends string = string> = {
109
+ /** External URL; these are never type-checked as app routes. */
110
+ href: ExternalHref<THref>;
111
+ params?: never;
112
+ };
113
+ type LinkTargetProps<TRoute extends string, THref extends string> = LinkExternalTargetProps<THref> | LinkRouteTargetProps<TRoute>;
114
+ /** What a `Link` takes besides its anchor attributes, in every renderer. */
115
+ type FarmLinkOptions<TRoute extends string = DefaultRouteHref, THref extends string = string> = LinkTargetProps<TRoute, THref> & {
116
+ /**
117
+ * When to prefetch. TanStack-style: "intent" (hover+touch), "viewport", "render", or "none".
118
+ * Legacy: true (intent+viewport), "hover" (intent), "viewport", false/"none".
119
+ */
120
+ prefetch?: PrefetchBehavior | PrefetchLegacy;
121
+ /** Search params appended after route params are resolved. */
122
+ query?: FarmRouterBuildOptions["query"];
123
+ /** Hash appended after route params and search params are resolved. */
124
+ hash?: string;
125
+ /** Add a trailing slash to the generated internal href. */
126
+ trailingSlash?: boolean;
127
+ /** Delay in ms before intent-based prefetch (hover/touch). Default 50. */
128
+ prefetchDelay?: number;
129
+ /** Replace current history entry instead of pushing */
130
+ replace?: boolean;
131
+ /** Scroll to top after navigation (default: true) */
132
+ scroll?: boolean;
133
+ /** Wrap this SPA navigation in a browser View Transition when supported. */
134
+ viewTransition?: FarmViewTransitionMode;
135
+ /** Preserve the active locale by default, or navigate using this locale. */
136
+ locale?: FarmI18nLocale;
137
+ };
138
+ /** The keys of {@link FarmLinkOptions}, which a `Link` keeps off its anchor. */
139
+ declare const FARM_LINK_OPTION_KEYS: readonly ["href", "params", "query", "hash", "trailingSlash", "prefetch", "prefetchDelay", "replace", "scroll", "viewTransition", "locale"];
140
+ /**
141
+ * The attributes a `Link` puts on its anchor. The app's router reads them: a click on the anchor
142
+ * navigates with `data-replace`, `data-no-scroll` and `data-view-transition`, and it prefetches
143
+ * as `data-farm-prefetch` says, so an anchor with these attributes behaves as a `Link` without
144
+ * any event handler of its own. `href` is absent for a `javascript:` URL, which never runs.
145
+ */
146
+ interface FarmLinkAttributes {
147
+ href: string | undefined;
148
+ "data-farm-link": "";
149
+ "data-farm-locale": FarmI18nLocale | undefined;
150
+ "data-farm-prefetch": string | undefined;
151
+ "data-farm-prefetch-delay": string | undefined;
152
+ "data-replace": "" | undefined;
153
+ "data-no-scroll": "" | undefined;
154
+ "data-view-transition": "auto" | "true" | undefined;
155
+ }
156
+ /**
157
+ * Resolves `Link` options into the attributes of its anchor: the href with route params, query,
158
+ * hash, locale, trailing slash and base path applied, and the data attributes the app's router
159
+ * reads to navigate and prefetch. Spread them on an `<a>` in any renderer to get a `Link`.
160
+ *
161
+ * ```ts
162
+ * resolveLinkAttributes({ href: "/products/[id]", params: { id: "42" }, prefetch: "intent" });
163
+ * // { href: "/products/42", "data-farm-link": "", "data-farm-prefetch": "intent", ... }
164
+ * ```
165
+ */
166
+ declare function resolveLinkAttributes<TRoute extends string = DefaultRouteHref, THref extends string = string>(options: FarmLinkOptions<TRoute, THref>): FarmLinkAttributes;
167
+
168
+ /**
169
+ * The state contract every renderer binding reads: a snapshot, and a way to hear that it changed.
170
+ * Farm's router, action, query, theme, and i18n stores implement it, and so does `createStore`.
171
+ */
172
+ interface FarmClientStore<TSnapshot> {
173
+ /** Returns the current snapshot. It must return the same value until the state changes. */
174
+ getSnapshot(): TSnapshot;
175
+ /** Calls `listener` after the snapshot changes. Returns a function that unsubscribes. */
176
+ subscribe(listener: () => void): () => void;
177
+ }
178
+
179
+ interface FarmRendererRouterOptions {
180
+ basePath?: string;
181
+ routes?: readonly FarmRouterRouteInput[];
182
+ }
183
+ interface FarmRendererRouterSnapshot {
184
+ pathname: string;
185
+ searchParams: URLSearchParams;
186
+ params: Record<string, string>;
187
+ pageState: unknown;
188
+ navigation: FarmNavigationState;
189
+ }
190
+ interface FarmRendererRouter extends FarmClientStore<FarmRendererRouterSnapshot> {
191
+ push(href: string, options?: Omit<FarmNavigateOptions, "replace">): Promise<void>;
192
+ replace(href: string, options?: Omit<FarmNavigateOptions, "replace">): Promise<void>;
193
+ refresh(options?: Omit<FarmNavigateOptions, "replace" | "refresh">): Promise<void>;
194
+ prefetch(href: string): Promise<void>;
195
+ back(): void;
196
+ forward(): void;
197
+ pushState<TState>(state: TState, href?: string): void;
198
+ replaceState<TState>(state: TState, href?: string): void;
199
+ }
200
+ declare function createRendererRouter(options?: FarmRendererRouterOptions): FarmRendererRouter;
201
+ type FarmActionStatus = "idle" | "pending" | "success" | "error";
202
+ interface FarmActionSnapshot<TResult, TError extends Error = Error> {
203
+ pending: boolean;
204
+ status: FarmActionStatus;
205
+ data: TResult | null;
206
+ error: TError | null;
207
+ }
208
+ interface FarmActionOptions<TInput, TResult, TError extends Error = Error> {
209
+ initialResult?: TResult | null;
210
+ resetOnSubmit?: boolean;
211
+ optimistic?: (context: {
212
+ input: TInput | FormData | undefined;
213
+ formData?: FormData;
214
+ current: TResult | null;
215
+ }) => TResult | null | undefined;
216
+ rollbackOnError?: boolean;
217
+ onSuccess?: (result: TResult) => void;
218
+ onError?: (error: TError) => void;
219
+ onSettled?: (result: TResult | null, error: TError | null) => void;
220
+ }
221
+ type FarmActionSubmit<TInput, TResult> = [unknown] extends [TInput] ? (input?: TInput | FormData) => Promise<TResult> : (input: TInput | FormData) => Promise<TResult>;
222
+ type FarmAction<TInput, TResult, TError extends Error = Error> = FarmClientStore<FarmActionSnapshot<TResult, TError>> & {
223
+ submit: FarmActionSubmit<TInput, TResult>;
224
+ reset(): void;
225
+ };
226
+ type FarmRouteActionTarget<TServerFn extends ServerFn<any, any, any>> = {
227
+ readonly action: TServerFn;
228
+ };
229
+ declare function createRendererAction<TInput, TResult, TError extends Error = Error>(target: ServerFn<TInput, TResult, TError> | FarmRouteActionTarget<ServerFn<TInput, TResult, TError>>, options?: FarmActionOptions<TInput, TResult, TError>): FarmAction<TInput, TResult, TError>;
230
+ interface FarmRendererQueryOptions extends ServerQueryFetchOptions {
231
+ enabled?: boolean;
232
+ refetchOnWindowFocus?: boolean;
233
+ refetchOnReconnect?: boolean;
234
+ }
235
+ interface FarmRendererQuerySnapshot<TData> {
236
+ data: TData | undefined;
237
+ error: Error | null;
238
+ status: FarmClientCacheStatus;
239
+ pending: boolean;
240
+ fetching: boolean;
241
+ stale: boolean;
242
+ }
243
+ interface FarmRendererQuery<TData> extends FarmClientStore<FarmRendererQuerySnapshot<TData>> {
244
+ refetch(): Promise<TData>;
245
+ dispose(): void;
246
+ }
247
+ declare function createRendererQuery<TInput, TData>(query: ServerQuery<TInput, TData>, input: TInput, options?: FarmRendererQueryOptions): FarmRendererQuery<TData>;
248
+ interface FarmRendererTheme extends FarmClientStore<FarmThemeSnapshot> {
249
+ setTheme(theme: FarmThemePreference): void;
250
+ toggleTheme(): FarmThemeSnapshot["resolvedTheme"];
251
+ }
252
+ declare function createRendererTheme(): FarmRendererTheme;
253
+ interface FarmRendererI18n extends FarmClientStore<FarmI18nClientSnapshot | undefined> {
254
+ readonly t: FarmTranslator;
255
+ setLocale(locale: FarmI18nLocale): void;
256
+ }
257
+ declare function createRendererI18n(): FarmRendererI18n;
258
+
259
+ type StoreState = Record<string, any>;
260
+ type StoreValueUpdater<T> = T | ((previous: T) => T);
261
+ type StorePatch<T extends StoreState> = Partial<T> | ((state: T) => Partial<T>);
262
+ type StoreListener<T extends StoreState> = (state: T, previousState: T) => void;
263
+ type StoreKeyListener<T extends StoreState, K extends keyof T> = (value: T[K], previousValue: T[K]) => void;
264
+ type StoreKeysListener<T extends StoreState, K extends keyof T> = (value: Pick<T, K>, previousValue: Pick<T, K>) => void;
265
+ type FieldAccessor<T extends StoreState, K extends keyof T> = {
266
+ /** Reads the field's current value. */
267
+ (): T[K];
268
+ get(): T[K];
269
+ set(value: StoreValueUpdater<T[K]>): T[K];
270
+ subscribe(listener: StoreKeyListener<T, K>): () => void;
271
+ };
272
+ type StoreFields<T extends StoreState> = {
273
+ [K in keyof T]: FieldAccessor<T, K>;
274
+ };
275
+ /**
276
+ * A store's methods without a renderer. It is a `FarmClientStore`, so any renderer binds it the
277
+ * way it binds Farm's router or query stores.
278
+ */
279
+ interface StoreApi<T extends StoreState> extends FarmClientStore<T> {
280
+ get(): T;
281
+ get<K extends keyof T>(key: K): T[K];
282
+ /** The whole state. Its identity changes only when a value changes. */
283
+ getSnapshot(): T;
284
+ set<K extends keyof T>(key: K, value: StoreValueUpdater<T[K]>): T[K];
285
+ set(patch: StorePatch<T>): T;
286
+ replace(nextState: T | ((state: T) => T)): T;
287
+ reset(): T;
288
+ subscribe(listener: StoreListener<T>): () => void;
289
+ subscribe<K extends keyof T>(key: K, listener: StoreKeyListener<T, K>): () => void;
290
+ subscribe<K extends keyof T>(keys: readonly K[], listener: StoreKeysListener<T, K>): () => void;
291
+ }
292
+ type Store<T extends StoreState, TMethods extends Record<string, any> = {}> = StoreApi<T> & StoreFields<T> & TMethods;
293
+ /**
294
+ * Creates an in-memory store that works with every renderer. Read it with `get()` or a field
295
+ * accessor, and bind it with your renderer's binding (`useStore` in Solid and Vue,
296
+ * `createReadable` in Svelte) or with any code that reads a `FarmClientStore`. React apps can
297
+ * import `createStore` from `@farm.js/core/client` instead, which adds the `use()` hook.
298
+ */
299
+ declare function createStore<T extends StoreState, TMethods extends Record<string, any> = {}>(initialState: T, extend?: (store: Store<T>) => TMethods): Store<T, TMethods>;
300
+
301
+ export { type FarmRendererRouterSnapshot as A, type FarmRendererTheme as B, type FarmRouteActionTarget as C, type DefaultRouteHref as D, type ExternalHref as E, type FarmLinkOptions as F, type Store as G, type StoreFields as H, createRendererAction as I, createRendererI18n as J, createRendererQuery as K, type LinkDefaultRoute as L, createRendererRouter as M, createRendererTheme as N, createStore as O, type PrefetchBehavior as P, resolveLinkAttributes as Q, type RouteHref as R, type StoreKeyListener as S, type DefaultRoutePath as a, type DefaultRoutePattern as b, type LinkExternalUriSchemes as c, type RouteOptionalParamValue as d, type RouteParamValue as e, type RouteParams as f, type StoreKeysListener as g, type StoreListener as h, type StorePatch as i, type StoreState as j, type StoreValueUpdater as k, type StoreApi as l, FARM_LINK_OPTION_KEYS as m, type FarmAction as n, type FarmActionOptions as o, type FarmActionSnapshot as p, type FarmActionStatus as q, type FarmActionSubmit as r, type FarmClientStore as s, type FarmLinkAttributes as t, type FarmRendererI18n as u, type FarmRendererQuery as v, type FarmRendererQueryOptions as w, type FarmRendererQuerySnapshot as x, type FarmRendererRouter as y, type FarmRendererRouterOptions as z };
@@ -0,0 +1,301 @@
1
+ import { FarmRouterPathParams, FarmRouterPathParam, FarmRouterBuildOptions, FarmRouterRouteInput } from './router.mjs';
2
+ import { b as FarmViewTransitionMode, a as FarmNavigationState, c as FarmNavigateOptions } from './spa-router.d-V6XLSTCy.mjs';
3
+ import { F as FarmClientCacheStatus } from './client-cache.d-di_Nasxa.mjs';
4
+ import { ServerFn } from './server-fn.mjs';
5
+ import { ServerQuery } from './server-query.mjs';
6
+ import { S as ServerQueryFetchOptions } from './server-query-runtime.d-aP52iuL5.mjs';
7
+ import { F as FarmThemeSnapshot, a as FarmThemePreference } from './types.d-DQnyD3VD.mjs';
8
+ import { f as FarmI18nLocale, b as FarmI18nClientSnapshot, o as FarmTranslator } from './types.d-euATAbE4.mjs';
9
+ import './navigation-delegate.d-BElGUMgt.mjs';
10
+
11
+ /**
12
+ * Prefetch strategy (TanStack Router–style):
13
+ * - "intent": prefetch on hover and touchstart (with prefetchDelay)
14
+ * - "viewport": prefetch when link enters viewport (IntersectionObserver)
15
+ * - "render": prefetch as soon as the link is mounted
16
+ * - "none" | false: no prefetch
17
+ */
18
+ type PrefetchBehavior = false | "intent" | "viewport" | "render" | "none";
19
+ /** @internal Legacy prefetch mode for backward compatibility */
20
+ type PrefetchLegacy = boolean | "hover" | "viewport" | "none";
21
+ /**
22
+ * Augment this interface via the generated farm.d.ts so Link href is typed
23
+ * without passing a generic. Defaults to string when not augmented.
24
+ */
25
+ interface LinkDefaultRoute {
26
+ }
27
+ type DefaultRoutePath = LinkDefaultRoute extends {
28
+ _: infer TRoute extends string;
29
+ } ? TRoute : string;
30
+ type DefaultRoutePattern = LinkDefaultRoute extends {
31
+ pattern: infer TRoute extends string;
32
+ } ? TRoute : DefaultRoutePath;
33
+ type DefaultRouteHref = DefaultRoutePath | DefaultRoutePattern;
34
+ type RouteHref<TRoute extends string> = TRoute | `${TRoute}?${string}` | `${TRoute}#${string}` | `${TRoute}?${string}#${string}`;
35
+ type RouteParamValue = Exclude<FarmRouterPathParam, null | undefined>;
36
+ type RouteOptionalParamValue = FarmRouterPathParam;
37
+ type RouteParams<TRoute extends string> = string extends TRoute ? FarmRouterPathParams : ExtractRouteParams<StripRouteSuffix<TRoute>>;
38
+ /** URI schemes recognized as typed external Link targets. Apps may augment this interface. */
39
+ interface LinkExternalUriSchemes {
40
+ about: true;
41
+ blob: true;
42
+ data: true;
43
+ file: true;
44
+ ftp: true;
45
+ ftps: true;
46
+ geo: true;
47
+ git: true;
48
+ http: true;
49
+ https: true;
50
+ im: true;
51
+ intent: true;
52
+ irc: true;
53
+ ircs: true;
54
+ magnet: true;
55
+ mailto: true;
56
+ market: true;
57
+ sms: true;
58
+ ssh: true;
59
+ tel: true;
60
+ urn: true;
61
+ vscode: true;
62
+ webcal: true;
63
+ ws: true;
64
+ wss: true;
65
+ }
66
+ type ExternalUriScheme = Extract<keyof LinkExternalUriSchemes, string>;
67
+ type UriSchemeLetter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z";
68
+ type UriSchemeStart = UriSchemeLetter | Uppercase<UriSchemeLetter>;
69
+ type UriSchemeCharacter = UriSchemeStart | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "+" | "-" | ".";
70
+ type IsUriSchemeTail<TValue extends string> = TValue extends "" ? true : TValue extends `${infer First}${infer Rest}` ? First extends UriSchemeCharacter ? IsUriSchemeTail<Rest> : false : false;
71
+ type IsUriScheme<TValue extends string> = TValue extends `${infer First}${infer Rest}` ? First extends UriSchemeStart ? IsUriSchemeTail<Rest> : false : false;
72
+ type KnownExternalHref = `//${string}` | `${ExternalUriScheme}:${string}`;
73
+ /** External URLs; these are never type-checked as routes. */
74
+ type ExternalHref<THref extends string = string> = string extends THref ? KnownExternalHref : THref extends `//${string}` ? THref : THref extends `${infer Scheme}:${string}` ? IsUriScheme<Scheme> extends true ? THref : never : never;
75
+ type StripRouteSuffix<TRoute extends string> = TRoute extends `${infer Path}?${string}` ? StripRouteSuffix<Path> : TRoute extends `${infer Path}#${string}` ? StripRouteSuffix<Path> : TRoute;
76
+ type ExtractRouteParams<TRoute extends string> = Simplify<ExtractOptionalCatchAllParams<TRoute> & ExtractCatchAllParams<TRoute> & ExtractDynamicParams<TRoute>>;
77
+ type ExtractOptionalCatchAllParams<TRoute extends string> = TRoute extends `${string}[[...${infer Param}]]${infer Rest}` ? {
78
+ [Key in Param]?: RouteOptionalParamValue;
79
+ } & ExtractOptionalCatchAllParams<Rest> : {};
80
+ type ExtractCatchAllParams<TRoute extends string> = TRoute extends `${string}[...${infer Param}]${infer Rest}` ? Param extends `[...${string}` ? ExtractCatchAllParams<Rest> : {
81
+ [Key in Param]: RouteParamValue;
82
+ } & ExtractCatchAllParams<Rest> : {};
83
+ type ExtractDynamicParams<TRoute extends string> = TRoute extends `${string}[${infer Param}]${infer Rest}` ? Param extends `...${string}` | `[...${string}` ? ExtractDynamicParams<Rest> : {
84
+ [Key in Param]: RouteParamValue;
85
+ } & ExtractDynamicParams<Rest> : {};
86
+ type Simplify<T> = {
87
+ [Key in keyof T]: T[Key];
88
+ } & {};
89
+ type HasRouteParams<TRoute extends string> = keyof RouteParams<TRoute> extends never ? false : true;
90
+ type RoutesWithRequiredParams<TRoute extends string> = TRoute extends string ? HasRouteParams<TRoute> extends true ? TRoute : never : never;
91
+ type LinkRouteParamsProps<TRoute extends string> = string extends TRoute ? {
92
+ params?: FarmRouterPathParams;
93
+ } : HasRouteParams<TRoute> extends true ? {
94
+ params: RouteParams<TRoute>;
95
+ } : {
96
+ params?: FarmRouterPathParams;
97
+ };
98
+ type LinkRouteTargetProps<TRoute extends string> = [RoutesWithRequiredParams<TRoute>] extends [
99
+ never
100
+ ] ? {
101
+ /** Internal route path with all params already resolved. */
102
+ href: RouteHref<TRoute>;
103
+ params?: FarmRouterPathParams;
104
+ } : TRoute extends string ? {
105
+ /** Internal route path or route pattern. */
106
+ href: RouteHref<TRoute>;
107
+ } & LinkRouteParamsProps<TRoute> : never;
108
+ type LinkExternalTargetProps<THref extends string = string> = {
109
+ /** External URL; these are never type-checked as app routes. */
110
+ href: ExternalHref<THref>;
111
+ params?: never;
112
+ };
113
+ type LinkTargetProps<TRoute extends string, THref extends string> = LinkExternalTargetProps<THref> | LinkRouteTargetProps<TRoute>;
114
+ /** What a `Link` takes besides its anchor attributes, in every renderer. */
115
+ type FarmLinkOptions<TRoute extends string = DefaultRouteHref, THref extends string = string> = LinkTargetProps<TRoute, THref> & {
116
+ /**
117
+ * When to prefetch. TanStack-style: "intent" (hover+touch), "viewport", "render", or "none".
118
+ * Legacy: true (intent+viewport), "hover" (intent), "viewport", false/"none".
119
+ */
120
+ prefetch?: PrefetchBehavior | PrefetchLegacy;
121
+ /** Search params appended after route params are resolved. */
122
+ query?: FarmRouterBuildOptions["query"];
123
+ /** Hash appended after route params and search params are resolved. */
124
+ hash?: string;
125
+ /** Add a trailing slash to the generated internal href. */
126
+ trailingSlash?: boolean;
127
+ /** Delay in ms before intent-based prefetch (hover/touch). Default 50. */
128
+ prefetchDelay?: number;
129
+ /** Replace current history entry instead of pushing */
130
+ replace?: boolean;
131
+ /** Scroll to top after navigation (default: true) */
132
+ scroll?: boolean;
133
+ /** Wrap this SPA navigation in a browser View Transition when supported. */
134
+ viewTransition?: FarmViewTransitionMode;
135
+ /** Preserve the active locale by default, or navigate using this locale. */
136
+ locale?: FarmI18nLocale;
137
+ };
138
+ /** The keys of {@link FarmLinkOptions}, which a `Link` keeps off its anchor. */
139
+ declare const FARM_LINK_OPTION_KEYS: readonly ["href", "params", "query", "hash", "trailingSlash", "prefetch", "prefetchDelay", "replace", "scroll", "viewTransition", "locale"];
140
+ /**
141
+ * The attributes a `Link` puts on its anchor. The app's router reads them: a click on the anchor
142
+ * navigates with `data-replace`, `data-no-scroll` and `data-view-transition`, and it prefetches
143
+ * as `data-farm-prefetch` says, so an anchor with these attributes behaves as a `Link` without
144
+ * any event handler of its own. `href` is absent for a `javascript:` URL, which never runs.
145
+ */
146
+ interface FarmLinkAttributes {
147
+ href: string | undefined;
148
+ "data-farm-link": "";
149
+ "data-farm-locale": FarmI18nLocale | undefined;
150
+ "data-farm-prefetch": string | undefined;
151
+ "data-farm-prefetch-delay": string | undefined;
152
+ "data-replace": "" | undefined;
153
+ "data-no-scroll": "" | undefined;
154
+ "data-view-transition": "auto" | "true" | undefined;
155
+ }
156
+ /**
157
+ * Resolves `Link` options into the attributes of its anchor: the href with route params, query,
158
+ * hash, locale, trailing slash and base path applied, and the data attributes the app's router
159
+ * reads to navigate and prefetch. Spread them on an `<a>` in any renderer to get a `Link`.
160
+ *
161
+ * ```ts
162
+ * resolveLinkAttributes({ href: "/products/[id]", params: { id: "42" }, prefetch: "intent" });
163
+ * // { href: "/products/42", "data-farm-link": "", "data-farm-prefetch": "intent", ... }
164
+ * ```
165
+ */
166
+ declare function resolveLinkAttributes<TRoute extends string = DefaultRouteHref, THref extends string = string>(options: FarmLinkOptions<TRoute, THref>): FarmLinkAttributes;
167
+
168
+ /**
169
+ * The state contract every renderer binding reads: a snapshot, and a way to hear that it changed.
170
+ * Farm's router, action, query, theme, and i18n stores implement it, and so does `createStore`.
171
+ */
172
+ interface FarmClientStore<TSnapshot> {
173
+ /** Returns the current snapshot. It must return the same value until the state changes. */
174
+ getSnapshot(): TSnapshot;
175
+ /** Calls `listener` after the snapshot changes. Returns a function that unsubscribes. */
176
+ subscribe(listener: () => void): () => void;
177
+ }
178
+
179
+ interface FarmRendererRouterOptions {
180
+ basePath?: string;
181
+ routes?: readonly FarmRouterRouteInput[];
182
+ }
183
+ interface FarmRendererRouterSnapshot {
184
+ pathname: string;
185
+ searchParams: URLSearchParams;
186
+ params: Record<string, string>;
187
+ pageState: unknown;
188
+ navigation: FarmNavigationState;
189
+ }
190
+ interface FarmRendererRouter extends FarmClientStore<FarmRendererRouterSnapshot> {
191
+ push(href: string, options?: Omit<FarmNavigateOptions, "replace">): Promise<void>;
192
+ replace(href: string, options?: Omit<FarmNavigateOptions, "replace">): Promise<void>;
193
+ refresh(options?: Omit<FarmNavigateOptions, "replace" | "refresh">): Promise<void>;
194
+ prefetch(href: string): Promise<void>;
195
+ back(): void;
196
+ forward(): void;
197
+ pushState<TState>(state: TState, href?: string): void;
198
+ replaceState<TState>(state: TState, href?: string): void;
199
+ }
200
+ declare function createRendererRouter(options?: FarmRendererRouterOptions): FarmRendererRouter;
201
+ type FarmActionStatus = "idle" | "pending" | "success" | "error";
202
+ interface FarmActionSnapshot<TResult, TError extends Error = Error> {
203
+ pending: boolean;
204
+ status: FarmActionStatus;
205
+ data: TResult | null;
206
+ error: TError | null;
207
+ }
208
+ interface FarmActionOptions<TInput, TResult, TError extends Error = Error> {
209
+ initialResult?: TResult | null;
210
+ resetOnSubmit?: boolean;
211
+ optimistic?: (context: {
212
+ input: TInput | FormData | undefined;
213
+ formData?: FormData;
214
+ current: TResult | null;
215
+ }) => TResult | null | undefined;
216
+ rollbackOnError?: boolean;
217
+ onSuccess?: (result: TResult) => void;
218
+ onError?: (error: TError) => void;
219
+ onSettled?: (result: TResult | null, error: TError | null) => void;
220
+ }
221
+ type FarmActionSubmit<TInput, TResult> = [unknown] extends [TInput] ? (input?: TInput | FormData) => Promise<TResult> : (input: TInput | FormData) => Promise<TResult>;
222
+ type FarmAction<TInput, TResult, TError extends Error = Error> = FarmClientStore<FarmActionSnapshot<TResult, TError>> & {
223
+ submit: FarmActionSubmit<TInput, TResult>;
224
+ reset(): void;
225
+ };
226
+ type FarmRouteActionTarget<TServerFn extends ServerFn<any, any, any>> = {
227
+ readonly action: TServerFn;
228
+ };
229
+ declare function createRendererAction<TInput, TResult, TError extends Error = Error>(target: ServerFn<TInput, TResult, TError> | FarmRouteActionTarget<ServerFn<TInput, TResult, TError>>, options?: FarmActionOptions<TInput, TResult, TError>): FarmAction<TInput, TResult, TError>;
230
+ interface FarmRendererQueryOptions extends ServerQueryFetchOptions {
231
+ enabled?: boolean;
232
+ refetchOnWindowFocus?: boolean;
233
+ refetchOnReconnect?: boolean;
234
+ }
235
+ interface FarmRendererQuerySnapshot<TData> {
236
+ data: TData | undefined;
237
+ error: Error | null;
238
+ status: FarmClientCacheStatus;
239
+ pending: boolean;
240
+ fetching: boolean;
241
+ stale: boolean;
242
+ }
243
+ interface FarmRendererQuery<TData> extends FarmClientStore<FarmRendererQuerySnapshot<TData>> {
244
+ refetch(): Promise<TData>;
245
+ dispose(): void;
246
+ }
247
+ declare function createRendererQuery<TInput, TData>(query: ServerQuery<TInput, TData>, input: TInput, options?: FarmRendererQueryOptions): FarmRendererQuery<TData>;
248
+ interface FarmRendererTheme extends FarmClientStore<FarmThemeSnapshot> {
249
+ setTheme(theme: FarmThemePreference): void;
250
+ toggleTheme(): FarmThemeSnapshot["resolvedTheme"];
251
+ }
252
+ declare function createRendererTheme(): FarmRendererTheme;
253
+ interface FarmRendererI18n extends FarmClientStore<FarmI18nClientSnapshot | undefined> {
254
+ readonly t: FarmTranslator;
255
+ setLocale(locale: FarmI18nLocale): void;
256
+ }
257
+ declare function createRendererI18n(): FarmRendererI18n;
258
+
259
+ type StoreState = Record<string, any>;
260
+ type StoreValueUpdater<T> = T | ((previous: T) => T);
261
+ type StorePatch<T extends StoreState> = Partial<T> | ((state: T) => Partial<T>);
262
+ type StoreListener<T extends StoreState> = (state: T, previousState: T) => void;
263
+ type StoreKeyListener<T extends StoreState, K extends keyof T> = (value: T[K], previousValue: T[K]) => void;
264
+ type StoreKeysListener<T extends StoreState, K extends keyof T> = (value: Pick<T, K>, previousValue: Pick<T, K>) => void;
265
+ type FieldAccessor<T extends StoreState, K extends keyof T> = {
266
+ /** Reads the field's current value. */
267
+ (): T[K];
268
+ get(): T[K];
269
+ set(value: StoreValueUpdater<T[K]>): T[K];
270
+ subscribe(listener: StoreKeyListener<T, K>): () => void;
271
+ };
272
+ type StoreFields<T extends StoreState> = {
273
+ [K in keyof T]: FieldAccessor<T, K>;
274
+ };
275
+ /**
276
+ * A store's methods without a renderer. It is a `FarmClientStore`, so any renderer binds it the
277
+ * way it binds Farm's router or query stores.
278
+ */
279
+ interface StoreApi<T extends StoreState> extends FarmClientStore<T> {
280
+ get(): T;
281
+ get<K extends keyof T>(key: K): T[K];
282
+ /** The whole state. Its identity changes only when a value changes. */
283
+ getSnapshot(): T;
284
+ set<K extends keyof T>(key: K, value: StoreValueUpdater<T[K]>): T[K];
285
+ set(patch: StorePatch<T>): T;
286
+ replace(nextState: T | ((state: T) => T)): T;
287
+ reset(): T;
288
+ subscribe(listener: StoreListener<T>): () => void;
289
+ subscribe<K extends keyof T>(key: K, listener: StoreKeyListener<T, K>): () => void;
290
+ subscribe<K extends keyof T>(keys: readonly K[], listener: StoreKeysListener<T, K>): () => void;
291
+ }
292
+ type Store<T extends StoreState, TMethods extends Record<string, any> = {}> = StoreApi<T> & StoreFields<T> & TMethods;
293
+ /**
294
+ * Creates an in-memory store that works with every renderer. Read it with `get()` or a field
295
+ * accessor, and bind it with your renderer's binding (`useStore` in Solid and Vue,
296
+ * `createReadable` in Svelte) or with any code that reads a `FarmClientStore`. React apps can
297
+ * import `createStore` from `@farm.js/core/client` instead, which adds the `use()` hook.
298
+ */
299
+ declare function createStore<T extends StoreState, TMethods extends Record<string, any> = {}>(initialState: T, extend?: (store: Store<T>) => TMethods): Store<T, TMethods>;
300
+
301
+ export { type FarmRendererRouterSnapshot as A, type FarmRendererTheme as B, type FarmRouteActionTarget as C, type DefaultRouteHref as D, type ExternalHref as E, type FarmLinkOptions as F, type Store as G, type StoreFields as H, createRendererAction as I, createRendererI18n as J, createRendererQuery as K, type LinkDefaultRoute as L, createRendererRouter as M, createRendererTheme as N, createStore as O, type PrefetchBehavior as P, resolveLinkAttributes as Q, type RouteHref as R, type StoreKeyListener as S, type DefaultRoutePath as a, type DefaultRoutePattern as b, type LinkExternalUriSchemes as c, type RouteOptionalParamValue as d, type RouteParamValue as e, type RouteParams as f, type StoreKeysListener as g, type StoreListener as h, type StorePatch as i, type StoreState as j, type StoreValueUpdater as k, type StoreApi as l, FARM_LINK_OPTION_KEYS as m, type FarmAction as n, type FarmActionOptions as o, type FarmActionSnapshot as p, type FarmActionStatus as q, type FarmActionSubmit as r, type FarmClientStore as s, type FarmLinkAttributes as t, type FarmRendererI18n as u, type FarmRendererQuery as v, type FarmRendererQueryOptions as w, type FarmRendererQuerySnapshot as x, type FarmRendererRouter as y, type FarmRendererRouterOptions as z };