export function decideTrackedChanges({ state, editor, decision, target, replacements }: {
    state: import('prosemirror-state').EditorState;
    editor: object;
    decision: ReviewDecision;
    target: object;
    replacements?: "paired" | "independent" | undefined;
}): DecisionResult | DecisionFailure;
export function buildDecisionBubbleEvents({ result, editor }: {
    result: DecisionResult;
    editor: object;
}): Array<{
    type: "trackedChange";
    event: "resolve" | "update";
    changeId: string;
    resolvedById?: string;
    resolvedByEmail?: string;
    resolvedByName?: string;
}>;
export type ReviewDecision = "accept" | "reject";
export type NormalizedDecisionTarget = {
    kind: "id";
    id: string;
} | {
    kind: "range";
    from: number;
    to: number;
} | {
    kind: "all";
};
export type DecisionDiagnostic = {
    code: string;
    severity: "info" | "warning" | "error";
    message: string;
    changeIds?: string[] | undefined;
    details?: unknown;
};
export type DecisionReceiptEntities = {
    /**
     * successor fragment ids minted by partial-range decisions.
     */
    createdChangeIds: string[];
    /**
     * changes whose surviving coverage changed.
     */
    updatedChangeIds: string[];
    /**
     * retired logical change ids.
     */
    removedChangeIds: Array<{
        id: string;
        cause?: string;
    }>;
    /**
     * comment threads removed as side effects.
     */
    deletedComments: Array<{
        id: string;
        cause: string;
    }>;
    /**
     * comment threads whose anchors survive but should detach from tracked-change threading.
     */
    detachedComments: Array<{
        id: string;
        cause: string;
    }>;
    /**
     * comment threads that shrank.
     */
    shrunkenComments: Array<{
        id: string;
        cause: string;
    }>;
    /**
     * child ids that retired with their parent.
     */
    affectedChildren: Array<{
        changeId: string;
    }>;
};
export type DecisionResult = {
    ok: true;
    /**
     * Pending transaction the caller dispatches.
     */
    tr: import('prosemirror-state').Transaction;
    receipt: DecisionReceiptEntities;
    /**
     * Ids the bubble lifecycle should refresh.
     */
    touchedChangeIds: Set<string>;
    diagnostics: DecisionDiagnostic[];
};
export type DecisionFailure = {
    ok: false;
    code: "TARGET_NOT_FOUND" | "INVALID_TARGET" | "REVISION_MISMATCH" | "PERMISSION_DENIED" | "CAPABILITY_UNAVAILABLE" | "PRECONDITION_FAILED" | "COMMENT_CASCADE_PARTIAL" | "NO_OP";
    message: string;
    diagnostics?: DecisionDiagnostic[] | undefined;
    details?: unknown;
};
export type ChangeSelection = {
    change: import('./review-graph.js').LogicalTrackedChange;
    /**
     * `full` resolves whole logical change.
     */
    coverage: "full" | "partial";
    /**
     * Concrete PM ranges to resolve.
     */
    ranges: Array<{
        from: number;
        to: number;
    }>;
};
export type MutationOp = {
    kind: "removeContent" | "removeMark" | "addMark" | "unwrapInsert" | "restoreFormat" | "removeFormat" | "rejectParagraphSplit";
    from: number;
    to: number;
    changeId?: string | undefined;
    side?: string | undefined;
    mark?: import('prosemirror-model').Mark | undefined;
    beforeMarks?: unknown[] | undefined;
    afterMarks?: unknown[] | undefined;
    anchor?: "source" | "inserted" | undefined;
};
export type MutationPlan = {
    /**
     * Document-order op list.
     */
    ops: MutationOp[];
    commentEffects: import('./comment-effects.js').CommentEffectsPlan & {
        _affectedChildren?: Array<{
            changeId: string;
        }>;
    };
    /**
     * Logical ids retired/updated by the decision.
     */
    touchedChangeIds: Set<string>;
    /**
     * Logical ids retired by the decision (subset).
     */
    retiredChangeIds: Set<string>;
    diagnostics: DecisionDiagnostic[];
};
/**
 * @typedef {'accept'|'reject'} ReviewDecision
 */
/**
 * @typedef {{ kind: 'id', id: string }
 *          | { kind: 'range', from: number, to: number }
 *          | { kind: 'all' }} NormalizedDecisionTarget
 */
/**
 * @typedef {Object} DecisionDiagnostic
 * @property {string} code
 * @property {'info'|'warning'|'error'} severity
 * @property {string} message
 * @property {string[]} [changeIds]
 * @property {unknown} [details]
 */
/**
 * @typedef {Object} DecisionReceiptEntities
 * @property {string[]} createdChangeIds successor fragment ids minted by partial-range decisions.
 * @property {string[]} updatedChangeIds changes whose surviving coverage changed.
 * @property {Array<{ id: string, cause?: string }>} removedChangeIds retired logical change ids.
 * @property {Array<{ id: string, cause: string }>} deletedComments comment threads removed as side effects.
 * @property {Array<{ id: string, cause: string }>} detachedComments comment threads whose anchors survive but should detach from tracked-change threading.
 * @property {Array<{ id: string, cause: string }>} shrunkenComments comment threads that shrank.
 * @property {Array<{ changeId: string }>} affectedChildren child ids that retired with their parent.
 */
/**
 * @typedef {Object} DecisionResult
 * @property {true} ok
 * @property {import('prosemirror-state').Transaction} tr Pending transaction the caller dispatches.
 * @property {DecisionReceiptEntities} receipt
 * @property {Set<string>} touchedChangeIds Ids the bubble lifecycle should refresh.
 * @property {DecisionDiagnostic[]} diagnostics
 */
/**
 * @typedef {Object} DecisionFailure
 * @property {false} ok
 * @property {'TARGET_NOT_FOUND'|'INVALID_TARGET'|'REVISION_MISMATCH'|'PERMISSION_DENIED'|'CAPABILITY_UNAVAILABLE'|'PRECONDITION_FAILED'|'COMMENT_CASCADE_PARTIAL'|'NO_OP'} code
 * @property {string} message
 * @property {DecisionDiagnostic[]} [diagnostics]
 * @property {unknown} [details]
 */
export const TRACKED_MARK_NAMES: Set<string>;
//# sourceMappingURL=decision-engine.d.ts.map