@farm.js/core 0.1.0-beta.11 → 0.1.0-beta.13
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.
- package/dist/{chunk-5EVQFRL2.mjs → chunk-3WIRO3N7.mjs} +2 -2
- package/dist/chunk-3WIRO3N7.mjs.map +1 -0
- package/dist/chunk-53MVSX3R.mjs +168 -0
- package/dist/chunk-53MVSX3R.mjs.map +1 -0
- package/dist/{chunk-AW6I64AP.mjs → chunk-6ZXIQSXE.mjs} +16 -1
- package/dist/chunk-6ZXIQSXE.mjs.map +1 -0
- package/dist/chunk-7ZVN3YZI.mjs +333 -0
- package/dist/chunk-7ZVN3YZI.mjs.map +1 -0
- package/dist/{chunk-7N62DNSO.mjs → chunk-H3TE3LOV.mjs} +2 -2
- package/dist/{chunk-QTZZ2ISQ.mjs → chunk-KLA67WKG.mjs} +1 -1
- package/dist/chunk-KLA67WKG.mjs.map +1 -0
- package/dist/{chunk-K5ZTUF22.mjs → chunk-L2PE36GQ.mjs} +7 -3
- package/dist/chunk-L2PE36GQ.mjs.map +1 -0
- package/dist/{chunk-4LND3PXF.mjs → chunk-OPHK6OJN.mjs} +513 -48
- package/dist/chunk-OPHK6OJN.mjs.map +1 -0
- package/dist/chunk-USLFXFFH.mjs +46 -0
- package/dist/chunk-USLFXFFH.mjs.map +1 -0
- package/dist/{chunk-4677KXB7.mjs → chunk-VSDZEB5M.mjs} +368 -103
- package/dist/chunk-VSDZEB5M.mjs.map +1 -0
- package/dist/{chunk-77BOAQHI.mjs → chunk-Z3YG4OZT.mjs} +725 -147
- package/dist/chunk-Z3YG4OZT.mjs.map +1 -0
- package/dist/client.cjs.map +1 -1
- package/dist/client.mjs +1 -1
- package/dist/{devtools-A22KUJZT.mjs → devtools-GAZ7F3KL.mjs} +4 -3
- package/dist/{devtools-A22KUJZT.mjs.map → devtools-GAZ7F3KL.mjs.map} +1 -1
- package/dist/docs.cjs +622 -124
- package/dist/docs.cjs.map +1 -1
- package/dist/docs.mjs +5 -3
- package/dist/font.cjs +19 -2
- package/dist/font.cjs.map +1 -1
- package/dist/font.mjs +7 -3
- package/dist/index.cjs +2206 -680
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +27 -19
- package/dist/index.mjs.map +1 -1
- package/dist/internal/build-runtime.cjs +2033 -516
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.mjs +13 -10
- package/dist/internal/client-runtime.cjs +169 -2
- package/dist/internal/client-runtime.cjs.map +1 -1
- package/dist/internal/client-runtime.mjs +170 -2
- package/dist/internal/client-runtime.mjs.map +1 -1
- package/dist/internal/config-runtime.cjs +22 -0
- package/dist/internal/config-runtime.cjs.map +1 -1
- package/dist/internal/config-runtime.mjs +3 -2
- package/dist/internal/metadata-image-runtime.cjs +199 -0
- package/dist/internal/metadata-image-runtime.cjs.map +1 -0
- package/dist/internal/metadata-image-runtime.mjs +8 -0
- package/dist/internal/metadata-image-runtime.mjs.map +1 -0
- package/dist/internal/production-runtime.cjs +310 -0
- package/dist/internal/production-runtime.cjs.map +1 -1
- package/dist/internal/production-runtime.mjs +10 -0
- package/dist/internal/production-runtime.mjs.map +1 -1
- package/dist/navigation.cjs.map +1 -1
- package/dist/navigation.mjs +2 -2
- package/dist/plugin.cjs +1521 -339
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.mjs +9 -5
- package/dist/server.cjs +1634 -410
- package/dist/server.cjs.map +1 -1
- package/dist/server.mjs +17 -19
- package/dist/server.mjs.map +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +1575 -349
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +9 -5
- package/package.json +10 -1
- package/dist/after.d.mts +0 -25
- package/dist/after.d.ts +0 -25
- package/dist/agent-runtime.d.mts +0 -94
- package/dist/agent-runtime.d.ts +0 -94
- package/dist/api/route-manager.d.mts +0 -66
- package/dist/api/route-manager.d.ts +0 -66
- package/dist/api/runtime.d.mts +0 -3
- package/dist/api/runtime.d.ts +0 -3
- package/dist/api.d.mts +0 -48
- package/dist/api.d.ts +0 -48
- package/dist/app-BNE2FoZ4.d.mts +0 -302
- package/dist/app-DRGUmJ3s.d.ts +0 -302
- package/dist/app-markdown.d.mts +0 -22
- package/dist/app-markdown.d.ts +0 -22
- package/dist/cache.d.mts +0 -192
- package/dist/cache.d.ts +0 -192
- package/dist/chunk-4677KXB7.mjs.map +0 -1
- package/dist/chunk-4LND3PXF.mjs.map +0 -1
- package/dist/chunk-5EVQFRL2.mjs.map +0 -1
- package/dist/chunk-77BOAQHI.mjs.map +0 -1
- package/dist/chunk-AW6I64AP.mjs.map +0 -1
- package/dist/chunk-K5ZTUF22.mjs.map +0 -1
- package/dist/chunk-QM746KUO.mjs +0 -56
- package/dist/chunk-QM746KUO.mjs.map +0 -1
- package/dist/chunk-QTZZ2ISQ.mjs.map +0 -1
- package/dist/client-BT1mFQas.d.mts +0 -447
- package/dist/client-Nn0q4eO4.d.ts +0 -447
- package/dist/client-cache-CIlyBlmx.d.ts +0 -6
- package/dist/client-cache-D-EZ7XVW.d.mts +0 -6
- package/dist/client-plugins-Bc5jHcNr.d.ts +0 -1927
- package/dist/client-plugins-jsk-ZLzJ.d.mts +0 -1927
- package/dist/client-plugins.d.mts +0 -22
- package/dist/client-plugins.d.ts +0 -22
- package/dist/client.d.mts +0 -447
- package/dist/client.d.ts +0 -447
- package/dist/config.d.mts +0 -29
- package/dist/config.d.ts +0 -29
- package/dist/cron.d.mts +0 -78
- package/dist/cron.d.ts +0 -78
- package/dist/deferred.d.mts +0 -42
- package/dist/deferred.d.ts +0 -42
- package/dist/deployment.d.mts +0 -34
- package/dist/deployment.d.ts +0 -34
- package/dist/docs.d.mts +0 -69
- package/dist/docs.d.ts +0 -69
- package/dist/env-types.d.mts +0 -12
- package/dist/env-types.d.ts +0 -12
- package/dist/env.d.mts +0 -45
- package/dist/env.d.ts +0 -45
- package/dist/environment/vite.d.mts +0 -22
- package/dist/environment/vite.d.ts +0 -22
- package/dist/environment.d.mts +0 -18
- package/dist/environment.d.ts +0 -18
- package/dist/font.d.mts +0 -70
- package/dist/font.d.ts +0 -70
- package/dist/headers.d.mts +0 -22
- package/dist/headers.d.ts +0 -22
- package/dist/i18n/client.d.mts +0 -32
- package/dist/i18n/client.d.ts +0 -32
- package/dist/i18n/index.d.mts +0 -20
- package/dist/i18n/index.d.ts +0 -20
- package/dist/i18n/server.d.mts +0 -30
- package/dist/i18n/server.d.ts +0 -30
- package/dist/image/server.d.mts +0 -37
- package/dist/image/server.d.ts +0 -37
- package/dist/image/sharp.d.mts +0 -7
- package/dist/image/sharp.d.ts +0 -7
- package/dist/image-config-Duob7wER.d.mts +0 -50
- package/dist/image-config-Duob7wER.d.ts +0 -50
- package/dist/image.d.mts +0 -39
- package/dist/image.d.ts +0 -39
- package/dist/index.d.mts +0 -455
- package/dist/index.d.ts +0 -455
- package/dist/integration-api-CHT2OKAf.d.mts +0 -93
- package/dist/integration-api-CHT2OKAf.d.ts +0 -93
- package/dist/integrations.d.mts +0 -22
- package/dist/integrations.d.ts +0 -22
- package/dist/internal/build-runtime.d.mts +0 -39
- package/dist/internal/build-runtime.d.ts +0 -39
- package/dist/internal/client-runtime.d.mts +0 -2
- package/dist/internal/client-runtime.d.ts +0 -2
- package/dist/internal/config-runtime.d.mts +0 -39
- package/dist/internal/config-runtime.d.ts +0 -39
- package/dist/internal/production-node-env.d.mts +0 -12
- package/dist/internal/production-node-env.d.ts +0 -12
- package/dist/internal/production-runtime.d.mts +0 -41
- package/dist/internal/production-runtime.d.ts +0 -41
- package/dist/markdown.d.mts +0 -60
- package/dist/markdown.d.ts +0 -60
- package/dist/metadata-7ffpT3jr.d.mts +0 -22
- package/dist/metadata-JHn-8eht.d.ts +0 -22
- package/dist/middleware.d.mts +0 -164
- package/dist/middleware.d.ts +0 -164
- package/dist/navigation-errors-Dvwpzaer.d.mts +0 -13
- package/dist/navigation-errors-Dvwpzaer.d.ts +0 -13
- package/dist/navigation.d.mts +0 -14
- package/dist/navigation.d.ts +0 -14
- package/dist/observability.d.mts +0 -335
- package/dist/observability.d.ts +0 -335
- package/dist/params-BALtrRim.d.ts +0 -15
- package/dist/params-ry-lxqmy.d.mts +0 -15
- package/dist/plugin-BJDf43dc.d.mts +0 -165
- package/dist/plugin-BJDf43dc.d.ts +0 -165
- package/dist/plugin.d.mts +0 -22
- package/dist/plugin.d.ts +0 -22
- package/dist/production-runtime-9KG7GuvW.d.ts +0 -79
- package/dist/production-runtime-B-fweKts.d.mts +0 -79
- package/dist/production-runtime-C_B79w2P.d.mts +0 -28
- package/dist/production-runtime-DDEM1D2q.d.ts +0 -28
- package/dist/query/client.d.mts +0 -61
- package/dist/query/client.d.ts +0 -61
- package/dist/query/index.d.mts +0 -90
- package/dist/query/index.d.ts +0 -90
- package/dist/query/parsers.d.mts +0 -25
- package/dist/query/parsers.d.ts +0 -25
- package/dist/query/server.d.mts +0 -55
- package/dist/query/server.d.ts +0 -55
- package/dist/request-Dsq4kGW0.d.mts +0 -6
- package/dist/request-udtobOLv.d.ts +0 -6
- package/dist/request.d.mts +0 -2
- package/dist/request.d.ts +0 -2
- package/dist/resolver-DJqjLMg_.d.mts +0 -14
- package/dist/resolver-IH4RmPEl.d.ts +0 -14
- package/dist/route-runtime-DoOHzCAD.d.mts +0 -38
- package/dist/route-runtime-DoOHzCAD.d.ts +0 -38
- package/dist/router.d.mts +0 -36
- package/dist/router.d.ts +0 -36
- package/dist/routes.d.mts +0 -224
- package/dist/routes.d.ts +0 -224
- package/dist/runtime-9nQjVM7X.d.mts +0 -206
- package/dist/runtime-Cxpq6xZN.d.mts +0 -27
- package/dist/runtime-DgeS2skB.d.ts +0 -206
- package/dist/runtime-bv63eUiO.d.ts +0 -27
- package/dist/server-action-security.d.mts +0 -43
- package/dist/server-action-security.d.ts +0 -43
- package/dist/server-fn-client.d.mts +0 -32
- package/dist/server-fn-client.d.ts +0 -32
- package/dist/server-fn.d.mts +0 -93
- package/dist/server-fn.d.ts +0 -93
- package/dist/server-plugins.d.mts +0 -55
- package/dist/server-plugins.d.ts +0 -55
- package/dist/server-query-client.d.mts +0 -50
- package/dist/server-query-client.d.ts +0 -50
- package/dist/server-query.d.mts +0 -36
- package/dist/server-query.d.ts +0 -36
- package/dist/server.d.mts +0 -48
- package/dist/server.d.ts +0 -48
- package/dist/storage.d.mts +0 -52
- package/dist/storage.d.ts +0 -52
- package/dist/testing.d.mts +0 -101
- package/dist/testing.d.ts +0 -101
- package/dist/transport-BmbGTXA5.d.mts +0 -49
- package/dist/transport-BmbGTXA5.d.ts +0 -49
- package/dist/types-BMxWr97v.d.mts +0 -81
- package/dist/types-BMxWr97v.d.ts +0 -81
- package/dist/types-C9N-nk5R.d.mts +0 -53
- package/dist/types-C9N-nk5R.d.ts +0 -53
- package/dist/types-D1A6-XvH.d.mts +0 -73
- package/dist/types-D1A6-XvH.d.ts +0 -73
- package/dist/utils-CA0z0c-2.d.ts +0 -23
- package/dist/utils-mYVkSOt2.d.mts +0 -23
- package/dist/version.d.mts +0 -3
- package/dist/version.d.ts +0 -3
- package/dist/vite.d.mts +0 -22
- package/dist/vite.d.ts +0 -22
- package/dist/workflows.d.mts +0 -110
- package/dist/workflows.d.ts +0 -110
- /package/dist/{chunk-7N62DNSO.mjs.map → chunk-H3TE3LOV.mjs.map} +0 -0
package/dist/query/client.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export { R as RouteParamsInput, l as loadRouteParams, p as parseRouteParams } from '../params-BALtrRim.js';
|
|
2
|
-
import { Parser } from './parsers.js';
|
|
3
|
-
export { asArrayOf, asBoolean, asFloat, asInteger, asIsoDate, asIsoDateTime, asJson, asString, createParser, inferParserType } from './parsers.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Farm.js Client-Side Query State Management
|
|
7
|
-
*
|
|
8
|
-
* Type-safe URL search parameter state management - Like useState, but stored in the URL query string.
|
|
9
|
-
* Client-only hooks for managing query parameters in the browser.
|
|
10
|
-
* Inspired by nuqs implementation patterns.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
type UrlUpdateType = "push" | "replace";
|
|
14
|
-
type HistoryMethod = "pushState" | "replaceState";
|
|
15
|
-
interface Options {
|
|
16
|
-
history?: HistoryMethod;
|
|
17
|
-
shallow?: boolean;
|
|
18
|
-
scroll?: boolean;
|
|
19
|
-
throttleMs?: number;
|
|
20
|
-
}
|
|
21
|
-
declare function useQueryState<TParser extends Parser<any>>(key: string, parser: TParser, options?: Options): [
|
|
22
|
-
NonNullable<ReturnType<TParser["parse"]>> | null,
|
|
23
|
-
(value: NonNullable<ReturnType<TParser["parse"]>> | null) => void
|
|
24
|
-
];
|
|
25
|
-
declare function useQueryState<T>(key: string, parser: Parser<T>, options?: Options): [T | null, (value: T | null) => void];
|
|
26
|
-
declare function useQueryStates<T extends Record<string, Parser<any>>>(parsers: T, options?: Options): [
|
|
27
|
-
{
|
|
28
|
-
[K in keyof T]: ReturnType<T[K]["parse"]>;
|
|
29
|
-
},
|
|
30
|
-
(updates: Partial<{
|
|
31
|
-
[K in keyof T]: ReturnType<T[K]["parse"]> | null;
|
|
32
|
-
}>) => void
|
|
33
|
-
];
|
|
34
|
-
declare function usePagination(options?: {
|
|
35
|
-
defaultPage?: number;
|
|
36
|
-
defaultLimit?: number;
|
|
37
|
-
pageKey?: string;
|
|
38
|
-
limitKey?: string;
|
|
39
|
-
}): {
|
|
40
|
-
page: number;
|
|
41
|
-
setPage: (value: number | null) => void;
|
|
42
|
-
limit: number;
|
|
43
|
-
setLimit: (value: number | null) => void;
|
|
44
|
-
offset: number;
|
|
45
|
-
resetPagination: () => void;
|
|
46
|
-
};
|
|
47
|
-
declare function useSearchFilters<T extends Record<string, any>>(options?: {
|
|
48
|
-
searchKey?: string;
|
|
49
|
-
defaultFilters?: T;
|
|
50
|
-
filterKeys?: (keyof T)[];
|
|
51
|
-
}): {
|
|
52
|
-
search: string | null;
|
|
53
|
-
setSearch: (value: string | null) => void;
|
|
54
|
-
filters: T;
|
|
55
|
-
setFilters: (updates: Partial<{
|
|
56
|
-
[x: string]: string | null;
|
|
57
|
-
}>) => void;
|
|
58
|
-
clearFilters: () => void;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export { type HistoryMethod, type Options, Parser, type UrlUpdateType, usePagination, useQueryState, useQueryStates, useSearchFilters };
|
package/dist/query/index.d.mts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
export { Parser, asArrayOf, asBoolean, asFloat, asInteger, asIsoDate, asIsoDateTime, asJson, asString, createParser, inferParserType } from './parsers.mjs';
|
|
2
|
-
export { R as RouteParamsInput, l as loadRouteParams, p as parseRouteParams } from '../params-ry-lxqmy.mjs';
|
|
3
|
-
import { ReactNode, ComponentType } from 'react';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Farm.js Query State Types
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Props for Farm.js page components with search params
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Props for Farm.js layout components
|
|
14
|
-
*/
|
|
15
|
-
interface LayoutPropsSafe {
|
|
16
|
-
children: ReactNode;
|
|
17
|
-
params: Record<string, string>;
|
|
18
|
-
}
|
|
19
|
-
interface PagePropsSafe {
|
|
20
|
-
params: Record<string, string>;
|
|
21
|
-
searchParams: Promise<URLSearchParams | Record<string, string | string[] | undefined>>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Query state configuration for Farm.js
|
|
25
|
-
*/
|
|
26
|
-
interface QueryStateConfig {
|
|
27
|
-
/**
|
|
28
|
-
* Default history method for URL updates
|
|
29
|
-
* @default 'push'
|
|
30
|
-
*/
|
|
31
|
-
defaultHistoryMethod?: "push" | "replace";
|
|
32
|
-
/**
|
|
33
|
-
* Default shallow routing behavior
|
|
34
|
-
* @default true
|
|
35
|
-
*/
|
|
36
|
-
shallow?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Default scroll behavior
|
|
39
|
-
* @default true
|
|
40
|
-
*/
|
|
41
|
-
scroll?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Custom serialization options
|
|
44
|
-
*/
|
|
45
|
-
serialization?: {
|
|
46
|
-
/**
|
|
47
|
-
* Custom URL key mappings
|
|
48
|
-
*/
|
|
49
|
-
urlKeys?: Record<string, string>;
|
|
50
|
-
/**
|
|
51
|
-
* Custom base URL for serialization
|
|
52
|
-
*/
|
|
53
|
-
baseUrl?: string;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Farm.js specific query state context
|
|
58
|
-
*/
|
|
59
|
-
interface FarmQueryStateContext {
|
|
60
|
-
/**
|
|
61
|
-
* Current search parameters
|
|
62
|
-
*/
|
|
63
|
-
searchParams: URLSearchParams;
|
|
64
|
-
/**
|
|
65
|
-
* Current pathname
|
|
66
|
-
*/
|
|
67
|
-
pathname: string;
|
|
68
|
-
/**
|
|
69
|
-
* Update URL with new search parameters
|
|
70
|
-
*/
|
|
71
|
-
updateUrl: (params: Record<string, any>, options?: {
|
|
72
|
-
method?: "push" | "replace";
|
|
73
|
-
shallow?: boolean;
|
|
74
|
-
scroll?: boolean;
|
|
75
|
-
}) => void;
|
|
76
|
-
/**
|
|
77
|
-
* Clear all search parameters
|
|
78
|
-
*/
|
|
79
|
-
clearParams: () => void;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Higher-order component for providing query state context
|
|
83
|
-
*/
|
|
84
|
-
type QueryStateProvider = ComponentType<{
|
|
85
|
-
children: ReactNode;
|
|
86
|
-
searchParams?: URLSearchParams;
|
|
87
|
-
pathname?: string;
|
|
88
|
-
}>;
|
|
89
|
-
|
|
90
|
-
export type { FarmQueryStateContext, LayoutPropsSafe, PagePropsSafe, QueryStateConfig, QueryStateProvider };
|
package/dist/query/index.d.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
export { Parser, asArrayOf, asBoolean, asFloat, asInteger, asIsoDate, asIsoDateTime, asJson, asString, createParser, inferParserType } from './parsers.js';
|
|
2
|
-
export { R as RouteParamsInput, l as loadRouteParams, p as parseRouteParams } from '../params-BALtrRim.js';
|
|
3
|
-
import { ReactNode, ComponentType } from 'react';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Farm.js Query State Types
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Props for Farm.js page components with search params
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Props for Farm.js layout components
|
|
14
|
-
*/
|
|
15
|
-
interface LayoutPropsSafe {
|
|
16
|
-
children: ReactNode;
|
|
17
|
-
params: Record<string, string>;
|
|
18
|
-
}
|
|
19
|
-
interface PagePropsSafe {
|
|
20
|
-
params: Record<string, string>;
|
|
21
|
-
searchParams: Promise<URLSearchParams | Record<string, string | string[] | undefined>>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Query state configuration for Farm.js
|
|
25
|
-
*/
|
|
26
|
-
interface QueryStateConfig {
|
|
27
|
-
/**
|
|
28
|
-
* Default history method for URL updates
|
|
29
|
-
* @default 'push'
|
|
30
|
-
*/
|
|
31
|
-
defaultHistoryMethod?: "push" | "replace";
|
|
32
|
-
/**
|
|
33
|
-
* Default shallow routing behavior
|
|
34
|
-
* @default true
|
|
35
|
-
*/
|
|
36
|
-
shallow?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Default scroll behavior
|
|
39
|
-
* @default true
|
|
40
|
-
*/
|
|
41
|
-
scroll?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Custom serialization options
|
|
44
|
-
*/
|
|
45
|
-
serialization?: {
|
|
46
|
-
/**
|
|
47
|
-
* Custom URL key mappings
|
|
48
|
-
*/
|
|
49
|
-
urlKeys?: Record<string, string>;
|
|
50
|
-
/**
|
|
51
|
-
* Custom base URL for serialization
|
|
52
|
-
*/
|
|
53
|
-
baseUrl?: string;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Farm.js specific query state context
|
|
58
|
-
*/
|
|
59
|
-
interface FarmQueryStateContext {
|
|
60
|
-
/**
|
|
61
|
-
* Current search parameters
|
|
62
|
-
*/
|
|
63
|
-
searchParams: URLSearchParams;
|
|
64
|
-
/**
|
|
65
|
-
* Current pathname
|
|
66
|
-
*/
|
|
67
|
-
pathname: string;
|
|
68
|
-
/**
|
|
69
|
-
* Update URL with new search parameters
|
|
70
|
-
*/
|
|
71
|
-
updateUrl: (params: Record<string, any>, options?: {
|
|
72
|
-
method?: "push" | "replace";
|
|
73
|
-
shallow?: boolean;
|
|
74
|
-
scroll?: boolean;
|
|
75
|
-
}) => void;
|
|
76
|
-
/**
|
|
77
|
-
* Clear all search parameters
|
|
78
|
-
*/
|
|
79
|
-
clearParams: () => void;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Higher-order component for providing query state context
|
|
83
|
-
*/
|
|
84
|
-
type QueryStateProvider = ComponentType<{
|
|
85
|
-
children: ReactNode;
|
|
86
|
-
searchParams?: URLSearchParams;
|
|
87
|
-
pathname?: string;
|
|
88
|
-
}>;
|
|
89
|
-
|
|
90
|
-
export type { FarmQueryStateContext, LayoutPropsSafe, PagePropsSafe, QueryStateConfig, QueryStateProvider };
|
package/dist/query/parsers.d.mts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Farm.js Query State Parsers
|
|
3
|
-
*
|
|
4
|
-
* Shared parsers that can be used in both client and server contexts
|
|
5
|
-
*/
|
|
6
|
-
interface Parser<T> {
|
|
7
|
-
parse: (value: string) => T | null;
|
|
8
|
-
serialize: (value: T) => string;
|
|
9
|
-
withDefault?: (defaultValue: T) => Parser<T>;
|
|
10
|
-
}
|
|
11
|
-
declare const asString: Parser<string>;
|
|
12
|
-
declare const asInteger: Parser<number>;
|
|
13
|
-
declare const asFloat: Parser<number>;
|
|
14
|
-
declare const asBoolean: Parser<boolean>;
|
|
15
|
-
declare function asArrayOf<T>(itemParser: Parser<T>): Parser<T[]>;
|
|
16
|
-
declare function asJson<T>(): Parser<T>;
|
|
17
|
-
declare const asIsoDate: Parser<Date>;
|
|
18
|
-
declare const asIsoDateTime: Parser<Date>;
|
|
19
|
-
declare function createParser<T>(config: {
|
|
20
|
-
parse: (value: string) => T | null;
|
|
21
|
-
serialize: (value: T) => string;
|
|
22
|
-
}): Parser<T>;
|
|
23
|
-
type inferParserType<T> = T extends Parser<infer U> ? U : never;
|
|
24
|
-
|
|
25
|
-
export { type Parser, asArrayOf, asBoolean, asFloat, asInteger, asIsoDate, asIsoDateTime, asJson, asString, createParser, type inferParserType };
|
package/dist/query/parsers.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Farm.js Query State Parsers
|
|
3
|
-
*
|
|
4
|
-
* Shared parsers that can be used in both client and server contexts
|
|
5
|
-
*/
|
|
6
|
-
interface Parser<T> {
|
|
7
|
-
parse: (value: string) => T | null;
|
|
8
|
-
serialize: (value: T) => string;
|
|
9
|
-
withDefault?: (defaultValue: T) => Parser<T>;
|
|
10
|
-
}
|
|
11
|
-
declare const asString: Parser<string>;
|
|
12
|
-
declare const asInteger: Parser<number>;
|
|
13
|
-
declare const asFloat: Parser<number>;
|
|
14
|
-
declare const asBoolean: Parser<boolean>;
|
|
15
|
-
declare function asArrayOf<T>(itemParser: Parser<T>): Parser<T[]>;
|
|
16
|
-
declare function asJson<T>(): Parser<T>;
|
|
17
|
-
declare const asIsoDate: Parser<Date>;
|
|
18
|
-
declare const asIsoDateTime: Parser<Date>;
|
|
19
|
-
declare function createParser<T>(config: {
|
|
20
|
-
parse: (value: string) => T | null;
|
|
21
|
-
serialize: (value: T) => string;
|
|
22
|
-
}): Parser<T>;
|
|
23
|
-
type inferParserType<T> = T extends Parser<infer U> ? U : never;
|
|
24
|
-
|
|
25
|
-
export { type Parser, asArrayOf, asBoolean, asFloat, asInteger, asIsoDate, asIsoDateTime, asJson, asString, createParser, type inferParserType };
|
package/dist/query/server.d.mts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Parser } from './parsers.mjs';
|
|
2
|
-
export { asArrayOf, asBoolean, asFloat, asInteger, asIsoDate, asIsoDateTime, asJson, asString, createParser, inferParserType } from './parsers.mjs';
|
|
3
|
-
export { R as RouteParamsInput, l as loadRouteParams, p as parseRouteParams } from '../params-ry-lxqmy.mjs';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Farm.js Server-Side Query State Management
|
|
7
|
-
*
|
|
8
|
-
* Server-side utilities for parsing and handling URL search parameters
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
type SearchParams = Record<string, string | string[] | undefined>;
|
|
12
|
-
/**
|
|
13
|
-
* Server-side utility to load and parse search parameters
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```tsx
|
|
17
|
-
* // In a server component
|
|
18
|
-
* import { loadSearchParams, parseAsString, parseAsInteger } from 'farm/query/server';
|
|
19
|
-
*
|
|
20
|
-
* export default async function MyPage({ searchParams }: PageProps) {
|
|
21
|
-
* const params = await loadSearchParams(searchParams, {
|
|
22
|
-
* search: parseAsString.withDefault!(''),
|
|
23
|
-
* page: parseAsInteger.withDefault!(1),
|
|
24
|
-
* });
|
|
25
|
-
*
|
|
26
|
-
* return <div>Search: {params.search}, Page: {params.page}</div>;
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
declare function loadSearchParams<T extends Record<string, Parser<any>>>(searchParams: Promise<URLSearchParams | Record<string, string | string[] | undefined>>, parsers: T): Promise<{
|
|
31
|
-
[K in keyof T]: ReturnType<T[K]["parse"]>;
|
|
32
|
-
}>;
|
|
33
|
-
/**
|
|
34
|
-
* Creates pagination metadata for server components.
|
|
35
|
-
*
|
|
36
|
-
* @param searchParams The search parameters promise.
|
|
37
|
-
* @param options Configuration options for pagination.
|
|
38
|
-
* @returns Pagination metadata.
|
|
39
|
-
*/
|
|
40
|
-
declare function createPaginationMeta(searchParams: Promise<URLSearchParams | Record<string, string | string[] | undefined>>, options: {
|
|
41
|
-
totalItems: number;
|
|
42
|
-
itemsPerPage?: number;
|
|
43
|
-
pageParam?: string;
|
|
44
|
-
}): Promise<{
|
|
45
|
-
currentPage: number;
|
|
46
|
-
itemsPerPage: number;
|
|
47
|
-
totalItems: number;
|
|
48
|
-
totalPages: number;
|
|
49
|
-
offset: number;
|
|
50
|
-
limit: number;
|
|
51
|
-
hasNextPage: boolean;
|
|
52
|
-
hasPreviousPage: boolean;
|
|
53
|
-
}>;
|
|
54
|
-
|
|
55
|
-
export { Parser, type SearchParams, createPaginationMeta, loadSearchParams };
|
package/dist/query/server.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Parser } from './parsers.js';
|
|
2
|
-
export { asArrayOf, asBoolean, asFloat, asInteger, asIsoDate, asIsoDateTime, asJson, asString, createParser, inferParserType } from './parsers.js';
|
|
3
|
-
export { R as RouteParamsInput, l as loadRouteParams, p as parseRouteParams } from '../params-BALtrRim.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Farm.js Server-Side Query State Management
|
|
7
|
-
*
|
|
8
|
-
* Server-side utilities for parsing and handling URL search parameters
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
type SearchParams = Record<string, string | string[] | undefined>;
|
|
12
|
-
/**
|
|
13
|
-
* Server-side utility to load and parse search parameters
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```tsx
|
|
17
|
-
* // In a server component
|
|
18
|
-
* import { loadSearchParams, parseAsString, parseAsInteger } from 'farm/query/server';
|
|
19
|
-
*
|
|
20
|
-
* export default async function MyPage({ searchParams }: PageProps) {
|
|
21
|
-
* const params = await loadSearchParams(searchParams, {
|
|
22
|
-
* search: parseAsString.withDefault!(''),
|
|
23
|
-
* page: parseAsInteger.withDefault!(1),
|
|
24
|
-
* });
|
|
25
|
-
*
|
|
26
|
-
* return <div>Search: {params.search}, Page: {params.page}</div>;
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
declare function loadSearchParams<T extends Record<string, Parser<any>>>(searchParams: Promise<URLSearchParams | Record<string, string | string[] | undefined>>, parsers: T): Promise<{
|
|
31
|
-
[K in keyof T]: ReturnType<T[K]["parse"]>;
|
|
32
|
-
}>;
|
|
33
|
-
/**
|
|
34
|
-
* Creates pagination metadata for server components.
|
|
35
|
-
*
|
|
36
|
-
* @param searchParams The search parameters promise.
|
|
37
|
-
* @param options Configuration options for pagination.
|
|
38
|
-
* @returns Pagination metadata.
|
|
39
|
-
*/
|
|
40
|
-
declare function createPaginationMeta(searchParams: Promise<URLSearchParams | Record<string, string | string[] | undefined>>, options: {
|
|
41
|
-
totalItems: number;
|
|
42
|
-
itemsPerPage?: number;
|
|
43
|
-
pageParam?: string;
|
|
44
|
-
}): Promise<{
|
|
45
|
-
currentPage: number;
|
|
46
|
-
itemsPerPage: number;
|
|
47
|
-
totalItems: number;
|
|
48
|
-
totalPages: number;
|
|
49
|
-
offset: number;
|
|
50
|
-
limit: number;
|
|
51
|
-
hasNextPage: boolean;
|
|
52
|
-
hasPreviousPage: boolean;
|
|
53
|
-
}>;
|
|
54
|
-
|
|
55
|
-
export { Parser, type SearchParams, createPaginationMeta, loadSearchParams };
|
package/dist/request.d.mts
DELETED
package/dist/request.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { b as FarmI18nLocaleSource, R as ResolvedFarmI18nConfig } from './types-BMxWr97v.mjs';
|
|
2
|
-
|
|
3
|
-
interface FarmLocaleResolution {
|
|
4
|
-
locale: string;
|
|
5
|
-
source: FarmI18nLocaleSource;
|
|
6
|
-
pathname: string;
|
|
7
|
-
redirect?: string;
|
|
8
|
-
persist: boolean;
|
|
9
|
-
}
|
|
10
|
-
declare function getFarmLocaleVaryHeaders(config: ResolvedFarmI18nConfig, resolution: FarmLocaleResolution): string[];
|
|
11
|
-
declare function createFarmLocaleCookie(locale: string, config: Pick<ResolvedFarmI18nConfig, "cookie">): string;
|
|
12
|
-
declare function matchFarmLocale(requested: string | null | undefined, locales: readonly string[]): string | undefined;
|
|
13
|
-
|
|
14
|
-
export { type FarmLocaleResolution as F, createFarmLocaleCookie as c, getFarmLocaleVaryHeaders as g, matchFarmLocale as m };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { b as FarmI18nLocaleSource, R as ResolvedFarmI18nConfig } from './types-BMxWr97v.js';
|
|
2
|
-
|
|
3
|
-
interface FarmLocaleResolution {
|
|
4
|
-
locale: string;
|
|
5
|
-
source: FarmI18nLocaleSource;
|
|
6
|
-
pathname: string;
|
|
7
|
-
redirect?: string;
|
|
8
|
-
persist: boolean;
|
|
9
|
-
}
|
|
10
|
-
declare function getFarmLocaleVaryHeaders(config: ResolvedFarmI18nConfig, resolution: FarmLocaleResolution): string[];
|
|
11
|
-
declare function createFarmLocaleCookie(locale: string, config: Pick<ResolvedFarmI18nConfig, "cookie">): string;
|
|
12
|
-
declare function matchFarmLocale(requested: string | null | undefined, locales: readonly string[]): string | undefined;
|
|
13
|
-
|
|
14
|
-
export { type FarmLocaleResolution as F, createFarmLocaleCookie as c, getFarmLocaleVaryHeaders as g, matchFarmLocale as m };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
type FarmRouteRuntime = "auto" | "node" | "edge";
|
|
2
|
-
type FarmRouteRegions = "auto" | readonly string[];
|
|
3
|
-
type FarmRouteMaxDuration = "auto" | number;
|
|
4
|
-
/** Portable execution controls shared by file, programmatic, and config routes. */
|
|
5
|
-
interface FarmRouteRuntimeConfig {
|
|
6
|
-
runtime?: FarmRouteRuntime;
|
|
7
|
-
regions?: FarmRouteRegions;
|
|
8
|
-
maxDuration?: FarmRouteMaxDuration;
|
|
9
|
-
}
|
|
10
|
-
interface ResolvedFarmRouteRuntimeConfig {
|
|
11
|
-
runtime: FarmRouteRuntime;
|
|
12
|
-
regions?: string[];
|
|
13
|
-
maxDuration?: number;
|
|
14
|
-
}
|
|
15
|
-
type FarmRouteRuntimeEntryKind = "page" | "api" | "rule";
|
|
16
|
-
type FarmRouteRenderingMode = "static" | "dynamic";
|
|
17
|
-
interface FarmRouteRuntimeManifestEntry extends ResolvedFarmRouteRuntimeConfig {
|
|
18
|
-
kind: FarmRouteRuntimeEntryKind;
|
|
19
|
-
pattern: string;
|
|
20
|
-
rendering: FarmRouteRenderingMode;
|
|
21
|
-
source?: string;
|
|
22
|
-
}
|
|
23
|
-
interface FarmRouteRuntimeManifest {
|
|
24
|
-
version: 1;
|
|
25
|
-
routes: FarmRouteRuntimeManifestEntry[];
|
|
26
|
-
}
|
|
27
|
-
declare function normalizeFarmRouteRuntimeConfig(value: FarmRouteRuntimeConfig | null | undefined, source?: string): FarmRouteRuntimeConfig;
|
|
28
|
-
/** Merge from lowest to highest precedence. Explicit "auto" values reset inherited hints. */
|
|
29
|
-
declare function mergeFarmRouteRuntimeConfigs(...configs: Array<FarmRouteRuntimeConfig | null | undefined>): FarmRouteRuntimeConfig;
|
|
30
|
-
declare function resolveFarmRouteRuntimeConfig(config: FarmRouteRuntimeConfig | null | undefined, source?: string): ResolvedFarmRouteRuntimeConfig;
|
|
31
|
-
declare function hasFarmRouteRuntimeControls(config: FarmRouteRuntimeConfig | null | undefined): boolean;
|
|
32
|
-
declare function getFarmRouteRuntimeConfig(value: unknown): FarmRouteRuntimeConfig;
|
|
33
|
-
declare function createFarmRouteRuntimeKey(config: ResolvedFarmRouteRuntimeConfig): string;
|
|
34
|
-
/** Resolve matching route rules from broadest to most specific. */
|
|
35
|
-
declare function resolveFarmRouteRuleRuntimeConfig(pathname: string, routeRules: Record<string, FarmRouteRuntimeConfig> | null | undefined): FarmRouteRuntimeConfig;
|
|
36
|
-
declare function farmRouteRuleMatches(pattern: string, pathname: string): boolean;
|
|
37
|
-
|
|
38
|
-
export { type FarmRouteRuntimeConfig as F, type ResolvedFarmRouteRuntimeConfig as R, type FarmRouteRuntime as a, type FarmRouteRegions as b, type FarmRouteMaxDuration as c, type FarmRouteRuntimeEntryKind as d, type FarmRouteRenderingMode as e, type FarmRouteRuntimeManifestEntry as f, type FarmRouteRuntimeManifest as g, hasFarmRouteRuntimeControls as h, getFarmRouteRuntimeConfig as i, createFarmRouteRuntimeKey as j, resolveFarmRouteRuleRuntimeConfig as k, farmRouteRuleMatches as l, mergeFarmRouteRuntimeConfigs as m, normalizeFarmRouteRuntimeConfig as n, resolveFarmRouteRuntimeConfig as r };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
type FarmRouteRuntime = "auto" | "node" | "edge";
|
|
2
|
-
type FarmRouteRegions = "auto" | readonly string[];
|
|
3
|
-
type FarmRouteMaxDuration = "auto" | number;
|
|
4
|
-
/** Portable execution controls shared by file, programmatic, and config routes. */
|
|
5
|
-
interface FarmRouteRuntimeConfig {
|
|
6
|
-
runtime?: FarmRouteRuntime;
|
|
7
|
-
regions?: FarmRouteRegions;
|
|
8
|
-
maxDuration?: FarmRouteMaxDuration;
|
|
9
|
-
}
|
|
10
|
-
interface ResolvedFarmRouteRuntimeConfig {
|
|
11
|
-
runtime: FarmRouteRuntime;
|
|
12
|
-
regions?: string[];
|
|
13
|
-
maxDuration?: number;
|
|
14
|
-
}
|
|
15
|
-
type FarmRouteRuntimeEntryKind = "page" | "api" | "rule";
|
|
16
|
-
type FarmRouteRenderingMode = "static" | "dynamic";
|
|
17
|
-
interface FarmRouteRuntimeManifestEntry extends ResolvedFarmRouteRuntimeConfig {
|
|
18
|
-
kind: FarmRouteRuntimeEntryKind;
|
|
19
|
-
pattern: string;
|
|
20
|
-
rendering: FarmRouteRenderingMode;
|
|
21
|
-
source?: string;
|
|
22
|
-
}
|
|
23
|
-
interface FarmRouteRuntimeManifest {
|
|
24
|
-
version: 1;
|
|
25
|
-
routes: FarmRouteRuntimeManifestEntry[];
|
|
26
|
-
}
|
|
27
|
-
declare function normalizeFarmRouteRuntimeConfig(value: FarmRouteRuntimeConfig | null | undefined, source?: string): FarmRouteRuntimeConfig;
|
|
28
|
-
/** Merge from lowest to highest precedence. Explicit "auto" values reset inherited hints. */
|
|
29
|
-
declare function mergeFarmRouteRuntimeConfigs(...configs: Array<FarmRouteRuntimeConfig | null | undefined>): FarmRouteRuntimeConfig;
|
|
30
|
-
declare function resolveFarmRouteRuntimeConfig(config: FarmRouteRuntimeConfig | null | undefined, source?: string): ResolvedFarmRouteRuntimeConfig;
|
|
31
|
-
declare function hasFarmRouteRuntimeControls(config: FarmRouteRuntimeConfig | null | undefined): boolean;
|
|
32
|
-
declare function getFarmRouteRuntimeConfig(value: unknown): FarmRouteRuntimeConfig;
|
|
33
|
-
declare function createFarmRouteRuntimeKey(config: ResolvedFarmRouteRuntimeConfig): string;
|
|
34
|
-
/** Resolve matching route rules from broadest to most specific. */
|
|
35
|
-
declare function resolveFarmRouteRuleRuntimeConfig(pathname: string, routeRules: Record<string, FarmRouteRuntimeConfig> | null | undefined): FarmRouteRuntimeConfig;
|
|
36
|
-
declare function farmRouteRuleMatches(pattern: string, pathname: string): boolean;
|
|
37
|
-
|
|
38
|
-
export { type FarmRouteRuntimeConfig as F, type ResolvedFarmRouteRuntimeConfig as R, type FarmRouteRuntime as a, type FarmRouteRegions as b, type FarmRouteMaxDuration as c, type FarmRouteRuntimeEntryKind as d, type FarmRouteRenderingMode as e, type FarmRouteRuntimeManifestEntry as f, type FarmRouteRuntimeManifest as g, hasFarmRouteRuntimeControls as h, getFarmRouteRuntimeConfig as i, createFarmRouteRuntimeKey as j, resolveFarmRouteRuleRuntimeConfig as k, farmRouteRuleMatches as l, mergeFarmRouteRuntimeConfigs as m, normalizeFarmRouteRuntimeConfig as n, resolveFarmRouteRuntimeConfig as r };
|
package/dist/router.d.mts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
type FarmRouterPrimitiveParam = string | number | boolean;
|
|
2
|
-
type FarmRouterPathParam = FarmRouterPrimitiveParam | readonly FarmRouterPrimitiveParam[] | null | undefined;
|
|
3
|
-
type FarmRouterPathParams = Record<string, FarmRouterPathParam>;
|
|
4
|
-
type FarmRouterParams = Record<string, string>;
|
|
5
|
-
interface FarmRouterRoute<TMeta = unknown> {
|
|
6
|
-
path: string;
|
|
7
|
-
name?: string;
|
|
8
|
-
meta?: TMeta;
|
|
9
|
-
}
|
|
10
|
-
type FarmRouterRouteInput<TMeta = unknown> = string | FarmRouterRoute<TMeta>;
|
|
11
|
-
interface FarmRouterMatch<TMeta = unknown> {
|
|
12
|
-
route: FarmRouterRoute<TMeta>;
|
|
13
|
-
pathname: string;
|
|
14
|
-
params: FarmRouterParams;
|
|
15
|
-
}
|
|
16
|
-
type FarmRouterQueryValue = FarmRouterPrimitiveParam | readonly FarmRouterPrimitiveParam[] | null | undefined;
|
|
17
|
-
interface FarmRouterBuildOptions {
|
|
18
|
-
query?: URLSearchParams | Record<string, FarmRouterQueryValue>;
|
|
19
|
-
hash?: string;
|
|
20
|
-
trailingSlash?: boolean;
|
|
21
|
-
}
|
|
22
|
-
interface FarmRouterActiveOptions {
|
|
23
|
-
exact?: boolean;
|
|
24
|
-
}
|
|
25
|
-
interface FarmRouter<TMeta = unknown> {
|
|
26
|
-
routes: FarmRouterRoute<TMeta>[];
|
|
27
|
-
match(pathname: string): FarmRouterMatch<TMeta> | null;
|
|
28
|
-
build(pattern: string, params?: FarmRouterPathParams, options?: FarmRouterBuildOptions): string;
|
|
29
|
-
isActive(pattern: string, pathname: string, options?: FarmRouterActiveOptions): boolean;
|
|
30
|
-
}
|
|
31
|
-
declare function createFarmRouter<TMeta = unknown>(routes: FarmRouterRouteInput<TMeta>[]): FarmRouter<TMeta>;
|
|
32
|
-
declare function matchFarmRoute(pattern: string, pathname: string): FarmRouterParams | null;
|
|
33
|
-
declare function buildFarmRoutePath(pattern: string, params?: FarmRouterPathParams, options?: FarmRouterBuildOptions): string;
|
|
34
|
-
declare function isFarmRouteActive(pattern: string, pathname: string, options?: FarmRouterActiveOptions): boolean;
|
|
35
|
-
|
|
36
|
-
export { type FarmRouter, type FarmRouterActiveOptions, type FarmRouterBuildOptions, type FarmRouterMatch, type FarmRouterParams, type FarmRouterPathParam, type FarmRouterPathParams, type FarmRouterPrimitiveParam, type FarmRouterQueryValue, type FarmRouterRoute, type FarmRouterRouteInput, buildFarmRoutePath, createFarmRouter, isFarmRouteActive, matchFarmRoute };
|
package/dist/router.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
type FarmRouterPrimitiveParam = string | number | boolean;
|
|
2
|
-
type FarmRouterPathParam = FarmRouterPrimitiveParam | readonly FarmRouterPrimitiveParam[] | null | undefined;
|
|
3
|
-
type FarmRouterPathParams = Record<string, FarmRouterPathParam>;
|
|
4
|
-
type FarmRouterParams = Record<string, string>;
|
|
5
|
-
interface FarmRouterRoute<TMeta = unknown> {
|
|
6
|
-
path: string;
|
|
7
|
-
name?: string;
|
|
8
|
-
meta?: TMeta;
|
|
9
|
-
}
|
|
10
|
-
type FarmRouterRouteInput<TMeta = unknown> = string | FarmRouterRoute<TMeta>;
|
|
11
|
-
interface FarmRouterMatch<TMeta = unknown> {
|
|
12
|
-
route: FarmRouterRoute<TMeta>;
|
|
13
|
-
pathname: string;
|
|
14
|
-
params: FarmRouterParams;
|
|
15
|
-
}
|
|
16
|
-
type FarmRouterQueryValue = FarmRouterPrimitiveParam | readonly FarmRouterPrimitiveParam[] | null | undefined;
|
|
17
|
-
interface FarmRouterBuildOptions {
|
|
18
|
-
query?: URLSearchParams | Record<string, FarmRouterQueryValue>;
|
|
19
|
-
hash?: string;
|
|
20
|
-
trailingSlash?: boolean;
|
|
21
|
-
}
|
|
22
|
-
interface FarmRouterActiveOptions {
|
|
23
|
-
exact?: boolean;
|
|
24
|
-
}
|
|
25
|
-
interface FarmRouter<TMeta = unknown> {
|
|
26
|
-
routes: FarmRouterRoute<TMeta>[];
|
|
27
|
-
match(pathname: string): FarmRouterMatch<TMeta> | null;
|
|
28
|
-
build(pattern: string, params?: FarmRouterPathParams, options?: FarmRouterBuildOptions): string;
|
|
29
|
-
isActive(pattern: string, pathname: string, options?: FarmRouterActiveOptions): boolean;
|
|
30
|
-
}
|
|
31
|
-
declare function createFarmRouter<TMeta = unknown>(routes: FarmRouterRouteInput<TMeta>[]): FarmRouter<TMeta>;
|
|
32
|
-
declare function matchFarmRoute(pattern: string, pathname: string): FarmRouterParams | null;
|
|
33
|
-
declare function buildFarmRoutePath(pattern: string, params?: FarmRouterPathParams, options?: FarmRouterBuildOptions): string;
|
|
34
|
-
declare function isFarmRouteActive(pattern: string, pathname: string, options?: FarmRouterActiveOptions): boolean;
|
|
35
|
-
|
|
36
|
-
export { type FarmRouter, type FarmRouterActiveOptions, type FarmRouterBuildOptions, type FarmRouterMatch, type FarmRouterParams, type FarmRouterPathParam, type FarmRouterPathParams, type FarmRouterPrimitiveParam, type FarmRouterQueryValue, type FarmRouterRoute, type FarmRouterRouteInput, buildFarmRoutePath, createFarmRouter, isFarmRouteActive, matchFarmRoute };
|