@fi4f/hg 0.0.6 → 0.0.8
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/core/asset.d.ts +28 -69
- package/dist/core/asset.d.ts.map +1 -1
- package/dist/core/asset.js +42 -162
- package/dist/core/asset.js.map +1 -1
- package/dist/core/cache.d.ts +58 -0
- package/dist/core/cache.d.ts.map +1 -0
- package/dist/core/cache.js +151 -0
- package/dist/core/cache.js.map +1 -0
- package/package.json +1 -1
package/dist/core/asset.d.ts
CHANGED
|
@@ -1,52 +1,34 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare const AUDIO: "audio";
|
|
3
|
-
export declare const TEXT: "text";
|
|
4
|
-
export declare const BLOB: "blob";
|
|
5
|
-
export declare const JSON: "json";
|
|
6
|
-
export type IMAGE = typeof IMAGE;
|
|
7
|
-
export type AUDIO = typeof AUDIO;
|
|
8
|
-
export type TEXT = typeof TEXT;
|
|
9
|
-
export type BLOB = typeof BLOB;
|
|
10
|
-
export type JSON = typeof JSON;
|
|
11
|
-
export type Kind = IMAGE | AUDIO | TEXT | BLOB | JSON;
|
|
12
|
-
export type Asset<T extends Kind> = {
|
|
1
|
+
export type Asset<T extends Asset.Kind> = {
|
|
13
2
|
kind: T;
|
|
14
3
|
path: string;
|
|
15
4
|
id?: string | undefined;
|
|
16
5
|
};
|
|
17
6
|
export declare namespace Asset {
|
|
7
|
+
type IMAGE = typeof IMAGE;
|
|
8
|
+
type AUDIO = typeof AUDIO;
|
|
9
|
+
type TEXT = typeof TEXT;
|
|
10
|
+
type BLOB = typeof BLOB;
|
|
11
|
+
type JSON = typeof JSON;
|
|
12
|
+
type Kind = Asset.IMAGE | Asset.AUDIO | Asset.TEXT | Asset.BLOB | Asset.JSON;
|
|
18
13
|
type Image = Asset<IMAGE>;
|
|
19
14
|
type Audio = Asset<AUDIO>;
|
|
20
15
|
type Text = Asset<TEXT>;
|
|
21
16
|
type Blob = Asset<BLOB>;
|
|
22
17
|
type Json = Asset<JSON>;
|
|
18
|
+
type Bundle = Array<Asset<any>>;
|
|
23
19
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
audios: {
|
|
30
|
-
[id: string]: HTMLAudioElement;
|
|
31
|
-
};
|
|
32
|
-
texts: {
|
|
33
|
-
[id: string]: string;
|
|
34
|
-
};
|
|
35
|
-
blobs: {
|
|
36
|
-
[id: string]: globalThis.Blob;
|
|
37
|
-
};
|
|
38
|
-
jsons: {
|
|
39
|
-
[id: string]: any;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export declare function load(a: Asset<any>): Promise<any>;
|
|
43
|
-
export declare function loadImage(a: Asset.Image): Promise<HTMLImageElement>;
|
|
44
|
-
export declare function loadAudio(a: Asset.Audio): Promise<HTMLAudioElement>;
|
|
45
|
-
export declare function loadText(a: Asset.Text): Promise<string>;
|
|
46
|
-
export declare function loadBlob(a: Asset.Blob): Promise<Blob>;
|
|
47
|
-
export declare function loadJson(a: Asset.Json): Promise<any>;
|
|
20
|
+
declare const IMAGE: "image";
|
|
21
|
+
declare const AUDIO: "audio";
|
|
22
|
+
declare const TEXT: "text";
|
|
23
|
+
declare const BLOB: "blob";
|
|
24
|
+
declare const JSON: "json";
|
|
48
25
|
export declare const Asset: {
|
|
49
|
-
"
|
|
26
|
+
IMAGE: "image";
|
|
27
|
+
AUDIO: "audio";
|
|
28
|
+
TEXT: "text";
|
|
29
|
+
BLOB: "blob";
|
|
30
|
+
JSON: "json";
|
|
31
|
+
"new"<T extends Asset.Kind>(kind: T, path: string, id?: string): {
|
|
50
32
|
kind: T;
|
|
51
33
|
path: string;
|
|
52
34
|
id: string | undefined;
|
|
@@ -76,37 +58,14 @@ export declare const Asset: {
|
|
|
76
58
|
path: string;
|
|
77
59
|
id: string | undefined;
|
|
78
60
|
};
|
|
61
|
+
Bundle(...a: Array<Asset<any>>): Asset<any>[];
|
|
62
|
+
load(a: Asset<any>): Promise<any>;
|
|
63
|
+
loadImage(a: Asset.Image): Promise<HTMLImageElement>;
|
|
64
|
+
loadAudio(a: Asset.Audio): Promise<HTMLAudioElement>;
|
|
65
|
+
loadText(a: Asset.Text): Promise<string>;
|
|
66
|
+
loadBlob(a: Asset.Blob): Promise<Blob>;
|
|
67
|
+
loadJson(a: Asset.Json): Promise<any>;
|
|
68
|
+
loadAll(a: Array<Asset<any>>): Promise<any[]>;
|
|
79
69
|
};
|
|
80
|
-
export
|
|
81
|
-
"new"(): {
|
|
82
|
-
images: {};
|
|
83
|
-
audios: {};
|
|
84
|
-
texts: {};
|
|
85
|
-
blobs: {};
|
|
86
|
-
jsons: {};
|
|
87
|
-
};
|
|
88
|
-
getImage(cache: Cache, id: string): HTMLImageElement | undefined;
|
|
89
|
-
getAudio(cache: Cache, id: string): HTMLAudioElement | undefined;
|
|
90
|
-
getText(cache: Cache, id: string): string | undefined;
|
|
91
|
-
getBlob(cache: Cache, id: string): Blob | undefined;
|
|
92
|
-
getJson(cache: Cache, id: string): any;
|
|
93
|
-
putImage(cache: Cache, id: string, image: HTMLImageElement): HTMLImageElement;
|
|
94
|
-
putAudio(cache: Cache, id: string, audio: HTMLAudioElement): HTMLAudioElement;
|
|
95
|
-
putText(cache: Cache, id: string, text: string): string;
|
|
96
|
-
putBlob(cache: Cache, id: string, blob: Blob): Blob;
|
|
97
|
-
putJson(cache: Cache, id: string, json: any): any;
|
|
98
|
-
freeImage(cache: Cache, id: string): void;
|
|
99
|
-
freeAudio(cache: Cache, id: string): void;
|
|
100
|
-
freeText(cache: Cache, id: string): void;
|
|
101
|
-
freeBlob(cache: Cache, id: string): void;
|
|
102
|
-
freeJson(cache: Cache, id: string): void;
|
|
103
|
-
freeAll(cache: Cache): void;
|
|
104
|
-
load(cache: Cache, a: Asset<any>): Promise<string>;
|
|
105
|
-
loadImage(cache: Cache, a: Asset.Image): Promise<string>;
|
|
106
|
-
loadAudio(cache: Cache, a: Asset.Audio): Promise<string>;
|
|
107
|
-
loadText(cache: Cache, a: Asset.Text): Promise<string>;
|
|
108
|
-
loadBlob(cache: Cache, a: Asset.Blob): Promise<string>;
|
|
109
|
-
loadJson(cache: Cache, a: Asset.Json): Promise<string>;
|
|
110
|
-
loadAll(cache: Cache, a: Array<Asset<any>>): Promise<string[]>;
|
|
111
|
-
};
|
|
70
|
+
export {};
|
|
112
71
|
//# sourceMappingURL=asset.d.ts.map
|
package/dist/core/asset.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../src/core/asset.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../src/core/asset.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,KAAK,CAAC,IAAI,IAAI;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAA;AAE7F,yBAAiB,KAAK,CAAC;IACrB,KAAY,KAAK,GAAG,OAAO,KAAK,CAAC;IACjC,KAAY,KAAK,GAAG,OAAO,KAAK,CAAC;IACjC,KAAY,IAAI,GAAI,OAAO,IAAI,CAAE;IACjC,KAAY,IAAI,GAAI,OAAO,IAAI,CAAE;IACjC,KAAY,IAAI,GAAI,OAAO,IAAI,CAAE;IAEjC,KAAY,IAAI,GACZ,KAAK,CAAC,KAAK,GACX,KAAK,CAAC,KAAK,GACX,KAAK,CAAC,IAAI,GACV,KAAK,CAAC,IAAI,GACV,KAAK,CAAC,IAAI,CAAA;IAEd,KAAY,KAAK,GAAI,KAAK,CAAC,KAAK,CAAC,CAAA;IACjC,KAAY,KAAK,GAAI,KAAK,CAAC,KAAK,CAAC,CAAA;IACjC,KAAY,IAAI,GAAK,KAAK,CAAC,IAAI,CAAE,CAAA;IACjC,KAAY,IAAI,GAAK,KAAK,CAAC,IAAI,CAAE,CAAA;IACjC,KAAY,IAAI,GAAK,KAAK,CAAC,IAAI,CAAE,CAAA;IACjC,KAAY,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;CACvC;AAED,QAAA,MAAM,KAAK,EAAG,OAAgB,CAAC;AAC/B,QAAA,MAAM,KAAK,EAAG,OAAgB,CAAC;AAC/B,QAAA,MAAM,IAAI,EAAI,MAAgB,CAAC;AAC/B,QAAA,MAAM,IAAI,EAAI,MAAgB,CAAC;AAC/B,QAAA,MAAM,IAAI,EAAI,MAAgB,CAAC;AAE/B,eAAO,MAAM,KAAK;;;;;;UAGZ,CAAC,SAAS,KAAK,CAAC,IAAI,QAAQ,CAAC,QAAQ,MAAM,OAAQ,MAAM;;;;;gBAIjD,MAAM,OAAQ,MAAM;;;;;gBAIpB,MAAM,OAAQ,MAAM;;;;;eAIrB,MAAM,OAAQ,MAAM;;;;;eAIpB,MAAM,OAAQ,MAAM;;;;;eAIpB,MAAM,OAAQ,MAAM;;;;;iBAIlB,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAItB,KAAK,CAAC,GAAG,CAAC;iBAWL,KAAK,CAAC,KAAK;iBASX,KAAK,CAAC,KAAK;gBASN,KAAK,CAAC,IAAI;gBAIV,KAAK,CAAC,IAAI;gBAIV,KAAK,CAAC,IAAI;eAIjB,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;CAG7B,CAAA"}
|
package/dist/core/asset.js
CHANGED
|
@@ -1,44 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export function load(a) {
|
|
7
|
-
switch (a.kind) {
|
|
8
|
-
case IMAGE: return loadImage(a);
|
|
9
|
-
case AUDIO: return loadAudio(a);
|
|
10
|
-
case TEXT: return loadText(a);
|
|
11
|
-
case BLOB: return loadBlob(a);
|
|
12
|
-
case JSON: return loadJson(a);
|
|
13
|
-
default: throw `[Asset.load]: Unknown kind of asset '${a.kind}'`;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export function loadImage(a) {
|
|
17
|
-
return new Promise((res, rej) => {
|
|
18
|
-
const image = new Image();
|
|
19
|
-
image.onload = () => res(image);
|
|
20
|
-
image.onerror = () => rej();
|
|
21
|
-
image.src = a.path;
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
export function loadAudio(a) {
|
|
25
|
-
return new Promise((res, rej) => {
|
|
26
|
-
const audio = new Audio();
|
|
27
|
-
audio.onload = () => res(audio);
|
|
28
|
-
audio.onerror = () => rej();
|
|
29
|
-
audio.src = a.path;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
export async function loadText(a) {
|
|
33
|
-
return fetch(a.path).then(res => res.text());
|
|
34
|
-
}
|
|
35
|
-
export async function loadBlob(a) {
|
|
36
|
-
return fetch(a.path).then(res => res.blob());
|
|
37
|
-
}
|
|
38
|
-
export async function loadJson(a) {
|
|
39
|
-
return fetch(a.path).then(res => res.json());
|
|
40
|
-
}
|
|
1
|
+
const IMAGE = "image";
|
|
2
|
+
const AUDIO = "audio";
|
|
3
|
+
const TEXT = "text";
|
|
4
|
+
const BLOB = "blob";
|
|
5
|
+
const JSON = "json";
|
|
41
6
|
export const Asset = {
|
|
7
|
+
IMAGE, AUDIO, TEXT, BLOB, JSON,
|
|
42
8
|
new(kind, path, id) {
|
|
43
9
|
return { kind, path, id };
|
|
44
10
|
},
|
|
@@ -57,132 +23,46 @@ export const Asset = {
|
|
|
57
23
|
Json(path, id) {
|
|
58
24
|
return Asset.new(JSON, path, id);
|
|
59
25
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
new() {
|
|
63
|
-
return {
|
|
64
|
-
images: {},
|
|
65
|
-
audios: {},
|
|
66
|
-
texts: {},
|
|
67
|
-
blobs: {},
|
|
68
|
-
jsons: {},
|
|
69
|
-
};
|
|
70
|
-
},
|
|
71
|
-
getImage(cache, id) {
|
|
72
|
-
if (!(id in cache.images))
|
|
73
|
-
throw `[Cache.getImage]: Image with id '${id}' does not exist`;
|
|
74
|
-
return cache.images[id];
|
|
75
|
-
},
|
|
76
|
-
getAudio(cache, id) {
|
|
77
|
-
if (!(id in cache.audios))
|
|
78
|
-
throw `[Cache.getAudio]: Audio with id '${id}' does not exist`;
|
|
79
|
-
return cache.audios[id];
|
|
80
|
-
},
|
|
81
|
-
getText(cache, id) {
|
|
82
|
-
if (!(id in cache.texts))
|
|
83
|
-
throw `[Cache.getText]: Text with id '${id}' does not exist`;
|
|
84
|
-
return cache.texts[id];
|
|
85
|
-
},
|
|
86
|
-
getBlob(cache, id) {
|
|
87
|
-
if (!(id in cache.blobs))
|
|
88
|
-
throw `[Cache.getBlob]: Blob with id '${id}' does not exist`;
|
|
89
|
-
return cache.blobs[id];
|
|
90
|
-
},
|
|
91
|
-
getJson(cache, id) {
|
|
92
|
-
if (!(id in cache.jsons))
|
|
93
|
-
throw `[Cache.getJson]: Json with id '${id}' does not exist`;
|
|
94
|
-
return cache.jsons[id];
|
|
95
|
-
},
|
|
96
|
-
putImage(cache, id, image) {
|
|
97
|
-
if (id in cache.images)
|
|
98
|
-
console.warn(`[Cache.putImage]: Image with id '${id}' already exists`);
|
|
99
|
-
return cache.images[id] = image;
|
|
100
|
-
},
|
|
101
|
-
putAudio(cache, id, audio) {
|
|
102
|
-
if (id in cache.audios)
|
|
103
|
-
console.warn(`[Cache.putAudio]: Audio with id '${id}' already exists`);
|
|
104
|
-
return cache.audios[id] = audio;
|
|
105
|
-
},
|
|
106
|
-
putText(cache, id, text) {
|
|
107
|
-
if (id in cache.texts)
|
|
108
|
-
console.warn(`[Cache.putText]: Text with id '${id}' already exists`);
|
|
109
|
-
return cache.texts[id] = text;
|
|
110
|
-
},
|
|
111
|
-
putBlob(cache, id, blob) {
|
|
112
|
-
if (id in cache.blobs)
|
|
113
|
-
console.warn(`[Cache.putBlob]: Blob with id '${id}' already exists`);
|
|
114
|
-
return cache.blobs[id] = blob;
|
|
115
|
-
},
|
|
116
|
-
putJson(cache, id, json) {
|
|
117
|
-
if (id in cache.jsons)
|
|
118
|
-
console.warn(`[Cache.putJson]: Json with id '${id}' already exists`);
|
|
119
|
-
return cache.jsons[id] = json;
|
|
26
|
+
Bundle(...a) {
|
|
27
|
+
return a;
|
|
120
28
|
},
|
|
121
|
-
|
|
122
|
-
delete cache.images[id];
|
|
123
|
-
},
|
|
124
|
-
freeAudio(cache, id) {
|
|
125
|
-
delete cache.audios[id];
|
|
126
|
-
},
|
|
127
|
-
freeText(cache, id) {
|
|
128
|
-
delete cache.texts[id];
|
|
129
|
-
},
|
|
130
|
-
freeBlob(cache, id) {
|
|
131
|
-
delete cache.blobs[id];
|
|
132
|
-
},
|
|
133
|
-
freeJson(cache, id) {
|
|
134
|
-
delete cache.jsons[id];
|
|
135
|
-
},
|
|
136
|
-
freeAll(cache) {
|
|
137
|
-
cache.images = {};
|
|
138
|
-
cache.audios = {};
|
|
139
|
-
cache.texts = {};
|
|
140
|
-
cache.blobs = {};
|
|
141
|
-
cache.jsons = {};
|
|
142
|
-
},
|
|
143
|
-
load(cache, a) {
|
|
29
|
+
load(a) {
|
|
144
30
|
switch (a.kind) {
|
|
145
|
-
case IMAGE: return
|
|
146
|
-
case AUDIO: return
|
|
147
|
-
case TEXT: return
|
|
148
|
-
case BLOB: return
|
|
149
|
-
case JSON: return
|
|
150
|
-
default: throw `[
|
|
31
|
+
case IMAGE: return Asset.loadImage(a);
|
|
32
|
+
case AUDIO: return Asset.loadAudio(a);
|
|
33
|
+
case TEXT: return Asset.loadText(a);
|
|
34
|
+
case BLOB: return Asset.loadBlob(a);
|
|
35
|
+
case JSON: return Asset.loadJson(a);
|
|
36
|
+
default: throw `[Asset.load]: Unknown kind of asset '${a.kind}'`;
|
|
151
37
|
}
|
|
152
38
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
return Promise.all(a.map(a =>
|
|
39
|
+
loadImage(a) {
|
|
40
|
+
return new Promise((res, rej) => {
|
|
41
|
+
const image = new Image();
|
|
42
|
+
image.onload = () => res(image);
|
|
43
|
+
image.onerror = () => rej();
|
|
44
|
+
image.src = a.path;
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
loadAudio(a) {
|
|
48
|
+
return new Promise((res, rej) => {
|
|
49
|
+
const audio = new Audio();
|
|
50
|
+
audio.onload = () => res(audio);
|
|
51
|
+
audio.onerror = () => rej();
|
|
52
|
+
audio.src = a.path;
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
async loadText(a) {
|
|
56
|
+
return fetch(a.path).then(res => res.text());
|
|
57
|
+
},
|
|
58
|
+
async loadBlob(a) {
|
|
59
|
+
return fetch(a.path).then(res => res.blob());
|
|
60
|
+
},
|
|
61
|
+
async loadJson(a) {
|
|
62
|
+
return fetch(a.path).then(res => res.json());
|
|
63
|
+
},
|
|
64
|
+
loadAll(a) {
|
|
65
|
+
return Promise.all(a.map(a => Asset.load(a)));
|
|
180
66
|
}
|
|
181
67
|
};
|
|
182
|
-
function uniqueId(ids) {
|
|
183
|
-
let id = crypto.randomUUID();
|
|
184
|
-
while (id in ids)
|
|
185
|
-
id = crypto.randomUUID();
|
|
186
|
-
return id;
|
|
187
|
-
}
|
|
188
68
|
//# sourceMappingURL=asset.js.map
|
package/dist/core/asset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.js","sourceRoot":"","sources":["../../src/core/asset.ts"],"names":[],"mappings":"
|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,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,CAAa;QAC1B,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAA;IAC9C,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,CAAa;QAC1B,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAA;IAC9C,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,CAAa;QAC1B,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAA;IAC9C,CAAC;IAED,OAAO,CAAC,CAAoB;QAC1B,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Asset } from "./asset.js";
|
|
2
|
+
export type Cache = {
|
|
3
|
+
images: {
|
|
4
|
+
[id: string]: HTMLImageElement;
|
|
5
|
+
};
|
|
6
|
+
audios: {
|
|
7
|
+
[id: string]: HTMLAudioElement;
|
|
8
|
+
};
|
|
9
|
+
texts: {
|
|
10
|
+
[id: string]: string;
|
|
11
|
+
};
|
|
12
|
+
blobs: {
|
|
13
|
+
[id: string]: Blob;
|
|
14
|
+
};
|
|
15
|
+
jsons: {
|
|
16
|
+
[id: string]: any;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const Cache: {
|
|
20
|
+
"new"(): {
|
|
21
|
+
images: {};
|
|
22
|
+
audios: {};
|
|
23
|
+
texts: {};
|
|
24
|
+
blobs: {};
|
|
25
|
+
jsons: {};
|
|
26
|
+
};
|
|
27
|
+
getImage(cache: Cache, id: string): HTMLImageElement | undefined;
|
|
28
|
+
getAudio(cache: Cache, id: string): HTMLAudioElement | undefined;
|
|
29
|
+
getText(cache: Cache, id: string): string | undefined;
|
|
30
|
+
getBlob(cache: Cache, id: string): Blob | undefined;
|
|
31
|
+
getJson(cache: Cache, id: string): any;
|
|
32
|
+
putImage(cache: Cache, id: string, image: HTMLImageElement): HTMLImageElement;
|
|
33
|
+
putAudio(cache: Cache, id: string, audio: HTMLAudioElement): HTMLAudioElement;
|
|
34
|
+
putText(cache: Cache, id: string, text: string): string;
|
|
35
|
+
putBlob(cache: Cache, id: string, blob: Blob): Blob;
|
|
36
|
+
putJson(cache: Cache, id: string, json: any): any;
|
|
37
|
+
freeImage(cache: Cache, id: string): void;
|
|
38
|
+
freeAudio(cache: Cache, id: string): void;
|
|
39
|
+
freeText(cache: Cache, id: string): void;
|
|
40
|
+
freeBlob(cache: Cache, id: string): void;
|
|
41
|
+
freeJson(cache: Cache, id: string): void;
|
|
42
|
+
freeAll(cache: Cache): void;
|
|
43
|
+
load(cache: Cache, a: Asset<any>): Promise<string>;
|
|
44
|
+
loadImage(cache: Cache, a: Asset.Image): Promise<string>;
|
|
45
|
+
loadAudio(cache: Cache, a: Asset.Audio): Promise<string>;
|
|
46
|
+
loadText(cache: Cache, a: Asset.Text): Promise<string>;
|
|
47
|
+
loadBlob(cache: Cache, a: Asset.Blob): Promise<string>;
|
|
48
|
+
loadJson(cache: Cache, a: Asset.Json): Promise<string>;
|
|
49
|
+
loadAll(cache: Cache, a: Array<Asset<any>>): Promise<string[]>;
|
|
50
|
+
};
|
|
51
|
+
export declare function load(a: Asset<any>): Promise<string>;
|
|
52
|
+
export declare function loadImage(a: Asset.Image): Promise<string>;
|
|
53
|
+
export declare function loadAudio(a: Asset.Audio): Promise<string>;
|
|
54
|
+
export declare function loadText(a: Asset.Text): Promise<string>;
|
|
55
|
+
export declare function loadBlob(a: Asset.Blob): Promise<string>;
|
|
56
|
+
export declare function loadJson(a: Asset.Json): Promise<string>;
|
|
57
|
+
export declare function loadAll(a: Array<Asset<any>>): Promise<string[]>;
|
|
58
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/core/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,MAAM,KAAK,GAAG;IAClB,MAAM,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,CAAA;KAAE,CAAA;IAC1C,MAAM,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,CAAA;KAAE,CAAA;IAC1C,KAAK,EAAG;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;KAAY,CAAA;IAC1C,KAAK,EAAG;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;KAAc,CAAA;IAC1C,KAAK,EAAG;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,GAAG,CAAA;KAAe,CAAA;CAC3C,CAAA;AAED,eAAO,MAAM,KAAK;;;;;;;;oBAYA,KAAK,MAAM,MAAM;oBAMjB,KAAK,MAAM,MAAM;mBAMlB,KAAK,MAAM,MAAM;mBAMjB,KAAK,MAAM,MAAM;mBAMjB,KAAK,MAAM,MAAM;oBAMhB,KAAK,MAAM,MAAM,SAAS,gBAAgB;oBAM1C,KAAK,MAAM,MAAM,SAAS,gBAAgB;mBAM3C,KAAK,MAAM,MAAM,QAAQ,MAAM;mBAM/B,KAAK,MAAM,MAAM,QAAQ,IAAI;mBAM7B,KAAK,MAAM,MAAM,QAAQ,GAAG;qBAM1B,KAAK,MAAM,MAAM;qBAIjB,KAAK,MAAM,MAAM;oBAIlB,KAAK,MAAM,MAAM;oBAIjB,KAAK,MAAM,MAAM;oBAIjB,KAAK,MAAM,MAAM;mBAIlB,KAAK;gBAQR,KAAK,KAAK,KAAK,CAAC,GAAG,CAAC;qBAWT,KAAK,KAAK,KAAK,CAAC,KAAK;qBAMrB,KAAK,KAAK,KAAK,CAAC,KAAK;oBAMtB,KAAK,KAAK,KAAK,CAAC,IAAI;oBAMpB,KAAK,KAAK,KAAK,CAAC,IAAI;oBAMpB,KAAK,KAAK,KAAK,CAAC,IAAI;mBAMrB,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;CAGjD,CAAA;AAWD,wBAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,mBAEjC;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,mBAEvC;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,mBAEvC;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,mBAErC;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,mBAErC;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,mBAErC;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,qBAE3C"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { Asset } from "./asset.js";
|
|
2
|
+
export const Cache = {
|
|
3
|
+
new() {
|
|
4
|
+
return {
|
|
5
|
+
images: {},
|
|
6
|
+
audios: {},
|
|
7
|
+
texts: {},
|
|
8
|
+
blobs: {},
|
|
9
|
+
jsons: {},
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
getImage(cache, id) {
|
|
13
|
+
if (!(id in cache.images))
|
|
14
|
+
throw `[Cache.getImage]: Image with id '${id}' does not exist`;
|
|
15
|
+
return cache.images[id];
|
|
16
|
+
},
|
|
17
|
+
getAudio(cache, id) {
|
|
18
|
+
if (!(id in cache.audios))
|
|
19
|
+
throw `[Cache.getAudio]: Audio with id '${id}' does not exist`;
|
|
20
|
+
return cache.audios[id];
|
|
21
|
+
},
|
|
22
|
+
getText(cache, id) {
|
|
23
|
+
if (!(id in cache.texts))
|
|
24
|
+
throw `[Cache.getText]: Text with id '${id}' does not exist`;
|
|
25
|
+
return cache.texts[id];
|
|
26
|
+
},
|
|
27
|
+
getBlob(cache, id) {
|
|
28
|
+
if (!(id in cache.blobs))
|
|
29
|
+
throw `[Cache.getBlob]: Blob with id '${id}' does not exist`;
|
|
30
|
+
return cache.blobs[id];
|
|
31
|
+
},
|
|
32
|
+
getJson(cache, id) {
|
|
33
|
+
if (!(id in cache.jsons))
|
|
34
|
+
throw `[Cache.getJson]: Json with id '${id}' does not exist`;
|
|
35
|
+
return cache.jsons[id];
|
|
36
|
+
},
|
|
37
|
+
putImage(cache, id, image) {
|
|
38
|
+
if (id in cache.images)
|
|
39
|
+
console.warn(`[Cache.putImage]: Image with id '${id}' already exists`);
|
|
40
|
+
return cache.images[id] = image;
|
|
41
|
+
},
|
|
42
|
+
putAudio(cache, id, audio) {
|
|
43
|
+
if (id in cache.audios)
|
|
44
|
+
console.warn(`[Cache.putAudio]: Audio with id '${id}' already exists`);
|
|
45
|
+
return cache.audios[id] = audio;
|
|
46
|
+
},
|
|
47
|
+
putText(cache, id, text) {
|
|
48
|
+
if (id in cache.texts)
|
|
49
|
+
console.warn(`[Cache.putText]: Text with id '${id}' already exists`);
|
|
50
|
+
return cache.texts[id] = text;
|
|
51
|
+
},
|
|
52
|
+
putBlob(cache, id, blob) {
|
|
53
|
+
if (id in cache.blobs)
|
|
54
|
+
console.warn(`[Cache.putBlob]: Blob with id '${id}' already exists`);
|
|
55
|
+
return cache.blobs[id] = blob;
|
|
56
|
+
},
|
|
57
|
+
putJson(cache, id, json) {
|
|
58
|
+
if (id in cache.jsons)
|
|
59
|
+
console.warn(`[Cache.putJson]: Json with id '${id}' already exists`);
|
|
60
|
+
return cache.jsons[id] = json;
|
|
61
|
+
},
|
|
62
|
+
freeImage(cache, id) {
|
|
63
|
+
delete cache.images[id];
|
|
64
|
+
},
|
|
65
|
+
freeAudio(cache, id) {
|
|
66
|
+
delete cache.audios[id];
|
|
67
|
+
},
|
|
68
|
+
freeText(cache, id) {
|
|
69
|
+
delete cache.texts[id];
|
|
70
|
+
},
|
|
71
|
+
freeBlob(cache, id) {
|
|
72
|
+
delete cache.blobs[id];
|
|
73
|
+
},
|
|
74
|
+
freeJson(cache, id) {
|
|
75
|
+
delete cache.jsons[id];
|
|
76
|
+
},
|
|
77
|
+
freeAll(cache) {
|
|
78
|
+
cache.images = {};
|
|
79
|
+
cache.audios = {};
|
|
80
|
+
cache.texts = {};
|
|
81
|
+
cache.blobs = {};
|
|
82
|
+
cache.jsons = {};
|
|
83
|
+
},
|
|
84
|
+
load(cache, a) {
|
|
85
|
+
switch (a.kind) {
|
|
86
|
+
case Asset.IMAGE: return Cache.loadImage(cache, a);
|
|
87
|
+
case Asset.AUDIO: return Cache.loadAudio(cache, a);
|
|
88
|
+
case Asset.TEXT: return Cache.loadText(cache, a);
|
|
89
|
+
case Asset.BLOB: return Cache.loadBlob(cache, a);
|
|
90
|
+
case Asset.JSON: return Cache.loadJson(cache, a);
|
|
91
|
+
default: throw `[Cache.load]: Unknown kind of asset '${a.kind}'`;
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
async loadImage(cache, a) {
|
|
95
|
+
const id = a.id ?? uniqueId(cache.images);
|
|
96
|
+
Cache.putImage(cache, id, await Asset.loadImage(a));
|
|
97
|
+
return id;
|
|
98
|
+
},
|
|
99
|
+
async loadAudio(cache, a) {
|
|
100
|
+
const id = a.id ?? uniqueId(cache.audios);
|
|
101
|
+
Cache.putAudio(cache, id, await Asset.loadAudio(a));
|
|
102
|
+
return id;
|
|
103
|
+
},
|
|
104
|
+
async loadText(cache, a) {
|
|
105
|
+
const id = a.id ?? uniqueId(cache.texts);
|
|
106
|
+
Cache.putText(cache, id, await Asset.loadText(a));
|
|
107
|
+
return id;
|
|
108
|
+
},
|
|
109
|
+
async loadBlob(cache, a) {
|
|
110
|
+
const id = a.id ?? uniqueId(cache.blobs);
|
|
111
|
+
Cache.putBlob(cache, id, await Asset.loadBlob(a));
|
|
112
|
+
return id;
|
|
113
|
+
},
|
|
114
|
+
async loadJson(cache, a) {
|
|
115
|
+
const id = a.id ?? uniqueId(cache.jsons);
|
|
116
|
+
Cache.putJson(cache, id, await Asset.loadJson(a));
|
|
117
|
+
return id;
|
|
118
|
+
},
|
|
119
|
+
async loadAll(cache, a) {
|
|
120
|
+
return Promise.all(a.map(a => Cache.load(cache, a)));
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
function uniqueId(ids) {
|
|
124
|
+
let id = crypto.randomUUID();
|
|
125
|
+
while (id in ids)
|
|
126
|
+
id = crypto.randomUUID();
|
|
127
|
+
return id;
|
|
128
|
+
}
|
|
129
|
+
const CACHE = Cache.new();
|
|
130
|
+
export function load(a) {
|
|
131
|
+
return Cache.load(CACHE, a);
|
|
132
|
+
}
|
|
133
|
+
export function loadImage(a) {
|
|
134
|
+
return Cache.loadImage(CACHE, a);
|
|
135
|
+
}
|
|
136
|
+
export function loadAudio(a) {
|
|
137
|
+
return Cache.loadAudio(CACHE, a);
|
|
138
|
+
}
|
|
139
|
+
export function loadText(a) {
|
|
140
|
+
return Cache.loadText(CACHE, a);
|
|
141
|
+
}
|
|
142
|
+
export function loadBlob(a) {
|
|
143
|
+
return Cache.loadBlob(CACHE, a);
|
|
144
|
+
}
|
|
145
|
+
export function loadJson(a) {
|
|
146
|
+
return Cache.loadJson(CACHE, a);
|
|
147
|
+
}
|
|
148
|
+
export function loadAll(a) {
|
|
149
|
+
return Cache.loadAll(CACHE, a);
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":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