Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @laniakea/utils

Index

Type aliases

Constructor

Constructor<T>: new (...args: any[]) => T

Type parameters

  • T

Type declaration

    • new (...args: any[]): T
    • Parameters

      • Rest ...args: any[]

      Returns T

NominalType

NominalType<AliasedType, TypeNameString>: AliasedType & { __brand: TypeNameString }

Utility to get nominally typed type-aliases See Approach 4 in https://michalzalecki.com/nominal-typing-in-typescript/

Type parameters

  • AliasedType

  • TypeNameString

SerializationStream

SerializationStream: ReadStream | WriteStream | MeasureStream

ShortTypeId

ShortTypeId: NominalType<number, "ShortTypeId">

A short typeId that's better for network message size but requires a lookup in the ClassRegistry 16-bit sequential id

TypeId

TypeId: NominalType<number, "TypeId">

A long type id that is computable from the typename 64-bit hash

TypeName

TypeName: string

The human readable name of the type, must be globally unique.

Variables

Let MAX_SHORT_TYPE_ID_EXCLUSIVE

MAX_SHORT_TYPE_ID_EXCLUSIVE: number = ...

Functions

measureAndSerialize

measureSerializable

periodicCallback

  • Scheduled a callback repeatedly at periodMS milliseconds after the start of each callback call. Avoids the period being dependent on execution time. This is not guaranteed if the callback takes longer than periodMS or if the executor is hogged by other code.

    Parameters

    • callback: () => void
        • (): void
        • Returns void

    • periodMS: number
    • cosmeticName: string

      Name of the callback used in errors and warnings.

    Returns PeriodicCallbackHandle

Generated using TypeDoc