/** * @since 0.3.2 */ import * as t from 'io-ts' /** * Changes the output type of the given runtime type * * @example * import * as t from 'io-ts' * import { mapOutput } from 'io-ts-types/lib/mapOutput' * import { optionFromNullable } from 'io-ts-types/lib/optionFromNullable' * import { none, some } from 'fp-ts/lib/Option' * * // Input: t.Type, number | null, t.mixed> * const Input = optionFromNullable(t.number) * * const toUndefined = (x: A | null): A | undefined => (x === null ? undefined : x) * * // Output: t.Type, number | undefined, t.mixed> * const Output = mapOutput(Input, toUndefined) * * assert.strictEqual(Output.encode(none), undefined) * assert.strictEqual(Output.encode(some(1)), 1) * * @since 0.3.2 */ export declare function mapOutput(codec: t.Type, f: (p: O) => P, name?: string): t.Type