@farm.js/core 0.1.0-beta.11 → 0.1.0-beta.14

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 (238) hide show
  1. package/dist/chunk-53MVSX3R.mjs +168 -0
  2. package/dist/chunk-53MVSX3R.mjs.map +1 -0
  3. package/dist/{chunk-AW6I64AP.mjs → chunk-6ZXIQSXE.mjs} +16 -1
  4. package/dist/chunk-6ZXIQSXE.mjs.map +1 -0
  5. package/dist/chunk-7ZVN3YZI.mjs +333 -0
  6. package/dist/chunk-7ZVN3YZI.mjs.map +1 -0
  7. package/dist/{chunk-5EVQFRL2.mjs → chunk-ARCGE2VT.mjs} +2 -2
  8. package/dist/chunk-ARCGE2VT.mjs.map +1 -0
  9. package/dist/{chunk-7N62DNSO.mjs → chunk-H3TE3LOV.mjs} +2 -2
  10. package/dist/{chunk-QTZZ2ISQ.mjs → chunk-KLA67WKG.mjs} +1 -1
  11. package/dist/chunk-KLA67WKG.mjs.map +1 -0
  12. package/dist/{chunk-K5ZTUF22.mjs → chunk-L2PE36GQ.mjs} +7 -3
  13. package/dist/chunk-L2PE36GQ.mjs.map +1 -0
  14. package/dist/{chunk-4LND3PXF.mjs → chunk-OPHK6OJN.mjs} +513 -48
  15. package/dist/chunk-OPHK6OJN.mjs.map +1 -0
  16. package/dist/{chunk-77BOAQHI.mjs → chunk-PNFQQSRA.mjs} +754 -156
  17. package/dist/chunk-PNFQQSRA.mjs.map +1 -0
  18. package/dist/chunk-USLFXFFH.mjs +46 -0
  19. package/dist/chunk-USLFXFFH.mjs.map +1 -0
  20. package/dist/{chunk-4677KXB7.mjs → chunk-VUL55IAX.mjs} +368 -103
  21. package/dist/chunk-VUL55IAX.mjs.map +1 -0
  22. package/dist/client.cjs.map +1 -1
  23. package/dist/client.mjs +1 -1
  24. package/dist/{devtools-A22KUJZT.mjs → devtools-GAZ7F3KL.mjs} +4 -3
  25. package/dist/{devtools-A22KUJZT.mjs.map → devtools-GAZ7F3KL.mjs.map} +1 -1
  26. package/dist/docs.cjs +622 -124
  27. package/dist/docs.cjs.map +1 -1
  28. package/dist/docs.mjs +5 -3
  29. package/dist/font.cjs +19 -2
  30. package/dist/font.cjs.map +1 -1
  31. package/dist/font.mjs +7 -3
  32. package/dist/index.cjs +2235 -689
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.mjs +27 -19
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/internal/build-runtime.cjs +2062 -525
  37. package/dist/internal/build-runtime.cjs.map +1 -1
  38. package/dist/internal/build-runtime.mjs +13 -10
  39. package/dist/internal/client-runtime.cjs +169 -2
  40. package/dist/internal/client-runtime.cjs.map +1 -1
  41. package/dist/internal/client-runtime.mjs +170 -2
  42. package/dist/internal/client-runtime.mjs.map +1 -1
  43. package/dist/internal/config-runtime.cjs +22 -0
  44. package/dist/internal/config-runtime.cjs.map +1 -1
  45. package/dist/internal/config-runtime.mjs +3 -2
  46. package/dist/internal/metadata-image-runtime.cjs +199 -0
  47. package/dist/internal/metadata-image-runtime.cjs.map +1 -0
  48. package/dist/internal/metadata-image-runtime.mjs +8 -0
  49. package/dist/internal/metadata-image-runtime.mjs.map +1 -0
  50. package/dist/internal/production-runtime.cjs +310 -0
  51. package/dist/internal/production-runtime.cjs.map +1 -1
  52. package/dist/internal/production-runtime.mjs +10 -0
  53. package/dist/internal/production-runtime.mjs.map +1 -1
  54. package/dist/navigation.cjs.map +1 -1
  55. package/dist/navigation.mjs +2 -2
  56. package/dist/plugin.cjs +1550 -348
  57. package/dist/plugin.cjs.map +1 -1
  58. package/dist/plugin.mjs +9 -5
  59. package/dist/server.cjs +1663 -419
  60. package/dist/server.cjs.map +1 -1
  61. package/dist/server.mjs +17 -19
  62. package/dist/server.mjs.map +1 -1
  63. package/dist/version.cjs +1 -1
  64. package/dist/version.cjs.map +1 -1
  65. package/dist/version.mjs +1 -1
  66. package/dist/vite.cjs +1604 -358
  67. package/dist/vite.cjs.map +1 -1
  68. package/dist/vite.mjs +9 -5
  69. package/package.json +10 -1
  70. package/types/client.d.ts +115 -4
  71. package/dist/after.d.mts +0 -25
  72. package/dist/after.d.ts +0 -25
  73. package/dist/agent-runtime.d.mts +0 -94
  74. package/dist/agent-runtime.d.ts +0 -94
  75. package/dist/api/route-manager.d.mts +0 -66
  76. package/dist/api/route-manager.d.ts +0 -66
  77. package/dist/api/runtime.d.mts +0 -3
  78. package/dist/api/runtime.d.ts +0 -3
  79. package/dist/api.d.mts +0 -48
  80. package/dist/api.d.ts +0 -48
  81. package/dist/app-BNE2FoZ4.d.mts +0 -302
  82. package/dist/app-DRGUmJ3s.d.ts +0 -302
  83. package/dist/app-markdown.d.mts +0 -22
  84. package/dist/app-markdown.d.ts +0 -22
  85. package/dist/cache.d.mts +0 -192
  86. package/dist/cache.d.ts +0 -192
  87. package/dist/chunk-4677KXB7.mjs.map +0 -1
  88. package/dist/chunk-4LND3PXF.mjs.map +0 -1
  89. package/dist/chunk-5EVQFRL2.mjs.map +0 -1
  90. package/dist/chunk-77BOAQHI.mjs.map +0 -1
  91. package/dist/chunk-AW6I64AP.mjs.map +0 -1
  92. package/dist/chunk-K5ZTUF22.mjs.map +0 -1
  93. package/dist/chunk-QM746KUO.mjs +0 -56
  94. package/dist/chunk-QM746KUO.mjs.map +0 -1
  95. package/dist/chunk-QTZZ2ISQ.mjs.map +0 -1
  96. package/dist/client-BT1mFQas.d.mts +0 -447
  97. package/dist/client-Nn0q4eO4.d.ts +0 -447
  98. package/dist/client-cache-CIlyBlmx.d.ts +0 -6
  99. package/dist/client-cache-D-EZ7XVW.d.mts +0 -6
  100. package/dist/client-plugins-Bc5jHcNr.d.ts +0 -1927
  101. package/dist/client-plugins-jsk-ZLzJ.d.mts +0 -1927
  102. package/dist/client-plugins.d.mts +0 -22
  103. package/dist/client-plugins.d.ts +0 -22
  104. package/dist/client.d.mts +0 -447
  105. package/dist/client.d.ts +0 -447
  106. package/dist/config.d.mts +0 -29
  107. package/dist/config.d.ts +0 -29
  108. package/dist/cron.d.mts +0 -78
  109. package/dist/cron.d.ts +0 -78
  110. package/dist/deferred.d.mts +0 -42
  111. package/dist/deferred.d.ts +0 -42
  112. package/dist/deployment.d.mts +0 -34
  113. package/dist/deployment.d.ts +0 -34
  114. package/dist/docs.d.mts +0 -69
  115. package/dist/docs.d.ts +0 -69
  116. package/dist/env-types.d.mts +0 -12
  117. package/dist/env-types.d.ts +0 -12
  118. package/dist/env.d.mts +0 -45
  119. package/dist/env.d.ts +0 -45
  120. package/dist/environment/vite.d.mts +0 -22
  121. package/dist/environment/vite.d.ts +0 -22
  122. package/dist/environment.d.mts +0 -18
  123. package/dist/environment.d.ts +0 -18
  124. package/dist/font.d.mts +0 -70
  125. package/dist/font.d.ts +0 -70
  126. package/dist/headers.d.mts +0 -22
  127. package/dist/headers.d.ts +0 -22
  128. package/dist/i18n/client.d.mts +0 -32
  129. package/dist/i18n/client.d.ts +0 -32
  130. package/dist/i18n/index.d.mts +0 -20
  131. package/dist/i18n/index.d.ts +0 -20
  132. package/dist/i18n/server.d.mts +0 -30
  133. package/dist/i18n/server.d.ts +0 -30
  134. package/dist/image/server.d.mts +0 -37
  135. package/dist/image/server.d.ts +0 -37
  136. package/dist/image/sharp.d.mts +0 -7
  137. package/dist/image/sharp.d.ts +0 -7
  138. package/dist/image-config-Duob7wER.d.mts +0 -50
  139. package/dist/image-config-Duob7wER.d.ts +0 -50
  140. package/dist/image.d.mts +0 -39
  141. package/dist/image.d.ts +0 -39
  142. package/dist/index.d.mts +0 -455
  143. package/dist/index.d.ts +0 -455
  144. package/dist/integration-api-CHT2OKAf.d.mts +0 -93
  145. package/dist/integration-api-CHT2OKAf.d.ts +0 -93
  146. package/dist/integrations.d.mts +0 -22
  147. package/dist/integrations.d.ts +0 -22
  148. package/dist/internal/build-runtime.d.mts +0 -39
  149. package/dist/internal/build-runtime.d.ts +0 -39
  150. package/dist/internal/client-runtime.d.mts +0 -2
  151. package/dist/internal/client-runtime.d.ts +0 -2
  152. package/dist/internal/config-runtime.d.mts +0 -39
  153. package/dist/internal/config-runtime.d.ts +0 -39
  154. package/dist/internal/production-node-env.d.mts +0 -12
  155. package/dist/internal/production-node-env.d.ts +0 -12
  156. package/dist/internal/production-runtime.d.mts +0 -41
  157. package/dist/internal/production-runtime.d.ts +0 -41
  158. package/dist/markdown.d.mts +0 -60
  159. package/dist/markdown.d.ts +0 -60
  160. package/dist/metadata-7ffpT3jr.d.mts +0 -22
  161. package/dist/metadata-JHn-8eht.d.ts +0 -22
  162. package/dist/middleware.d.mts +0 -164
  163. package/dist/middleware.d.ts +0 -164
  164. package/dist/navigation-errors-Dvwpzaer.d.mts +0 -13
  165. package/dist/navigation-errors-Dvwpzaer.d.ts +0 -13
  166. package/dist/navigation.d.mts +0 -14
  167. package/dist/navigation.d.ts +0 -14
  168. package/dist/observability.d.mts +0 -335
  169. package/dist/observability.d.ts +0 -335
  170. package/dist/params-BALtrRim.d.ts +0 -15
  171. package/dist/params-ry-lxqmy.d.mts +0 -15
  172. package/dist/plugin-BJDf43dc.d.mts +0 -165
  173. package/dist/plugin-BJDf43dc.d.ts +0 -165
  174. package/dist/plugin.d.mts +0 -22
  175. package/dist/plugin.d.ts +0 -22
  176. package/dist/production-runtime-9KG7GuvW.d.ts +0 -79
  177. package/dist/production-runtime-B-fweKts.d.mts +0 -79
  178. package/dist/production-runtime-C_B79w2P.d.mts +0 -28
  179. package/dist/production-runtime-DDEM1D2q.d.ts +0 -28
  180. package/dist/query/client.d.mts +0 -61
  181. package/dist/query/client.d.ts +0 -61
  182. package/dist/query/index.d.mts +0 -90
  183. package/dist/query/index.d.ts +0 -90
  184. package/dist/query/parsers.d.mts +0 -25
  185. package/dist/query/parsers.d.ts +0 -25
  186. package/dist/query/server.d.mts +0 -55
  187. package/dist/query/server.d.ts +0 -55
  188. package/dist/request-Dsq4kGW0.d.mts +0 -6
  189. package/dist/request-udtobOLv.d.ts +0 -6
  190. package/dist/request.d.mts +0 -2
  191. package/dist/request.d.ts +0 -2
  192. package/dist/resolver-DJqjLMg_.d.mts +0 -14
  193. package/dist/resolver-IH4RmPEl.d.ts +0 -14
  194. package/dist/route-runtime-DoOHzCAD.d.mts +0 -38
  195. package/dist/route-runtime-DoOHzCAD.d.ts +0 -38
  196. package/dist/router.d.mts +0 -36
  197. package/dist/router.d.ts +0 -36
  198. package/dist/routes.d.mts +0 -224
  199. package/dist/routes.d.ts +0 -224
  200. package/dist/runtime-9nQjVM7X.d.mts +0 -206
  201. package/dist/runtime-Cxpq6xZN.d.mts +0 -27
  202. package/dist/runtime-DgeS2skB.d.ts +0 -206
  203. package/dist/runtime-bv63eUiO.d.ts +0 -27
  204. package/dist/server-action-security.d.mts +0 -43
  205. package/dist/server-action-security.d.ts +0 -43
  206. package/dist/server-fn-client.d.mts +0 -32
  207. package/dist/server-fn-client.d.ts +0 -32
  208. package/dist/server-fn.d.mts +0 -93
  209. package/dist/server-fn.d.ts +0 -93
  210. package/dist/server-plugins.d.mts +0 -55
  211. package/dist/server-plugins.d.ts +0 -55
  212. package/dist/server-query-client.d.mts +0 -50
  213. package/dist/server-query-client.d.ts +0 -50
  214. package/dist/server-query.d.mts +0 -36
  215. package/dist/server-query.d.ts +0 -36
  216. package/dist/server.d.mts +0 -48
  217. package/dist/server.d.ts +0 -48
  218. package/dist/storage.d.mts +0 -52
  219. package/dist/storage.d.ts +0 -52
  220. package/dist/testing.d.mts +0 -101
  221. package/dist/testing.d.ts +0 -101
  222. package/dist/transport-BmbGTXA5.d.mts +0 -49
  223. package/dist/transport-BmbGTXA5.d.ts +0 -49
  224. package/dist/types-BMxWr97v.d.mts +0 -81
  225. package/dist/types-BMxWr97v.d.ts +0 -81
  226. package/dist/types-C9N-nk5R.d.mts +0 -53
  227. package/dist/types-C9N-nk5R.d.ts +0 -53
  228. package/dist/types-D1A6-XvH.d.mts +0 -73
  229. package/dist/types-D1A6-XvH.d.ts +0 -73
  230. package/dist/utils-CA0z0c-2.d.ts +0 -23
  231. package/dist/utils-mYVkSOt2.d.mts +0 -23
  232. package/dist/version.d.mts +0 -3
  233. package/dist/version.d.ts +0 -3
  234. package/dist/vite.d.mts +0 -22
  235. package/dist/vite.d.ts +0 -22
  236. package/dist/workflows.d.mts +0 -110
  237. package/dist/workflows.d.ts +0 -110
  238. /package/dist/{chunk-7N62DNSO.mjs.map → chunk-H3TE3LOV.mjs.map} +0 -0
@@ -1,42 +0,0 @@
1
- declare const FARM_DEFERRED_CONTENT_TYPE = "application/x-farm-deferred+json";
2
- declare const FARM_DEFERRED_ERROR_CODE = "FARM_DEFERRED_DATA_ERROR";
3
- declare const FARM_DEFERRED_BRAND: unique symbol;
4
- interface Deferred<T> extends Promise<T> {
5
- readonly [FARM_DEFERRED_BRAND]: true;
6
- }
7
- interface PreparedDeferredData {
8
- data: unknown;
9
- records: readonly DeferredRecord[];
10
- }
11
- interface DeferredRecord {
12
- id: string;
13
- promise: Deferred<unknown>;
14
- }
15
- type DeferredSettlement = {
16
- status: "fulfilled";
17
- value: unknown;
18
- } | {
19
- status: "rejected";
20
- error: {
21
- code: typeof FARM_DEFERRED_ERROR_CODE;
22
- message: string;
23
- };
24
- };
25
- type DeferredSettlements = Record<string, DeferredSettlement>;
26
- interface DeferredDataResponseOptions {
27
- onError?: (error: unknown, id: string) => void;
28
- }
29
- declare class DeferredDataError extends Error {
30
- readonly name = "DeferredDataError";
31
- readonly code = "FARM_DEFERRED_DATA_ERROR";
32
- constructor(message?: string);
33
- }
34
- declare function defer<T>(value: PromiseLike<T>): Deferred<Awaited<T>>;
35
- declare function isDeferred<T = unknown>(value: unknown): value is Deferred<T>;
36
- declare function prepareDeferredData(value: unknown): PreparedDeferredData;
37
- declare function snapshotDeferredData(records: readonly DeferredRecord[]): DeferredSettlements;
38
- declare function reviveDeferredData<T>(value: T, settlements: DeferredSettlements): T;
39
- declare function createDeferredDataResponse(value: unknown, init?: ResponseInit, options?: DeferredDataResponseOptions): Response;
40
- declare function readDeferredDataResponse<T>(response: Response): Promise<T>;
41
-
42
- export { type Deferred, DeferredDataError, type DeferredDataResponseOptions, type DeferredRecord, type DeferredSettlement, type DeferredSettlements, FARM_DEFERRED_BRAND, FARM_DEFERRED_CONTENT_TYPE, FARM_DEFERRED_ERROR_CODE, type PreparedDeferredData, createDeferredDataResponse, defer, isDeferred, prepareDeferredData, readDeferredDataResponse, reviveDeferredData, snapshotDeferredData };
@@ -1,42 +0,0 @@
1
- declare const FARM_DEFERRED_CONTENT_TYPE = "application/x-farm-deferred+json";
2
- declare const FARM_DEFERRED_ERROR_CODE = "FARM_DEFERRED_DATA_ERROR";
3
- declare const FARM_DEFERRED_BRAND: unique symbol;
4
- interface Deferred<T> extends Promise<T> {
5
- readonly [FARM_DEFERRED_BRAND]: true;
6
- }
7
- interface PreparedDeferredData {
8
- data: unknown;
9
- records: readonly DeferredRecord[];
10
- }
11
- interface DeferredRecord {
12
- id: string;
13
- promise: Deferred<unknown>;
14
- }
15
- type DeferredSettlement = {
16
- status: "fulfilled";
17
- value: unknown;
18
- } | {
19
- status: "rejected";
20
- error: {
21
- code: typeof FARM_DEFERRED_ERROR_CODE;
22
- message: string;
23
- };
24
- };
25
- type DeferredSettlements = Record<string, DeferredSettlement>;
26
- interface DeferredDataResponseOptions {
27
- onError?: (error: unknown, id: string) => void;
28
- }
29
- declare class DeferredDataError extends Error {
30
- readonly name = "DeferredDataError";
31
- readonly code = "FARM_DEFERRED_DATA_ERROR";
32
- constructor(message?: string);
33
- }
34
- declare function defer<T>(value: PromiseLike<T>): Deferred<Awaited<T>>;
35
- declare function isDeferred<T = unknown>(value: unknown): value is Deferred<T>;
36
- declare function prepareDeferredData(value: unknown): PreparedDeferredData;
37
- declare function snapshotDeferredData(records: readonly DeferredRecord[]): DeferredSettlements;
38
- declare function reviveDeferredData<T>(value: T, settlements: DeferredSettlements): T;
39
- declare function createDeferredDataResponse(value: unknown, init?: ResponseInit, options?: DeferredDataResponseOptions): Response;
40
- declare function readDeferredDataResponse<T>(response: Response): Promise<T>;
41
-
42
- export { type Deferred, DeferredDataError, type DeferredDataResponseOptions, type DeferredRecord, type DeferredSettlement, type DeferredSettlements, FARM_DEFERRED_BRAND, FARM_DEFERRED_CONTENT_TYPE, FARM_DEFERRED_ERROR_CODE, type PreparedDeferredData, createDeferredDataResponse, defer, isDeferred, prepareDeferredData, readDeferredDataResponse, reviveDeferredData, snapshotDeferredData };
@@ -1,34 +0,0 @@
1
- declare const FARM_DEPLOYMENT_ID_HEADER = "x-farm-deployment-id";
2
- declare const FARM_DEPLOYMENT_MISMATCH_HEADER = "x-farm-deployment-mismatch";
3
- declare const FARM_DEPLOYMENT_COOKIE = "__farm_deployment";
4
- declare const FARM_DEPLOYMENT_MISMATCH_CODE = "FARM_DEPLOYMENT_MISMATCH";
5
- declare const FARM_DEPLOYMENT_MISMATCH_STATUS = 409;
6
- interface FarmDeploymentMismatch {
7
- clientDeploymentId: string;
8
- serverDeploymentId: string;
9
- }
10
- interface FarmDeploymentResponseOptions {
11
- setCookie?: boolean;
12
- cookiePath?: string;
13
- secureCookie?: boolean;
14
- }
15
- declare class FarmDeploymentMismatchError extends Error {
16
- readonly clientDeploymentId: string;
17
- readonly serverDeploymentId: string;
18
- readonly name = "FarmDeploymentMismatchError";
19
- readonly code = "FARM_DEPLOYMENT_MISMATCH";
20
- readonly retryable = false;
21
- constructor(clientDeploymentId: string, serverDeploymentId: string);
22
- }
23
- declare function normalizeFarmDeploymentId(value: unknown): string;
24
- declare function createFarmDeploymentRequestHeaders(deploymentId: string | undefined, init?: HeadersInit): Headers;
25
- declare function getFarmRequestDeploymentId(request: Pick<Request, "headers" | "method">): string | undefined;
26
- declare function getFarmDeploymentMismatch(request: Pick<Request, "headers" | "method">, serverDeploymentId: string | undefined): FarmDeploymentMismatch | null;
27
- declare function createFarmDeploymentMismatchResponse(mismatch: FarmDeploymentMismatch): Response;
28
- declare function withFarmDeploymentResponse(response: Response, deploymentId: string | undefined, options?: FarmDeploymentResponseOptions): Response;
29
- declare function getFarmResponseDeploymentId(response: Pick<Response, "headers">): string | undefined;
30
- declare function isFarmDeploymentMismatchResponse(response: Pick<Response, "headers" | "status">, clientDeploymentId: string | undefined): boolean;
31
- declare function createFarmDeploymentMismatchError(response: Pick<Response, "headers">, clientDeploymentId: string): FarmDeploymentMismatchError;
32
- declare function createFarmDeploymentCookie(deploymentId: string, path?: string, secure?: boolean): string;
33
-
34
- export { FARM_DEPLOYMENT_COOKIE, FARM_DEPLOYMENT_ID_HEADER, FARM_DEPLOYMENT_MISMATCH_CODE, FARM_DEPLOYMENT_MISMATCH_HEADER, FARM_DEPLOYMENT_MISMATCH_STATUS, type FarmDeploymentMismatch, FarmDeploymentMismatchError, type FarmDeploymentResponseOptions, createFarmDeploymentCookie, createFarmDeploymentMismatchError, createFarmDeploymentMismatchResponse, createFarmDeploymentRequestHeaders, getFarmDeploymentMismatch, getFarmRequestDeploymentId, getFarmResponseDeploymentId, isFarmDeploymentMismatchResponse, normalizeFarmDeploymentId, withFarmDeploymentResponse };
@@ -1,34 +0,0 @@
1
- declare const FARM_DEPLOYMENT_ID_HEADER = "x-farm-deployment-id";
2
- declare const FARM_DEPLOYMENT_MISMATCH_HEADER = "x-farm-deployment-mismatch";
3
- declare const FARM_DEPLOYMENT_COOKIE = "__farm_deployment";
4
- declare const FARM_DEPLOYMENT_MISMATCH_CODE = "FARM_DEPLOYMENT_MISMATCH";
5
- declare const FARM_DEPLOYMENT_MISMATCH_STATUS = 409;
6
- interface FarmDeploymentMismatch {
7
- clientDeploymentId: string;
8
- serverDeploymentId: string;
9
- }
10
- interface FarmDeploymentResponseOptions {
11
- setCookie?: boolean;
12
- cookiePath?: string;
13
- secureCookie?: boolean;
14
- }
15
- declare class FarmDeploymentMismatchError extends Error {
16
- readonly clientDeploymentId: string;
17
- readonly serverDeploymentId: string;
18
- readonly name = "FarmDeploymentMismatchError";
19
- readonly code = "FARM_DEPLOYMENT_MISMATCH";
20
- readonly retryable = false;
21
- constructor(clientDeploymentId: string, serverDeploymentId: string);
22
- }
23
- declare function normalizeFarmDeploymentId(value: unknown): string;
24
- declare function createFarmDeploymentRequestHeaders(deploymentId: string | undefined, init?: HeadersInit): Headers;
25
- declare function getFarmRequestDeploymentId(request: Pick<Request, "headers" | "method">): string | undefined;
26
- declare function getFarmDeploymentMismatch(request: Pick<Request, "headers" | "method">, serverDeploymentId: string | undefined): FarmDeploymentMismatch | null;
27
- declare function createFarmDeploymentMismatchResponse(mismatch: FarmDeploymentMismatch): Response;
28
- declare function withFarmDeploymentResponse(response: Response, deploymentId: string | undefined, options?: FarmDeploymentResponseOptions): Response;
29
- declare function getFarmResponseDeploymentId(response: Pick<Response, "headers">): string | undefined;
30
- declare function isFarmDeploymentMismatchResponse(response: Pick<Response, "headers" | "status">, clientDeploymentId: string | undefined): boolean;
31
- declare function createFarmDeploymentMismatchError(response: Pick<Response, "headers">, clientDeploymentId: string): FarmDeploymentMismatchError;
32
- declare function createFarmDeploymentCookie(deploymentId: string, path?: string, secure?: boolean): string;
33
-
34
- export { FARM_DEPLOYMENT_COOKIE, FARM_DEPLOYMENT_ID_HEADER, FARM_DEPLOYMENT_MISMATCH_CODE, FARM_DEPLOYMENT_MISMATCH_HEADER, FARM_DEPLOYMENT_MISMATCH_STATUS, type FarmDeploymentMismatch, FarmDeploymentMismatchError, type FarmDeploymentResponseOptions, createFarmDeploymentCookie, createFarmDeploymentMismatchError, createFarmDeploymentMismatchResponse, createFarmDeploymentRequestHeaders, getFarmDeploymentMismatch, getFarmRequestDeploymentId, getFarmResponseDeploymentId, isFarmDeploymentMismatchResponse, normalizeFarmDeploymentId, withFarmDeploymentResponse };
package/dist/docs.d.mts DELETED
@@ -1,69 +0,0 @@
1
- import { F as FarmDocsResolvedConfig, a as FarmDocsUserConfig } from './types-C9N-nk5R.mjs';
2
- export { b as FarmDocsConfigInput, c as FarmDocsNavigationConfig, d as FarmDocsSidebarItem } from './types-C9N-nk5R.mjs';
3
- import { DocsConfig } from '@farming-labs/docs';
4
-
5
- interface FarmDocsHandlerOptions {
6
- root: string;
7
- srcDir?: string;
8
- clientEntry?: string;
9
- }
10
- interface FarmDocsPage {
11
- slug: string;
12
- title: string;
13
- description?: string;
14
- section?: string;
15
- href: string;
16
- sourcePath: string;
17
- lastModified?: string;
18
- }
19
- interface LoadedFarmDocsPage extends FarmDocsPage {
20
- body: string;
21
- frontmatter: Record<string, string>;
22
- }
23
- declare function isFarmDocsRequest(docs: FarmDocsResolvedConfig | undefined, request: Request): boolean;
24
- declare function resolveFarmDocsContentDir(docs: FarmDocsResolvedConfig, options: FarmDocsHandlerOptions): string;
25
- declare function getFarmDocsRouteTypeEntries(docs: FarmDocsResolvedConfig | undefined): string[];
26
- declare function getFarmDocsDocumentNavigationMatchers(docs: FarmDocsResolvedConfig | undefined): string[];
27
- declare function loadFarmDocsPage(contentDir: string, docs: FarmDocsResolvedConfig, slug: string): LoadedFarmDocsPage | null;
28
- declare function discoverFarmDocsPages(contentDir: string, docs: FarmDocsResolvedConfig): FarmDocsPage[];
29
- declare function createFarmDocsHandler(docs: FarmDocsResolvedConfig | undefined, options: FarmDocsHandlerOptions): (request: Request) => Promise<Response | null>;
30
-
31
- interface FarmDocsAPIOptions {
32
- rootDir?: string;
33
- root?: string;
34
- srcDir?: string;
35
- docs?: FarmDocsUserConfig | FarmDocsResolvedConfig;
36
- config?: Partial<DocsConfig>;
37
- configPath?: string;
38
- entry?: string;
39
- docsPath?: string;
40
- contentDir?: string;
41
- }
42
- interface FarmDocsCloudRouteOptions {
43
- locale?: string;
44
- publicBaseUrl?: string;
45
- }
46
- interface FarmDocsCloudServer {
47
- handleRequest(request: Request, options?: FarmDocsCloudRouteOptions): Promise<Response>;
48
- }
49
- type FarmDocsCloudIntegration = FarmDocsCloudServer | (FarmDocsCloudRouteOptions & {
50
- docsCloud?: FarmDocsCloudServer;
51
- });
52
- interface FarmDocsAPIRouteHandlers {
53
- GET(request: Request): Promise<Response>;
54
- POST(request: Request): Promise<Response>;
55
- }
56
- type FarmDocsAPIHandler = (request: Request) => Promise<Response | null>;
57
- type FarmDocsRuntimeConfig = {
58
- root?: string;
59
- srcDir?: string;
60
- docs?: FarmDocsResolvedConfig;
61
- };
62
- declare global {
63
- var __FARM_DOCS_RUNTIME_CONFIG__: FarmDocsRuntimeConfig | undefined;
64
- }
65
- declare function isFarmDocsAPIRequest(requestOrPathname: Request | string): boolean;
66
- declare function createDocsAPI(options?: FarmDocsAPIOptions, cloudIntegration?: FarmDocsCloudIntegration): FarmDocsAPIRouteHandlers;
67
- declare function createFarmDocsAPIHandler(options?: FarmDocsAPIOptions, cloudIntegration?: FarmDocsCloudIntegration): FarmDocsAPIHandler;
68
-
69
- 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 DELETED
@@ -1,69 +0,0 @@
1
- import { F as FarmDocsResolvedConfig, a as FarmDocsUserConfig } from './types-C9N-nk5R.js';
2
- export { b as FarmDocsConfigInput, c as FarmDocsNavigationConfig, d as FarmDocsSidebarItem } from './types-C9N-nk5R.js';
3
- import { DocsConfig } from '@farming-labs/docs';
4
-
5
- interface FarmDocsHandlerOptions {
6
- root: string;
7
- srcDir?: string;
8
- clientEntry?: string;
9
- }
10
- interface FarmDocsPage {
11
- slug: string;
12
- title: string;
13
- description?: string;
14
- section?: string;
15
- href: string;
16
- sourcePath: string;
17
- lastModified?: string;
18
- }
19
- interface LoadedFarmDocsPage extends FarmDocsPage {
20
- body: string;
21
- frontmatter: Record<string, string>;
22
- }
23
- declare function isFarmDocsRequest(docs: FarmDocsResolvedConfig | undefined, request: Request): boolean;
24
- declare function resolveFarmDocsContentDir(docs: FarmDocsResolvedConfig, options: FarmDocsHandlerOptions): string;
25
- declare function getFarmDocsRouteTypeEntries(docs: FarmDocsResolvedConfig | undefined): string[];
26
- declare function getFarmDocsDocumentNavigationMatchers(docs: FarmDocsResolvedConfig | undefined): string[];
27
- declare function loadFarmDocsPage(contentDir: string, docs: FarmDocsResolvedConfig, slug: string): LoadedFarmDocsPage | null;
28
- declare function discoverFarmDocsPages(contentDir: string, docs: FarmDocsResolvedConfig): FarmDocsPage[];
29
- declare function createFarmDocsHandler(docs: FarmDocsResolvedConfig | undefined, options: FarmDocsHandlerOptions): (request: Request) => Promise<Response | null>;
30
-
31
- interface FarmDocsAPIOptions {
32
- rootDir?: string;
33
- root?: string;
34
- srcDir?: string;
35
- docs?: FarmDocsUserConfig | FarmDocsResolvedConfig;
36
- config?: Partial<DocsConfig>;
37
- configPath?: string;
38
- entry?: string;
39
- docsPath?: string;
40
- contentDir?: string;
41
- }
42
- interface FarmDocsCloudRouteOptions {
43
- locale?: string;
44
- publicBaseUrl?: string;
45
- }
46
- interface FarmDocsCloudServer {
47
- handleRequest(request: Request, options?: FarmDocsCloudRouteOptions): Promise<Response>;
48
- }
49
- type FarmDocsCloudIntegration = FarmDocsCloudServer | (FarmDocsCloudRouteOptions & {
50
- docsCloud?: FarmDocsCloudServer;
51
- });
52
- interface FarmDocsAPIRouteHandlers {
53
- GET(request: Request): Promise<Response>;
54
- POST(request: Request): Promise<Response>;
55
- }
56
- type FarmDocsAPIHandler = (request: Request) => Promise<Response | null>;
57
- type FarmDocsRuntimeConfig = {
58
- root?: string;
59
- srcDir?: string;
60
- docs?: FarmDocsResolvedConfig;
61
- };
62
- declare global {
63
- var __FARM_DOCS_RUNTIME_CONFIG__: FarmDocsRuntimeConfig | undefined;
64
- }
65
- declare function isFarmDocsAPIRequest(requestOrPathname: Request | string): boolean;
66
- declare function createDocsAPI(options?: FarmDocsAPIOptions, cloudIntegration?: FarmDocsCloudIntegration): FarmDocsAPIRouteHandlers;
67
- declare function createFarmDocsAPIHandler(options?: FarmDocsAPIOptions, cloudIntegration?: FarmDocsCloudIntegration): FarmDocsAPIHandler;
68
-
69
- 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 };
@@ -1,12 +0,0 @@
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 };
@@ -1,12 +0,0 @@
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 DELETED
@@ -1,45 +0,0 @@
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 DELETED
@@ -1,45 +0,0 @@
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 };
@@ -1,22 +0,0 @@
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 };
@@ -1,22 +0,0 @@
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 };
@@ -1,18 +0,0 @@
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 };
@@ -1,18 +0,0 @@
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 };
package/dist/font.d.mts DELETED
@@ -1,70 +0,0 @@
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
- }
59
- /**
60
- * Compile local font files into hashed application assets and generated CSS.
61
- * The call is removed at build time and adds no font-loader runtime code.
62
- */
63
- declare function localFont(_options: LocalFontOptions): FarmFont;
64
- /**
65
- * Compile a remote font into a self-hosted application asset by default.
66
- * Use `strategy: "external"` only when the browser should retain the remote URL.
67
- */
68
- declare function remoteFont(_options: RemoteFontOptions): FarmFont;
69
-
70
- export { type FarmFont, type FarmFontDisplay, type FarmFontOptions, type FarmFontSource, type LocalFontOptions, type RemoteFontOptions, type RemoteFontSource, localFont, remoteFont };
package/dist/font.d.ts DELETED
@@ -1,70 +0,0 @@
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
- }
59
- /**
60
- * Compile local font files into hashed application assets and generated CSS.
61
- * The call is removed at build time and adds no font-loader runtime code.
62
- */
63
- declare function localFont(_options: LocalFontOptions): FarmFont;
64
- /**
65
- * Compile a remote font into a self-hosted application asset by default.
66
- * Use `strategy: "external"` only when the browser should retain the remote URL.
67
- */
68
- declare function remoteFont(_options: RemoteFontOptions): FarmFont;
69
-
70
- export { type FarmFont, type FarmFontDisplay, type FarmFontOptions, type FarmFontSource, type LocalFontOptions, type RemoteFontOptions, type RemoteFontSource, localFont, remoteFont };