import { Atomic, IValidation, Resolved } from "@typia/interface"; import { TypeGuardError } from "./TypeGuardError"; /** * 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[]; /** * Deep clones value of type `T`. * * Creates a deep copy of the input value. Class instances with methods are * cloned as plain objects (methods are not copied). * * Does not validate the input. For validation, use: * * - {@link assertClone} — Throws on type mismatch * - {@link isClone} — Returns `null` on type mismatch * - {@link validateClone} — Returns detailed validation errors * * @template T Type of input value * @param input Value to clone * @returns Deep cloned value */ export declare function clone(input: T): Resolved; /** * Deep clones value with assertion. * * Creates a deep copy with {@link assert} validation. Throws * {@link TypeGuardError} on type mismatch. Class instances with methods are * cloned as plain objects. * * Related functions: * * - {@link clone} — No validation * - {@link isClone} — Returns `null` instead of throwing * - {@link validateClone} — Returns detailed validation errors * * @template T Type of input value * @param input Value to clone * @param errorFactory Custom error factory receiving * {@link TypeGuardError.IProps} * @returns Deep cloned value * @throws {TypeGuardError} When input doesn't conform to type `T` */ export declare function assertClone(input: T, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): Resolved; /** * Deep clones value with type checking. * * Creates a deep copy with {@link is} validation. Returns `null` on type * mismatch. Class instances with methods are cloned as plain objects. * * Related functions: * * - {@link clone} — No validation * - {@link assertClone} — Throws instead of returning `null` * - {@link validateClone} — Returns detailed validation errors * * @template T Type of input value * @param input Value to clone * @returns Deep cloned value, or `null` if invalid */ export declare function isClone(input: T): Resolved | null; /** * Deep clones value with validation. * * Creates a deep copy with {@link validate} validation. Returns * {@link IValidation.IFailure} with all errors on mismatch, or * {@link IValidation.ISuccess} with cloned value. Class instances with methods * are cloned as plain objects. * * Related functions: * * - {@link clone} — No validation * - {@link assertClone} — Throws on first error * - {@link isClone} — Returns `null` instead of error details * * @template T Type of input value * @param input Value to clone * @returns Validation result containing cloned value or errors */ export declare function validateClone(input: T): IValidation>; /** * Removes superfluous properties from object. * * Deletes all properties not defined in type `T`, including in nested objects. * Mutates the input directly—removed properties cannot be recovered. * * Does not validate the input. For validation, use: * * - {@link assertPrune} — Throws on type mismatch * - {@link isPrune} — Returns `false` on type mismatch * - {@link validatePrune} — Returns detailed validation errors * * @template T Type of input value * @param input Object to prune */ export declare function prune(input: T): void; /** * Removes superfluous properties with assertion. * * Combines {@link assert} with {@link prune}. Throws {@link TypeGuardError} on * type mismatch. Mutates the input directly—removed properties cannot be * recovered. * * Related functions: * * - {@link prune} — No validation * - {@link isPrune} — Returns `false` instead of throwing * - {@link validatePrune} — Returns detailed validation errors * * @template T Type of input value * @param input Object to assert and prune * @param errorFactory Custom error factory receiving * {@link TypeGuardError.IProps} * @returns The pruned input * @throws {TypeGuardError} When input doesn't conform to type `T` */ export declare function assertPrune(input: T, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): T; /** * Removes superfluous properties with type checking. * * Combines {@link is} with {@link prune}. Returns `false` on type mismatch (no * pruning occurs). Returns `true` after successful pruning. Mutates the input * directly. * * Related functions: * * - {@link prune} — No validation * - {@link assertPrune} — Throws instead of returning `false` * - {@link validatePrune} — Returns detailed validation errors * * @template T Type of input value * @param input Object to check and prune * @returns `true` if valid and pruned, `false` if type mismatch */ export declare function isPrune(input: T): input is T; /** * Removes superfluous properties with validation. * * Combines {@link validate} with {@link prune}. Returns * {@link IValidation.IFailure} with all errors on mismatch (no pruning occurs), * or {@link IValidation.ISuccess} after successful pruning. Mutates the input * directly. * * Related functions: * * - {@link prune} — No validation * - {@link assertPrune} — Throws on first error * - {@link isPrune} — Returns `false` instead of error details * * @template T Type of input value * @param input Object to validate and prune * @returns Validation result */ export declare function validatePrune(input: T): IValidation; /** * Creates reusable {@link clone} function. * * @danger You must configure the generic argument `T` */ export declare function createClone(): never; /** * Creates reusable {@link clone} function. * * @template T Type of input value * @returns Reusable clone function */ export declare function createClone(): (input: T) => Resolved; /** * Creates reusable {@link assertClone} function. * * @danger You must configure the generic argument `T` */ export declare function createAssertClone(errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): never; /** * Creates reusable {@link assertClone} function. * * @template T Type of input value * @param errorFactory Custom error factory receiving * {@link TypeGuardError.IProps} * @returns Reusable clone function */ export declare function createAssertClone(errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): (input: unknown) => Resolved; /** * Creates reusable {@link isClone} function. * * @danger You must configure the generic argument `T` */ export declare function createIsClone(): never; /** * Creates reusable {@link isClone} function. * * @template T Type of input value * @returns Reusable clone function */ export declare function createIsClone(): (input: unknown) => Resolved | null; /** * Creates reusable {@link validateClone} function. * * @danger You must configure the generic argument `T` */ export declare function createValidateClone(): never; /** * Creates reusable {@link validateClone} function. * * @template T Type of input value * @returns Reusable clone function */ export declare function createValidateClone(): (input: unknown) => IValidation>; /** * Creates reusable {@link prune} function. * * @danger You must configure the generic argument `T` */ export declare function createPrune(): never; /** * Creates reusable {@link prune} function. * * @template T Type of input value * @returns Reusable prune function */ export declare function createPrune(): (input: T) => void; /** * Creates reusable {@link assertPrune} function. * * @danger You must configure the generic argument `T` */ export declare function createAssertPrune(errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): never; /** * Creates reusable {@link assertPrune} function. * * @template T Type of input value * @param errorFactory Custom error factory receiving * {@link TypeGuardError.IProps} * @returns Reusable prune function */ export declare function createAssertPrune(errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): (input: unknown) => T; /** * Creates reusable {@link isPrune} function. * * @danger You must configure the generic argument `T` */ export declare function createIsPrune(): never; /** * Creates reusable {@link isPrune} function. * * @template T Type of input value * @returns Reusable prune function */ export declare function createIsPrune(): (input: unknown) => input is T; /** * Creates reusable {@link validatePrune} function. * * @danger You must configure the generic argument `T` */ export declare function createValidatePrune(): never; /** * Creates reusable {@link validatePrune} function. * * @template T Type of input value * @returns Reusable prune function */ export declare function createValidatePrune(): (input: unknown) => IValidation;