import { Gateway } from "./gateway"; import { Hologram, hologramCtor, InternalBaseHologram, InternalFixture } from "./hologram"; import { Domain } from "./domain"; import { QueryFilter, QueryResult, QuerySorting } from "./query"; import { ValueMapType, ValueType } from "./value"; import { Serialized, SerializedType } from "./serialize"; /** * The Bitnode class represents a Bitnode connection. * * It provides methods to interact with a Bitnode instance. */ export declare class Bitnode { private apiUrl; static models: Map>; private static _instance; /** * The singleton instance of the Bitnode class. * * Primarily used internally when creating new Hologram instances to spark the Hologram on the Bitnode. * * @internal */ private static get instance(); private static set instance(value); private _ws?; private _closeWs; private _requests; private _gateway; private _holograms; private _queries; private _domain?; private static _handlers; /** * Creates a new Bitnode instance. * * @param apiUrl The URL of the Bitnode websocket server. * @param domain The domain to use for the Bitnode instance. * @param gateway The gateway to use for the Bitnode instance. If not provided, a new {@link Gateway} will be created. */ constructor(apiUrl: string, domain?: Domain, gateway?: Gateway); private cbs; connect(): Promise; disconnect(): Promise; get gateway(): Gateway; get domain(): Domain | undefined; getId(): Promise; getName(): Promise; setName(name: string): void; getDomain(): Promise; getPlugins(): Promise; getGateways(): Promise; spark(hgCtor: hologramCtor, values: Serialized | SerializedType, gateway?: string, clazz?: string): Promise; getHologram(hgCtor: hologramCtor, holoId: string): Promise; getHolograms(meta: { gateway: string; model: string; class: string; }): Promise; deleteHologram(hologramId: string): Promise; query(hgCtor: hologramCtor, keepAlive?: boolean, filters?: QueryFilter[], sortings?: QuerySorting[], offset?: number, limit?: number): Promise>; getFixture(hgCtor: hologramCtor, name: string): Promise; getFixtures(): Promise; private createModelHologram; private createClassHologram; private unpackHologram; /** * @internal */ detachQuery(queryId: string): Promise; private sendHologramValue; private receiveHologramValue; private receiveQueryAdd; private receiveQueryRemove; private receiveQueryInitialDone; private gatewayStart; private gatewayLoad; private gatewayStop; private gatewayModel; private gatewayGetName; private gatewayGetVersion; private gatewayGetPlugin; private gatewayGetBlueprints; private gatewayGetBlueprint; private gatewayUpdate; private gatewayInvoke; private gatewayInvokeDirect; /** * Called when a hologram value is set for a hologram that the gateway has subscribed to. */ private gatewaySetHologramValue; /** * Called when a hologram value is emitted for a hologram that the gateway has subscribed to. */ private gatewayEmitHologramValue; /** * Called when a hologram is added to a query that the gateway has subscribed to. */ private gatewayQueryAdd; /** * Called when a hologram is removed from a query that the gateway has subscribed to. */ private gatewayQueryRemove; /** * Called when a query has finished its initial query. */ private gatewayQueryInitialDone; private static handler; private sendSync; private sendSyncSerialized; private sendAsync; private handle; private send; } export interface PluginInfo { [_: string]: ValueType; version: string; blueprints: any[]; } export interface GatewayInfo { [_: string]: ValueType; name: string; version: string; plugin: string; blueprints: any[]; }