import http from "node:http"; import type { JinnConfig, Connector } from "../shared/types.js"; import { type Encoding } from "./compress.js"; export declare function isAllowedCorsOrigin(origin: string | undefined, requestHost?: string): boolean; type ServeStaticOptions = { compress?: (encoding: Encoding, input: Buffer) => Buffer; compressionCache?: { entries: Map; totalBytes: number; }; compressionCacheMaxEntries?: number; compressionCacheMaxBytes?: number; }; export declare function serveStatic(req: http.IncomingMessage, res: http.ServerResponse, webDir: string, options?: ServeStaticOptions): boolean; /** A connector declaration with its id resolved — the one runtime shape. */ export interface NormalizedConnector { id: string; type: string; employee?: string; /** Config handed to the connector constructor (always carries `id`). */ config: Record; } /** * Flatten both config forms into one list: the legacy top-level connectors * (`connectors.slack`, …) become instances whose id defaults to their type, * followed by the explicitly named `connectors.instances[]`. */ export declare function connectorInstancesFromConfig(config: JinnConfig): NormalizedConnector[]; /** The only place a connector is constructed. Throws on an unknown type. */ export declare function createConnector(instance: NormalizedConnector): Connector; interface ReloadConnectorRegistryOptions { connectorMap: Map; loadInstances: () => NormalizedConnector[]; initConnector: (instance: NormalizedConnector) => Promise; describeConnector: (instance: NormalizedConnector) => string; } /** Reload a live connector registry from freshly normalized declarations. */ export declare function reloadConnectorRegistry({ connectorMap, loadInstances, initConnector, describeConnector, }: ReloadConnectorRegistryOptions): Promise<{ started: string[]; stopped: string[]; errors: string[]; }>; /** Boot-time startup. Returns without awaiting any `start()`, so a hung handshake cannot delay the HTTP listen. */ export declare function startConnectorInstances(instances: NormalizedConnector[], initConnector: (instance: NormalizedConnector) => Promise, describeConnector: (instance: NormalizedConnector) => string): void; export type GatewayCleanup = () => Promise; export declare function startGateway(config: JinnConfig): Promise; export {}; //# sourceMappingURL=server.d.ts.map