UNPKG

@casual-simulation/aux-vm-client

Version:

A set of utilities required to securely run an AUX as a client.

41 lines 2.54 kB
import type { PartitionAuthSource } from '@casual-simulation/aux-common'; import { InstRecordsClient } from '@casual-simulation/aux-common'; import type { PartitionConfig, OtherPlayersPartition, RemoteCausalRepoProtocol, YjsPartition } from '@casual-simulation/aux-common'; import type { AuxTimeSyncConfiguration } from '@casual-simulation/aux-vm'; import { TimeSyncController } from '@casual-simulation/timesync'; import type { RemoteSharedDocumentConfig } from '@casual-simulation/aux-common/documents/SharedDocumentConfig'; import { RemoteYjsSharedDocument } from '@casual-simulation/aux-common/documents/RemoteYjsSharedDocument'; /** * Gets the causal repo client that should be used for the given host. * @param host The host. */ export declare function getClientForHostAndProtocol(host: string, authSource: PartitionAuthSource, protocol: RemoteCausalRepoProtocol): InstRecordsClient; /** * Gets the casual repo client that should be used for the given host when connecting over the AWS Apiary protocol. * @param host The URl that should be connected to. * @param user The user that the connection should be made with. */ export declare function getAWSApiaryClientForHostAndProtocol(host: string, authSource: PartitionAuthSource): InstRecordsClient; /** * Gets the causal repo client that should be used for the given host when connecting over the websocket protocol. * @param host The host. */ export declare function getWebSocketClientForHost(host: string, authSource: PartitionAuthSource): InstRecordsClient; /** * Attempts to create a CausalTree2Partition from the given config. * @param config The config. */ export declare function createRemoteYjsPartition(config: PartitionConfig, authSource: PartitionAuthSource, useCache?: boolean): Promise<YjsPartition>; /** * Attempts to create a RemoteYjsSharedDocument from the given config. * @param config The config. * @param authSource The auth source. */ export declare function createRemoteYjsSharedDocument(config: RemoteSharedDocumentConfig, authSource: PartitionAuthSource): Promise<RemoteYjsSharedDocument>; /** * Attempts to create a CausalTree2Partition from the given config. * @param config The config. */ export declare function createOtherPlayersRepoPartition(config: PartitionConfig, authSource: PartitionAuthSource, useCache?: boolean): Promise<OtherPlayersPartition>; export declare function createTimeSyncController(config: AuxTimeSyncConfiguration, authSource: PartitionAuthSource): TimeSyncController; //# sourceMappingURL=PartitionFactories.d.ts.map