/** * Public types for the snapshot-based document diff contract. * * These types are engine-agnostic wrappers around opaque engine payloads. * The `payload` field in both DiffSnapshot and DiffPayload is engine-owned * and must not be inspected by consumers. */ /** Identifier for the engine adapter that produced the opaque payload. */ export type DiffEngineId = 'super-editor'; /** Declares which document components are included in a snapshot or diff. */ export interface DiffCoverage { body: true; comments: boolean; styles: boolean; numbering: boolean; headerFooters: boolean; } /** Versioned, fingerprinted snapshot of a document's diffable state. */ export interface DiffSnapshot { version: 'sd-diff-snapshot/v1' | 'sd-diff-snapshot/v2'; engine: DiffEngineId; fingerprint: string; coverage: DiffCoverage; /** Opaque engine-owned snapshot data. Do not inspect or modify. */ payload: Record; } /** Coarse change summary for a diff payload. */ export interface DiffSummary { hasChanges: boolean; changedComponents: Array<'body' | 'comments' | 'styles' | 'numbering' | 'headerFooters' | 'parts'>; body: { hasChanges: boolean; }; comments: { hasChanges: boolean; }; styles: { hasChanges: boolean; }; numbering: { hasChanges: boolean; }; headerFooters: { hasChanges: boolean; }; parts: { hasChanges: boolean; }; } /** Versioned diff payload describing changes from a base to a target document. */ export interface DiffPayload { version: 'sd-diff-payload/v1' | 'sd-diff-payload/v2'; engine: DiffEngineId; baseFingerprint: string; targetFingerprint: string; coverage: DiffCoverage; summary: DiffSummary; /** Opaque engine-owned diff data. Do not inspect or modify. */ payload: Record; } /** Result metadata returned after applying a diff. */ export interface DiffApplyResult { appliedOperations: number; baseFingerprint: string; targetFingerprint: string; coverage: DiffCoverage; summary: DiffSummary; diagnostics: string[]; } /** Input for `diff.compare`. */ export interface DiffCompareInput { targetSnapshot: DiffSnapshot; } /** Input for `diff.apply`. */ export interface DiffApplyInput { diff: DiffPayload; } /** How body content changes are applied. */ export type DiffChangeMode = 'direct' | 'tracked'; /** Options for `diff.apply`. */ export interface DiffApplyOptions { changeMode?: DiffChangeMode; } //# sourceMappingURL=diff.types.d.ts.map