@paroicms/server
Version:
The ParoiCMS server
23 lines (22 loc) • 1.1 kB
TypeScript
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>;