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

    Class IdeConnection

    Presently, this is the entrypoint into the Deephaven JS API. By creating an instance of this with the server URL and some options, JS applications can run code on the server and interact with available exportable objects.

    Implements

    Index
    EVENT_DISCONNECT: string
    EVENT_RECONNECT: string
    EVENT_SHUTDOWN: string
    HACK_CONNECTION_FAILURE: string
    • 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.

    • Closes the current connection, releasing any resources on the server or client.

      Returns void

    • Returns Promise<string[]>

    • Reads an object shared by another client to this server with the sharedTicketBytes. Until the other client releases this object (or their session ends), the object will be available on the server.

      The type of the object must be passed so that the object can be read from the server correct - the other client should provide this information.

      Parameters

      • sharedTicketBytes: string | Uint8Array

        The value provided by another client/user to obtain the object. It may be a unicode string (will be encoded as utf8 bytes), or a Uint8Array value.

      • type: string

        The type of the object, so it can be correctly read from the server.

      Returns PendingObject

      the shared object, as a pending object that rejects with an error if it cannot be read

    • Load the named table, with columns and size information already fully populated.

      Parameters

      • name: string

        the name of the table to fetch.

      • OptionalapplyPreviewColumns: boolean

        false to disable previews. Defaults to true.

      Returns PendingTable<Table>

      the table, as a pending table that rejects with an error if it cannot be loaded

      Added to resolve a specific issue, in the future preview will be applied as part of the subscription.

    • 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.

    • Merges the given tables into a single table. Assumes all tables have the same structure.

      Parameters

      • tables: readonly TableReference[]

        the tables to merge, which must have the same columns and be from this connection

      Returns PendingTable<Table>

      the merged table, as a pending table

    • Creates a table on the server from the given column data.

      Parameters

      • columnNames: string[]

        the name of each column

      • types: string[]

        the type of each column

      • data: string[][]

        the values of each column, as strings

      • userTimeZone: string

        the time zone to read date-time values in

      Returns PendingTable<Table>

      the new table, as a pending table

    • 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.

    • Register a callback function to handle any log messages that are emitted on the server. Returns a function , which can be invoked to remove this log handler. Any log handler registered in this way will receive as many old log messages as are presently available.

      Parameters

      Returns () => void

      io.deephaven.web.shared.fu.JsRunnable

    • Removes an event listener added to this table.

      Type Parameters

      • T

      Parameters

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

      Returns boolean

    • Promise that resolves when this worker instance can be connected to, or rejects if it can't be used.

      Returns Promise<IdeConnection>

      A promise that resolves with this instance.

    • Makes an object available to another user or another client on this same server which knows the value of the sharedTicketBytes. Use that sharedTicketBytes value like a one-time use password - any other client which knows this value can read the same object.

      Shared objects will remain available using the sharedTicketBytes until the client that first shared them releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until the remote end has signaled that it has successfully fetched the object before releasing it from this client. A pending table that nothing awaits is released once its result arrives and the share has been made, so keep it by awaiting it, or share the table that awaiting gives.

      Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to prevent access by unauthorized clients.

      Parameters

      Returns Promise<string | Uint8Array>

      A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read by another client, or will reject if an error occurs.

    • Parameters

      • type: string

      Returns Promise<IdeSession>

    • Parameters

      Returns () => void