UNPKG

typia

Version:

Superfast runtime validators with only one line

65 lines (64 loc) 2.02 kB
import { Atomic, IMetadataSchemaCollection, IMetadataSchemaUnit } from "@typia/interface"; /** * Generates metadata schemas for multiple types. * * @danger You must configure the generic argument `Types` */ export declare function schemas(): never; /** * Generates metadata schemas for multiple types. * * Creates {@link IMetadataSchemaCollection} containing metadata for all types in * the tuple. Collection types (Array, Tuple, Object) are stored in * `components`. Alias types are stored in `aliases`. * * @template Types Tuple of target types * @returns Metadata schema collection */ export declare function schemas<Types extends unknown[]>(): IMetadataSchemaCollection; /** * Generates metadata schema for a single type. * * @danger You must configure the generic argument `Type` */ export declare function schema(): never; /** * Generates metadata schema for a single type. * * Creates {@link IMetadataSchemaUnit} containing metadata for the type. * * @template Type Target type * @returns Metadata schema unit */ export declare function schema<Type>(): IMetadataSchemaUnit; /** * Gets the runtime type name of type `T`. * * @danger You must configure the generic argument `T` */ export declare function name(): never; /** * Gets the runtime type name of type `T`. * * Returns a string representation of the type name. * * @template T Target type * @template Regular If `true`, returns regular (normalized) name * @returns Type name string */ export declare function name<T, Regular extends boolean = false>(): string; /** * Converts union literal type to array. * * @danger You must configure the generic argument `T` */ export declare function literals(): never; /** * Converts union literal type to array. * * Extracts all members of a union literal type `T` into an array at runtime. * * @template T Union literal type (e.g., `"A" | "B" | 1`) * @returns Array containing all union members */ export declare function literals<T extends Atomic.Type | null>(): T[];