import { Type } from "../types/type/Type"; import { WrappedType } from "../types/wrap/WrappedType"; import { TFlatType } from "../types/type/TFlatType"; import { UnwrappedType } from "../types/wrap/UnwrappedType"; export declare class ObjectUtils { static clone(source: T, options?: { excludes?: string[]; useRefTypes?: any[]; onlyOneDepth?: boolean; }): T; private static _clone; static merge(source: T, target: P, opt?: { arrayProcess?: "replace" | "concat"; useDelTargetNull?: boolean; }): T & P; static merge3, O extends Record, T extends Record>(source: S, origin: O, target: T, optionsObj?: Record): { conflict: boolean; result: O & S & T; }; static omit, K extends keyof T>(item: T, omitKeys: K[]): Omit; static omitByFilter>(item: T, omitKeyFn: (key: keyof T) => boolean): T; static pick, K extends keyof T>(item: T, keys: K[]): Pick; static pickByType, A extends TFlatType>(item: T, type: Type): { [K in keyof T]: WrappedType extends WrappedType ? T[K] : never; }; static equal(source: any, target: any, options?: { includes?: string[]; excludes?: string[]; ignoreArrayIndex?: boolean; onlyOneDepth?: boolean; }): boolean; static validate(value: T, def: TValidateDef): IValidateResult | undefined; static validateObject(obj: T, def: TValidateObjectDef): TValidateObjectResult; static validateObjectWithThrow(displayName: string, obj: T, def: TValidateObjectDefWithName): void; static validateArray(arr: T[], def: ((item: T) => TValidateObjectDef) | TValidateObjectDef): IValidateArrayResult[]; static validateArrayWithThrow(displayName: string, arr: T[], def: ((item: T) => TValidateObjectDefWithName) | TValidateObjectDefWithName): void; static getChainValueByDepth(obj: T, key: K, depth: number, optional: true): T[K] | undefined; static getChainValueByDepth(obj: T, key: K, depth: number): T[K]; private static _getChainSplits; static getChainValue(obj: any, chain: string, optional: true): any | undefined; static getChainValue(obj: any, chain: string): any; static setChainValue(obj: any, chain: string, value: any): void; static deleteChainValue(obj: any, chain: string): void; static clearUndefined(obj: T): T; static clear(obj: T): {}; static nullToUndefined(obj: T): T | undefined; static optToUndef(obj: TUndefToOptional): T; static unflattenObject(flatObj: Record): Record; } export type TValidateDef = Type> | Type>[] | IValidateDef; export interface IValidateDef { type?: Type> | Type>[]; notnull?: boolean; includes?: T[]; displayValue?: boolean; validator?: (value: UnwrappedType>) => boolean | string; } export interface IValidateResult { value: T; invalidateDef: IValidateDef & { type?: Type>[]; }; message?: string; } type TValidateObjectDef = { [K in keyof T]?: TValidateDef; }; type TValidateObjectResult = { [K in keyof T]?: IValidateResult; }; export interface IValidateDefWithName extends IValidateDef { displayName: string; } export type TValidateObjectDefWithName = { [K in keyof T]?: IValidateDefWithName; }; interface IValidateArrayResult { index: number; item: T; result: TValidateObjectResult; } export type TUndefToOptional = { [K in keyof T as undefined extends T[K] ? K : never]?: T[K]; } & { [K in keyof T as undefined extends T[K] ? never : K]: T[K]; }; export type TOptionalToUndef = { [K in keyof T]-?: {} extends Pick ? Exclude | undefined : T[K]; }; export {};