For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Type Alias AddProtocolResponseData

AddProtocolResponseData:
    | ArrayBuffer
    | ImageBitmap
    | HTMLImageElement
    | string
    | object

The data a protocol handler resolves with. Which member is expected follows RequestParameters.type:

  • 'arrayBuffer': an ArrayBuffer, for example a non-compressed pbf vector tile.
  • 'json': the parsed JSON value.
  • 'string': a string.
  • 'image': an ImageBitmap or HTMLImageElement, used as is, or an ArrayBuffer of encoded image bytes, which are decoded first. A handler that already holds decoded pixels should return them as an ImageBitmap, since encoding them only makes the library decode them again.
Was this helpful?