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.base.d.ts
319 lines (237 loc) · 13.3 KB
/
sap.ui.base.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
declare namespace sap.ui.base {
class MetaData {
// Returns an array with the names of all public methods declared by the described class and its ancestors.
getAllPublicMethods();
// Returns the (constructor of the) described class
getClass();
// Returns the fully qualified name of the described class
getName();
// Returns the metadata object of the base class of the described class or null if the class has no (documented) base class.
getParent();
// Returns an array with the names of the public methods declared by the described class.
getPublicMethods();
// Returns whether the described class is abstract
isAbstract();
// Whether the described class is deprecated and should not be used any more
isDeprecated();
// Returns whether the described class is final
isFinal();
// Checks whether the described class or one of its ancestor classes implements the given interface.
isInstanceOf(sInterface);
}
abstract class Object {
//Creates a subclass of class sap.ui.base.Object with name sClassName and enriches it with the information contained in oClassInfo.
static extend(sClassName: string, oClassInfo?, FNMetaImpl?);
// Destructor method for objects
destroy();
// Returns the public interface of the object.
getInterface();
// Returns the metadata for the class that this object belongs to.
getMetadata(): MetaData;
}
abstract class EventProvider extends Object {
// Adds an event registration for the given object and given event name
attachEvent(sEventId, fnFunction, oListener?);
attachEvent(sEventId, oData, fnFunction, oListener?);
// Adds a one time event registration for the given object and given event name.
attachEventOnce(sEventId, fnFunction, oListener?);
attachEventOnce(sEventId, oData, fnFunction, oListener?);
//
destroy();
// Removes an event registration for the given object and given event name.
detachEvent(sEventId, fnFunction, oListener?);
// Fires the given event and notifies all listeners.
fireEvent(sEventId, mParameters?, bAllowPreventDefault?, bEnableEventBubbling?);
// Returns the parent in the eventing hierarchy of this object.
getEventingParent();
// Returns a string representation of this object.
toString();
}
class Event extends Object {
// Cancel bubbling of the event.
cancelBubble();
// Returns the id of the event
getId();
// Returns the value of the parameter with the given sName.
getParameter(sName);
// Returns all parameter values of the event keyed by their names.
getParameters(): sap.m.ViewSettingsItemConfirmEventParameter | sap.m.SelectListItemPressEventParameter | {};
// Returns the source of the event
getSource(): EventProvider;
// Prevent the default action of this event.
preventDefault();
}
interface AggregationBindingInfo {
/*
* the binding path
*/
path: string;
/*
* the template to clone for each item in the aggregation
*/
template: sap.ui.base.ManagedObject;
/*
* , Default: true option to enable that the template will be shared which means that it won't be destroyed or cloned automatically
*/
templateShareable?: boolean;
/*
* the factory function
*/
factory?: any;
/*
* the first entry of the list to be created
*/
startIndex?: number;
/*
* the amount of entries to be created (may exceed the sizelimit of the model)
*/
length?: number;
/*
* the initial sort order (optional)
*/
sorter?: sap.ui.model.Sorter | sap.ui.model.Sorter[];
/*
* the predefined filters for this aggregation (optional)
*/
filters?: sap.ui.model.Filter[];
/*
* a map of parameters which is passed to the binding
*/
parameters?: any;
/*
* a factory function to generate custom group visualization (optional)
*/
groupHeaderFactory?: any;
}
class ManagedObjectMetadata extends MetaData {
}
class ManagedObject extends EventProvider {
/**
* Returns the metadata for the ManagedObject class.
*/
static getMetadata(): ManagedObjectMetadata;
// Adds some entity oObject to the aggregation identified by sAggregationName.
addAggregation(sAggregationName, oObject, bSuppressInvalidate?);
// Adds some object with the ID sId to the association identified by sAssociationName and marks this ManagedObject as changed.
addAssociation(sAssociationName, sId, bSuppressInvalidate?);
// Sets all the properties, aggregations, associations and event handlers as given in the object literal mSettings.
applySettings(mSettings, oScope?);
// Attach event handler fnFunction to the 'formatError' event of this sap.ui.base.ManagedObject.
attachFormatError(fnFunction, oListener?);
attachFormatError(oData, fnFunction, oListener?);
// Attach event handler fnFunction to the 'parseError' event of this sap.ui.base.ManagedObject.
attachParseError(fnFunction, oListener?);
attachParseError(oData, fnFunction, oListener?);
// Attach event handler fnFunction to the 'validationError' event of this sap.ui.base.ManagedObject.
attachValidationError(fnFunction, oListener?);
attachValidationError(oData, fnFunction, oListener?);
// Attach event handler fnFunction to the 'validationSuccess' event of this sap.ui.base.ManagedObject.
attachValidationSuccess(fnFunction, oListener?);
attachValidationSuccess(oData, fnFunction, oListener?);
// Bind an aggregation to the model.
bindAggregation(sName, oBindingInfo: AggregationBindingInfo): ManagedObject;
// Bind the object to the referenced entity in the model, which is used as the binding context to resolve bound properties or aggregations of the object itself and all of its children relatively to the given path.
bindObject(vPath, mParameters?);
// Bind a property to the model.
bindProperty(sName, oBindingInfo);
// Clones a tree of objects starting with the object on which clone is called first (root object).
clone(sIdSuffix?, aLocalIds?, oOptions?);
// Cleans up the resources associated with this object and all its aggregated children.
destroy(bSuppressInvalidate?);
// Destroys (all) the managed object(s) in the aggregation named sAggregationName and empties the aggregation.
destroyAggregation(sAggregationName, bSuppressInvalidate?);
// Detach event handler fnFunction from the 'formatError' event of this sap.ui.base.ManagedObject.
detachFormatError(fnFunction, oListener);
// Detach event handler fnFunction from the 'parseError' event of this sap.ui.base.ManagedObject.
detachParseError(fnFunction, oListener);
// Detach event handler fnFunction from the 'validationError' event of this sap.ui.base.ManagedObject.
detachValidationError(fnFunction, oListener);
// Detach event handler fnFunction from the 'validationSuccess' event of this sap.ui.base.ManagedObject.
detachValidationSuccess(fnFunction, oListener);
// Searches and returns an array of child elements and controls which are referenced within an aggregation or aggregations of child elements/controls.
findAggregatedObjects(bRecursive);
// Fire event formatError to attached listeners.
fireFormatError(mArguments?);
// Fire event parseError to attached listeners.
fireParseError(mArguments?);
// Fire event validationError to attached listeners.
fireValidationError(mArguments?);
// Fire event validationSuccess to attached listeners.
fireValidationSuccess(mArguments?);
// Returns the aggregated object(s) for the named aggregation of this ManagedObject.
getAggregation(sAggregationName, oDefaultForCreation);
// Returns the content of the association wit hthe given name.
getAssociation(sAssociationName, oDefaultForCreation);
// Get the binding object for a specific aggregation/property
getBinding(sName);
// Get the binding context of this object for the given model name.
getBindingContext(sModelName?);
// Returns the binding infos for the given property or aggregation.
getBindingInfo(sName);
// Get the binding path for a specific aggregation/property
getBindingPath(sName);
// Returns the parent managed object as new eventing parent to enable control event bubbling or null if this object hasn't been added to a parent yet.
getEventingParent();
// Returns the object's Id.
getId();
// Returns the metadata for the class that this object belongs to.
getMetadata(): ManagedObjectMetadata;
// Get the model to be used for data bindings with the given model name.
getModel(sName?: string): sap.ui.model.Model;
// Get the object binding object for a specific model
getObjectBinding(sModelName);
// Returns the origin info for the value of the given property.
getOriginInfo(sPropertyName);
// Returns the parent managed object or null if this object hasn't been added to a parent yet.
getParent();
// Returns the value for the property with the given sPropertyName
// Note: This method is a low-level API as described in the class documentation.
getProperty(sPropertyName);
// Check if any model is set to the ManagedObject or to one of its parents (including UIArea and Core).
hasModel();
// Searches for the provided ManagedObject in the named aggregation and returns its 0-based index if found, or -1 otherwise.
indexOfAggregation(sAggregationName, oObject);
// Inserts managed object oObject to the aggregation named sAggregationName at position iIndex.
insertAggregation(sAggregationName, oObject, iIndex, bSuppressInvalidate?);
// This triggers rerendering of itself and its children.
invalidate(): void;
// Find out whether a property or aggregation is bound
isBound(sName);
// Returns whether rerendering is currently suppressed on this ManagedObject
isInvalidateSuppressed();
// This method is used internally and should only be overridden by a tree managed object which utilizes the tree binding.
isTreeBinding(sName);
// Generic method which is called, whenever messages for this object exists.
propagateMessages(sName, aMessages);
// Removes an object from the aggregation named sAggregationName with cardinality 0.
removeAggregation(sAggregationName, vObject, bSuppressInvalidate?);
// Removes all objects from the 0.
removeAllAggregation(sAggregationName, bSuppressInvalidate?);
// Removes all the objects in the 0.
removeAllAssociation(sAssociationName, bSuppressInvalidate?);
// Removes a ManagedObject from the association named sAssociationName.
removeAssociation(sAssociationName, vObject, bSuppressInvalidate?);
// Sets a new object in the named 0.
setAggregation(sAggregationName, oObject, bSuppressInvalidate?);
// Sets the associatied object for the given managed association of cardinality '0.
setAssociation(sAssociationName, sId, bSuppressInvalidate?);
// Set the binding context for this ManagedObject for the model with the given name.
setBindingContext(oContext, sModelName?);
// Sets or unsets a model for the given model name for this ManagedObject.
setModel(oModel: sap.ui.model.Model, sName?: string);
// Sets the given value for the given property after validating and normalizing it, marks this object as changed.
setProperty(sPropertyName, oValue, bSuppressInvalidate?);
// Returns a simple string representation of this managed object.
toString();
// Unbind the aggregation from the model
unbindAggregation(sName, bSuppressReset);
// Removes the defined binding context of this object, all bindings will now resolve relative to the parent context again.
unbindObject(sModelName?);
// Unbind the property from the model
unbindProperty(sName, bSuppressReset);
// Checks whether the given value is of the proper type for the given aggregation name.
validateAggregation(sAggregationName, oObject, bMultiple);
// Checks whether the given value is of the proper type for the given property name.
validateProperty(sPropertyName, oValue);
}
}