@tonk/keepsync
Version:
A reactive sync engine framework for use with Tonk apps
31 lines (29 loc) • 1.16 kB
TypeScript
import { SyncEngine } from '../engine/index.js';
import { Repo, DocumentId } from '@automerge/automerge-repo/slim';
import { SyncEngineOptions } from '../engine/syncEngine.js';
/**
* Configure the global sync engine with the provided options
* This should be called once at the application startup
* @param options Configuration options for the SyncEngine
* @returns The configured SyncEngine instance
*/
export declare function configureSyncEngine(options: SyncEngineOptions): Promise<SyncEngine>;
/**
* Get the sync engine instance
* @returns The SyncEngine instance or null if not created yet
*/
export declare function getSyncEngine(): SyncEngine | null;
/**
* Get the Automerge Repo instance from the SyncEngine
* @returns The Repo instance or null if SyncEngine not created yet
*/
export declare function getRepo(): Repo | null;
/**
* Get the Automerge Repo instance from the SyncEngine
* @returns The Repo instance or null if SyncEngine not created yet
*/
export declare function getRootId(): DocumentId | undefined;
/**
* Reset the sync engine instance (mainly for testing purposes)
*/
export declare function resetSyncEngine(): void;