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,