inkvec / studio /pkg-threads /inkvec_studio_wasm.d.ts
Incorporo-user's picture
Inkvec 0.2: the presentation page, and Inkvec Studio Lite under studio/
8b468fc verified
Raw
History Blame Contribute Delete
6.86 kB
/* 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<any>;
/**
* 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_stage(name, ms)` is called as the pipeline passes each stage; `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.
*/
trace(request: string, draft_px: number, draft_seconds: number, generation: number, on_stage: 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;
export function initThreadPool(num_threads: number): Promise<any>;
/**
* 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 class wbg_rayon_PoolBuilder {
private constructor();
free(): void;
[Symbol.dispose](): void;
build(): void;
numThreads(): number;
receiver(): number;
}
export function wbg_rayon_start_worker(receiver: number): void;
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
export interface InitOutput {
readonly __wbg_studio_free: (a: number, b: number) => void;
readonly __wbg_wbg_rayon_poolbuilder_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 initThreadPool: (a: number) => number;
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 wbg_rayon_poolbuilder_build: (a: number) => void;
readonly wbg_rayon_poolbuilder_numThreads: (a: number) => number;
readonly wbg_rayon_poolbuilder_receiver: (a: number) => number;
readonly wbg_rayon_start_worker: (a: number) => void;
readonly memory: WebAssembly.Memory;
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;
readonly __wbindgen_thread_destroy: (a?: number, b?: number, c?: number) => void;
readonly __wbindgen_start: (a: number) => void;
}
export type SyncInitInput = BufferSource | WebAssembly.Module;
/**
* Instantiates the given `module`, which can either be bytes or
* a precompiled `WebAssembly.Module`.
*
* @param {{ module: SyncInitInput, memory?: WebAssembly.Memory, thread_stack_size?: number }} module - Passing `SyncInitInput` directly is deprecated.
* @param {WebAssembly.Memory} memory - Deprecated.
*
* @returns {InitOutput}
*/
export function initSync(module: { module: SyncInitInput, memory?: WebAssembly.Memory, thread_stack_size?: number } | SyncInitInput, memory?: WebAssembly.Memory): 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>, memory?: WebAssembly.Memory, thread_stack_size?: number }} module_or_path - Passing `InitInput` directly is deprecated.
* @param {WebAssembly.Memory} memory - Deprecated.
*
* @returns {Promise<InitOutput>}
*/
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput>, memory?: WebAssembly.Memory, thread_stack_size?: number } | InitInput | Promise<InitInput>, memory?: WebAssembly.Memory): Promise<InitOutput>;