diff --git a/classes/CallContext.html b/classes/CallContext.html index f70c276..d41414a 100644 --- a/classes/CallContext.html +++ b/classes/CallContext.html @@ -1,4 +1,4 @@ -CallContext | extism

Class CallContext

Hierarchy

  • CallContext

Properties

#arrayBufferType +CallContext | extism

Class CallContext

Hierarchy

  • CallContext

Properties

#arrayBufferType: (new (size) => ArrayBufferLike)

Type declaration

    • new (size): ArrayBufferLike
    • Parameters

      • size: number

      Returns ArrayBufferLike

#blocks: (null | Block)[] = []
#config: PluginConfig
#decoder: TextDecoder
#encoder: TextEncoder
#logger: Console
#stack: [null | number, null | number, null | number][]
#vars: Map<string, number> = ...

Methods

  • Allocate a chunk of host memory visible to plugins via other extism host functions. +

Properties

#arrayBufferType: (new (size) => ArrayBufferLike)

Type declaration

    • new (size): ArrayBufferLike
    • Parameters

      • size: number

      Returns ArrayBufferLike

#blocks: (null | Block)[] = []
#config: PluginConfig
#decoder: TextDecoder
#encoder: TextEncoder
#logger: Console
#stack: [null | number, null | number, null | number][]
#vars: Map<string, number> = ...

Methods

  • Allocate a chunk of host memory visible to plugins via other extism host functions. Returns the start address of the block.

    -

    Parameters

    • size: number | bigint

    Returns bigint

  • Read a variable from extism memory by name.

    +

    Parameters

    • size: number | bigint

    Returns bigint

  • Read a variable from extism memory by name.

    Parameters

    • name: string

    Returns null | PluginOutput

    PluginOutput

    -
  • Given an address in extism memory, return a PluginOutput that represents +

  • Given an address in extism memory, return a PluginOutput that represents a view of that memory. Returns null if the address is invalid.

    Parameters

    • addr: number | bigint

    Returns null | PluginOutput

    bigint

    -
  • Set a variable to a given string or byte array value. Returns the start +

  • Set a variable to a given string or byte array value. Returns the start address of the variable. The start address is reused when changing the value of an existing variable.

    Parameters

    • name: string
    • value: string | Uint8Array

    Returns bigint

    bigint

    -
  • Store a string or Uint8Array value in extism memory.

    Parameters

    • input: string | Uint8Array

    Returns bigint

    bigint

    -

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/createPlugin.html b/functions/createPlugin.html index dd24415..7ad1c0b 100644 --- a/functions/createPlugin.html +++ b/functions/createPlugin.html @@ -11,4 +11,4 @@
  • opts: ExtismPluginOptions = {}

    options for controlling the behavior of the plugin.

  • Returns Promise<Plugin>

    a promise for a Plugin.

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/Capabilities.html b/interfaces/Capabilities.html index 8e02406..e1cc0fd 100644 --- a/interfaces/Capabilities.html +++ b/interfaces/Capabilities.html @@ -1,4 +1,4 @@ -Capabilities | extism

    Interface Capabilities

    Hierarchy

    • Capabilities

    Properties

    allowSharedBufferCodec +Capabilities | extism

    Interface Capabilities

    Hierarchy

    • Capabilities

    Properties

    crossOriginChecksEnforced: boolean

    Whether or not cross-origin checks are enforced for outgoing HTTP requests on this platform.

    +
    crossOriginChecksEnforced: boolean

    Whether or not cross-origin checks are enforced for outgoing HTTP requests on this platform.

    • ❌ node
    • ❌ deno
    • @@ -22,7 +22,7 @@
    • ✅ chrome
    • ✅ webkit
    -
    fsAccess: boolean

    Whether or not the host environment has access to a filesystem.

    +
    fsAccess: boolean

    Whether or not the host environment has access to a filesystem.

    • ✅ node
    • ✅ deno
    • @@ -31,7 +31,7 @@
    • ❌ chrome
    • ❌ webkit
    -
    hasWorkerCapability: boolean

    Whether or not the host environment supports moving Wasm plugin workloads to a worker. This requires +

    hasWorkerCapability: boolean

    Whether or not the host environment supports moving Wasm plugin workloads to a worker. This requires SharedArrayBuffer support, which requires window.crossOriginIsolated to be true in browsers.

    See

    crossOriginalIsolated on MDN

      @@ -42,7 +42,7 @@
    • 🔒 chrome
    • 🔒 webkit
    -
    manifestSupportsPaths: boolean

    Whether or not ManifestWasm items support the "path:" key.

    +
    manifestSupportsPaths: boolean

    Whether or not ManifestWasm items support the "path:" key.

    • ✅ node
    • ✅ deno
    • @@ -51,7 +51,7 @@
    • ❌ chrome
    • ❌ webkit
    -
    supportsWasiPreview1: boolean

    Whether or not the host environment supports WASI preview 1.

    +
    supportsWasiPreview1: boolean

    Whether or not the host environment supports WASI preview 1.

    See

    WASI and WASI Preview 1

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/ExtismPluginOptions.html b/interfaces/ExtismPluginOptions.html index 38ddbb4..22d1efd 100644 --- a/interfaces/ExtismPluginOptions.html +++ b/interfaces/ExtismPluginOptions.html @@ -1,5 +1,5 @@ ExtismPluginOptions | extism

    Interface ExtismPluginOptions

    Options for initializing an Extism plugin.

    -

    Hierarchy

    • ExtismPluginOptions

    Properties

    Hierarchy

    • ExtismPluginOptions

    Properties

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

    Type declaration

    • [key: string]: string
    config?: PluginConfigLike
    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: RequestInfo
        • Optional init: RequestInit

        Returns Promise<Response>

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

    A map of namespaces to function names to host functions.

    +

    Properties

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

    Type declaration

    • [key: string]: string
    config?: PluginConfigLike
    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: RequestInfo
        • 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 +

    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.

    -
    sharedArrayBufferSize?: number
    useWasi?: boolean

    Whether or not to enable WASI preview 1.

    -

    Generated using TypeDoc

    \ No newline at end of file +
    sharedArrayBufferSize?: number
    useWasi?: boolean

    Whether or not to enable WASI preview 1.

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/Manifest.html b/interfaces/Manifest.html index b8f27e2..06d98b6 100644 --- a/interfaces/Manifest.html +++ b/interfaces/Manifest.html @@ -3,6 +3,6 @@

    Every member of .wasm is expected to be an instance of ManifestWasm.

    See

    Extism > Concepts > Manifest

    -

    Hierarchy

    Properties

    Hierarchy

    • Manifest

    Properties

    Properties

    config?: PluginConfigLike
    wasm: ManifestWasm[]

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    config?: PluginConfigLike
    wasm: ManifestWasm[]

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/ManifestWasmData.html b/interfaces/ManifestWasmData.html index b4880a9..4ac4d75 100644 --- a/interfaces/ManifestWasmData.html +++ b/interfaces/ManifestWasmData.html @@ -1,3 +1,3 @@ ManifestWasmData | extism

    Interface ManifestWasmData

    Represents the raw bytes of a WASM file loaded into memory

    -

    Hierarchy

    • ManifestWasmData

    Properties

    Properties

    data: Uint8Array

    Generated using TypeDoc

    \ No newline at end of file +

    Hierarchy

    Properties

    Properties

    data: Uint8Array

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/ManifestWasmModule.html b/interfaces/ManifestWasmModule.html index 36c9bb3..8d0c73a 100644 --- a/interfaces/ManifestWasmModule.html +++ b/interfaces/ManifestWasmModule.html @@ -1,3 +1,3 @@ ManifestWasmModule | extism

    Interface ManifestWasmModule

    Represents a WASM module as a response

    -

    Hierarchy

    • ManifestWasmModule

    Properties

    Properties

    module: Module

    Generated using TypeDoc

    \ No newline at end of file +

    Hierarchy

    Properties

    Properties

    module: Module

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/ManifestWasmPath.html b/interfaces/ManifestWasmPath.html index 0aeccd5..99423a4 100644 --- a/interfaces/ManifestWasmPath.html +++ b/interfaces/ManifestWasmPath.html @@ -1,3 +1,3 @@ ManifestWasmPath | extism

    Interface ManifestWasmPath

    Represents a path to a WASM module

    -

    Hierarchy

    • ManifestWasmPath

    Properties

    Properties

    path: string

    Generated using TypeDoc

    \ No newline at end of file +

    Hierarchy

    Properties

    Properties

    path: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/ManifestWasmResponse.html b/interfaces/ManifestWasmResponse.html index dbd3782..291a470 100644 --- a/interfaces/ManifestWasmResponse.html +++ b/interfaces/ManifestWasmResponse.html @@ -1,3 +1,3 @@ ManifestWasmResponse | extism

    Interface ManifestWasmResponse

    Represents a WASM module as a response

    -

    Hierarchy

    • ManifestWasmResponse

    Properties

    Properties

    response: Response

    Generated using TypeDoc

    \ No newline at end of file +

    Hierarchy

    Properties

    Properties

    response: Response

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/ManifestWasmUrl.html b/interfaces/ManifestWasmUrl.html index 236f68e..eeaa740 100644 --- a/interfaces/ManifestWasmUrl.html +++ b/interfaces/ManifestWasmUrl.html @@ -1,3 +1,3 @@ ManifestWasmUrl | extism

    Interface ManifestWasmUrl

    Represents a url to a WASM module

    -

    Hierarchy

    • ManifestWasmUrl

    Properties

    url -

    Properties

    url: string | URL

    Generated using TypeDoc

    \ No newline at end of file +

    Hierarchy

    Properties

    url +

    Properties

    url: string | URL

    Generated using TypeDoc

    \ No newline at end of file diff --git a/interfaces/Plugin.html b/interfaces/Plugin.html index fa41473..0f0ff32 100644 --- a/interfaces/Plugin.html +++ b/interfaces/Plugin.html @@ -1,4 +1,4 @@ -Plugin | extism

    Interface Plugin

    Hierarchy

    • Plugin

    Methods

    call +Plugin | extism

    Interface Plugin

    Hierarchy

    • Plugin

    Methods

    call close functionExists getExports @@ -10,10 +10,10 @@

    Parameters

    • funcName: string | [string, string]

      The name of the function to call

    • Optional input: string | number | Uint8Array

      The input to pass to the function

    Returns Promise<null | PluginOutput>

    The result from the function call

    -
    • Check if a function exists in the WebAssembly module.

      +
    • Check if a function exists in the WebAssembly module.

      Parameters

      • funcName: string | [string, string]

        The function's name, or a tuple of target module name and function name.

      Returns Promise<boolean>

      true if the function exists, otherwise false

      -
    • Parameters

      • Optional name: string

      Returns Promise<ModuleExportDescriptor[]>

    • Parameters

      • Optional name: string

      Returns Promise<ModuleImportDescriptor[]>

    • Parameters

      • Optional name: string

      Returns Promise<Instance>

    • Whether the plugin is currently processing a call.

      -

      Returns boolean

    • Parameters

      • Optional name: string

      Returns Promise<ModuleExportDescriptor[]>

    • Parameters

      • Optional name: string

      Returns Promise<ModuleImportDescriptor[]>

    • Parameters

      • Optional name: string

      Returns Promise<Instance>

    • Whether the plugin is currently processing a call.

      +

      Returns boolean

    • Reset Plugin memory. If called while the plugin is actively executing, memory will not be reset.

      Returns Promise<boolean>

      Whether or not the reset was successful.

      -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/ManifestLike.html b/types/ManifestLike.html index 1a83e10..9ad97db 100644 --- a/types/ManifestLike.html +++ b/types/ManifestLike.html @@ -13,4 +13,4 @@

    See

    Extism > Concepts > Manifest

    Throws

    TypeError when URL parameters don't resolve to a known content-type

    Throws

    TypeError when the resulting Manifest does not contain a wasm member with valid ManifestWasm items.

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/types/ManifestWasm.html b/types/ManifestWasm.html index e734b12..010a78d 100644 --- a/types/ManifestWasm.html +++ b/types/ManifestWasm.html @@ -1,2 +1,2 @@ ManifestWasm | extism

    Type alias ManifestWasm

    ManifestWasm: (ManifestWasmUrl | ManifestWasmData | ManifestWasmPath | ManifestWasmResponse | ManifestWasmModule) & {
        hash?: string;
        name?: string;
    }

    The WASM to load as bytes, a path, a fetch Response, a WebAssembly.Module, or a url

    -

    Type declaration

    • Optional hash?: string
    • Optional name?: string

    Generated using TypeDoc

    \ No newline at end of file +

    Type declaration

    Generated using TypeDoc

    \ No newline at end of file diff --git a/variables/CAPABILITIES-1.html b/variables/CAPABILITIES-1.html index e52dfeb..8ebb599 100644 --- a/variables/CAPABILITIES-1.html +++ b/variables/CAPABILITIES-1.html @@ -1,3 +1,3 @@ CAPABILITIES | extism

    Variable CAPABILITIESConst

    CAPABILITIES: Capabilities

    The Capabilities supported by the current platform.

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file