WasmParserWorld constructor

WasmParserWorld({
  1. required WasmParserWorldImports imports,
  2. required WasmLibrary library,
})

Implementation

WasmParserWorld({
  required this.imports,
  required this.library,
})  : _wasm2wasmComponent = library.getComponentFunctionWorker(
        'wasm2wasm-component',
        const FuncType([
          ('input', WasmInput._spec),
          ('wit', OptionType(StringType())),
          ('adapters', ListType(ComponentAdapter._spec))
        ], [
          ('', ResultType(ListType(U8()), StringType()))
        ]),
      )!,
      _wasmComponent2wit = library.getComponentFunctionWorker(
        'wasm-component2wit',
        const FuncType([('input', WasmInput._spec)],
            [('', ResultType(StringType(), StringType()))]),
      )!,
      _wat2wasm = library.getComponentFunctionWorker(
        'wat2wasm',
        const FuncType([('input', WatInput._spec)],
            [('', ResultType(ListType(U8()), StringType()))]),
      )!,
      _wasm2wat = library.getComponentFunctionWorker(
        'wasm2wat',
        const FuncType([('input', WasmInput._spec)],
            [('', ResultType(StringType(), StringType()))]),
      )!,
      _parseWat = library.getComponentFunctionWorker(
        'parse-wat',
        const FuncType([('input', WatInput._spec)],
            [('', ResultType(WasmType._spec, StringType()))]),
      )!,
      _parseWasm = library.getComponentFunctionWorker(
        'parse-wasm',
        const FuncType([('input', WasmInput._spec)],
            [('', ResultType(WasmType._spec, StringType()))]),
      )!,
      _validateWasm = library.getComponentFunctionWorker(
        'validate-wasm',
        const FuncType([
          ('input', WasmInput._spec),
          ('features', OptionType(WasmFeatures._spec))
        ], [
          ('', ResultType(WasmType._spec, StringType()))
        ]),
      )!,
      _defaultWasmFeatures = library.getComponentFunctionWorker(
        'default-wasm-features',
        const FuncType([], [('', WasmFeatures._spec)]),
      )!;