import { Classifiable, ClassifyResult, IValidation, Resolved } from "@typia/interface"; import { TypeGuardError } from "./TypeGuardError"; /** * 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; /** * Reconstructs a class instance from plain data. * * Builds a real instance of class type `T` from a plain object, driven by * typia's compile-time type information — no decorators required (unlike * `class-transformer`). Each class is constructed by exactly one strategy, in * precedence order: a static factory `T.from(x)`, then `new T(x)` (single * argument), then field copy onto the prototype. Nested classes and containers * are reconstructed recursively, and methods come from the prototype. * * Does not validate the input. For validation, use: * * - {@link assertClassify} — Throws on type mismatch * - {@link validateClassify} — Returns detailed validation errors * * @template T Target class type to reconstruct * * @param input Plain data to classify * * @returns A real instance of type `T` */ export declare function classify(input: Classifiable): ClassifyResult; /** * Reconstructs a class instance with assertion. * * Combines {@link assert} with {@link classify}: validates the plain input * against type `T`, throwing {@link TypeGuardError} on mismatch, then builds a * real instance of `T`. * * Related functions: * * - {@link classify} — No validation * - {@link validateClassify} — Returns detailed validation errors * * @template T Target class type to reconstruct * * @param input Plain data to validate and classify * @param errorFactory Custom error factory receiving * {@link TypeGuardError.IProps} * * @returns A real instance of type `T` * * @throws {TypeGuardError} When input doesn't conform to type `T` */ export declare function assertClassify(input: Classifiable, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): ClassifyResult; /** * Reconstructs a class instance with validation. * * Combines {@link validate} with {@link classify}: validates the plain input * against type `T`, returning {@link IValidation.IFailure} with all errors on * mismatch, or {@link IValidation.ISuccess} holding a real instance of `T`. * * Related functions: * * - {@link classify} — No validation * - {@link assertClassify} — Throws on first error * * @template T Target class type to reconstruct * * @param input Plain data to validate and classify * * @returns Validation result containing the instance or errors */ export declare function validateClassify(input: Classifiable): 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, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)) => 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, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)) => 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; /** * Creates reusable {@link classify} function. * * @danger You must configure the generic argument `T` */ export declare function createClassify(): never; /** * Creates reusable {@link classify} function. * * @template T Target class type to reconstruct * * @returns Reusable classify function */ export declare function createClassify(): (input: Classifiable) => ClassifyResult; /** * Creates reusable {@link assertClassify} function. * * @danger You must configure the generic argument `T` */ export declare function createAssertClassify(errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): never; /** * Creates reusable {@link assertClassify} function. * * @template T Target class type to reconstruct * * @param errorFactory Custom error factory receiving * {@link TypeGuardError.IProps} * * @returns Reusable classify function */ export declare function createAssertClassify(errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): (input: unknown, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)) => ClassifyResult; /** * Creates reusable {@link validateClassify} function. * * @danger You must configure the generic argument `T` */ export declare function createValidateClassify(): never; /** * Creates reusable {@link validateClassify} function. * * @template T Target class type to reconstruct * * @returns Reusable classify function */ export declare function createValidateClassify(): (input: unknown) => IValidation>;