Skip to content

Commit 17ca0ad

Browse files
committed
Updated d.ts
1 parent 0b01d61 commit 17ca0ad

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

js/main/jsdb.d.ts

+15-12
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ declare module 'jsdb' {
2525
interface Entity {
2626
}
2727
/**
28-
* Definition of an entity constructor, just to mane things.
28+
* Definition of an entity constructor, just to name things.
2929
*/
3030
interface EntityType<T extends Entity> {
3131
new (): T;
3232
}
33+
interface EntityTypeProducer<T extends Entity> {
34+
(): EntityType<T>;
35+
}
3336
/**
3437
* Internal module, most of the stuff inside this module are either internal use only or exposed by other methods,
3538
* they should never be used directly.
@@ -1240,11 +1243,11 @@ declare module 'jsdb' {
12401243
class MetaDescriptor {
12411244
localName: string;
12421245
remoteName: string;
1243-
ctor: EntityType<any>;
12441246
classMeta: ClassMetadata;
12451247
getTreeChange(md: Metadata): ClassMetadata;
12461248
getRemoteName(): string;
12471249
setType(def: any): void;
1250+
ctor: EntityType<any>;
12481251
named(name: string): MetaDescriptor;
12491252
setLocalName(name: string): void;
12501253
createEvent(allMetadata: Metadata): GenericEvent;
@@ -1337,22 +1340,22 @@ declare module 'jsdb' {
13371340
}
13381341
function bind(localName: string, targetName: string, live?: boolean): Internal.IBinding;
13391342
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;
13451348
function root(name?: string, override?: string): ClassDecorator;
13461349
function discriminator(disc: string): ClassDecorator;
13471350
function override(override?: string): ClassDecorator;
13481351
function observable(): PropertyDecorator;
13491352
function ignore(): PropertyDecorator;
13501353
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;
13561359
function observable(): Db.Internal.ObservableMetaDescriptor;
13571360
function ignore(): Db.Internal.IgnoreMetaDescriptor;
13581361
function define(ctor: EntityType<any>, root?: string, discriminator?: string, override?: string): void;

0 commit comments

Comments
 (0)