import type { Default, OnMissing } from "./default"; import type { From, FromFn, InputOf, OutputOf } from "./from"; import type { Descriptive, Displayed } from "./helpdoc"; export { identity, type OutputOf, type InputOf } from "./from"; export type Type = From & Partial & OnMissing>; /** * Get the type definitions or an empty object from a type or a decoding function */ export declare function typeDef | FromFn>(from: T): T extends FromFn ? {} : Omit; /** * Get the decoding function from a type or a function */ export declare function fromFn(t: FromFn | From): FromFn; /** * Extend a type: take a type and use it as a base for another type. Much like using the spread operator: * ``` * const newType = { ...oldType } * ``` * but composes the `from` arguments * * @param base A base type from `InputA` to `OutputA` * @param nextTypeOrDecodingFunction Either an entire `Type` or just a decoding function from `OutputA` to any type */ export declare function extendType, NextType extends Type, any> | FromFn, any>>(base: BaseType, nextTypeOrDecodingFunction: NextType): Omit & (NextType extends FromFn ? unknown : Omit) & From, OutputOf>; /** Contains a type definition inside */ export type HasType> = { /** The value decoding strategy for this item */ type: T; };