pdfjs-reader-core 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -5,6 +5,7 @@ import * as pdfjsDist from 'pdfjs-dist';
5
5
  export { pdfjsDist as pdfjsLib };
6
6
  import * as zustand from 'zustand';
7
7
  import * as react_jsx_runtime from 'react/jsx-runtime';
8
+ import { z } from 'zod';
8
9
  import * as pdfjs_dist_types_src_display_api from 'pdfjs-dist/types/src/display/api';
9
10
  import { ClassValue } from 'clsx';
10
11
  import * as pdfjs_dist_types_src_display_metadata from 'pdfjs-dist/types/src/display/metadata';
@@ -247,6 +248,147 @@ interface StudentModeProps {
247
248
  askAboutLongPressDuration?: number;
248
249
  }
249
250
 
251
+ type BlockType = 'heading' | 'paragraph' | 'list_item' | 'figure' | 'figure_region' | 'caption' | 'table' | 'mcq_option';
252
+ type DefaultAction = 'zoom_pan' | 'spotlight' | 'underline' | 'pulse';
253
+ /** Four numbers: [x1, y1, x2, y2] in PDF coordinates (origin top-left). */
254
+ type BBoxCoords = readonly [number, number, number, number];
255
+ interface Block {
256
+ block_id: string;
257
+ bbox: BBoxCoords;
258
+ text: string | null;
259
+ type: BlockType;
260
+ parent_id: string | null;
261
+ confidence: number;
262
+ reading_order: number;
263
+ default_action: DefaultAction;
264
+ semantic_unit_id: string;
265
+ }
266
+ interface PageDimensionsDpi {
267
+ width: number;
268
+ height: number;
269
+ dpi: number;
270
+ }
271
+ interface PageBBoxData {
272
+ id: string;
273
+ page_number: number;
274
+ page_text: string;
275
+ page_dimensions: PageDimensionsDpi;
276
+ blocks: Block[];
277
+ created_at: string;
278
+ }
279
+ /** Lookup indexes used by the director + engine. */
280
+ interface BBoxIndex {
281
+ byPage: Map<number, PageBBoxData>;
282
+ blockById: Map<string, {
283
+ block: Block;
284
+ pageNumber: number;
285
+ }>;
286
+ crossPageFigures: Array<{
287
+ block_id: string;
288
+ page: number;
289
+ type: 'figure' | 'figure_region' | 'caption';
290
+ text: string;
291
+ }>;
292
+ }
293
+
294
+ type EasingName = 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out';
295
+ type SpotlightShape = 'rect' | 'rounded' | 'ellipse';
296
+ type UnderlineStyle = 'straight' | 'sketch' | 'double' | 'wavy';
297
+ type ArrowCurve = 'straight' | 'curved' | 'zigzag';
298
+ type PulseIntensity = 'subtle' | 'normal' | 'strong';
299
+ type BoxStyle = 'solid' | 'dashed';
300
+ type LabelPosition = 'top' | 'bottom' | 'left' | 'right';
301
+ type GhostPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
302
+ type ClearTarget = 'all' | 'spotlights' | 'overlays' | string[];
303
+ interface ActionCamera {
304
+ type: 'camera';
305
+ target_block?: string;
306
+ target_bbox?: BBoxCoords;
307
+ scale: number;
308
+ padding: number;
309
+ easing: EasingName;
310
+ }
311
+ interface ActionSpotlight {
312
+ type: 'spotlight';
313
+ target_block: string;
314
+ dim_opacity: number;
315
+ feather_px: number;
316
+ shape: SpotlightShape;
317
+ }
318
+ interface ActionUnderline {
319
+ type: 'underline';
320
+ target_block: string;
321
+ color: string;
322
+ style: UnderlineStyle;
323
+ draw_duration_ms: number;
324
+ }
325
+ interface ActionHighlight {
326
+ type: 'highlight';
327
+ target_block: string;
328
+ color: string;
329
+ draw_duration_ms: number;
330
+ }
331
+ interface ActionPulse {
332
+ type: 'pulse';
333
+ target_block: string;
334
+ count: number;
335
+ intensity: PulseIntensity;
336
+ }
337
+ interface ActionCallout {
338
+ type: 'callout';
339
+ from_block: string;
340
+ to_block: string;
341
+ label?: string;
342
+ curve: ArrowCurve;
343
+ }
344
+ interface ActionGhostReference {
345
+ type: 'ghost_reference';
346
+ target_page: number;
347
+ target_block: string;
348
+ position: GhostPosition;
349
+ }
350
+ interface ActionBox {
351
+ type: 'box';
352
+ target_block: string;
353
+ color: string;
354
+ style: BoxStyle;
355
+ }
356
+ interface ActionLabel {
357
+ type: 'label';
358
+ target_block: string;
359
+ text: string;
360
+ position: LabelPosition;
361
+ }
362
+ interface ActionClear {
363
+ type: 'clear';
364
+ targets: ClearTarget;
365
+ }
366
+ type StoryboardAction = ActionCamera | ActionSpotlight | ActionUnderline | ActionHighlight | ActionPulse | ActionCallout | ActionGhostReference | ActionBox | ActionLabel | ActionClear;
367
+ interface StoryboardStep {
368
+ at_ms: number;
369
+ duration_ms: number;
370
+ action: StoryboardAction;
371
+ }
372
+ interface Storyboard {
373
+ version: 1;
374
+ reasoning: string;
375
+ steps: StoryboardStep[];
376
+ }
377
+ /** Active overlay state tracked by the engine / store. */
378
+ interface ActiveOverlay {
379
+ id: string;
380
+ kind: StoryboardAction['type'];
381
+ action: StoryboardAction;
382
+ createdAt: number;
383
+ expiresAt: number;
384
+ }
385
+ interface CameraState {
386
+ scale: number;
387
+ x: number;
388
+ y: number;
389
+ easing: EasingName;
390
+ }
391
+
250
392
  interface PDFViewerProps {
251
393
  /** URL or ArrayBuffer of the PDF file */
252
394
  src: string | ArrayBuffer | Uint8Array;
@@ -326,7 +468,7 @@ interface PageDimensions {
326
468
  height: number;
327
469
  scale: number;
328
470
  }
329
- type ViewMode = 'single' | 'dual' | 'continuous' | 'book';
471
+ type ViewMode = 'single' | 'dual' | 'continuous' | 'book' | 'tutor';
330
472
  type ScrollMode = 'single' | 'continuous';
331
473
  type SidebarPanel = 'thumbnails' | 'outline' | 'search' | 'annotations' | null;
332
474
  type Theme = 'light' | 'dark' | 'sepia';
@@ -823,7 +965,7 @@ interface PDFViewerHandle {
823
965
  *
824
966
  * @example
825
967
  * ```tsx
826
- * import { PDFViewer } from '@pdf-reader/core';
968
+ * import { PDFViewer } from 'pdfjs-reader-core';
827
969
  *
828
970
  * function App() {
829
971
  * return (
@@ -1489,6 +1631,912 @@ interface PDFLoadingScreenProps {
1489
1631
  */
1490
1632
  declare const PDFLoadingScreen: react.NamedExoticComponent<PDFLoadingScreenProps>;
1491
1633
 
1634
+ interface ChunkHistoryEntry {
1635
+ text: string;
1636
+ pageNumber: number;
1637
+ timestamp: number;
1638
+ }
1639
+ type EngineStatus = 'idle' | 'transitioning' | 'executing';
1640
+ type LlmStatus = 'idle' | 'in-flight' | 'failed';
1641
+ interface DebugEvent {
1642
+ id: string;
1643
+ timestamp: number;
1644
+ kind: 'chunk' | 'llm-request' | 'llm-response' | 'llm-error' | 'storyboard-execute' | 'fallback-fired' | 'note';
1645
+ /** Short headline shown in the log */
1646
+ summary: string;
1647
+ /** Full payload (chunk text, raw LLM response, parsed storyboard, error, etc.) */
1648
+ payload?: unknown;
1649
+ }
1650
+ interface NarrationState {
1651
+ currentChunk: string | null;
1652
+ currentPage: number;
1653
+ chunkHistory: ChunkHistoryEntry[];
1654
+ camera: CameraState;
1655
+ activeOverlays: ActiveOverlay[];
1656
+ engineStatus: EngineStatus;
1657
+ llmStatus: LlmStatus;
1658
+ lastStoryboard: Storyboard | null;
1659
+ lastError: string | null;
1660
+ isPaused: boolean;
1661
+ debugEvents: DebugEvent[];
1662
+ }
1663
+ interface NarrationActions {
1664
+ setCurrentChunk: (chunk: string | null) => void;
1665
+ setCurrentPage: (page: number) => void;
1666
+ pushChunkHistory: (entry: ChunkHistoryEntry) => void;
1667
+ setCamera: (camera: Partial<CameraState>) => void;
1668
+ addOverlay: (overlay: ActiveOverlay) => void;
1669
+ removeOverlay: (id: string) => void;
1670
+ clearOverlays: (predicate?: (o: ActiveOverlay) => boolean) => void;
1671
+ setEngineStatus: (s: EngineStatus) => void;
1672
+ setLlmStatus: (s: LlmStatus, error?: string | null) => void;
1673
+ setLastStoryboard: (sb: Storyboard | null) => void;
1674
+ setPaused: (paused: boolean) => void;
1675
+ appendDebugEvent: (event: Omit<DebugEvent, 'id' | 'timestamp'>) => void;
1676
+ clearDebugEvents: () => void;
1677
+ reset: () => void;
1678
+ }
1679
+ type NarrationStore = NarrationState & NarrationActions;
1680
+ declare function createNarrationStore(overrides?: Partial<NarrationState>): zustand.StoreApi<NarrationStore>;
1681
+ type NarrationStoreApi = ReturnType<typeof createNarrationStore>;
1682
+ declare function makeOverlayId(action: StoryboardAction): string;
1683
+
1684
+ declare const SYSTEM_PROMPT = "You are the cinematic director of an AI tutor's PDF visualization. The tutor speaks one \"chunk\" at a time; for each chunk you anchor the visuals onto the EXACT blocks on the page the tutor is talking about, so the reader sees the page react like a produced teaching video. Think of yourself as a motion designer layering effects on top of a document \u2014 zoom is only one tool in the kit, and often not the right one.\n\n# Your primary task\nYou are given a list of blocks for the current page under \"Page blocks\", each with a `block_id`, `text`, `type`, `bbox`, and `default_action`. Your #1 job is to decide WHICH block(s) the current chunk is referring to, and then pick the right visual action(s) to anchor there.\n\nAnchoring rules:\n- EVERY action that references a block MUST set `target_block` (or `from_block`/`to_block` for callouts) to an EXISTING `block_id` from \"Page blocks\" (or \"Cross-page figures index\" for cross-page refs). Never invent an id. Never emit a step whose target can't be found in the provided lists.\n- Match the chunk to blocks by semantic overlap with the block's `text`: quoted phrases, named entities, keywords, figure references (\"Fig 3.2\", \"the suture\"), list enumerations.\n- If no block clearly matches, emit a single `camera` step that fits the page (no overlays) and explain in `reasoning`. Do NOT spray overlays onto random blocks.\n- If multiple blocks match, pick the most specific one, or use a `callout` from one to the other.\n\n# Output shape\nOutput ONLY this JSON, nothing else:\n{\n \"version\": 1,\n \"reasoning\": \"<which block(s) you picked, which intent you used, and why \u2014 name the block_id>\",\n \"steps\": [ { \"at_ms\": <int>, \"duration_ms\": <int>, \"action\": <action> }, ... ]\n}\n\n# Action shapes \u2014 ALL fields shown are REQUIRED per action type\n- camera: { \"type\":\"camera\", \"target_block\":\"<id>\", \"scale\":1.1, \"padding\":80, \"easing\":\"ease-out\" }\n- spotlight: { \"type\":\"spotlight\", \"target_block\":\"<id>\", \"dim_opacity\":0.65, \"feather_px\":40, \"shape\":\"rounded\" }\n- underline: { \"type\":\"underline\", \"target_block\":\"<id>\", \"color\":\"#FBBF24\", \"style\":\"sketch\", \"draw_duration_ms\":600 }\n- highlight: { \"type\":\"highlight\", \"target_block\":\"<id>\", \"color\":\"rgba(250,204,21,0.35)\", \"draw_duration_ms\":500 }\n- pulse: { \"type\":\"pulse\", \"target_block\":\"<id>\", \"count\":2, \"intensity\":\"normal\" }\n- callout: { \"type\":\"callout\", \"from_block\":\"<id>\", \"to_block\":\"<id>\", \"label\":\"<text>\", \"curve\":\"curved\" }\n- ghost_reference: { \"type\":\"ghost_reference\", \"target_page\":<int>, \"target_block\":\"<id>\", \"position\":\"top-right\" }\n- box: { \"type\":\"box\", \"target_block\":\"<id>\", \"color\":\"#3B82F6\", \"style\":\"solid\" }\n- label: { \"type\":\"label\", \"target_block\":\"<id>\", \"text\":\"<text>\", \"position\":\"top\" }\n- clear: { \"type\":\"clear\", \"targets\":\"overlays\" }\n\n# When to use each action (match the effect to the narration's intent, not just the block type)\n- camera \u2014 when focus SHIFTS to a new region. If the primary block is already on-screen and roughly centered, you may skip camera entirely and start with an overlay. When you do use camera, prefer scale 1.1\u20131.4 for gentle re-centering; reserve 1.5+ for dense figures you need to inspect closely.\n- spotlight \u2014 when narration ISOLATES one idea, term, or sentence. Great for definitions, principles, and \"the key insight is\u2026\" moments.\n- underline \u2014 when narration QUOTES a phrase or reads a line word-by-word. Use style \"sketch\" for handwritten feel, \"straight\" for formal, \"wavy\" for emphasis. Pairs well with spotlight.\n- highlight \u2014 when narration FLAGS a keyword inline without full focus. Cheap, fast, great for list items, definitions-in-context, callback references.\n- pulse \u2014 when narration says \"notice this\" / \"see here\" / \"look at the diagram\". Use with figures, icons, and anchor blocks that should catch the eye without blocking surrounding content.\n- callout \u2014 when narration CONNECTS two things on the page: a caption to its figure, a label to a region, one list item to another. Arrow implies directional meaning.\n- ghost_reference \u2014 when narration REFERS to a block on a DIFFERENT page (\"as we saw on page 2\u2026\"). Never use for same-page references.\n- box \u2014 when narration FRAMES a structural region: a table, a sidebar, a group of related items, a diagram subpart. Use dashed style for \"in-progress\" / \"under discussion\" regions.\n- label \u2014 when narration attaches a NAMED TAG to a block: \"this is the definition\", \"this is an example\", \"step 3\". Keep text \u226440 chars for readability.\n- clear \u2014 rarely needed; the engine auto-expires overlays. Use only when you explicitly want to wipe prior state before a new beat.\n\nRespect each block's `default_action` as a soft hint, but override it freely when narration intent calls for a different effect. A paragraph labeled `default_action: spotlight` can absolutely take a highlight or underline if that's what the narration asks for.\n\n# Intent Taxonomy \u2014 canonical \"recipes\" you should use as your default vocabulary\nWhen narration fits one of these patterns, emit the corresponding storyboard shape (fill in real block_ids from the page). You may also COMPOSE freely beyond these \u2014 they are a floor, not a ceiling.\n\n## define \u2014 the narration introduces or defines a term\nShape: spotlight the term + underline it + drop a label tag. No camera move if the block is already on-screen.\n{\n \"version\": 1,\n \"reasoning\": \"define recipe: spotlighting and underlining the term, labeling as 'definition'\",\n \"steps\": [\n { \"at_ms\":0, \"duration_ms\":700, \"action\": { \"type\":\"spotlight\", \"target_block\":\"p1_para0\", \"dim_opacity\":0.6, \"feather_px\":40, \"shape\":\"rounded\" } },\n { \"at_ms\":200, \"duration_ms\":800, \"action\": { \"type\":\"underline\", \"target_block\":\"p1_para0\", \"color\":\"#FBBF24\", \"style\":\"sketch\", \"draw_duration_ms\":700 } },\n { \"at_ms\":900, \"duration_ms\":1200, \"action\": { \"type\":\"label\", \"target_block\":\"p1_para0\", \"text\":\"definition\", \"position\":\"top\" } }\n ]\n}\n\n## point_out \u2014 the narration directs the viewer's eye to a figure, diagram, or specific region\nShape: gentle camera move + callout arrow from caption to figure + pulse the figure.\n{\n \"version\": 1,\n \"reasoning\": \"point_out recipe: drawing attention from caption p1_cap1 to figure p1_fig0\",\n \"steps\": [\n { \"at_ms\":0, \"duration_ms\":600, \"action\": { \"type\":\"camera\", \"target_block\":\"p1_fig0\", \"scale\":1.3, \"padding\":80, \"easing\":\"ease-out\" } },\n { \"at_ms\":400, \"duration_ms\":900, \"action\": { \"type\":\"callout\", \"from_block\":\"p1_cap1\", \"to_block\":\"p1_fig0\", \"label\":\"see here\", \"curve\":\"curved\" } },\n { \"at_ms\":900, \"duration_ms\":1200, \"action\": { \"type\":\"pulse\", \"target_block\":\"p1_fig0\", \"count\":2, \"intensity\":\"normal\" } }\n ]\n}\n\n## compare \u2014 the narration contrasts two things on the page\nShape: box A + box B + callout between them with a relational label.\n{\n \"version\": 1,\n \"reasoning\": \"compare recipe: framing fibrous vs synovial joints\",\n \"steps\": [\n { \"at_ms\":0, \"duration_ms\":600, \"action\": { \"type\":\"box\", \"target_block\":\"p1_list5\", \"color\":\"#3B82F6\", \"style\":\"solid\" } },\n { \"at_ms\":300, \"duration_ms\":600, \"action\": { \"type\":\"box\", \"target_block\":\"p1_list12\", \"color\":\"#F472B6\", \"style\":\"solid\" } },\n { \"at_ms\":800, \"duration_ms\":1000, \"action\": { \"type\":\"callout\", \"from_block\":\"p1_list5\", \"to_block\":\"p1_list12\", \"label\":\"vs\", \"curve\":\"curved\" } }\n ]\n}\n\n## emphasize \u2014 the narration stresses a keyword, warning, or takeaway\nShape: highlight + pulse. Fast, punchy, no camera.\n{\n \"version\": 1,\n \"reasoning\": \"emphasize recipe: highlighting key keyword and pulsing for stress\",\n \"steps\": [\n { \"at_ms\":0, \"duration_ms\":500, \"action\": { \"type\":\"highlight\", \"target_block\":\"p1_list0\", \"color\":\"rgba(250,204,21,0.35)\", \"draw_duration_ms\":450 } },\n { \"at_ms\":350, \"duration_ms\":800, \"action\": { \"type\":\"pulse\", \"target_block\":\"p1_list0\", \"count\":2, \"intensity\":\"strong\" } }\n ]\n}\n\n# Choreography rules\n- HARD REQUIREMENT: every storyboard MUST contain at least ONE non-camera step. A lone camera step is NEVER a valid output \u2014 the viewer needs an overlay to know WHY the camera moved. If you cannot find a good overlay target, emit a `highlight` or `pulse` on your primary block as the second step.\n- Favor VARIETY that matches narration texture \u2014 a definition earns different visuals than a comparison. Don't send every chunk through the same zoom+box motion.\n- Include a camera step only when focus genuinely shifts to a new region. If the primary target is already on-screen and roughly centred, SKIP the camera entirely and start directly with an overlay.\n- Camera scale: default to **1.1** (gentle re-centre). Use **1.2\u20131.3** for normal reading distance. Use **1.4\u20131.6** ONLY for dense figures or small inline details. NEVER use a scale below 0.5 or above 4.0 \u2014 the engine rejects those. When in doubt, use 1.1.\n- Prefer overlays that OVERLAP the camera move. A camera that takes 700ms to finish while overlays fire at 200ms feels cinematic; overlays waiting until after the camera settles feel sluggish. Stagger `at_ms`: camera at 0, first overlay at 150\u2013300ms, second overlay at 600\u2013900ms.\n- 2\u20134 steps is typical; single-step overlays (no camera) are PREFERRED when the target is already visible.\n- When narration compares two things, USE the compare recipe (box + box + callout), not a single camera step. When narration says \"key takeaway\", USE emphasize (highlight + pulse).\n- Never target a block_id not present in the provided lists. If no block matches, emit a single camera step at scale 1.0 + a subtle pulse on the nearest heading; explain in `reasoning`.\n- Output ONLY valid JSON. No markdown, no code fences, no commentary, no trailing whitespace inside property values.\n\n# Forbidden outputs \u2014 these will be rejected:\n- A storyboard with only a camera step.\n- A camera step with scale < 0.5 or > 4.0.\n- target_block values not listed in \"Page blocks\" or \"Cross-page figures index\".\n- Tab characters, newlines, or explanatory text inside JSON string values.";
1685
+ interface BuildUserPromptInput {
1686
+ chunk: string;
1687
+ pageNumber: number;
1688
+ page: PageBBoxData;
1689
+ index: BBoxIndex;
1690
+ history: ChunkHistoryEntry[];
1691
+ camera: CameraState;
1692
+ activeOverlays: ActiveOverlay[];
1693
+ maxSteps?: number;
1694
+ }
1695
+ /** Truncate text to ~max chars, word-aware. */
1696
+ declare function truncate(text: string | null, max?: number): string;
1697
+ declare function buildUserPrompt(input: BuildUserPromptInput): string;
1698
+
1699
+ interface LlmConfig {
1700
+ endpointUrl: string;
1701
+ model: string;
1702
+ authToken?: string;
1703
+ extraBody?: Record<string, unknown>;
1704
+ maxTokens?: number;
1705
+ temperature?: number;
1706
+ /** If true, include response_format: json_schema (disable if the backend doesn't support it). */
1707
+ useJsonSchema?: boolean;
1708
+ /** If true, request streaming (default false: simpler, more reliable for non-streaming backends). */
1709
+ stream?: boolean;
1710
+ }
1711
+ interface DirectorInput extends BuildUserPromptInput {
1712
+ signal?: AbortSignal;
1713
+ timeoutMs?: number;
1714
+ }
1715
+ interface DirectorResult {
1716
+ storyboard: Storyboard | null;
1717
+ raw: string;
1718
+ error?: string;
1719
+ }
1720
+ /**
1721
+ * Call the LLM, stream the response, extract a JSON storyboard, validate with zod.
1722
+ * Returns { storyboard: null } with an error string on any failure path.
1723
+ */
1724
+ declare function directStoryboard(config: LlmConfig, input: DirectorInput): Promise<DirectorResult>;
1725
+
1726
+ interface EmbeddingProvider {
1727
+ /** Return embeddings (normalized or raw — similarity function handles either). */
1728
+ embed: (texts: string[]) => Promise<Float32Array[]>;
1729
+ }
1730
+ declare function cosineSimilarity(a: Float32Array, b: Float32Array): number;
1731
+ interface BlockMatch {
1732
+ block: Block;
1733
+ score: number;
1734
+ }
1735
+ declare function matchChunkToBlock(chunk: string, page: PageBBoxData, provider: EmbeddingProvider): Promise<BlockMatch | null>;
1736
+ /**
1737
+ * Build a fallback storyboard from a matched block. Keys on `block.type`
1738
+ * (7 types) rather than `block.default_action` (4 values) so every block
1739
+ * class produces a visually distinct storyboard — not every failure rounds
1740
+ * down to camera + box. An optional `page` lets caption blocks route to a
1741
+ * callout→figure on the same page.
1742
+ *
1743
+ * Never throws — emits a clear-only storyboard when no match is supplied.
1744
+ */
1745
+ declare function storyboardFromMatch(match: BlockMatch | null, page?: PageBBoxData): Storyboard;
1746
+
1747
+ interface TutorModeContainerProps {
1748
+ pageNumber: number;
1749
+ bboxData: PageBBoxData[];
1750
+ narrationStore: NarrationStoreApi;
1751
+ scale: number;
1752
+ rotation?: number;
1753
+ /** Reactive chunk from the tutor (updates as she speaks) */
1754
+ currentChunk?: string | null;
1755
+ /** LLM endpoint configuration provided by the consumer */
1756
+ llm?: LlmConfig;
1757
+ /** Milliseconds of no new chunks before the camera returns to fit-page */
1758
+ idleTimeoutMs?: number;
1759
+ /** LLM call timeout in ms. Default 30000 (Qwen3-32B and similar can take 5-15s). */
1760
+ llmTimeoutMs?: number;
1761
+ /** Optional embedding provider for fallback matching when the LLM fails */
1762
+ embeddingProvider?: EmbeddingProvider;
1763
+ /** Show subtitle bar with the current chunk text (default: true) */
1764
+ showSubtitles?: boolean;
1765
+ /**
1766
+ * Show the "Reset view" button (default: true). Clicking it clears all
1767
+ * overlays and returns the camera to fit-page. If `onExitTutorMode` is
1768
+ * also provided, it runs after the reset — useful when the host app
1769
+ * wants the same button to also leave tutor mode entirely.
1770
+ */
1771
+ showExitButton?: boolean;
1772
+ /**
1773
+ * Optional callback fired AFTER the engine's resetVisuals. Provide this
1774
+ * only if the host wants the reset button to also leave tutor mode /
1775
+ * navigate away. Omit it for a pure "reset the visuals" behaviour.
1776
+ */
1777
+ onExitTutorMode?: () => void;
1778
+ /**
1779
+ * Minimum hold time (ms) for every overlay, regardless of the
1780
+ * `duration_ms` the LLM specifies. Short LLM-emitted durations (600-1200ms)
1781
+ * flash past too quickly to read; bump this for narration-paired UX.
1782
+ * Default: 3500ms.
1783
+ */
1784
+ minOverlayDurationMs?: number;
1785
+ className?: string;
1786
+ }
1787
+ /** Build a cross-page/block index from the raw bbox list. */
1788
+ declare function buildBBoxIndex(bboxData: PageBBoxData[]): BBoxIndex;
1789
+ declare function TutorModeContainer({ pageNumber, bboxData, narrationStore, scale, rotation, currentChunk, llm, idleTimeoutMs, llmTimeoutMs, embeddingProvider, showSubtitles, showExitButton, onExitTutorMode, minOverlayDurationMs, className, }: TutorModeContainerProps): react_jsx_runtime.JSX.Element;
1790
+
1791
+ interface CinemaLayerProps {
1792
+ page: PageBBoxData;
1793
+ index: BBoxIndex;
1794
+ overlays: ActiveOverlay[];
1795
+ scale: number;
1796
+ }
1797
+ declare function CinemaLayer({ page, index, overlays, scale, }: CinemaLayerProps): react_jsx_runtime.JSX.Element;
1798
+
1799
+ interface CameraViewProps {
1800
+ camera: CameraState;
1801
+ children: react__default.ReactNode;
1802
+ /** total duration for the tween, in ms */
1803
+ durationMs?: number;
1804
+ className?: string;
1805
+ }
1806
+ /**
1807
+ * Wraps page content in a Framer Motion container that animates scale+translate.
1808
+ * The origin is the center of the container.
1809
+ */
1810
+ declare function CameraView({ camera, children, durationMs, className, }: CameraViewProps): react_jsx_runtime.JSX.Element;
1811
+
1812
+ interface SpotlightMaskProps {
1813
+ page: PageDimensionsDpi;
1814
+ bbox: BBoxCoords;
1815
+ action: ActionSpotlight;
1816
+ durationMs?: number;
1817
+ }
1818
+ /**
1819
+ * Full-page SVG overlay: dims the entire page with action.dim_opacity,
1820
+ * then "cuts out" a rounded/rect/ellipse hole over the target bbox so
1821
+ * the underlying page shows through. Uses an SVG mask with a blur filter
1822
+ * to feather the edge.
1823
+ *
1824
+ * Rendered in PAGE coords (viewBox spans the full page). The parent
1825
+ * CinemaLayer applies the overall scale transform.
1826
+ */
1827
+ declare function SpotlightMask({ page, bbox, action, durationMs, }: SpotlightMaskProps): react_jsx_runtime.JSX.Element;
1828
+
1829
+ interface AnimatedUnderlineProps {
1830
+ bbox: BBoxCoords;
1831
+ action: ActionUnderline;
1832
+ }
1833
+ declare function AnimatedUnderline({ bbox, action }: AnimatedUnderlineProps): react_jsx_runtime.JSX.Element;
1834
+
1835
+ interface AnimatedHighlightProps {
1836
+ bbox: BBoxCoords;
1837
+ action: ActionHighlight;
1838
+ }
1839
+ declare function AnimatedHighlight({ bbox, action }: AnimatedHighlightProps): react_jsx_runtime.JSX.Element;
1840
+
1841
+ interface PulseOverlayProps {
1842
+ bbox: BBoxCoords;
1843
+ action: ActionPulse;
1844
+ }
1845
+ declare function PulseOverlay({ bbox, action }: PulseOverlayProps): react_jsx_runtime.JSX.Element;
1846
+
1847
+ interface CalloutArrowProps {
1848
+ fromBbox: BBoxCoords;
1849
+ toBbox: BBoxCoords;
1850
+ action: ActionCallout;
1851
+ }
1852
+ declare function CalloutArrow({ fromBbox, toBbox, action }: CalloutArrowProps): react_jsx_runtime.JSX.Element;
1853
+
1854
+ interface GhostReferenceProps {
1855
+ page: PageDimensionsDpi;
1856
+ sourceBbox: BBoxCoords;
1857
+ sourceBlockText: string | null;
1858
+ sourcePageNumber: number;
1859
+ action: ActionGhostReference;
1860
+ }
1861
+ /**
1862
+ * Renders a floating "ghost" card referencing a block from another page.
1863
+ * Shows a minimap of the source page with the target bbox highlighted,
1864
+ * plus the block's text description as a caption.
1865
+ */
1866
+ declare function GhostReference({ page, sourceBbox, sourceBlockText, sourcePageNumber, action, }: GhostReferenceProps): react_jsx_runtime.JSX.Element;
1867
+
1868
+ interface BoxOverlayProps {
1869
+ bbox: BBoxCoords;
1870
+ action: ActionBox;
1871
+ }
1872
+ declare function BoxOverlay({ bbox, action }: BoxOverlayProps): react_jsx_runtime.JSX.Element;
1873
+
1874
+ interface StickyLabelProps {
1875
+ bbox: BBoxCoords;
1876
+ action: ActionLabel;
1877
+ }
1878
+ declare function StickyLabel({ bbox, action }: StickyLabelProps): react_jsx_runtime.JSX.Element;
1879
+
1880
+ interface SubtitleBarProps {
1881
+ text: string | null;
1882
+ }
1883
+ declare function SubtitleBar({ text }: SubtitleBarProps): react_jsx_runtime.JSX.Element;
1884
+
1885
+ interface ViewportSize {
1886
+ width: number;
1887
+ height: number;
1888
+ }
1889
+
1890
+ interface EngineDeps {
1891
+ narrationStore: NarrationStoreApi;
1892
+ bboxIndex: BBoxIndex;
1893
+ /** Callback to read current viewport size (pixels). */
1894
+ getViewport: () => ViewportSize;
1895
+ /**
1896
+ * Minimum time (ms) an overlay stays on screen regardless of what
1897
+ * `step.duration_ms` the LLM emitted. The schema caps duration at 5000ms
1898
+ * and recipes typically suggest 600-1200ms — too short to register
1899
+ * visually in a narration context. Default: 3500ms.
1900
+ */
1901
+ minOverlayDurationMs?: number;
1902
+ }
1903
+ declare class StoryboardEngine {
1904
+ private deps;
1905
+ private pendingTimers;
1906
+ private currentStoryboardId;
1907
+ constructor(deps: EngineDeps);
1908
+ /**
1909
+ * Execute a new storyboard. Cancels in-flight steps from the previous storyboard
1910
+ * and smoothly transitions the camera/overlays from the current state.
1911
+ */
1912
+ execute(storyboard: Storyboard): void;
1913
+ /** Abort all pending steps and set engine status to idle. */
1914
+ cancelPending(): void;
1915
+ /** Reset visuals: clear overlays, fit camera back to page. */
1916
+ resetVisuals(): void;
1917
+ /** Execute one step — dispatch to narrationStore. Returns true if applied. */
1918
+ private runStep;
1919
+ private applyCamera;
1920
+ }
1921
+
1922
+ declare const StoryboardActionSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
1923
+ type: z.ZodLiteral<"camera">;
1924
+ target_block: z.ZodOptional<z.ZodString>;
1925
+ target_bbox: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
1926
+ scale: z.ZodDefault<z.ZodNumber>;
1927
+ padding: z.ZodDefault<z.ZodNumber>;
1928
+ easing: z.ZodDefault<z.ZodEnum<["linear", "ease-in", "ease-out", "ease-in-out"]>>;
1929
+ }, "strip", z.ZodTypeAny, {
1930
+ type: "camera";
1931
+ scale: number;
1932
+ easing: "linear" | "ease-in" | "ease-out" | "ease-in-out";
1933
+ padding: number;
1934
+ target_block?: string | undefined;
1935
+ target_bbox?: [number, number, number, number] | undefined;
1936
+ }, {
1937
+ type: "camera";
1938
+ scale?: number | undefined;
1939
+ easing?: "linear" | "ease-in" | "ease-out" | "ease-in-out" | undefined;
1940
+ padding?: number | undefined;
1941
+ target_block?: string | undefined;
1942
+ target_bbox?: [number, number, number, number] | undefined;
1943
+ }>, {
1944
+ type: "camera";
1945
+ scale: number;
1946
+ easing: "linear" | "ease-in" | "ease-out" | "ease-in-out";
1947
+ padding: number;
1948
+ target_block?: string | undefined;
1949
+ target_bbox?: [number, number, number, number] | undefined;
1950
+ }, {
1951
+ type: "camera";
1952
+ scale?: number | undefined;
1953
+ easing?: "linear" | "ease-in" | "ease-out" | "ease-in-out" | undefined;
1954
+ padding?: number | undefined;
1955
+ target_block?: string | undefined;
1956
+ target_bbox?: [number, number, number, number] | undefined;
1957
+ }>, z.ZodObject<{
1958
+ type: z.ZodLiteral<"spotlight">;
1959
+ target_block: z.ZodString;
1960
+ dim_opacity: z.ZodDefault<z.ZodNumber>;
1961
+ feather_px: z.ZodDefault<z.ZodNumber>;
1962
+ shape: z.ZodDefault<z.ZodEnum<["rect", "rounded", "ellipse"]>>;
1963
+ }, "strip", z.ZodTypeAny, {
1964
+ type: "spotlight";
1965
+ shape: "rect" | "rounded" | "ellipse";
1966
+ target_block: string;
1967
+ dim_opacity: number;
1968
+ feather_px: number;
1969
+ }, {
1970
+ type: "spotlight";
1971
+ target_block: string;
1972
+ shape?: "rect" | "rounded" | "ellipse" | undefined;
1973
+ dim_opacity?: number | undefined;
1974
+ feather_px?: number | undefined;
1975
+ }>, z.ZodObject<{
1976
+ type: z.ZodLiteral<"underline">;
1977
+ target_block: z.ZodString;
1978
+ color: z.ZodDefault<z.ZodString>;
1979
+ style: z.ZodDefault<z.ZodEnum<["straight", "sketch", "double", "wavy"]>>;
1980
+ draw_duration_ms: z.ZodDefault<z.ZodNumber>;
1981
+ }, "strip", z.ZodTypeAny, {
1982
+ style: "straight" | "sketch" | "double" | "wavy";
1983
+ color: string;
1984
+ type: "underline";
1985
+ target_block: string;
1986
+ draw_duration_ms: number;
1987
+ }, {
1988
+ type: "underline";
1989
+ target_block: string;
1990
+ style?: "straight" | "sketch" | "double" | "wavy" | undefined;
1991
+ color?: string | undefined;
1992
+ draw_duration_ms?: number | undefined;
1993
+ }>, z.ZodObject<{
1994
+ type: z.ZodLiteral<"highlight">;
1995
+ target_block: z.ZodString;
1996
+ color: z.ZodDefault<z.ZodString>;
1997
+ draw_duration_ms: z.ZodDefault<z.ZodNumber>;
1998
+ }, "strip", z.ZodTypeAny, {
1999
+ color: string;
2000
+ type: "highlight";
2001
+ target_block: string;
2002
+ draw_duration_ms: number;
2003
+ }, {
2004
+ type: "highlight";
2005
+ target_block: string;
2006
+ color?: string | undefined;
2007
+ draw_duration_ms?: number | undefined;
2008
+ }>, z.ZodObject<{
2009
+ type: z.ZodLiteral<"pulse">;
2010
+ target_block: z.ZodString;
2011
+ count: z.ZodDefault<z.ZodNumber>;
2012
+ intensity: z.ZodDefault<z.ZodEnum<["subtle", "normal", "strong"]>>;
2013
+ }, "strip", z.ZodTypeAny, {
2014
+ type: "pulse";
2015
+ target_block: string;
2016
+ count: number;
2017
+ intensity: "subtle" | "normal" | "strong";
2018
+ }, {
2019
+ type: "pulse";
2020
+ target_block: string;
2021
+ count?: number | undefined;
2022
+ intensity?: "subtle" | "normal" | "strong" | undefined;
2023
+ }>, z.ZodObject<{
2024
+ type: z.ZodLiteral<"callout">;
2025
+ from_block: z.ZodString;
2026
+ to_block: z.ZodString;
2027
+ label: z.ZodOptional<z.ZodString>;
2028
+ curve: z.ZodDefault<z.ZodEnum<["straight", "curved", "zigzag"]>>;
2029
+ }, "strip", z.ZodTypeAny, {
2030
+ type: "callout";
2031
+ curve: "straight" | "curved" | "zigzag";
2032
+ from_block: string;
2033
+ to_block: string;
2034
+ label?: string | undefined;
2035
+ }, {
2036
+ type: "callout";
2037
+ from_block: string;
2038
+ to_block: string;
2039
+ label?: string | undefined;
2040
+ curve?: "straight" | "curved" | "zigzag" | undefined;
2041
+ }>, z.ZodObject<{
2042
+ type: z.ZodLiteral<"ghost_reference">;
2043
+ target_page: z.ZodNumber;
2044
+ target_block: z.ZodString;
2045
+ position: z.ZodDefault<z.ZodEnum<["top-right", "top-left", "bottom-right", "bottom-left"]>>;
2046
+ }, "strip", z.ZodTypeAny, {
2047
+ type: "ghost_reference";
2048
+ position: "top-right" | "top-left" | "bottom-right" | "bottom-left";
2049
+ target_block: string;
2050
+ target_page: number;
2051
+ }, {
2052
+ type: "ghost_reference";
2053
+ target_block: string;
2054
+ target_page: number;
2055
+ position?: "top-right" | "top-left" | "bottom-right" | "bottom-left" | undefined;
2056
+ }>, z.ZodObject<{
2057
+ type: z.ZodLiteral<"box">;
2058
+ target_block: z.ZodString;
2059
+ color: z.ZodDefault<z.ZodString>;
2060
+ style: z.ZodDefault<z.ZodEnum<["solid", "dashed"]>>;
2061
+ }, "strip", z.ZodTypeAny, {
2062
+ style: "solid" | "dashed";
2063
+ color: string;
2064
+ type: "box";
2065
+ target_block: string;
2066
+ }, {
2067
+ type: "box";
2068
+ target_block: string;
2069
+ style?: "solid" | "dashed" | undefined;
2070
+ color?: string | undefined;
2071
+ }>, z.ZodObject<{
2072
+ type: z.ZodLiteral<"label">;
2073
+ target_block: z.ZodString;
2074
+ text: z.ZodString;
2075
+ position: z.ZodDefault<z.ZodEnum<["top", "bottom", "left", "right"]>>;
2076
+ }, "strip", z.ZodTypeAny, {
2077
+ text: string;
2078
+ type: "label";
2079
+ position: "top" | "bottom" | "left" | "right";
2080
+ target_block: string;
2081
+ }, {
2082
+ text: string;
2083
+ type: "label";
2084
+ target_block: string;
2085
+ position?: "top" | "bottom" | "left" | "right" | undefined;
2086
+ }>, z.ZodObject<{
2087
+ type: z.ZodLiteral<"clear">;
2088
+ targets: z.ZodDefault<z.ZodUnion<[z.ZodEnum<["all", "spotlights", "overlays"]>, z.ZodArray<z.ZodString, "many">]>>;
2089
+ }, "strip", z.ZodTypeAny, {
2090
+ type: "clear";
2091
+ targets: "all" | "spotlights" | "overlays" | string[];
2092
+ }, {
2093
+ type: "clear";
2094
+ targets?: "all" | "spotlights" | "overlays" | string[] | undefined;
2095
+ }>]>;
2096
+ declare const StoryboardSchema: z.ZodObject<{
2097
+ version: z.ZodLiteral<1>;
2098
+ reasoning: z.ZodDefault<z.ZodString>;
2099
+ steps: z.ZodArray<z.ZodObject<{
2100
+ at_ms: z.ZodDefault<z.ZodNumber>;
2101
+ duration_ms: z.ZodDefault<z.ZodNumber>;
2102
+ action: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
2103
+ type: z.ZodLiteral<"camera">;
2104
+ target_block: z.ZodOptional<z.ZodString>;
2105
+ target_bbox: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
2106
+ scale: z.ZodDefault<z.ZodNumber>;
2107
+ padding: z.ZodDefault<z.ZodNumber>;
2108
+ easing: z.ZodDefault<z.ZodEnum<["linear", "ease-in", "ease-out", "ease-in-out"]>>;
2109
+ }, "strip", z.ZodTypeAny, {
2110
+ type: "camera";
2111
+ scale: number;
2112
+ easing: "linear" | "ease-in" | "ease-out" | "ease-in-out";
2113
+ padding: number;
2114
+ target_block?: string | undefined;
2115
+ target_bbox?: [number, number, number, number] | undefined;
2116
+ }, {
2117
+ type: "camera";
2118
+ scale?: number | undefined;
2119
+ easing?: "linear" | "ease-in" | "ease-out" | "ease-in-out" | undefined;
2120
+ padding?: number | undefined;
2121
+ target_block?: string | undefined;
2122
+ target_bbox?: [number, number, number, number] | undefined;
2123
+ }>, {
2124
+ type: "camera";
2125
+ scale: number;
2126
+ easing: "linear" | "ease-in" | "ease-out" | "ease-in-out";
2127
+ padding: number;
2128
+ target_block?: string | undefined;
2129
+ target_bbox?: [number, number, number, number] | undefined;
2130
+ }, {
2131
+ type: "camera";
2132
+ scale?: number | undefined;
2133
+ easing?: "linear" | "ease-in" | "ease-out" | "ease-in-out" | undefined;
2134
+ padding?: number | undefined;
2135
+ target_block?: string | undefined;
2136
+ target_bbox?: [number, number, number, number] | undefined;
2137
+ }>, z.ZodObject<{
2138
+ type: z.ZodLiteral<"spotlight">;
2139
+ target_block: z.ZodString;
2140
+ dim_opacity: z.ZodDefault<z.ZodNumber>;
2141
+ feather_px: z.ZodDefault<z.ZodNumber>;
2142
+ shape: z.ZodDefault<z.ZodEnum<["rect", "rounded", "ellipse"]>>;
2143
+ }, "strip", z.ZodTypeAny, {
2144
+ type: "spotlight";
2145
+ shape: "rect" | "rounded" | "ellipse";
2146
+ target_block: string;
2147
+ dim_opacity: number;
2148
+ feather_px: number;
2149
+ }, {
2150
+ type: "spotlight";
2151
+ target_block: string;
2152
+ shape?: "rect" | "rounded" | "ellipse" | undefined;
2153
+ dim_opacity?: number | undefined;
2154
+ feather_px?: number | undefined;
2155
+ }>, z.ZodObject<{
2156
+ type: z.ZodLiteral<"underline">;
2157
+ target_block: z.ZodString;
2158
+ color: z.ZodDefault<z.ZodString>;
2159
+ style: z.ZodDefault<z.ZodEnum<["straight", "sketch", "double", "wavy"]>>;
2160
+ draw_duration_ms: z.ZodDefault<z.ZodNumber>;
2161
+ }, "strip", z.ZodTypeAny, {
2162
+ style: "straight" | "sketch" | "double" | "wavy";
2163
+ color: string;
2164
+ type: "underline";
2165
+ target_block: string;
2166
+ draw_duration_ms: number;
2167
+ }, {
2168
+ type: "underline";
2169
+ target_block: string;
2170
+ style?: "straight" | "sketch" | "double" | "wavy" | undefined;
2171
+ color?: string | undefined;
2172
+ draw_duration_ms?: number | undefined;
2173
+ }>, z.ZodObject<{
2174
+ type: z.ZodLiteral<"highlight">;
2175
+ target_block: z.ZodString;
2176
+ color: z.ZodDefault<z.ZodString>;
2177
+ draw_duration_ms: z.ZodDefault<z.ZodNumber>;
2178
+ }, "strip", z.ZodTypeAny, {
2179
+ color: string;
2180
+ type: "highlight";
2181
+ target_block: string;
2182
+ draw_duration_ms: number;
2183
+ }, {
2184
+ type: "highlight";
2185
+ target_block: string;
2186
+ color?: string | undefined;
2187
+ draw_duration_ms?: number | undefined;
2188
+ }>, z.ZodObject<{
2189
+ type: z.ZodLiteral<"pulse">;
2190
+ target_block: z.ZodString;
2191
+ count: z.ZodDefault<z.ZodNumber>;
2192
+ intensity: z.ZodDefault<z.ZodEnum<["subtle", "normal", "strong"]>>;
2193
+ }, "strip", z.ZodTypeAny, {
2194
+ type: "pulse";
2195
+ target_block: string;
2196
+ count: number;
2197
+ intensity: "subtle" | "normal" | "strong";
2198
+ }, {
2199
+ type: "pulse";
2200
+ target_block: string;
2201
+ count?: number | undefined;
2202
+ intensity?: "subtle" | "normal" | "strong" | undefined;
2203
+ }>, z.ZodObject<{
2204
+ type: z.ZodLiteral<"callout">;
2205
+ from_block: z.ZodString;
2206
+ to_block: z.ZodString;
2207
+ label: z.ZodOptional<z.ZodString>;
2208
+ curve: z.ZodDefault<z.ZodEnum<["straight", "curved", "zigzag"]>>;
2209
+ }, "strip", z.ZodTypeAny, {
2210
+ type: "callout";
2211
+ curve: "straight" | "curved" | "zigzag";
2212
+ from_block: string;
2213
+ to_block: string;
2214
+ label?: string | undefined;
2215
+ }, {
2216
+ type: "callout";
2217
+ from_block: string;
2218
+ to_block: string;
2219
+ label?: string | undefined;
2220
+ curve?: "straight" | "curved" | "zigzag" | undefined;
2221
+ }>, z.ZodObject<{
2222
+ type: z.ZodLiteral<"ghost_reference">;
2223
+ target_page: z.ZodNumber;
2224
+ target_block: z.ZodString;
2225
+ position: z.ZodDefault<z.ZodEnum<["top-right", "top-left", "bottom-right", "bottom-left"]>>;
2226
+ }, "strip", z.ZodTypeAny, {
2227
+ type: "ghost_reference";
2228
+ position: "top-right" | "top-left" | "bottom-right" | "bottom-left";
2229
+ target_block: string;
2230
+ target_page: number;
2231
+ }, {
2232
+ type: "ghost_reference";
2233
+ target_block: string;
2234
+ target_page: number;
2235
+ position?: "top-right" | "top-left" | "bottom-right" | "bottom-left" | undefined;
2236
+ }>, z.ZodObject<{
2237
+ type: z.ZodLiteral<"box">;
2238
+ target_block: z.ZodString;
2239
+ color: z.ZodDefault<z.ZodString>;
2240
+ style: z.ZodDefault<z.ZodEnum<["solid", "dashed"]>>;
2241
+ }, "strip", z.ZodTypeAny, {
2242
+ style: "solid" | "dashed";
2243
+ color: string;
2244
+ type: "box";
2245
+ target_block: string;
2246
+ }, {
2247
+ type: "box";
2248
+ target_block: string;
2249
+ style?: "solid" | "dashed" | undefined;
2250
+ color?: string | undefined;
2251
+ }>, z.ZodObject<{
2252
+ type: z.ZodLiteral<"label">;
2253
+ target_block: z.ZodString;
2254
+ text: z.ZodString;
2255
+ position: z.ZodDefault<z.ZodEnum<["top", "bottom", "left", "right"]>>;
2256
+ }, "strip", z.ZodTypeAny, {
2257
+ text: string;
2258
+ type: "label";
2259
+ position: "top" | "bottom" | "left" | "right";
2260
+ target_block: string;
2261
+ }, {
2262
+ text: string;
2263
+ type: "label";
2264
+ target_block: string;
2265
+ position?: "top" | "bottom" | "left" | "right" | undefined;
2266
+ }>, z.ZodObject<{
2267
+ type: z.ZodLiteral<"clear">;
2268
+ targets: z.ZodDefault<z.ZodUnion<[z.ZodEnum<["all", "spotlights", "overlays"]>, z.ZodArray<z.ZodString, "many">]>>;
2269
+ }, "strip", z.ZodTypeAny, {
2270
+ type: "clear";
2271
+ targets: "all" | "spotlights" | "overlays" | string[];
2272
+ }, {
2273
+ type: "clear";
2274
+ targets?: "all" | "spotlights" | "overlays" | string[] | undefined;
2275
+ }>]>;
2276
+ }, "strip", z.ZodTypeAny, {
2277
+ action: {
2278
+ type: "camera";
2279
+ scale: number;
2280
+ easing: "linear" | "ease-in" | "ease-out" | "ease-in-out";
2281
+ padding: number;
2282
+ target_block?: string | undefined;
2283
+ target_bbox?: [number, number, number, number] | undefined;
2284
+ } | {
2285
+ type: "spotlight";
2286
+ shape: "rect" | "rounded" | "ellipse";
2287
+ target_block: string;
2288
+ dim_opacity: number;
2289
+ feather_px: number;
2290
+ } | {
2291
+ style: "straight" | "sketch" | "double" | "wavy";
2292
+ color: string;
2293
+ type: "underline";
2294
+ target_block: string;
2295
+ draw_duration_ms: number;
2296
+ } | {
2297
+ color: string;
2298
+ type: "highlight";
2299
+ target_block: string;
2300
+ draw_duration_ms: number;
2301
+ } | {
2302
+ type: "pulse";
2303
+ target_block: string;
2304
+ count: number;
2305
+ intensity: "subtle" | "normal" | "strong";
2306
+ } | {
2307
+ type: "callout";
2308
+ curve: "straight" | "curved" | "zigzag";
2309
+ from_block: string;
2310
+ to_block: string;
2311
+ label?: string | undefined;
2312
+ } | {
2313
+ type: "ghost_reference";
2314
+ position: "top-right" | "top-left" | "bottom-right" | "bottom-left";
2315
+ target_block: string;
2316
+ target_page: number;
2317
+ } | {
2318
+ style: "solid" | "dashed";
2319
+ color: string;
2320
+ type: "box";
2321
+ target_block: string;
2322
+ } | {
2323
+ text: string;
2324
+ type: "label";
2325
+ position: "top" | "bottom" | "left" | "right";
2326
+ target_block: string;
2327
+ } | {
2328
+ type: "clear";
2329
+ targets: "all" | "spotlights" | "overlays" | string[];
2330
+ };
2331
+ at_ms: number;
2332
+ duration_ms: number;
2333
+ }, {
2334
+ action: {
2335
+ type: "camera";
2336
+ scale?: number | undefined;
2337
+ easing?: "linear" | "ease-in" | "ease-out" | "ease-in-out" | undefined;
2338
+ padding?: number | undefined;
2339
+ target_block?: string | undefined;
2340
+ target_bbox?: [number, number, number, number] | undefined;
2341
+ } | {
2342
+ type: "spotlight";
2343
+ target_block: string;
2344
+ shape?: "rect" | "rounded" | "ellipse" | undefined;
2345
+ dim_opacity?: number | undefined;
2346
+ feather_px?: number | undefined;
2347
+ } | {
2348
+ type: "underline";
2349
+ target_block: string;
2350
+ style?: "straight" | "sketch" | "double" | "wavy" | undefined;
2351
+ color?: string | undefined;
2352
+ draw_duration_ms?: number | undefined;
2353
+ } | {
2354
+ type: "highlight";
2355
+ target_block: string;
2356
+ color?: string | undefined;
2357
+ draw_duration_ms?: number | undefined;
2358
+ } | {
2359
+ type: "pulse";
2360
+ target_block: string;
2361
+ count?: number | undefined;
2362
+ intensity?: "subtle" | "normal" | "strong" | undefined;
2363
+ } | {
2364
+ type: "callout";
2365
+ from_block: string;
2366
+ to_block: string;
2367
+ label?: string | undefined;
2368
+ curve?: "straight" | "curved" | "zigzag" | undefined;
2369
+ } | {
2370
+ type: "ghost_reference";
2371
+ target_block: string;
2372
+ target_page: number;
2373
+ position?: "top-right" | "top-left" | "bottom-right" | "bottom-left" | undefined;
2374
+ } | {
2375
+ type: "box";
2376
+ target_block: string;
2377
+ style?: "solid" | "dashed" | undefined;
2378
+ color?: string | undefined;
2379
+ } | {
2380
+ text: string;
2381
+ type: "label";
2382
+ target_block: string;
2383
+ position?: "top" | "bottom" | "left" | "right" | undefined;
2384
+ } | {
2385
+ type: "clear";
2386
+ targets?: "all" | "spotlights" | "overlays" | string[] | undefined;
2387
+ };
2388
+ at_ms?: number | undefined;
2389
+ duration_ms?: number | undefined;
2390
+ }>, "many">;
2391
+ }, "strip", z.ZodTypeAny, {
2392
+ version: 1;
2393
+ reasoning: string;
2394
+ steps: {
2395
+ action: {
2396
+ type: "camera";
2397
+ scale: number;
2398
+ easing: "linear" | "ease-in" | "ease-out" | "ease-in-out";
2399
+ padding: number;
2400
+ target_block?: string | undefined;
2401
+ target_bbox?: [number, number, number, number] | undefined;
2402
+ } | {
2403
+ type: "spotlight";
2404
+ shape: "rect" | "rounded" | "ellipse";
2405
+ target_block: string;
2406
+ dim_opacity: number;
2407
+ feather_px: number;
2408
+ } | {
2409
+ style: "straight" | "sketch" | "double" | "wavy";
2410
+ color: string;
2411
+ type: "underline";
2412
+ target_block: string;
2413
+ draw_duration_ms: number;
2414
+ } | {
2415
+ color: string;
2416
+ type: "highlight";
2417
+ target_block: string;
2418
+ draw_duration_ms: number;
2419
+ } | {
2420
+ type: "pulse";
2421
+ target_block: string;
2422
+ count: number;
2423
+ intensity: "subtle" | "normal" | "strong";
2424
+ } | {
2425
+ type: "callout";
2426
+ curve: "straight" | "curved" | "zigzag";
2427
+ from_block: string;
2428
+ to_block: string;
2429
+ label?: string | undefined;
2430
+ } | {
2431
+ type: "ghost_reference";
2432
+ position: "top-right" | "top-left" | "bottom-right" | "bottom-left";
2433
+ target_block: string;
2434
+ target_page: number;
2435
+ } | {
2436
+ style: "solid" | "dashed";
2437
+ color: string;
2438
+ type: "box";
2439
+ target_block: string;
2440
+ } | {
2441
+ text: string;
2442
+ type: "label";
2443
+ position: "top" | "bottom" | "left" | "right";
2444
+ target_block: string;
2445
+ } | {
2446
+ type: "clear";
2447
+ targets: "all" | "spotlights" | "overlays" | string[];
2448
+ };
2449
+ at_ms: number;
2450
+ duration_ms: number;
2451
+ }[];
2452
+ }, {
2453
+ version: 1;
2454
+ steps: {
2455
+ action: {
2456
+ type: "camera";
2457
+ scale?: number | undefined;
2458
+ easing?: "linear" | "ease-in" | "ease-out" | "ease-in-out" | undefined;
2459
+ padding?: number | undefined;
2460
+ target_block?: string | undefined;
2461
+ target_bbox?: [number, number, number, number] | undefined;
2462
+ } | {
2463
+ type: "spotlight";
2464
+ target_block: string;
2465
+ shape?: "rect" | "rounded" | "ellipse" | undefined;
2466
+ dim_opacity?: number | undefined;
2467
+ feather_px?: number | undefined;
2468
+ } | {
2469
+ type: "underline";
2470
+ target_block: string;
2471
+ style?: "straight" | "sketch" | "double" | "wavy" | undefined;
2472
+ color?: string | undefined;
2473
+ draw_duration_ms?: number | undefined;
2474
+ } | {
2475
+ type: "highlight";
2476
+ target_block: string;
2477
+ color?: string | undefined;
2478
+ draw_duration_ms?: number | undefined;
2479
+ } | {
2480
+ type: "pulse";
2481
+ target_block: string;
2482
+ count?: number | undefined;
2483
+ intensity?: "subtle" | "normal" | "strong" | undefined;
2484
+ } | {
2485
+ type: "callout";
2486
+ from_block: string;
2487
+ to_block: string;
2488
+ label?: string | undefined;
2489
+ curve?: "straight" | "curved" | "zigzag" | undefined;
2490
+ } | {
2491
+ type: "ghost_reference";
2492
+ target_block: string;
2493
+ target_page: number;
2494
+ position?: "top-right" | "top-left" | "bottom-right" | "bottom-left" | undefined;
2495
+ } | {
2496
+ type: "box";
2497
+ target_block: string;
2498
+ style?: "solid" | "dashed" | undefined;
2499
+ color?: string | undefined;
2500
+ } | {
2501
+ text: string;
2502
+ type: "label";
2503
+ target_block: string;
2504
+ position?: "top" | "bottom" | "left" | "right" | undefined;
2505
+ } | {
2506
+ type: "clear";
2507
+ targets?: "all" | "spotlights" | "overlays" | string[] | undefined;
2508
+ };
2509
+ at_ms?: number | undefined;
2510
+ duration_ms?: number | undefined;
2511
+ }[];
2512
+ reasoning?: string | undefined;
2513
+ }>;
2514
+ type StoryboardParsed = z.infer<typeof StoryboardSchema>;
2515
+ /** Converts the zod schema to JSON Schema for use with OpenAI structured outputs.
2516
+ *
2517
+ * OpenAI's structured outputs validator requires:
2518
+ * - Every property has a `type` (no bare `const`/`enum` without `type`)
2519
+ * - All properties listed in `required`
2520
+ * - `additionalProperties: false` on every object
2521
+ *
2522
+ * We model the action union as a single object with all possible fields optional
2523
+ * at the schema level (validated strictly later by zod). This keeps the schema
2524
+ * compatible across providers; field-level required-ness is enforced post-parse.
2525
+ */
2526
+ interface StoryboardJsonSchemaOptions {
2527
+ /** Block IDs valid for the CURRENT page. Constrains target_block / from_block / to_block. */
2528
+ validBlockIds?: string[];
2529
+ /** Block IDs valid for cross-page references (e.g., figures on other pages). */
2530
+ validCrossPageBlockIds?: string[];
2531
+ }
2532
+ declare function storyboardJsonSchema(opts?: StoryboardJsonSchemaOptions): Record<string, unknown>;
2533
+
2534
+ /**
2535
+ * Lazily load a local MiniLM model (only on first call). The dynamic import
2536
+ * keeps `@xenova/transformers` out of the main bundle unless used.
2537
+ */
2538
+ declare function getLocalMiniLM(): Promise<EmbeddingProvider>;
2539
+
1492
2540
  type ViewerStore = ViewerState & ViewerActions;
1493
2541
  declare function createViewerStore(initialOverrides?: Partial<ViewerState>): zustand.StoreApi<ViewerStore>;
1494
2542
  type ViewerStoreApi = ReturnType<typeof createViewerStore>;
@@ -2776,4 +3824,4 @@ declare function getRectIntersection(rectA: {
2776
3824
  */
2777
3825
  declare function playPageTurnSound(volume?: number): void;
2778
3826
 
2779
- export { type AddNoteOptions, type AgentAPI, type AgentAPIInstance, type AgentAPIStores, type AgentActions, type AgentContext, type AgentHighlightParams, type AgentState, type AgentStore, type AgentStoreApi, type AgentToolResult, type AgentTools, type Annotation, type AnnotationActions, AnnotationLayer, type AnnotationLayerProps, type AnnotationState, type AnnotationStore, type AnnotationStoreApi, type AnnotationTool, AnnotationToolbar, type AnnotationToolbarProps, type AnnotationType, type AskAboutContext, AskAboutOverlay, type AskAboutOverlayProps, AskAboutTrigger, type AskAboutTriggerProps, BookModeContainer, type BookModeContainerProps, type Bookmark, BookmarksPanel, type BookmarksPanelProps, CanvasLayer, type CanvasLayerProps, type CharPosition, type ContextMenuItem, ContinuousScrollContainer, type ContinuousScrollContainerProps, type CoordinateHelpers, DocumentContainer, type DocumentContainerProps, type DocumentLoadingState, type DrawCircleOptions, type DrawRectOptions, type DrawingAnnotation, DrawingCanvas, type DrawingCanvasProps, type DrawingPath, DualPageContainer, type DualPageContainerProps, type ExportData, type FindTextOptions, FloatingZoomControls, type FloatingZoomControlsProps, FocusRegionLayer, type FocusRegionLayerProps, type FocusedRegion, type GoToPageOptions, type Highlight, type HighlightColor, HighlightLayer, type HighlightLayerProps, HighlightPopover, type HighlightPopoverProps, type HighlightRect, type HighlightTextOptions, HighlightsPanel, type HighlightsPanelProps, type LoadDocumentOptions, type LoadDocumentResult, type LoadDocumentWithCallbacksOptions, type LoadDocumentWithCallbacksResult, type LoadingPhase, type LoadingProgress, Minimap, type MinimapProps, MobileSidebar, type MobileSidebarProps, MobileToolbar, type MobileToolbarProps, type NoteAnnotation, type OutlineItem, OutlinePanel, type OutlinePanelProps, type PDFDocumentLoadedEvent, PDFErrorBoundary, type PDFErrorBoundaryProps, PDFLoadingScreen, type PDFLoadingScreenProps, PDFPage, type PDFPageProps, type PDFPageState, type PDFRegion, PDFThumbnailNav, type PDFThumbnailNavProps, PDFViewer, PDFViewerClient, PDFViewerContext, type PDFViewerContextValue, type PDFViewerController, type PDFViewerControllerOptions, type PDFViewerEventMap, type PDFViewerHandle, type PDFViewerProps, PDFViewerProvider, type PDFViewerProviderProps, type PageCoordinates, type PageDimensions, type PageDimensionsInfo, type Plugin, type PluginAPI, PluginManager, type PluginManagerOptions, type QuickNote, QuickNoteButton, type QuickNoteButtonProps, QuickNotePopover, type QuickNotePopoverProps, type ScrollMode, type ScrollToPageRequest, type SearchActions, type SearchAndHighlightOptions, type SearchAndHighlightResult, type SearchOptions, SearchPanel, type SearchPanelProps, type SearchResult, type SearchState, type SearchStore, type SearchStoreApi, SelectionToolbar, type SelectionToolbarProps, type ShapeAnnotation, ShapePreview, type ShapePreviewProps, ShapeRenderer, type ShapeRendererProps, type ShapeType, Sidebar, type SidebarPanel, type SidebarPanelConfig, type SidebarProps, StickyNote, type StickyNoteProps, type StoredStudentData, type StreamingProgress, type StudentActions, type StudentData, type StudentModeCallbacks, type StudentModeProps, type StudentState, type StudentStore, type StudentStoreApi, type Takeaway, TakeawaysPanel, type TakeawaysPanelProps, TextLayer, type TextLayerProps, type TextMatch, type TextSelection, type Theme, ThumbnailPanel, type ThumbnailPanelProps, Toolbar, type ToolbarItem, type ToolbarProps, type UseAgentContextOptions, type UseAgentContextReturn, type UseAnnotationsOptions, type UseAnnotationsReturn, type UseAskAboutOptions, type UseAskAboutReturn, type UseBookmarksOptions, type UseBookmarksReturn, type UseHighlightsOptions, type UseHighlightsReturn, type UsePageNavigationOptions, type UsePluginsOptions, type UsePluginsReturn, type UseQuickNotesOptions, type UseQuickNotesReturn, type UseStudentProgressOptions, type UseStudentProgressReturn, type UseTextSelectionOptions, type UseTouchGesturesOptions, type UseZoomOptions, type ViewMode, type ViewerActions, type ViewerState, type ViewerStore, type ViewerStoreApi, VirtualizedDocumentContainer, type VirtualizedDocumentContainerProps, type WithErrorBoundaryProps, applyRotation, clearHighlights, clearStudentData, cn, countTextOnPage, createAgentAPI, createAgentStore, createAnnotationStore, createPDFViewer, createPluginManager, createSearchStore, createStudentStore, createViewerStore, doRectsIntersect, downloadAnnotationsAsJSON, downloadAnnotationsAsMarkdown, downloadFile, exportAnnotationsAsJSON, exportAnnotationsAsMarkdown, exportHighlightsAsJSON, exportHighlightsAsMarkdown, extractPageText, findTextInDocument, findTextOnPage, generateDocumentId, getAllDocumentIds, getAllStudentDataDocumentIds, getMetadata, getOutline, getPage, getPageText, getPageTextContent, getPluginManager, getRectIntersection, getRotatedDimensions, getStorageStats, importHighlightsFromJSON, initializePDFJS, isPDFJSInitialized, isPointInRect, loadDocument, loadDocumentWithCallbacks, loadHighlights, loadStudentData, mergeAdjacentRects, pdfToPercent, pdfToViewport, percentToPDF, percentToViewport, playPageTurnSound, quickViewer, removeRotation, saveHighlights, saveStudentData, scaleRect, useAgentContext, useAgentStore, useAnnotationStore, useAnnotations, useAskAbout, useBookmarks, useHighlights, useIsMobile, useIsTouchDevice, usePDFViewer, usePDFViewerStores, usePageNavigation, usePlugins, useQuickNotes, useSearchStore, useStudentProgress, useStudentStore, useTextSelection, useTouchGestures, useViewerStore, useZoom, viewportToPDF, viewportToPercent, withErrorBoundary };
3827
+ export { type ActionBox, type ActionCallout, type ActionCamera, type ActionClear, type ActionGhostReference, type ActionHighlight, type ActionLabel, type ActionPulse, type ActionSpotlight, type ActionUnderline, type ActiveOverlay, type AddNoteOptions, type AgentAPI, type AgentAPIInstance, type AgentAPIStores, type AgentActions, type AgentContext, type AgentHighlightParams, type AgentState, type AgentStore, type AgentStoreApi, type AgentToolResult, type AgentTools, AnimatedHighlight, type AnimatedHighlightProps, AnimatedUnderline, type AnimatedUnderlineProps, type Annotation, type AnnotationActions, AnnotationLayer, type AnnotationLayerProps, type AnnotationState, type AnnotationStore, type AnnotationStoreApi, type AnnotationTool, AnnotationToolbar, type AnnotationToolbarProps, type AnnotationType, type ArrowCurve, type AskAboutContext, AskAboutOverlay, type AskAboutOverlayProps, AskAboutTrigger, type AskAboutTriggerProps, type BBoxCoords, type BBoxIndex, type Block, type BlockMatch, type BlockType, BookModeContainer, type BookModeContainerProps, type Bookmark, BookmarksPanel, type BookmarksPanelProps, BoxOverlay, type BoxOverlayProps, type BoxStyle, type BuildUserPromptInput, CalloutArrow, type CalloutArrowProps, type CameraState, CameraView, type CameraViewProps, CanvasLayer, type CanvasLayerProps, type CharPosition, type ChunkHistoryEntry, CinemaLayer, type CinemaLayerProps, type ClearTarget, type ContextMenuItem, ContinuousScrollContainer, type ContinuousScrollContainerProps, type CoordinateHelpers, type DebugEvent, type DefaultAction, type DirectorInput, type DirectorResult, DocumentContainer, type DocumentContainerProps, type DocumentLoadingState, type DrawCircleOptions, type DrawRectOptions, type DrawingAnnotation, DrawingCanvas, type DrawingCanvasProps, type DrawingPath, DualPageContainer, type DualPageContainerProps, type EasingName, type EmbeddingProvider, type EngineStatus, type ExportData, type FindTextOptions, FloatingZoomControls, type FloatingZoomControlsProps, FocusRegionLayer, type FocusRegionLayerProps, type FocusedRegion, type GhostPosition, GhostReference, type GhostReferenceProps, type GoToPageOptions, type Highlight, type HighlightColor, HighlightLayer, type HighlightLayerProps, HighlightPopover, type HighlightPopoverProps, type HighlightRect, type HighlightTextOptions, HighlightsPanel, type HighlightsPanelProps, type LabelPosition, type LlmConfig, type LlmStatus, type LoadDocumentOptions, type LoadDocumentResult, type LoadDocumentWithCallbacksOptions, type LoadDocumentWithCallbacksResult, type LoadingPhase, type LoadingProgress, Minimap, type MinimapProps, MobileSidebar, type MobileSidebarProps, MobileToolbar, type MobileToolbarProps, type NarrationActions, type NarrationState, type NarrationStore, type NarrationStoreApi, type NoteAnnotation, type OutlineItem, OutlinePanel, type OutlinePanelProps, type PDFDocumentLoadedEvent, PDFErrorBoundary, type PDFErrorBoundaryProps, PDFLoadingScreen, type PDFLoadingScreenProps, PDFPage, type PDFPageProps, type PDFPageState, type PDFRegion, PDFThumbnailNav, type PDFThumbnailNavProps, PDFViewer, PDFViewerClient, PDFViewerContext, type PDFViewerContextValue, type PDFViewerController, type PDFViewerControllerOptions, type PDFViewerEventMap, type PDFViewerHandle, type PDFViewerProps, PDFViewerProvider, type PDFViewerProviderProps, type PageBBoxData, type PageCoordinates, type PageDimensions, type PageDimensionsDpi, type PageDimensionsInfo, type Plugin, type PluginAPI, PluginManager, type PluginManagerOptions, type PulseIntensity, PulseOverlay, type PulseOverlayProps, type QuickNote, QuickNoteButton, type QuickNoteButtonProps, QuickNotePopover, type QuickNotePopoverProps, SYSTEM_PROMPT, type ScrollMode, type ScrollToPageRequest, type SearchActions, type SearchAndHighlightOptions, type SearchAndHighlightResult, type SearchOptions, SearchPanel, type SearchPanelProps, type SearchResult, type SearchState, type SearchStore, type SearchStoreApi, SelectionToolbar, type SelectionToolbarProps, type ShapeAnnotation, ShapePreview, type ShapePreviewProps, ShapeRenderer, type ShapeRendererProps, type ShapeType, Sidebar, type SidebarPanel, type SidebarPanelConfig, type SidebarProps, SpotlightMask, type SpotlightMaskProps, type SpotlightShape, StickyLabel, type StickyLabelProps, StickyNote, type StickyNoteProps, type StoredStudentData, type Storyboard, type StoryboardAction, StoryboardActionSchema, StoryboardEngine, type StoryboardParsed, StoryboardSchema, type StoryboardStep, type StreamingProgress, type StudentActions, type StudentData, type StudentModeCallbacks, type StudentModeProps, type StudentState, type StudentStore, type StudentStoreApi, SubtitleBar, type SubtitleBarProps, type Takeaway, TakeawaysPanel, type TakeawaysPanelProps, TextLayer, type TextLayerProps, type TextMatch, type TextSelection, type Theme, ThumbnailPanel, type ThumbnailPanelProps, Toolbar, type ToolbarItem, type ToolbarProps, TutorModeContainer, type TutorModeContainerProps, type UnderlineStyle, type UseAgentContextOptions, type UseAgentContextReturn, type UseAnnotationsOptions, type UseAnnotationsReturn, type UseAskAboutOptions, type UseAskAboutReturn, type UseBookmarksOptions, type UseBookmarksReturn, type UseHighlightsOptions, type UseHighlightsReturn, type UsePageNavigationOptions, type UsePluginsOptions, type UsePluginsReturn, type UseQuickNotesOptions, type UseQuickNotesReturn, type UseStudentProgressOptions, type UseStudentProgressReturn, type UseTextSelectionOptions, type UseTouchGesturesOptions, type UseZoomOptions, type ViewMode, type ViewerActions, type ViewerState, type ViewerStore, type ViewerStoreApi, VirtualizedDocumentContainer, type VirtualizedDocumentContainerProps, type WithErrorBoundaryProps, applyRotation, buildBBoxIndex, buildUserPrompt, clearHighlights, clearStudentData, cn, cosineSimilarity, countTextOnPage, createAgentAPI, createAgentStore, createAnnotationStore, createNarrationStore, createPDFViewer, createPluginManager, createSearchStore, createStudentStore, createViewerStore, directStoryboard, doRectsIntersect, downloadAnnotationsAsJSON, downloadAnnotationsAsMarkdown, downloadFile, exportAnnotationsAsJSON, exportAnnotationsAsMarkdown, exportHighlightsAsJSON, exportHighlightsAsMarkdown, extractPageText, findTextInDocument, findTextOnPage, generateDocumentId, getAllDocumentIds, getAllStudentDataDocumentIds, getLocalMiniLM, getMetadata, getOutline, getPage, getPageText, getPageTextContent, getPluginManager, getRectIntersection, getRotatedDimensions, getStorageStats, importHighlightsFromJSON, initializePDFJS, isPDFJSInitialized, isPointInRect, loadDocument, loadDocumentWithCallbacks, loadHighlights, loadStudentData, makeOverlayId, matchChunkToBlock, mergeAdjacentRects, pdfToPercent, pdfToViewport, percentToPDF, percentToViewport, playPageTurnSound, quickViewer, removeRotation, saveHighlights, saveStudentData, scaleRect, storyboardFromMatch, storyboardJsonSchema, truncate, useAgentContext, useAgentStore, useAnnotationStore, useAnnotations, useAskAbout, useBookmarks, useHighlights, useIsMobile, useIsTouchDevice, usePDFViewer, usePDFViewerStores, usePageNavigation, usePlugins, useQuickNotes, useSearchStore, useStudentProgress, useStudentStore, useTextSelection, useTouchGestures, useViewerStore, useZoom, viewportToPDF, viewportToPercent, withErrorBoundary };