API reference@evolu/commonResult › OnlyDone

type OnlyDone<E> = Extract<E, Done<any>>;

Defined in: packages/common/src/Result.ts:868

Extracts only Done from an error union.

Useful for pull-based protocols where completion is encoded in the error channel (for example NextResult).

Example

import {
  assertType,
  type Done,
  type OnlyDone,
  type Typed,
} from "@evolu/common";

type Errors = ReadFailedError | Done<number>;

interface ReadFailedError extends Typed<"ReadFailed"> {}

assertType<Done<number>, OnlyDone<Errors>>();