@ruby/wasm-wasi
    Preparing search index...

    Type Alias RubyInitComponentOptions

    RubyInitComponentOptions:
        | {
            instantiate: (
                _: typeof RubyJsJsRuntime,
            ) => Promise<typeof RubyJsRubyRuntime>;
            args?: string[];
        }
        | {
            instantiate: RubyComponentInstantiator;
            getCoreModule: (path: string) => Promise<WebAssembly.Module>;
            instantiateCore?: (
                module: WebAssembly.Module,
                imports: Record<string, any>,
            ) => WebAssembly.Instance | Promise<WebAssembly.Instance>;
            wasip2: any;
            args?: string[];
        }

    Type declaration

    • {
          instantiate: (
              _: typeof RubyJsJsRuntime,
          ) => Promise<typeof RubyJsRubyRuntime>;
          args?: string[];
      }
      • instantiate: (_: typeof RubyJsJsRuntime) => Promise<typeof RubyJsRubyRuntime>

        A lower-level instantiation function that instantiates the Ruby component with the given component that implements "ruby:js/js-runtime" WIT interface.

      • Optionalargs?: string[]

        The arguments to pass to the Ruby VM. Note that the first argument must be the Ruby program name.

        ["ruby.wasm", "-EUTF-8", "-e_=0"]
        
    • {
          instantiate: RubyComponentInstantiator;
          getCoreModule: (path: string) => Promise<WebAssembly.Module>;
          instantiateCore?: (
              module: WebAssembly.Module,
              imports: Record<string, any>,
          ) => WebAssembly.Instance | Promise<WebAssembly.Instance>;
          wasip2: any;
          args?: string[];
      }
      • instantiate: RubyComponentInstantiator

        An instantiate function generated by @bytecodealliance/jco that instantiates the Ruby component.

      • getCoreModule: (path: string) => Promise<WebAssembly.Module>

        A function that returns a WebAssembly Core module within the Ruby component transpiled by @bytecodealliance/jco.

      • OptionalinstantiateCore?: (
            module: WebAssembly.Module,
            imports: Record<string, any>,
        ) => WebAssembly.Instance | Promise<WebAssembly.Instance>

        An optional function used to instantiate a WebAssembly Core module

      • wasip2: any

        WASI Preview 2 implementation, typically imported from import * as wasip2 from "@bytecodealliance/preview2-shim"

      • Optionalargs?: string[]

        The arguments to pass to the Ruby VM. Note that the first argument must be the Ruby program name.

        ["ruby.wasm", "-EUTF-8", "-e_=0"]