import { LagunaObject } from '../types'; interface ThreadOptions { network?: boolean; storage?: boolean; database?: boolean; helpers?: boolean; jsonApi?: boolean; transform?: boolean; } export interface DatabaseOptions { name: string; threadOptions: ThreadOptions; } export interface DatabaseProperties { databaseName: string; version: number; tables?: DatabaseTableProperties[]; } export interface DatabaseTableProperties { name: string; indexes: string[]; } export interface DatabaseSchemaProperties { version: number; tables: DatabaseTableProperties[]; } export interface DatabasePutAction { eventId: string; tableName: string; data: LagunaObject | LagunaObject[]; } export interface DatabaseGetAction { tableName: string; filter?: (item: any, params?: any) => boolean; groupBy?: (item: any, params?: any) => boolean; params?: LagunaObject; orderBy?: string; desc?: boolean; justCount?: boolean; } export interface DatabaseThreadGetAction extends DatabaseGetAction { threadFilter?: string; threadGroupBy?: string; } export interface DatabaseSumAction extends Omit { sumField?: string; } export interface DatabaseThreadSumAction extends Omit { threadFilter?: string; threadGroupBy?: string; } export interface DatabaseHandle { OpenDatabase: (dbProperties: DatabaseProperties) => Promise; Put: (putActions: DatabasePutAction) => Promise; Get: (getActions: DatabaseGetAction) => Promise; Sum: (sumActions: DatabaseSumAction) => Promise; } export {};