Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

Clause

Clause<C>: C | C[]

Type parameters

  • C

EntityConstructor

EntityConstructor: (new () => EntityInterface) & { class: string; nymph: Nymph; factory: any; factoryReference: any; factorySync: any; serverCallStatic: any }

EntityData

EntityData: {}

Type declaration

  • [k: string]: any

EntityJson

EntityJson<T>: { cdate: number | null; class: T["class"]; data: EntityData; guid: string | null; mdate: number | null; tags: string[] }

Type parameters

Type declaration

  • cdate: number | null
  • class: T["class"]
  • data: EntityData
  • guid: string | null
  • mdate: number | null
  • tags: string[]

EntityPatch

EntityPatch: { addTags: string[]; class: string; guid: string; mdate: number | null; removeTags: string[]; set: EntityData; unset: string[] }

Type declaration

  • addTags: string[]
  • class: string
  • guid: string
  • mdate: number | null
  • removeTags: string[]
  • set: EntityData
  • unset: string[]

EntityReference

EntityReference: ["nymph_entity_reference", string, string]

EventType

EventType: "request" | "response"

HttpRequesterEventType

HttpRequesterEventType: "request" | "response"

HttpRequesterRequestCallback

HttpRequesterRequestCallback: (requester: HttpRequester, url: string, options: RequestInit) => void

Type declaration

    • (requester: HttpRequester, url: string, options: RequestInit): void
    • Parameters

      • requester: HttpRequester
      • url: string
      • options: RequestInit

      Returns void

HttpRequesterRequestOptions

HttpRequesterRequestOptions: { data: {}; dataType: string; url: string }

Type declaration

  • data: {}
    • [k: string]: any
  • dataType: string
  • url: string

HttpRequesterResponseCallback

HttpRequesterResponseCallback: (requester: HttpRequester, response: Response) => void

Type declaration

    • (requester: HttpRequester, response: Response): void
    • Parameters

      • requester: HttpRequester
      • response: Response

      Returns void

NymphOptions

NymphOptions: { WebSocket?: typeof WebSocket; fetch?: WindowOrWorkerGlobalScope["fetch"]; noConsole?: boolean; pubsubUrl?: string; restUrl: string; weakCache?: boolean }

Type declaration

  • Optional WebSocket?: typeof WebSocket

    A WebSocket implementation.

  • Optional fetch?: WindowOrWorkerGlobalScope["fetch"]

    A fetch implementation.

  • Optional noConsole?: boolean

    Whether to not output status messages to the console.

  • Optional pubsubUrl?: string

    The URL of your Nymph PubSub server.

  • restUrl: string

    The URL of your Nymph REST server.

  • Optional weakCache?: boolean

    Use a WeakRef based cache of entities.

    This ensures all entities returned are the same instance if they have the same class and GUID. This also means that whenever an entity is returned from the server, the single instance in memory will be refreshed. This could have annoying results, like destroying dirty data (the dreaded triple-D).

    This could also be a potential source of memory leaks. Although the entities themselves are referenced weakly so they get garbage collected, the GUID used as a key and the WeakRef object itself are not weak references, so not destroyed when the instance is garbage collected.

    However, even with these caveats, this might help you if you have a big app with the same entities stored in several different places in memory. This can help to synchronize them correctly and avoid data conflicts.

Options

Options<T>: { class: T; limit?: number; offset?: number; return?: "entity" | "guid"; reverse?: boolean; skipCache?: boolean; sort?: "cdate" | "mdate" }

Type parameters

Type declaration

  • class: T
  • Optional limit?: number
  • Optional offset?: number
  • Optional return?: "entity" | "guid"
  • Optional reverse?: boolean
  • Optional skipCache?: boolean
  • Optional sort?: "cdate" | "mdate"

OrWithTime

OrWithTime<T>: T | [string, null, string]

Type parameters

  • T

PubSubCallbacks

PubSubCallbacks<T>: [PubSubResolveCallback<T> | undefined, PubSubRejectCallback | undefined, PubSubCountCallback | undefined]

Type parameters

  • T

PubSubConnectCallback

PubSubConnectCallback: () => void

Type declaration

    • (): void
    • Returns void

PubSubCountCallback

PubSubCountCallback: (count: number) => void

Type declaration

    • (count: number): void
    • Parameters

      • count: number

      Returns void

PubSubDisconnectCallback

PubSubDisconnectCallback: () => void

Type declaration

    • (): void
    • Returns void

PubSubEventType

PubSubEventType: "connect" | "disconnect"

PubSubRejectCallback

PubSubRejectCallback: (err: any) => void

Type declaration

    • (err: any): void
    • Parameters

      • err: any

      Returns void

PubSubResolveCallback

PubSubResolveCallback<T>: (arg: T, event?: string) => void

Type parameters

  • T

Type declaration

    • (arg: T, event?: string): void
    • Parameters

      • arg: T
      • Optional event: string

      Returns void

PubSubSubscribable

PubSubSubscribable<T>: (resolve?: PubSubResolveCallback<T>, reject?: PubSubRejectCallback, count?: PubSubCountCallback) => PubSubSubscription<T>

Type parameters

  • T

Type declaration

PubSubUpdate

PubSubUpdate<T>: T | { query: string; removed: string } | { added: string; data: EntityJson; query: string } | { data: EntityJson; query: string; updated: string }

Type parameters

  • T

RequestCallback

RequestCallback: (url: string, options: RequestInit) => void

Type declaration

    • (url: string, options: RequestInit): void
    • Parameters

      • url: string
      • options: RequestInit

      Returns void

ResponseCallback

ResponseCallback: (response: Response) => void

Type declaration

    • (response: Response): void
    • Parameters

      • response: Response

      Returns void

Selector

Selector: { !contain?: Clause<OrWithTime<PrimitiveSelector["contain"]>>; !defined?: Clause<PrimitiveSelector["defined"]>; !equal?: Clause<OrWithTime<PrimitiveSelector["equal"]>>; !gt?: Clause<OrWithTime<PrimitiveSelector["gt"]>>; !gte?: Clause<OrWithTime<PrimitiveSelector["gte"]>>; !guid?: Clause<PrimitiveSelector["guid"]>; !ilike?: Clause<PrimitiveSelector["ilike"]>; !imatch?: Clause<PrimitiveSelector["imatch"]>; !like?: Clause<PrimitiveSelector["like"]>; !lt?: Clause<OrWithTime<PrimitiveSelector["lt"]>>; !lte?: Clause<OrWithTime<PrimitiveSelector["lte"]>>; !match?: Clause<PrimitiveSelector["match"]>; !qref?: Selector["qref"]; !ref?: Clause<PrimitiveSelector["ref"]>; !selector?: Selector["selector"]; !tag?: Clause<PrimitiveSelector["tag"]>; !truthy?: Clause<PrimitiveSelector["truthy"]>; contain?: Clause<OrWithTime<PrimitiveSelector["contain"]>>; defined?: Clause<PrimitiveSelector["defined"]>; equal?: Clause<OrWithTime<PrimitiveSelector["equal"]>>; gt?: Clause<OrWithTime<PrimitiveSelector["gt"]>>; gte?: Clause<OrWithTime<PrimitiveSelector["gte"]>>; guid?: Clause<PrimitiveSelector["guid"]>; ilike?: Clause<PrimitiveSelector["ilike"]>; imatch?: Clause<PrimitiveSelector["imatch"]>; like?: Clause<PrimitiveSelector["like"]>; lt?: Clause<OrWithTime<PrimitiveSelector["lt"]>>; lte?: Clause<OrWithTime<PrimitiveSelector["lte"]>>; match?: Clause<PrimitiveSelector["match"]>; qref?: Clause<[string, [Options, ...Selector[]]]>; ref?: Clause<PrimitiveSelector["ref"]>; selector?: Clause<Selector>; tag?: Clause<PrimitiveSelector["tag"]>; truthy?: Clause<PrimitiveSelector["truthy"]>; type: "&" | "|" | "!&" | "!|" }

Type declaration

  • Optional !contain?: Clause<OrWithTime<PrimitiveSelector["contain"]>>
  • Optional !defined?: Clause<PrimitiveSelector["defined"]>
  • Optional !equal?: Clause<OrWithTime<PrimitiveSelector["equal"]>>
  • Optional !gt?: Clause<OrWithTime<PrimitiveSelector["gt"]>>
  • Optional !gte?: Clause<OrWithTime<PrimitiveSelector["gte"]>>
  • Optional !guid?: Clause<PrimitiveSelector["guid"]>
  • Optional !ilike?: Clause<PrimitiveSelector["ilike"]>
  • Optional !imatch?: Clause<PrimitiveSelector["imatch"]>
  • Optional !like?: Clause<PrimitiveSelector["like"]>
  • Optional !lt?: Clause<OrWithTime<PrimitiveSelector["lt"]>>
  • Optional !lte?: Clause<OrWithTime<PrimitiveSelector["lte"]>>
  • Optional !match?: Clause<PrimitiveSelector["match"]>
  • Optional !qref?: Selector["qref"]
  • Optional !ref?: Clause<PrimitiveSelector["ref"]>
  • Optional !selector?: Selector["selector"]
  • Optional !tag?: Clause<PrimitiveSelector["tag"]>
  • Optional !truthy?: Clause<PrimitiveSelector["truthy"]>
  • Optional contain?: Clause<OrWithTime<PrimitiveSelector["contain"]>>
  • Optional defined?: Clause<PrimitiveSelector["defined"]>
  • Optional equal?: Clause<OrWithTime<PrimitiveSelector["equal"]>>
  • Optional gt?: Clause<OrWithTime<PrimitiveSelector["gt"]>>
  • Optional gte?: Clause<OrWithTime<PrimitiveSelector["gte"]>>
  • Optional guid?: Clause<PrimitiveSelector["guid"]>
  • Optional ilike?: Clause<PrimitiveSelector["ilike"]>
  • Optional imatch?: Clause<PrimitiveSelector["imatch"]>
  • Optional like?: Clause<PrimitiveSelector["like"]>
  • Optional lt?: Clause<OrWithTime<PrimitiveSelector["lt"]>>
  • Optional lte?: Clause<OrWithTime<PrimitiveSelector["lte"]>>
  • Optional match?: Clause<PrimitiveSelector["match"]>
  • Optional qref?: Clause<[string, [Options, ...Selector[]]]>
  • Optional ref?: Clause<PrimitiveSelector["ref"]>
  • Optional selector?: Clause<Selector>
  • Optional tag?: Clause<PrimitiveSelector["tag"]>
  • Optional truthy?: Clause<PrimitiveSelector["truthy"]>
  • type: "&" | "|" | "!&" | "!|"

SerializedEntityData

SerializedEntityData: {}

Type declaration

  • [k: string]: string

ServerCallResponse

ServerCallResponse: { entity?: EntityJson; return: any }

Type declaration

ServerCallStaticResponse

ServerCallStaticResponse: any

Generated using TypeDoc