import { Server as WsServer } from 'ws';
import http from 'http';
type BaseMessage = {
    streamName: string;
} & ({
    id: string;
} | {
    groupId: string;
});
type StreamEvent<TData> = {
    type: 'sync';
    data: TData;
} | {
    type: 'create';
    data: TData;
} | {
    type: 'update';
    data: TData;
} | {
    type: 'delete';
    data: TData;
} | {
    type: 'event';
    event: {
        type: string;
        data: any;
    };
};
type EventMessage<TData> = BaseMessage & {
    event: StreamEvent<TData>;
};
type Props = {
    server: http.Server;
    onJoin: <TData>(streamName: string, id: string) => Promise<TData>;
    onJoinGroup: <TData>(streamName: string, groupId: string) => Promise<TData[] | undefined>;
};
export declare const createSocketServer: ({ server, onJoin, onJoinGroup }: Props) => {
    pushEvent: <TData>(message: EventMessage<TData>) => void;
    socketServer: WsServer<typeof import("ws"), typeof http.IncomingMessage>;
};
export {};
