UNPKG

vike

Version:

The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.

40 lines (39 loc) 2.14 kB
export { createHttpResponsePage }; export { createHttpResponsePageContextJson }; export { createHttpResponseError }; export { createHttpResponseErrorWithoutGlobalContext }; export { createHttpResponseRedirect }; export { createHttpResponse404 }; export { createHttpResponseBaseIsMissing }; export type { HttpResponse }; import type { GetPageAssets } from './getPageAssets.js'; import type { HtmlRender } from '../html/renderHtml.js'; import type { RenderHook } from './execHookOnRenderHtml.js'; import type { RedirectStatusCode, AbortStatusCode, UrlRedirect } from '../../../shared/route/abort.js'; import { HttpResponseBody } from './getHttpResponseBody.js'; import { type EarlyHint } from './getEarlyHints.js'; import type { PageContextBegin } from '../renderPage.js'; import type { GlobalContextServerInternal } from '../globalContext.js'; type HttpResponse = { statusCode: 200 | 404 | 500 | RedirectStatusCode | AbortStatusCode; headers: [string, string][]; earlyHints: EarlyHint[]; /** **Deprecated**: use `headers` instead, see https://vike.dev/migration/0.4.134 */ contentType: 'application/json' | 'text/html;charset=utf-8'; } & HttpResponseBody; declare function createHttpResponsePage(htmlRender: HtmlRender, renderHook: null | RenderHook, pageContext: { pageId: null | string; is404: null | boolean; errorWhileRendering: null | Error; __getPageAssets: GetPageAssets; _globalContext: GlobalContextServerInternal; abortStatusCode?: AbortStatusCode; }): Promise<HttpResponse>; declare function createHttpResponse404(errMsg404: string): HttpResponse; declare function createHttpResponseBaseIsMissing(urlOriginal: string, baseServer: string): HttpResponse; declare function createHttpResponseError(pageContext: { _globalContext: GlobalContextServerInternal; }): HttpResponse; declare function createHttpResponseErrorWithoutGlobalContext(): HttpResponse; declare function createHttpResponsePageContextJson(pageContextSerialized: string): Promise<HttpResponse>; declare function createHttpResponseRedirect({ url, statusCode }: UrlRedirect, pageContextInit: PageContextBegin): HttpResponse;