From e8b076ebe5337f40f567c88930f0f95ccea1dc2a Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Mon, 15 Sep 2025 10:56:44 +0400 Subject: [PATCH] export SyncEngineStats type --- bindings/javascript/sync/packages/common/index.ts | 4 ++-- bindings/javascript/sync/packages/common/types.ts | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bindings/javascript/sync/packages/common/index.ts b/bindings/javascript/sync/packages/common/index.ts index 1b264c80b..822a8c24f 100644 --- a/bindings/javascript/sync/packages/common/index.ts +++ b/bindings/javascript/sync/packages/common/index.ts @@ -1,5 +1,5 @@ import { run, memoryIO } from "./run.js" -import { SyncOpts, ProtocolIo, RunOpts, DatabaseRowMutation, DatabaseRowStatement, DatabaseRowTransformResult } from "./types.js" +import { SyncOpts, ProtocolIo, RunOpts, DatabaseRowMutation, DatabaseRowStatement, DatabaseRowTransformResult, SyncEngineStats } from "./types.js" export { run, memoryIO, } -export type { SyncOpts, ProtocolIo, RunOpts, DatabaseRowMutation, DatabaseRowStatement, DatabaseRowTransformResult } \ No newline at end of file +export type { SyncOpts, ProtocolIo, RunOpts, DatabaseRowMutation, DatabaseRowStatement, DatabaseRowTransformResult, SyncEngineStats } \ No newline at end of file diff --git a/bindings/javascript/sync/packages/common/types.ts b/bindings/javascript/sync/packages/common/types.ts index 25fa1e47e..49b140103 100644 --- a/bindings/javascript/sync/packages/common/types.ts +++ b/bindings/javascript/sync/packages/common/types.ts @@ -44,7 +44,13 @@ export interface DatabaseRowStatement { values: Array } -export type GeneratorResponse = - | { type: 'IO' } - | { type: 'Done' } - | { type: 'SyncEngineStats', operations: number, mainWal: number, revertWal: number, lastPullUnixTime: number, lastPushUnixTime: number | null } \ No newline at end of file +export interface SyncEngineStats { + operations: number; + mainWal: number; + revertWal: number; + lastPullUnixTime: number; + lastPushUnixTime: number | null; + revision: string | null; +} + +export type GeneratorResponse = { type: 'IO' } | { type: 'Done' } | ({ type: 'SyncEngineStats' } & SyncEngineStats) \ No newline at end of file