openmixer — generated API reference
    Preparing search index...

    Interface OperationConfig<A, P, R>

    interface OperationConfig<
        A,
        P extends object = NoOperationColumn,
        R extends object = NoOperationColumn,
    > {
        address: AddressCodec<A>;
        cancel?: (addr: A) => void;
        confirm?: ConfirmGate;
        instances?: () => Iterable<A>;
        inverseSteps?: (
            addr: A,
            delta: WireDelta,
        ) => ResourceInverseSteps | undefined;
        lifecycle?: LifecycleDoors<A>;
        now?: () => number;
        params?: OperationParamCodecs<P>;
        path: string;
        policy?: ResourcePolicy;
        report?: (id: ResourceId) => void;
        start: (
            addr: A,
            run: OperationRun<R>,
            params: OperationParams<P>,
        ) => Refusal | undefined;
    }

    Type Parameters

    Index
    address: AddressCodec<A>
    cancel?: (addr: A) => void

    Stop the current run, best effort. The mold drops the run's landings either way.

    confirm?: ConfirmGate

    The confirm gate this fire must pass — see ConsoleResource.confirm. Declared on the row and executed by the registry; the mold only carries it. Its transition is the run's own running → true.

    instances?: () => Iterable<A>

    Which instances this operation HAS, when it has more than the one its address always names.

    A singleton-addressed operation needs none: the mold's own read answers, and the registry's fallback enumerates it. An operation addressed at a KEY (/clipboard/{slot}/paste) has as many instances as there are keys, and a row that cannot enumerate is absent from the opening burst — a client that never received it has no idea the door is there.

    inverseSteps?: (addr: A, delta: WireDelta) => ResourceInverseSteps | undefined

    The patches that put the console back after this operation fired — see ConsoleResource.inverseSteps. An operation is the mold most likely to need one: its own state narrates a run, and what the run CHANGED is somewhere else entirely.

    lifecycle?: LifecycleDoors<A>

    The item-lifecycle doors. An operation addressed at a STORED item (/scenes/{id} — recall) is also the place that item is addressable at all, so DELETE there is "delete the scene", not "cancel the recall" (that is PATCH { running: false }, and it stays that).

    now?: () => number

    The clock behind startedAt. Defaults to Date.now.

    The arguments this operation takes, one core codec each. Every declared parameter is REQUIRED on the fire and accepted ONLY alongside running: true — a stored argument that takes effect at some later fire is an ambiguous success, and a defaulted one is a run nobody asked for.

    path: string

    What a committed write here means for the session's dirtiness and the operator's history. Absent means the layer default: it dirties the session, is not undoable, and is not a barrier (see ResourcePolicy).

    report?: (id: ResourceId) => void

    Called when a run changed this instance OUTSIDE a patch — progress, the landing. The server wires this to registry.reproject, which is how completion becomes the next frame of the same instance.

    start: (
        addr: A,
        run: OperationRun<R>,
        params: OperationParams<P>,
    ) => Refusal | undefined

    Fire the work: dispatch and RETURN — the patch never awaits. A returned refusal means the run never started. A fast operation may land synchronously; its landed state rides the patch's own broadcast.