export type VoiceRecordingCaptureState = "capturing" | "stopped" | "discarded"; export type VoiceRecordingUploadState = "pending" | "syncing" | "retrying" | "complete"; export type VoiceRecordingTranscriptionState = "pending" | "transcribing" | "retrying" | "complete"; export type VoiceRecordingFinalizationState = "pending" | "transcript-ready" | "handed-off"; export type VoiceRecordingChunkUploadState = "pending" | "syncing" | "complete"; export type VoiceRecordingRecoveryMode = "automatic" | "manual"; export type VoiceRecordingHandoffMode = "append" | "explicit"; export type VoiceRecordingManifest = { version: 1; recordingId: string; workspaceId: string; createdAt: string; updatedAt: string; mimeType: string; codec: string | null; captureState: VoiceRecordingCaptureState; uploadState: VoiceRecordingUploadState; transcriptionState: VoiceRecordingTranscriptionState; finalizationState: VoiceRecordingFinalizationState; /** Whether safe server reconciliation should continue without another user action. */ recoveryMode: VoiceRecordingRecoveryMode; /** Delayed/recovered results require explicit insertion instead of mutating an uncertain draft. */ handoffMode: VoiceRecordingHandoffMode; /** Tab/process lease. A different owner may take over only after this heartbeat is stale. */ ownerId: string | null; ownerHeartbeatAt: string | null; /** Authoritative provider result, persisted before any composer draft mutation. */ transcriptText: string | null; nextChunkNumber: number; chunkCount: number; totalBytes: number; totalDurationMilliseconds: number; }; export type VoiceRecordingChunk = { recordingId: string; chunkNumber: number; capturedAt: string; startMilliseconds: number; durationMilliseconds: number; mimeType: string; codec: string | null; byteLength: number; sha256: string; uploadState: VoiceRecordingChunkUploadState; audio: Blob; }; export type PersistVoiceRecordingChunkInput = { recordingId: string; ownerId?: string | undefined; chunkNumber: number; capturedAt: string; startMilliseconds: number; durationMilliseconds: number; mimeType: string; audio: Blob; }; export type PersistVoiceRecordingChunkResult = { manifest: VoiceRecordingManifest; chunk: VoiceRecordingChunk; deduplicated: boolean; }; export interface VoiceRecordingStore { createManifest(manifest: VoiceRecordingManifest): Promise; getManifest(recordingId: string): Promise; listRecoverableManifests(workspaceId: string, ownership?: { ownerId: string; staleBefore: string; }): Promise; claimManifest(recordingId: string, ownerId: string, claimedAt: string, staleBefore: string): Promise; listChunks(recordingId: string): Promise; persistChunk(input: PersistVoiceRecordingChunkInput): Promise; updateManifest(recordingId: string, update: Partial>, updatedAt: string, ownerId?: string | undefined): Promise; discard(recordingId: string, ownerId?: string | undefined): Promise; cleanupHandedOffManifests(ownership: { ownerId: string; staleBefore: string; }): Promise; close(): Promise; } export declare class VoiceRecordingStorageUnavailableError extends Error { constructor(); } export declare class VoiceRecordingNotFoundError extends Error { constructor(recordingId: string); } export declare class VoiceRecordingChunkConflictError extends Error { constructor(recordingId: string, chunkNumber: number); } export declare class VoiceRecordingChunkSequenceError extends Error { constructor(expected: number, received: number); } export declare class VoiceRecordingOwnedError extends Error { constructor(recordingId: string); } export declare function createVoiceRecordingManifest(input: { recordingId: string; workspaceId: string; mimeType: string; createdAt: string; ownerId?: string | null | undefined; }): VoiceRecordingManifest; export declare function prepareVoiceRecordingChunk(input: PersistVoiceRecordingChunkInput): Promise; export declare function planVoiceRecordingChunkCommit(input: { manifest: VoiceRecordingManifest; chunk: VoiceRecordingChunk; existingChunk: VoiceRecordingChunk | null; }): PersistVoiceRecordingChunkResult; export declare class IndexedDbVoiceRecordingStore implements VoiceRecordingStore { private readonly database; constructor(options?: { indexedDB?: IDBFactory | null; databaseName?: string; }); createManifest(manifest: VoiceRecordingManifest): Promise; getManifest(recordingId: string): Promise; listRecoverableManifests(workspaceId: string, ownership?: { ownerId: string; staleBefore: string; }): Promise; claimManifest(recordingId: string, ownerId: string, claimedAt: string, staleBefore: string): Promise; listChunks(recordingId: string): Promise; persistChunk(input: PersistVoiceRecordingChunkInput): Promise; updateManifest(recordingId: string, update: Partial>, updatedAt: string, ownerId?: string | undefined): Promise; discard(recordingId: string, ownerId?: string | undefined): Promise; cleanupHandedOffManifests(ownership: { ownerId: string; staleBefore: string; }): Promise; close(): Promise; }