UNPKG

typia

Version:

Superfast runtime validators with only one line

1 lines 2.9 kB
{"version":3,"file":"reflect.mjs","names":[],"sources":["../src/reflect.ts"],"sourcesContent":["import {\n Atomic,\n IMetadataSchemaCollection,\n IMetadataSchemaUnit,\n} from \"@typia/interface\";\n\nimport { NoTransformConfigurationError } from \"./transformers/NoTransformConfigurationError\";\n\n/**\n * Generates metadata schemas for multiple types.\n *\n * @danger You must configure the generic argument `Types`\n */\nexport function schemas(): never;\n\n/**\n * Generates metadata schemas for multiple types.\n *\n * Creates {@link IMetadataSchemaCollection} containing metadata for all types in\n * the tuple. Collection types (Array, Tuple, Object) are stored in\n * `components`. Alias types are stored in `aliases`.\n *\n * @template Types Tuple of target types\n * @returns Metadata schema collection\n */\nexport function schemas<Types extends unknown[]>(): IMetadataSchemaCollection;\n\n/** @internal */\nexport function schemas(): never {\n NoTransformConfigurationError(\"reflect.schemas\");\n}\n\n/**\n * Generates metadata schema for a single type.\n *\n * @danger You must configure the generic argument `Type`\n */\nexport function schema(): never;\n\n/**\n * Generates metadata schema for a single type.\n *\n * Creates {@link IMetadataSchemaUnit} containing metadata for the type.\n *\n * @template Type Target type\n * @returns Metadata schema unit\n */\nexport function schema<Type>(): IMetadataSchemaUnit;\n\n/** @internal */\nexport function schema(): never {\n NoTransformConfigurationError(\"reflect.schema\");\n}\n\n/**\n * Gets the runtime type name of type `T`.\n *\n * @danger You must configure the generic argument `T`\n */\nexport function name(): never;\n\n/**\n * Gets the runtime type name of type `T`.\n *\n * Returns a string representation of the type name.\n *\n * @template T Target type\n * @template Regular If `true`, returns regular (normalized) name\n * @returns Type name string\n */\nexport function name<T, Regular extends boolean = false>(): string;\n\n/** @internal */\nexport function name(): never {\n NoTransformConfigurationError(\"reflect.name\");\n}\n\n/**\n * Converts union literal type to array.\n *\n * @danger You must configure the generic argument `T`\n */\nexport function literals(): never;\n\n/**\n * Converts union literal type to array.\n *\n * Extracts all members of a union literal type `T` into an array at runtime.\n *\n * @template T Union literal type (e.g., `\"A\" | \"B\" | 1`)\n * @returns Array containing all union members\n */\nexport function literals<T extends Atomic.Type | null>(): T[];\n\n/** @internal */\nexport function literals(): never {\n NoTransformConfigurationError(\"reflect.literals\");\n}\n"],"mappings":";;;;;;;;;;AA4BA,SAAgB,UAAiB;CAC/B,8BAA8B,iBAAiB;AACjD;;AAoBA,SAAgB,SAAgB;CAC9B,8BAA8B,gBAAgB;AAChD;;AAqBA,SAAgB,OAAc;CAC5B,8BAA8B,cAAc;AAC9C;;AAoBA,SAAgB,WAAkB;CAChC,8BAA8B,kBAAkB;AAClD"}