/* eslint-disable no-unused-vars */ /* eslint-disable @typescript-eslint/no-unused-vars */ import type { EventBulk, RxDocumentData, RxStorage, RxStorageChangeEvent, RxStorageDefaultCheckpoint } from '../../types/index.d.ts'; export type RxStorageFoundationDBSettings = { /** * Version of the API of the foundationDB server. */ apiVersion: number; /** * Path to the foundationDB cluster file * like '/path/to/fdb.cluster' * (optional) */ clusterFile?: string; batchSize?: number; }; export type RxStorageFoundationDBInstanceCreationOptions = { // can be overwritten per instance batchSize?: number; }; /** * We cannot import types from 'foundationdb' * because 'foundationdb' is an optional peer dependency * this is NOT also in the devDependencies. * This is because it requires to install the foundationdb client cli * which would mean everyone that wants to develop RxDB must have this installed manually. */ // import { // open as foundationDBOpen, // Database, // Transaction // } from 'foundationdb'; export type FoundationDBIndexMeta = { indexName: string; index: string[]; getIndexableString: (doc: RxDocumentData) => string; db: FoundationDBDatabase; }; export type FoundationDBConnection = any; // ReturnType; export type FoundationDBDatabase = any; // Database; export type FoundationDBTransaction = any; // Transaction, any>; export type FoundationDBStorageInternals = { connection: FoundationDBConnection; dbsPromise: Promise<{ root: FoundationDBDatabase; main: FoundationDBDatabase; attachments: FoundationDBDatabase; events: FoundationDBDatabase>, RxStorageDefaultCheckpoint>>; indexes: { [indexName: string]: FoundationDBIndexMeta; }; }>; }; export type RxStorageFoundationDB = RxStorage, RxStorageFoundationDBInstanceCreationOptions> & {};