@pond-ts/process API Reference
    Preparing search index...

    Interface PortSpec<T>

    Declares one port's value type.

    valueType is a phantom marker: never set at runtime, present only so T is inferable from a spec (PortSpec<infer T>). Together with the equals parameter position it also makes PortSpec invariant in T, so a PortSpec<string> is not silently accepted where a PortSpec<number> is required.

    interface PortSpec<T> {
        defaultValue?: T;
        equals?: (a: T, b: T) => boolean;
        valueType?: T;
    }

    Type Parameters

    • T
    Index

    Properties

    defaultValue?: T

    Value used when the inlet is left unconnected. Without it, pulling through an unconnected inlet throws UnconnectedInputError.

    Outputs ignore this field.

    equals?: (a: T, b: T) => boolean

    Decides whether a newly computed value differs from the cached one. Returning true suppresses the version bump, so every downstream node skips recomputation even though it was marked dirty.

    It also keeps the previously cached value — the newly computed one is discarded. That is what makes the cutoff work (downstream Object.is checks still see the same reference), but it means a loose equals loses data: an equals comparing only an id field will keep serving the old object after the rest of it changed. Compare everything a consumer can observe.

    Defaults to Object.is. For immutable pond values (TimeSeries, Event) identity is the right test — a transform that genuinely changed something returns a new instance. Supply a structural comparison when a node produces scalars or small records, where "same number as last time" is common and downstream work is not free.

    valueType?: T

    Phantom type marker. Never present at runtime.