Skip to content

TaskView is a self-hosted project and task management platform focused on clarity, ownership, and control. TaskView is built for teams that want a transparent, self-hosted alternative to SaaS task managers.

1.0 KB
Raw Blame
import type { Edge, Node, XYPosition } from '@vue-flow/core'
import type { TaskItem } from './tasks.types'

export type GraphDirection = 'LR' | 'TB';

// Which side of an existing task a new one goes: before it (a predecessor) or after it (a successor)
export type GraphPlacementSide = 'before' | 'after';

export type GraphStore = {
    nodes: Node[];
    edges: Edge[];
    allNodes: Node[];
    allEdges: Edge[];
    goalId: number | null;
    direction: GraphDirection;
};

export type GraphInsertTaskArgs = {
    task: TaskItem;
    position?: XYPosition | null;
};

export type GraphPositionNearArgs = {
    taskId: number;
    task: TaskItem;
    side: GraphPlacementSide;
};

export type GraphPlaceNodeFreeArgs = {
    /** wanted top-left corner of the new node */
    target: XYPosition;
    node: Pick<Node, 'data'>;
    obstacles: Node[];
};

export type GraphPlaceNodeNearArgs = {
    anchor: Node;
    node: Pick<Node, 'data'>;
    side: GraphPlacementSide;
    direction: GraphDirection;
    obstacles: Node[];
};