flagstaff
API reference

flagstaff/tasks

Every export of flagstaff/tasks, with its signature and doc comment: tasks, plus 4 types.

import { tasks } from 'flagstaff/tasks';

Functions

tasks

A task list: settled tasks one line each off a terminal, the whole list drawn on one.

function tasks({ spinner }?: TasksOptions): Component<TasksState>;
ParameterType
{ spinner } (optional)TasksOptions

Returns Component<TasksState>

Interfaces

Task

interface Task {
    title: string;
    /** `pending` when omitted. */
    status?: TaskStatus;
    /** A line under the title — the step's current detail, shown only on a terminal. */
    detail?: string;
}

TasksOptions

interface TasksOptions {
    /** The spinner style the running task is drawn with. Default `dots`. */
    spinner?: string;
}

TasksState

interface TasksState {
    tasks: Task[];
}

Types

TaskStatus

type TaskStatus = 'pending' | 'running' | 'ok' | 'fail' | 'warn' | 'info';

On this page