API reference@evolu/commonResult › Done

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

A signal indicating normal completion of a pull-based protocol.

This is not a failure — it is a control signal that carries an optional "done" value (often void, but can be a final summary or leftover).

Inspired by JavaScript's IteratorResult where { done: true } signals completion.

Example

import { assertEqual, assertType, done, type Done } from "@evolu/common";

const withoutValue = done();
const withValue = done(42);
assertType<Done<void>, typeof withoutValue>();
assertType<Done<number>, typeof withValue>();
assertEqual(withoutValue, { type: "Done", done: undefined });
assertEqual(withValue, { type: "Done", done: 42 });

Extends

Properties

done

readonly done: D;

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


type

readonly type: "Done";

Defined in: packages/common/src/Type.ts:11986

Inherited from

Typed.type