forked from bmob/hydrogen-js-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
133 lines (119 loc) · 4.64 KB
/
index.d.ts
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
export interface BmobPromise<T = any> extends Promise<BmobPromise<T>> {
}
export interface queryData {
(key: string, operator: string, val: any): object
}
export class Query {
new(params: string): void;
get: (objectId: string) => BmobPromise;
set: (filedName: string, filedValue: string) => BmobPromise;
destroy: (objectId: string) => BmobPromise;
save: (parmas?: object) => BmobPromise;
find: () => BmobPromise;
current: () => BmobPromise;
add: (key: string, val: string[]) => void;
addUnique: () => (key: string, val: string[]) => void;
remove: (key: string, val: string[]) => void;
equalTo: (key: string, operator: string, val: any) => object
or: (...args: object[]) => void;
and: (...args: object[]) => void;
select: (...args: string[]) => void;
containedIn: (key: string, val: string[]) => queryData;
notContainedIn: (key: string, val: string[]) => queryData;
exists: (key: string) => queryData;
doesNotExist: (key: string) => queryData;
limit: (params: number) => void;
skip: (params: number) => void;
order: (...args: string[]) => void;
include: (...args: string[]) => void;
count: (limit?: number) => BmobPromise;
statTo: (key: string, val: any) => object;
saveAll: (items: any[]) => BmobPromise;
updateStorage: (objectId: string) => BmobPromise;
field: (key: string, objectId: string) => object;
withinKilometers: (field: string, coordinates: string, km?: number) => object
withinGeoBox: (field: string, coordinates: string, s?: number) => object
relation: (tableName: string) => BmobPromise
}
export class User extends Query {
new(): void;
login: (username: string, password: string) => BmobPromise;
register: (params: object) => BmobPromise;
signOrLoginByMobilePhone: (phone: number, smsCode: number) => BmobPromise;
logout: () => void;
users: () => BmobPromise;
decryption: (params: object) => BmobPromise
requestOpenId: (code: any, params?: string) => BmobPromise
requestEmailVerify: (email: string) => BmobPromise
linkWith: (params: any) => BmobPromise
loginWithWeapp: (code: any, params?: string, str: string) => BmobPromise
upInfo: (params: object) => BmobPromise
openId: () => void;
auth: (params?: string) => BmobPromise
}
export interface operation {
(parmas: string, op: string): object
}
export class Relation {
new(tableName: string): void;
add: (parmas: string) => operation
}
export class Pointer {
new(tableName: string): void;
set: (objectId: string) => object
}
export interface functions {
(funName: string, parmas?: object): BmobPromise
}
export class Pay {
new(price: string, productName: string, body: any): BmobPromise
}
export class Socket {
new(id: string): void;
updateTable: (tableName: string) => void
unsubUpdateTable: (tableName: string) => void
updateRow: (tableName: string, objectId: string) => boid
unsubUpdateRow: (tableName: string, objectId: string) => boid
deleteTable: (tableName: string) => void
unsubDeleteTable: (tableName: string) => void
deleteRow: (tableName: string, objectId: string) => boid
unsubDeleteRow: (tableName: string, objectId: string) => boid
onUpdateTable: (tableName: string, data: any) => any
onUpdateRow: (tableName: string, objectId: string, data: any) => any
onUpdateTable: (tableName: string, data: any) => any
onUpdateTable: (tableName: string, objectId: string, data: any) => any
}
export class File {
new(name: string, params: any): void;
save: () => BmobPromise;
destroy: (params: string) => BmobPromise;
}
export interface Bmob {
initialize: (secretKey: string, securityCode: string, masterKey?: string) => void;
User: User;
Query: (params: string) => Query;
push: (params: object) => BmobPromise;
Pointer: (parmas: string) => Pointer;
Relation: (parmas: string) => Relation;
requestPasswordReset: (email: object) => BmobPromise;
resetPasswordBySmsCode: (smsCode: string, params: object) => BmobPromise;
updateUserPassword: (objectId: string, params: object) => BmobPromise;
timestamp: () => BmobPromise;
generateCode: (params: object) => BmobPromise;
getAccessToken: () => BmobPromise;
sendWeAppMessage: (parmas: object) => BmobPromise;
refund: (parmas: object) => BmobPromise;
notifyMsg: (parmas: object) => BmobPromise;
requestPasswordReset: (parmas: object) => BmobPromise;
checkMsg: (parmas: string) => BmobPromise;
functions: functions;
run: functions;
pay: Pay;
Socket: (id: string) => Socket;
geoPoint: (parmas: object) => object;
requestSmsCode: (parmas: object, options?: any) => BmobPromise;
verifySmsCode: (smscode: string, parmas: object, options?: any) => BmobPromise;
File: (name: string, object: any) => File
}
declare const Bmob: Bmob;
export default Bmob