@maptiler/weather
Version:
Weather layers for MapTiler Cloud and MapTiler SDK
33 lines (32 loc) • 759 B
TypeScript
declare class InstancePool<T> {
private allInstances;
private availableInstances;
/**
* Add an instance to the pool
* @param obj
* @param isAvailable make it available when true (default: false)
* @returns
*/
add(obj: T, isAvailable?: boolean): T;
/**
* Check if there are still available instances in the pool.
* @returns
*/
isEmpty(): boolean;
/**
* Pops one instance from the pool.
* @throw when the pool of available instances is empty. Use `.isEmpty()` to test.
* @returns
*
*/
pop(): T;
/**
* Make all the instances available again
*/
init(): void;
/**
* Remove all elements
*/
reset(): void;
}
export { InstancePool };