narraleaf-react 0.41.2 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/game/nlcore/action/actionTypes.d.ts +2 -2
- package/dist/game/nlcore/elements/sound.d.ts +7 -1
- package/dist/game/nlcore/elements/type.d.ts +12 -0
- package/dist/game/nlcore/gameTypes.d.ts +15 -0
- package/dist/game/player/elements/preload/preloadPlan.d.ts +14 -2
- package/dist/game/player/lib/AudioManager.d.ts +11 -2
- package/dist/game/player/lib/ImageCacheManager.d.ts +10 -1
- package/dist/main.js +34 -34
- package/dist/util/data.d.ts +15 -1
- package/package.json +1 -1
package/dist/util/data.d.ts
CHANGED
|
@@ -245,7 +245,21 @@ export type ExcludeEach<T extends string[][], Excluded> = T extends [infer First
|
|
|
245
245
|
export type FlexibleTuple<T extends any[]> = T extends [infer First, ...infer Rest] ? Rest extends any[] ? [First, ...FlexibleTuple<Rest>] | FlexibleTuple<Rest> : [First] : [];
|
|
246
246
|
export declare function moveElement<T>(arr: T[], element: T, direction: "up" | "down" | "top" | "bottom"): T[];
|
|
247
247
|
export declare function moveElementInArray<T>(arr: T[], element: T, newIndex: number): T[];
|
|
248
|
-
|
|
248
|
+
/**
|
|
249
|
+
* Fetch `src` and hand back a URL for the same bytes that an `<img>` can be pointed at.
|
|
250
|
+
*
|
|
251
|
+
* An object URL rather than a data URL, which is what this used to produce. A data URL costs a
|
|
252
|
+
* base64 encode of the whole file (about a third larger than the bytes), keeps that string alive
|
|
253
|
+
* for as long as the cache holds the entry, and makes the browser decode the base64 back to bytes
|
|
254
|
+
* before it can decode the image. An object URL is a handle to the blob that is already in memory:
|
|
255
|
+
* no encode, no string, and the decode reads the bytes directly. Measured over a 241 MB image
|
|
256
|
+
* library, the whole fetch-and-decode pass drops by about a third.
|
|
257
|
+
*
|
|
258
|
+
* The caller owns the URL and MUST call {@link URL.revokeObjectURL} when it stops using it -
|
|
259
|
+
* an object URL pins its blob for the lifetime of the document otherwise. {@link ImageCacheManager}
|
|
260
|
+
* is the only caller and revokes on every path that drops an entry.
|
|
261
|
+
*/
|
|
262
|
+
export declare function getImageObjectUrl(src: string, options?: RequestInit): Promise<string>;
|
|
249
263
|
export declare class TaskPool {
|
|
250
264
|
private readonly concurrency;
|
|
251
265
|
private readonly delay;
|