Interface ExtismPluginOptions

Options for initializing an Extism plugin.

Hierarchy

  • ExtismPluginOptions

Properties

allowedHosts?: string[]
allowedPaths?: {
    [key: string]: string;
}

Type declaration

  • [key: string]: string
enableWasiOutput?: boolean

Whether WASI stdout should be forwarded to the host.

Overrides the EXTISM_ENABLE_WASI_OUTPUT environment variable.

fetch?: {
    (input, init?): Promise<Response>;
    (input, init?): Promise<Response>;
}

Type declaration

    • (input, init?): Promise<Response>
    • Parameters

      • input: URL | RequestInfo
      • Optional init: RequestInit

      Returns Promise<Response>

    • (input, init?): Promise<Response>
    • Parameters

      • input: any
      • Optional init: RequestInit

      Returns Promise<Response>

functions?: {
    [key: string]: {
        [key: string]: ((callContext, ...args) => any);
    };
}

A map of namespaces to function names to host functions.

const functions = {
'my_great_namespace': {
'my_func': (callContext: CallContext, input: bigint) => {
const output = callContext.read(input);
if (output !== null) {
console.log(output.string());
}
}
}
}

Type declaration

  • [key: string]: {
        [key: string]: ((callContext, ...args) => any);
    }
    • [key: string]: ((callContext, ...args) => any)
        • (callContext, ...args): any
        • Parameters

          Returns any

logger?: Console

A logger implementation. Must provide info, debug, warn, and error methods.

runInWorker?: boolean

Whether or not to run the Wasm module in a Worker thread. Requires CAPABILITIES.hasWorkerCapability to be true. Defaults to false.

This feature is marked experimental as we work out a bug.

sharedArrayBufferSize?: number
useWasi?: boolean

Whether or not to enable WASI preview 1.

Generated using TypeDoc