vasille
Version:
The same framework which is designed to build bulletproof frontends (core library).
29 lines (28 loc) • 738 B
TypeScript
/**
* Interface which describes a value
* @class IValue
*/
export declare abstract class IValue<T> {
/**
* Get the encapsulated value
* @return {*} the encapsulated value
*/
abstract get V(): T;
/**
* Sets the encapsulated value
* @param value {*} value to encapsulate
*/
abstract set V(value: T);
/**
* Add a new handler to value change
* @param handler {function(value : *)} the handler to add
*/
abstract on(handler: (value: T) => void): void;
/**
* Removes a handler of value change
* @param handler {function(value : *)} the handler to remove
*/
abstract off(handler: (value: T) => void): void;
toJSON(): T;
toString(): string;
}