|
| 1 | +/* tslint:disable */ |
| 2 | +/* eslint-disable */ |
| 3 | +/** |
| 4 | +* Type used on the JS side to convert screen coordinates to chart |
| 5 | +* coordinates. |
| 6 | +*/ |
| 7 | +export class Chart { |
| 8 | + free(): void; |
| 9 | +/** |
| 10 | +* Draw provided power function on the canvas element using it's id. |
| 11 | +* Return `Chart` struct suitable for coordinate conversion. |
| 12 | +* @param {string} canvas_id |
| 13 | +* @param {number} power |
| 14 | +* @returns {Chart} |
| 15 | +*/ |
| 16 | + static power(canvas_id: string, power: number): Chart; |
| 17 | +/** |
| 18 | +* Draw Mandelbrot set on the provided canvas element. |
| 19 | +* Return `Chart` struct suitable for coordinate conversion. |
| 20 | +* @param {HTMLCanvasElement} canvas |
| 21 | +* @returns {Chart} |
| 22 | +*/ |
| 23 | + static mandelbrot(canvas: HTMLCanvasElement): Chart; |
| 24 | +/** |
| 25 | +* @param {HTMLCanvasElement} canvas |
| 26 | +* @param {number} pitch |
| 27 | +* @param {number} yaw |
| 28 | +*/ |
| 29 | + static plot3d(canvas: HTMLCanvasElement, pitch: number, yaw: number): void; |
| 30 | +/** |
| 31 | +* This function can be used to convert screen coordinates to |
| 32 | +* chart coordinates. |
| 33 | +* @param {number} x |
| 34 | +* @param {number} y |
| 35 | +* @returns {Point | undefined} |
| 36 | +*/ |
| 37 | + coord(x: number, y: number): Point | undefined; |
| 38 | +} |
| 39 | +/** |
| 40 | +* Result of screen to chart coordinates conversion. |
| 41 | +*/ |
| 42 | +export class Point { |
| 43 | + free(): void; |
| 44 | +/** |
| 45 | +*/ |
| 46 | + x: number; |
| 47 | +/** |
| 48 | +*/ |
| 49 | + y: number; |
| 50 | +} |
| 51 | + |
| 52 | +export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; |
| 53 | + |
| 54 | +export interface InitOutput { |
| 55 | + readonly memory: WebAssembly.Memory; |
| 56 | + readonly __wbg_chart_free: (a: number) => void; |
| 57 | + readonly __wbg_point_free: (a: number) => void; |
| 58 | + readonly __wbg_get_point_x: (a: number) => number; |
| 59 | + readonly __wbg_set_point_x: (a: number, b: number) => void; |
| 60 | + readonly __wbg_get_point_y: (a: number) => number; |
| 61 | + readonly __wbg_set_point_y: (a: number, b: number) => void; |
| 62 | + readonly chart_power: (a: number, b: number, c: number, d: number) => void; |
| 63 | + readonly chart_mandelbrot: (a: number, b: number) => void; |
| 64 | + readonly chart_plot3d: (a: number, b: number, c: number, d: number) => void; |
| 65 | + readonly chart_coord: (a: number, b: number, c: number) => number; |
| 66 | + readonly __wbindgen_malloc: (a: number) => number; |
| 67 | + readonly __wbindgen_realloc: (a: number, b: number, c: number) => number; |
| 68 | + readonly __wbindgen_exn_store: (a: number) => void; |
| 69 | + readonly __wbindgen_add_to_stack_pointer: (a: number) => number; |
| 70 | +} |
| 71 | + |
| 72 | +/** |
| 73 | +* Synchronously compiles the given `bytes` and instantiates the WebAssembly module. |
| 74 | +* |
| 75 | +* @param {BufferSource} bytes |
| 76 | +* |
| 77 | +* @returns {InitOutput} |
| 78 | +*/ |
| 79 | +export function initSync(bytes: BufferSource): InitOutput; |
| 80 | + |
| 81 | +/** |
| 82 | +* If `module_or_path` is {RequestInfo} or {URL}, makes a request and |
| 83 | +* for everything else, calls `WebAssembly.instantiate` directly. |
| 84 | +* |
| 85 | +* @param {InitInput | Promise<InitInput>} module_or_path |
| 86 | +* |
| 87 | +* @returns {Promise<InitOutput>} |
| 88 | +*/ |
| 89 | +export default function init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>; |
0 commit comments