fix: update Entity decorator return type to ClassDecorator (#5776) · typeorm/typeorm@7d8a1ca

Original file line numberDiff line numberDiff line change

@@ -5,23 +5,23 @@ import {TableMetadataArgs} from "../../metadata-args/TableMetadataArgs";

55

* This decorator is used to mark classes that will be an entity (table or document depend on database type).

66

* Database schema will be created for all classes decorated with it, and Repository can be retrieved and used for it.

77

*/

8-

export function Entity(options?: EntityOptions): Function;

8+

export function Entity(options?: EntityOptions): ClassDecorator;

99
1010

/**

1111

* This decorator is used to mark classes that will be an entity (table or document depend on database type).

1212

* Database schema will be created for all classes decorated with it, and Repository can be retrieved and used for it.

1313

*/

14-

export function Entity(name?: string, options?: EntityOptions): Function;

14+

export function Entity(name?: string, options?: EntityOptions): ClassDecorator;

1515
1616

/**

1717

* This decorator is used to mark classes that will be an entity (table or document depend on database type).

1818

* Database schema will be created for all classes decorated with it, and Repository can be retrieved and used for it.

1919

*/

20-

export function Entity(nameOrOptions?: string|EntityOptions, maybeOptions?: EntityOptions): Function {

20+

export function Entity(nameOrOptions?: string|EntityOptions, maybeOptions?: EntityOptions): ClassDecorator {

2121

const options = (typeof nameOrOptions === "object" ? nameOrOptions as EntityOptions : maybeOptions) || {};

2222

const name = typeof nameOrOptions === "string" ? nameOrOptions : options.name;

2323
24-

return function (target: Function) {

24+

return function (target) {

2525

getMetadataArgsStorage().tables.push({

2626

target: target,

2727

name: name,