@wonfsy/wonfy-tools
Version:
Collection of tools for personal use, provides library and CLI.
92 lines (87 loc) • 4.02 kB
TypeScript
/* tslint:disable */
/* eslint-disable */
export function stitch(images: Uint8Array[], direction: string, order: string, window_size: number | null | undefined, match_mode: string | null | undefined, crop_padding: number | null | undefined, preview: Preview | null | undefined, format: EncodeFormat): StitchReturn;
export function rgba_bytes_to_image(bytes: Uint8Array, width: number, height: number, format: EncodeFormat): ImageWithDHash;
export function start(): void;
export function encode_format_content_type(format: EncodeFormat): string;
export function encode_format_file_extension(format: EncodeFormat): string;
export enum EncodeFormat {
Png = 0,
Jpeg = 1,
Gif = 2,
WebP = 3,
}
export enum PreviewType {
Resize = 0,
MaxWidth = 1,
MaxHeight = 2,
}
export class ImageWithDHash {
private constructor();
free(): void;
images(): [Uint8Array, BigInt];
}
export class Preview {
free(): void;
constructor(type: PreviewType, value: number);
}
export class StitchReturn {
private constructor();
free(): void;
images(): [StitchedImage, StitchedImage?];
}
export class StitchedImage {
private constructor();
free(): void;
toJson(): { image: Uint8Array, stitchPositions: Array<{ x: number, y: number }>, width: number, height: number };
width: number;
height: number;
}
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
export interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly __wbg_preview_free: (a: number, b: number) => void;
readonly preview_new: (a: number, b: number) => number;
readonly __wbg_stitchedimage_free: (a: number, b: number) => void;
readonly __wbg_get_stitchedimage_width: (a: number) => number;
readonly __wbg_set_stitchedimage_width: (a: number, b: number) => void;
readonly __wbg_get_stitchedimage_height: (a: number) => number;
readonly __wbg_set_stitchedimage_height: (a: number, b: number) => void;
readonly stitchedimage_toJson: (a: number) => any;
readonly __wbg_stitchreturn_free: (a: number, b: number) => void;
readonly stitchreturn_images: (a: number) => any;
readonly stitch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number, number];
readonly __wbg_imagewithdhash_free: (a: number, b: number) => void;
readonly imagewithdhash_images: (a: number) => any;
readonly rgba_bytes_to_image: (a: number, b: number, c: number, d: number, e: number) => number;
readonly start: () => void;
readonly encode_format_content_type: (a: number) => [number, number];
readonly encode_format_file_extension: (a: number) => [number, number];
readonly __wbindgen_exn_store: (a: number) => void;
readonly __externref_table_alloc: () => number;
readonly __wbindgen_export_2: WebAssembly.Table;
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
readonly __wbindgen_malloc: (a: number, b: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
readonly __externref_table_dealloc: (a: number) => void;
readonly __wbindgen_start: () => void;
}
export type SyncInitInput = BufferSource | WebAssembly.Module;
/**
* Instantiates the given `module`, which can either be bytes or
* a precompiled `WebAssembly.Module`.
*
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
*
* @returns {InitOutput}
*/
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
/**
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
* for everything else, calls `WebAssembly.instantiate` directly.
*
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
*
* @returns {Promise<InitOutput>}
*/
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;