import type { RxCollection, RxDatabase } from 'rxdb/plugins/core'; import { RxServerReplicationEndpoint } from './endpoint-replication.ts'; import type { RxServerAdapter, RxServerAuthHandler, RxServerChangeValidator, RxServerEndpoint, RxServerOptions, RxServerQueryModifier } from './types.ts'; import { RxServerRestEndpoint } from './endpoint-rest.ts'; export declare class RxServer { readonly options: RxServerOptions; readonly authHandler: RxServerAuthHandler; readonly serverApp: ServerAppType; readonly cors: string; readonly endpoints: RxServerEndpoint[]; private closeFn; listenPromise?: Promise; readonly database: RxDatabase; readonly adapter: RxServerAdapter; constructor(options: RxServerOptions, authHandler: RxServerAuthHandler, serverApp: ServerAppType, cors?: string); private ensureNotStarted; addReplicationEndpoint(opts: { name: string; collection: RxCollection; queryModifier?: RxServerQueryModifier; changeValidator?: RxServerChangeValidator; /** * Set a origin for allowed CORS requests. * Overwrites the cors option of the server. * [default='*'] */ cors?: '*' | string; serverOnlyFields?: string[]; }): RxServerReplicationEndpoint; addRestEndpoint(opts: { name: string; collection: RxCollection; queryModifier?: RxServerQueryModifier; changeValidator?: RxServerChangeValidator; /** * Set a origin for allowed CORS requests. * Overwrites the cors option of the server. * [default='*'] */ cors?: '*' | string; serverOnlyFields?: string[]; }): RxServerRestEndpoint; start(): Promise; close(): Promise; }