tiny-essentials 1.29.1 → 1.29.2
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/changelog/1/29/2.md +82 -0
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyFetchLoader.min.js +1 -0
- package/dist/v1/TinyImageLoader.min.js +1 -0
- package/dist/v1/TinyMediaCache.min.js +1 -0
- package/dist/v1/TinyMediaLoader.min.js +1 -0
- package/dist/v1/basics/index.cjs +5 -0
- package/dist/v1/basics/index.d.mts +2 -1
- package/dist/v1/basics/index.d.mts.map +1 -1
- package/dist/v1/basics/index.mjs +2 -1
- package/dist/v1/basics/media/youtube.cjs +275 -0
- package/dist/v1/basics/media/youtube.d.mts +107 -0
- package/dist/v1/basics/media/youtube.d.mts.map +1 -0
- package/dist/v1/basics/media/youtube.mjs +214 -0
- package/dist/v1/index.cjs +13 -0
- package/dist/v1/index.d.mts +6 -1
- package/dist/v1/index.d.mts.map +1 -1
- package/dist/v1/index.mjs +7 -2
- package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.cjs +0 -1
- package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.d.mts +0 -1
- package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.d.mts.map +1 -1
- package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.mjs +0 -1
- package/dist/v1/libs/fs/plugins/OPFS/index.cjs +0 -8
- package/dist/v1/libs/fs/plugins/OPFS/index.d.mts +0 -8
- package/dist/v1/libs/fs/plugins/OPFS/index.d.mts.map +1 -1
- package/dist/v1/libs/fs/plugins/OPFS/index.mjs +0 -8
- package/dist/v1/libs/html/TinyHtml.cjs +1 -1
- package/dist/v1/libs/html/TinyHtml.d.mts +2 -2
- package/dist/v1/libs/html/TinyHtml.d.mts.map +1 -1
- package/dist/v1/libs/html/TinyHtml.mjs +1 -1
- package/dist/v1/libs/html/loader/TinyMediaLoader.cjs +1999 -0
- package/dist/v1/libs/html/loader/TinyMediaLoader.d.mts +999 -0
- package/dist/v1/libs/html/loader/TinyMediaLoader.d.mts.map +1 -0
- package/dist/v1/libs/html/loader/TinyMediaLoader.mjs +1852 -0
- package/dist/v1/libs/html/loader/beta/formats/TinyAudioLoader.cjs +77 -0
- package/dist/v1/libs/html/loader/beta/formats/TinyAudioLoader.d.mts +103 -0
- package/dist/v1/libs/html/loader/beta/formats/TinyAudioLoader.d.mts.map +1 -0
- package/dist/v1/libs/html/loader/beta/formats/TinyAudioLoader.mjs +67 -0
- package/dist/v1/libs/html/loader/beta/formats/TinyContentLoader.cjs +630 -0
- package/dist/v1/libs/html/loader/beta/formats/TinyContentLoader.d.mts +138 -0
- package/dist/v1/libs/html/loader/beta/formats/TinyContentLoader.d.mts.map +1 -0
- package/dist/v1/libs/html/loader/beta/formats/TinyContentLoader.mjs +576 -0
- package/dist/v1/libs/html/loader/beta/formats/TinyVideoLoader.cjs +70 -0
- package/dist/v1/libs/html/loader/beta/formats/TinyVideoLoader.d.mts +100 -0
- package/dist/v1/libs/html/loader/beta/formats/TinyVideoLoader.d.mts.map +1 -0
- package/dist/v1/libs/html/loader/beta/formats/TinyVideoLoader.mjs +60 -0
- package/dist/v1/libs/html/loader/beta/probe/TinyMediaProbe.cjs +946 -0
- package/dist/v1/libs/html/loader/beta/probe/TinyMediaProbe.d.mts +67 -0
- package/dist/v1/libs/html/loader/beta/probe/TinyMediaProbe.d.mts.map +1 -0
- package/dist/v1/libs/html/loader/beta/probe/TinyMediaProbe.mjs +896 -0
- package/dist/v1/libs/html/loader/formats/TinyFetchLoader.cjs +225 -0
- package/dist/v1/libs/html/loader/formats/TinyFetchLoader.d.mts +149 -0
- package/dist/v1/libs/html/loader/formats/TinyFetchLoader.d.mts.map +1 -0
- package/dist/v1/libs/html/loader/formats/TinyFetchLoader.mjs +197 -0
- package/dist/v1/libs/html/loader/formats/TinyImageLoader.cjs +1454 -0
- package/dist/v1/libs/html/loader/formats/TinyImageLoader.d.mts +200 -0
- package/dist/v1/libs/html/loader/formats/TinyImageLoader.d.mts.map +1 -0
- package/dist/v1/libs/html/loader/formats/TinyImageLoader.mjs +1317 -0
- package/dist/v1/libs/html/loader/probe/TinyImageProbe.cjs +668 -0
- package/dist/v1/libs/html/loader/probe/TinyImageProbe.d.mts +83 -0
- package/dist/v1/libs/html/loader/probe/TinyImageProbe.d.mts.map +1 -0
- package/dist/v1/libs/html/loader/probe/TinyImageProbe.mjs +626 -0
- package/dist/v1/libs/html/loader/utils/TinyBufferReader.cjs +277 -0
- package/dist/v1/libs/html/loader/utils/TinyBufferReader.d.mts +118 -0
- package/dist/v1/libs/html/loader/utils/TinyBufferReader.d.mts.map +1 -0
- package/dist/v1/libs/html/loader/utils/TinyBufferReader.mjs +247 -0
- package/dist/v1/libs/html/loader/utils/TinyIsoBox.cjs +128 -0
- package/dist/v1/libs/html/loader/utils/TinyIsoBox.d.mts +49 -0
- package/dist/v1/libs/html/loader/utils/TinyIsoBox.d.mts.map +1 -0
- package/dist/v1/libs/html/loader/utils/TinyIsoBox.mjs +116 -0
- package/dist/v1/libs/html/loader/utils/TinyMediaCache.cjs +796 -0
- package/dist/v1/libs/html/loader/utils/TinyMediaCache.d.mts +354 -0
- package/dist/v1/libs/html/loader/utils/TinyMediaCache.d.mts.map +1 -0
- package/dist/v1/libs/html/loader/utils/TinyMediaCache.mjs +734 -0
- package/dist/v1/libs/html/loader/utils/TinyMediaMirror.cjs +302 -0
- package/dist/v1/libs/html/loader/utils/TinyMediaMirror.d.mts +256 -0
- package/dist/v1/libs/html/loader/utils/TinyMediaMirror.d.mts.map +1 -0
- package/dist/v1/libs/html/loader/utils/TinyMediaMirror.mjs +280 -0
- package/dist/v1/libs/html/loader/utils/TinyMediaProgress.cjs +194 -0
- package/dist/v1/libs/html/loader/utils/TinyMediaProgress.d.mts +138 -0
- package/dist/v1/libs/html/loader/utils/TinyMediaProgress.d.mts.map +1 -0
- package/dist/v1/libs/html/loader/utils/TinyMediaProgress.mjs +175 -0
- package/dist/v1/libs/tools/TinyPkgExportValidator.cjs +359 -55
- package/dist/v1/libs/tools/TinyPkgExportValidator.d.mts +64 -6
- package/dist/v1/libs/tools/TinyPkgExportValidator.d.mts.map +1 -1
- package/dist/v1/libs/tools/TinyPkgExportValidator.mjs +320 -57
- package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.cjs +0 -1
- package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.d.mts +0 -1
- package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.d.mts.map +1 -1
- package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.mjs +0 -1
- package/dist/v1/webTemplates/bootstrap/5.3/scss/background/_background-grid.scss +15 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/components/buttons/_buttons-contrast.scss +208 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/components/buttons/_buttons-ghost.scss +89 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/components/icon/_cube-icon.scss +65 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/components/icon/_sphere-pulse.scss +39 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_badges.scss +90 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_bootstrap-overrides.scss +495 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_buttons.scss +390 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_colors.scss +213 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_effects.scss +153 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_forms-tones.scss +69 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_forms.scss +323 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_global.scss +31 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_links.scss +47 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_tables.scss +25 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_theme.scss +21 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_tokens.scss +161 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_utilities.scss +81 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/_variables.scss +63 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/plugins/_form-tone-mixins.scss +236 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/plugins/_sizing.scss +68 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/plugins/_tone-mixins.scss +392 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/plugins/_typography.scss +112 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/plugins/background/_tiny_gradient_1.scss +131 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/themes/deepstrap/plugins/colors/_pink.scss +47 -0
- package/docs/v1/Exports.md +33 -2
- package/docs/v1/README.md +9 -0
- package/docs/v1/basics/youtube.md +204 -0
- package/docs/v1/libs/html/loader/TinyFetchLoader.md +114 -0
- package/docs/v1/libs/html/loader/TinyImageLoader.md +141 -0
- package/docs/v1/libs/html/loader/TinyMediaCache.md +166 -0
- package/docs/v1/libs/html/loader/TinyMediaLoader.md +300 -0
- package/docs/v1/libs/tools/TinyPkgExportValidator.md +55 -0
- package/docs/v1/webTemplates/bootstrap/5.3/DeepStrap.md +177 -0
- package/package.json +244 -8
- /package/dist/v1/webTemplates/bootstrap/5.3/scss/input/{Placeholder-Colors-Fix.scss → _placeholder-colors-fix.scss} +0 -0
- /package/dist/v1/webTemplates/bootstrap/5.3/scss/spacing/{Spacing-Plus.scss → _spacing-plus.scss} +0 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Shared memory cache for media blobs and object URLs.
|
|
3
|
+
* Instances are tracked statically so a blob survives until the last cache
|
|
4
|
+
* releases it, which prevents revoking an object URL that another part of the
|
|
5
|
+
* application is still rendering.
|
|
6
|
+
*/
|
|
7
|
+
export type MediaCacheStrategy = 'auto' | 'manual' | 'ttl';
|
|
8
|
+
export type MediaCacheOptions = {
|
|
9
|
+
/**
|
|
10
|
+
* - Maximum number of entries (Infinity by default).
|
|
11
|
+
*/
|
|
12
|
+
maxItems?: number;
|
|
13
|
+
/**
|
|
14
|
+
* - Maximum cache size in bytes (Infinity by default).
|
|
15
|
+
*/
|
|
16
|
+
maxBytes?: number;
|
|
17
|
+
/**
|
|
18
|
+
* - Entry lifetime in milliseconds (0 = never expires).
|
|
19
|
+
*/
|
|
20
|
+
ttl?: number;
|
|
21
|
+
/**
|
|
22
|
+
* - Cleanup strategy at zero references.
|
|
23
|
+
*/
|
|
24
|
+
strategy?: MediaCacheStrategy;
|
|
25
|
+
/**
|
|
26
|
+
* - Whether the query string is ignored when building keys.
|
|
27
|
+
*/
|
|
28
|
+
ignoreSearch?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* - Interval in milliseconds for active TTL sweeping (0 = disabled).
|
|
31
|
+
*/
|
|
32
|
+
sweepInterval?: number;
|
|
33
|
+
};
|
|
34
|
+
export type MediaCacheEntry = {
|
|
35
|
+
/**
|
|
36
|
+
* - The normalized cache key.
|
|
37
|
+
*/
|
|
38
|
+
key: string;
|
|
39
|
+
/**
|
|
40
|
+
* - The original URL.
|
|
41
|
+
*/
|
|
42
|
+
url: string;
|
|
43
|
+
/**
|
|
44
|
+
* - The cached blob.
|
|
45
|
+
*/
|
|
46
|
+
blob: Blob;
|
|
47
|
+
/**
|
|
48
|
+
* - The shared object URL.
|
|
49
|
+
*/
|
|
50
|
+
objectUrl: string;
|
|
51
|
+
/**
|
|
52
|
+
* - The blob size in bytes.
|
|
53
|
+
*/
|
|
54
|
+
size: number;
|
|
55
|
+
/**
|
|
56
|
+
* - The blob MIME type.
|
|
57
|
+
*/
|
|
58
|
+
type: string;
|
|
59
|
+
/**
|
|
60
|
+
* - The number of active consumers.
|
|
61
|
+
*/
|
|
62
|
+
refs: number;
|
|
63
|
+
/**
|
|
64
|
+
* - The epoch timestamp when the entry was created.
|
|
65
|
+
*/
|
|
66
|
+
createdAt: number;
|
|
67
|
+
/**
|
|
68
|
+
* - The epoch timestamp of the last access.
|
|
69
|
+
*/
|
|
70
|
+
lastAccess: number;
|
|
71
|
+
/**
|
|
72
|
+
* - The epoch timestamp when the entry expires (0 = never).
|
|
73
|
+
*/
|
|
74
|
+
expiresAt: number;
|
|
75
|
+
/**
|
|
76
|
+
* - Whether the entry is protected from eviction.
|
|
77
|
+
*/
|
|
78
|
+
pinned: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* - The key of the entry that owns this one, or null.
|
|
81
|
+
*/
|
|
82
|
+
parent: string | null;
|
|
83
|
+
/**
|
|
84
|
+
* - The probe metadata captured with the blob.
|
|
85
|
+
*/
|
|
86
|
+
metadata: Record<string, any>;
|
|
87
|
+
};
|
|
88
|
+
export type MediaCacheStats = {
|
|
89
|
+
/**
|
|
90
|
+
* - The number of entries in this cache.
|
|
91
|
+
*/
|
|
92
|
+
size: number;
|
|
93
|
+
/**
|
|
94
|
+
* - The total size in bytes held by this cache.
|
|
95
|
+
*/
|
|
96
|
+
bytes: number;
|
|
97
|
+
/**
|
|
98
|
+
* - The total number of active references.
|
|
99
|
+
*/
|
|
100
|
+
refs: number;
|
|
101
|
+
/**
|
|
102
|
+
* - The number of successful lookups.
|
|
103
|
+
*/
|
|
104
|
+
hits: number;
|
|
105
|
+
/**
|
|
106
|
+
* - The number of failed lookups.
|
|
107
|
+
*/
|
|
108
|
+
misses: number;
|
|
109
|
+
/**
|
|
110
|
+
* - The number of evicted entries.
|
|
111
|
+
*/
|
|
112
|
+
evictions: number;
|
|
113
|
+
/**
|
|
114
|
+
* - The number of entries that currently own at least one child.
|
|
115
|
+
*/
|
|
116
|
+
links: number;
|
|
117
|
+
/**
|
|
118
|
+
* - The number of live cache instances.
|
|
119
|
+
*/
|
|
120
|
+
instances: number;
|
|
121
|
+
/**
|
|
122
|
+
* - The number of blobs in the shared registry.
|
|
123
|
+
*/
|
|
124
|
+
blobs: number;
|
|
125
|
+
};
|
|
126
|
+
export type MediaCacheRecord = {
|
|
127
|
+
/**
|
|
128
|
+
* - The shared object URL.
|
|
129
|
+
*/
|
|
130
|
+
objectUrl: string;
|
|
131
|
+
/**
|
|
132
|
+
* - The number of cache instances holding the key.
|
|
133
|
+
*/
|
|
134
|
+
refs: number;
|
|
135
|
+
/**
|
|
136
|
+
* - The blob size in bytes.
|
|
137
|
+
*/
|
|
138
|
+
size: number;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Memory cache shared by every media loader.
|
|
142
|
+
*/
|
|
143
|
+
declare class TinyMediaCache {
|
|
144
|
+
#private;
|
|
145
|
+
/**
|
|
146
|
+
* Cleanup strategies applied when an entry reaches zero references.
|
|
147
|
+
*/
|
|
148
|
+
static Strategy: Readonly<{
|
|
149
|
+
AUTO: "auto";
|
|
150
|
+
MANUAL: "manual";
|
|
151
|
+
TTL: "ttl";
|
|
152
|
+
}>;
|
|
153
|
+
/**
|
|
154
|
+
* The number of failed lookups recorded by this cache.
|
|
155
|
+
* @returns {number} The current miss count.
|
|
156
|
+
*/
|
|
157
|
+
get misses(): number;
|
|
158
|
+
/**
|
|
159
|
+
* Whether the query string is ignored when building cache keys.
|
|
160
|
+
* @returns {boolean} True when the query string is ignored.
|
|
161
|
+
*/
|
|
162
|
+
get ignoreSearch(): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* The cleanup strategy applied when an entry reaches zero references.
|
|
165
|
+
* @returns {MediaCacheStrategy} The active cleanup strategy used by the cache.
|
|
166
|
+
*/
|
|
167
|
+
get strategy(): MediaCacheStrategy;
|
|
168
|
+
/**
|
|
169
|
+
* The entry lifetime in milliseconds.
|
|
170
|
+
* @returns {number} The entry lifetime in milliseconds (0 = never expires).
|
|
171
|
+
*/
|
|
172
|
+
get ttl(): number;
|
|
173
|
+
/**
|
|
174
|
+
* The maximum number of entries allowed in this cache.
|
|
175
|
+
* @returns {number} The maximum number of entries.
|
|
176
|
+
*/
|
|
177
|
+
get maxItems(): number;
|
|
178
|
+
/**
|
|
179
|
+
* The maximum size in bytes allowed in this cache.
|
|
180
|
+
* @returns {number} The maximum size in bytes.
|
|
181
|
+
*/
|
|
182
|
+
get maxBytes(): number;
|
|
183
|
+
/**
|
|
184
|
+
* The number of entries evicted by the limit enforcement.
|
|
185
|
+
* @returns {number} The current eviction count.
|
|
186
|
+
*/
|
|
187
|
+
get evictions(): number;
|
|
188
|
+
/**
|
|
189
|
+
* @param {MediaCacheOptions} [options] - The cache configuration.
|
|
190
|
+
* @throws {TypeError} If `options` is not a plain object.
|
|
191
|
+
* @throws {RangeError} If `maxItems` is not a positive number.
|
|
192
|
+
* @throws {RangeError} If `maxBytes` is not a positive number.
|
|
193
|
+
* @throws {RangeError} If `ttl` is not a positive number.
|
|
194
|
+
* @throws {TypeError} If `strategy` is not a known strategy.
|
|
195
|
+
* @throws {TypeError} If `ignoreSearch` is not a boolean.
|
|
196
|
+
* @throws {RangeError} If `sweepInterval` is not a positive number.
|
|
197
|
+
*/
|
|
198
|
+
constructor(options?: MediaCacheOptions);
|
|
199
|
+
/**
|
|
200
|
+
* A read-only snapshot of the shared blob registry.
|
|
201
|
+
* @returns {Array<{ key: string, objectUrl: string, refs: number, size: number }>} One record per cached blob.
|
|
202
|
+
*/
|
|
203
|
+
static get registry(): Array<{
|
|
204
|
+
key: string;
|
|
205
|
+
objectUrl: string;
|
|
206
|
+
refs: number;
|
|
207
|
+
size: number;
|
|
208
|
+
}>;
|
|
209
|
+
/**
|
|
210
|
+
* Every live cache instance.
|
|
211
|
+
* @returns {TinyMediaCache[]}
|
|
212
|
+
*/
|
|
213
|
+
static get instances(): TinyMediaCache[];
|
|
214
|
+
/**
|
|
215
|
+
* The number of blobs held by the shared registry.
|
|
216
|
+
* @returns {number}
|
|
217
|
+
*/
|
|
218
|
+
static get size(): number;
|
|
219
|
+
/**
|
|
220
|
+
* The total number of bytes held by the shared registry.
|
|
221
|
+
* @returns {number}
|
|
222
|
+
*/
|
|
223
|
+
static get bytes(): number;
|
|
224
|
+
/**
|
|
225
|
+
* Checks the shared registry without touching any instance.
|
|
226
|
+
* @param {string} url - The media URL.
|
|
227
|
+
* @param {boolean} [ignoreSearch] - Whether the query string is ignored.
|
|
228
|
+
* @returns {boolean}
|
|
229
|
+
*/
|
|
230
|
+
static has(url: string, ignoreSearch?: boolean): boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Revokes every object URL in the shared registry.
|
|
233
|
+
* @returns {void}
|
|
234
|
+
*/
|
|
235
|
+
static clear(): void;
|
|
236
|
+
/**
|
|
237
|
+
* Destroys every live cache instance.
|
|
238
|
+
* @returns {void}
|
|
239
|
+
*/
|
|
240
|
+
static destroyAll(): void;
|
|
241
|
+
/**
|
|
242
|
+
* The number of entries currently stored in this cache instance.
|
|
243
|
+
* @returns {number} The number of entries in this cache.
|
|
244
|
+
*/
|
|
245
|
+
get size(): number;
|
|
246
|
+
/**
|
|
247
|
+
* The number of children's currently stored in this cache instance.
|
|
248
|
+
* @returns {number} The number of children's in this cache.
|
|
249
|
+
*/
|
|
250
|
+
get links(): number;
|
|
251
|
+
/**
|
|
252
|
+
* @returns {number} The total size in bytes held by this cache.
|
|
253
|
+
*/
|
|
254
|
+
get bytes(): number;
|
|
255
|
+
/**
|
|
256
|
+
* Indicates whether the cache instance has been destroyed.
|
|
257
|
+
* @returns {boolean} True if the cache was destroyed, false otherwise.
|
|
258
|
+
*/
|
|
259
|
+
get destroyed(): boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Returns a snapshot of the cache's internal performance counters.
|
|
262
|
+
* @returns {MediaCacheStats} A snapshot of the cache counters.
|
|
263
|
+
*/
|
|
264
|
+
get stats(): MediaCacheStats;
|
|
265
|
+
/**
|
|
266
|
+
* A read-only snapshot of every entry held by this cache.
|
|
267
|
+
* @returns {MediaCacheEntry[]} A shallow copy of the entries.
|
|
268
|
+
*/
|
|
269
|
+
entries(): MediaCacheEntry[];
|
|
270
|
+
/**
|
|
271
|
+
* Stores a blob and returns its entry.
|
|
272
|
+
* @param {string} url - The media URL.
|
|
273
|
+
* @param {Blob} blob - The blob to cache.
|
|
274
|
+
* @param {boolean} [pinned] - Whether the entry is protected from eviction.
|
|
275
|
+
* @param {Record<string, any>} [metadata] - The probe metadata captured with the blob.
|
|
276
|
+
* @param {string|null} [parent] - The key of the entry that owns this one.
|
|
277
|
+
* @returns {MediaCacheEntry} The stored entry.
|
|
278
|
+
* @throws {TypeError} If `blob` is not a Blob.
|
|
279
|
+
* @throws {TypeError} If `parent` is neither a string nor null.
|
|
280
|
+
* @throws {Error} If the cache was destroyed.
|
|
281
|
+
*/
|
|
282
|
+
set(url: string, blob: Blob, pinned?: boolean, metadata?: Record<string, any>, parent?: string | null): MediaCacheEntry;
|
|
283
|
+
/**
|
|
284
|
+
* Reads an entry without changing its reference count.
|
|
285
|
+
* @param {string} url - The media URL.
|
|
286
|
+
* @returns {MediaCacheEntry|null}
|
|
287
|
+
*/
|
|
288
|
+
get(url: string): MediaCacheEntry | null;
|
|
289
|
+
/**
|
|
290
|
+
* Checks whether a live entry exists for the given URL.
|
|
291
|
+
* @param {string} url - The media URL.
|
|
292
|
+
* @returns {boolean} True when a non-expired entry exists.
|
|
293
|
+
*/
|
|
294
|
+
has(url: string): boolean;
|
|
295
|
+
/**
|
|
296
|
+
* Increments the reference count of an entry.
|
|
297
|
+
* @param {string} url - The media URL.
|
|
298
|
+
* @returns {MediaCacheEntry|null} The acquired entry, or null when missing.
|
|
299
|
+
*/
|
|
300
|
+
acquire(url: string): MediaCacheEntry | null;
|
|
301
|
+
/**
|
|
302
|
+
* Decrements the reference count and applies the cleanup strategy.
|
|
303
|
+
* @param {string} url - The media URL.
|
|
304
|
+
* @returns {boolean} True when the entry was released.
|
|
305
|
+
*/
|
|
306
|
+
release(url: string): boolean;
|
|
307
|
+
/**
|
|
308
|
+
* Removes an entry and releases its share of the shared registry. When the
|
|
309
|
+
* entry is the last child of a parent, the parent is removed as well.
|
|
310
|
+
* @param {string} url - The media URL.
|
|
311
|
+
* @returns {boolean} True when an entry was removed.
|
|
312
|
+
*/
|
|
313
|
+
delete(url: string): boolean;
|
|
314
|
+
/**
|
|
315
|
+
* The keys of the entries owned by the given key.
|
|
316
|
+
* @param {string} url - The media URL of the owner.
|
|
317
|
+
* @returns {string[]} The normalized keys of the children, in insertion order.
|
|
318
|
+
*/
|
|
319
|
+
children(url: string): string[];
|
|
320
|
+
/**
|
|
321
|
+
* Reads an entry without changing its reference count and without touching
|
|
322
|
+
* the hit/miss counters. Expired entries are reported as missing but are not
|
|
323
|
+
* removed, so a read-only probe never mutates the cache.
|
|
324
|
+
* @param {string} url - The media URL.
|
|
325
|
+
* @returns {MediaCacheEntry|null} The live entry, or null when absent or expired.
|
|
326
|
+
* @throws {TypeError} If `url` is not a string.
|
|
327
|
+
* @throws {Error} If the cache was destroyed.
|
|
328
|
+
*/
|
|
329
|
+
peek(url: string): MediaCacheEntry | null;
|
|
330
|
+
/**
|
|
331
|
+
* Pins an entry so the limit enforcement skips it.
|
|
332
|
+
* @param {string} url - The media URL.
|
|
333
|
+
* @param {boolean} [value] - The new pinned state.
|
|
334
|
+
* @returns {boolean} True when the entry exists.
|
|
335
|
+
*/
|
|
336
|
+
pin(url: string, value?: boolean): boolean;
|
|
337
|
+
/**
|
|
338
|
+
* Removes every expired entry.
|
|
339
|
+
* @returns {number} The number of removed entries.
|
|
340
|
+
*/
|
|
341
|
+
prune(): number;
|
|
342
|
+
/**
|
|
343
|
+
* Removes every entry, regardless of its reference count.
|
|
344
|
+
* @returns {void}
|
|
345
|
+
*/
|
|
346
|
+
clear(): void;
|
|
347
|
+
/**
|
|
348
|
+
* Detaches this instance from the shared registry.
|
|
349
|
+
* @returns {void}
|
|
350
|
+
*/
|
|
351
|
+
destroy(): void;
|
|
352
|
+
}
|
|
353
|
+
export default TinyMediaCache;
|
|
354
|
+
//# sourceMappingURL=TinyMediaCache.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TinyMediaCache.d.mts","sourceRoot":"","sources":["../../../../../../src/v1/libs/html/loader/utils/TinyMediaCache.mjs"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIA,YAAiC,kBAAkB,GAAzC,MAAM,GAAC,QAAQ,GAAC,KAAK,CAAoB;AAInD,YAAkB,iBAAiB,GACnC;;;;IAAoB,QAAQ,AAA5B,CACA,EADW,MAAM,CACjB;;;;IAAoB,QAAQ,AAA5B,CACA,EADW,MAAM,CACjB;;;;IAAoB,GAAG,AAAvB,CACA,EADW,MAAM,CACjB;;;;IAAgC,QAAQ,AAAxC,CACA,EADW,kBAAkB,CAC7B;;;;IAAqB,YAAY,AAAjC,CACA,EADW,OAAO,CAClB;;;;IAAoB,aAAa,AAAjC,CACF,EADa,MAAM,CACnB;CAAA,CAAA;AAGE,YAAkB,eAAe,GACjC;;;;IAAmB,GAAG,EAAX,MAAM,CACjB;;;;IAAmB,GAAG,EAAX,MAAM,CACjB;;;;IAAiB,IAAI,EAAV,IAAI,CACf;;;;IAAmB,SAAS,EAAjB,MAAM,CACjB;;;;IAAmB,IAAI,EAAZ,MAAM,CACjB;;;;IAAmB,IAAI,EAAZ,MAAM,CACjB;;;;IAAmB,IAAI,EAAZ,MAAM,CACjB;;;;IAAmB,SAAS,EAAjB,MAAM,CACjB;;;;IAAmB,UAAU,EAAlB,MAAM,CACjB;;;;IAAmB,SAAS,EAAjB,MAAM,CACjB;;;;IAAoB,MAAM,EAAf,OAAO,CAClB;;;;IAAwB,MAAM,EAAnB,MAAM,GAAC,IAAI,CACtB;;;;IAAgC,QAAQ,EAA7B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAChC;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