import type { Task, TaskStore } from "../types.js"; /** * Sync parent-child relationship (bidirectional). * Updates: parent.children[] ↔ child.parent_id */ export declare function syncParentChild(store: TaskStore, childId: string, oldParentId: string | null, newParentId: string | null): void; /** * Add blocking relationship (bidirectional). * Updates: blocker.blocks[] ↔ blocked.blockedBy[] */ export declare function syncAddBlocker(store: TaskStore, blockerId: string, blockedId: string): void; /** * Remove blocking relationship (bidirectional). */ export declare function syncRemoveBlocker(store: TaskStore, blockerId: string, blockedId: string): void; /** * Clean up all references to a deleted task. */ export declare function cleanupTaskReferences(store: TaskStore, taskId: string): void; /** * Check if adding blocker→blocked would create a cycle. * A cycle exists if 'blocked' is already in blocker's dependency chain. * Checks both blockedBy and blocks directions for robustness against data inconsistencies. */ export declare function wouldCreateBlockingCycle(tasks: Task[], blockerId: string, blockedId: string): boolean; /** * Get incomplete tasks that are blocking a given task. */ export declare function getIncompleteBlockers(tasks: Task[], task: Task): Task[]; /** * Get IDs of incomplete tasks that are blocking a given task. */ export declare function getIncompleteBlockerIds(tasks: Task[], task: Task): string[]; /** * Check if a task is blocked (has any incomplete tasks in blockedBy). */ export declare function isBlocked(tasks: Task[], task: Task): boolean; /** * Check if a task has any incomplete children. */ export declare function hasIncompleteChildren(tasks: Task[], task: Task): boolean; /** * Check if a task is ready (pending with all blockers completed and no incomplete children). */ export declare function isReady(tasks: Task[], task: Task): boolean; /** * Check if a task is in progress (started but not completed). */ export declare function isInProgress(task: Task): boolean; /** * Collect all descendant IDs of a task recursively into a Set. */ export declare function collectDescendantIds(tasks: Task[], parentId: string, result: Set): void; /** * Check if potentialDescendant is a descendant of ancestorId. */ export declare function isDescendant(tasks: Task[], potentialDescendant: string, ancestorId: string): boolean; /** * Collect ancestors of a task, from root to immediate parent. */ export declare function collectAncestors(tasks: Task[], id: string): Task[]; /** * Calculate depth from a parent ID (for validation during creation). * Returns the depth a new child would have if created under this parent. */ export declare function getDepthFromParent(tasks: Task[], parentId: string): number; /** * Get the depth of a task (number of ancestors). * 0 = root (epic), 1 = task under epic, 2 = subtask */ export declare function getDepth(tasks: Task[], id: string): number; /** * Get immediate children of a task. */ export declare function getChildren(tasks: Task[], parentId: string): Task[]; /** * Get tasks that are blocked by a given task (depend on this task completing). * Returns only incomplete tasks. */ export declare function getBlockedTasks(tasks: Task[], task: Task): Task[]; /** * Get the maximum depth of descendants relative to a task. * Returns 0 if the task has no children, 1 if it has children but no grandchildren, etc. */ export declare function getMaxDescendantDepth(tasks: Task[], taskId: string): number; //# sourceMappingURL=task-relationships.d.ts.map