UNPKG

1.1 kBPlain TextView Raw
1// TODO merge into vite/types
2
3/** The list of input keys will become optional, everything else will remain the same. */
4export type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>
5
6export type GlobbedRouteImports = Record<string, () => Promise<unknown>>
7
8export type Endpoint = (req: Request) => Response | string | Object | null
9
10export type Options = {
11 ignore?: RegExp[]
12 preserveApiRoutes?: boolean
13 ignoreRequireErrors?: boolean
14 ignoreEntryPoints?: boolean
15 /* Used to simplify testing for toEqual() comparison */
16 internal_stripLoadRoute?: boolean
17 /* Used to simplify by skipping the generated routes */
18 skipGenerated?: boolean
19 importMode?: string
20 platformRoutes?: boolean
21 platform?: string
22}
23
24export type RenderApp = (props: RenderAppProps) => Promise<string>
25
26export type LoaderProps<Params extends Object = Record<string, string>> = {
27 path: string
28 params: Params
29 request?: Request
30}
31
32export type RenderAppProps = {
33 path: string
34 preloads?: string[]
35 css?: string[]
36 loaderServerData?: any
37 loaderData?: any
38 loaderProps?: LoaderProps
39}