Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DataObjectService<T>

The object service manages the data of objects that are currently being processed in the model and objects that need to be tracked.

Type parameters

Hierarchy

Index

Constructors

constructor

Properties

dataType

dataType: new () => T

Type declaration

    • new (): T
    • Returns T

Protected driver

driver: DataServiceDriver<string, T>

logger

logger: (level: string, log: any) => void = ...

Type declaration

    • (level: string, log: any): void
    • Parameters

      • level: string
      • log: any

      Returns void

name

name: string

Service name

Readonly Static captureRejectionSymbol

captureRejectionSymbol: typeof captureRejectionSymbol

Static captureRejections

captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

Static defaultMaxListeners

defaultMaxListeners: number

Readonly Static errorMonitor

errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Methods

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): DataObjectService<T>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns DataObjectService<T>

count

createIndex

  • createIndex(index: string): Promise<void>

delete

  • delete(id: string): Promise<void>

deleteAll

  • deleteAll(): Promise<void>

emit

  • emit(name: string | symbol, ...args: any[]): boolean
  • emit(name: "ready"): boolean
  • emit(name: "destroy"): boolean

emitAsync

  • emitAsync(type: string | symbol, ...args: any[]): Promise<boolean>

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

findAfter

  • findAfter(timestamp: number): Promise<T[]>
  • Find data objects created after a certain timestamp

    Parameters

    • timestamp: number

      Timestamp

    Returns Promise<T[]>

    Array of data objects after the specified timestamp

findAll

findBefore

  • findBefore(timestamp: number): Promise<T[]>
  • Find data objects created before a certain timestamp

    Parameters

    • timestamp: number

      Timestamp

    Returns Promise<T[]>

    Array of data objects before the specified timestamp

findByDisplayName

  • findByDisplayName(displayName: string): Promise<T[]>
  • Find a data object by its display name

    Parameters

    • displayName: string

      Name to search for

    Returns Promise<T[]>

    Array of data objects that match the display name

findByParentUID

  • findByParentUID(parentUID: string): Promise<T[]>
  • Find all data objects with a parent UID

    Parameters

    • parentUID: string

      string Parent UID

    Returns Promise<T[]>

    Array of data objects that match the parent UID

findByPosition

findByUID

  • findByUID(uid: string): Promise<T>

findOne

getMaxListeners

  • getMaxListeners(): number

insert

  • insert(id: string, object: T): Promise<T>

insertObject

  • insertObject(object: T): Promise<T>

isReady

  • isReady(): boolean

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): DataObjectService<T>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns DataObjectService<T>

on

  • on(event: string | symbol, listener: (...args: any[]) => void): DataObjectService<T>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns DataObjectService<T>

once

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): DataObjectService<T>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns DataObjectService<T>

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): DataObjectService<T>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns DataObjectService<T>

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): DataObjectService<T>
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns DataObjectService<T>

setMaxListeners

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Static on

  • on(emitter: EventEmitter, event: string): AsyncIterableIterator<any>
  • Parameters

    • emitter: EventEmitter
    • event: string

    Returns AsyncIterableIterator<any>

Static once

  • once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>
  • once(emitter: DOMEventTarget, event: string): Promise<any[]>
  • Parameters

    • emitter: NodeEventTarget
    • event: string | symbol

    Returns Promise<any[]>

  • Parameters

    • emitter: DOMEventTarget
    • event: string

    Returns Promise<any[]>