-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
273 additions
and
329 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,51 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* | ||
*Compiles Melody source code to a regular expression | ||
* | ||
*# Errors | ||
* | ||
*Throws an error if a compilation error is encountered | ||
* | ||
*# Example | ||
* | ||
*```js | ||
*import init, { compiler } from "https://deno.land/x/melody/melody_wasm.js"; | ||
* | ||
*await init(); | ||
* | ||
*const source = ` | ||
* <start>; | ||
* | ||
* option of "v"; | ||
* | ||
* capture major { | ||
* some of <digit>; | ||
* } | ||
* | ||
* "."; | ||
* | ||
* capture minor { | ||
* some of <digit>; | ||
* } | ||
* | ||
* "."; | ||
* | ||
* capture patch { | ||
* some of <digit>; | ||
* } | ||
* | ||
* <end>; | ||
*`; | ||
* | ||
*try { | ||
* const output = compiler(source); | ||
* new RegExp(output).test("v1.1.1"); // true | ||
*} catch (error) { | ||
* // handle compilation error | ||
*} | ||
*``` | ||
* @param {string} source | ||
* @returns {string} | ||
*/ | ||
* | ||
*Compiles Melody source code to a regular expression | ||
* | ||
*# Errors | ||
* | ||
*Throws an error if a compilation error is encountered | ||
* | ||
*# Example | ||
* | ||
*```js | ||
*const source = ` | ||
* <start>; | ||
* | ||
* option of "v"; | ||
* | ||
* capture major { | ||
* some of <digit>; | ||
* } | ||
* | ||
* "."; | ||
* | ||
* capture minor { | ||
* some of <digit>; | ||
* } | ||
* | ||
* "."; | ||
* | ||
* capture patch { | ||
* some of <digit>; | ||
* } | ||
* | ||
* <end>; | ||
*`; | ||
* | ||
*try { | ||
* const output = compiler(source); | ||
* new RegExp(output).test("v1.1.1"); // true | ||
*} catch (error) { | ||
* // handle compilation error | ||
*} | ||
*``` | ||
* @param {string} source | ||
* @returns {string} | ||
*/ | ||
export function compiler(source: string): string; | ||
|
||
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; | ||
|
||
export interface InitOutput { | ||
readonly memory: WebAssembly.Memory; | ||
readonly compiler: (a: number, b: number, c: number) => void; | ||
readonly __wbindgen_add_to_stack_pointer: (a: number) => number; | ||
readonly __wbindgen_malloc: (a: number) => number; | ||
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number; | ||
readonly __wbindgen_free: (a: number, b: number) => void; | ||
} | ||
|
||
/** | ||
* Synchronously compiles the given `bytes` and instantiates the WebAssembly module. | ||
* | ||
* @param {BufferSource} bytes | ||
* | ||
* @returns {InitOutput} | ||
*/ | ||
export function initSync(bytes: BufferSource): InitOutput; | ||
|
||
/** | ||
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and | ||
* for everything else, calls `WebAssembly.instantiate` directly. | ||
* | ||
* @param {InitInput | Promise<InitInput>} module_or_path | ||
* | ||
* @returns {Promise<InitOutput>} | ||
*/ | ||
export default function init(module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>; | ||
*/ | ||
export function main(): void; |
Oops, something went wrong.