This repository has been archived by the owner on Nov 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsap.ui.model.d.ts
416 lines (314 loc) · 16.2 KB
/
sap.ui.model.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
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
declare namespace sap.ui.model {
class Filter { }
class Model extends sap.ui.core.message.MessageProcessor {
/**
* Attach event-handler fnFunction to the 'parseError' event of this sap.ui.moel.Model.
*/
attachParseError(fnFunction, oListener?);
attachParseError(oData, fnFunction, oListener?);
/**
* Attach event-handler fnFunction to the 'requestCompleted' event of this sap.ui.moel.Model.
*/
attachRequestCompleted(fnFunction, oListener?);
attachRequestCompleted(oData, fnFunction, oListener?);
/**
* Attach event-handler fnFunction to the 'requestFailed' event of this sap.ui.moel.Model.
*/
attachRequestFailed(fnFunction, oListener?);
attachRequestFailed(oData, fnFunction, oListener?);
/**
* Attach event-handler fnFunction to the 'requestSent' event of this sap.ui.moel.Model.
*/
attachRequestSent(fnFunction, oListener?);
attachRequestSent(oData, fnFunction, oListener?);
/**
* Create ContxtBinding
*/
bindContext(sPath, oContext?, mParameters?, oEvents?);
/**
* Implement in inheritig classes
*/
bindList(sPath, oContext?, aSorters?, aFilters?, mParameters?);
/**
* Implement in inheritig classes
*/
bindProperty(sPath, oContext?, mParameters?);
/**
* Implement in inheritig classes
*/
bindTree(sPath, oContext?, aFilters?, mParameters?);
/**
* Implement in inheritig classes
*/
createBindingContext(sPath, oContext?, mParameters?, fnCallBack?, bReload?);
/**
* Destroys the model and clears the model data.
*/
destroy();
/**
* Implement in inheritig classes
*/
destroyBindingContext(oContext);
/**
* Detach event-handler fnFunction from the 'parseError' event of this sap.ui.moel.Model.
*/
detachParseError(fnFunction, oListener);
/**
* Detach event-handler fnFunction from the 'requestCompleted' event of this sap.ui.moel.Model.
*/
detachRequestCompleted(fnFunction, oListener);
/**
* Detach event-handler fnFunction from the 'requestFailed' event of this sap.ui.moel.Model.
*/
detachRequestFailed(fnFunction, oListener);
/**
* Detach event-handler fnFunction from the 'requestSent' event of this sap.ui.moel.Model.
*/
detachRequestSent(fnFunction, oListener);
/**
* Fire event parseError to attached isteners.
*/
fireParseError(mArguments?);
/**
* Fire event requestCompleted to attached isteners.
*/
fireRequestCompleted(mArguments?);
/**
* Fire event requestFailed to attached isteners.
*/
fireRequestFailed(mArguments?);
/**
* Fire event requestSent to attached isteners.
*/
fireRequestSent(mArguments?);
/**
* Get the default binding mode forthe model
*/
getDefaultBindingMode();
/**
* Get message for path
*/
getMessagesByPath(sPath);
/**
* Returns the meta model associated with this model if it is available for the concrete mdel type.
*/
getMetaModel();
/**
* Implement in inheritig classes
*/
getObject(sPath, oContext?);
/**
* Returns the original value for the property with the given path an context.
*/
getOriginalProperty(sPath, oContext?);
/**
* Implement in inheritig classes
*/
getProperty(sPath, oContext?);
/**
* Check if the specified binding mode is supported by he model.
*/
isBindingModeSupported(sMode);
/**
* Returns whether legacy path syntx is used
*/
isLegacySyntax();
/**
* Refresh he model.
*/
refresh(bForceUpdate);
/**
* Set the default binding mode for he model.
*/
setDefaultBindingMode(sMode);
/**
* Enables legacy path syntax handling
* This defines, whether relative bindings, which do not have a defined binding context, should be compatible to earlier releases which means they are resolved relative to the root element or handled strict and stay unresolved until a bindng context is set
*/
setLegacySyntax(bLegacySyntax);
/**
* Set messages
*/
setMessages(mMessages);
/**
* Set the maximum number of entries which are used for for listbindings.
*/
setSizeLimit(iSizeLimit);
}
class Sorter {
constructor(sPath: string, bDescending: boolean, vGroup: boolean | ((any) => any));
constructor(sPath: string, vGroup: boolean | ((any) => any));
}
class ClientModel extends Model {
/**
*
*/
destroy();
/**
* Force no caching.
*/
forceNoCache(bForceNoCache?);
/**
* Returns the current data of the model.
*/
getData();
/**
* update all bindings
*/
updateBindings(bForceUpdate);
}
namespace json {
class JSONModel extends sap.ui.model.ClientModel {
/**
* @param oData either the URL where to load the JSON from or a JS object
*/
constructor(oData);
// Serializes the current JSON data of the model into a string.
getJSON();
// Returns the value for the property with the given sPropertyName
getProperty(sPath, oContext?);
// Load JSON-encoded data from the server using a GET HTTP request and store the resulting JSON data in the model.
loadData(sURL, oParameters?, bAsync?, sType?, bMerge?, bCache?, mHeaders?);
// Sets the JSON encoded data to the model.
setData(oData, bMerge?);
// Sets the JSON encoded string data to the model.
setJSON(sJSONText, bMerge?);
// Sets a new value for the given property sPropertyName in the model.
setProperty(sPath, oValue, oContext?, bAsyncUpdate?): boolean;
}
}
namespace odata {
namespace v2 {
class ODataModel extends sap.ui.model.Model {
constructor(sServiceUrl?: string, mParameters?);
// Adds (a) new URL(s) to the be parsed for OData annotations, which are then merged into the annotations object which can be retrieved by calling the getServiceAnnotations()-method.
addAnnotationUrl(vUrl);
// Adds new xml content to be parsed for OData annotations, which are then merged into the annotations object which can be retrieved by calling the getServiceAnnotations()-method.
addAnnotationXML(sXMLContent, bSuppressEvents?);
// Attach event-handler fnFunction to the 'annotationsFailed' event of this sap.ui.model.odata.v2.ODataModel.
attachAnnotationsFailed(fnFunction, oListener?);
attachAnnotationsFailed(oData, fnFunction, oListener?);
// Attach event-handler fnFunction to the 'annotationsLoaded' event of this sap.ui.model.odata.v2.ODataModel.
attachAnnotationsLoaded(fnFunction, oListener?);
attachAnnotationsLoaded(oData, fnFunction, oListener?);
// Attach event-handler fnFunction to the 'batchRequestCompleted' event of this sap.ui.model.odata.v2.ODataModel.
attachBatchRequestCompleted(fnFunction, oListener?);
attachBatchRequestCompleted(oData, fnFunction, oListener?);
// Attach event-handler fnFunction to the 'batchRequestFailed' event of this sap.ui.model.odata.v2.ODataModel.
attachBatchRequestFailed(fnFunction, oListener?);
attachBatchRequestFailed(oData, fnFunction, oListener?);
// Attach event-handler fnFunction to the 'requestSent' event of this sap.ui.model.odata.v2.ODataModel.
attachBatchRequestSent(fnFunction, oListener?);
attachBatchRequestSent(oData, fnFunction, oListener?);
// Attach event-handler fnFunction to the 'metadataFailed' event of this sap.ui.model.odata.v2.ODataModel.
attachMetadataFailed(fnFunction, oListener?);
attachMetadataFailed(oData, fnFunction, oListener?);
// Attach event-handler fnFunction to the 'metadataLoaded' event of this sap.ui.model.odata.v2.ODataModel.
attachMetadataLoaded(fnFunction, oListener?);
attachMetadataLoaded(oData, fnFunction, oListener?);
// Trigger a request to the function import odata service that was specified in the model constructor.
callFunction(sFunctionName, mParameters?);
// Trigger a POST request to the odata service that was specified in the model constructor.
create(sPath, oData, mParameters?);
// Creates a binding context for the given path If the data of the context is not yet available, it can not be created, but first the entity needs to be fetched from the server asynchronously.
createBindingContext(sPath, oContext?, mParameters?, fnCallBack?, bReload?);
// Creates a new entry object which is described by the metadata of the entity type of the specified sPath Name.
createEntry(sPath, mParameters);
// Creates the key from the given collection name and property map.
createKey(sCollection, oKeyProperties);
// Deletes a created entry from the request queue and the model.
deleteCreatedEntry(oContext);
//
destroy();
// Detach event-handler fnFunction from the 'annotationsFailed' event of this sap.ui.model.odata.v2.ODataModel.
detachAnnotationsFailed(fnFunction, oListener);
// Detach event-handler fnFunction from the 'annotationsLoaded' event of this sap.ui.model.odata.v2.ODataModel.
detachAnnotationsLoaded(fnFunction, oListener);
// Detach event-handler fnFunction from the 'batchRequestCompleted' event of this sap.ui.model.odata.v2.ODataModel.
detachBatchRequestCompleted(fnFunction, oListener);
// Detach event-handler fnFunction from the 'batchRequestFailed' event of this sap.ui.model.odata.v2.ODataModel.
detachBatchRequestFailed(fnFunction, oListener);
// Detach event-handler fnFunction from the 'batchRequestSent' event of this sap.ui.model.odata.v2.ODataModel.
detachBatchRequestSent(fnFunction, oListener);
// Detach event-handler fnFunction from the 'metadataFailed' event of this sap.ui.model.odata.v2.ODataModel.
detachMetadataFailed(fnFunction, oListener);
// Detach event-handler fnFunction from the 'metadataLoaded' event of this sap.ui.model.odata.v2.ODataModel.
detachMetadataLoaded(fnFunction, oListener);
// Fire event annotationsFailed to attached listeners.
fireAnnotationsFailed(mArguments?);
// Fire event annotationsLoaded to attached listeners.
fireAnnotationsLoaded(mArguments?);
// Fire event batchRequestCompleted to attached listeners.
fireBatchRequestCompleted(mArguments);
// Fire event batchRequestFailed to attached listeners.
fireBatchRequestFailed(mArguments);
// Fire event batchRequestSent to attached listeners.
fireBatchRequestSent(mArguments?);
// Fire event metadataFailed to attached listeners.
fireMetadataFailed(mArguments?);
// Fire event metadataLoaded to attached listeners.
fireMetadataLoaded(mArguments?);
// Returns the definition of batchGroups per EntityType for TwoWay changes
getChangeBatchGroups();
// Returns the default count mode for retrieving the count of collections
getDefaultCountMode();
// Returns the array of batchGroupIds that are set as deferred
getDeferredBatchGroups();
// Returns the ETag for a given binding path/context or data object
getETag(sPath?, oContext?, oEntity?);
// Returns all headers and custom headers which are stored in the OData model.
getHeaders();
// Returns the key part from the entry URI or the given context or object
getKey(oObject);
// Returns an instance of an OData meta model which offers a unified access to both OData v2 meta data and v4 annotations.
getMetaModel();
// Returns the value for the property with the given sPath
getProperty(sPath, oContext?, bIncludeExpandEntries?);
// Returns the current security token.
getSecurityToken();
// Return the annotation object.
getServiceAnnotations();
// Return the parsed XML metadata as a Javascript object.
getServiceMetadata();
// Checks if there exist pending changes in the model created by the setProperty method.
hasPendingChanges();
// Returns a promise for the loaded state of the metadata.
metadataLoaded();
// Trigger a GET request to the odata service that was specified in the model constructor.
read(sPath, mParameters?);
// Refresh the model.
refresh(bForceUpdate?, bRemoveData?, sBatchGroupId?);
// Refreshes the metadata for model, e.g.
refreshMetadata();
// refresh XSRF token by performing a GET request against the service root URL.
refreshSecurityToken(fnSuccess?, fnError?);
// Trigger a DELETE request to the odata service that was specified in the model constructor.
remove(sPath, mParameters?);
// Resets the collected changes by the setProperty method.
resetChanges(aKeys?);
// Definition of batchGroups per EntityType for "TwoWay" changes
setChangeBatchGroups(mGroups);
// Sets the default way to retrieve the count of collections in this model.
setDefaultCountMode(sCountMode);
// Setting batch groups as deferred.
setDeferredBatchGroups(aGroupIds);
// Set custom headers which are provided in a key/value map.
setHeaders(mHeaders);
// Sets a new value for the given property sPropertyName in the model.
setProperty(sPath, oValue, oContext?, bAsyncUpdate?);
// Enable/Disable automatic updates of all Bindings after change operations
setRefreshAfterChange(bRefreshAfterChange);
// Enable/Disable XCSRF-Token handling
setTokenHandlingEnabled(bTokenHandling?);
//
setUseBatch(bUseBatch?);
// Submits the collected changes which were collected by the setProperty method.
submitChanges(mParameters?);
// Trigger a PUT/MERGE request to the odata service that was specified in the model constructor.
update(sPath, oData, mParameters?);
// update all bindings
updateBindings(bForceUpdate?);
}
}
}
}