import "./recording_run.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type StyleProps } from "./style_props"; import { type CaptureSelection } from "./capture_selection"; /** One arm per phase, each carrying its verbs, so a phase drawn without its way out does not compile. */ export type RecordingRunState = { kind: "live"; elapsedSeconds: number; /** RMS level of the whole mix, 0–1, over the last `RECORDING_LEVEL_INTERVAL_MS`. */ level: number; /** The shared audio alone; `null` for microphone-only. Given, the meters split, since the person's * own voice keeps the mix moving whether or not the far end is captured. */ otherSideLevel: number | null; /** The share gave no sound, so only the microphone records; persistent, since a toast would be gone * when the transcript reveals it. */ shareAudioMissing: boolean; silent: boolean; onKeepRecording: () => void; onStop: () => void; /** Ends and throws away the recording untranscribed; absent where every recording is kept. */ onDiscard?: () => void; } | { kind: "processing"; /** Since the stop, or since a recovered recording was picked up. */ elapsedSeconds: number; /** Absent while filing: discarding then would hide the filing, not stop it. */ onDiscard?: () => void; } | { kind: "failed"; stage: "transcription" | "filing"; /** In the failing side's words. */ reason: string | null; onRetry: () => void; onDiscard: () => void; /** Saves the finished recording, so one that cannot be filed can still be kept. */ onDownload?: () => void; } | { kind: "interrupted"; elapsedSeconds: number; /** A resume re-acquires it. */ capture: CaptureSelection; /** False when this browser cannot append to the codec. */ canResume: boolean; onResume: () => void; onFinalize: () => void; onDiscard: () => void; }; interface RecordingRunBase extends StyleProps { state: RecordingRunState; /** What the run holds so far — e.g. the finished `Recording` of a failed filing, still playable. */ children?: React.ReactNode; /** Prefixes every part a test reaches: `-timer`, `-level`, `-stop-button`… */ testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** The whole panel, centred, while it records. */ export interface RecordingRunPaneProps extends RecordingRunBase { variant: "pane"; } /** One floating strip over whatever the person moved on to. */ export interface RecordingRunPillProps extends RecordingRunBase { variant: "pill"; /** Named by the surface owning the capture, never by the requester, which could otherwise label the * consent. */ label: string; onExpand?: () => void; } /** One floating card over whatever came next, so a recorded call is never forgotten: state, a large clock, * destination, each side's sound, every verb. */ export interface RecordingRunPanelProps extends RecordingRunBase { variant: "panel"; /** The pill's `label`, by the same rule. */ label: string; /** The surface keeps which of card and pill it draws. */ onMinimize: () => void; } export type RecordingRunProps = RecordingRunPaneProps | RecordingRunPillProps | RecordingRunPanelProps; /** A quarter second: each level is the loudness over its interval, so slower draws samples twice, faster * draws instants and speech reads as gaps between syllables. */ export declare const RECORDING_LEVEL_INTERVAL_MS = 250; /** A recording from first second to transcript: `live` (clock, level, Stop), `processing`, `failed`, * `interrupted`, each arm carrying its verbs. `pane` is the surface while recording; `panel` floats over * what the person opened next, naming the destination; `pill` is the panel folded — `AgentRun`'s * vocabulary for screen entitlement. */ export declare function RecordingRun(props: RecordingRunProps): React.ReactElement>; export {};