FuncType - v1.4.1
    Preparing search index...

    Variable Decoder

    Decoder: { _tag: "Decoder" } & {
        array: <A>(inner: Decoder<A>) => Decoder<A[]>;
        boolean: Decoder<boolean>;
        either: {
            discriminated: <L, R>(
                config: { leftTag: string; rightTag: string; tag: string },
                left: Decoder<L>,
                right: Decoder<R>,
            ) => Decoder<Either<L, R>>;
            envelope: <L, R>(
                shape: { err: Decoder<L>; ok: Decoder<R> },
            ) => Decoder<Either<L, R>>;
        };
        list: <A>(inner: Decoder<A>) => Decoder<List<A>>;
        map: <V>(inner: Decoder<V>) => Decoder<Map<string, V>>;
        nullable: <A>(inner: Decoder<A>) => Decoder<A | null>;
        number: Decoder<number>;
        object: <T extends Record<string, unknown>>(
            shape: { [K in string | number | symbol]: Decoder<T[K]> },
        ) => Decoder<T>;
        option: <A>(inner: Decoder<A>) => Decoder<Option<A>>;
        string: Decoder<string>;
        tagged: {
            either: <L, R>(
                left: Decoder<L>,
                right: Decoder<R>,
            ) => Decoder<Either<L, R>>;
            list: <A>(inner: Decoder<A>) => Decoder<List<A>>;
            map: <V>(inner: Decoder<V>) => Decoder<Map<string, V>>;
            obj: <T extends Record<string, unknown>>(
                shape: { [K in string | number | symbol]: Decoder<T[K]> },
            ) => Decoder<T>;
            option: <A>(inner: Decoder<A>) => Decoder<Option<A>>;
            try: <A>(inner: Decoder<A>) => Decoder<Try<A>>;
        };
        unknown: Decoder<unknown>;
    }

    Decoder namespace: combinators for converting unknown into typed values.

    • Decoder.string / .number / .boolean / .unknown / .nullable(inner) — leaf primitives
    • Decoder.option(inner) — null-bias Option (null → None, else inner → Some)
    • Decoder.either.envelope({ok, err}) / .discriminated({...}, l, r) — Either variants
    • Decoder.list(inner) / .array(inner) / .map(inner) / .object(shape) — composites; accumulate child failures
    • Decoder.tagged.option/either/try/list/map/obj(inner?) — round-trip the {_tag, value} shape used by functype's built-in .toJSON() (for functype-to-functype services)