# OperationSnapshot

Source: /tuil/docs/reference/packages/operations/api/operation-snapshot
Locale: en

interface exported by @mwillbanks/tuil-operations.



{/* Generated by tooling/docs/generate-reference.ts. */}

## interface [#interface]

Public interface exported by `@mwillbanks/tuil-operations`.

```ts
export interface OperationSnapshot<TResult = unknown> {
  readonly id: string;
  readonly title: string;
  readonly description?: string;
  readonly status: OperationStatus;
  readonly progress?: OperationProgress;
  readonly attempt: number;
  readonly startedAt?: number;
  readonly completedAt?: number;
  readonly result?: TResult;
  readonly error?: OperationError;
  readonly children: readonly OperationSnapshot[];
  readonly metadata: Readonly<Record<string, unknown>>;
  readonly logs: readonly string[];
}
```

## Members [#members]

| Member        | Type                                    | Required | Description                                                                      | Related types                                                                     |
| ------------- | --------------------------------------- | -------- | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `id`          | `string`                                | Yes      | The `id` member uses the `string` contract.                                      | —                                                                                 |
| `title`       | `string`                                | Yes      | The `title` member uses the `string` contract.                                   | —                                                                                 |
| `description` | `string \| undefined`                   | No       | The `description` member uses the `string \| undefined` contract.                | —                                                                                 |
| `status`      | `OperationStatus`                       | Yes      | The `status` member uses the `OperationStatus` contract.                         | [`OperationStatus`](/tuil/docs/reference/packages/operations/api/operation-status)     |
| `progress`    | `OperationProgress \| undefined`        | No       | The `progress` member uses the `OperationProgress \| undefined` contract.        | [`OperationProgress`](/tuil/docs/reference/packages/operations/api/operation-progress) |
| `attempt`     | `number`                                | Yes      | The `attempt` member uses the `number` contract.                                 | —                                                                                 |
| `startedAt`   | `number \| undefined`                   | No       | The `startedAt` member uses the `number \| undefined` contract.                  | —                                                                                 |
| `completedAt` | `number \| undefined`                   | No       | The `completedAt` member uses the `number \| undefined` contract.                | —                                                                                 |
| `result`      | `TResult \| undefined`                  | No       | The `result` member uses the `TResult \| undefined` contract.                    | —                                                                                 |
| `error`       | `OperationError \| undefined`           | No       | The `error` member uses the `OperationError \| undefined` contract.              | [`OperationError`](/tuil/docs/reference/packages/operations/api/operation-error)       |
| `children`    | `readonly OperationSnapshot<unknown>[]` | Yes      | The `children` member uses the `readonly OperationSnapshot<unknown>[]` contract. | [`OperationSnapshot`](/tuil/docs/reference/packages/operations/api/operation-snapshot) |
| `metadata`    | `Readonly<Record<string, unknown>>`     | Yes      | The `metadata` member uses the `Readonly<Record<string, unknown>>` contract.     | —                                                                                 |
| `logs`        | `readonly string[]`                     | Yes      | The `logs` member uses the `readonly string[]` contract.                         | —                                                                                 |

## Parameters [#parameters]

This declaration has no public members.

## Returns [#returns]

This declaration does not return a value.

## Throws [#throws]

No thrown errors are documented for this declaration.

## Related types [#related-types]

* [`OperationError`](/tuil/docs/reference/packages/operations/api/operation-error)
* [`OperationProgress`](/tuil/docs/reference/packages/operations/api/operation-progress)
* [`OperationStatus`](/tuil/docs/reference/packages/operations/api/operation-status)

## Source [#source]

[View the secondary source reference](https://github.com/mwillbanks/tuil/blob/main/packages/operations/src/index.ts)

## Package [#package]

[@mwillbanks/tuil-operations](/tuil/docs/reference/packages/operations)
