Millwork
    Preparing search index...

    Interface CodecSpec<Raw, Value, Options>

    What defineCodec needs. parse may throw on bad input; the codec catches it.

    interface CodecSpec<Raw, Value, Options> {
        name: string;
        equals?(a: Value, b: Value): boolean;
        format(value: Value, options: Options): Raw;
        isValue(input: unknown): input is Value;
        key?(value: Value): unknown;
        parse(raw: Raw, options: Options): Value;
    }

    Type Parameters

    • Raw
    • Value
    • Options
    Index
    name: string