/** * Creation of standard ExpressJS server for ReactJS apps. */ import { type Express, type Request } from 'express'; import { type HelmetOptions } from 'helmet'; import type { Configuration } from 'webpack'; import { type LoggerI, type OptionsT as RendererOptionsT } from './renderer'; export type CspOptionsT = Exclude; /** * @category Utilities * @func server/getDefaultCspSettings * @global * @desc * ```js * import { server } from '@dr.pogodin/react-utils'; * const { getDefaultCspSettings } from '@dr.pogodin/react-utils'; * ``` * @return {{ * directives: object * }} A deep copy of default CSP settings object used by `react-utils`, * with the exception of `nonce-xxx` clause in `script-src` directive, * which is added dynamically for each request. */ export declare function getDefaultCspSettings(): { directives: Record; }; export type ServerT = Express & { logger: LoggerI; }; export type OptionsT = RendererOptionsT & { beforeExpressJsError?: (server: ServerT) => Promise | boolean; beforeExpressJsSetup?: (server: ServerT) => Promise | void; cookieSignatureSecret?: string; cspSettingsHook?: (defaultOptions: CspOptionsT, req: Request) => CspOptionsT; csrfIgnoreRequest?: (req: Request) => boolean; devMode?: boolean; httpsRedirect?: boolean; onExpressJsSetup?: (server: ServerT) => Promise | void; }; export default function factory(webpackConfig: Configuration, options: OptionsT): Promise;