This repository was archived by the owner on Sep 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathjaydata.d.ts
More file actions
177 lines (160 loc) · 6.27 KB
/
jaydata.d.ts
File metadata and controls
177 lines (160 loc) · 6.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
declare module $data{
class Geography{}
class GeographyLineString{}
class GeographyPolygon{}
class GeographyMultiPoint{}
class GeographyMultiPolygon{}
class GeographyMultiLineString{}
class GeographyCollection{}
class Geometry{}
class GeometryLineString{}
class GeometryPolygon{}
class GeometryMultiPoint{}
class GeometryMultiPolygon{}
class GeometryMultiLineString{}
class GeometryCollection{}
const enum EntityState{
Detached = 0,
Unchanged = 10,
Added = 20,
Modified = 30,
Deleted = 40
}
interface MemberDefinition{
name: string;
type: any;
dataType: any;
elementType: any;
originalType: any;
kind: string;
classMember: boolean;
set: (value:any) => void;
get: () => any;
value: any;
initialValue: any;
method: Function;
enumerable: boolean;
configurable: boolean;
key: boolean;
computed: boolean;
storeOnObject: boolean;
monitorChanges: boolean;
}
interface Event{
attach(eventHandler: (sender: any, event: any) => void ): void;
detach(eventHandler: () => void ): void;
fire(e: any, sender: any): void;
}
class Base<T>{
constructor();
getType: () => typeof Base;
static addProperty(name:string, getterOrType:string | Function, setterOrGetter?:Function, setter?:Function): void;
static addMember(name:string, definition:any, isClassMember?:boolean): void;
static describeField(name:string, definition:any): void;
static hasMetadata(key:string, property?:string): boolean;
static getAllMetadata(property?:string): any;
static getMetadata(key:string, property?:string): any;
static setMetadata(key:string, value:any, property?:string): void;
}
class Enum extends Base<Enum>{
static extend(name:string, instanceDefinition:any, classDefinition?:any): Base<Enum>;
}
function createEnum(name:string, enumType:any, enumDefinition?:any): Base<Enum>;
class Entity extends Base<Entity>{
static extend(name:string, instanceDefinition:any, classDefinition?:any): Base<Entity>;
entityState: EntityState;
changedProperties: MemberDefinition[];
propertyChanging: Event;
propertyChanged: Event;
propertyValidationError: Event;
isValid: boolean;
}
class EntitySet<Ttype extends typeof Entity, T extends Entity> extends Queryable<T>{
add(item: T): T;
add(initData: {}): T;
attach(item: T): void;
attach(item: {}): void;
attachOrGet(item: T): T;
attachOrGet(item: {}): T;
detach(item: T): void;
detach(item: {}): void;
remove(item: T): void;
remove(item: {}): void;
elementType: Ttype;
}
class EntityContext extends Base<EntityContext>{
constructor(config?: any);
onReady(): Promise<EntityContext>;
saveChanges(): Promise<number>;
stateManager: {reset: Function};
static extend(name:string, instanceDefinition:any, classDefinition?:any): Base<EntityContext>;
}
class Queryable<T extends Entity | Edm.Primitive>{
filter(predicate: (it: T) => boolean, thisArg?: any): Queryable<T>;
filter(predicate: string, thisArg?: any): Queryable<T>;
map(projection: (it: T) => any): Queryable<any>;
map(projection: string): Queryable<any>;
orderBy(predicate: (it: T) => void): Queryable<T>;
orderBy(predicate: string): Queryable<T>;
orderByDescending(predicate: (it: T) => void): Queryable<T>;
orderByDescending(predicate: string): Queryable<T>;
include(selector: string): Queryable<T>;
skip(amount: number): Queryable<T>;
take(amount: number): Queryable<T>;
forEach(handler: (it: T) => void): Promise<T>;
length(): Promise<number>;
toArray(): Promise<T[]>;
single(predicate: (it: T) => boolean, params?: any): Promise<T>;
single(predicate: string, params?: any): Promise<T>;
first(predicate?: (it: T) => boolean, params?: any): Promise<T>;
first(predicate?: string, params?: any): Promise<T>;
removeAll(): Promise<number>;
count(): Promise<number>;
}
class ServiceAction{}
class ServiceFunction{}
function implementation(name:string): typeof Base;
}
export {$data as $data}
declare type JSDate = Date;
declare module Edm {
type Boolean = boolean;
type Binary = Uint8Array;
type DateTime = JSDate;
type DateTimeOffset = JSDate;
type Duration = string;
type TimeOfDay = string;
type Date = string;
type Time = string;
type Decimal = string;
type Single = number;
type Float = number;
type Double = number;
type Guid = string;
type Int16 = number;
type Int32 = number;
type Int64 = string;
type Byte = number;
type SByte = number;
type String = string;
type GeographyPoint = $data.Geography;
type GeographyLineString = $data.GeographyLineString;
type GeographyPolygon = $data.GeographyPolygon;
type GeographyMultiPoint = $data.GeographyMultiPoint;
type GeographyMultiPolygon = $data.GeographyMultiPolygon;
type GeographyMultiLineString = $data.GeographyMultiLineString;
type GeographyCollection = $data.GeographyCollection;
type GeometryPoint = $data.Geometry;
type GeometryLineString = $data.GeometryLineString;
type GeometryPolygon = $data.GeometryPolygon;
type GeometryMultiPoint = $data.GeometryMultiPoint;
type GeometryMultiPolygon = $data.GeometryMultiPolygon;
type GeometryMultiLineString = $data.GeometryMultiLineString;
type GeometryCollection = $data.GeometryCollection;
type Primitive =
Boolean | Binary | Guid | DateTime | DateTimeOffset | Duration | TimeOfDay | Date | Time |
Decimal | Single | Float | Double | Int16 | Int32 | Int64 | Byte | SByte | String |
GeographyPoint | GeographyLineString | GeographyPolygon | GeographyMultiPoint | GeographyMultiLineString | GeographyMultiPolygon | GeographyCollection |
GeometryPoint | GeometryLineString | GeometryPolygon | GeometryMultiPoint | GeometryMultiLineString | GeometryMultiPolygon | GeometryCollection;
}
export {Edm as Edm}