import { BigDecimal } from '@sentio/bigdecimal'; import { AbstractEntity as Entity, Bytes, Float, ID, Int, Timestamp, UpdateValues } from './types.js'; import { IStoreContext } from '@sentio/runtime'; import { Cursor } from './cursor.js'; export interface EntityClass { new (data: Partial): T; } export declare function getEntityName(entity: EntityClass | T | string): string; export declare function getEntityField(entity: EntityClass | T | string, field: string): string; export declare class Store { private readonly context; constructor(context: IStoreContext); get(entity: EntityClass | string, id: ID): Promise; delete(entity: EntityClass | T | T[], id?: string | string[]): Promise; update(entity: EntityClass, values: UpdateValues): Promise; upsert(entity: T | T[]): Promise; listIterator>(entity: EntityClass, filters: ListFilter[]): AsyncGenerator; listBatched>(entity: EntityClass, filters: ListFilter[], batchSize?: number): AsyncGenerator; private listRequest; list>(entity: EntityClass, filters?: ListFilter[], cursor?: Cursor): Promise; private fromAsync; private newEntity; } type ArrayOperators = 'in' | 'not in' | 'has all' | 'has any'; export type Operators = T extends Array ? 'in' | 'not in' | '=' | '!=' | 'has all' | 'has any' : T extends Int ? '=' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not in' : T extends Float ? '=' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not in' : T extends Bytes ? '=' | '!=' | 'in' | 'not in' : T extends ID ? '=' | '!=' | 'like' | 'not like' | 'in' | 'not in' | '<' | '<=' | '>' | '>=' : T extends string ? '=' | '!=' | 'like' | 'not like' | 'in' | 'not in' : T extends Timestamp ? '=' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not in' : T extends boolean ? '=' | '!=' | 'in' | 'not in' : T extends BigDecimal ? '=' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not in' : T extends bigint ? '=' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not in' : '=' | '!=' | 'in' | 'not in'; type CompatibleValue> = O extends ArrayOperators ? T extends Array ? U[] : T[] : (T extends bigint ? bigint : T extends Int ? number : T extends Float ? number : T extends Bytes ? Bytes | string : T extends ID ? ID | string : T extends BigDecimal ? BigDecimal | number : T extends Int ? number : T extends () => Promise ? ID | string : T) | Nullable; type Nullable = O extends '=' | '!=' ? null : never; export type ListFilter> = { field: P; op: O; value: CompatibleValue; }; export type ArrayFilter> = [ P, O, CompatibleValue ]; export declare function getStore(): Store; export {}; //# sourceMappingURL=store.d.ts.map