UNPKG

2.01 kBTypeScriptView Raw
1/* tslint:disable */
2/* eslint-disable */
3/**
4* @param {Uint8Array} raw
5* @param {number} scale
6* @returns {Uint8Array}
7*/
8export function get_gray_image(raw: Uint8Array, scale: number): Uint8Array;
9/**
10* @param {Uint8Array} raw
11* @param {number} scale
12* @param {boolean} reverse
13* @returns {string}
14*/
15export function get_ascii_by_image(raw: Uint8Array, scale: number, reverse: boolean): string;
16/**
17* @param {Uint8Array} raw
18* @param {number} scale
19* @param {boolean} reverse
20* @param {string} style
21* @returns {string}
22*/
23export function get_ascii_by_image_tai(raw: Uint8Array, scale: number, reverse: boolean, style: string): string;
24/**
25*/
26export function run(): void;
27
28export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
29
30export interface InitOutput {
31 readonly memory: WebAssembly.Memory;
32 readonly get_gray_image: (a: number, b: number, c: number, d: number) => void;
33 readonly get_ascii_by_image: (a: number, b: number, c: number, d: number, e: number) => void;
34 readonly get_ascii_by_image_tai: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
35 readonly run: () => void;
36 readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
37 readonly __wbindgen_malloc: (a: number) => number;
38 readonly __wbindgen_free: (a: number, b: number) => void;
39 readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
40 readonly __wbindgen_start: () => void;
41}
42
43/**
44* Synchronously compiles the given `bytes` and instantiates the WebAssembly module.
45*
46* @param {BufferSource} bytes
47*
48* @returns {InitOutput}
49*/
50export function initSync(bytes: BufferSource): InitOutput;
51
52/**
53* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
54* for everything else, calls `WebAssembly.instantiate` directly.
55*
56* @param {InitInput | Promise<InitInput>} module_or_path
57*
58* @returns {Promise<InitOutput>}
59*/
60export default function init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;