Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Container

Hierarchy

  • AsyncEventEmitter
  • AsyncEventEmitter
    • Container

Index

Constructors

constructor

Properties

adapter

adapter: Adapter

isLoaded

  • get isLoaded(): boolean

isLoading

  • get isLoading(): boolean

listeners

listeners: EventListener[] = []

mappers

mappers: ContainerMappers

validator

validator: any

Accessors

maxListeners

  • get maxListeners(): number
  • set maxListeners(value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

Methods

createRecord

  • Parameters

    Returns Record

emit

  • emit(namespace: string, ...data: any[]): Promise<void>
  • Parameters

    • namespace: string
    • Rest ...data: any[]

    Returns Promise<void>

find

  • find(mapper: string): Query
  • Parameters

    • mapper: string

    Returns Query

findAll

  • findAll(mapper: string, query: Query | object): Promise<Record[]>
  • Parameters

    • mapper: string
    • query: Query | object

    Returns Promise<Record[]>

get

  • get(mapper: string, id: string): Promise<Record>
  • Parameters

    • mapper: string
    • id: string

    Returns Promise<Record>

getAll

  • getAll(mapper: string, ids: string[]): Promise<Record[]>
  • Parameters

    • mapper: string
    • ids: string[]

    Returns Promise<Record[]>

insert

  • Parameters

    Returns Promise<Record>

insertAll

  • Parameters

    Returns Promise<Record[]>

load

  • load(): Promise<__type>
  • Returns Promise<__type>

on

  • on(namespace: string | RegExp, callback: Function, once?: boolean): any
  • Parameters

    • namespace: string | RegExp
    • callback: Function
    • Default value once: boolean = false

    Returns any

once

  • once(namespace: string | RegExp, callback: Function): EventListener
  • Subscribe a callable function to a namespace, for exactly one execution.

    Parameters

    • namespace: string | RegExp
    • callback: Function

    Returns EventListener

    Used to manage the subscription status via open and close methods.

pop

  • pop(listener: EventListener): boolean
  • Remove a Listener instance from the EventNamespace instance. Called with unsubscribe method.

    Parameters

    • listener: EventListener

    Returns boolean

    A true value indicates a successful pop.

push

  • push(listener: EventListener): void
  • Add a Listener instance to the EventNamespace instance. Called with subscribe method.

    Parameters

    • listener: EventListener

    Returns void

remove

  • Parameters

    Returns Promise<Record>

replace

  • replace(mapper: string, id: string, data: RecordData, validate?: boolean, rev?: string): Promise<Record>
  • Parameters

    • mapper: string
    • id: string
    • data: RecordData
    • Optional validate: boolean
    • Optional rev: string

    Returns Promise<Record>

truncate

  • truncate(mapper: string): Promise<boolean>
  • Parameters

    • mapper: string

    Returns Promise<boolean>

update

  • update(mapper: string, id: string, data: object): Promise<Record>
  • Parameters

    • mapper: string
    • id: string
    • data: object

    Returns Promise<Record>