forked from external-repos/squoosh
* Basic rotate & flip * Flipping resize when orientation changes * Hack around critters issue. * Removing generator. Huge perf boost. * Stable positioning * Creating input processors * Allowing rotation to be changed * Reverting old change * Adding tooltips * No more flip * Removing need for wrapper element boxing * Adding comment * Addressing nits * Bleh
27 lines
698 B
TypeScript
27 lines
698 B
TypeScript
type BitmapResizeMethods = 'browser-pixelated' | 'browser-low' | 'browser-medium' | 'browser-high';
|
|
|
|
export interface ResizeOptions {
|
|
width: number;
|
|
height: number;
|
|
method: 'vector' | BitmapResizeMethods;
|
|
fitMethod: 'stretch' | 'contain';
|
|
}
|
|
|
|
export interface BitmapResizeOptions extends ResizeOptions {
|
|
method: BitmapResizeMethods;
|
|
}
|
|
|
|
export interface VectorResizeOptions extends ResizeOptions {
|
|
method: 'vector';
|
|
}
|
|
|
|
export const defaultOptions: ResizeOptions = {
|
|
// Width and height will always default to the image size.
|
|
// This is set elsewhere.
|
|
width: 1,
|
|
height: 1,
|
|
// This will be set to 'vector' if the input is SVG.
|
|
method: 'browser-high',
|
|
fitMethod: 'stretch',
|
|
};
|