openmixer — generated API reference
    Preparing search index...

    Type Alias FieldSpec<S, K, A>

    FieldSpec:
        | {
            codec: FieldCodec<S[K]>;
            kind: "stored";
            clamp?(v: S[K], addr: A, current: S): S[K];
            limit?(addr: A): ControlLimit | undefined;
            refuse?(v: S[K], addr: A, current: S): Refusal | undefined;
            taper?(addr: A): Taper | undefined;
            values?(addr: A): readonly string[] | undefined;
            writable?(addr: A): Refusal | undefined;
        }
        | { kind: "derived"; derive(addr: A): S[K] }
        | {
            codec: FieldCodec<S[K]>;
            kind: "virtual";
            of: keyof S & string;
            derive(addr: A): S[K];
            limit?(addr: A): ControlLimit | undefined;
            writable?(addr: A): Refusal | undefined;
        }

    One cell of a field table. The kind discriminant makes a field that is both stored and derived a compile error; the mapped FieldSpecs makes a state field without a spec a compile error.

    Type Parameters

    • S extends object
    • K extends keyof S & string
    • A

    Type Declaration

    • {
          codec: FieldCodec<S[K]>;
          kind: "stored";
          clamp?(v: S[K], addr: A, current: S): S[K];
          limit?(addr: A): ControlLimit | undefined;
          refuse?(v: S[K], addr: A, current: S): Refusal | undefined;
          taper?(addr: A): Taper | undefined;
          values?(addr: A): readonly string[] | undefined;
          writable?(addr: A): Refusal | undefined;
      }
      • Readonlycodec: FieldCodec<S[K]>
      • Readonlykind: "stored"
      • clamp?: function
        • Parameters

          • v: S[K]
          • addr: A
          • current: S

          Returns S[K]

      • limit?: function
        • This instance's travel, when it is a property of the DEVICE rather than of the codec — a head amp's gain range, a fader's dB span under the taper it was given. Wins over FieldCodec.limit; absent means the codec's answer stands.

          Parameters

          • addr: A

          Returns ControlLimit | undefined

      • refuse?: function
        • Refuse THIS VALUE, given what the row currently holds — the third kind of "no", and the only one that can see both.

          The codec refuses by TRAVEL, which is a property of the field and cannot know the state. writable refuses by INSTANCE, which is a property of the desk and cannot know the value. Neither can express a bound that MOVES with the state: a console allocation may grow and may not shrink, a roster may be reordered and not resized. The alternative was clamp, and a clamp is silent — the operator asks for eight and gets twelve with no refusal anywhere, which is the shape finiteNumber was caught in (a doc claiming it refused while it quietly clamped).

          Runs after the codec and before the clamp, so a value that is off the travel is refused as such rather than argued about. Absent ⇒ any decoded value is acceptable.

          Parameters

          • v: S[K]
          • addr: A
          • current: S

          Returns Refusal | undefined

      • taper?: function
        • This instance's position↔value curve, for a field whose two are not the same number.

          Parameters

          • addr: A

          Returns Taper | undefined

      • values?: function
        • This instance's enum membership, when it is narrower than FieldCodec.values — an appliance that offers lcr on one bus and not another, the same per-instance cardinality limit carries for a number. Wins over the codec's own values; absent means the codec's full vocabulary stands. NEVER widens: a value this returns that FieldCodec.values does not already list is a codec that cannot decode what OPTIONS just offered, which is the over-declaration the whole travel system exists to refuse — narrow the codec too if a new member is genuinely needed.

          Parameters

          • addr: A

          Returns readonly string[] | undefined

      • writable?: function
        • Absent ⇒ writable. A refusal here is per-instance ("this desk cannot").

          Parameters

          • addr: A

          Returns Refusal | undefined

    • { kind: "derived"; derive(addr: A): S[K] }
    • {
          codec: FieldCodec<S[K]>;
          kind: "virtual";
          of: keyof S & string;
          derive(addr: A): S[K];
          limit?(addr: A): ControlLimit | undefined;
          writable?(addr: A): Refusal | undefined;
      }
      • Readonlycodec: FieldCodec<S[K]>
      • Readonlykind: "virtual"

        DERIVED on read, WRITABLE on write — a field that is another unit of a stored one.

        A fader's dB is the worked case. The VALUE is the dB; the position is its realisation through the channel's taper, so dB is what an operator means and what a client should send. But dB cannot be STORED beside the position: two stores for one fact drift, and a stored dB that disagrees with its position is a lie a reader cannot detect. So the read always re-derives, and the write is folded back into the stored half by the row's couple — which is why declaring one without a couple is a row that accepts a value and silently discards it.

      • Readonlyof: keyof S & string

        The STORED field this one re-expresses — db is position through the taper.

      • derive: function
        • Parameters

          • addr: A

          Returns S[K]

      • limit?: function
        • Per-instance travel — a fader's dB span is its taper's, so it is not the codec's.

          Parameters

          • addr: A

          Returns ControlLimit | undefined

      • writable?: function
        • Absent ⇒ writable. A refusal here is per-instance.

          Parameters

          • addr: A

          Returns Refusal | undefined