diff --git a/src/index.ts b/src/index.ts index 3bef5422b..1a42973ee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -65,20 +65,20 @@ export function classToPlainFromExist( * * @deprecated Function name changed, use the `plainToInstance` method instead. */ -export function plainToClass(cls: ClassConstructor, plain: V[], options?: ClassTransformOptions): T[]; -export function plainToClass(cls: ClassConstructor, plain: V, options?: ClassTransformOptions): T; -export function plainToClass(cls: ClassConstructor, plain: V | V[], options?: ClassTransformOptions): T | T[] { +export function plainToClass(cls: ClassConstructor, plain: T[], options?: ClassTransformOptions): T[]; +export function plainToClass(cls: ClassConstructor, plain: T, options?: ClassTransformOptions): T; +export function plainToClass(cls: ClassConstructor, plain: T | T[], options?: ClassTransformOptions): T | T[] { return classTransformer.plainToInstance(cls, plain as any, options); } /** * Converts plain (literal) object to class (constructor) object. Also works with arrays. */ -export function plainToInstance(cls: ClassConstructor, plain: V[], options?: ClassTransformOptions): T[]; -export function plainToInstance(cls: ClassConstructor, plain: V, options?: ClassTransformOptions): T; -export function plainToInstance( +export function plainToInstance(cls: ClassConstructor, plain: T[], options?: ClassTransformOptions): T[]; +export function plainToInstance(cls: ClassConstructor, plain: T, options?: ClassTransformOptions): T; +export function plainToInstance( cls: ClassConstructor, - plain: V | V[], + plain: T | T[], options?: ClassTransformOptions ): T | T[] { return classTransformer.plainToInstance(cls, plain as any, options);