@tanstack/router-core 1.114.29 → 1.114.32
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/cjs/index.d.cts +1 -1
- package/dist/cjs/serializer.d.cts +8 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/serializer.d.ts +8 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/serializer.ts +11 -3
package/dist/cjs/index.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ export { preloadWarning } from './link.cjs';
|
|
|
4
4
|
export type { IsRequiredParams, ParsePathParams, AddTrailingSlash, RemoveTrailingSlashes, AddLeadingSlash, RemoveLeadingSlashes, ActiveOptions, LinkOptionsProps, ResolveCurrentPath, ResolveParentPath, ResolveRelativePath, LinkCurrentTargetElement, FindDescendantToPaths, InferDescendantToPaths, RelativeToPath, RelativeToParentPath, RelativeToCurrentPath, AbsoluteToPath, RelativeToPathAutoComplete, NavigateOptions, ToOptions, ToMaskOptions, ToSubOptions, ResolveRoute, SearchParamOptions, PathParamOptions, ToPathOption, LinkOptions, MakeOptionalPathParams, FromPathOption, MakeOptionalSearchParams, MaskOptions, ToSubOptionsProps, RequiredToOptions, } from './link.cjs';
|
|
5
5
|
export type { RouteToPath, TrailingSlashOptionByRouter, ParseRoute, CodeRouteToPath, RouteIds, FullSearchSchema, FullSearchSchemaInput, AllParams, RouteById, AllContext, RoutePaths, RoutesById, RoutesByPath, AllLoaderData, RouteByPath, } from './routeInfo.cjs';
|
|
6
6
|
export type { InferFileRouteTypes, FileRouteTypes, FileRoutesByPath, LazyRoute, LazyRouteOptions, } from './fileRoute.cjs';
|
|
7
|
-
export type { StartSerializer, Serializable, SerializerParse, SerializerParseBy, SerializerStringify, SerializerStringifyBy, } from './serializer.cjs';
|
|
7
|
+
export type { StartSerializer, Serializable, SerializerParse, SerializerParseBy, SerializerStringify, SerializerStringifyBy, SerializerExtensions, } from './serializer.cjs';
|
|
8
8
|
export type { ParsedLocation } from './location.cjs';
|
|
9
9
|
export type { Manifest, RouterManagedTag } from './manifest.cjs';
|
|
10
10
|
export { isMatch } from './Matches.cjs';
|
|
@@ -7,9 +7,16 @@ export interface StartSerializer {
|
|
|
7
7
|
export type SerializerStringifyBy<T, TSerializable> = T extends TSerializable ? T : T extends (...args: Array<any>) => any ? 'Function is not serializable' : {
|
|
8
8
|
[K in keyof T]: SerializerStringifyBy<T[K], TSerializable>;
|
|
9
9
|
};
|
|
10
|
-
export type SerializerParseBy<T, TSerializable> = T extends TSerializable ? T :
|
|
10
|
+
export type SerializerParseBy<T, TSerializable> = T extends TSerializable ? T : unknown extends SerializerExtensions['ReadableStream'] ? {
|
|
11
|
+
[K in keyof T]: SerializerParseBy<T[K], TSerializable>;
|
|
12
|
+
} : T extends SerializerExtensions['ReadableStream'] ? ReadableStream : {
|
|
11
13
|
[K in keyof T]: SerializerParseBy<T[K], TSerializable>;
|
|
12
14
|
};
|
|
15
|
+
export interface DefaultSerializerExtensions {
|
|
16
|
+
ReadableStream: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface SerializerExtensions extends DefaultSerializerExtensions {
|
|
19
|
+
}
|
|
13
20
|
export type Serializable = Date | undefined | Error | FormData | bigint;
|
|
14
21
|
export type SerializerStringify<T> = SerializerStringifyBy<T, Serializable>;
|
|
15
22
|
export type SerializerParse<T> = SerializerParseBy<T, Serializable>;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { preloadWarning } from './link.js';
|
|
|
4
4
|
export type { IsRequiredParams, ParsePathParams, AddTrailingSlash, RemoveTrailingSlashes, AddLeadingSlash, RemoveLeadingSlashes, ActiveOptions, LinkOptionsProps, ResolveCurrentPath, ResolveParentPath, ResolveRelativePath, LinkCurrentTargetElement, FindDescendantToPaths, InferDescendantToPaths, RelativeToPath, RelativeToParentPath, RelativeToCurrentPath, AbsoluteToPath, RelativeToPathAutoComplete, NavigateOptions, ToOptions, ToMaskOptions, ToSubOptions, ResolveRoute, SearchParamOptions, PathParamOptions, ToPathOption, LinkOptions, MakeOptionalPathParams, FromPathOption, MakeOptionalSearchParams, MaskOptions, ToSubOptionsProps, RequiredToOptions, } from './link.js';
|
|
5
5
|
export type { RouteToPath, TrailingSlashOptionByRouter, ParseRoute, CodeRouteToPath, RouteIds, FullSearchSchema, FullSearchSchemaInput, AllParams, RouteById, AllContext, RoutePaths, RoutesById, RoutesByPath, AllLoaderData, RouteByPath, } from './routeInfo.js';
|
|
6
6
|
export type { InferFileRouteTypes, FileRouteTypes, FileRoutesByPath, LazyRoute, LazyRouteOptions, } from './fileRoute.js';
|
|
7
|
-
export type { StartSerializer, Serializable, SerializerParse, SerializerParseBy, SerializerStringify, SerializerStringifyBy, } from './serializer.js';
|
|
7
|
+
export type { StartSerializer, Serializable, SerializerParse, SerializerParseBy, SerializerStringify, SerializerStringifyBy, SerializerExtensions, } from './serializer.js';
|
|
8
8
|
export type { ParsedLocation } from './location.js';
|
|
9
9
|
export type { Manifest, RouterManagedTag } from './manifest.js';
|
|
10
10
|
export { isMatch } from './Matches.js';
|
package/dist/esm/serializer.d.ts
CHANGED
|
@@ -7,9 +7,16 @@ export interface StartSerializer {
|
|
|
7
7
|
export type SerializerStringifyBy<T, TSerializable> = T extends TSerializable ? T : T extends (...args: Array<any>) => any ? 'Function is not serializable' : {
|
|
8
8
|
[K in keyof T]: SerializerStringifyBy<T[K], TSerializable>;
|
|
9
9
|
};
|
|
10
|
-
export type SerializerParseBy<T, TSerializable> = T extends TSerializable ? T :
|
|
10
|
+
export type SerializerParseBy<T, TSerializable> = T extends TSerializable ? T : unknown extends SerializerExtensions['ReadableStream'] ? {
|
|
11
|
+
[K in keyof T]: SerializerParseBy<T[K], TSerializable>;
|
|
12
|
+
} : T extends SerializerExtensions['ReadableStream'] ? ReadableStream : {
|
|
11
13
|
[K in keyof T]: SerializerParseBy<T[K], TSerializable>;
|
|
12
14
|
};
|
|
15
|
+
export interface DefaultSerializerExtensions {
|
|
16
|
+
ReadableStream: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface SerializerExtensions extends DefaultSerializerExtensions {
|
|
19
|
+
}
|
|
13
20
|
export type Serializable = Date | undefined | Error | FormData | bigint;
|
|
14
21
|
export type SerializerStringify<T> = SerializerStringifyBy<T, Serializable>;
|
|
15
22
|
export type SerializerParse<T> = SerializerParseBy<T, Serializable>;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/serializer.ts
CHANGED
|
@@ -13,9 +13,17 @@ export type SerializerStringifyBy<T, TSerializable> = T extends TSerializable
|
|
|
13
13
|
|
|
14
14
|
export type SerializerParseBy<T, TSerializable> = T extends TSerializable
|
|
15
15
|
? T
|
|
16
|
-
:
|
|
17
|
-
?
|
|
18
|
-
:
|
|
16
|
+
: unknown extends SerializerExtensions['ReadableStream']
|
|
17
|
+
? { [K in keyof T]: SerializerParseBy<T[K], TSerializable> }
|
|
18
|
+
: T extends SerializerExtensions['ReadableStream']
|
|
19
|
+
? ReadableStream
|
|
20
|
+
: { [K in keyof T]: SerializerParseBy<T[K], TSerializable> }
|
|
21
|
+
|
|
22
|
+
export interface DefaultSerializerExtensions {
|
|
23
|
+
ReadableStream: unknown
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface SerializerExtensions extends DefaultSerializerExtensions {}
|
|
19
27
|
|
|
20
28
|
export type Serializable = Date | undefined | Error | FormData | bigint
|
|
21
29
|
|