/** * Рисмик in a partner platform's page: the lesson in an iframe, its events, its commands. * * const lesson = Whiteboard.mount(document.getElementById('lesson')!, { * url, // the participant's link, from your server (POST /lessons/{id}/links) * onEvent: (e) => console.log(e.type, e), * }) * const png = await lesson.command('exportPng') // data:image/png;base64,… * lesson.destroy() * * Messages are taken only from the lesson's own origin, and commands go only to it. */ export type LessonRole = 'teacher' | 'student'; export type LessonMode = 'full' | 'board_only'; export type LessonEvent = { type: 'wb:ready'; role: LessonRole; mode: LessonMode; lessonId: string; } | { type: 'wb:joined'; call: boolean; } | { type: 'wb:leave'; } | { type: 'wb:error'; code: 'link_expired' | 'not_found' | 'archived' | 'unavailable' | string; } | { type: 'wb:minutes-exhausted'; code: 'minutes_exhausted'; }; export type LessonCommand = 'exportPng' | 'exportPdf' | 'fitToScreen'; export type CommandResult = { exportPng: string; exportPdf: Blob; fitToScreen: true; }; export type MountOptions = { /** The participant's link (https://…/embed/). */ url: string; /** Every event of the lesson (wb:ready, wb:joined, wb:leave, wb:error, wb:minutes-exhausted). */ onEvent?: (event: LessonEvent) => void; /** CSS height of the frame (default 720px); the width is 100%. */ height?: string; /** The frame's accessible title. */ title?: string; /** How long a command may take (ms, default 30 000). */ commandTimeoutMs?: number; }; export type MountedLesson = { iframe: HTMLIFrameElement; /** Resolves once the lesson is ready (wb:ready), rejects on wb:error / wb:minutes-exhausted. */ ready: Promise>; command(command: C): Promise; destroy(): void; }; /** What the frame may use: the camera and the microphone for the call, the screen, fullscreen. */ export declare const FRAME_ALLOW = "camera; microphone; display-capture; fullscreen; clipboard-write"; export declare function mount(container: HTMLElement, options: MountOptions): MountedLesson;