@@ -25,11 +25,14 @@ declare module 'jsdb' {
25
25
interface Entity {
26
26
}
27
27
/**
28
- * Definition of an entity constructor, just to mane things.
28
+ * Definition of an entity constructor, just to name things.
29
29
*/
30
30
interface EntityType < T extends Entity > {
31
31
new ( ) : T ;
32
32
}
33
+ interface EntityTypeProducer < T extends Entity > {
34
+ ( ) : EntityType < T > ;
35
+ }
33
36
/**
34
37
* Internal module, most of the stuff inside this module are either internal use only or exposed by other methods,
35
38
* they should never be used directly.
@@ -1240,11 +1243,11 @@ declare module 'jsdb' {
1240
1243
class MetaDescriptor {
1241
1244
localName : string ;
1242
1245
remoteName : string ;
1243
- ctor : EntityType < any > ;
1244
1246
classMeta : ClassMetadata ;
1245
1247
getTreeChange ( md : Metadata ) : ClassMetadata ;
1246
1248
getRemoteName ( ) : string ;
1247
1249
setType ( def : any ) : void ;
1250
+ ctor : EntityType < any > ;
1248
1251
named ( name : string ) : MetaDescriptor ;
1249
1252
setLocalName ( name : string ) : void ;
1250
1253
createEvent ( allMetadata : Metadata ) : GenericEvent ;
@@ -1337,22 +1340,22 @@ declare module 'jsdb' {
1337
1340
}
1338
1341
function bind ( localName : string , targetName : string , live ?: boolean ) : Internal . IBinding ;
1339
1342
function sortBy ( field : string , desc ?: boolean ) : Internal . SortingData ;
1340
- function embedded ( def : EntityType < any > , binding ?: Internal . IBinding ) : PropertyDecorator ;
1341
- function reference ( def : EntityType < any > , project ?: string [ ] ) : PropertyDecorator ;
1342
- function map ( valueType : EntityType < any > , reference ?: boolean , sorting ?: Internal . SortingData ) : PropertyDecorator ;
1343
- function set ( valueType : EntityType < any > , reference ?: boolean , sorting ?: Internal . SortingData ) : PropertyDecorator ;
1344
- function list ( valueType : EntityType < any > , reference ?: boolean , sorting ?: Internal . SortingData ) : PropertyDecorator ;
1343
+ function embedded ( def : EntityType < any > | EntityTypeProducer < any > , binding ?: Internal . IBinding ) : PropertyDecorator ;
1344
+ function reference ( def : EntityType < any > | EntityTypeProducer < any > , project ?: string [ ] ) : PropertyDecorator ;
1345
+ function map ( valueType : EntityType < any > | EntityTypeProducer < any > , reference ?: boolean , sorting ?: Internal . SortingData ) : PropertyDecorator ;
1346
+ function set ( valueType : EntityType < any > | EntityTypeProducer < any > , reference ?: boolean , sorting ?: Internal . SortingData ) : PropertyDecorator ;
1347
+ function list ( valueType : EntityType < any > | EntityTypeProducer < any > , reference ?: boolean , sorting ?: Internal . SortingData ) : PropertyDecorator ;
1345
1348
function root ( name ?: string , override ?: string ) : ClassDecorator ;
1346
1349
function discriminator ( disc : string ) : ClassDecorator ;
1347
1350
function override ( override ?: string ) : ClassDecorator ;
1348
1351
function observable ( ) : PropertyDecorator ;
1349
1352
function ignore ( ) : PropertyDecorator ;
1350
1353
module meta {
1351
- function embedded ( def : any , binding ?: Internal . IBinding ) : Db . Internal . EmbeddedMetaDescriptor ;
1352
- function reference ( def : any , project ?: string [ ] ) : Db . Internal . ReferenceMetaDescriptor ;
1353
- function map ( valuetype : EntityType < any > , reference ?: boolean , sorting ?: Internal . SortingData ) : Db . Internal . MapMetaDescriptor ;
1354
- function set ( valuetype : EntityType < any > , reference ?: boolean , sorting ?: Internal . SortingData ) : Db . Internal . SetMetaDescriptor ;
1355
- function list ( valuetype : EntityType < any > , reference ?: boolean , sorting ?: Internal . SortingData ) : Db . Internal . ListMetaDescriptor ;
1354
+ function embedded ( def : EntityType < any > | EntityTypeProducer < any > , binding ?: Internal . IBinding ) : Db . Internal . EmbeddedMetaDescriptor ;
1355
+ function reference ( def : EntityType < any > | EntityTypeProducer < any > , project ?: string [ ] ) : Db . Internal . ReferenceMetaDescriptor ;
1356
+ function map ( valuetype : EntityType < any > | EntityTypeProducer < any > , reference ?: boolean , sorting ?: Internal . SortingData ) : Db . Internal . MapMetaDescriptor ;
1357
+ function set ( valuetype : EntityType < any > | EntityTypeProducer < any > , reference ?: boolean , sorting ?: Internal . SortingData ) : Db . Internal . SetMetaDescriptor ;
1358
+ function list ( valuetype : EntityType < any > | EntityTypeProducer < any > , reference ?: boolean , sorting ?: Internal . SortingData ) : Db . Internal . ListMetaDescriptor ;
1356
1359
function observable ( ) : Db . Internal . ObservableMetaDescriptor ;
1357
1360
function ignore ( ) : Db . Internal . IgnoreMetaDescriptor ;
1358
1361
function define ( ctor : EntityType < any > , root ?: string , discriminator ?: string , override ?: string ) : void ;
0 commit comments