mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-16 10:39:53 +00:00
Parallel OxiPNG improvements
- Refactor to work around Chromium's issue with postMessage queuing. https://bugs.chromium.org/p/chromium/issues/detail?id=1075645 - Convert codec code to TypeScript. - Make separate parallel and non-parallel builds. - Switch to nightly Rust for OxiPNG to allow parallel builds (but also reuse it for regular builds to avoid installing two toolchains).
This commit is contained in:
committed by
Ingvar Stepanyan
parent
e462875807
commit
9420dba3bc
26
codecs/oxipng/pkg/squoosh_oxipng.d.ts
vendored
26
codecs/oxipng/pkg/squoosh_oxipng.d.ts
vendored
@@ -1,36 +1,21 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* @returns {any}
|
||||
*/
|
||||
export function worker_initializer(): any;
|
||||
/**
|
||||
* @param {number} num
|
||||
*/
|
||||
export function start_main_thread(num: number): void;
|
||||
/**
|
||||
*/
|
||||
export function start_worker_thread(): void;
|
||||
/**
|
||||
* @param {Uint8Array} data
|
||||
* @param {number} level
|
||||
* @returns {Uint8Array}
|
||||
* @param {Uint8Array} data
|
||||
* @param {number} level
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function optimise(data: Uint8Array, level: number): Uint8Array;
|
||||
|
||||
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
||||
|
||||
export interface InitOutput {
|
||||
readonly worker_initializer: () => number;
|
||||
readonly start_main_thread: (a: number) => void;
|
||||
readonly start_worker_thread: () => void;
|
||||
readonly memory: WebAssembly.Memory;
|
||||
readonly optimise: (a: number, b: number, c: number, d: number) => void;
|
||||
readonly malloc: (a: number) => number;
|
||||
readonly free: (a: number) => void;
|
||||
readonly __wbindgen_export_0: WebAssembly.Memory;
|
||||
readonly __wbindgen_malloc: (a: number) => number;
|
||||
readonly __wbindgen_free: (a: number, b: number) => void;
|
||||
readonly __wbindgen_start: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,9 +23,8 @@ export interface InitOutput {
|
||||
* for everything else, calls `WebAssembly.instantiate` directly.
|
||||
*
|
||||
* @param {InitInput | Promise<InitInput>} module_or_path
|
||||
* @param {WebAssembly.Memory} maybe_memory
|
||||
*
|
||||
* @returns {Promise<InitOutput>}
|
||||
*/
|
||||
export default function init (module_or_path?: InitInput | Promise<InitInput>, maybe_memory: WebAssembly.Memory): Promise<InitOutput>;
|
||||
export default function init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|
||||
|
||||
Reference in New Issue
Block a user