import type { TCorePropositionalExpression } from "../schemata/index.js"; import type { TCorePositionConfig } from "../utils/position.js"; import type { TExpressionInput, TExpressionWithoutPosition, TExpressionUpdate } from "./expression-manager.js"; /** * Validates the preconditions for `ExpressionManager.insertExpression` * (existence, arity, and root-only-operator rules) and returns the anchor * slot the new expression inherits. * * @throws Under the same conditions documented on `insertExpression`. */ export declare function validateInsertExpression(expression: TExpressionInput, leftNodeId: string | undefined, rightNodeId: string | undefined, expressions: Map): { anchorParentId: string | null; anchorPosition: number; }; /** * Validates the preconditions for `ExpressionManager.wrapExpression` * (existence, arity, and root-only-operator rules) and returns the existing * node's ID plus the anchor slot the operator inherits. * * @throws Under the same conditions documented on `wrapExpression`. */ export declare function validateWrapExpression(operator: TExpressionWithoutPosition, newSibling: TExpressionWithoutPosition, leftNodeId: string | undefined, rightNodeId: string | undefined, expressions: Map): { existingNodeId: string; anchorParentId: string | null; anchorPosition: number; }; /** * Computes the sibling-position redistribution range for * `ExpressionManager.repositionSiblings`: which contiguous run of * `children` to shift, and the bounds to spread them across. * * @throws If neither direction has enough space to redistribute into. */ export declare function validateRepositionSiblings(children: TExpr[], leftPos: number, rightPos: number, positionConfig: TCorePositionConfig): { startIdx: number; endIdx: number; lowerBound: number; upperBound: number; count: number; }; /** * Validates the preconditions for `ExpressionManager.updateExpression` * and, when the update includes a position change, performs the sibling * position-set swap (delete old position, reject or accept the new one). * * Mutates `childPositionsByParentId` in place when a position update is * accepted — this is the one check in this module that isn't a pure * throw-or-void helper, since the swap must happen atomically with the * collision check to avoid leaving the position set inconsistent. * * @throws Under the same conditions documented on `updateExpression`. */ export declare function validateUpdateExpression(expressionId: string, expression: TExpr, updates: TExpressionUpdate, childPositionsByParentId: Map>): void; /** * Validates the preconditions for the single-child-promotion branch of * `ExpressionManager.removeAndPromote` and returns which of the two * branches applies. * * @throws If `target` has more than one child. * @throws If the single child is a root-only operator (`implies`/`iff`) * that would be placed in a non-root position. * @returns The child to promote, or `undefined` for a plain leaf removal. */ export declare function validateRemoveAndPromote(expressionId: string, target: TExpr, children: TExpr[]): TExpr | undefined; /** * Validates the preconditions for * `ExpressionManager.addExpressionRelative` and returns the sibling * looked up by ID. * * @throws If the sibling does not exist. */ export declare function validateAddExpressionRelative(siblingId: string, expressions: Map): TExpr; //# sourceMappingURL=expression-manager-checks.d.ts.map