84 lines
4.3 KiB
TypeScript
84 lines
4.3 KiB
TypeScript
// generated by fetchdts, strategy table+union, 3 routes
|
|
// (2 static, 0 dynamic, 1 wildcard)
|
|
import type { AnyHTTPMethod, Endpoint, HTTPMethod, TypedFetchErrorBody, TypedFetchMethods, TypedFetchRequestBody, TypedFetchRequestHeaders, TypedFetchRequestQuery, TypedFetchRequires, TypedFetchResponseBody, TypedFetchResponseHeaders, ValidFetchInput, WildcardParam } from 'nuxt/app'
|
|
import type { ServerRoutes } from '@nuxt/schema'
|
|
import type { Serialize } from 'nuxt/app'
|
|
import type { RequestBodyOf, RequestQueryOf } from '@nuxt/nitro-server/request-types'
|
|
type AugmentedServerRoutes = GeneratedServerRoutes & ServerRoutes
|
|
|
|
export interface GeneratedServerRoutes {
|
|
"/__nuxt_error": {
|
|
[Endpoint]: Record<HTTPMethod, {
|
|
"response": Serialize<Awaited<ReturnType<typeof import("../../site1/node_modules/@nuxt/nitro-server/dist/runtime/handlers/renderer").default>>>
|
|
"body": RequestBodyOf<typeof import("../../site1/node_modules/@nuxt/nitro-server/dist/runtime/handlers/renderer").default>
|
|
"query": RequestQueryOf<typeof import("../../site1/node_modules/@nuxt/nitro-server/dist/runtime/handlers/renderer").default>
|
|
}>
|
|
}
|
|
"/__nuxt_island": {
|
|
[WildcardParam]: {
|
|
[Endpoint]: Record<HTTPMethod, {
|
|
"response": Serialize<Awaited<ReturnType<typeof import("../#internal/nuxt/island-renderer").default>>>
|
|
"body": RequestBodyOf<typeof import("../#internal/nuxt/island-renderer").default>
|
|
"query": RequestQueryOf<typeof import("../#internal/nuxt/island-renderer").default>
|
|
}>
|
|
}
|
|
}
|
|
"/sitemap.xml": {
|
|
[Endpoint]: Record<HTTPMethod, {
|
|
"response": Serialize<Awaited<ReturnType<typeof import("../server/routes/sitemap.xml").default>>>
|
|
"body": RequestBodyOf<typeof import("../server/routes/sitemap.xml").default>
|
|
"query": RequestQueryOf<typeof import("../server/routes/sitemap.xml").default>
|
|
}>
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Every path whose every segment is known, mapped to the endpoints registered on it.
|
|
*
|
|
* A fast path rather than the authority: a lookup that misses falls through to the tree, which
|
|
* costs nothing, since a path reached through a parameter has to walk either way.
|
|
*/
|
|
export interface Exact {
|
|
"/__nuxt_error": GeneratedServerRoutes["/__nuxt_error"][typeof Endpoint]
|
|
"/sitemap.xml": GeneratedServerRoutes["/sitemap.xml"][typeof Endpoint]
|
|
}
|
|
|
|
export type Path =
|
|
| "/__nuxt_error"
|
|
| `/__nuxt_island/${string}${string}`
|
|
| "/__nuxt_island"
|
|
| "/sitemap.xml"
|
|
|
|
/**
|
|
* Whether a path resolves, for use in parameter position: `input: T & ValidInput<T, M>`.
|
|
*
|
|
* Does not consult `Exact`: a lookup where the path is still a type parameter relates a `keyof`
|
|
* of every static path once per program, so the table stays where the path is resolved.
|
|
*/
|
|
export type ValidInput<Path_, Method extends AnyHTTPMethod = 'GET'>
|
|
= ValidFetchInput<AugmentedServerRoutes, Path_, Method>
|
|
|
|
export type Response<Path_, Method extends AnyHTTPMethod = 'GET'>
|
|
= Path_ extends keyof Exact
|
|
? Uppercase<Method> extends keyof Exact[Path_]
|
|
? 'response' extends keyof Exact[Path_][Uppercase<Method>]
|
|
? Exact[Path_][Uppercase<Method>]['response']
|
|
: unknown
|
|
: TypedFetchResponseBody<AugmentedServerRoutes, Path_, Method>
|
|
: TypedFetchResponseBody<AugmentedServerRoutes, Path_, Method>
|
|
|
|
export type Methods<Path_> = TypedFetchMethods<AugmentedServerRoutes, Path_>
|
|
|
|
export type ResponseHeaders<Path_, Method extends AnyHTTPMethod = 'GET'> = TypedFetchResponseHeaders<AugmentedServerRoutes, Path_, Method>
|
|
|
|
export type ErrorBody<Path_, Method extends AnyHTTPMethod = 'GET'> = TypedFetchErrorBody<AugmentedServerRoutes, Path_, Method>
|
|
|
|
export type RequestBody<Path_, Method extends AnyHTTPMethod = 'GET', Fallback = BodyInit | null> = TypedFetchRequestBody<AugmentedServerRoutes, Path_, Method, Fallback>
|
|
|
|
export type RequestQuery<Path_, Method extends AnyHTTPMethod = 'GET', Fallback = Record<string, unknown>> = TypedFetchRequestQuery<AugmentedServerRoutes, Path_, Method, Fallback>
|
|
|
|
export type RequestHeaders<Path_, Method extends AnyHTTPMethod = 'GET', Fallback = HeadersInit> = TypedFetchRequestHeaders<AugmentedServerRoutes, Path_, Method, Fallback>
|
|
|
|
export type Requires<Path_, Method extends AnyHTTPMethod, Field extends 'body' | 'query' | 'headers'> = TypedFetchRequires<AugmentedServerRoutes, Path_, Method, Field>
|
|
export type StrictFetchPaths = false
|
|
export type RouteTypesEngine = 'internal-api' |