mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-11 16:26:20 +00:00
* Refactoring codecs * Plugging in new processor * Fixing decorator * MozJPEG free issue * Better worker aborting, and terminate workers that aren't used for 10 seconds * Better comment * Ooops, half-typed comment * Uncommenting problematic line * Surma fixed it! * Abstracting WASM initialisation * Better comment * Don't need this. * Adding ticket * noInitalRun * Reverting MozJPEG issue demo * Making a const for worker timeout * Inline docs * Bail early rather than nesting * Addressing nits
24 lines
575 B
TypeScript
24 lines
575 B
TypeScript
import {
|
|
QuantizeOptions, defaultOptions as quantizerDefaultOptions,
|
|
} from './imagequant/processor-meta';
|
|
import { ResizeOptions, defaultOptions as resizeDefaultOptions } from './resize/processor-meta';
|
|
|
|
interface Enableable {
|
|
enabled: boolean;
|
|
}
|
|
export interface PreprocessorState {
|
|
quantizer: Enableable & QuantizeOptions;
|
|
resize: Enableable & ResizeOptions;
|
|
}
|
|
|
|
export const defaultPreprocessorState: PreprocessorState = {
|
|
quantizer: {
|
|
enabled: false,
|
|
...quantizerDefaultOptions,
|
|
},
|
|
resize: {
|
|
enabled: false,
|
|
...resizeDefaultOptions,
|
|
},
|
|
};
|