export type SharedConfig = { baseUrl: string; apiKey: string; identity: string; signature: string; fetch?: typeof fetch; pullStaticUrl?: string; pullStreamUrl?: string; }; export type RecordData = Record; export type RecordId = string; export interface CollectionInput { name: string; schema: string; } export interface CollectionListItem { id: string; name: string; schema?: string; } export interface CollectionResponse { id: string; name: string; schema?: string; } export interface CollectionListResponse { collections: CollectionListItem[]; } export interface RecordMutationAck { id: string; seq: number; ack: boolean; } export interface RecordResponse { id: string; data: unknown; } export interface RecordListItem { id: string; data: unknown; } export interface RecordListResponse { records: RecordListItem[]; cursor: string; hasMore: boolean; } export interface SignResponse { identity: string; signature: string; } export interface SyncDatasetRecord { id: string; op: string; sequenceInt: number; recordData: unknown | null; } export type SyncDataset = Record; export interface SyncStaticResponse { dataset: SyncDataset; cursor: string; total?: number; } export interface SyncStreamMessage { identity: string; key?: string; value?: string; operation: string; collectionId: string; recordId?: string; sequenceInt?: number; recordData?: unknown; timestamp: number; } export interface SearchResultsResponse { results: unknown; count: number; } export type SearchQueryOperators = { eq?: unknown; ne?: unknown; gt?: unknown; gte?: unknown; lt?: unknown; lte?: unknown; in?: unknown[]; nin?: unknown[]; exists?: boolean; isNull?: boolean; notNull?: boolean; contains?: unknown; size?: number; }; export interface SearchQueryFilter { and?: SearchQueryFilter[]; or?: SearchQueryFilter[]; not?: SearchQueryFilter; [field: string]: SearchQueryOperators | SearchQueryFilter[] | SearchQueryFilter | undefined; } export interface SearchQuerySort { field: string; order?: "asc" | "desc"; } export interface SearchQueryPaginate { limit?: number; offset?: number; } export interface SearchQueryTransform { select?: string[]; distinct?: string; } export interface SearchQuerySpec { filters?: SearchQueryFilter; sort?: SearchQuerySort[]; paginate?: SearchQueryPaginate; transform?: SearchQueryTransform; } export type MatchSpec = Record; export type InternalOp = "create" | "update" | "delete"; export interface InternalMutation { localId: string; identity: string; op: InternalOp; collection: string; recordId: string; data: RecordData | null; timestamp: number; status: "pending" | "acked"; serverSeq?: number; } export interface InternalPullChange { op: InternalOp; collection: string; recordId: string; data: RecordData | null; serverSeq: number; } export interface InternalPushAck { localId: string; serverSeq: number; ack: boolean; committed?: boolean; } export interface InternalStorageRecordRow { identity: string; collection: string; recordId: string; data: RecordData; serverSeq?: number | null; updatedAt: number; }