import { FlowBlock, TrackChangeAuthor, TrackedChangeMeta } from './index.js'; /** * A composed resolver mapping a tracked-change author identity to a color. * Returns `undefined` only when the resolver itself declines (it normally * falls back to a deterministic color); the field is left absent entirely when * per-author colors are disabled. */ export type TrackChangeAuthorColorResolver = (author: TrackChangeAuthor) => string | undefined; /** * Host-facing per-author tracked-change color configuration. Mirrors the * `modules.trackChanges.authorColors` shape on the public `superdoc` package. */ export interface AuthorColorsConfig { /** When `false`, per-author colors are not applied. Defaults to enabled. */ enabled?: boolean; /** * Color overrides keyed by author identity. Both `email` and `name` keys are * supported (email is checked first); matching is exact. */ overrides?: Record; /** * Resolver consulted after `overrides`. Return a CSS color string, or * `undefined`/nullish to fall through to the deterministic fallback. */ resolve?: (author: TrackChangeAuthor) => string | undefined | null; } /** Stable identity string for an author (used for hashing + dedupe). */ export declare const authorIdentityKey: (author: TrackChangeAuthor | undefined) => string; /** * Deterministic fallback color derived from the author identity. The same * identity always maps to the same palette entry, so colors stay stable across * reloads and across the paint / snapshot surfaces. */ export declare const fallbackAuthorColor: (author: TrackChangeAuthor | undefined) => string; /** * Composes the host `authorColors` config into a single resolver. * * Resolution order per author: * 1. `overrides` by identity — `email` first, then `name` (exact match). * 2. `resolve(author)`. * 3. A deterministic fallback color from the author identity. * * Returns `undefined` when colors are disabled (`enabled === false`) or no * config was provided, so callers can leave the existing default palette in * place by simply not threading a resolver. */ export declare const composeAuthorColorResolver: (config?: AuthorColorsConfig | null) => TrackChangeAuthorColorResolver | undefined; /** Maps tracked-change metadata to the author identity the resolver expects. */ export declare const authorFromTrackedChangeMeta: (meta: TrackedChangeMeta) => TrackChangeAuthor; /** * Walks every tracked-change layer in the converted FlowBlocks and stamps * `meta.color` from the resolver. Passing `undefined` clears existing colors, * which prevents stale author colors from surviving on reused cached blocks * after the host disables per-author colors. */ export declare const stampTrackedChangeColors: (blocks: FlowBlock[], resolve: TrackChangeAuthorColorResolver | undefined) => void; //# sourceMappingURL=author-colors.d.ts.map