import { Request } from 'express'; import { TRouteObject } from "../interfaces/route-object.js"; import { IEntrypointOptions, IPrepareRenderOut } from "../node/entry.js"; import { TRender } from "../node/render.js"; import ServerApi from "./server-api.js"; import ServerConfig from "./server-config.js"; interface IPrepareServerEntrypointLoadOut> { render: TRender; routes: TRouteObject[]; abortDelay?: number; onRequest?: IEntrypointOptions['onRequest']; onRouterReady?: IEntrypointOptions['onRouterReady']; onShellReady?: IEntrypointOptions['onShellReady']; onShellError?: IEntrypointOptions['onShellError']; onResponse?: IEntrypointOptions['onResponse']; onError?: IEntrypointOptions['onError']; getState?: IEntrypointOptions['getState']; } /** * Load server entrypoint and template * DEV MODE: refresh entrypoint and template */ declare class PrepareServer { /** * Server configuration */ protected readonly config: ServerConfig; /** * Server API */ protected readonly serverApi: ServerApi; /** * Entrypoint resolved params */ protected entrypoint?: IPrepareServerEntrypointLoadOut; /** * Hook which calls after express server created */ protected onServerCreated?: IEntrypointOptions['onServerCreated']; /** * Hook which calls after express server started */ onServerStarted?: IEntrypointOptions['onServerStarted']; /** * Html shell */ protected html: string; /** * Middlewares configs */ protected middlewaresConfigs?: IPrepareRenderOut['middlewares']; /** * @constructor */ /** * @constructor */ protected constructor(config: ServerConfig, serverApi?: ServerApi); /** * Init service */ /** * Init service */ static init(config: ServerConfig, serverApi?: ServerApi): PrepareServer; /** * Resolve and return entrypoint params */ /** * Resolve and return entrypoint params */ loadEntrypoint(shouldInit?: boolean): Promise; /** * Load and return html shell */ /** * Load and return html shell */ loadHtml(req: Request): Promise<[string, string]>; /** * Run server created hook */ /** * Run server created hook */ onAppCreated(): Promise; /** * Return SSR express middlewares configs */ /** * Return SSR express middlewares configs */ getMiddlewaresConfig(): NonNullable; } export { PrepareServer as default };