import { YNotebook } from '@jupyter/ydoc';
import { WebsocketProvider } from 'y-websocket';
import type { ICollaborationProvider, ICollaborationProviderEvents } from '@datalayer/jupyter-react';
export declare enum CollaborationStatus {
    Disconnected = "disconnected",
    Connecting = "connecting",
    Connected = "connected",
    Error = "error"
}
/**
 * Configuration for Datalayer collaboration provider
 */
export interface IDatalayerCollaborationConfig {
    /**
     * Base URL for the Datalayer server (optional, uses config from store if not provided)
     */
    runUrl?: string;
    /**
     * Authentication token (optional, uses config from store if not provided)
     */
    token?: string;
    /**
     * Custom fetch function to use for HTTP requests.
     * Useful for proxying requests in environments with CORS restrictions (e.g., VS Code webviews).
     */
    fetchFn?: typeof fetch;
}
/**
 * Datalayer collaboration provider
 *
 * This provider connects to Datalayer's collaboration service using WebSockets.
 */
export declare class DatalayerCollaborationProvider implements ICollaborationProvider {
    readonly type = "datalayer";
    private _status;
    private _provider;
    private _sharedModel;
    private _statusChanged;
    private _errorOccurred;
    private _syncStateChanged;
    private _isDisposed;
    private _config;
    private _onSync;
    private _onConnectionClose;
    constructor(config: IDatalayerCollaborationConfig);
    get status(): CollaborationStatus;
    get isConnected(): boolean;
    get isDisposed(): boolean;
    get events(): ICollaborationProviderEvents;
    private setStatus;
    connect(sharedModel: YNotebook, documentId: string, options?: Record<string, any>): Promise<void>;
    disconnect(): void;
    getProvider(): WebsocketProvider | null;
    getSharedModel(): YNotebook | null;
    handleConnectionClose(event: CloseEvent): void;
    handleSync(isSynced: boolean): void;
    dispose(): void;
}
export default DatalayerCollaborationProvider;
