import { ServiceConfig } from '@atlaskit/util-service-support';
import { EditorState, Transaction } from 'prosemirror-state';
import { Step } from 'prosemirror-transform';
import type { ConnectionData, InitData, Participant, PresenceData, RemoteData, TelepointerData } from '../types';
export type { TelepointerData, Participant };
export declare type CollabEvent = 'init' | 'connected' | 'data' | 'telepointer' | 'presence' | 'error' | 'local-steps' | 'editor-appearance';
export interface CollabEventData {
    init: InitData;
    connected: ConnectionData;
    data: RemoteData;
    telepointer: TelepointerData;
    presensense: PresenceData;
    error: any;
}
export interface CollabEditProvider {
    initialize(getState: () => any, createStep: (json: object) => Step): this;
    send(tr: Transaction, oldState: EditorState, newState: EditorState): void;
    on(evt: CollabEvent, handler: (...args: any) => void): this;
    off(evt: CollabEvent, handler: (...args: any) => void): this;
    unsubscribeAll(evt: CollabEvent): this;
    sendMessage<T extends keyof CollabEventData>(data: {
        type: T;
    } & CollabEventData[T]): void;
}
export interface DocumentResponse {
    version: number;
    doc: any;
}
export interface StepResponse {
    version: number;
    steps: any[];
}
export declare type MixedResponse = DocumentResponse & StepResponse;
export interface Config extends ServiceConfig {
    docId: string;
    userId: string;
}
/**
 * Same as PubSub client types (don't want a direct dep though)
 */
export declare type ARI = string;
export declare type AVI = string;
export interface PubSubOnEvent<T = any> {
    (event: string, data: T): void;
}
export interface PubSubClient {
    on(eventAvi: string, listener: PubSubOnEvent): PubSubClient;
    off(eventAvi: string, listener: PubSubOnEvent): PubSubClient;
    join(aris: ARI[]): Promise<PubSubClient>;
    leave(aris: ARI[]): Promise<PubSubClient>;
}
export declare enum PubSubSpecialEventType {
    ERROR = "ERROR",
    CONNECTED = "CONNECTED",
    RECONNECT = "RECONNECT"
}
