Files
GDevelop/Extensions/TileMap/helper/dts/render/ResourceCache.d.ts
D8H f871b64011 [TileMap] Collision mask object (#3313)
* The collision mask is read from the tile maps exported by Tiled 1.9+.
* Several collision masks can be used for instance to have platforms and ladders.
* Take a look to the wiki for more details https://wiki.gdevelop.io/gdevelop5/objects/tilemap
2022-07-13 15:12:12 +02:00

28 lines
796 B
TypeScript

/**
* A cache of resources identified by a string.
*
* It ensures that a resource is never load twice.
*/
export declare class ResourceCache<T> {
private _cachedValues;
/**
* Several calls can happen before the resource is loaded.
* This allows to stack them.
*/
private _callbacks;
constructor();
/**
* Return a resource through a call back.
* @param key the resource identifier.
* @param load load the resource in case of cache default.
* Note that the load callback is used by `getOrLoad` and not by the caller.
* @param callback called when the resource is ready.
*/
getOrLoad(
key: string,
load: (callback: (value: T | null) => void) => void,
callback: (value: T | null) => void
): void;
}
//# sourceMappingURL=ResourceCache.d.ts.map