import { Types } from 'ably';
import Space from './Space.js';
import type { Lock, SpaceMember } from './types.js';
import type { PresenceMember } from './utilities/types.js';
import EventEmitter, { type EventKey, type EventListener } from './utilities/EventEmitter.js';
export declare class LockAttributes extends Map<string, string> {
    toJSON(): {
        [k: string]: string;
    };
}
interface LockOptions {
    attributes: LockAttributes;
}
type LockEventMap = {
    update: Lock;
};
export default class Locks extends EventEmitter<LockEventMap> {
    private space;
    private presenceUpdate;
    private locks;
    constructor(space: Space, presenceUpdate: Space['presenceUpdate']);
    get(id: string): Lock | undefined;
    getAll(): Promise<Lock[]>;
    getSelf(): Promise<Lock[]>;
    getOthers(): Promise<Lock[]>;
    acquire(id: string, opts?: LockOptions): Promise<Lock>;
    release(id: string): Promise<void>;
    subscribe<K extends EventKey<LockEventMap>>(listenerOrEvents?: K | K[] | EventListener<LockEventMap[K]>, listener?: EventListener<LockEventMap[K]>): void;
    unsubscribe<K extends EventKey<LockEventMap>>(listenerOrEvents?: K | K[] | EventListener<LockEventMap[K]>, listener?: EventListener<LockEventMap[K]>): void;
    processPresenceMessage(message: Types.PresenceMessage): Promise<void>;
    processPending(member: SpaceMember, pendingLock: Lock): void;
    updatePresence(self: SpaceMember): Promise<void>;
    getLock(id: string, connectionId: string): Lock | undefined;
    setLock(lock: Lock): void;
    deleteLock(id: string, connectionId: string): boolean | undefined;
    private getLocksForConnectionId;
    getLockExtras(connectionId: string): PresenceMember['extras'];
}
export {};
