@bb-labs/next-router 0.0.1 → 0.0.2
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/README.md +1 -1
- package/dist/client/z-page/index.d.ts +2 -10
- package/dist/client/z-page/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,17 +5,9 @@ type HookOptions<T> = {
|
|
|
5
5
|
onError?: (error: Error) => void;
|
|
6
6
|
};
|
|
7
7
|
export declare function useRouteParams<T extends ZodObject>(schema: T, options?: HookOptions<z.output<T>>): {
|
|
8
|
-
data: z.output<T
|
|
9
|
-
error: null;
|
|
10
|
-
} | {
|
|
11
|
-
data: null;
|
|
12
|
-
error: z.ZodError<z.core.output<T>>;
|
|
8
|
+
data: z.core.output<T> | null;
|
|
13
9
|
};
|
|
14
10
|
export declare function useSearchParams<T extends ZodObject>(schema: T, options?: HookOptions<z.output<T>>): {
|
|
15
|
-
data: z.output<T
|
|
16
|
-
error: null;
|
|
17
|
-
} | {
|
|
18
|
-
data: null;
|
|
19
|
-
error: z.ZodError<z.core.output<T>>;
|
|
11
|
+
data: z.core.output<T> | null;
|
|
20
12
|
};
|
|
21
13
|
export {};
|
|
@@ -21,7 +21,7 @@ export function useRouteParams(schema, options) {
|
|
|
21
21
|
options?.onSuccess?.(result.data);
|
|
22
22
|
}
|
|
23
23
|
}, [result, options, router]);
|
|
24
|
-
return result;
|
|
24
|
+
return { data: result.data };
|
|
25
25
|
}
|
|
26
26
|
export function useSearchParams(schema, options) {
|
|
27
27
|
const nextSearchParams = useNextSearchParams();
|
|
@@ -48,5 +48,5 @@ export function useSearchParams(schema, options) {
|
|
|
48
48
|
options?.onSuccess?.(result.data);
|
|
49
49
|
}
|
|
50
50
|
}, [result, options, router]);
|
|
51
|
-
return result;
|
|
51
|
+
return { data: result.data };
|
|
52
52
|
}
|