@neutrium/formatter - v1.0.1
    Preparing search index...

    Interface FormatContract<Spec, Value, Rounded, Range>

    Type-level description of one presentation handled by a codec.

    Contracts are needed only when a codec accepts multiple specification shapes with different value types or capabilities. The first contract whose spec matches the supplied specification is selected.

    interface FormatContract<
        Spec extends FormatSpecBase = FormatSpecBase,
        Value = unknown,
        Rounded = unknown,
        Range extends boolean = boolean,
    > {
        range: Range;
        rounded: Rounded;
        spec: Spec;
        value: Value;
    }

    Type Parameters

    • Spec extends FormatSpecBase = FormatSpecBase

      Specification shape that selects this presentation.

    • Value = unknown

      Value accepted by formatting operations.

    • Rounded = unknown

      Value reported as rounded metadata.

    • Range extends boolean = boolean

      Whether range formatting is always, never, or conditionally available.

    Index
    range: Range

    true, false, or boolean for runtime-dependent range support.

    rounded: Rounded

    Rounded metadata returned by detailed formatting.

    spec: Spec

    Specification shape selecting this contract.

    value: Value

    Input value accepted by formatting operations.