declare const uuidSymbol: unique symbol; export type Keyword = `:${string}`; export type Attribute = Keyword; export type UuidValue = string; export interface DatahikeUuid { readonly [uuidSymbol]: true; } export type BranchName = Keyword; export type VersionRef = BranchName | DatahikeUuid; export interface StoreConfig { backend: Keyword; id?: DatahikeUuid; path?: string; [key: string]: any; } export interface WriterConfig { backend: Keyword; [key: string]: any; } export interface ConnectOptions { "sync?"?: boolean; [key: string]: any; } export interface DatabaseConfig { store: StoreConfig; writer?: WriterConfig; branch?: Keyword; "keep-history?"?: boolean; "schema-flexibility"?: ":read" | ":write"; "initial-tx"?: Transaction[]; name?: string; "remote-peer"?: RemotePeer; [key: string]: any; } export interface RemotePeer { backend: ":datahike-server"; url: string; token?: string; [key: string]: any; } declare const connectionBrand: unique symbol; export interface Connection { readonly [connectionBrand]: true; } declare const databaseBrand: unique symbol; export interface Database { readonly [databaseBrand]: true; } export type EntityId = number | string | [Attribute, any]; export type EntityMap = Record; export type Transaction = [":db/add", EntityId, Attribute, any] | [":db/retract", EntityId, Attribute, any] | [Keyword, ...any[]] | EntityMap; export interface WithArgs { "tx-data": Transaction[]; "tx-meta"?: any; "tx-options"?: { "allow-index-backfill?"?: boolean; } | null; } export interface QueryArgs { query: string | any[] | Record; args?: any[]; limit?: number; offset?: number; } export interface PullOptions { selector: any[]; eid: EntityId | EntityId[]; } export type Index = ":eavt" | ":aevt" | ":avet"; export interface IndexLookupArgs { index: Index; components?: any[] | null; } export interface IndexRangeArgs { attrid: Attribute; start: any; end: any; } export interface Datom { e: number; a: Attribute; v: any; tx: number; added: boolean; } export interface TransactionReport { "db-before": Database | null; "db-after": Database; "tx-data": Datom[]; tempids: { [key: string]: number; }; "tx-meta"?: any; "commit-id"?: UuidValue; } export interface Schema { [key: string]: { "db/valueType": Keyword; "db/cardinality": Keyword; "db/unique"?: Keyword; "db/index"?: boolean; [key: string]: any; }; } export interface Metrics { count: number; "avet-count": number; "per-attr-counts": Record; "per-entity-counts"?: Record; "temporal-count"?: number; "temporal-avet-count"?: number; } export interface GcOptions { "min-age-ms"?: number; } export interface RemoteReport { "db-after"?: Database; "db-before"?: null; "tx-data"?: Datom[]; tempids?: { [key: string]: number; }; "commit-id"?: UuidValue; resync?: boolean; deleted?: boolean; truncated?: boolean; error?: Error; status?: number; } export declare function configureCache({ maxEntries }: { maxEntries: number; }): void; export declare function clearCache(): void; export declare function request(route: string, referentiallyTransparent: boolean, args: unknown[], create?: boolean): Promise; export declare function uuid(value: string): DatahikeUuid; export declare function randomUuid(): DatahikeUuid; export declare function isPromise(value: any): value is Promise; export declare function listen(conn: Connection, callback: (report: RemoteReport) => void): string; export declare function unlisten(conn: Connection, key: string): void; export {};