automaton

An automaton library & basic programs written in Rust
git clone git://git.ethandl.dev/automaton
Log | Files | Refs | README

automaton.d.ts (2703B)


      1 /* tslint:disable */
      2 /* eslint-disable */
      3 /**
      4 */
      5 export class WebAutomatonError {
      6   free(): void;
      7 /**
      8 * @returns {string}
      9 */
     10   to_string(): string;
     11 }
     12 /**
     13 */
     14 export class WebRegex {
     15   free(): void;
     16 /**
     17 * @param {string} regex
     18 */
     19   constructor(regex: string);
     20 /**
     21 * @param {string} input
     22 * @returns {boolean}
     23 */
     24   accepts(input: string): boolean;
     25 /**
     26 * @returns {string}
     27 */
     28   regex_string(): string;
     29 /**
     30 * @returns {string}
     31 */
     32   regex_to_string(): string;
     33 /**
     34 * @returns {string}
     35 */
     36   enfa_to_string(): string;
     37 /**
     38 * @returns {string}
     39 */
     40   nfa_to_string(): string;
     41 /**
     42 * @returns {string}
     43 */
     44   dfa_to_string(): string;
     45 /**
     46 * @returns {string}
     47 */
     48   enfa_dot(): string;
     49 /**
     50 * @returns {string}
     51 */
     52   nfa_dot(): string;
     53 /**
     54 * @returns {string}
     55 */
     56   dfa_dot(): string;
     57 }
     58 
     59 export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
     60 
     61 export interface InitOutput {
     62   readonly memory: WebAssembly.Memory;
     63   readonly __wbg_webautomatonerror_free: (a: number) => void;
     64   readonly webautomatonerror_to_string: (a: number, b: number) => void;
     65   readonly __wbg_webregex_free: (a: number) => void;
     66   readonly webregex_new: (a: number, b: number, c: number) => void;
     67   readonly webregex_accepts: (a: number, b: number, c: number) => number;
     68   readonly webregex_regex_string: (a: number, b: number) => void;
     69   readonly webregex_regex_to_string: (a: number, b: number) => void;
     70   readonly webregex_enfa_to_string: (a: number, b: number) => void;
     71   readonly webregex_nfa_to_string: (a: number, b: number) => void;
     72   readonly webregex_dfa_to_string: (a: number, b: number) => void;
     73   readonly webregex_enfa_dot: (a: number, b: number) => void;
     74   readonly webregex_nfa_dot: (a: number, b: number) => void;
     75   readonly webregex_dfa_dot: (a: number, b: number) => void;
     76   readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
     77   readonly __wbindgen_free: (a: number, b: number, c: number) => void;
     78   readonly __wbindgen_malloc: (a: number, b: number) => number;
     79   readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
     80 }
     81 
     82 export type SyncInitInput = BufferSource | WebAssembly.Module;
     83 /**
     84 * Instantiates the given `module`, which can either be bytes or
     85 * a precompiled `WebAssembly.Module`.
     86 *
     87 * @param {SyncInitInput} module
     88 *
     89 * @returns {InitOutput}
     90 */
     91 export function initSync(module: SyncInitInput): InitOutput;
     92 
     93 /**
     94 * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
     95 * for everything else, calls `WebAssembly.instantiate` directly.
     96 *
     97 * @param {InitInput | Promise<InitInput>} module_or_path
     98 *
     99 * @returns {Promise<InitOutput>}
    100 */
    101 export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;