import type { CanvasGraph } from './graph-projection.js'; import type { YarramateOperation } from './operations.js'; /** * Drafting a deletion, the last of the four motions the write surface has * (ADR 0069) and the last the canvas could not make. * * `apply` refuses to delete a subject anything still references, and evaluates * that against the post-batch state, so a subject and the relationships naming * it land as one atomic motion when they go together. Composing that batch is * the useful part: a reviewer deleting one subject would otherwise have to * find every relationship touching it by hand, and a canvas already knows them. */ /** A reference that would still hold the subject after its relationships go. */ export interface DeletionBlocker { /** The subject doing the referencing. */ readonly by: string; /** Which of its fields names the target. */ readonly field: 'owner' | 'distinctFrom' | 'supersedes' | 'constraint' | 'reference'; } /** * What would still refuse the deletion once every relationship naming the * subject is deleted with it. * * Relationships are absent by construction: they are deleted in the same * batch. What remains is the reference kinds a batch cannot resolve on the * reviewer's behalf, because removing them changes what another subject says * rather than removing something that only existed to join two things. */ export declare const deletionBlockers: (graph: CanvasGraph, id: string) => readonly DeletionBlocker[]; /** * The operations that remove a subject, or a relationship, from the model. * * Deleting a subject takes every relationship naming it along, which is what * makes the batch land at all. Each operation names the document the thing was * actually authored in, so a relationship stored apart from its endpoints is * still spliced out of its own file. * * Empty when the id is not in the graph. Blockers are NOT consulted here: a * caller that wants to warn asks {@link deletionBlockers}, and one that goes * ahead anyway is refused by `apply` rather than by a second opinion here. */ export declare const draftDeletion: (graph: CanvasGraph, id: string) => readonly YarramateOperation[]; /** * What a reviewer is about to do, in a sentence, for the confirmation. * * Blockers are stated rather than used to disable the confirmation. The list * is derived from what a canvas holds, and a canvas does not hold everything * that can reference a subject - an evidence overlay is not in the graph - so * treating it as authoritative would refuse deletions that would actually * land. `apply` is the gate; this is a warning. */ export declare const describeDeletion: (graph: CanvasGraph, id: string) => string | null;