gantt-renderer
    Preparing search index...

    Type Alias Task<TData>

    Task: (
        | {
            color?: string;
            data?: unknown;
            endDate: string;
            id: number;
            kind: "task";
            parent?: number;
            percentComplete: number;
            readonly?: boolean;
            startDate: string;
            text: string;
        }
        | {
            color?: string;
            data?: unknown;
            endDate: string;
            id: number;
            kind: "project";
            open: boolean;
            parent?: number;
            percentComplete: number;
            readonly?: boolean;
            startDate: string;
            text: string;
        }
        | {
            color?: string;
            data?: unknown;
            id: number;
            kind: "milestone";
            parent?: number;
            readonly?: boolean;
            startDate: string;
            text: string;
        }
    ) extends infer _U
        ? _U extends unknown
            ? Omit<_U, "data"> & (
                [TData] extends [never] ? Record<never, never> : { data?: TData }
            )
            : never
        : never

    A task in the Gantt chart — discriminated by kind into leaf tasks, summary projects, and milestones.

    Type Parameters

    • TData = never

      The type of the optional data property. Defaults to never, which omits the data property from the type. Specify a concrete type to enable compile-time-checked task data in both input and callback payloads.

    // Default: no `data` property
    const task: Task = { id: 1, text: 'Build', startDate: '2026-01-01', endDate: '2026-01-03', kind: 'task' };

    // With typed data
    interface TaskMeta { priority: number; label: string }
    const typedTask: Task<TaskMeta> = {
    id: 1, text: 'Build', startDate: '2026-01-01', endDate: '2026-01-03',
    kind: 'task', data: { priority: 1, label: 'critical' }
    };