|
1 | 1 | /* tslint:disable */ |
2 | 2 | /* eslint-disable */ |
3 | 3 | /** |
4 | | - * |
5 | | - *Compiles Melody source code to a regular expression |
6 | | - * |
7 | | - *# Errors |
8 | | - * |
9 | | - *Throws an error if a compilation error is encountered |
10 | | - * |
11 | | - *# Example |
12 | | - * |
13 | | - *```js |
14 | | - *import init, { compiler } from "https://deno.land/x/melody/melody_wasm.js"; |
15 | | - * |
16 | | - *await init(); |
17 | | - * |
18 | | - *const source = ` |
19 | | - * <start>; |
20 | | - * |
21 | | - * option of "v"; |
22 | | - * |
23 | | - * capture major { |
24 | | - * some of <digit>; |
25 | | - * } |
26 | | - * |
27 | | - * "."; |
28 | | - * |
29 | | - * capture minor { |
30 | | - * some of <digit>; |
31 | | - * } |
32 | | - * |
33 | | - * "."; |
34 | | - * |
35 | | - * capture patch { |
36 | | - * some of <digit>; |
37 | | - * } |
38 | | - * |
39 | | - * <end>; |
40 | | - *`; |
41 | | - * |
42 | | - *try { |
43 | | - * const output = compiler(source); |
44 | | - * new RegExp(output).test("v1.1.1"); // true |
45 | | - *} catch (error) { |
46 | | - * // handle compilation error |
47 | | - *} |
48 | | - *``` |
49 | | - * @param {string} source |
50 | | - * @returns {string} |
51 | | - */ |
| 4 | +* |
| 5 | +*Compiles Melody source code to a regular expression |
| 6 | +* |
| 7 | +*# Errors |
| 8 | +* |
| 9 | +*Throws an error if a compilation error is encountered |
| 10 | +* |
| 11 | +*# Example |
| 12 | +* |
| 13 | +*```js |
| 14 | +*const source = ` |
| 15 | +* <start>; |
| 16 | +* |
| 17 | +* option of "v"; |
| 18 | +* |
| 19 | +* capture major { |
| 20 | +* some of <digit>; |
| 21 | +* } |
| 22 | +* |
| 23 | +* "."; |
| 24 | +* |
| 25 | +* capture minor { |
| 26 | +* some of <digit>; |
| 27 | +* } |
| 28 | +* |
| 29 | +* "."; |
| 30 | +* |
| 31 | +* capture patch { |
| 32 | +* some of <digit>; |
| 33 | +* } |
| 34 | +* |
| 35 | +* <end>; |
| 36 | +*`; |
| 37 | +* |
| 38 | +*try { |
| 39 | +* const output = compiler(source); |
| 40 | +* new RegExp(output).test("v1.1.1"); // true |
| 41 | +*} catch (error) { |
| 42 | +* // handle compilation error |
| 43 | +*} |
| 44 | +*``` |
| 45 | +* @param {string} source |
| 46 | +* @returns {string} |
| 47 | +*/ |
52 | 48 | export function compiler(source: string): string; |
53 | | - |
54 | | -export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; |
55 | | - |
56 | | -export interface InitOutput { |
57 | | - readonly memory: WebAssembly.Memory; |
58 | | - readonly compiler: (a: number, b: number, c: number) => void; |
59 | | - readonly __wbindgen_add_to_stack_pointer: (a: number) => number; |
60 | | - readonly __wbindgen_malloc: (a: number) => number; |
61 | | - readonly __wbindgen_realloc: (a: number, b: number, c: number) => number; |
62 | | - readonly __wbindgen_free: (a: number, b: number) => void; |
63 | | -} |
64 | | - |
65 | 49 | /** |
66 | | - * Synchronously compiles the given `bytes` and instantiates the WebAssembly module. |
67 | | - * |
68 | | - * @param {BufferSource} bytes |
69 | | - * |
70 | | - * @returns {InitOutput} |
71 | | - */ |
72 | | -export function initSync(bytes: BufferSource): InitOutput; |
73 | | - |
74 | | -/** |
75 | | - * If `module_or_path` is {RequestInfo} or {URL}, makes a request and |
76 | | - * for everything else, calls `WebAssembly.instantiate` directly. |
77 | | - * |
78 | | - * @param {InitInput | Promise<InitInput>} module_or_path |
79 | | - * |
80 | | - * @returns {Promise<InitOutput>} |
81 | | - */ |
82 | | -export default function init(module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>; |
| 50 | +*/ |
| 51 | +export function main(): void; |
0 commit comments