///
import CubeCore, { CreateOptions as CoreCreateOptions, DatabaseType, DriverContext, DriverOptions, SystemOptions } from '@cubejs-backend/server-core';
import { Express } from 'express';
import http from 'http';
import { CorsOptions } from 'cors';
import type { SQLServer, SQLServerOptions } from '@cubejs-backend/api-gateway';
import type { BaseDriver } from '@cubejs-backend/query-orchestrator';
import { WebSocketServer, WebSocketServerOptions } from './websocket-server';
import { GracefulHttpServer } from './server/gracefull-http';
import { ServerStatusHandler } from './server-status';
interface HttpOptions {
cors?: CorsOptions;
}
export interface CreateOptions extends CoreCreateOptions, WebSocketServerOptions, SQLServerOptions {
webSockets?: boolean;
http?: HttpOptions;
gracefulShutdown?: number;
serverKeepAliveTimeout?: number;
serverHeadersTimeout?: number;
}
type RequireOne = {
[X in Exclude]?: T[X];
} & {
[P in K]-?: T[P];
};
export declare class CubejsServer {
protected readonly core: CubeCore;
protected readonly config: RequireOne;
protected server: GracefulHttpServer | null;
protected socketServer: WebSocketServer | null;
protected sqlServer: SQLServer | null;
protected readonly status: ServerStatusHandler;
constructor(config?: CreateOptions, systemOptions?: SystemOptions);
protected createCoreInstance(config: CreateOptions, systemOptions?: SystemOptions): CubeCore;
listen(options?: http.ServerOptions): Promise<{
app: Express;
port: number;
server: GracefulHttpServer;
version: any;
}>;
testConnections(): Promise<(void | [...void[], void])[]>;
handleScheduledRefreshInterval(options: any): Promise<{
finished: boolean;
}[]>;
runScheduledRefresh(context: any, queryingOptions: any): Promise<{
finished: boolean;
}>;
getDriver(ctx: DriverContext): Promise;
close(): Promise;
/**
* Create driver instance.
*
* TODO (buntarb): there is no usage of this method across the project.
*/
static createDriver(dbType: DatabaseType, opt: DriverOptions): BaseDriver;
static driverDependencies(dbType: DatabaseType): string;
static apiSecret(): string | undefined;
static version(): any;
shutdown(signal: string, graceful?: boolean): Promise<0 | 1>;
}
export {};
//# sourceMappingURL=server.d.ts.map