/** * Shared type definitions for MRSF rendering plugins. * * These types are used by both @mrsf/markdown-it-mrsf and @mrsf/rehype-mrsf. */ import type { MrsfDocument } from "@mrsf/cli"; /** Base options shared by all MRSF rendering plugins. */ export interface MrsfPluginOptions { /** * Path to the Markdown document on disk. * Used for auto-discovery of the sidecar file via `@mrsf/cli`. */ documentPath?: string; /** * Explicit path to the `.review.yaml` or `.review.json` sidecar file. * Takes precedence over auto-discovery. */ sidecarPath?: string; /** * Pre-loaded MRSF sidecar data. * Takes precedence over `loader`, `sidecarPath`, and `documentPath`. * Enables browser use, custom pipelines, and testing. */ comments?: MrsfDocument; /** * Custom loader function that returns sidecar data. * Takes precedence over `sidecarPath` and `documentPath`. * Useful for integrations that manage their own sidecar state. */ loader?: (options: MrsfPluginOptions, env?: unknown) => MrsfDocument | null; /** Whether to show resolved comments (default: true). */ showResolved?: boolean; /** * How serialized review data should be embedded into rendered HTML. * - `script`: emits `