import type { NextFunction } from '@feathersjs/feathers'; import type { Application } from '@feathersjs/express'; import type { Server as HttpServer } from 'http'; import { SyncServiceOptions } from './sync-service.js'; import { SyncServiceInfo } from '@kalisio/feathers-automerge'; export * from './utils.js'; export type AppSetupHookContext = { app: Application; server: HttpServer; }; export interface SyncOptionsBase extends SyncServiceOptions { directory: string; serverId: string; syncServicePath: string; getInitialDocuments?: (app: Application) => Promise; } export interface SyncServerOptions extends SyncOptionsBase { authenticate: (app: Application, accessToken: string | null) => Promise; syncServerWsPath?: string; } export interface SyncClientOptions extends SyncOptionsBase { getAccessToken?: (app: Application) => Promise; syncServerUrl?: string; } export type SyncOptions = SyncServerOptions | SyncClientOptions; export declare function validateSyncServerOptions(options: SyncOptions): options is SyncServerOptions; export declare function handleWss(options: SyncServerOptions): (context: AppSetupHookContext, next: NextFunction) => Promise; export declare function handleWsClient(options: SyncClientOptions): (context: AppSetupHookContext, next: NextFunction) => Promise; export declare function automergeServer(options: SyncOptions): (app: Application) => void;