Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface StreamAdapter

Interface for the stream adapters

Hierarchy

  • StreamAdapter

Implemented by

Index

Properties

Optional adapter

adapter: undefined | ((specification: TopicSpecification) => StreamAdapter)

Optional function for creating a stream adapter that matches a specific topic specification.

Methods

onDelta

  • onDelta(path: string, specification: TopicSpecification, oldContent: Uint8Array | null, content: Uint8Array, delta: BinaryDelta | null, oldValue: any, newValue: any): void
  • Handle a delta event

    throws

    an InvalidDataError if the value is incompatible with the data type, or buffer does not represent a valid value.

    Parameters

    • path: string

      the topic path

    • specification: TopicSpecification

      the topic specification

    • oldContent: Uint8Array | null

      the buffer containing the old content

    • content: Uint8Array

      the content that was received

    • delta: BinaryDelta | null

      the delta

    • oldValue: any

      the old value

    • newValue: any

      the new value

    Returns void

onOpen

  • onOpen(): void
  • Handle the open event

    Returns void

onSubscription

  • Handle a subscription event

    Parameters

    Returns void

onSubscriptionError

  • Handle a subscription error

    Parameters

    Returns void

onUnsubscription

  • Handle a subscription event

    Parameters

    Returns void

onValue

  • onValue(path: string, specification: TopicSpecification, oldContent: Uint8Array | null, content: Uint8Array, oldValue: any, newValue: any): void
  • Handle a value event

    throws

    an InvalidDataError if the value is incompatible with the data type, or buffer does not represent a valid value.

    Parameters

    • path: string

      the topic path

    • specification: TopicSpecification

      the topic specification

    • oldContent: Uint8Array | null

      the buffer containing the old content

    • content: Uint8Array

      the content that was received

    • oldValue: any

      the old value

    • newValue: any

      the new value

    Returns void

selects

  • Check if the stream adapter selects a topic specification

    Parameters

    Returns boolean

    true if the adapter matches the specification

Copyright © 2025 DiffusionData Ltd. All Rights Reserved.