MCPcopy
hub / github.com/aspen-cloud/triplit / SyncTransport

Interface SyncTransport

packages/client/src/transport/types/index.ts:18–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16 | 'CLOSED';
17
18export interface SyncTransport {
19 isOpen: boolean;
20 connectionStatus: ConnectionStatus;
21 /**
22 * Sends a message to the server. If the message could not be sent, this should return false. If successfully sent, this should return true.
23 */
24 sendMessage(message: ClientSyncMessage): boolean;
25 /**
26 * Connect to the server with the given parameters. If this transport is already connected, it should close the existing connection and open a new one.
27 */
28 connect(params: TransportConnectParams): void;
29 /**
30 * Closes the connection to the server. If the transport is not connected, this should be a no op.
31 */
32 close(reason?: CloseReason): void;
33 onClose(callback: (ev: any) => void): void;
34 /**
35 * @deprecated Triplit Client now manages its own connection state, so this is no longer needed.
36 */
37 onConnectionChange(callback: (state: ConnectionStatus) => void): void;
38 onError(callback: (ev: any) => void): void;
39 onMessage(callback: (message: any) => void): void;
40 onOpen(callback: (ev: any) => void): void;
41}
42
43export type TransportConnectParams = {
44 server: string;

Callers 30

sendMessageMethod · 0.65
outbox.spec.tsFile · 0.65
query-sync.spec.tsFile · 0.65
createConnectionMethod · 0.65
connectMethod · 0.65
tempTriplitServerFunction · 0.65
closeConnectionMethod · 0.65

Implementers 3

TestTransportpackages/integration-tests/utils/test-
HttpTransportpackages/client/src/transport/http-tra
WebSocketTransportpackages/client/src/transport/websocke

Calls

no outgoing calls

Tested by

no test coverage detected