@johnhenry/sitefile 0.0.2 → 0.0.3

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.
Files changed (130) hide show
  1. package/CHANGELOG.md +467 -0
  2. package/README.md +55 -6
  3. package/lib/src/archive-writers.d.ts +12 -2
  4. package/lib/src/archive-writers.js +53 -10
  5. package/lib/src/canonical.d.ts +16 -0
  6. package/lib/src/canonical.js +46 -0
  7. package/lib/src/car.d.ts +34 -0
  8. package/lib/src/car.js +203 -0
  9. package/lib/src/checklinks.js +8 -2
  10. package/lib/src/cli/bake.js +4 -3
  11. package/lib/src/cli/build-image.d.ts +1 -0
  12. package/lib/src/cli/build-image.js +1 -0
  13. package/lib/src/cli/common.js +4 -1
  14. package/lib/src/cli/hosts.d.ts +5 -0
  15. package/lib/src/cli/hosts.js +78 -0
  16. package/lib/src/cli/images.js +23 -5
  17. package/lib/src/cli/import-config.d.ts +2 -0
  18. package/lib/src/cli/import-config.js +56 -0
  19. package/lib/src/cli/index.d.ts +3 -1
  20. package/lib/src/cli/index.js +31 -2
  21. package/lib/src/cli/integrity.d.ts +2 -0
  22. package/lib/src/cli/integrity.js +77 -0
  23. package/lib/src/cli/network.d.ts +7 -0
  24. package/lib/src/cli/network.js +14 -3
  25. package/lib/src/cli/serve-keys.d.ts +39 -0
  26. package/lib/src/cli/serve-keys.js +106 -0
  27. package/lib/src/cli/serve-worker.js +46 -8
  28. package/lib/src/cli/servers.d.ts +124 -1
  29. package/lib/src/cli/servers.js +705 -62
  30. package/lib/src/cli/up.d.ts +2 -0
  31. package/lib/src/cli/up.js +193 -0
  32. package/lib/src/cli/watch.d.ts +14 -1
  33. package/lib/src/cli/watch.js +20 -3
  34. package/lib/src/cli.js +138 -18
  35. package/lib/src/csp.d.ts +17 -0
  36. package/lib/src/csp.js +52 -0
  37. package/lib/src/dictionary.d.ts +16 -0
  38. package/lib/src/dictionary.js +89 -0
  39. package/lib/src/epub.d.ts +5 -0
  40. package/lib/src/epub.js +113 -0
  41. package/lib/src/errors.d.ts +22 -9
  42. package/lib/src/errors.js +20 -1
  43. package/lib/src/executor.d.ts +31 -1
  44. package/lib/src/executor.js +192 -22
  45. package/lib/src/explain.js +33 -3
  46. package/lib/src/export-for.d.ts +42 -0
  47. package/lib/src/export-for.js +466 -0
  48. package/lib/src/export-formats.d.ts +2 -2
  49. package/lib/src/export-formats.js +52 -2
  50. package/lib/src/fingerprint.d.ts +3 -1
  51. package/lib/src/fingerprint.js +32 -5
  52. package/lib/src/host-config.d.ts +34 -0
  53. package/lib/src/host-config.js +645 -0
  54. package/lib/src/hosts.d.ts +47 -0
  55. package/lib/src/hosts.js +106 -0
  56. package/lib/src/index.d.ts +1 -1
  57. package/lib/src/index.js +1 -1
  58. package/lib/src/integrity.d.ts +115 -0
  59. package/lib/src/integrity.js +273 -0
  60. package/lib/src/language/ast.d.ts +116 -3
  61. package/lib/src/language/ast.js +7 -1
  62. package/lib/src/language/parser.js +176 -7
  63. package/lib/src/language/validate.js +21 -0
  64. package/lib/src/links.d.ts +33 -0
  65. package/lib/src/links.js +271 -3
  66. package/lib/src/lint.d.ts +1 -1
  67. package/lib/src/lint.js +26 -1
  68. package/lib/src/mime-data.d.ts +2 -0
  69. package/lib/src/mime-data.js +92 -0
  70. package/lib/src/oci.d.ts +20 -2
  71. package/lib/src/oci.js +70 -28
  72. package/lib/src/outdated.d.ts +3 -0
  73. package/lib/src/outdated.js +4 -4
  74. package/lib/src/planner.d.ts +69 -2
  75. package/lib/src/planner.js +150 -8
  76. package/lib/src/plugins/cache.d.ts +11 -0
  77. package/lib/src/plugins/cache.js +29 -0
  78. package/lib/src/plugins/host.d.ts +51 -2
  79. package/lib/src/plugins/host.js +141 -16
  80. package/lib/src/plugins/wasm.js +1 -3
  81. package/lib/src/portable.d.ts +8 -0
  82. package/lib/src/portable.js +47 -0
  83. package/lib/src/precache.d.ts +33 -0
  84. package/lib/src/precache.js +75 -0
  85. package/lib/src/precompress.d.ts +19 -0
  86. package/lib/src/precompress.js +35 -0
  87. package/lib/src/qr.d.ts +18 -0
  88. package/lib/src/qr.js +372 -0
  89. package/lib/src/registry-ops.js +4 -2
  90. package/lib/src/reload-client.d.ts +2 -0
  91. package/lib/src/reload-client.js +304 -0
  92. package/lib/src/resources/archive.d.ts +36 -0
  93. package/lib/src/resources/archive.js +338 -67
  94. package/lib/src/resources/convert.js +3 -1
  95. package/lib/src/resources/https.d.ts +9 -1
  96. package/lib/src/resources/https.js +36 -0
  97. package/lib/src/resources/network.d.ts +25 -3
  98. package/lib/src/resources/network.js +77 -6
  99. package/lib/src/secrets.d.ts +12 -3
  100. package/lib/src/secrets.js +18 -5
  101. package/lib/src/serve-auth.d.ts +32 -0
  102. package/lib/src/serve-auth.js +112 -0
  103. package/lib/src/serve-rules.d.ts +83 -7
  104. package/lib/src/serve-rules.js +264 -53
  105. package/lib/src/server.d.ts +437 -10
  106. package/lib/src/server.js +1236 -52
  107. package/lib/src/servers-file.d.ts +36 -0
  108. package/lib/src/servers-file.js +101 -0
  109. package/lib/src/servers.d.ts +109 -7
  110. package/lib/src/servers.js +151 -29
  111. package/lib/src/single-file.d.ts +12 -0
  112. package/lib/src/single-file.js +147 -0
  113. package/lib/src/site.d.ts +54 -0
  114. package/lib/src/site.js +204 -6
  115. package/lib/src/store.js +9 -5
  116. package/lib/src/swbn.d.ts +10 -0
  117. package/lib/src/swbn.js +86 -0
  118. package/lib/src/toml.d.ts +17 -0
  119. package/lib/src/toml.js +323 -0
  120. package/lib/src/wacz.d.ts +6 -0
  121. package/lib/src/wacz.js +96 -0
  122. package/lib/src/warc.d.ts +28 -0
  123. package/lib/src/warc.js +252 -0
  124. package/lib/src/watch.d.ts +12 -1
  125. package/lib/src/watch.js +67 -1
  126. package/lib/src/wbn.d.ts +9 -1
  127. package/lib/src/wbn.js +23 -33
  128. package/lib/src/zstd.d.ts +4 -0
  129. package/lib/src/zstd.js +328 -0
  130. package/package.json +1 -1
@@ -0,0 +1,304 @@
1
+ // The browser side of live reload: served at /__sitefile/reload.js while `serve --watch` runs
2
+ // (src/server.ts), and loaded by the tag injected into navigated HTML.
3
+ //
4
+ // This file is the single source of the script: the Rust server (rust/src/server.rs) compiles it
5
+ // in with include_str! and serves the text between the String.raw backticks, so both servers send
6
+ // the same bytes. Keep it plain ES2017 with no backticks and no dollar-brace inside.
7
+ //
8
+ // The literal is a function expression; the server calls it with the watch session's options
9
+ // (clientScript in src/server.ts): `RELOAD_CLIENT + "(" + options JSON + ");\n"`.
10
+ /** The live-reload client script (JavaScript), a function of the options object. */
11
+ export const RELOAD_CLIENT = String.raw `(function (options) {
12
+ "use strict";
13
+ var me = document.currentScript;
14
+ // Relative to this script, so the page can be served under another origin or a base path.
15
+ var base = (me && me.src) || location.href;
16
+
17
+ // A service worker that caches the site would keep serving the old build after a reload:
18
+ // unregister this origin's workers and empty its Cache Storage first (--keep-service-workers
19
+ // turns this off).
20
+ function resetServiceWorkers() {
21
+ if (!options.resetServiceWorkers) return Promise.resolve();
22
+ var jobs = [];
23
+ if (navigator.serviceWorker && navigator.serviceWorker.getRegistrations) {
24
+ jobs.push(navigator.serviceWorker.getRegistrations().then(function (regs) {
25
+ return Promise.all(regs.map(function (r) { return r.unregister(); }));
26
+ }));
27
+ }
28
+ if (window.caches && caches.keys) {
29
+ jobs.push(caches.keys().then(function (keys) {
30
+ return Promise.all(keys.map(function (k) { return caches.delete(k); }));
31
+ }));
32
+ }
33
+ return Promise.all(jobs).catch(function () {});
34
+ }
35
+
36
+ // Only stylesheets changed: point each <link rel=stylesheet> whose path changed at a fresh URL
37
+ // (the old sheet stays until the new one loads, so nothing flashes). False when no link matched,
38
+ // e.g. a sheet that is only @import-ed: then the page reloads.
39
+ function swapStylesheets(paths) {
40
+ var swapped = false;
41
+ var links = document.querySelectorAll("link[rel~=stylesheet][href]");
42
+ for (var i = 0; i < links.length; i++) {
43
+ var link = links[i];
44
+ var url = new URL(link.getAttribute("href"), location.href);
45
+ if (url.origin !== location.origin) continue;
46
+ var p = decodeURIComponent(url.pathname);
47
+ if (paths.indexOf(p) === -1) continue;
48
+ url.searchParams.set("__sitefile", String(Date.now()));
49
+ var fresh = link.cloneNode(false);
50
+ fresh.href = url.href;
51
+ fresh.onload = fresh.onerror = (function (old) {
52
+ return function () { if (old.parentNode) old.parentNode.removeChild(old); };
53
+ })(link);
54
+ link.parentNode.insertBefore(fresh, link.nextSibling);
55
+ swapped = true;
56
+ }
57
+ return swapped;
58
+ }
59
+
60
+ // A full reload keeps the scroll position: it is saved per path in sessionStorage and restored
61
+ // when the reloaded page has loaded.
62
+ var scrollKey = "sitefile:scroll:" + location.pathname;
63
+ function saveScroll() {
64
+ try {
65
+ sessionStorage.setItem(scrollKey, JSON.stringify([window.scrollX, window.scrollY]));
66
+ } catch (_) {}
67
+ }
68
+ function restoreScroll() {
69
+ var saved = null;
70
+ try {
71
+ saved = JSON.parse(sessionStorage.getItem(scrollKey) || "null");
72
+ sessionStorage.removeItem(scrollKey);
73
+ } catch (_) {}
74
+ if (saved && saved.length === 2) window.scrollTo(saved[0], saved[1]);
75
+ }
76
+ if (document.readyState === "complete") restoreScroll();
77
+ else window.addEventListener("load", restoreScroll);
78
+
79
+ // --navigate-to-changed: a rebuild that changed exactly one page names it; go there unless
80
+ // this is already that page.
81
+ function reload(path) {
82
+ resetServiceWorkers().then(function () {
83
+ if (path && options.navigateToChanged && path !== location.pathname) return location.assign(path);
84
+ saveScroll();
85
+ location.reload();
86
+ });
87
+ }
88
+
89
+ // --reload morph (the default): when only HTML changed, fetch this page again and update the
90
+ // document in place (scroll position, focus and form input stay), unless its scripts changed;
91
+ // anything unexpected falls back to a full reload.
92
+ function isOurs(n) {
93
+ return n.nodeType === 1 && (n.localName === "sitefile-overlay" || n === me);
94
+ }
95
+ function scriptsOf(doc) {
96
+ var out = [];
97
+ var list = doc.querySelectorAll("script");
98
+ for (var i = 0; i < list.length; i++) {
99
+ var s = list[i];
100
+ if (s === me || (s.getAttribute("src") || "").indexOf("/__sitefile/reload.js") !== -1) continue;
101
+ out.push((s.getAttribute("src") || "") + "|" + (s.getAttribute("type") || "") + "|" + s.textContent);
102
+ }
103
+ return out.join("\n");
104
+ }
105
+ function sameKind(a, b) {
106
+ return a.nodeType === b.nodeType && a.nodeName === b.nodeName && (a.nodeType !== 1 || (a.id || "") === (b.id || ""));
107
+ }
108
+ function morphChildren(from, to) {
109
+ var have = Array.prototype.filter.call(from.childNodes, function (n) { return !isOurs(n); });
110
+ var want = Array.prototype.slice.call(to.childNodes);
111
+ var anchor = null;
112
+ for (var k = 0; k < from.childNodes.length; k++) {
113
+ if (isOurs(from.childNodes[k])) { anchor = from.childNodes[k]; break; }
114
+ }
115
+ for (var i = 0; i < want.length; i++) {
116
+ var h = have[i];
117
+ if (!h) from.insertBefore(document.importNode(want[i], true), anchor);
118
+ else if (sameKind(h, want[i])) morphNode(h, want[i]);
119
+ else from.replaceChild(document.importNode(want[i], true), h);
120
+ }
121
+ for (var j = want.length; j < have.length; j++) from.removeChild(have[j]);
122
+ }
123
+ function morphNode(from, to) {
124
+ if (from.nodeType === 3 || from.nodeType === 8) {
125
+ if (from.nodeValue !== to.nodeValue) from.nodeValue = to.nodeValue;
126
+ return;
127
+ }
128
+ if (from.nodeType !== 1 || from.localName === "script") return;
129
+ var i;
130
+ for (i = 0; i < to.attributes.length; i++) {
131
+ var a = to.attributes[i];
132
+ if (from.getAttribute(a.name) !== a.value) from.setAttribute(a.name, a.value);
133
+ }
134
+ for (i = from.attributes.length - 1; i >= 0; i--) {
135
+ if (!to.hasAttribute(from.attributes[i].name)) from.removeAttribute(from.attributes[i].name);
136
+ }
137
+ var tag = from.localName;
138
+ if (from === document.activeElement && (tag === "input" || tag === "textarea" || tag === "select")) return;
139
+ if (tag === "textarea") return; // its text is its value, which the person may have edited
140
+ morphChildren(from, to);
141
+ }
142
+ function morph() {
143
+ return fetch(location.href, { headers: { accept: "text/html" }, cache: "no-store" })
144
+ .then(function (r) {
145
+ if (!r.ok) throw new Error("status " + r.status);
146
+ return r.text();
147
+ })
148
+ .then(function (html) {
149
+ var doc = new DOMParser().parseFromString(html, "text/html");
150
+ if (scriptsOf(doc) !== scriptsOf(document)) throw new Error("scripts changed");
151
+ morphChildren(document.head, doc.head);
152
+ morphChildren(document.body, doc.body);
153
+ if (document.title !== doc.title) document.title = doc.title;
154
+ });
155
+ }
156
+ function update(ev) {
157
+ var going = ev.path && options.navigateToChanged && ev.path !== location.pathname;
158
+ if (!ev.morph || going || options.reload !== "morph") return reload(ev.path);
159
+ resetServiceWorkers()
160
+ .then(morph)
161
+ .catch(function () {
162
+ saveScroll();
163
+ location.reload();
164
+ });
165
+ }
166
+
167
+ // Forward errors and warnings (and, with --console, log and info) to the server log, for pages
168
+ // open on a phone or in a browser without devtools.
169
+ var consoleUrl = new URL("console", base).href;
170
+ var sending = false;
171
+ function text(x) {
172
+ if (typeof x === "string") return x;
173
+ if (x instanceof Error) return x.name + ": " + x.message;
174
+ try {
175
+ var j = JSON.stringify(x);
176
+ return j === undefined ? String(x) : j;
177
+ } catch (_) {
178
+ return String(x);
179
+ }
180
+ }
181
+ function forward(level, message, stack, url, line, col) {
182
+ if (sending) return;
183
+ sending = true;
184
+ try {
185
+ var body = { level: level, message: String(message).slice(0, 4000) };
186
+ if (stack) body.stack = String(stack).slice(0, 4000);
187
+ if (url) body.url = String(url);
188
+ if (typeof line === "number") body.line = line;
189
+ if (typeof col === "number") body.col = col;
190
+ fetch(consoleUrl, { method: "POST", body: JSON.stringify(body), keepalive: true }).catch(function () {});
191
+ } catch (_) {
192
+ // never let forwarding break the page
193
+ } finally {
194
+ sending = false;
195
+ }
196
+ }
197
+ window.addEventListener("error", function (e) {
198
+ if (e.error === undefined && !e.message) return; // a resource that failed to load
199
+ forward("error", "Uncaught " + (e.error ? text(e.error) : e.message), e.error && e.error.stack, e.filename, e.lineno, e.colno);
200
+ });
201
+ window.addEventListener("unhandledrejection", function (e) {
202
+ var r = e.reason;
203
+ forward("error", "Unhandled rejection: " + text(r), r && r.stack, location.href);
204
+ });
205
+ var levels = options.console ? ["error", "warn", "log", "info"] : ["error", "warn"];
206
+ levels.forEach(function (level) {
207
+ var original = console[level];
208
+ if (typeof original !== "function") return;
209
+ console[level] = function () {
210
+ var args = Array.prototype.slice.call(arguments);
211
+ var err = args.filter(function (a) { return a instanceof Error; })[0];
212
+ forward(level, args.map(text).join(" "), err && err.stack, location.href);
213
+ return original.apply(this, arguments);
214
+ };
215
+ });
216
+
217
+ // The Rebuilding badge and the build-error overlay live in shadow roots, so the site's CSS
218
+ // cannot reach them and theirs cannot leak into the site (--no-overlay turns both off).
219
+ var badge = null;
220
+ var overlay = null;
221
+ function host(css, html) {
222
+ var el = document.createElement("sitefile-overlay");
223
+ var root = el.attachShadow ? el.attachShadow({ mode: "open" }) : el;
224
+ root.innerHTML = "<style>" + css + "</style>" + html;
225
+ (document.body || document.documentElement).appendChild(el);
226
+ return { el: el, root: root };
227
+ }
228
+ function showBadge() {
229
+ if (!options.overlay || badge) return;
230
+ badge = host(
231
+ ":host{all:initial}div{position:fixed;right:12px;bottom:12px;z-index:2147483647;padding:6px 10px;" +
232
+ "border-radius:6px;background:#1f2937;color:#f9fafb;font:12px/1.4 system-ui,sans-serif;opacity:.9}",
233
+ "<div role=\"status\">Rebuilding\u2026</div>"
234
+ );
235
+ }
236
+ function hideBadge() {
237
+ if (badge) badge.el.remove();
238
+ badge = null;
239
+ }
240
+ function showError(ev) {
241
+ hideBadge();
242
+ hideError();
243
+ if (!options.overlay) return;
244
+ overlay = host(
245
+ ":host{all:initial}.back{position:fixed;inset:0;z-index:2147483647;background:rgba(0,0,0,.55);" +
246
+ "display:flex;align-items:flex-start;justify-content:center;padding:8vh 16px;box-sizing:border-box}" +
247
+ ".box{max-width:860px;width:100%;max-height:80vh;overflow:auto;background:#fff;color:#111;" +
248
+ "border-top:6px solid #dc2626;border-radius:8px;padding:20px 24px;font:14px/1.5 system-ui,sans-serif;" +
249
+ "box-shadow:0 10px 40px rgba(0,0,0,.4)}h2{margin:0 0 8px;font-size:16px;color:#b91c1c}" +
250
+ "pre{white-space:pre-wrap;word-break:break-word;font:13px/1.5 ui-monospace,monospace;margin:8px 0}" +
251
+ ".where,.note{color:#555;font-size:13px;overflow-wrap:anywhere}button{float:right;font:inherit;border:0;background:none;" +
252
+ "font-size:20px;line-height:1;cursor:pointer;color:#555}",
253
+ "<div class=\"back\"><div class=\"box\" role=\"alertdialog\" aria-label=\"Build failed\">" +
254
+ "<button type=\"button\" aria-label=\"Dismiss\">\u00d7</button><h2></h2><pre></pre>" +
255
+ "<div class=\"where\"></div><div class=\"note\"></div></div></div>"
256
+ );
257
+ var r = overlay.root;
258
+ r.querySelector("h2").textContent = "Build failed: " + (ev.code || "error");
259
+ r.querySelector("pre").textContent = ev.message || "";
260
+ r.querySelector(".where").textContent = ev.file ? ev.file + (ev.line ? ":" + ev.line + (ev.column ? ":" + ev.column : "") : "") : "";
261
+ r.querySelector(".note").textContent =
262
+ "The page shows the last good build. This clears on the next good build." +
263
+ (navigator.serviceWorker && navigator.serviceWorker.controller ? " A service worker controls this page." : "");
264
+ r.querySelector("button").onclick = hideError;
265
+ }
266
+ function hideError() {
267
+ if (overlay) overlay.el.remove();
268
+ overlay = null;
269
+ }
270
+
271
+ // EventSource reconnects by itself after a dropped connection (the server sends retry: 1000),
272
+ // but gives up for good when an answer is not an event stream (a proxy or tunnel error page):
273
+ // then try again, waiting twice as long each time, up to 30 s.
274
+ var delay = 1000;
275
+ function connect() {
276
+ var source = new EventSource(new URL("reload", base).href);
277
+ source.onopen = function () {
278
+ delay = 1000;
279
+ };
280
+ source.onmessage = function (e) {
281
+ var ev;
282
+ try {
283
+ ev = JSON.parse(e.data);
284
+ } catch (_) {
285
+ ev = { type: "reload" };
286
+ }
287
+ if (ev.type === "building") return showBadge();
288
+ if (ev.type === "error") return showError(ev);
289
+ hideBadge();
290
+ hideError();
291
+ if (ev.type === "ok") return;
292
+ if (ev.type === "css" && options.cssInject && swapStylesheets(ev.paths || [])) return;
293
+ if (ev.type === "reload") return update(ev);
294
+ reload();
295
+ };
296
+ source.onerror = function () {
297
+ if (source.readyState !== EventSource.CLOSED) return;
298
+ setTimeout(connect, delay);
299
+ delay = Math.min(delay * 2, 30000);
300
+ };
301
+ }
302
+ connect();
303
+ })`;
304
+ //# sourceMappingURL=reload-client.js.map
@@ -9,3 +9,39 @@ import { type ArchiveLimits } from './types.js';
9
9
  * kept as-is.
10
10
  */
11
11
  export declare function extractArchive(bytes: Uint8Array, origin: string, limits?: ArchiveLimits, span?: SourceSpan): Promise<Tree>;
12
+ /**
13
+ * OS metadata that archivers and file managers add next to real files: macOS
14
+ * resource forks (`__MACOSX/`, AppleDouble `._name`), Finder's `.DS_Store` and
15
+ * custom folder `Icon\r`, and Windows' `Thumbs.db` and `desktop.ini`
16
+ * (case-insensitive, as Windows writes them).
17
+ */
18
+ export declare function isOsMetadata(path: string): boolean;
19
+ /** `tree` without its OS metadata files ({@link isOsMetadata}), and how many were dropped. */
20
+ export declare function withoutOsMetadata(tree: Tree): {
21
+ tree: Tree;
22
+ skipped: number;
23
+ };
24
+ /** The warning for {@link withoutOsMetadata} dropping `skipped` files of `what`. */
25
+ export declare function osMetadataWarning(what: string, skipped: number): string;
26
+ /** A zip file served without holding its contents ({@link openZipFile}). */
27
+ export interface ZipFile {
28
+ /** The archive's files; their `bytes` are empty (read them with `read`), digests and modes are real. */
29
+ readonly tree: Tree;
30
+ /** The bytes of a file of `tree`, read from the zip again and checked; undefined for other paths. */
31
+ read(path: string): Uint8Array | undefined;
32
+ /** A deflated file's raw deflate stream with its CRC-32 and size (for gzip responses); else undefined. */
33
+ deflated(path: string): {
34
+ readonly deflate: Uint8Array;
35
+ readonly crc: number;
36
+ readonly size: number;
37
+ } | undefined;
38
+ close(): void;
39
+ }
40
+ /**
41
+ * Open a zip file for serving without extracting it into memory: the central directory and
42
+ * local headers are read and checked as {@link extractArchive} checks them, and every entry is
43
+ * inflated once (one at a time) for its CRC-32, digest and the limits. Afterwards only the
44
+ * entry index is held; `read` reads an entry from the file on demand. A file that changed on
45
+ * disk since is reported as `E_ARCHIVE` by `read`.
46
+ */
47
+ export declare function openZipFile(file: string, origin: string, limits?: ArchiveLimits): Promise<ZipFile>;