Skip to content
// EFFECT DAYS 2026

Story unstable

Story tests drive update with messages and assert on the Model: pure, with no runtime, no Layers, no host and no view.

Details

A story is evidence about update. It takes any message and any Model, so it reaches branches that are awkward to reach through the view. It never renders, so a defect in view fails a Scene, not a story. Commands stay pending as data until a step resolves them with the message they would have produced, so no service is needed.

make is a scoped Effect that gives a cursor, Steps, whose steps run as soon as they are called and return the cursor, so they chain. The test reads the Model and the rest of the record from the cursor between steps. A shared setup is a function of the cursor, applied with pipe. Every step follows the acknowledgement rule described in Steps: a story is the full account of what the component did. A defect in init or update makes the step throw, on the line that called it.

A child a story's component binds with children is reached without a view: childEmit and childFailure stand in for what it emits and how it fails, and expectBound checks what is bound, with what props. A child step names the child by its component, then by its key when it has one: childEmit(Profile, event), childEmit(Row, "a", event).

check generates messages and settlements, checks Schemas and an optional invariant, and shrinks a failing story for replay.

Example A todo row: send, resolve its Command, check the Model

import { Command, Component, UiSchema } from "effect/ui"
import { Story } from "effect/ui/testing"
import { Effect, Schema } from "effect"
const Message = UiSchema.TaggedEnum({ ClickedSave: {}, CompletedSaveTodo: {} })
class SaveTodo extends Command.Service<SaveTodo>()(
"todos/SaveTodo",
{ args: { id: Schema.String }, success: Message }
) {}
const TodoItem = Component.define({
name: "TodoItem",
props: Schema.Struct({ id: Schema.String }),
model: Schema.Struct({ saved: Schema.Boolean }),
message: Message
}).make({
init: () => ({ saved: false }),
update: ($, message) =>
Message.match(message, {
ClickedSave: () => $.run(SaveTodo.make({ id: $.props.id })),
CompletedSaveTodo: () => ({ saved: true })
}),
view: (h) => h.el("button").on("click", Message.ClickedSave()).children("save")
})
Effect.gen(function*() {
const s = yield* Story.make(TodoItem, { id: "t1" })
s.send(Message.ClickedSave())
.expectExact(SaveTodo.make({ id: "t1" }))
.resolve(SaveTodo, Message.CompletedSaveTodo())
console.log(s.model.saved) // true
}).pipe(Effect.scoped, Effect.runSync)
31 exports Since v4.2.0 Source

Checking

check

unstable
Since v4.2.0

Returns an Effect that runs generated stories for a component and props. A failing story is shrunk and reported as a defect with a replay token.

Details

Generated steps:

Each story starts with start. Steps either send a message or settle one piece of pending work: a Command, an afterRefetch wait, a query load or a load more. Settlements with no eligible work are skipped. Before sending, the runner uses keepPending so messages can arrive while work is pending. Query entries under a live optimistic patch cannot settle.

Command results default to the Service's success and error Schemas; query results use the query's Schemas. A Command.make Command needs a commands entry with a success generator or the run fails when selecting its outcomes. Schema.Never outcomes are not generated. Work with no available outcome stays pending. Use messages: Schema.Never to generate only settlements.

An infinite query loads one page on a cold load. A refetch loads as many pages as it holds, unless next ends the list first.

Checks and failures:

After init and each applied step, the runner checks the Model's Schema, runs transition on each update call in order, runs invariant, then validates and acknowledges events and sends using the events and receives Schemas. A step that throws also fails the run. init isn't an update call, so transition never sees the initial Model.

The failure report includes Story steps, the Model, pending Commands and a replay token. Shrinking removes steps and shrinks messages generated from a Schema or Arbitrary. Command and query results, and messages generated by a function, are sampled by seed; their values do not shrink.

Choosing generators:

Defaults allow any value in the Schemas. If a Command's success is the whole message Schema, it can resolve with any message. The default message generator can also send a completion message without a pending Command. Narrow messages and commands to the interactions you want to test.

Reports identify Commands by name, not by their variable names. effect/Arbitrary is unstable; replay tokens may not survive a release.

Signature

declare function check<C extends AnyComponent, O extends readonly Array<Any> = []>(component: C, props: Props<C>, options?: CheckOptions<C, O>): Effect<void>

Example Check that the saving flag matches pending saves

import { Command, Component, UiSchema } from "effect/ui"
import { Story } from "effect/ui/testing"
import { Effect, Schema } from "effect"
const Message = UiSchema.TaggedEnum({ ClickedSave: {}, CompletedSave: {} })
class Save extends Command.Service<Save>()("todos/Save", {
success: Message
}) {}
const Editor = Component.define({
name: "Editor",
model: Schema.Struct({ saving: Schema.Boolean }),
message: Message
}).make({
init: () => ({ saving: false }),
update: ($, message) =>
Message.match(message, {
ClickedSave: () =>
$.model.saving ? $.model : $.set({ saving: true }).run(Save.make()),
CompletedSave: () => ({ saving: false })
}),
view: (h) => h.el("button").on("click", Message.ClickedSave()).children("save")
})
Story.check(Editor, {}, {
messages: Message.cases.ClickedSave,
commands: [[Save, { success: Message.cases.CompletedSave }]],
invariant: (story) => story.model.saving === (story.pending.length > 0)
}).pipe(Effect.runPromise)

Constructors

make

unstable
Since v4.2.0

Starts a story: init with props, as a cursor in a scope. The test calls steps on the cursor and reads the record from it.

Details

When the scope closes with a success, the end check runs: it fails on anything pending, kept or exempt included, on a query with no result unless keepPending named it, and on any event or send not acknowledged. When the scope closes with a failure the end check doesn't run, so a failed test reports only its own failure. it.effect from @effect/vitest provides the scope, which closes at the end of the test.

Signature

declare function make<C extends AnyComponent>(component: C, props: Props<C>): Effect<Steps<C>, never, Scope>

start

unstable
Since v4.2.0

The cursor after init. Its steps follow the acknowledgement rule, but nothing checks what's pending or unacknowledged at the end.

Signature

declare function start<C extends AnyComponent>(component: C, props: Props<C>): Steps<C>

Exploring

explore

unstable
Since v4.2.0

Explores stories up to depth moves using the supplied component, props, messages and Command results. Returns { states, closed } on success, or throws with a shortest failing path as Story steps.

Details

A move sends one of messages, or settles a running Command with one of its listed results: resolve for each success, fail for each error. An afterRefetch wait ends with waitExpired. Before sending a message, the search calls keepPending for blocking Commands and unloaded queries, allowing messages to arrive while Commands run. As in a written Story, only the oldest run with the same name and args settles.

After init and every move, the Model is checked against its Schema, then transition runs on each update call in order, then invariant, then events and sends are checked against their Schemas and acknowledged. A move that throws fails too. transition never sees init. Rules should read only what they are given: outside state defeats the merging below.

Moves run breadth first, messages as listed, then pending Commands oldest first. With deterministic inputs and component logic, the first failure is a shortest one and is the same on every run. Two records that agree on the Model, the query results and the pending Commands, each with the messages its results deliver, share the rest of the search. Plain objects and arrays match their copies, with the same own properties in the same order and the same sharing of references. This merging applies only to records without opaque objects, functions or accessors. A record containing a Date, an Option or a class instance merges only with one containing the same objects, which may use more of the state budget. Comparing plain data with an external constant by reference can hide a failing path; avoid such comparisons in components tested with explore.

Running out of the states budget throws, so a pass covers the whole depth bound. closed: true means no further moves reach new records; closed: false means the search reached its depth limit without closure.

Gotchas

A Command with no commands entry fails the search naming it, unless it is a silent Command.Service, which settles with Component.noop. A stream Command fails the search when it is issued. Queries stay unloaded, and props, subscriptions and shared don't change.

Signature

declare function explore<C extends AnyComponent, O extends readonly Array<ExploredCommand> = []>(component: C, props: Props<C>, options: ExploreOptions<C, O>): Explored

Example Results match the query

import { Command, Component, UiSchema } from "effect/ui"
import { Story } from "effect/ui/testing"
import { Effect, Schema } from "effect"
const Message = UiSchema.TaggedEnum({
Typed: { text: Schema.String },
GotResults: { query: Schema.String }
})
const Search = Command.make(
"search/Search",
{ args: { text: Schema.String }, mode: "switch" },
({ text }) => Effect.succeed(Message.GotResults({ query: text }))
)
const SearchBox = Component.define({
name: "SearchBox",
model: Schema.Struct({
query: Schema.String,
results: Schema.NullOr(Schema.String)
}),
message: Message
}).make({
init: () => ({ query: "", results: null }),
update: ($, message) =>
Message.match(message, {
Typed: ({ text }) =>
$.set({ ...$.model, query: text }).run(Search.make({ text })),
GotResults: ({ query }) => ({ ...$.model, results: query })
}),
view: (h, model) => h.el("p").children(model.query)
})
const explored = Story.explore(SearchBox, {}, {
messages: [Message.Typed({ text: "a" }), Message.Typed({ text: "ab" })],
commands: [[Search, {
success: ({ text }) => [Message.GotResults({ query: text })]
}]],
invariant: (story) =>
story.pending.length > 0 || story.model.results === null ||
story.model.results === story.model.query,
depth: 6
})
console.log(explored.closed) // true

Models

AwaitedQuery

interface unstable
Since v4.2.0

A query a Command.afterRefetch run waits for, by its name in queries, at the args it returned when the run resolved. A queryMany query has one per awaited key.

Signature

interface AwaitedQuery {
readonly args: unknown;
readonly name: string;
}

BoundExpected

type unstable
Since v4.2.0

What expectBound expects of one children entry. A Component.child entry is an object: key and props are checked when given. A Component.childMany entry lists its keys in order, each a key or an object that also checks its props.

Signature

type BoundExpected = {
readonly key?: string;
readonly props?: unknown;
} | ReadonlyArray<string | {
readonly key: string;
readonly props?: unknown;
}>

BoundInfo

interface unstable
Since v4.2.0

One child a component binds with children, as a test records it: the entry that binds it, the name of what it's bound to, its key, the path the runtime starts it at and the props its binding passes.

Signature

interface BoundInfo {
readonly child: string;
readonly key: string;
readonly name: string;
readonly path: string;
readonly props: unknown;
}

CheckOptions

interface unstable
Since v4.2.0

Generators and an invariant for check, plus the run, shrink and replay options accepted by Arbitrary.checkEffect.

Signature

interface CheckOptions<C extends AnyComponent, O extends ReadonlyArray<Command.Definition.Any> = []> extends CheckOptions {
readonly commands?: { [K in string | number | symbol]: readonly [O[K], CheckResults<O[K]>] };
readonly invariant?: (current: Story<Props<C>, Model<C>, Message<C>, Events<C>, { [K in string | number | symbol]: QueryResultOf<Queries<C>[K]> }, RecordComponent<C>>) => boolean | void;
readonly messages?: Generated<Model<C>, Message<C>>;
readonly transition?: (transition: Transition<Model<C>, Message<C>>) => boolean | void;
}

CheckResults

interface unstable
Since v4.2.0

Overrides for a Command's result generators. Omitted outcomes use the Service's Schemas; generator functions receive the Command's args.

Signature

interface CheckResults<D> {
readonly error?: Generated<Args<D>, Failure<D>>;
readonly success?: Generated<Args<D>, Result<D>>;
}

Divergence

interface unstable
Since v4.2.0

Where a replay first computed something other than what the log recorded.

Details

recorded and recomputed hold the Model, the events, the Commands and the sends (both encoded the way the Wire encodes them) after the message in entry seq.

Signature

interface Divergence<Model, Msg, Events> {
readonly message: Msg;
readonly recomputed: Outcome<Model, Events>;
readonly recorded: Outcome<Model, Events>;
readonly seq: number;
}

Explored

interface unstable
Since v4.2.0

What a passing explore searched: the distinct records it reached, and whether they are every record reachable at any depth.

Signature

interface Explored {
readonly closed: boolean;
readonly states: number;
}

ExploredCommand

type unstable
Since v4.2.0

A non-stream Command that explore can settle.

Signature

type ExploredCommand = Command.Definition<any, any, false, any, any>

ExploredPending

interface unstable
Since v4.2.0

A pending Command as explore's invariant sees it: its name and args, not the work it runs.

Signature

interface ExploredPending<Msg> extends Omit<Shared.Pending<Msg>, "command"> {
readonly command: Pick<Shared.Pending<Msg>["command"], "name" | "args">;
}

ExploredRecord

type unstable
Since v4.2.0

A Story record without interruption history or pending Command internals, which the search omits when comparing records. Each pending Command exposes only its name and args.

Signature

type ExploredRecord<C extends AnyComponent> = Omit<Steps<C>["current"], "interrupted" | "pending"> & {
readonly pending: ReadonlyArray<ExploredPending<Component.Message<C>>>;
}

ExploreOptions

interface unstable
Since v4.2.0

The options of explore: the moves it tries, what it checks, and its bounds.

Signature

interface ExploreOptions<C extends AnyComponent, O extends ReadonlyArray<ExploredCommand> = []> {
readonly commands?: { [K in string | number | symbol]: readonly [O[K], ExploreResults<O[K]>] };
readonly depth: number;
readonly invariant?: (current: ExploredRecord<C>) => boolean | void;
readonly messages: readonly Array<Message<C>> | (model: Model<C>) => readonly Array<Message<C>>;
readonly states?: number;
readonly transition?: (transition: Transition<Model<C>, Message<C>>) => boolean | void;
}

ExploreResults

interface unstable
Since v4.2.0

The results explore settles a running Command with. A function takes the Command's args. Empty or missing lists never settle it.

Signature

interface ExploreResults<D> {
readonly error?: readonly Array<Failure<D>> | (args: Args<D>) => readonly Array<Failure<D>>;
readonly success?: readonly Array<Result<D>> | (args: Args<D>) => readonly Array<Result<D>>;
}

Generated

type unstable
Since v4.2.0

A source of generated values for check. Use a function when values depend on the current Model or Command args.

Signature

type Generated<Input, A> = Schema.Schema<A> | Arbitrary.Arbitrary<A> | (input: Input) => Arbitrary.Arbitrary<A>

KeyedLoad

type unstable
Since v4.2.0

One key of a queryMany query for loadedMany: its args and a Success value or a typed failure.

Signature

type KeyedLoad<R extends Query.Query.Any> = {
readonly args: Query.Query.Args<R>;
readonly patched?: boolean;
readonly value: Query.Query.Success<R>;
readonly waiting?: boolean;
} | {
readonly args: Query.Query.Args<R>;
readonly error: Query.Query.Error<R>;
readonly waiting?: boolean;
}

Outcome

interface unstable
Since v4.2.0

What one update produced, as a replay compares it.

Signature

interface Outcome<Model, Events> {
readonly commands: readonly Array<{
readonly _tag: "Interrupt" | "Effect" | "Stream";
readonly args: Json;
readonly group: string | null;
readonly name: string;
}>;
readonly events: readonly Array<Events>;
readonly lists: readonly Array<ListIssue>;
readonly model: Model;
readonly sends: readonly Array<{
readonly message: Json;
readonly owner: string;
}>;
}

Pending

interface unstable
Since v4.2.0

A Command issued by the instance whose message hasn't been delivered.

Details

running is what the runtime would be executing; queued is waiting behind a running run of the same group under mode: "queue". awaiting has resolved or failed, and holds message: a Command.afterRefetch run waits for the queries in awaiting, and under mode: "queue" a message also waits for the earlier ones of its group.

Signature

interface Pending<Msg> {
readonly awaiting?: readonly Array<AwaitedQuery>;
readonly command: Issued<Noop | Msg, any, never, "Effect", never> | Issued<Noop | Msg, any, never, "Stream", never>;
readonly message?: Noop | Msg;
readonly status: "running" | "queued" | "awaiting";
}

QueryInfo

interface unstable
Since v4.2.0

One of a component's queries in a story: its name, its Query's name, and the args it returns for the current Model and props, undefined when it is disabled. A queryMany query's args are its unique args, in order.

Signature

interface QueryInfo {
readonly args: unknown;
readonly name: string;
readonly query: string;
}

Replay

interface unstable
Since v4.2.0

The result of fromLog: the state the replay reached (the Model, props and query results), how many messages it re-ran, and the first divergence, if any. On a divergence, the state is the one the diverging message was sent to: the Model before it, and the props and results its update read.

Signature

interface Replay<Model, Msg, Events, Queries = {
[name: string]: unknown;
}, Props = unknown> {
readonly divergence: Divergence<Model, Msg, Events> | undefined;
readonly model: Model;
readonly path: string;
readonly props: Props;
readonly queries: () => Queries;
readonly replayed: number;
readonly results: Results | undefined;
}

Steps

interface unstable
Since v4.2.0

A cursor over one story. It has the steps every kind of test shares, from Steps.Steps, and drives the instance by sending messages to update.

Details

The types come from the component: Steps<typeof Counter> only sends Counter's messages. A step shared by any component is written <S extends Story.Steps.Any>(s: S): S, which keeps the caller's type. One that only uses the shared steps can take Steps.Steps.Any instead.

Signature

interface Steps<C extends AnyComponent> extends Steps<C> {
readonly current: Story<Props<C>, Model<C>, Message<C>, Events<C>, { [K in string | number | symbol]: QueryResultOf<Queries<C>[K]> }, RecordComponent<C>>;
readonly model: Model<C>;
readonly queries: { [K in string | number | symbol]: QueryResultOf<Queries<C>[K]> };
readonly results: Results | undefined;
childEmit<Child extends BoundTarget>(child: Child, event: EventsOf<Child>): this;
childEmit<Child extends BoundTarget>(child: Child, key: string, event: EventsOf<Child>): this;
childFailure(child: BoundTarget, cause: Cause<unknown>): this;
childFailure(child: BoundTarget, key: string, cause: Cause<unknown>): this;
send(message: Message<C> | (model: Model<C>) => Message<C>): this;
}

Example A shared setup

import { Effect, Schema } from "effect"
import { Component, UiSchema } from "effect/ui"
import { Story } from "effect/ui/testing"
const Message = UiSchema.TaggedEnum({ ClickedIncrement: {} })
const Counter = Component.define({
name: "Counter",
model: Schema.Struct({ count: Schema.Number }),
message: Message
}).make({
init: () => ({ count: 0 }),
update: ($) => ({ count: $.model.count + 1 }),
view: (h, model) => h.el("button").on("click", Message.ClickedIncrement()).children(`+ ${model.count}`)
})
const twice = (s: Story.Steps<typeof Counter>) =>
s.send(Message.ClickedIncrement()).send(Message.ClickedIncrement())
Effect.gen(function*() {
const s = yield* Story.make(Counter, {})
s.given({ count: 10 }).pipe(twice)
console.log(s.model.count) // 12
}).pipe(Effect.scoped, Effect.runSync)

Story

interface unstable
Since v4.2.0

The state of one instance between steps, as a story records it. Immutable: every step replaces the cursor's record with a new one.

Signature

interface Story<Props, Model, Msg, Events, Queries = {
[name: string]: unknown;
}, C = Shared.Record<Props, Model, Msg, Events>["component"]> extends Record<Props, Model, Msg, Events, C> {
readonly model: Model;
readonly queries: () => Queries;
readonly results: Results | undefined;
}

StreamTarget

type unstable
Since v4.2.0

A stream Command's definition, or an issued stream Command: what next and end take.

Signature

type StreamTarget = Command.Definition<any, any, true, any, any> | Command.Issued<any, any, never, "Stream">

Target

type unstable
Since v4.2.0

A pending Command's definition, or an issued Command to also match the arguments.

Signature

type Target = Command.Definition.Any | Command.Issued<any, any, never, "Effect"> | Command.Issued<any, any, never, "Stream">

Transition

interface unstable
Since v4.2.0

One update call, as a transition rule sees it: the Model it received, the message, and the Model it returned.

Signature

interface Transition<Model, Msg> {
readonly after: Model;
readonly before: Model;
readonly message: Msg;
}

Other

Steps

unstable
Since v4.2.0

Helper types for Steps.

Queries

parts

unstable
Since v4.2.0

The parts of a headless component for a Model and props: the plain values a consumer's closure would read.

Details

Given a Scene's record, a reader of shared state reads what the scene's shared steps gave, or else each owner's default, as the scene's view does.

For a component that builds on another with p.child, the parts are the ones the consumer gets. Each child it declares gives the parts of its init Model, or, given a Scene's record, of the Model givenChild set.

Signature

declare function parts<Props, Events, Parts, R, Rcv>(component: Headless<Props, Events, Parts, R, Rcv>, record: {
readonly model: unknown;
readonly props: Props;
} | {
readonly props: Props;
}): Parts

Replay

fromLog

unstable
Since v4.2.0

Re-runs a logged session of one component, purely, and reports the first place it doesn't reproduce.

Details

The replay starts at the oldest surviving Mounted or Update entry for the path (the first one logged for a component with this name, unless path is given), takes its Model, and re-runs every following message with the props and query results it was recorded with, so every update sees $.queries as it did when it ran, whichever entries the log still holds. Commands are compared, never run. Models and events are compared with Schema.toEquivalence, and Commands by their Wire encoding.

The props and results are tracked with the Model, so the result is the state the instance ended with. They start from the first entry's: a Mounted entry's or an Update entry's recorded props and results. Each later PropsChanged entry sets the props and each QueryChanged entry writes its result, so props from the parent and loads that settled after the last message are in the result too.

A path that mounted more than once is replayed instance by instance, each from its own entries, and the result is the state of the last one.

It takes live entries or Wire frames. A Wire value sent as a placeholder, such as a truncated Model, can't be decoded, and the error names the entry.

A headless component, such as an owner of shared state, replays the same way, preserving the model and message types inferred by make. Annotating the component as Component.Headless without its model and message type arguments widens those types to unknown.

To replay a mounted instance from a log, pass entry.component and { path: entry.path }. The log does not preserve the component's type arguments, so the replay's model, messages, events and props are unknown.

Signature

declare const fromLog: {
<C extends AnyComponent>(component: C, entries: readonly Array<Entry | {
readonly _tag: tag<Tag>;
readonly host: "server" | "browser" | "test" | "native" | "terminal";
readonly version: number;
} | {
readonly _tag: tag<Tag>;
readonly app: string;
readonly at: number;
readonly causedBy?: number;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly cursor?: Json | undefined;
readonly empty?: boolean;
readonly inWindow: boolean;
readonly logKey: string;
readonly page?: number;
readonly parentSpanId?: string;
readonly query: string;
readonly restart: boolean;
readonly seq: number;
readonly session: string;
readonly stored: boolean;
readonly traceId?: string;
readonly trigger: "watch" | "visibility" | "get" | "loadMore" | "reset" | "prefetch" | "connectivity" | "interval" | "invalidation";
readonly watcher?: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly boundary?: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly model: Json;
readonly path: string;
readonly props: Json;
readonly queries?: Json | undefined;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly adopted: boolean;
readonly at: number;
readonly boundary?: number;
readonly causedBy?: number;
readonly commands: readonly Array<{
readonly _tag: "Interrupt" | "Effect" | "Stream";
readonly args: Json;
readonly group: string | null;
readonly name: string;
}>;
readonly component: string;
readonly events: readonly Array<Json>;
readonly excluded?: boolean;
readonly instance: number;
readonly model: Json;
readonly path: string;
readonly props: Json;
readonly queries?: Json | undefined;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly boundary?: number;
readonly causedBy?: number;
readonly collected?: Json | undefined;
readonly commands: readonly Array<{
readonly _tag: "Interrupt" | "Effect" | "Stream";
readonly args: Json;
readonly group: string | null;
readonly name: string;
}>;
readonly component: string;
readonly events: readonly Array<Json>;
readonly excluded?: boolean;
readonly instance: number;
readonly lists: readonly Array<{
readonly name: string;
readonly op: "loadMore" | "reset";
}>;
readonly message: Json;
readonly model: Json;
readonly path: string;
readonly props: Json;
readonly queries?: Json | undefined;
readonly sends: readonly Array<{
readonly message: Json;
readonly owner: string;
}>;
readonly seq: number;
readonly session: string;
readonly shared?: Json | undefined;
readonly source: {
readonly _tag: tag<Tag>;
readonly name: string;
} | {
readonly _tag: tag<Tag>;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly name: string;
readonly spanId: string | null;
readonly traceId: string | null;
} | {
readonly _tag: tag<Tag>;
readonly deps: readonly Array<Json> | null;
readonly key: string;
readonly name: string;
} | {
readonly _tag: tag<Tag>;
readonly name: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly name: string;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
} | {
readonly _tag: tag<Tag>;
readonly args: Json;
readonly name: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
};
readonly viewTransition?: readonly Array<string>;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly path: string;
readonly props: Json;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly name: string;
readonly path: string;
readonly result: Json;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly path: string;
readonly seq: number;
readonly session: string;
readonly status?: "Pending" | "Rebuilding" | "Awaiting";
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly cause: {
readonly pretty: string;
readonly reasons: readonly Array<Json>;
};
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly path: string;
readonly redacted?: boolean;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly cause: {
readonly pretty: string;
readonly reasons: readonly Array<Json>;
};
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly in: string;
readonly instance: number;
readonly issued?: {
readonly index: number;
readonly seq: number;
};
readonly name: string | null;
readonly path: string;
readonly props: Json;
readonly seq: number;
readonly session: string;
readonly update?: {
readonly message: Json;
readonly source: {
readonly _tag: tag<Tag>;
readonly name: string;
} | {
readonly _tag: tag<Tag>;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly name: string;
readonly spanId: string | null;
readonly traceId: string | null;
} | {
readonly _tag: tag<Tag>;
readonly deps: readonly Array<Json> | null;
readonly key: string;
readonly name: string;
} | {
readonly _tag: tag<Tag>;
readonly name: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly name: string;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
} | {
readonly _tag: tag<Tag>;
readonly args: Json;
readonly name: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
};
};
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly args: Json;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly name: string;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly name: string;
readonly path: string;
readonly reason: "closed" | "completed" | "failed";
readonly seq: number;
readonly session: string;
readonly silent: boolean;
readonly started: number;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly name: string;
readonly parentSpanId?: string;
readonly path: string;
readonly seq: number;
readonly session: string;
readonly spanId: string;
readonly traceId: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly entries: readonly Array<{
readonly logKey: string;
readonly query: string;
}>;
readonly excluded?: boolean;
readonly instance: number;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly name: string;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly name: string;
readonly outstanding?: readonly Array<{
readonly logKey: string;
readonly query: string;
}>;
readonly path: string;
readonly seq: number;
readonly session: string;
readonly silent: boolean;
readonly spanId: string | null;
readonly traceId: string | null;
readonly waitEnded?: "interrupt" | "closed" | "switch" | "settled" | "nothing" | "budget";
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly name: string;
readonly path: string;
readonly reason: "self" | "interrupt" | "switch" | "unmount" | "layer";
readonly seq: number;
readonly session: string;
readonly spanId: string | null;
readonly traceId: string | null;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly name: string;
readonly path: string;
readonly reason: "server";
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly owner: string;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly deps: readonly Array<Json> | null;
readonly excluded?: boolean;
readonly instance: number;
readonly key: string;
readonly name: string;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly deps: readonly Array<Json> | null;
readonly excluded?: boolean;
readonly instance: number;
readonly key: string;
readonly name: string;
readonly path: string;
readonly seq: number;
readonly session: string;
}>, options?: {
readonly path?: string;
}): Replay<Model<C>, Message<C>, Events<C>, { [K in string | number | symbol]: QueryResultOf<Queries<C>[K]> }, Props<C>>;
(component: Any | Any, entries: readonly Array<Entry | {
readonly _tag: tag<Tag>;
readonly host: "server" | "browser" | "test" | "native" | "terminal";
readonly version: number;
} | {
readonly _tag: tag<Tag>;
readonly app: string;
readonly at: number;
readonly causedBy?: number;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly cursor?: Json | undefined;
readonly empty?: boolean;
readonly inWindow: boolean;
readonly logKey: string;
readonly page?: number;
readonly parentSpanId?: string;
readonly query: string;
readonly restart: boolean;
readonly seq: number;
readonly session: string;
readonly stored: boolean;
readonly traceId?: string;
readonly trigger: "watch" | "visibility" | "get" | "loadMore" | "reset" | "prefetch" | "connectivity" | "interval" | "invalidation";
readonly watcher?: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly boundary?: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly model: Json;
readonly path: string;
readonly props: Json;
readonly queries?: Json | undefined;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly adopted: boolean;
readonly at: number;
readonly boundary?: number;
readonly causedBy?: number;
readonly commands: readonly Array<{
readonly _tag: "Interrupt" | "Effect" | "Stream";
readonly args: Json;
readonly group: string | null;
readonly name: string;
}>;
readonly component: string;
readonly events: readonly Array<Json>;
readonly excluded?: boolean;
readonly instance: number;
readonly model: Json;
readonly path: string;
readonly props: Json;
readonly queries?: Json | undefined;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly boundary?: number;
readonly causedBy?: number;
readonly collected?: Json | undefined;
readonly commands: readonly Array<{
readonly _tag: "Interrupt" | "Effect" | "Stream";
readonly args: Json;
readonly group: string | null;
readonly name: string;
}>;
readonly component: string;
readonly events: readonly Array<Json>;
readonly excluded?: boolean;
readonly instance: number;
readonly lists: readonly Array<{
readonly name: string;
readonly op: "loadMore" | "reset";
}>;
readonly message: Json;
readonly model: Json;
readonly path: string;
readonly props: Json;
readonly queries?: Json | undefined;
readonly sends: readonly Array<{
readonly message: Json;
readonly owner: string;
}>;
readonly seq: number;
readonly session: string;
readonly shared?: Json | undefined;
readonly source: {
readonly _tag: tag<Tag>;
readonly name: string;
} | {
readonly _tag: tag<Tag>;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly name: string;
readonly spanId: string | null;
readonly traceId: string | null;
} | {
readonly _tag: tag<Tag>;
readonly deps: readonly Array<Json> | null;
readonly key: string;
readonly name: string;
} | {
readonly _tag: tag<Tag>;
readonly name: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly name: string;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
} | {
readonly _tag: tag<Tag>;
readonly args: Json;
readonly name: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
};
readonly viewTransition?: readonly Array<string>;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly path: string;
readonly props: Json;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly name: string;
readonly path: string;
readonly result: Json;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly path: string;
readonly seq: number;
readonly session: string;
readonly status?: "Pending" | "Rebuilding" | "Awaiting";
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly cause: {
readonly pretty: string;
readonly reasons: readonly Array<Json>;
};
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly path: string;
readonly redacted?: boolean;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly cause: {
readonly pretty: string;
readonly reasons: readonly Array<Json>;
};
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly in: string;
readonly instance: number;
readonly issued?: {
readonly index: number;
readonly seq: number;
};
readonly name: string | null;
readonly path: string;
readonly props: Json;
readonly seq: number;
readonly session: string;
readonly update?: {
readonly message: Json;
readonly source: {
readonly _tag: tag<Tag>;
readonly name: string;
} | {
readonly _tag: tag<Tag>;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly name: string;
readonly spanId: string | null;
readonly traceId: string | null;
} | {
readonly _tag: tag<Tag>;
readonly deps: readonly Array<Json> | null;
readonly key: string;
readonly name: string;
} | {
readonly _tag: tag<Tag>;
readonly name: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
readonly name: string;
readonly path: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
} | {
readonly _tag: tag<Tag>;
readonly args: Json;
readonly name: string;
readonly seq: number;
} | {
readonly _tag: tag<Tag>;
};
};
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly args: Json;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly name: string;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly name: string;
readonly path: string;
readonly reason: "closed" | "completed" | "failed";
readonly seq: number;
readonly session: string;
readonly silent: boolean;
readonly started: number;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly name: string;
readonly parentSpanId?: string;
readonly path: string;
readonly seq: number;
readonly session: string;
readonly spanId: string;
readonly traceId: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly entries: readonly Array<{
readonly logKey: string;
readonly query: string;
}>;
readonly excluded?: boolean;
readonly instance: number;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly name: string;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly name: string;
readonly outstanding?: readonly Array<{
readonly logKey: string;
readonly query: string;
}>;
readonly path: string;
readonly seq: number;
readonly session: string;
readonly silent: boolean;
readonly spanId: string | null;
readonly traceId: string | null;
readonly waitEnded?: "interrupt" | "closed" | "switch" | "settled" | "nothing" | "budget";
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly name: string;
readonly path: string;
readonly reason: "self" | "interrupt" | "switch" | "unmount" | "layer";
readonly seq: number;
readonly session: string;
readonly spanId: string | null;
readonly traceId: string | null;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly name: string;
readonly path: string;
readonly reason: "server";
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly excluded?: boolean;
readonly instance: number;
readonly issued: {
readonly index: number;
readonly seq: number;
};
readonly owner: string;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly deps: readonly Array<Json> | null;
readonly excluded?: boolean;
readonly instance: number;
readonly key: string;
readonly name: string;
readonly path: string;
readonly seq: number;
readonly session: string;
} | {
readonly _tag: tag<Tag>;
readonly at: number;
readonly causedBy?: number;
readonly component: string;
readonly deps: readonly Array<Json> | null;
readonly excluded?: boolean;
readonly instance: number;
readonly key: string;
readonly name: string;
readonly path: string;
readonly seq: number;
readonly session: string;
}>, options?: {
readonly path?: string;
}): Replay<unknown, unknown, unknown>;
}