clear-react-router 1.4.9 → 1.5.0

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.
@@ -1,2 +1,2 @@
1
- import { Adapter } from '../types/global';
2
- export declare function useQueryParam<T>(field: string, adapter: Adapter<T>, defaultValue?: T): [T, (arg: T | null) => void];
1
+ import { AdapterType } from '../types/global';
2
+ export declare function useQueryParam<T>(field: string, adapter: AdapterType<T>, defaultValue?: T): [T, (arg: T | null) => void];
package/dist/index.d.ts CHANGED
@@ -13,4 +13,4 @@ export { useSearchParams } from './hooks/useSearchParams';
13
13
  export { useHistoricalTrail } from './hooks/useHistoricalTrail';
14
14
  export { adapter } from './utils/adapter';
15
15
  export { createRouter } from './utils/utils';
16
- export type { RouteItem, BlockerState, Location, Adapter } from './types/global';
16
+ export type { RouteItem, BlockerState, Location, AdapterType } from './types/global';
@@ -55,7 +55,7 @@ export type LoaderState = {
55
55
  loaderError: Error | null;
56
56
  beforeLoadError: Error | null;
57
57
  };
58
- export type Adapter<T> = {
58
+ export type AdapterType<T> = {
59
59
  parse: (params: string[]) => T;
60
60
  serialize?: (params: T) => string | string[];
61
61
  };
@@ -1,4 +1,4 @@
1
- import { Adapter } from '../types/global';
1
+ import { AdapterType } from '../types/global';
2
2
  type ZodInterface<T> = {
3
3
  safeParse(input: unknown): {
4
4
  success: true;
@@ -46,6 +46,6 @@ export declare const adapter: {
46
46
  parse: (params: string[]) => Date[];
47
47
  serialize: (args: Date[]) => string[];
48
48
  };
49
- zodSchema: <T>(schema: ZodInterface<T>) => Adapter<T>;
49
+ zodSchema: <T>(schema: ZodInterface<T>) => AdapterType<T>;
50
50
  };
51
51
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clear-react-router",
3
- "version": "1.4.9",
3
+ "version": "1.5.0",
4
4
  "description": "A lightweight, type-safe routing library for React applications",
5
5
  "author": "Andrew Bubnov",
6
6
  "scripts": {