From 7d8a1ca4926e03de1b34a9b22d13d209227267c1 Mon Sep 17 00:00:00 2001 From: GrayStrider <43771776+GrayStrider@users.noreply.github.com> Date: Sun, 17 May 2020 03:02:04 +1100 Subject: [PATCH] fix: update Entity decorator return type to ClassDecorator (#5776) I've been making a class decorator composer function, and Function type is not specific enough. I'll augment it locally for the time being. I suppose some other types would have to be updated as well, hopefully there's a CI in place --- src/decorator/entity/Entity.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/decorator/entity/Entity.ts b/src/decorator/entity/Entity.ts index bb2af675d0..f90e446470 100644 --- a/src/decorator/entity/Entity.ts +++ b/src/decorator/entity/Entity.ts @@ -5,23 +5,23 @@ import {TableMetadataArgs} from "../../metadata-args/TableMetadataArgs"; * This decorator is used to mark classes that will be an entity (table or document depend on database type). * Database schema will be created for all classes decorated with it, and Repository can be retrieved and used for it. */ -export function Entity(options?: EntityOptions): Function; +export function Entity(options?: EntityOptions): ClassDecorator; /** * This decorator is used to mark classes that will be an entity (table or document depend on database type). * Database schema will be created for all classes decorated with it, and Repository can be retrieved and used for it. */ -export function Entity(name?: string, options?: EntityOptions): Function; +export function Entity(name?: string, options?: EntityOptions): ClassDecorator; /** * This decorator is used to mark classes that will be an entity (table or document depend on database type). * Database schema will be created for all classes decorated with it, and Repository can be retrieved and used for it. */ -export function Entity(nameOrOptions?: string|EntityOptions, maybeOptions?: EntityOptions): Function { +export function Entity(nameOrOptions?: string|EntityOptions, maybeOptions?: EntityOptions): ClassDecorator { const options = (typeof nameOrOptions === "object" ? nameOrOptions as EntityOptions : maybeOptions) || {}; const name = typeof nameOrOptions === "string" ? nameOrOptions : options.name; - return function (target: Function) { + return function (target) { getMetadataArgsStorage().tables.push({ target: target, name: name,