lik/dist/lik.objectmap.d.ts

41 lines
847 B
TypeScript
Raw Normal View History

export interface IObjectmapForEachFunction<T> {
(itemArg: T): void;
2016-07-31 12:36:28 +00:00
}
export interface IObjectmapFindFunction<T> {
(itemArg: T): boolean;
}
2016-07-30 22:54:46 +00:00
/**
* allows keeping track of objects
*/
export declare class Objectmap<T> {
2016-07-30 22:54:46 +00:00
private objectArray;
2016-08-07 16:08:52 +00:00
/**
* returns a new instance
*/
constructor();
2016-07-31 12:36:28 +00:00
/**
* add object to Objectmap
*/
add(objectArg: T): void;
2016-07-31 12:36:28 +00:00
/**
* remove object from Objectmap
*/
remove(objectArg: T): void;
2016-07-31 12:36:28 +00:00
/**
* check if object is in Objectmap
*/
checkForObject(objectArg: T): boolean;
/**
* find object
*/
find(findFunction: IObjectmapFindFunction<T>): T;
2016-07-31 12:36:28 +00:00
/**
* run function for each item in Objectmap
*/
forEach(functionArg: IObjectmapForEachFunction<T>): void;
2016-07-31 12:36:28 +00:00
/**
* wipe Objectmap
*/
2016-07-30 22:54:46 +00:00
wipe(): void;
}