/**
 * Acquire a channel-level A2A sync lock. Returns true if acquired,
 * false if another instance holds the lock. Uses atomic exclusive-create
 * (wx flag) to prevent TOCTOU races.
 *
 * Stale locks (>5 min old) are automatically cleaned up. This handles
 * gateway crashes between lock acquisition and Welcome processing.
 * After a crash, the first sync attempt on restart may encounter a stale
 * lock — it will be deleted and the lock re-acquired on the same call.
 */
export declare function acquireA2ASyncLock(dataDir: string, channelId: string): Promise<boolean>;
/**
 * Release the channel-level A2A sync lock. Idempotent — no error if
 * the lock file does not exist.
 */
export declare function releaseA2ASyncLock(dataDir: string, channelId: string): Promise<void>;
/**
 * Check if a pending Welcome KP bundle already exists for a group.
 */
export declare function hasPendingWelcome(dataDir: string, groupId: string): Promise<boolean>;
/**
 * Save a pending KeyPackage bundle to disk.
 * The KP bundle has complex typed fields — we serialize the private key material
 * (raw Uint8Arrays) to base64, and the public package as pre-serialized bytes.
 * `serializePublicFn` should be MLSGroupManager.serializeKeyPackage.
 */
export declare function savePendingKpBundle(dataDir: string, groupId: string, kp: any, serializePublicFn: (pub: any) => Uint8Array): Promise<void>;
/**
 * Load a pending KeyPackage bundle from disk.
 * Returns the raw private key material as Uint8Arrays.
 * The public package is returned as raw serialized bytes — the caller
 * must deserialize it if needed, or the Welcome handler can use just the private keys.
 */
export declare function loadPendingKpBundle(dataDir: string, groupId: string): Promise<any | null>;
/**
 * Clear the pending KP bundle (after successful Welcome join).
 */
export declare function clearPendingWelcome(dataDir: string, groupId: string): Promise<void>;
/**
 * Save MLS group state to a per-group file.
 * State is an opaque serialized string from MLSGroupManager.exportState().
 */
export declare function saveMlsState(dataDir: string, groupId: string, state: string): Promise<void>;
/**
 * Load MLS group state from a per-group file.
 * Returns null if the file doesn't exist (first join or after re-join cleanup).
 */
export declare function loadMlsState(dataDir: string, groupId: string): Promise<string | null>;
/**
 * Delete MLS group state file.
 * Used when re-joining a group (old state is invalid after re-join).
 */
export declare function deleteMlsState(dataDir: string, groupId: string): Promise<void>;
//# sourceMappingURL=mls-state.d.ts.map