typescriptkit
Version:
Basic functionality for TypeScript projects
43 lines (42 loc) • 1.55 kB
TypeScript
/**
* Helper Utility for objects and instances
*/
export declare class ObjectExtensions {
/**
* Check whether an object is null or undefined
* @param object The object to check.
*/
static isNullOrUndefined(object: any): boolean;
/**
* Get all methods attached to an object
* @param object The object to check.
*/
static getAllMethods<TClass extends object>(object: TClass): Array<Function>;
/**
* Get the propertyDecorator for this object
* @param object The object to check.
* @param propertyName The name of the property the decorator is attached to.
* @param descriptorName The name of the descript value where the decorator is attached to.
*/
static getPropertyDecorator<TDecorator extends Object>(object: Object, propertyName: string, descriptorName: string): TDecorator;
}
/**
* Interface to allow extension code completion
*/
export interface Object {
/**
* Check whether an object is null or undefined
*/
isNullOrUndefined(): boolean;
/**
* Get all methods attached to an object
*/
getAllMethods<TClass extends Object>(): Array<Function>;
/**
* Get the propertyDecorator for this object
* @param propertyName The name of the property the decorator is attached to.
* @param descriptorName The name of the descript value where the decorator is attached to.
*/
getPropertyDecorator<TDecorator extends Object>(propertyName: string, descriptorName: string): TDecorator;
}
export default ObjectExtensions;