import { type Configuration } from "https://dotland.deno.dev/x/zipjs@v2.7.53/index.d.ts";
Represents the configuration passed to configure.
Properties
The delay in milliseconds before idle web workers are automatically terminated. You can call terminateWorkers()
to terminate idle workers.
The URIs of the compression/decompression scripts run in web workers.
It allows using alternative deflate implementations or specifying a URL to the worker script if the CSP of the page blocks scripts imported from a Blob URI.
The properties deflate
and inflate
must specify arrays of URLs to import the deflate/inflate web workers, respectively.
The first URL is relative to the base URI of the document. The other URLs are relative to the URL of the first script. Scripts in the array are executed in order.
If you only use deflation or inflation, the unused deflate
/inflate
property can be omitted.
Here is an example:
configure({
workerScripts: {
deflate: ["library_path/custom-worker.js", "./custom-deflate.js"],
inflate: ["library_path/custom-worker.js", "./custom-inflate.js"]
}
});
If the CSP of the page blocks scripts imported from a Blob URI you can use z-worker.js
from https://github.com/gildas-lormeau/zip.js/tree/master/dist and specify the URL where it can be found.
Here is an example:
configure({
workerScripts: {
deflate: ["library_path/z-worker.js"],
inflate: ["library_path/z-worker.js"]
}
});