Class Range

    Hierarchy
    Index

    Accessors

    Constructors

    Methods

    • Read-only same-type view: the RO dual of the endo .lens. For a cross-type view use the typed static Target.derive(src, fn).

      Parameters

      • this: Cell<V>
      • fn: (v: V) => V

      Returns this

    • Endomorphic lens. A 2-arg bwd(view, current) consults the current source; a 1-arg bwd(view) reconstructs it from the view alone.

      Parameters

      • this: Cell<V>
      • fwd: (v: V) => V
      • bwd: (target: V, current: V) => V

      Returns this

    • Backward fan-in: forwards its parent's value unchanged; on write, folds N contributors into one value. fold defaults to last-writer-wins.

      Parameters

      • this: Cell<V>
      • Optionalfold: MergeFold<V>

      Returns Cell<V>

    • Coerce Val<Inner<Cls>>Cls: instance → identity, RO cell → tracked derive, literal → fresh seed.

      Type Parameters

      • C extends AnyCellCtor

      Parameters

      Returns InstanceType<C>

    • Read-only typed view. Cls.derive(parent, fn) (1-input), Cls.derive(parents, fn) (N-input), or Cls.derive(fn) (closure). Polymorphic-this: Vec.derive(...)Vec.

      Type Parameters

      • C extends AnyCellCtor
      • P

      Parameters

      Returns InstanceType<C>

    • Read-only typed view. Cls.derive(parent, fn) (1-input), Cls.derive(parents, fn) (N-input), or Cls.derive(fn) (closure). Polymorphic-this: Vec.derive(...)Vec.

      Type Parameters

      • C extends AnyCellCtor
      • P extends readonly Read<unknown>[]

      Parameters

      • this: C
      • parents: P
      • fn: (vals: ReadValues<P>) => Inner<InstanceType<C>>

      Returns InstanceType<C>

    • Read-only typed view. Cls.derive(parent, fn) (1-input), Cls.derive(parents, fn) (N-input), or Cls.derive(fn) (closure). Polymorphic-this: Vec.derive(...)Vec.

      Type Parameters

      • C extends AnyCellCtor

      Parameters

      • this: C
      • fn: () => Inner<InstanceType<C>>

      Returns InstanceType<C>

    • Type predicate against this class: Vec.is(x) narrows x to Vec. Inherited static; works for any subclass via polymorphic this.

      Type Parameters

      • C extends AnyCellCtor

      Parameters

      • this: C
      • v: unknown

      Returns v is InstanceType<C>

    • Writable lens. Cls.lens(parent, fwd, bwd) for one input, Cls.lens(parents, fwd, bwd) for N; a 2-arg bwd reads the source, a 1-arg bwd reconstructs it. Cls.lens(parent(s), spec) builds a complement-carrying lens from { init, step, fwd, bwd }.

      Type Parameters

      • C extends AnyCellCtor
      • P

      Parameters

      • this: C
      • parent: Read<P>
      • fwd: (v: P) => Inner<InstanceType<C>>
      • bwd: (target: Inner<InstanceType<C>>, v: P) => P

      Returns Writable<InstanceType<C>>

    • Writable lens. Cls.lens(parent, fwd, bwd) for one input, Cls.lens(parents, fwd, bwd) for N; a 2-arg bwd reads the source, a 1-arg bwd reconstructs it. Cls.lens(parent(s), spec) builds a complement-carrying lens from { init, step, fwd, bwd }.

      Type Parameters

      • C extends AnyCellCtor
      • P extends readonly Read<unknown>[]

      Parameters

      • this: C
      • parents: P
      • fwd: (vals: ReadValues<P>) => Inner<InstanceType<C>>
      • bwd: (
            target: Inner<InstanceType<C>>,
            vals: ReadValues<P>,
        ) => BackUpdates<ReadValuesOrSkip<P>>

      Returns Writable<InstanceType<C>>

    • Writable lens. Cls.lens(parent, fwd, bwd) for one input, Cls.lens(parents, fwd, bwd) for N; a 2-arg bwd reads the source, a 1-arg bwd reconstructs it. Cls.lens(parent(s), spec) builds a complement-carrying lens from { init, step, fwd, bwd }.

      Type Parameters

      • C extends AnyCellCtor
      • P
      • Cm

      Parameters

      Returns Writable<InstanceType<C>>

    • Writable lens. Cls.lens(parent, fwd, bwd) for one input, Cls.lens(parents, fwd, bwd) for N; a 2-arg bwd reads the source, a 1-arg bwd reconstructs it. Cls.lens(parent(s), spec) builds a complement-carrying lens from { init, step, fwd, bwd }.

      Type Parameters

      • C extends AnyCellCtor
      • P extends readonly Read<unknown>[]
      • Cm

      Parameters

      Returns Writable<InstanceType<C>>

    • Writable-shaped constant: always reads v, absorbs writes (parentless sink lens), for APIs demanding bidirectionality.

      Type Parameters

      • C extends AnyCellCtor

      Parameters

      Returns Writable<InstanceType<C>>

    Properties

    _t: {
        equals: (a: V, b: V) => boolean;
        lerp: (a: V, b: V, t: number) => V;
        linear: Linear<V>;
        metric: (a: V, b: V) => number;
        pack: Pack<V>;
    }

    Type Declaration

    • equals: (a: V, b: V) => boolean
    • lerp: (a: V, b: V, t: number) => V
    • linear: Linear<V>
    • metric: (a: V, b: V) => number

      Euclidean distance over (lo, hi).

    • pack: Pack<V>
    name: string | undefined

    Optional debug label (cell(0, { name })); used by errors and graph dumps.

    value: V
    traits: {
        equals: (a: V, b: V) => boolean;
        lerp: (a: V, b: V, t: number) => V;
        linear: Linear<V>;
        metric: (a: V, b: V) => number;
        pack: Pack<V>;
    } = ...

    Type Declaration

    • equals: (a: V, b: V) => boolean
    • lerp: (a: V, b: V, t: number) => V
    • linear: Linear<V>
    • metric: (a: V, b: V) => number

      Euclidean distance over (lo, hi).

    • pack: Pack<V>