/** * The workspace's one meeting recorder, held above the routes so a recording * keeps going while the person moves around the app. * * The capture code (MediaRecorder, IndexedDB, the uploader) loads lazily: the * host mounts the first time someone opens Meetings, or at startup when this * browser still holds a recording that hasn't finished uploading. The live * snapshot changes several times a second while recording, so it lives in an * external store; only the components that read it re-render. * * In the desktop app, the provider also carries out the call notifications' * choices; the host says where Meetings and a meeting are with * `onOpenMeetings` and `onOpenMeeting`. * * A recording belongs to the workspace it started in and keeps going when the * person moves to another workspace: the recorder follows the host's current * workspace only while nothing is being captured. It belongs to the person * too: a host that signs people in passes them as `scope`, and a recording * ends at once when they sign out or someone else signs in. */ import { type ReactNode } from "react"; import type { UseRecorderResult } from "../recordings.js"; export { canStartRecording } from "./recorder-state.js"; export type MeetingRecorder = UseRecorderResult; /** * A recording someone asked for outside the recorder, such as from a desktop * call notification. An empty title leaves the name to Opengeni; `app` marks * a title the app guessed (the call app's name), which a calendar event or * the conversation replaces. */ export type MeetingStartRequest = { title: string; titleSource?: "person" | "app"; }; export type MeetingRecorderStore = { get: () => MeetingRecorder | null; subscribe: (listener: () => void) => () => void; /** Publish the recorder, and the workspace its recordings go to. */ set: (recorder: MeetingRecorder | null, workspaceId?: string | null) => void; /** Recordings whose upload finished in this tab, newest last. */ finished: () => readonly string[]; markFinished: (recordingId: string) => void; /** A start the recorder panel should make as soon as it can, or null. */ pendingStart: () => MeetingStartRequest | null; requestStart: (request: MeetingStartRequest) => void; /** Take the pending start, so it happens once. */ takeStart: () => MeetingStartRequest | null; /** Load the capture code. Idempotent. */ activate: () => void; /** * The workspace the recorder's recordings go to: while one records, the * workspace it started in, even after the person moved to another one. * Absent from stores made before it existed. */ workspaceId?: () => string | null; /** * Open a recorded meeting in its own workspace, through the host's * `onOpenMeeting`. False when the host gave no way to. */ openMeeting?: (recordingId: string, workspaceId: string) => boolean; }; export declare function createMeetingRecorderStore(onActivate?: () => void, onOpenMeeting?: (recordingId: string, workspaceId: string) => boolean): MeetingRecorderStore; export declare const MeetingRecorderStoreProvider: import("react").Provider; export declare function MeetingRecorderProvider({ workspaceId, scope, client, onOpenMeetings, onOpenMeeting, children, }: { /** The workspace recordings go to; null while the host is still finding it. */ workspaceId: string | null; /** * Who records, such as the signed-in person's id, for a host that mounts * this above sign-in. A new value ends a recording at once and starts a * fresh recorder; null means nobody is signed in, so there is no recorder. * Omit it when the host remounts the provider when the person changes. */ scope?: string | null | undefined; /** * The SDK client the recorder uploads with, for a host that mounts this * above its routes without an there. The provider's * client otherwise. */ client?: object | undefined; /** Show the Meetings page, where a desktop call notification's recording starts. */ onOpenMeetings?: (() => void) | undefined; /** * Show one meeting, after a desktop call notification stopped its recording * or a recording made in another workspace stopped. `workspaceId` is the * workspace the meeting is in, which may not be the one shown. */ onOpenMeeting?: ((recordingId: string, workspaceId: string) => void) | undefined; children: ReactNode; }): import("react").JSX.Element; /** The start a desktop notification asked for, until the recorder panel takes it. */ export declare function usePendingMeetingStart(): { request: MeetingStartRequest | null; take: () => MeetingStartRequest | null; }; /** The live recorder, loading it on first use. Null until the capture code is ready. */ export declare function useMeetingRecorder(): { recorder: MeetingRecorder | null; finished: readonly string[]; /** The workspace the recorder's recording is in; may differ from the one shown. */ workspaceId: string | null; /** * Open a meeting the recorder made in its own workspace. False when the * host gave no way to, so the caller opens it as usual. */ openMeeting: (recordingId: string, workspaceId: string) => boolean; }; /** Only the recorder's state word, for the rail: re-renders on state changes, not on every tick. */ export declare function useMeetingRecorderState(): MeetingRecorder["state"] | null; /** * The recorder's Start and Stop, for the app's actions (⌘K, keys, the desktop * menu bar). Null without a recorder provider. Re-renders on state changes, * not on every tick. */ export type MeetingRecorderControls = { /** The recorder's state; null until its capture code loads. */ state: MeetingRecorder["state"] | null; /** Whether this browser can record; null until the capture code loads. */ supported: boolean | null; /** * Start recording as the Meetings page's Start recording button does, once * that page's recorder is ready; the caller shows Meetings next. Does * nothing while a recording is going. */ requestStart: () => void; /** Stop the recording and open it, as a desktop call notification's Stop does. */ stop: () => Promise; }; /** The meeting a Stop ended; `opened` is false when the host gave no way to open it. */ export type StoppedMeeting = { recordingId: string; workspaceId: string; opened: boolean; }; export declare function useMeetingRecorderControls(): MeetingRecorderControls | null;