import { SyncItem } from '../contentful/types'; interface SyncCollection { entries: Array<{ sys: any; fields: any; }>; assets: Array<{ sys: any; fields: any; }>; deletedEntries: Array<{ sys: any; }>; deletedAssets: Array<{ sys: any; }>; nextSyncToken: string; } /** * This interface represents any Contentful client capable of using the Sync API. * A simple implementation of this interface is provided by this library, but you * can also use the official Contentful JS SDK. */ export interface ContentfulClientApi { sync(query: any): Promise; } export interface Syncable { getToken(): string | undefined | null | Promise; setToken(token: string): void | Promise; index(syncItem: SyncItem): void | Promise; } export declare class SyncEngine { private readonly dataSource; private readonly client; constructor(dataSource: Syncable, client: ContentfulClientApi); sync(): Promise; } /** * Enhances a dataSource with a Contentful client to keep it up to date via the * Sync API. * @param dataSource The data source to store data e.g. InMemoryDataSource, PostgresDataSource * @param client The Contentful client that allows us to sync data to the data source * @returns The same data source enhanced with the sync() method */ export declare function withSync(dataSource: DataSource, client: Pick): DataSource & Pick; /** * Enhances a dataSource with a Contentful client to keep it up to date via the * Sync API. * @param dataSource The data source to store data e.g. InMemoryDataSource, PostgresDataSource * @param client The Contentful client that allows us to sync data to the data source * @returns The same data source enhanced with the sync() method */ export declare function addSync(dataSource: DataSource, client: Pick): asserts dataSource is DataSource & Pick; export declare function isSyncable(dataSource: any): dataSource is Syncable; export declare function hasSync(dataSource: any): dataSource is Pick; export {};