laravel-request 1.1.31 → 1.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/types.d.ts +307 -240
- package/tsconfig.json +9 -0
package/package.json
CHANGED
package/src/types.d.ts
CHANGED
|
@@ -1,251 +1,318 @@
|
|
|
1
1
|
// Define an interface for the ApiRequest class
|
|
2
|
-
declare class ApiRequest {
|
|
3
|
-
url: string;
|
|
4
|
-
static notifyClass: any | null;
|
|
5
|
-
domain: string;
|
|
6
|
-
target: string;
|
|
7
|
-
focus: string;
|
|
8
|
-
method: string;
|
|
9
|
-
data: any;
|
|
10
|
-
headers: any[];
|
|
11
|
-
arguments: any[];
|
|
12
|
-
builder: Builder;
|
|
13
|
-
notifyCallback: (status: number) => boolean;
|
|
14
|
-
responseBinding: Binding | Binding[] | null;
|
|
15
|
-
responseBindingErrors: Binding | null;
|
|
16
|
-
callSuccess: Function;
|
|
17
|
-
callError: Function;
|
|
18
|
-
|
|
19
|
-
constructor(target: string, focus: string, data?: object, method?: string);
|
|
20
|
-
|
|
21
|
-
getNotifyManager(): any | null;
|
|
22
|
-
setUrl(url: string): ApiRequest;
|
|
23
|
-
setDomain(domain: string): ApiRequest;
|
|
24
|
-
addArg(arg: any | any[]): ApiRequest;
|
|
25
|
-
first(successCallback?: (r: any) => void, errorCallback?: () => void): any;
|
|
26
|
-
all(successCallback?: (r: any) => void, errorCallback?: () => void): any;
|
|
27
|
-
paginate(
|
|
28
|
-
page?: number,
|
|
29
|
-
perPage?: number,
|
|
30
|
-
successCallback?: (r: any) => void,
|
|
31
|
-
errorCallback?: () => void
|
|
32
|
-
): any;
|
|
33
|
-
pluck(
|
|
34
|
-
fields: any,
|
|
35
|
-
successCallback?: (r: any) => void,
|
|
36
|
-
errorCallback?: () => void
|
|
37
|
-
): ApiRequest;
|
|
38
|
-
getUrl(): string;
|
|
39
|
-
call(
|
|
40
|
-
successCallback?: (r: any) => void,
|
|
41
|
-
errorCallback?: () => void,
|
|
42
|
-
params?: object,
|
|
43
|
-
dataKey?: string,
|
|
44
|
-
argumentsKey?: string,
|
|
45
|
-
queryKey?: string,
|
|
46
|
-
byUrl?: boolean
|
|
47
|
-
): ApiRequest;
|
|
48
|
-
callSync(
|
|
49
|
-
successCallback?: (r: any) => void,
|
|
50
|
-
errorCallback?: () => void
|
|
51
|
-
): ApiRequest;
|
|
52
|
-
callUrl(
|
|
53
|
-
successCallback?: (r: any) => void,
|
|
54
|
-
errorCallback?: () => void,
|
|
55
|
-
params?: object,
|
|
56
|
-
dataKey?: string,
|
|
57
|
-
argumentsKey?: string,
|
|
58
|
-
queryKey?: string
|
|
59
|
-
): ApiRequest;
|
|
60
|
-
constructRequestData(
|
|
61
|
-
dataKey: string,
|
|
62
|
-
argumentsKey: string,
|
|
63
|
-
queryKey: string
|
|
64
|
-
): object;
|
|
65
|
-
getErrorNotification(xhr: XMLHttpRequest, errorText: string): object | null;
|
|
66
|
-
defaultErrorMessage(xhr: XMLHttpRequest, errorText: string): object | null;
|
|
67
|
-
getErrorNotificationFallback(e: Error): object | null;
|
|
68
|
-
executeRequest(
|
|
69
|
-
successCallback: (r: any) => void,
|
|
70
|
-
errorCallback: () => void,
|
|
71
|
-
params?: object,
|
|
72
|
-
dataKey?: string,
|
|
73
|
-
argumentsKey?: string,
|
|
74
|
-
queryKey?: string,
|
|
75
|
-
byUrl?: boolean
|
|
76
|
-
): ApiRequest;
|
|
77
|
-
handleSuccessNotification(
|
|
78
|
-
response: any,
|
|
79
|
-
status: number
|
|
80
|
-
): object | null;
|
|
81
|
-
handleError(
|
|
82
|
-
notify: object | null,
|
|
83
|
-
errorCallback: (xhr: XMLHttpRequest) => void,
|
|
84
|
-
xhr: XMLHttpRequest,
|
|
85
|
-
errorText: string
|
|
86
|
-
): void;
|
|
87
|
-
bind(
|
|
88
|
-
obj: any,
|
|
89
|
-
item: string | [string, string][],
|
|
90
|
-
rerender?: boolean,
|
|
91
|
-
cb?: Function
|
|
92
|
-
): ApiRequest;
|
|
93
|
-
toBind(response: any): void;
|
|
94
|
-
resetBindErrors(): void;
|
|
95
|
-
toBindErrors(response?: object): void;
|
|
96
|
-
withValidateForm(
|
|
97
|
-
obj: any,
|
|
98
|
-
item?: string,
|
|
99
|
-
key?: string
|
|
100
|
-
): ApiRequest;
|
|
101
|
-
withoutNotify(callback?: (status: number) => boolean): ApiRequest;
|
|
102
|
-
}
|
|
103
2
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
static debug: boolean;
|
|
107
|
-
static requestClass: any;
|
|
108
|
-
static tokenResolver: () => Promise<string | null>;
|
|
109
|
-
static domainResolver: () => string;
|
|
110
|
-
|
|
111
|
-
static getArg(controller: string, action: string, arg: string, data?: Record<string, any>): ApiRequest;
|
|
112
|
-
static postArg(controller: string, action: string, arg: string, data?: Record<string, any>): ApiRequest;
|
|
113
|
-
static putArg(controller: string, action: string, arg: string, data?: Record<string, any>): ApiRequest;
|
|
114
|
-
|
|
115
|
-
static getUrl(url: string, data?: Record<string, any>): ApiRequest;
|
|
116
|
-
static postUrl(url: string, data?: Record<string, any>): ApiRequest;
|
|
117
|
-
static putUrl(url: string, data?: Record<string, any>): ApiRequest;
|
|
118
|
-
|
|
119
|
-
static get(controller: string, action: string, data?: Record<string, any>): ApiRequest;
|
|
120
|
-
static post(controller: string, action: string, data?: Record<string, any>): ApiRequest;
|
|
121
|
-
static put(controller: string, action: string, data?: Record<string, any>): ApiRequest;
|
|
122
|
-
static delete(controller: string, action: string, id: string, data?: Record<string, any>): ApiRequest;
|
|
123
|
-
|
|
124
|
-
static encodeQueryString(params: Record<string, any>): string;
|
|
125
|
-
static logRequest(request: {
|
|
3
|
+
declare module 'laravel-request' {
|
|
4
|
+
export class ApiRequest {
|
|
126
5
|
url: string;
|
|
6
|
+
static notifyClass: any | null;
|
|
7
|
+
domain: string;
|
|
8
|
+
target: string;
|
|
9
|
+
focus: string;
|
|
127
10
|
method: string;
|
|
128
|
-
data
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
11
|
+
data: any;
|
|
12
|
+
headers: any[];
|
|
13
|
+
arguments: any[];
|
|
14
|
+
builder: Builder;
|
|
15
|
+
notifyCallback: (status: number) => boolean;
|
|
16
|
+
responseBinding: Binding | Binding[] | null;
|
|
17
|
+
responseBindingErrors: Binding | null;
|
|
18
|
+
callSuccess: Function;
|
|
19
|
+
callError: Function;
|
|
132
20
|
|
|
133
|
-
|
|
134
|
-
url: string;
|
|
135
|
-
method: string;
|
|
136
|
-
data?: Record<string, any>;
|
|
137
|
-
params?: Record<string, any>;
|
|
138
|
-
headers?: Record<string, any>;
|
|
139
|
-
success?: (response: any, status: number, xhr: any) => void;
|
|
140
|
-
error?: (xhr: any, statusCode: number, statusText: string) => void;
|
|
141
|
-
}): Promise<any>;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
declare class Builder {
|
|
145
|
-
static availableMethod: string[];
|
|
146
|
-
|
|
147
|
-
query: Array<Record<string, any>>;
|
|
148
|
-
|
|
149
|
-
constructor();
|
|
150
|
-
|
|
151
|
-
add(method: string, args: any[]): Builder;
|
|
152
|
-
|
|
153
|
-
toArray(): Array<Record<string, any>>;
|
|
154
|
-
|
|
155
|
-
// Define dynamic method signatures for available methods
|
|
156
|
-
select(...args: any[]): Builder;
|
|
157
|
-
where(...args: any[]): Builder;
|
|
158
|
-
orWhere(...args: any[]): Builder;
|
|
159
|
-
whereDate(...args: any[]): Builder;
|
|
160
|
-
orWhereDate(...args: any[]): Builder;
|
|
161
|
-
whereYear(...args: any[]): Builder;
|
|
162
|
-
orWhereYear(...args: any[]): Builder;
|
|
163
|
-
whereMonth(...args: any[]): Builder;
|
|
164
|
-
orWhereMonth(...args: any[]): Builder;
|
|
165
|
-
has(...args: any[]): Builder;
|
|
166
|
-
whereIn(...args: any[]): Builder;
|
|
167
|
-
orWhereIn(...args: any[]): Builder;
|
|
168
|
-
whereNotIn(...args: any[]): Builder;
|
|
169
|
-
orWhereNotIn(...args: any[]): Builder;
|
|
170
|
-
whereHas(...args: any[]): Builder;
|
|
171
|
-
orWhereHas(...args: any[]): Builder;
|
|
172
|
-
whereHasMorph(...args: any[]): Builder;
|
|
173
|
-
orWhereHasMorph(...args: any[]): Builder;
|
|
174
|
-
whereDoesntHave(...args: any[]): Builder;
|
|
175
|
-
orWhereDoesntHave(...args: any[]): Builder;
|
|
176
|
-
whereNull(...args: any[]): Builder;
|
|
177
|
-
orWhereNull(...args: any[]): Builder;
|
|
178
|
-
whereNotNull(...args: any[]): Builder;
|
|
179
|
-
orWhereNotNull(...args: any[]): Builder;
|
|
180
|
-
orderBy(...args: any[]): Builder;
|
|
181
|
-
groupBy(...args: any[]): Builder;
|
|
182
|
-
with(...args: any[]): Builder;
|
|
183
|
-
withCount(...args: any[]): Builder;
|
|
184
|
-
offset(...args: any[]): Builder;
|
|
185
|
-
limit(...args: any[]): Builder;
|
|
186
|
-
distinct(...args: any[]): Builder;
|
|
187
|
-
owner(...args: any[]): Builder;
|
|
188
|
-
whereAbs(...args: any[]): Builder;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
interface Target {
|
|
192
|
-
state: Record<string, any>;
|
|
193
|
-
setState(callback: (prevState: Record<string, any>) => Record<string, any>, onSuccess?: () => void): void;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
declare class Binding {
|
|
197
|
-
target: Target;
|
|
198
|
-
pathTarget: string[];
|
|
199
|
-
pathData: string[];
|
|
200
|
-
callback?: () => void;
|
|
201
|
-
rerender: boolean;
|
|
202
|
-
|
|
203
|
-
constructor(
|
|
204
|
-
target: Target,
|
|
205
|
-
pathTarget: string,
|
|
206
|
-
pathData: string,
|
|
207
|
-
rerender: boolean,
|
|
208
|
-
onSuccess?: () => void
|
|
209
|
-
);
|
|
210
|
-
|
|
211
|
-
fire(data: Record<string, any>): void;
|
|
212
|
-
|
|
213
|
-
getData(value: Record<string, any>): any;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
declare class ApiProxy {
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
interface Query {
|
|
221
|
-
orderBy(field: string, direction: string): Query;
|
|
222
|
-
where(field: string, operator: string, value: any): Query;
|
|
223
|
-
// Define other methods as required
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
interface OptionData {
|
|
227
|
-
value: string;
|
|
228
|
-
method?: (query: Query, value: string) => void;
|
|
229
|
-
field?: string;
|
|
230
|
-
operator?: string;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
interface Options {
|
|
234
|
-
[key: string]: OptionData;
|
|
235
|
-
}
|
|
21
|
+
constructor(target: string, focus: string, data?: object, method?: string);
|
|
236
22
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
23
|
+
getNotifyManager(): any | null;
|
|
24
|
+
|
|
25
|
+
setUrl(url: string): ApiRequest;
|
|
26
|
+
|
|
27
|
+
setDomain(domain: string): ApiRequest;
|
|
28
|
+
|
|
29
|
+
addArg(arg: any | any[]): ApiRequest;
|
|
30
|
+
|
|
31
|
+
first(successCallback?: (r: any) => void, errorCallback?: () => void): any;
|
|
32
|
+
|
|
33
|
+
all(successCallback?: (r: any) => void, errorCallback?: () => void): any;
|
|
34
|
+
|
|
35
|
+
paginate(
|
|
36
|
+
page?: number,
|
|
37
|
+
perPage?: number,
|
|
38
|
+
successCallback?: (r: any) => void,
|
|
39
|
+
errorCallback?: () => void
|
|
40
|
+
): any;
|
|
41
|
+
|
|
42
|
+
pluck(
|
|
43
|
+
fields: any,
|
|
44
|
+
successCallback?: (r: any) => void,
|
|
45
|
+
errorCallback?: () => void
|
|
46
|
+
): ApiRequest;
|
|
47
|
+
|
|
48
|
+
getUrl(): string;
|
|
49
|
+
|
|
50
|
+
call(
|
|
51
|
+
successCallback?: (r: any) => void,
|
|
52
|
+
errorCallback?: () => void,
|
|
53
|
+
params?: object,
|
|
54
|
+
dataKey?: string,
|
|
55
|
+
argumentsKey?: string,
|
|
56
|
+
queryKey?: string,
|
|
57
|
+
byUrl?: boolean
|
|
58
|
+
): ApiRequest;
|
|
59
|
+
|
|
60
|
+
callSync(
|
|
61
|
+
successCallback?: (r: any) => void,
|
|
62
|
+
errorCallback?: () => void
|
|
63
|
+
): ApiRequest;
|
|
64
|
+
|
|
65
|
+
callUrl(
|
|
66
|
+
successCallback?: (r: any) => void,
|
|
67
|
+
errorCallback?: () => void,
|
|
68
|
+
params?: object,
|
|
69
|
+
dataKey?: string,
|
|
70
|
+
argumentsKey?: string,
|
|
71
|
+
queryKey?: string
|
|
72
|
+
): ApiRequest;
|
|
73
|
+
|
|
74
|
+
constructRequestData(
|
|
75
|
+
dataKey: string,
|
|
76
|
+
argumentsKey: string,
|
|
77
|
+
queryKey: string
|
|
78
|
+
): object;
|
|
79
|
+
|
|
80
|
+
getErrorNotification(xhr: XMLHttpRequest, errorText: string): object | null;
|
|
81
|
+
|
|
82
|
+
defaultErrorMessage(xhr: XMLHttpRequest, errorText: string): object | null;
|
|
83
|
+
|
|
84
|
+
getErrorNotificationFallback(e: Error): object | null;
|
|
85
|
+
|
|
86
|
+
executeRequest(
|
|
87
|
+
successCallback: (r: any) => void,
|
|
88
|
+
errorCallback: () => void,
|
|
89
|
+
params?: object,
|
|
90
|
+
dataKey?: string,
|
|
91
|
+
argumentsKey?: string,
|
|
92
|
+
queryKey?: string,
|
|
93
|
+
byUrl?: boolean
|
|
94
|
+
): ApiRequest;
|
|
95
|
+
|
|
96
|
+
handleSuccessNotification(
|
|
97
|
+
response: any,
|
|
98
|
+
status: number
|
|
99
|
+
): object | null;
|
|
100
|
+
|
|
101
|
+
handleError(
|
|
102
|
+
notify: object | null,
|
|
103
|
+
errorCallback: (xhr: XMLHttpRequest) => void,
|
|
104
|
+
xhr: XMLHttpRequest,
|
|
105
|
+
errorText: string
|
|
106
|
+
): void;
|
|
107
|
+
|
|
108
|
+
bind(
|
|
109
|
+
obj: any,
|
|
110
|
+
item: string | [string, string][],
|
|
111
|
+
rerender?: boolean,
|
|
112
|
+
cb?: Function
|
|
113
|
+
): ApiRequest;
|
|
114
|
+
|
|
115
|
+
toBind(response: any): void;
|
|
116
|
+
|
|
117
|
+
resetBindErrors(): void;
|
|
118
|
+
|
|
119
|
+
toBindErrors(response?: object): void;
|
|
120
|
+
|
|
121
|
+
withValidateForm(
|
|
122
|
+
obj: any,
|
|
123
|
+
item?: string,
|
|
124
|
+
key?: string
|
|
125
|
+
): ApiRequest;
|
|
126
|
+
|
|
127
|
+
withoutNotify(callback?: (status: number) => boolean): ApiRequest;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Define the Api class type with all static methods
|
|
131
|
+
export class Api {
|
|
132
|
+
static debug: boolean;
|
|
133
|
+
static requestClass: any;
|
|
134
|
+
static tokenResolver: () => Promise<string | null>;
|
|
135
|
+
static domainResolver: () => string;
|
|
136
|
+
|
|
137
|
+
static getArg(controller: string, action: string, arg: string, data?: Record<string, any>): ApiRequest;
|
|
138
|
+
|
|
139
|
+
static postArg(controller: string, action: string, arg: string, data?: Record<string, any>): ApiRequest;
|
|
140
|
+
|
|
141
|
+
static putArg(controller: string, action: string, arg: string, data?: Record<string, any>): ApiRequest;
|
|
142
|
+
|
|
143
|
+
static getUrl(url: string, data?: Record<string, any>): ApiRequest;
|
|
144
|
+
|
|
145
|
+
static postUrl(url: string, data?: Record<string, any>): ApiRequest;
|
|
146
|
+
|
|
147
|
+
static putUrl(url: string, data?: Record<string, any>): ApiRequest;
|
|
148
|
+
|
|
149
|
+
static get(controller: string, action: string, data?: Record<string, any>): ApiRequest;
|
|
150
|
+
|
|
151
|
+
static post(controller: string, action: string, data?: Record<string, any>): ApiRequest;
|
|
152
|
+
|
|
153
|
+
static put(controller: string, action: string, data?: Record<string, any>): ApiRequest;
|
|
154
|
+
|
|
155
|
+
static delete(controller: string, action: string, id: string, data?: Record<string, any>): ApiRequest;
|
|
156
|
+
|
|
157
|
+
static encodeQueryString(params: Record<string, any>): string;
|
|
158
|
+
|
|
159
|
+
static logRequest(request: {
|
|
160
|
+
url: string;
|
|
161
|
+
method: string;
|
|
162
|
+
data?: Record<string, any>;
|
|
163
|
+
params?: Record<string, any>;
|
|
164
|
+
headers?: Record<string, any>;
|
|
165
|
+
}): void;
|
|
166
|
+
|
|
167
|
+
static makeRequest(params: {
|
|
168
|
+
url: string;
|
|
169
|
+
method: string;
|
|
170
|
+
data?: Record<string, any>;
|
|
171
|
+
params?: Record<string, any>;
|
|
172
|
+
headers?: Record<string, any>;
|
|
173
|
+
success?: (response: any, status: number, xhr: any) => void;
|
|
174
|
+
error?: (xhr: any, statusCode: number, statusText: string) => void;
|
|
175
|
+
}): Promise<any>;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export class Builder {
|
|
179
|
+
static availableMethod: string[];
|
|
180
|
+
|
|
181
|
+
query: Array<Record<string, any>>;
|
|
182
|
+
|
|
183
|
+
constructor();
|
|
184
|
+
|
|
185
|
+
add(method: string, args: any[]): Builder;
|
|
186
|
+
|
|
187
|
+
toArray(): Array<Record<string, any>>;
|
|
240
188
|
|
|
241
|
-
|
|
189
|
+
// Define dynamic method signatures for available methods
|
|
190
|
+
select(...args: any[]): Builder;
|
|
191
|
+
|
|
192
|
+
where(...args: any[]): Builder;
|
|
193
|
+
|
|
194
|
+
orWhere(...args: any[]): Builder;
|
|
195
|
+
|
|
196
|
+
whereDate(...args: any[]): Builder;
|
|
197
|
+
|
|
198
|
+
orWhereDate(...args: any[]): Builder;
|
|
199
|
+
|
|
200
|
+
whereYear(...args: any[]): Builder;
|
|
201
|
+
|
|
202
|
+
orWhereYear(...args: any[]): Builder;
|
|
203
|
+
|
|
204
|
+
whereMonth(...args: any[]): Builder;
|
|
205
|
+
|
|
206
|
+
orWhereMonth(...args: any[]): Builder;
|
|
207
|
+
|
|
208
|
+
has(...args: any[]): Builder;
|
|
209
|
+
|
|
210
|
+
whereIn(...args: any[]): Builder;
|
|
211
|
+
|
|
212
|
+
orWhereIn(...args: any[]): Builder;
|
|
213
|
+
|
|
214
|
+
whereNotIn(...args: any[]): Builder;
|
|
215
|
+
|
|
216
|
+
orWhereNotIn(...args: any[]): Builder;
|
|
217
|
+
|
|
218
|
+
whereHas(...args: any[]): Builder;
|
|
219
|
+
|
|
220
|
+
orWhereHas(...args: any[]): Builder;
|
|
221
|
+
|
|
222
|
+
whereHasMorph(...args: any[]): Builder;
|
|
223
|
+
|
|
224
|
+
orWhereHasMorph(...args: any[]): Builder;
|
|
225
|
+
|
|
226
|
+
whereDoesntHave(...args: any[]): Builder;
|
|
227
|
+
|
|
228
|
+
orWhereDoesntHave(...args: any[]): Builder;
|
|
229
|
+
|
|
230
|
+
whereNull(...args: any[]): Builder;
|
|
231
|
+
|
|
232
|
+
orWhereNull(...args: any[]): Builder;
|
|
233
|
+
|
|
234
|
+
whereNotNull(...args: any[]): Builder;
|
|
235
|
+
|
|
236
|
+
orWhereNotNull(...args: any[]): Builder;
|
|
237
|
+
|
|
238
|
+
orderBy(...args: any[]): Builder;
|
|
239
|
+
|
|
240
|
+
groupBy(...args: any[]): Builder;
|
|
241
|
+
|
|
242
|
+
with(...args: any[]): Builder;
|
|
243
|
+
|
|
244
|
+
withCount(...args: any[]): Builder;
|
|
245
|
+
|
|
246
|
+
offset(...args: any[]): Builder;
|
|
247
|
+
|
|
248
|
+
limit(...args: any[]): Builder;
|
|
249
|
+
|
|
250
|
+
distinct(...args: any[]): Builder;
|
|
251
|
+
|
|
252
|
+
owner(...args: any[]): Builder;
|
|
253
|
+
|
|
254
|
+
whereAbs(...args: any[]): Builder;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
interface Target {
|
|
258
|
+
state: Record<string, any>;
|
|
259
|
+
|
|
260
|
+
setState(callback: (prevState: Record<string, any>) => Record<string, any>, onSuccess?: () => void): void;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export class Binding {
|
|
264
|
+
target: Target;
|
|
265
|
+
pathTarget: string[];
|
|
266
|
+
pathData: string[];
|
|
267
|
+
callback?: () => void;
|
|
268
|
+
rerender: boolean;
|
|
269
|
+
|
|
270
|
+
constructor(
|
|
271
|
+
target: Target,
|
|
272
|
+
pathTarget: string,
|
|
273
|
+
pathData: string,
|
|
274
|
+
rerender: boolean,
|
|
275
|
+
onSuccess?: () => void
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
fire(data: Record<string, any>): void;
|
|
279
|
+
|
|
280
|
+
getData(value: Record<string, any>): any;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export class ApiProxy {
|
|
284
|
+
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
interface Query {
|
|
288
|
+
orderBy(field: string, direction: string): Query;
|
|
289
|
+
|
|
290
|
+
where(field: string, operator: string, value: any): Query;
|
|
291
|
+
|
|
292
|
+
// Define other methods as required
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
interface OptionData {
|
|
296
|
+
value: string;
|
|
297
|
+
method?: (query: Query, value: string) => void;
|
|
298
|
+
field?: string;
|
|
299
|
+
operator?: string;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
interface Options {
|
|
303
|
+
[key: string]: OptionData;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Declare the UrlBind class
|
|
307
|
+
export class UrlBind {
|
|
308
|
+
static parse: boolean;
|
|
242
309
|
|
|
243
|
-
|
|
310
|
+
static order(query: Query, options: { value: string }): Query;
|
|
244
311
|
|
|
245
|
-
|
|
312
|
+
static filter(query: Query, options: Options): Query;
|
|
246
313
|
|
|
247
|
-
|
|
248
|
-
}
|
|
314
|
+
static getParams(query: Query, options: Options): Query;
|
|
249
315
|
|
|
250
|
-
|
|
251
|
-
|
|
316
|
+
static urlParse(obj: Record<string, OptionData>): void;
|
|
317
|
+
}
|
|
318
|
+
}
|