Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DeltaType<ValueType, SourceType, CBORType>

Type parameters

  • ValueType

  • SourceType

  • CBORType

Hierarchy

  • DeltaType

Index

Methods

apply

  • apply(oldValue: SourceType, delta: BinaryDelta): ValueType | null
  • Parameters

    Returns ValueType | null

    the new value generated applying the delta to the old value

diff

  • diff(oldValue: SourceType, newValue: SourceType): BinaryDelta
  • Parameters

    • oldValue: SourceType
    • newValue: SourceType

    Returns BinaryDelta

    the delta between values

isValueCheaper

  • isValueCheaper(value: SourceType, delta: BinaryDelta): boolean
  • Parameters

    Returns boolean

    true if the value is considered cheaper than the delta

name

  • name(): string
  • Returns string

    the name

noChange

  • Returns BinaryDelta

    unique object representing no change in value

readDelta

  • readDelta(buffer: Uint8Array, offset?: undefined | number, length?: undefined | number): BinaryDelta
  • Parameters

    • buffer: Uint8Array
    • Optional offset: undefined | number
    • Optional length: undefined | number

    Returns BinaryDelta

    the delta

writeDelta

  • Parameters

    Returns Buffer

    the serialised form of the delta

writeDeltaToArray

  • Parameters

    Returns Uint8Array

    the serialised form of the delta