import React from 'react'; import { ContentfulDataSource } from '../dataSource'; import { DataSourceWithResolve } from '../resolve'; interface LocalSchemaContext { dataSource: DataSourceWithResolve; state: { /** A number that auto-increments whenever a new entry is indexed */ revision: number; /** A timestamp indicating when the index method was last called to update the dataSource. */ lastIndexedAt: number; /** A timestamp indicating when the resync method last completed. */ lastSyncedAt: number; /** A timestamp indicating the last time that the post-sync backup completed. */ lastBackedUpAt: number; }; /** * Directly invokes the sync method on the data source, updating the revision number. * If the data source supports backup, this will also trigger a backup in the background. * * @returns A promise that resolves to the current revision number after sync completed. */ resync: () => Promise; } export interface LocalSchemaProviderProps { dataSource: ContentfulDataSource; /** * The component to render while waiting for restore from backup/sync. * By default, this will render an empty screen. */ Loading?: React.ComponentType; } /** * Provides a data source to power the query hooks */ export declare function LocalSchemaProvider({ children, dataSource, Loading }: React.PropsWithChildren): React.ReactElement<{}, string | React.JSXElementConstructor> | React.FunctionComponentElement> | null; export declare function useDataSource(): readonly [DataSourceWithResolve, { /** A number that auto-increments whenever a new entry is indexed */ revision: number; /** A timestamp indicating when the index method was last called to update the dataSource. */ lastIndexedAt: number; /** A timestamp indicating when the resync method last completed. */ lastSyncedAt: number; /** A timestamp indicating the last time that the post-sync backup completed. */ lastBackedUpAt: number; }, () => Promise]; export {};