mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Replace knownEvents modules with static strings.
This commit is contained in:
26
data/observable/observable.d.ts
vendored
26
data/observable/observable.d.ts
vendored
@@ -30,20 +30,14 @@ declare module "data/observable" {
|
||||
value: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Known event names.
|
||||
*/
|
||||
module knownEvents {
|
||||
/**
|
||||
* The name of the property changed event.
|
||||
*/
|
||||
export var propertyChange: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Observable is used when you want to be notified when a change occurs. Use on/off methods to add/remove listener.
|
||||
*/
|
||||
class Observable {
|
||||
/**
|
||||
* String value used when hooking to propertyChange event.
|
||||
*/
|
||||
public static propertyChangeEvent: string;
|
||||
|
||||
/**
|
||||
* Creates an Observable instance and sets its properties accroding to the supplied JSON object.
|
||||
@@ -56,14 +50,22 @@ declare module "data/observable" {
|
||||
typeName: string;
|
||||
|
||||
/**
|
||||
* Shortcut alias to the addEventListener method.
|
||||
* A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
|
||||
* @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
|
||||
* @param callback - Callback function which will be executed when event is raised.
|
||||
* @param thisArg - An optional parameter which will be used as `this` context for callback execution.
|
||||
*/
|
||||
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any);
|
||||
|
||||
/**
|
||||
* Raised when a propertyChange occurs.
|
||||
*/
|
||||
on(event: "propertyChange", callback: (data: EventData) => void, thisArg?: any);
|
||||
|
||||
/**
|
||||
* Shortcut alias to the removeEventListener method.
|
||||
*/
|
||||
off(eventNames: string, callback?: any);
|
||||
off(eventNames: string, callback?: any, thisArg?: any);
|
||||
|
||||
/**
|
||||
* Adds a listener for the specified event name.
|
||||
|
||||
Reference in New Issue
Block a user