feat(app): add search and pagination (#1860)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import type { z } from "zod";
|
||||
|
||||
export type MaybePromise<T> = T | Promise<T>;
|
||||
|
||||
export type AtLeastOneOf<T> = [T, ...T[]];
|
||||
@@ -16,3 +18,11 @@ export type Inverse<T extends Invertible> = {
|
||||
};
|
||||
|
||||
type Invertible = Record<PropertyKey, PropertyKey>;
|
||||
|
||||
export type inferSearchParamsFromSchema<TSchema extends z.AnyZodObject> = inferSearchParamsFromSchemaInner<
|
||||
z.infer<TSchema>
|
||||
>;
|
||||
|
||||
type inferSearchParamsFromSchemaInner<TSchema extends Record<string, unknown>> = Partial<{
|
||||
[K in keyof TSchema]: Exclude<TSchema[K], undefined> extends unknown[] ? string[] : string;
|
||||
}>;
|
||||
|
||||
Reference in New Issue
Block a user