UNPKG

watr

Version:

Light & fast WAT compiler – WebAssembly Text to binary, parse, print, transform

22 lines 1.15 kB
/** * Compile WAT to binary. Supports string, AST, and tagged template. * * @param {Object} backend - { parse, compile, optimize, polyfill } primitives * @param {string|Array|TemplateStringsArray} source - WAT source, AST, or template strings * @param {any[]} values - Interpolation values (for template literal) * Last value can be options object: * - polyfill: true | 'funcref sign_ext' | { funcref: true } * - optimize: true | 'fold treeshake' | { fold: true } * @returns {Uint8Array} WebAssembly binary */ export function compile(backend: any, source: string | any[] | TemplateStringsArray, values: any[]): Uint8Array; /** * Compile and instantiate WAT, returning exports. * * @param {Object} backend - { parse, compile, optimize, polyfill } primitives * @param {string|Array|TemplateStringsArray} source - WAT source, AST, or template strings * @param {any[]} values - Interpolation values (for template literal) * @returns {WebAssembly.Exports} Module exports */ export function watr(backend: any, source: string | any[] | TemplateStringsArray, values: any[]): WebAssembly.Exports; //# sourceMappingURL=template.d.ts.map