@farm.js/core 0.1.0-beta.21 → 0.1.0-beta.23

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 (266) hide show
  1. package/dist/after.d.mts +25 -0
  2. package/dist/after.d.ts +25 -0
  3. package/dist/agent-runtime.d.mts +97 -0
  4. package/dist/agent-runtime.d.ts +97 -0
  5. package/dist/api/route-manager.d.mts +68 -0
  6. package/dist/api/route-manager.d.ts +68 -0
  7. package/dist/api/runtime.d.mts +3 -0
  8. package/dist/api/runtime.d.ts +3 -0
  9. package/dist/api.cjs +22 -19
  10. package/dist/api.cjs.map +1 -1
  11. package/dist/api.d.mts +50 -0
  12. package/dist/api.d.ts +50 -0
  13. package/dist/api.mjs +2 -1
  14. package/dist/app-CTFnOJaI.d.ts +308 -0
  15. package/dist/app-DA6ospIq.d.mts +308 -0
  16. package/dist/app-markdown.d.mts +25 -0
  17. package/dist/app-markdown.d.ts +25 -0
  18. package/dist/cache.d.mts +192 -0
  19. package/dist/cache.d.ts +192 -0
  20. package/dist/{chunk-MIUW47JX.mjs → chunk-2PEJGY5V.mjs} +15 -20
  21. package/dist/chunk-2PEJGY5V.mjs.map +1 -0
  22. package/dist/{chunk-RIXKJPGI.mjs → chunk-42325TLU.mjs} +2 -2
  23. package/dist/chunk-4IVNW5QD.mjs +82 -0
  24. package/dist/chunk-4IVNW5QD.mjs.map +1 -0
  25. package/dist/{chunk-I3UWA2P2.mjs → chunk-5NOVWCFL.mjs} +2 -2
  26. package/dist/chunk-5NOVWCFL.mjs.map +1 -0
  27. package/dist/chunk-D42BNPZH.mjs +79 -0
  28. package/dist/chunk-D42BNPZH.mjs.map +1 -0
  29. package/dist/{chunk-LLPN5SEZ.mjs → chunk-DVPRBMU2.mjs} +2 -2
  30. package/dist/{chunk-VIC7NJ77.mjs → chunk-FJGTYLCO.mjs} +67 -20
  31. package/dist/chunk-FJGTYLCO.mjs.map +1 -0
  32. package/dist/chunk-GIELMNBG.mjs +15 -0
  33. package/dist/chunk-GIELMNBG.mjs.map +1 -0
  34. package/dist/chunk-GQVQESLY.mjs +25 -0
  35. package/dist/chunk-GQVQESLY.mjs.map +1 -0
  36. package/dist/chunk-H53KVQUU.mjs +48 -0
  37. package/dist/chunk-H53KVQUU.mjs.map +1 -0
  38. package/dist/chunk-HCGQYYHI.mjs +1 -0
  39. package/dist/chunk-HCGQYYHI.mjs.map +1 -0
  40. package/dist/{chunk-4EATUJFO.mjs → chunk-ICTGDDV4.mjs} +20 -22
  41. package/dist/chunk-ICTGDDV4.mjs.map +1 -0
  42. package/dist/{chunk-UCYWGN2P.mjs → chunk-OHNSROHS.mjs} +1 -1
  43. package/dist/{chunk-FRPWCMMG.mjs → chunk-SBWOTAX4.mjs} +63 -2
  44. package/dist/chunk-SBWOTAX4.mjs.map +1 -0
  45. package/dist/{chunk-FKKM7HVF.mjs → chunk-TX54PXAJ.mjs} +109 -58
  46. package/dist/chunk-TX54PXAJ.mjs.map +1 -0
  47. package/dist/{chunk-CEVMYGDL.mjs → chunk-YD5IRKVS.mjs} +13 -9
  48. package/dist/chunk-YD5IRKVS.mjs.map +1 -0
  49. package/dist/chunk-recovery-lnQFzcQP.d.mts +26 -0
  50. package/dist/chunk-recovery-lnQFzcQP.d.ts +26 -0
  51. package/dist/client-BT1mFQas.d.mts +447 -0
  52. package/dist/client-Nn0q4eO4.d.ts +447 -0
  53. package/dist/client-cache-CIlyBlmx.d.ts +6 -0
  54. package/dist/client-cache-D-EZ7XVW.d.mts +6 -0
  55. package/dist/client-plugins-CCilIb_G.d.mts +2092 -0
  56. package/dist/client-plugins-DuuleQKk.d.ts +2092 -0
  57. package/dist/client-plugins.d.mts +25 -0
  58. package/dist/client-plugins.d.ts +25 -0
  59. package/dist/client.cjs +122 -35
  60. package/dist/client.cjs.map +1 -1
  61. package/dist/client.d.mts +454 -0
  62. package/dist/client.d.ts +454 -0
  63. package/dist/client.mjs +13 -2
  64. package/dist/config.d.mts +32 -0
  65. package/dist/config.d.ts +32 -0
  66. package/dist/cron.d.mts +78 -0
  67. package/dist/cron.d.ts +78 -0
  68. package/dist/deferred.d.mts +42 -0
  69. package/dist/deferred.d.ts +42 -0
  70. package/dist/deployment.d.mts +36 -0
  71. package/dist/deployment.d.ts +36 -0
  72. package/dist/{devtools-52FYXIEK.mjs → devtools-326RBQCN.mjs} +7 -6
  73. package/dist/{devtools-52FYXIEK.mjs.map → devtools-326RBQCN.mjs.map} +1 -1
  74. package/dist/docs.cjs.map +1 -1
  75. package/dist/docs.d.mts +80 -0
  76. package/dist/docs.d.ts +80 -0
  77. package/dist/docs.mjs +6 -5
  78. package/dist/env-types.d.mts +12 -0
  79. package/dist/env-types.d.ts +12 -0
  80. package/dist/env.d.mts +45 -0
  81. package/dist/env.d.ts +45 -0
  82. package/dist/environment/vite.d.mts +22 -0
  83. package/dist/environment/vite.d.ts +22 -0
  84. package/dist/environment.d.mts +18 -0
  85. package/dist/environment.d.ts +18 -0
  86. package/dist/font.d.mts +95 -0
  87. package/dist/font.d.ts +95 -0
  88. package/dist/headers.d.mts +22 -0
  89. package/dist/headers.d.ts +22 -0
  90. package/dist/i18n/client.d.mts +32 -0
  91. package/dist/i18n/client.d.ts +32 -0
  92. package/dist/i18n/index.d.mts +20 -0
  93. package/dist/i18n/index.d.ts +20 -0
  94. package/dist/i18n/server.d.mts +30 -0
  95. package/dist/i18n/server.d.ts +30 -0
  96. package/dist/image/server.d.mts +37 -0
  97. package/dist/image/server.d.ts +37 -0
  98. package/dist/image/sharp.d.mts +7 -0
  99. package/dist/image/sharp.d.ts +7 -0
  100. package/dist/image-config-Duob7wER.d.mts +50 -0
  101. package/dist/image-config-Duob7wER.d.ts +50 -0
  102. package/dist/image.d.mts +39 -0
  103. package/dist/image.d.ts +39 -0
  104. package/dist/index.cjs +496 -123
  105. package/dist/index.cjs.map +1 -1
  106. package/dist/index.d.mts +480 -0
  107. package/dist/index.d.ts +480 -0
  108. package/dist/index.mjs +70 -52
  109. package/dist/index.mjs.map +1 -1
  110. package/dist/integration-api-CHT2OKAf.d.mts +93 -0
  111. package/dist/integration-api-CHT2OKAf.d.ts +93 -0
  112. package/dist/integrations.d.mts +25 -0
  113. package/dist/integrations.d.ts +25 -0
  114. package/dist/internal/build-runtime.cjs +386 -83
  115. package/dist/internal/build-runtime.cjs.map +1 -1
  116. package/dist/internal/build-runtime.d.mts +42 -0
  117. package/dist/internal/build-runtime.d.ts +42 -0
  118. package/dist/internal/build-runtime.mjs +17 -13
  119. package/dist/internal/client-runtime.d.mts +17 -0
  120. package/dist/internal/client-runtime.d.ts +17 -0
  121. package/dist/internal/config-runtime.cjs +41 -0
  122. package/dist/internal/config-runtime.cjs.map +1 -1
  123. package/dist/internal/config-runtime.d.mts +42 -0
  124. package/dist/internal/config-runtime.d.ts +42 -0
  125. package/dist/internal/config-runtime.mjs +5 -4
  126. package/dist/internal/metadata-image-runtime.d.mts +25 -0
  127. package/dist/internal/metadata-image-runtime.d.ts +25 -0
  128. package/dist/internal/production-node-env.d.mts +12 -0
  129. package/dist/internal/production-node-env.d.ts +12 -0
  130. package/dist/internal/production-runtime.cjs +178 -0
  131. package/dist/internal/production-runtime.cjs.map +1 -1
  132. package/dist/internal/production-runtime.d.mts +80 -0
  133. package/dist/internal/production-runtime.d.ts +80 -0
  134. package/dist/internal/production-runtime.mjs +13 -1
  135. package/dist/internal/production-runtime.mjs.map +1 -1
  136. package/dist/island-CfGru1MO.d.mts +9 -0
  137. package/dist/island-CfGru1MO.d.ts +9 -0
  138. package/dist/markdown.d.mts +60 -0
  139. package/dist/markdown.d.ts +60 -0
  140. package/dist/metadata-DyPRG0wX.d.ts +22 -0
  141. package/dist/metadata-_GHcAySx.d.mts +22 -0
  142. package/dist/middleware.cjs +17 -17
  143. package/dist/middleware.cjs.map +1 -1
  144. package/dist/middleware.d.mts +172 -0
  145. package/dist/middleware.d.ts +172 -0
  146. package/dist/middleware.mjs +3 -2
  147. package/dist/navigation-errors-Dvwpzaer.d.mts +13 -0
  148. package/dist/navigation-errors-Dvwpzaer.d.ts +13 -0
  149. package/dist/navigation.d.mts +14 -0
  150. package/dist/navigation.d.ts +14 -0
  151. package/dist/observability.d.mts +335 -0
  152. package/dist/observability.d.ts +335 -0
  153. package/dist/params-BALtrRim.d.ts +15 -0
  154. package/dist/params-ry-lxqmy.d.mts +15 -0
  155. package/dist/plugin-BJDf43dc.d.mts +165 -0
  156. package/dist/plugin-BJDf43dc.d.ts +165 -0
  157. package/dist/plugin.cjs +261 -62
  158. package/dist/plugin.cjs.map +1 -1
  159. package/dist/plugin.d.mts +25 -0
  160. package/dist/plugin.d.ts +25 -0
  161. package/dist/plugin.mjs +13 -9
  162. package/dist/production-runtime-C4cO3esK.d.mts +81 -0
  163. package/dist/production-runtime-DrEy8kBO.d.ts +81 -0
  164. package/dist/query/client.d.mts +61 -0
  165. package/dist/query/client.d.ts +61 -0
  166. package/dist/query/index.d.mts +90 -0
  167. package/dist/query/index.d.ts +90 -0
  168. package/dist/query/parsers.d.mts +25 -0
  169. package/dist/query/parsers.d.ts +25 -0
  170. package/dist/query/server.d.mts +55 -0
  171. package/dist/query/server.d.ts +55 -0
  172. package/dist/request-B2PpOxYK.d.mts +6 -0
  173. package/dist/request-D40lt6aN.d.ts +6 -0
  174. package/dist/request.d.mts +26 -0
  175. package/dist/request.d.ts +26 -0
  176. package/dist/resolver-DJqjLMg_.d.mts +14 -0
  177. package/dist/resolver-IH4RmPEl.d.ts +14 -0
  178. package/dist/route-runtime-DoOHzCAD.d.mts +38 -0
  179. package/dist/route-runtime-DoOHzCAD.d.ts +38 -0
  180. package/dist/router.d.mts +36 -0
  181. package/dist/router.d.ts +36 -0
  182. package/dist/routes.d.mts +227 -0
  183. package/dist/routes.d.ts +227 -0
  184. package/dist/runtime-Bpp-c28k.d.ts +231 -0
  185. package/dist/runtime-Cxpq6xZN.d.mts +27 -0
  186. package/dist/runtime-Q3u74Nbq.d.mts +231 -0
  187. package/dist/runtime-bv63eUiO.d.ts +27 -0
  188. package/dist/server-action-security.d.mts +45 -0
  189. package/dist/server-action-security.d.ts +45 -0
  190. package/dist/server-fn-client.d.mts +33 -0
  191. package/dist/server-fn-client.d.ts +33 -0
  192. package/dist/server-fn-error-DDh14a0V.d.mts +26 -0
  193. package/dist/server-fn-error-DDh14a0V.d.ts +26 -0
  194. package/dist/server-fn.d.mts +121 -0
  195. package/dist/server-fn.d.ts +121 -0
  196. package/dist/server-plugins.d.mts +58 -0
  197. package/dist/server-plugins.d.ts +58 -0
  198. package/dist/server-query-client.d.mts +51 -0
  199. package/dist/server-query-client.d.ts +51 -0
  200. package/dist/server-query.d.mts +37 -0
  201. package/dist/server-query.d.ts +37 -0
  202. package/dist/server.cjs +285 -85
  203. package/dist/server.cjs.map +1 -1
  204. package/dist/server.d.mts +53 -0
  205. package/dist/server.d.ts +53 -0
  206. package/dist/server.mjs +26 -31
  207. package/dist/server.mjs.map +1 -1
  208. package/dist/storage.d.mts +52 -0
  209. package/dist/storage.d.ts +52 -0
  210. package/dist/testing.d.mts +104 -0
  211. package/dist/testing.d.ts +104 -0
  212. package/dist/theme/client.cjs +115 -0
  213. package/dist/theme/client.cjs.map +1 -0
  214. package/dist/theme/client.d.mts +17 -0
  215. package/dist/theme/client.d.ts +17 -0
  216. package/dist/theme/client.mjs +16 -0
  217. package/dist/theme/client.mjs.map +1 -0
  218. package/dist/theme/index.cjs +71 -0
  219. package/dist/theme/index.cjs.map +1 -0
  220. package/dist/theme/index.d.mts +6 -0
  221. package/dist/theme/index.d.ts +6 -0
  222. package/dist/theme/index.mjs +9 -0
  223. package/dist/theme/index.mjs.map +1 -0
  224. package/dist/theme/server.cjs +191 -0
  225. package/dist/theme/server.cjs.map +1 -0
  226. package/dist/theme/server.d.mts +8 -0
  227. package/dist/theme/server.d.ts +8 -0
  228. package/dist/theme/server.mjs +18 -0
  229. package/dist/theme/server.mjs.map +1 -0
  230. package/dist/transport-BmbGTXA5.d.mts +49 -0
  231. package/dist/transport-BmbGTXA5.d.ts +49 -0
  232. package/dist/types-BMxWr97v.d.mts +81 -0
  233. package/dist/types-BMxWr97v.d.ts +81 -0
  234. package/dist/types-CsR8fpgF.d.mts +30 -0
  235. package/dist/types-CsR8fpgF.d.ts +30 -0
  236. package/dist/types-D1A6-XvH.d.mts +73 -0
  237. package/dist/types-D1A6-XvH.d.ts +73 -0
  238. package/dist/types-DTzm4TCl.d.mts +78 -0
  239. package/dist/types-DTzm4TCl.d.ts +78 -0
  240. package/dist/utils-3sQgfkya.d.ts +23 -0
  241. package/dist/utils-Bop7bly-.d.mts +23 -0
  242. package/dist/version.cjs +1 -1
  243. package/dist/version.cjs.map +1 -1
  244. package/dist/version.d.mts +3 -0
  245. package/dist/version.d.ts +3 -0
  246. package/dist/version.mjs +1 -1
  247. package/dist/vite.cjs +285 -64
  248. package/dist/vite.cjs.map +1 -1
  249. package/dist/vite.d.mts +25 -0
  250. package/dist/vite.d.ts +25 -0
  251. package/dist/vite.mjs +13 -9
  252. package/dist/workflows-CusFV6mn.d.mts +153 -0
  253. package/dist/workflows-CusFV6mn.d.ts +153 -0
  254. package/dist/workflows.d.mts +1 -0
  255. package/dist/workflows.d.ts +1 -0
  256. package/package.json +25 -1
  257. package/dist/chunk-4EATUJFO.mjs.map +0 -1
  258. package/dist/chunk-CEVMYGDL.mjs.map +0 -1
  259. package/dist/chunk-FKKM7HVF.mjs.map +0 -1
  260. package/dist/chunk-FRPWCMMG.mjs.map +0 -1
  261. package/dist/chunk-I3UWA2P2.mjs.map +0 -1
  262. package/dist/chunk-MIUW47JX.mjs.map +0 -1
  263. package/dist/chunk-VIC7NJ77.mjs.map +0 -1
  264. /package/dist/{chunk-RIXKJPGI.mjs.map → chunk-42325TLU.mjs.map} +0 -0
  265. /package/dist/{chunk-LLPN5SEZ.mjs.map → chunk-DVPRBMU2.mjs.map} +0 -0
  266. /package/dist/{chunk-UCYWGN2P.mjs.map → chunk-OHNSROHS.mjs.map} +0 -0
@@ -0,0 +1,80 @@
1
+ import { FarmLayoutFonts } from './font.mjs';
2
+ import { F as FarmDocsResolvedConfig, a as FarmDocsUserConfig } from './types-DTzm4TCl.mjs';
3
+ export { b as FarmDocsConfigInput, c as FarmDocsNavigationConfig, f as FarmDocsSidebarItem, d as FarmDocsSocialImageConfig, e as FarmDocsSocialImageFonts } from './types-DTzm4TCl.mjs';
4
+ import { DocsConfig } from '@farming-labs/docs';
5
+
6
+ interface FarmDocsPublicFontAsset {
7
+ family: "Geist Sans" | "Geist Mono";
8
+ url: string;
9
+ }
10
+
11
+ interface FarmDocsHandlerOptions {
12
+ root: string;
13
+ srcDir?: string;
14
+ clientEntry?: string;
15
+ fontAssets?: readonly FarmDocsPublicFontAsset[];
16
+ /** Resolve semantic fonts from the layouts that apply to the requested docs route. */
17
+ resolveLayoutFonts?: (pathname: string) => FarmLayoutFonts | undefined | Promise<FarmLayoutFonts | undefined>;
18
+ /** Stylesheet containing the `@font-face` rules generated by Farm's font compiler. */
19
+ fontStylesheetHref?: string;
20
+ }
21
+ interface FarmDocsPage {
22
+ slug: string;
23
+ title: string;
24
+ description?: string;
25
+ section?: string;
26
+ href: string;
27
+ sourcePath: string;
28
+ lastModified?: string;
29
+ }
30
+ interface LoadedFarmDocsPage extends FarmDocsPage {
31
+ body: string;
32
+ frontmatter: Record<string, string>;
33
+ }
34
+ declare function isFarmDocsRequest(docs: FarmDocsResolvedConfig | undefined, request: Request): boolean;
35
+ declare function resolveFarmDocsContentDir(docs: FarmDocsResolvedConfig, options: FarmDocsHandlerOptions): string;
36
+ declare function getFarmDocsRouteTypeEntries(docs: FarmDocsResolvedConfig | undefined): string[];
37
+ declare function getFarmDocsDocumentNavigationMatchers(docs: FarmDocsResolvedConfig | undefined): string[];
38
+ declare function loadFarmDocsPage(contentDir: string, docs: FarmDocsResolvedConfig, slug: string): LoadedFarmDocsPage | null;
39
+ declare function discoverFarmDocsPages(contentDir: string, docs: FarmDocsResolvedConfig): FarmDocsPage[];
40
+ declare function createFarmDocsHandler(docs: FarmDocsResolvedConfig | undefined, options: FarmDocsHandlerOptions): (request: Request) => Promise<Response | null>;
41
+
42
+ interface FarmDocsAPIOptions {
43
+ rootDir?: string;
44
+ root?: string;
45
+ srcDir?: string;
46
+ docs?: FarmDocsUserConfig | FarmDocsResolvedConfig;
47
+ config?: Partial<DocsConfig>;
48
+ configPath?: string;
49
+ entry?: string;
50
+ docsPath?: string;
51
+ contentDir?: string;
52
+ }
53
+ interface FarmDocsCloudRouteOptions {
54
+ locale?: string;
55
+ publicBaseUrl?: string;
56
+ }
57
+ interface FarmDocsCloudServer {
58
+ handleRequest(request: Request, options?: FarmDocsCloudRouteOptions): Promise<Response>;
59
+ }
60
+ type FarmDocsCloudIntegration = FarmDocsCloudServer | (FarmDocsCloudRouteOptions & {
61
+ docsCloud?: FarmDocsCloudServer;
62
+ });
63
+ interface FarmDocsAPIRouteHandlers {
64
+ GET(request: Request): Promise<Response>;
65
+ POST(request: Request): Promise<Response>;
66
+ }
67
+ type FarmDocsAPIHandler = (request: Request) => Promise<Response | null>;
68
+ type FarmDocsRuntimeConfig = {
69
+ root?: string;
70
+ srcDir?: string;
71
+ docs?: FarmDocsResolvedConfig;
72
+ };
73
+ declare global {
74
+ var __FARM_DOCS_RUNTIME_CONFIG__: FarmDocsRuntimeConfig | undefined;
75
+ }
76
+ declare function isFarmDocsAPIRequest(requestOrPathname: Request | string): boolean;
77
+ declare function createDocsAPI(options?: FarmDocsAPIOptions, cloudIntegration?: FarmDocsCloudIntegration): FarmDocsAPIRouteHandlers;
78
+ declare function createFarmDocsAPIHandler(options?: FarmDocsAPIOptions, cloudIntegration?: FarmDocsCloudIntegration): FarmDocsAPIHandler;
79
+
80
+ export { type FarmDocsAPIHandler, type FarmDocsAPIOptions, type FarmDocsAPIRouteHandlers, type FarmDocsCloudIntegration, type FarmDocsCloudRouteOptions, type FarmDocsCloudServer, type FarmDocsHandlerOptions, type FarmDocsPage, FarmDocsResolvedConfig, FarmDocsUserConfig, type LoadedFarmDocsPage, createDocsAPI, createFarmDocsAPIHandler, createFarmDocsHandler, discoverFarmDocsPages, getFarmDocsDocumentNavigationMatchers, getFarmDocsRouteTypeEntries, isFarmDocsAPIRequest, isFarmDocsRequest, loadFarmDocsPage, resolveFarmDocsContentDir };
package/dist/docs.d.ts ADDED
@@ -0,0 +1,80 @@
1
+ import { FarmLayoutFonts } from './font.js';
2
+ import { F as FarmDocsResolvedConfig, a as FarmDocsUserConfig } from './types-DTzm4TCl.js';
3
+ export { b as FarmDocsConfigInput, c as FarmDocsNavigationConfig, f as FarmDocsSidebarItem, d as FarmDocsSocialImageConfig, e as FarmDocsSocialImageFonts } from './types-DTzm4TCl.js';
4
+ import { DocsConfig } from '@farming-labs/docs';
5
+
6
+ interface FarmDocsPublicFontAsset {
7
+ family: "Geist Sans" | "Geist Mono";
8
+ url: string;
9
+ }
10
+
11
+ interface FarmDocsHandlerOptions {
12
+ root: string;
13
+ srcDir?: string;
14
+ clientEntry?: string;
15
+ fontAssets?: readonly FarmDocsPublicFontAsset[];
16
+ /** Resolve semantic fonts from the layouts that apply to the requested docs route. */
17
+ resolveLayoutFonts?: (pathname: string) => FarmLayoutFonts | undefined | Promise<FarmLayoutFonts | undefined>;
18
+ /** Stylesheet containing the `@font-face` rules generated by Farm's font compiler. */
19
+ fontStylesheetHref?: string;
20
+ }
21
+ interface FarmDocsPage {
22
+ slug: string;
23
+ title: string;
24
+ description?: string;
25
+ section?: string;
26
+ href: string;
27
+ sourcePath: string;
28
+ lastModified?: string;
29
+ }
30
+ interface LoadedFarmDocsPage extends FarmDocsPage {
31
+ body: string;
32
+ frontmatter: Record<string, string>;
33
+ }
34
+ declare function isFarmDocsRequest(docs: FarmDocsResolvedConfig | undefined, request: Request): boolean;
35
+ declare function resolveFarmDocsContentDir(docs: FarmDocsResolvedConfig, options: FarmDocsHandlerOptions): string;
36
+ declare function getFarmDocsRouteTypeEntries(docs: FarmDocsResolvedConfig | undefined): string[];
37
+ declare function getFarmDocsDocumentNavigationMatchers(docs: FarmDocsResolvedConfig | undefined): string[];
38
+ declare function loadFarmDocsPage(contentDir: string, docs: FarmDocsResolvedConfig, slug: string): LoadedFarmDocsPage | null;
39
+ declare function discoverFarmDocsPages(contentDir: string, docs: FarmDocsResolvedConfig): FarmDocsPage[];
40
+ declare function createFarmDocsHandler(docs: FarmDocsResolvedConfig | undefined, options: FarmDocsHandlerOptions): (request: Request) => Promise<Response | null>;
41
+
42
+ interface FarmDocsAPIOptions {
43
+ rootDir?: string;
44
+ root?: string;
45
+ srcDir?: string;
46
+ docs?: FarmDocsUserConfig | FarmDocsResolvedConfig;
47
+ config?: Partial<DocsConfig>;
48
+ configPath?: string;
49
+ entry?: string;
50
+ docsPath?: string;
51
+ contentDir?: string;
52
+ }
53
+ interface FarmDocsCloudRouteOptions {
54
+ locale?: string;
55
+ publicBaseUrl?: string;
56
+ }
57
+ interface FarmDocsCloudServer {
58
+ handleRequest(request: Request, options?: FarmDocsCloudRouteOptions): Promise<Response>;
59
+ }
60
+ type FarmDocsCloudIntegration = FarmDocsCloudServer | (FarmDocsCloudRouteOptions & {
61
+ docsCloud?: FarmDocsCloudServer;
62
+ });
63
+ interface FarmDocsAPIRouteHandlers {
64
+ GET(request: Request): Promise<Response>;
65
+ POST(request: Request): Promise<Response>;
66
+ }
67
+ type FarmDocsAPIHandler = (request: Request) => Promise<Response | null>;
68
+ type FarmDocsRuntimeConfig = {
69
+ root?: string;
70
+ srcDir?: string;
71
+ docs?: FarmDocsResolvedConfig;
72
+ };
73
+ declare global {
74
+ var __FARM_DOCS_RUNTIME_CONFIG__: FarmDocsRuntimeConfig | undefined;
75
+ }
76
+ declare function isFarmDocsAPIRequest(requestOrPathname: Request | string): boolean;
77
+ declare function createDocsAPI(options?: FarmDocsAPIOptions, cloudIntegration?: FarmDocsCloudIntegration): FarmDocsAPIRouteHandlers;
78
+ declare function createFarmDocsAPIHandler(options?: FarmDocsAPIOptions, cloudIntegration?: FarmDocsCloudIntegration): FarmDocsAPIHandler;
79
+
80
+ export { type FarmDocsAPIHandler, type FarmDocsAPIOptions, type FarmDocsAPIRouteHandlers, type FarmDocsCloudIntegration, type FarmDocsCloudRouteOptions, type FarmDocsCloudServer, type FarmDocsHandlerOptions, type FarmDocsPage, FarmDocsResolvedConfig, FarmDocsUserConfig, type LoadedFarmDocsPage, createDocsAPI, createFarmDocsAPIHandler, createFarmDocsHandler, discoverFarmDocsPages, getFarmDocsDocumentNavigationMatchers, getFarmDocsRouteTypeEntries, isFarmDocsAPIRequest, isFarmDocsRequest, loadFarmDocsPage, resolveFarmDocsContentDir };
package/dist/docs.mjs CHANGED
@@ -9,9 +9,9 @@ import {
9
9
  isFarmDocsRequest,
10
10
  loadFarmDocsPage,
11
11
  resolveFarmDocsContentDir
12
- } from "./chunk-LLPN5SEZ.mjs";
12
+ } from "./chunk-DVPRBMU2.mjs";
13
13
  import "./chunk-V7RBCSDJ.mjs";
14
- import "./chunk-CEVMYGDL.mjs";
14
+ import "./chunk-YD5IRKVS.mjs";
15
15
  import "./chunk-UVCIEUJC.mjs";
16
16
  import "./chunk-RQ633A5I.mjs";
17
17
  import "./chunk-USLFXFFH.mjs";
@@ -19,13 +19,14 @@ import "./chunk-E257KFBU.mjs";
19
19
  import "./chunk-7MABZJIM.mjs";
20
20
  import "./chunk-YW7OBE6Q.mjs";
21
21
  import "./chunk-74YTBPTY.mjs";
22
- import "./chunk-7ZVN3YZI.mjs";
23
22
  import "./chunk-GY2STC2S.mjs";
23
+ import "./chunk-7ZVN3YZI.mjs";
24
+ import "./chunk-4E6VRJ6P.mjs";
25
+ import "./chunk-GXASWWJU.mjs";
24
26
  import "./chunk-WORFTBLU.mjs";
27
+ import "./chunk-H53KVQUU.mjs";
25
28
  import "./chunk-ZVWA4ZQ3.mjs";
26
29
  import "./chunk-7FBJLMQH.mjs";
27
- import "./chunk-4E6VRJ6P.mjs";
28
- import "./chunk-GXASWWJU.mjs";
29
30
  import "./chunk-CRN3AH35.mjs";
30
31
  import "./chunk-QGOHVJ6J.mjs";
31
32
  import "./chunk-FQYDHKKU.mjs";
@@ -0,0 +1,12 @@
1
+ interface GenerateEnvTypesOptions {
2
+ root: string;
3
+ srcDir?: string;
4
+ outFile?: string;
5
+ configPath?: string;
6
+ /** Lower-priority layer config files, ordered before the project config. */
7
+ layerConfigPaths?: readonly string[];
8
+ }
9
+ declare function generateEnvTypes(options: GenerateEnvTypesOptions): Promise<string>;
10
+ declare function createEnvTypeDeclarations(options: GenerateEnvTypesOptions, outPath: string): string;
11
+
12
+ export { type GenerateEnvTypesOptions, createEnvTypeDeclarations, generateEnvTypes };
@@ -0,0 +1,12 @@
1
+ interface GenerateEnvTypesOptions {
2
+ root: string;
3
+ srcDir?: string;
4
+ outFile?: string;
5
+ configPath?: string;
6
+ /** Lower-priority layer config files, ordered before the project config. */
7
+ layerConfigPaths?: readonly string[];
8
+ }
9
+ declare function generateEnvTypes(options: GenerateEnvTypesOptions): Promise<string>;
10
+ declare function createEnvTypeDeclarations(options: GenerateEnvTypesOptions, outPath: string): string;
11
+
12
+ export { type GenerateEnvTypesOptions, createEnvTypeDeclarations, generateEnvTypes };
package/dist/env.d.mts ADDED
@@ -0,0 +1,45 @@
1
+ interface EnvSchema<TOutput = unknown> {
2
+ parse(value: unknown): TOutput;
3
+ }
4
+ type EnvParser<TOutput = unknown> = EnvSchema<TOutput> | ((value: string | undefined, context: {
5
+ key: string;
6
+ scope: "server" | "public";
7
+ }) => TOutput);
8
+ type EnvShape = Record<string, EnvParser<any>>;
9
+ type InferEnvParser<TParser> = TParser extends EnvSchema<infer TOutput> ? TOutput : TParser extends (value: string | undefined, context: any) => infer TOutput ? TOutput : never;
10
+ type InferEnvShape<TShape> = TShape extends EnvShape ? {
11
+ [K in keyof TShape]: InferEnvParser<TShape[K]>;
12
+ } : {};
13
+ interface FarmEnvConfig<TServer extends EnvShape = EnvShape, TPublic extends EnvShape = EnvShape> {
14
+ server?: TServer;
15
+ public?: TPublic;
16
+ }
17
+ interface ResolvedFarmEnv<TServer extends Record<string, any> = Record<string, unknown>, TPublic extends Record<string, any> = Record<string, unknown>> {
18
+ server: TServer;
19
+ public: TPublic;
20
+ }
21
+ type InferEnv<TConfig> = TConfig extends FarmEnvConfig<infer TServer, infer TPublic> ? ResolvedFarmEnv<InferEnvShape<TServer>, InferEnvShape<TPublic>> : ResolvedFarmEnv;
22
+ /**
23
+ * Augmented by generated src/farm.d.ts for project-specific autocomplete.
24
+ */
25
+ interface FarmEnvTypes {
26
+ }
27
+ type FarmServerEnv = FarmEnvTypes extends {
28
+ server: infer TServer;
29
+ } ? TServer extends Record<string, any> ? TServer : Record<string, unknown> : Record<string, unknown>;
30
+ type FarmPublicEnv = FarmEnvTypes extends {
31
+ public: infer TPublic;
32
+ } ? TPublic extends Record<string, any> ? TPublic : Record<string, unknown> : Record<string, unknown>;
33
+ type FarmTypedEnv = ResolvedFarmEnv<FarmServerEnv, FarmPublicEnv>;
34
+ declare function resolveEnv<TConfig extends FarmEnvConfig<any, any> | undefined>(config: TConfig, source?: Record<string, string | undefined>): InferEnv<NonNullable<TConfig>>;
35
+ declare function setEnv(env: ResolvedFarmEnv): void;
36
+ declare function getResolvedEnv<TEnv extends ResolvedFarmEnv = FarmTypedEnv>(): TEnv;
37
+ declare function getEnv<TServer extends Record<string, any> = FarmServerEnv>(): TServer;
38
+ declare function getEnv<TKey extends Extract<keyof FarmServerEnv, string>>(key: TKey): FarmServerEnv[TKey];
39
+ declare function getPublicEnv<TPublic extends Record<string, any> = FarmPublicEnv>(): TPublic;
40
+ declare function getPublicEnv<TKey extends Extract<keyof FarmPublicEnv, string>>(key: TKey): FarmPublicEnv[TKey];
41
+ declare const env: FarmServerEnv;
42
+ declare const serverEnv: Record<string, unknown>;
43
+ declare const publicEnv: FarmPublicEnv;
44
+
45
+ export { type EnvParser, type EnvSchema, type EnvShape, type FarmEnvConfig, type FarmEnvTypes, type FarmPublicEnv, type FarmServerEnv, type FarmTypedEnv, type InferEnv, type InferEnvParser, type InferEnvShape, type ResolvedFarmEnv, env, getEnv, getPublicEnv, getResolvedEnv, publicEnv, resolveEnv, serverEnv, setEnv };
package/dist/env.d.ts ADDED
@@ -0,0 +1,45 @@
1
+ interface EnvSchema<TOutput = unknown> {
2
+ parse(value: unknown): TOutput;
3
+ }
4
+ type EnvParser<TOutput = unknown> = EnvSchema<TOutput> | ((value: string | undefined, context: {
5
+ key: string;
6
+ scope: "server" | "public";
7
+ }) => TOutput);
8
+ type EnvShape = Record<string, EnvParser<any>>;
9
+ type InferEnvParser<TParser> = TParser extends EnvSchema<infer TOutput> ? TOutput : TParser extends (value: string | undefined, context: any) => infer TOutput ? TOutput : never;
10
+ type InferEnvShape<TShape> = TShape extends EnvShape ? {
11
+ [K in keyof TShape]: InferEnvParser<TShape[K]>;
12
+ } : {};
13
+ interface FarmEnvConfig<TServer extends EnvShape = EnvShape, TPublic extends EnvShape = EnvShape> {
14
+ server?: TServer;
15
+ public?: TPublic;
16
+ }
17
+ interface ResolvedFarmEnv<TServer extends Record<string, any> = Record<string, unknown>, TPublic extends Record<string, any> = Record<string, unknown>> {
18
+ server: TServer;
19
+ public: TPublic;
20
+ }
21
+ type InferEnv<TConfig> = TConfig extends FarmEnvConfig<infer TServer, infer TPublic> ? ResolvedFarmEnv<InferEnvShape<TServer>, InferEnvShape<TPublic>> : ResolvedFarmEnv;
22
+ /**
23
+ * Augmented by generated src/farm.d.ts for project-specific autocomplete.
24
+ */
25
+ interface FarmEnvTypes {
26
+ }
27
+ type FarmServerEnv = FarmEnvTypes extends {
28
+ server: infer TServer;
29
+ } ? TServer extends Record<string, any> ? TServer : Record<string, unknown> : Record<string, unknown>;
30
+ type FarmPublicEnv = FarmEnvTypes extends {
31
+ public: infer TPublic;
32
+ } ? TPublic extends Record<string, any> ? TPublic : Record<string, unknown> : Record<string, unknown>;
33
+ type FarmTypedEnv = ResolvedFarmEnv<FarmServerEnv, FarmPublicEnv>;
34
+ declare function resolveEnv<TConfig extends FarmEnvConfig<any, any> | undefined>(config: TConfig, source?: Record<string, string | undefined>): InferEnv<NonNullable<TConfig>>;
35
+ declare function setEnv(env: ResolvedFarmEnv): void;
36
+ declare function getResolvedEnv<TEnv extends ResolvedFarmEnv = FarmTypedEnv>(): TEnv;
37
+ declare function getEnv<TServer extends Record<string, any> = FarmServerEnv>(): TServer;
38
+ declare function getEnv<TKey extends Extract<keyof FarmServerEnv, string>>(key: TKey): FarmServerEnv[TKey];
39
+ declare function getPublicEnv<TPublic extends Record<string, any> = FarmPublicEnv>(): TPublic;
40
+ declare function getPublicEnv<TKey extends Extract<keyof FarmPublicEnv, string>>(key: TKey): FarmPublicEnv[TKey];
41
+ declare const env: FarmServerEnv;
42
+ declare const serverEnv: Record<string, unknown>;
43
+ declare const publicEnv: FarmPublicEnv;
44
+
45
+ export { type EnvParser, type EnvSchema, type EnvShape, type FarmEnvConfig, type FarmEnvTypes, type FarmPublicEnv, type FarmServerEnv, type FarmTypedEnv, type InferEnv, type InferEnvParser, type InferEnvShape, type ResolvedFarmEnv, env, getEnv, getPublicEnv, getResolvedEnv, publicEnv, resolveEnv, serverEnv, setEnv };
@@ -0,0 +1,22 @@
1
+ import { Plugin } from 'vite';
2
+ import { FarmEnvironment } from '../environment.mjs';
3
+
4
+ interface AstNode {
5
+ type: string;
6
+ start: number;
7
+ end: number;
8
+ [key: string]: unknown;
9
+ }
10
+ interface TransformEnvironmentFunctionsOptions {
11
+ code: string;
12
+ id: string;
13
+ environment: FarmEnvironment;
14
+ parse: (code: string) => AstNode;
15
+ }
16
+ interface TransformEnvironmentFunctionsResult {
17
+ code: string;
18
+ }
19
+ declare function transformEnvironmentFunctions(options: TransformEnvironmentFunctionsOptions): TransformEnvironmentFunctionsResult | null;
20
+ declare function farmEnvironmentFunctionsPlugin(): Plugin;
21
+
22
+ export { type TransformEnvironmentFunctionsOptions, type TransformEnvironmentFunctionsResult, farmEnvironmentFunctionsPlugin, transformEnvironmentFunctions };
@@ -0,0 +1,22 @@
1
+ import { Plugin } from 'vite';
2
+ import { FarmEnvironment } from '../environment.js';
3
+
4
+ interface AstNode {
5
+ type: string;
6
+ start: number;
7
+ end: number;
8
+ [key: string]: unknown;
9
+ }
10
+ interface TransformEnvironmentFunctionsOptions {
11
+ code: string;
12
+ id: string;
13
+ environment: FarmEnvironment;
14
+ parse: (code: string) => AstNode;
15
+ }
16
+ interface TransformEnvironmentFunctionsResult {
17
+ code: string;
18
+ }
19
+ declare function transformEnvironmentFunctions(options: TransformEnvironmentFunctionsOptions): TransformEnvironmentFunctionsResult | null;
20
+ declare function farmEnvironmentFunctionsPlugin(): Plugin;
21
+
22
+ export { type TransformEnvironmentFunctionsOptions, type TransformEnvironmentFunctionsResult, farmEnvironmentFunctionsPlugin, transformEnvironmentFunctions };
@@ -0,0 +1,18 @@
1
+ type AnyEnvironmentFunction = (...args: never[]) => unknown;
2
+ type FarmEnvironment = "server" | "client";
3
+ interface FarmIsomorphicFnOptions<TArgs extends unknown[], TServerResult, TClientResult> {
4
+ server: (...args: TArgs) => TServerResult;
5
+ client: (...args: TArgs) => TClientResult;
6
+ }
7
+ declare class FarmEnvironmentError extends Error {
8
+ readonly api: "createServerOnlyFn" | "createClientOnlyFn";
9
+ readonly expected: FarmEnvironment;
10
+ readonly actual: FarmEnvironment;
11
+ readonly code = "FARM_ENVIRONMENT_MISMATCH";
12
+ constructor(api: "createServerOnlyFn" | "createClientOnlyFn", expected: FarmEnvironment, actual: FarmEnvironment);
13
+ }
14
+ declare function createServerOnlyFn<TFunction extends AnyEnvironmentFunction>(implementation: TFunction): TFunction;
15
+ declare function createClientOnlyFn<TFunction extends AnyEnvironmentFunction>(implementation: TFunction): TFunction;
16
+ declare function createIsomorphicFn<TArgs extends unknown[], TServerResult, TClientResult>(options: FarmIsomorphicFnOptions<TArgs, TServerResult, TClientResult>): (...args: TArgs) => TServerResult | TClientResult;
17
+
18
+ export { type FarmEnvironment, FarmEnvironmentError, type FarmIsomorphicFnOptions, createClientOnlyFn, createIsomorphicFn, createServerOnlyFn };
@@ -0,0 +1,18 @@
1
+ type AnyEnvironmentFunction = (...args: never[]) => unknown;
2
+ type FarmEnvironment = "server" | "client";
3
+ interface FarmIsomorphicFnOptions<TArgs extends unknown[], TServerResult, TClientResult> {
4
+ server: (...args: TArgs) => TServerResult;
5
+ client: (...args: TArgs) => TClientResult;
6
+ }
7
+ declare class FarmEnvironmentError extends Error {
8
+ readonly api: "createServerOnlyFn" | "createClientOnlyFn";
9
+ readonly expected: FarmEnvironment;
10
+ readonly actual: FarmEnvironment;
11
+ readonly code = "FARM_ENVIRONMENT_MISMATCH";
12
+ constructor(api: "createServerOnlyFn" | "createClientOnlyFn", expected: FarmEnvironment, actual: FarmEnvironment);
13
+ }
14
+ declare function createServerOnlyFn<TFunction extends AnyEnvironmentFunction>(implementation: TFunction): TFunction;
15
+ declare function createClientOnlyFn<TFunction extends AnyEnvironmentFunction>(implementation: TFunction): TFunction;
16
+ declare function createIsomorphicFn<TArgs extends unknown[], TServerResult, TClientResult>(options: FarmIsomorphicFnOptions<TArgs, TServerResult, TClientResult>): (...args: TArgs) => TServerResult | TClientResult;
17
+
18
+ export { type FarmEnvironment, FarmEnvironmentError, type FarmIsomorphicFnOptions, createClientOnlyFn, createIsomorphicFn, createServerOnlyFn };
@@ -0,0 +1,95 @@
1
+ type FarmFontDisplay = "auto" | "block" | "swap" | "fallback" | "optional";
2
+ interface FarmFontSource {
3
+ /** Local file path or remote URL, depending on the loader. */
4
+ path: string;
5
+ /** A fixed weight (`400`) or variable range (`100 900`). */
6
+ weight?: number | string;
7
+ /** Font style for this source. */
8
+ style?: string;
9
+ /** Optional CSS unicode-range descriptor. */
10
+ unicodeRange?: string;
11
+ }
12
+ interface FarmFontOptions {
13
+ /** CSS font-family name. */
14
+ family: string;
15
+ /** A fixed weight (`400`) or variable range (`100 900`). */
16
+ weight?: number | string;
17
+ /** Font style. @default "normal" */
18
+ style?: string;
19
+ /** Browser loading behavior. @default "swap" */
20
+ display?: FarmFontDisplay;
21
+ /** CSS custom property populated by `variable`, for example `--font-sans`. */
22
+ variable?: `--${string}`;
23
+ /** Fallback family names appended to the generated stack. */
24
+ fallback?: string[];
25
+ /** Emit font preload hints. @default true */
26
+ preload?: boolean;
27
+ }
28
+ interface LocalFontOptions extends FarmFontOptions {
29
+ /**
30
+ * A file relative to this module, a package font specifier, or explicit
31
+ * sources for a multi-weight family.
32
+ */
33
+ src: string | FarmFontSource[];
34
+ }
35
+ interface RemoteFontSource extends FarmFontSource {
36
+ /** Optional integrity value for this source. Overrides the family-level value. */
37
+ integrity?: string;
38
+ }
39
+ interface RemoteFontOptions extends FarmFontOptions {
40
+ /** HTTPS font URL, or explicit remote sources for a multi-weight family. */
41
+ src: string | RemoteFontSource[];
42
+ /** Download and fingerprint the font during the build, or retain its URL. */
43
+ strategy?: "self-host" | "external";
44
+ /** Optional Subresource Integrity value checked while self-hosting. */
45
+ integrity?: string;
46
+ }
47
+ interface FarmFont {
48
+ /** Generated class that applies the font family and fallback stack. */
49
+ className: string;
50
+ /** Generated class that defines the configured CSS custom property. */
51
+ variable: string;
52
+ /** Inline-style equivalent of the generated family. */
53
+ style: Readonly<{
54
+ fontFamily: string;
55
+ fontStyle?: string;
56
+ fontWeight?: number | string;
57
+ }>;
58
+ /** Compiled resources that should be preloaded when this font is selected. */
59
+ preloads: readonly Readonly<{
60
+ href: string;
61
+ type: string;
62
+ }>[];
63
+ }
64
+ /** Semantic font roles inherited by framework-owned surfaces such as Farm Docs. */
65
+ interface FarmLayoutFonts {
66
+ /** Default text and prose font. */
67
+ body?: FarmFont;
68
+ /** Code, keyboard input, and other technical UI font. */
69
+ code?: FarmFont;
70
+ }
71
+ interface FarmLayoutFontModule {
72
+ fonts?: FarmLayoutFonts;
73
+ }
74
+ /**
75
+ * Define the semantic fonts exported by a layout.
76
+ *
77
+ * Layouts are resolved from the root toward the requested route. A nearer
78
+ * layout overrides only the roles it defines, so it can replace `body` while
79
+ * continuing to inherit `code` from a parent layout.
80
+ */
81
+ declare function defineLayoutFonts<const T extends FarmLayoutFonts>(fonts: T): T;
82
+ /** Resolve semantic font roles from root layout to nearest layout. */
83
+ declare function resolveFarmLayoutFonts(layouts: readonly FarmLayoutFontModule[]): FarmLayoutFonts | undefined;
84
+ /**
85
+ * Compile local font files into hashed application assets and generated CSS.
86
+ * The call is removed at build time and adds no font-loader runtime code.
87
+ */
88
+ declare function localFont(_options: LocalFontOptions): FarmFont;
89
+ /**
90
+ * Compile a remote font into a self-hosted application asset by default.
91
+ * Use `strategy: "external"` only when the browser should retain the remote URL.
92
+ */
93
+ declare function remoteFont(_options: RemoteFontOptions): FarmFont;
94
+
95
+ export { type FarmFont, type FarmFontDisplay, type FarmFontOptions, type FarmFontSource, type FarmLayoutFontModule, type FarmLayoutFonts, type LocalFontOptions, type RemoteFontOptions, type RemoteFontSource, defineLayoutFonts, localFont, remoteFont, resolveFarmLayoutFonts };
package/dist/font.d.ts ADDED
@@ -0,0 +1,95 @@
1
+ type FarmFontDisplay = "auto" | "block" | "swap" | "fallback" | "optional";
2
+ interface FarmFontSource {
3
+ /** Local file path or remote URL, depending on the loader. */
4
+ path: string;
5
+ /** A fixed weight (`400`) or variable range (`100 900`). */
6
+ weight?: number | string;
7
+ /** Font style for this source. */
8
+ style?: string;
9
+ /** Optional CSS unicode-range descriptor. */
10
+ unicodeRange?: string;
11
+ }
12
+ interface FarmFontOptions {
13
+ /** CSS font-family name. */
14
+ family: string;
15
+ /** A fixed weight (`400`) or variable range (`100 900`). */
16
+ weight?: number | string;
17
+ /** Font style. @default "normal" */
18
+ style?: string;
19
+ /** Browser loading behavior. @default "swap" */
20
+ display?: FarmFontDisplay;
21
+ /** CSS custom property populated by `variable`, for example `--font-sans`. */
22
+ variable?: `--${string}`;
23
+ /** Fallback family names appended to the generated stack. */
24
+ fallback?: string[];
25
+ /** Emit font preload hints. @default true */
26
+ preload?: boolean;
27
+ }
28
+ interface LocalFontOptions extends FarmFontOptions {
29
+ /**
30
+ * A file relative to this module, a package font specifier, or explicit
31
+ * sources for a multi-weight family.
32
+ */
33
+ src: string | FarmFontSource[];
34
+ }
35
+ interface RemoteFontSource extends FarmFontSource {
36
+ /** Optional integrity value for this source. Overrides the family-level value. */
37
+ integrity?: string;
38
+ }
39
+ interface RemoteFontOptions extends FarmFontOptions {
40
+ /** HTTPS font URL, or explicit remote sources for a multi-weight family. */
41
+ src: string | RemoteFontSource[];
42
+ /** Download and fingerprint the font during the build, or retain its URL. */
43
+ strategy?: "self-host" | "external";
44
+ /** Optional Subresource Integrity value checked while self-hosting. */
45
+ integrity?: string;
46
+ }
47
+ interface FarmFont {
48
+ /** Generated class that applies the font family and fallback stack. */
49
+ className: string;
50
+ /** Generated class that defines the configured CSS custom property. */
51
+ variable: string;
52
+ /** Inline-style equivalent of the generated family. */
53
+ style: Readonly<{
54
+ fontFamily: string;
55
+ fontStyle?: string;
56
+ fontWeight?: number | string;
57
+ }>;
58
+ /** Compiled resources that should be preloaded when this font is selected. */
59
+ preloads: readonly Readonly<{
60
+ href: string;
61
+ type: string;
62
+ }>[];
63
+ }
64
+ /** Semantic font roles inherited by framework-owned surfaces such as Farm Docs. */
65
+ interface FarmLayoutFonts {
66
+ /** Default text and prose font. */
67
+ body?: FarmFont;
68
+ /** Code, keyboard input, and other technical UI font. */
69
+ code?: FarmFont;
70
+ }
71
+ interface FarmLayoutFontModule {
72
+ fonts?: FarmLayoutFonts;
73
+ }
74
+ /**
75
+ * Define the semantic fonts exported by a layout.
76
+ *
77
+ * Layouts are resolved from the root toward the requested route. A nearer
78
+ * layout overrides only the roles it defines, so it can replace `body` while
79
+ * continuing to inherit `code` from a parent layout.
80
+ */
81
+ declare function defineLayoutFonts<const T extends FarmLayoutFonts>(fonts: T): T;
82
+ /** Resolve semantic font roles from root layout to nearest layout. */
83
+ declare function resolveFarmLayoutFonts(layouts: readonly FarmLayoutFontModule[]): FarmLayoutFonts | undefined;
84
+ /**
85
+ * Compile local font files into hashed application assets and generated CSS.
86
+ * The call is removed at build time and adds no font-loader runtime code.
87
+ */
88
+ declare function localFont(_options: LocalFontOptions): FarmFont;
89
+ /**
90
+ * Compile a remote font into a self-hosted application asset by default.
91
+ * Use `strategy: "external"` only when the browser should retain the remote URL.
92
+ */
93
+ declare function remoteFont(_options: RemoteFontOptions): FarmFont;
94
+
95
+ export { type FarmFont, type FarmFontDisplay, type FarmFontOptions, type FarmFontSource, type FarmLayoutFontModule, type FarmLayoutFonts, type LocalFontOptions, type RemoteFontOptions, type RemoteFontSource, defineLayoutFonts, localFont, remoteFont, resolveFarmLayoutFonts };
@@ -0,0 +1,22 @@
1
+ interface RequestCookie {
2
+ name: string;
3
+ value: string;
4
+ }
5
+ interface ReadonlyHeaders extends Iterable<[string, string]> {
6
+ get(name: string): string | null;
7
+ has(name: string): boolean;
8
+ forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
9
+ entries(): IterableIterator<[string, string]>;
10
+ keys(): IterableIterator<string>;
11
+ values(): IterableIterator<string>;
12
+ }
13
+ interface ReadonlyRequestCookies extends Iterable<RequestCookie> {
14
+ get(name: string): RequestCookie | undefined;
15
+ getAll(name?: string): RequestCookie[];
16
+ has(name: string): boolean;
17
+ toString(): string;
18
+ }
19
+ declare function headers(): ReadonlyHeaders;
20
+ declare function cookies(): ReadonlyRequestCookies;
21
+
22
+ export { type ReadonlyHeaders, type ReadonlyRequestCookies, type RequestCookie, cookies, headers };
@@ -0,0 +1,22 @@
1
+ interface RequestCookie {
2
+ name: string;
3
+ value: string;
4
+ }
5
+ interface ReadonlyHeaders extends Iterable<[string, string]> {
6
+ get(name: string): string | null;
7
+ has(name: string): boolean;
8
+ forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
9
+ entries(): IterableIterator<[string, string]>;
10
+ keys(): IterableIterator<string>;
11
+ values(): IterableIterator<string>;
12
+ }
13
+ interface ReadonlyRequestCookies extends Iterable<RequestCookie> {
14
+ get(name: string): RequestCookie | undefined;
15
+ getAll(name?: string): RequestCookie[];
16
+ has(name: string): boolean;
17
+ toString(): string;
18
+ }
19
+ declare function headers(): ReadonlyHeaders;
20
+ declare function cookies(): ReadonlyRequestCookies;
21
+
22
+ export { type ReadonlyHeaders, type ReadonlyRequestCookies, type RequestCookie, cookies, headers };