gitscope
← marzneshin / v0.3.0-alpha3 / dashboard/src/components/entity-table/hooks/use-entity-query.ts
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/components/entity-table/hooks/use-entity-query.ts · TypeScript
Blame Raw
 1import { z } from "zod";
 2
 3const UseEntityQueryPropsSchema = z.object({
 4    page: z.number().gte(1),
 5    size: z.number().gte(1).lte(100)
 6})
 7
 8export type UseEntityQueryProps = z.infer<typeof UseEntityQueryPropsSchema>
 9
10export type EntityQueryKeyType = { queryKey: [string, number, number] }
11
12interface FetchEntityResult<T> {
13    pageCount: number
14    entity: T[]
15}
16
17export type FetchEntityReturn<T> = Promise<FetchEntityResult<T>>