UNPKG

@paroicms/server

Version:
23 lines (22 loc) 1.1 kB
import { type Tracker } from "@paroicms/internal-server-lib"; import type { PaHttpContext } from "@paroicms/public-server-lib"; import type { SiteContext } from "../site-context/site-context.types.js"; export interface ServeTextOr { serveFromCache: () => Promise<boolean>; putInCacheAndServe: (html: string, dependencyKeys: string[]) => Promise<void>; } export interface ServeTextOrWithCacheKey { serveFromCache: () => Promise<boolean>; putInCacheAndServe: (html: string, dependencyKeys: string[], cacheKey: string) => Promise<void>; } export declare function serveTextFromCacheOr(siteContext: SiteContext, httpContext: PaHttpContext, tracker: Tracker, options: { cacheKey: string; contentType?: string; }): ServeTextOr; export declare function serveTextFromCacheOr(siteContext: SiteContext, httpContext: PaHttpContext, tracker: Tracker, options: { cacheKey: string[]; contentType?: string; }): ServeTextOrWithCacheKey; export declare function render404Html(siteContext: SiteContext, httpContext: PaHttpContext, options?: { language?: string; }): Promise<void>;