# flagstaff/tasks

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

Source: https://flagstaff.interlace.tools/docs/api/tasks

<!-- Generated by scripts/api-reference.ts from the built dist/*.d.ts. Do not edit; run `npx tsx scripts/api-reference.ts`. -->

```ts
import { tasks } from 'flagstaff/tasks';
```

## Functions

### tasks

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

```ts
function tasks({ spinner }?: TasksOptions): Component<TasksState>;
```

| Parameter | Type |
| :-- | :-- |
| `{ spinner }` (optional) | `TasksOptions` |

**Returns** `Component<TasksState>`

## Interfaces

### Task

```ts
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

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

### TasksState

```ts
interface TasksState {
    tasks: Task[];
}
```

## Types

### TaskStatus

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