@deephaven/jsapi-types
    Preparing search index...

    Class CoreClient

    A client for connecting to a Deephaven server from the Deephaven JS API.

    This type manages connection lifecycle and authentication state, and provides helpers to fetch server and authentication-related configuration.

    Implements

    Index
    EVENT_CONNECT: string
    EVENT_DISCONNECT: string
    EVENT_RECONNECT: string
    EVENT_RECONNECT_AUTH_FAILED: string
    EVENT_REFRESH_TOKEN_UPDATED: string
    EVENT_REQUEST_FAILED: string
    EVENT_REQUEST_STARTED: string
    EVENT_REQUEST_SUCCEEDED: string
    FEATURES?: Features

    A collection of feature flags that the JS API advertises. All must be nullable booleans, and if listed, the value is true.

    Marked as nullable as past releases will not have this property, be sure to test for null if an older release might be in use.

    LOGIN_TYPE_ANONYMOUS: string

    Password login type.

    When used as credentials.type for CoreClient.login(), the credentials must include a username and a password.

    LOGIN_TYPE_PASSWORD: string

    Password login type.

    When used as credentials.type for CoreClient.login(), the credentials must include a username and a password.

    • Listen for events on this object.

      Type Parameters

      • T

        The type of the data that the event will provide.

      Parameters

      • name: string

        The name of the event to listen for.

      • callback: (e: Event<T>) => void

        A function to call when the event occurs.

      Returns () => void

      Returns a cleanup function.

    • Disconnects and releases resources associated with this client.

      Returns void

    • Fetches authentication configuration values.

      This method is intended to be used before a session is established.

      Returns Promise<string[][]>

      a promise of key/value pairs, returned as a two-element string array per entry

    • Fetches server configuration values for the current connection.

      Returns Promise<string[][]>

      a promise of configuration entries as an array of [key, value] string pairs

    • Returns the server URL associated with this client.

      Returns string

    • Checks whether any event listeners are registered for the given event name.

      Parameters

      • name: string

        The event name.

      Returns boolean

      true if there is at least one listener registered for name; false otherwise.

    • Logs in using the provided credentials.

      Parameters

      Returns Promise<void>

      a promise which resolves once the client has connected using the provided credentials

    • Returns a promise that resolves the next time the named event occurs, with the value of the event's detail. If a timeout is specified and occurs before the event takes place, the promise will reject, otherwise waits indefinitely.

      Type Parameters

      • T

        The type of the event detail.

      Parameters

      • eventName: string

        The event name.

      • OptionaltimeoutInMillis: number

        Optional timeout in milliseconds.

      Returns Promise<Event<T>>

      A promise that resolves with the next matching event.

    • Resolves when the client is connected.

      Parameters

      • OptionaltimeoutInMillis: number

        ignored, only exists for legacy callers

      Returns Promise<void>

      a promise that resolves when connection is established, or rejects if connection fails

    • Removes an event listener added to this table.

      Type Parameters

      • T

      Parameters

      • name: string
      • callback: (e: Event<T>) => void

      Returns boolean

    • Indicates whether this client instance is still usable.

      Returns Promise<CoreClient>

      a promise which resolves to this when the client is usable