import { BaseUserMeta, Client as LiveblocksClient, LiveList, LiveObject, User } from "@liveblocks/client";
import { DeepReadonly } from "helpers/ts-type-helpers";
import React from "react";
import { UndoableAction } from "../redux/reducers/current-release/types";
import { SelectionState } from "../redux/reducers/editor/selection";
import { RootState } from "../redux/reducers/root";
import { AppMiddleware } from "../redux/stores/typed-redux-hooks";
declare global {
    interface Window {
        liveblocksSyncStorage: LiveObject<LiveblocksStorage> | null;
    }
}
/**
 * Liveblocks Client / Room types
 */
export declare const LIVEBLOCKS_SESSION_EXPIRED_MESSAGE = "Subframe session token expired; please refresh the page";
export declare function enterTypedLiveblocksRoom(client: LiveblocksClient, projectId: string, initialPresence: LiveblocksPresence): import("@liveblocks/core").Room<LiveblocksPresence, LiveblocksStorage, BaseUserMeta, never>;
export declare function leaveLiveblocksRoom(client: LiveblocksClient, projectId: string): void;
type LiveblocksPresence = {
    editingComponentId: string | null;
    selection: SelectionState | null;
    user: {
        id: string;
        email: string;
        avatarUrl: string | null;
    };
};
type UserMeta = BaseUserMeta;
/**
 * Ops Transaction types and helpers
 */
export type OpsTransaction = {
    id: string;
    ops: UndoableAction<object>[];
    timestamp: number;
    userId: string;
};
type LiveblocksOpsTransaction = LiveObject<Omit<OpsTransaction, "ops"> & {
    ops: LiveList<LiveObject<UndoableAction<any>>>;
}>;
export type LiveblocksStorage = {
    meta: LiveObject<{
        subframeVersion: string;
    }>;
    ops: LiveList<LiveblocksOpsTransaction>;
};
export declare const RoomContext: React.Context<import("@liveblocks/core").Room<LiveblocksPresence, LiveblocksStorage, BaseUserMeta, never> | null>, RoomProvider: (props: {
    id: string;
    children: React.ReactNode;
    autoConnect?: boolean | undefined;
    shouldInitiallyConnect?: boolean | undefined;
    unstable_batchedUpdates?: ((cb: () => void) => void) | undefined;
    initialPresence: LiveblocksPresence | ((roomId: string) => LiveblocksPresence);
    initialStorage?: LiveblocksStorage | ((roomId: string) => LiveblocksStorage) | undefined;
}) => JSX.Element, useOthers: {
    (): readonly User<LiveblocksPresence, BaseUserMeta>[];
    <T>(selector: (others: readonly User<LiveblocksPresence, BaseUserMeta>[]) => T, isEqual?: ((prev: T, curr: T) => boolean) | undefined): T;
}, useUpdateMyPresence: () => (patch: Partial<LiveblocksPresence>, options?: {
    addToHistory: boolean;
} | undefined) => void;
export declare const COLLABORATION_COLORS: readonly ["pink", "yellow", "green", "purple", "orange"];
export type CollaborationColorType = (typeof COLLABORATION_COLORS)[number];
export declare function getColorForOtherUser(others: User<LiveblocksPresence, UserMeta>[], userId: string): CollaborationColorType;
export declare function useOthersInComponentId(componentId: string): User<LiveblocksPresence, BaseUserMeta>[];
export declare function applyOpsToRelease(currentRelease: RootState["currentRelease"], inputRemoteOps: DeepReadonly<OpsTransaction[]>, localOps: readonly OpsTransaction[]): [
    RootState["currentRelease"],
    RootState["currentRelease"],
    OpsTransaction[],
    OpsTransaction[],
    Error | null
];
export declare function LiveblocksRoomProvider({ children, projectId }: {
    children: React.ReactNode;
    projectId: string;
}): React.JSX.Element;
export declare function useLiveblocksRoom(): {
    loading: boolean;
};
export declare const syncToLiveblocksMiddleware: AppMiddleware;
export {};
//# sourceMappingURL=liveblocks-client.d.ts.map