@dxos/react-client
    Preparing search index...

    Class Client

    The Client class encapsulates the core client-side API of DXOS.

    Index

    Constructors

    Properties

    reloaded: Event<void>

    Emitted after the client is reset and the services have finished restarting.

    version: "0.16.0"

    The version of this client API.

    Accessors

    • get config(): Config

      Current configuration object.

      Returns Config

    • get edge(): ClientEdgeAPI

      EDGE client. This API is experimental and subject to change.

      Returns ClientEdgeAPI

    • get fatalError(): MulticastObservable<null | Error>

      Set when the system status stream fails after open; cleared only when the client reopens.

      Returns MulticastObservable<null | Error>

    • get graph(): Hypergraph

      ECHO graph.

      Returns Hypergraph

    • get halo(): Halo

      HALO credentials.

      Returns Halo

    • get indexActivity(): MulticastObservable<IndexActivity>

      Index work queries answer through, such as catch-up and the full-text index, for a progress indicator.

      Returns MulticastObservable<IndexActivity>

    • get indexStatus(): MulticastObservable<null | IndexStatus>

      What the ECHO index is doing (migrating, rebuilding, idle), for a boot screen or progress indicator. Reported by the worker while the client opens, then streamed from the host; null until the host first reports.

      Returns MulticastObservable<null | IndexStatus>

    • get initialized(): boolean

      Whether the client is ready: initialize() has completed and the client can be used. With ClientOptions.bootCache that can be from the cache, before the services answer; see servicesReady.

      Returns boolean

    • get mesh(): MeshProxy

      MESH networking.

      Returns MeshProxy

    • get resetting(): boolean

      True while an in-progress reset is tearing down services. Consumers that react to service disconnect/reconnect (e.g. to force a reload) should check this before choosing a reload target — mid-reset, the current route is stale and reloading to it would reopen now-cleared UI, so navigate to the origin instead.

      Returns boolean

    • get servicesReady(): boolean

      Whether the client services are open and answering. Implies initialized.

      Returns boolean

    • get shell(): Shell

      Shell API.

      Returns Shell

    • get spaces(): Echo

      ECHO Spaces.

      Returns Echo

    • get status(): MulticastObservable<null | SystemStatus>

      Client services system status.

      Returns MulticastObservable<null | SystemStatus>

    Methods

    • Returns Promise<void>

    • Returns string

    • Add schema types to the client.

      Parameters

      • types: AnyEntity[]

      Returns Promise<void>

    • Cleanup, release resources. Open/close is re-entrant.

      Returns Promise<void>

    • Get client diagnostics data.

      Parameters

      • Optionaloptions: JsonKeyOptions

      Returns Promise<any>

    • Initializes internal resources in an idempotent way. Required before using the Client instance.

      Returns Promise<Client>

    • Test and repair database.

      Returns Promise<any>

    • Resets and destroys client storage. This will currently leave the client in a closed state. Re-using the client after reset is not currently supported.

      Returns Promise<void>

    • Reinitialized the client session with the remote service host. This is useful when connecting to a host running behind a resource lock (e.g., HALO when SharedWorker is unavailable).

      Returns Promise<void>

    • Returns {
          halo: undefined | HaloProxy;
          initialized: boolean;
          mesh: undefined | MeshProxy;
          spaces: undefined | SpaceList;
      }

    • Returns string

    • Resolves once the client is ready (milestone client.ready): initialize() has completed, and identity, spaces and queries can be used. With ClientOptions.bootCache that can be from the cache, before the services answer. An app waits on this to render.

      Waits indefinitely unless timeout is given, in which case it rejects with TimeoutError — opt-in because most consumers only want the completion signal, and bounding the session is the caller's job (see the app entry point).

      This is the completion signal, not the error channel: a failing initialize() rejects at its own call site, and this promise stays pending.

      Parameters

      • Optional__namedParameters: { timeout?: number }

      Returns Promise<void>

    • Resolves once the client services are open and answering (milestone client.services-ready), never before waitUntilInitialized. Without ClientOptions.bootCache both resolve together; with it, this can come well after. Wait on this only for what the cache cannot stand in for: observability, releasing a resource the services take over, or acting on a result only the services can report.

      Rejects when services the client opened from the cache fail to open, since initialize() has already returned and cannot report it, and with ContextDisposedError when the client is destroyed first; timeout behaves as in waitUntilInitialized.

      Parameters

      • Optional__namedParameters: { timeout?: number }

      Returns Promise<void>