edge-sync-client
Version:
Library for accessing the Edge data-sync system
15 lines (14 loc) • 735 B
TypeScript
import { FetchFunction } from 'serverlet';
import { EdgeServers } from '../types/base-types';
import { GetStoreResponse, PostStoreBody, PostStoreResponse, PutStoreResponse } from '../types/rest-types';
export interface SyncClient {
createRepo: (syncKey: string, apiKey?: string) => Promise<PutStoreResponse>;
readRepo: (syncKey: string, lastHash: string | undefined) => Promise<GetStoreResponse>;
updateRepo: (syncKey: string, lastHash: string | undefined, body: PostStoreBody) => Promise<PostStoreResponse>;
}
export interface SyncClientOptions {
fetch?: FetchFunction;
log?: (message: string) => void;
edgeServers?: EdgeServers;
}
export declare function makeSyncClient(opts?: SyncClientOptions): SyncClient;