import { DiffMeta } from 'api-smart-diff';
import { DiffBlockData, Token, TokenTag } from './common';
import { JsonValue } from '../types';
/** Format-specific context passed through the traversal. Mutable within a sibling iteration. */
export interface FormatContext {
    last: boolean;
    level: number;
}
/** Strategy interface for format-specific token generation */
export interface FormatStrategy {
    stringify(value: JsonValue): string;
    propLineTokens(key: string | number, value: JsonValue, diff: DiffMeta | undefined, ctx: FormatContext): Token[];
    arrLineTokens(value: JsonValue, diff: DiffMeta | undefined, ctx: FormatContext): Token[];
    propBlockTokens(isArray: boolean, key: string | number, diff: DiffMeta | undefined, ctx: FormatContext): Token[];
    beginBlockTokens(isArray: boolean, ctx: FormatContext): Token[];
    endBlockTokens(isArray: boolean, ctx: FormatContext): Token[];
    addBlockTokens(block: DiffBlockData, isArray: boolean): void;
    /** Called after each child block is added. May mutate ctx (e.g. YAML resets level). */
    postAddBlock?(parent: DiffBlockData, block: DiffBlockData, ctx: FormatContext): void;
    /**
     * Create a container block for an array item that is itself an object/array.
     * Returns the block and the level to use when recursing into its children.
     * If not provided, the default beginBlockTokens path is used.
     */
    createArrayContainerBlock?(parent: DiffBlockData, isArrayValue: boolean, diff: DiffMeta | undefined, ctx: FormatContext): {
        block: DiffBlockData;
        childLevel: number;
    };
}
/** Shared helper: generate value tokens with word-level diff support */
export declare function valueTokens(stringify: (v: JsonValue) => string, tokenCtor: (value: string, tags?: TokenTag | TokenTag[]) => Token, value: JsonValue, diff?: DiffMeta): Token[];
/** Recursively build the diff tree for an input object/array */
export declare function buildDiff(input: Record<string, unknown> | unknown[], parent: DiffBlockData, strategy: FormatStrategy, ctx?: FormatContext): void;
