/* tslint:disable */ /* eslint-disable */ /** * One Studio session: the image that is open and what has been traced of it. The * browser's `AppState`. */ export class Studio { free(): void; [Symbol.dispose](): void; /** * Every other command, by its Tauri name, with its arguments as the interface sends * them (a JSON object, camelCase keys). Returns the reply as JSON. */ call(cmd: string, args: string): string; /** * What this build can do (`capabilities`), with the denoiser's standing as the page * measured it: whether it can run here, and whether the weights are in its cache. */ capabilities(denoiser_supported: boolean, denoiser_installed: boolean, denoiser_bytes?: number | null): string; /** * Forget the open image and everything traced from it. */ close(): void; /** * Build an export (`write_export`'s work) and hand every file back as * `[{ name, data }]`, for the page to download. With more than one file, `zip` packs * them into one archive instead, returned as a single `{ name: "", data }`. */ export_files(request: string, zip: boolean): Array; /** * A session with nothing open. */ constructor(); /** * Open an image (`open_bytes`): PNG, JPEG, WebP, GIF, BMP, TIFF or SVG bytes. */ open_bytes(bytes: Uint8Array, name?: string | null): string; /** * A wizard preview (`start_preview`'s work): a draft of `request.settings` that does * not become the drawing. */ preview(request: string, draft_px: number, draft_seconds: number): string; /** * Trace the open image (`start_trace`'s work), synchronously. * * `on_progress(json)` is called with what the engine reported (`trace:progress`'s * payload, without the generation) whenever a stage starts, ends or says something, * and at most every [`PROGRESS_MS`] for a loop's count. This worker is busy for the * whole trace, so the pipeline's own thread is the only place progress can leave from; * a count kept on rayon's workers shows at the next report made here. `is_current()` * is asked, once the drawing is done, whether the page still wants this generation -- * a drawing it has moved past is kept in the cache but not measured. Returns the * outcome as JSON (`trace:done`'s `outcome`), or `undefined` when it was retired. * * A trace here is never cancelled from inside: WebAssembly cannot unwind, so the page * stops a trace nobody wants by terminating this worker (`engine.ts`). */ trace(request: string, draft_px: number, draft_seconds: number, generation: number, on_progress: Function, is_current: Function): string | undefined; } /** * The Hugging Face repository the weights come from. */ export function denoiser_model_repo(): string; /** * The SHA-256 the weights must hash to. */ export function denoiser_model_sha256(): string; /** * The Hugging Face URL of the denoiser weights, the same file the command line pulls. */ export function denoiser_model_url(): string; /** * Route every trace that asks for "Clean up damage" through the page's denoiser. Called * once by the worker when the page can block on a shared buffer (it is cross-origin * isolated); without it such a trace runs as the desktop app does without its model. */ export function enable_denoiser(): void; /** * Whether this is the threaded build, whose pool `initThreadPool` starts. */ export function threads_available(): boolean; /** * The app's version, which is the engine's: they are built from one tree. */ export function version(): string; export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; export interface InitOutput { readonly memory: WebAssembly.Memory; readonly __wbg_studio_free: (a: number, b: number) => void; readonly denoiser_model_repo: (a: number) => void; readonly denoiser_model_sha256: (a: number) => void; readonly denoiser_model_url: (a: number) => void; readonly enable_denoiser: () => void; readonly studio_call: (a: number, b: number, c: number, d: number, e: number, f: number) => void; readonly studio_capabilities: (a: number, b: number, c: number, d: number, e: number, f: number) => void; readonly studio_close: (a: number) => void; readonly studio_export_files: (a: number, b: number, c: number, d: number, e: number) => void; readonly studio_new: () => number; readonly studio_open_bytes: (a: number, b: number, c: number, d: number, e: number, f: number) => void; readonly studio_preview: (a: number, b: number, c: number, d: number, e: number, f: number) => void; readonly studio_trace: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void; readonly threads_available: () => number; readonly version: (a: number) => void; readonly __wbindgen_export: (a: number, b: number) => number; readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export3: (a: number) => void; readonly __wbindgen_export4: (a: number, b: number, c: number) => void; readonly __wbindgen_add_to_stack_pointer: (a: number) => number; } 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 }} module_or_path - Passing `InitInput` directly is deprecated. * * @returns {Promise} */ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise } | InitInput | Promise): Promise;