import { SatOpRow } from '../_generated/protocol/satellite.js'; import { SatPbMsg } from '../util/proto.js'; import { SocketFactory } from '../sockets/index.js'; import { AuthResponse, LSN, ReplicationStatus, DataTransaction, DbRecord, Relation, StartReplicationResponse, StopReplicationResponse, ErrorCallback, RelationCallback, OutboundStartedCallback, TransactionCallback, AdditionalDataCallback, ReplicatedRowTransformer, GoneBatchCallback } from '../util/types.js'; import { TypeEncoder, TypeDecoder } from '../util/encoders/index.js'; import { Client } from './index.js'; import { SatelliteClientOpts } from './config.js'; import { ShapeRequest, SubscribeResponse, SubscriptionDeliveredCallback, SubscriptionErrorCallback, UnsubscribeResponse } from './shapes/types.js'; import { DbSchema } from '../client/model/index.js'; import { QualifiedTablename } from '../util/index.js'; import { AuthState } from '../auth/index.js'; import Long from 'long'; export declare class SatelliteClient implements Client { private opts; private dialect; private encoder; private decoder; private emitter; private socketFactory; private socket?; private inbound; private outbound; private subscriptionsDataCache; private replicationTransforms; private socketHandler?; private throttledPushTransaction?; private rpcClient; private service; private incomingMutex; private allowedMutexedRpcResponses; private dbDescription; private isDown; private handlerForMessageType; private handlerForRpcRequests; private listenerRemapping; constructor(dbDescription: DbSchema, socketFactory: SocketFactory, opts: SatelliteClientOpts); private resetReplication; private resetInboundReplication; connect(): Promise; disconnect(): void; isConnected(): boolean; getOutboundReplicationStatus(): ReplicationStatus; shutdown(): Promise; startReplication(lsn?: LSN, schemaVersion?: string, subscriptionIds?: string[], observedTransactionData?: Long[]): Promise; stopReplication(): Promise; authenticate({ clientId, token }: AuthState): Promise; subscribeToTransactions(callback: TransactionCallback): void; unsubscribeToTransactions(callback: TransactionCallback): void; subscribeToAdditionalData(callback: AdditionalDataCallback): void; unsubscribeToAdditionalData(_callback: AdditionalDataCallback): void; subscribeToRelations(callback: RelationCallback): void; unsubscribeToRelations(callback: RelationCallback): void; subscribeToGoneBatch(callback: GoneBatchCallback): void; unsubscribeToGoneBatch(_callback: GoneBatchCallback): void; enqueueTransaction(transaction: DataTransaction): void; private pushTransactions; subscribeToError(callback: ErrorCallback): void; unsubscribeToError(callback: ErrorCallback): void; subscribeToOutboundStarted(callback: OutboundStartedCallback): void; unsubscribeToOutboundStarted(callback: OutboundStartedCallback): void; subscribeToSubscriptionEvents(successCallback: SubscriptionDeliveredCallback, errorCallback: SubscriptionErrorCallback): void; unsubscribeToSubscriptionEvents(successCallback: SubscriptionDeliveredCallback, errorCallback: SubscriptionErrorCallback): void; subscribe(subscriptionId: string, shapes: ShapeRequest[]): Promise; unsubscribe(subscriptionIds: string[]): Promise; private sendMissingRelations; private transactionToSatOpLog; private handleAuthResp; private handleStartResp; /** * Server may issue RPC requests to the client, and we're handling them here. */ private handleRpcRequest; private handleStartReq; private handleStopReq; private handleStopResp; private handleRelation; private handleTransaction; private handleError; private handleSubscription; private handleSubscriptionError; private handleSubscriptionDataBegin; private handleSubscriptionDataEnd; private handleShapeDataBegin; private handleShapeDataEnd; private handleUnsubscribeResponse; private handleUnsubsDataBegin; private handleUnsubsDataEnd; private delayIncomingMessages; private handleIncoming; private getRelation; private processUnsubsDataMessage; private processOpLogMessage; private sendMessage; getLastSentLsn(): LSN; private maybeSendAck; setReplicationTransform(tableName: QualifiedTablename, transform: ReplicatedRowTransformer): void; clearReplicationTransform(tableName: QualifiedTablename): void; private _applyDataChangeTransform; } export declare function serializeRow(rec: DbRecord, relation: Relation, dbDescription: DbSchema, encoder: TypeEncoder): SatOpRow; export declare function deserializeRow(row: SatOpRow, relation: Relation, dbDescription: DbSchema, decoder: TypeDecoder): DbRecord; export declare function deserializeRow(row: SatOpRow | undefined, relation: Relation, dbDescription: DbSchema, decoder: TypeDecoder): DbRecord | undefined; export declare function toMessage(data: Uint8Array): SatPbMsg;