jsstore
Version:
Harness the power of JsStore to streamline database operations in your web applications. With its SQL-like API, JsStore simplifies IndexedDB interactions, enabling developers to easily query, filter, and manipulate data with familiar syntax and efficiency
37 lines (36 loc) • 881 B
TypeScript
import { IError, IDataBase } from "./interfaces";
import { API, EVENT } from "./enums";
export type WebWorkerRequest = {
name: API;
query?: any;
onSuccess?: (results?: any) => void;
onError?: (err: IError) => void;
onResult?: (cb: (result: any) => Promise<any>) => void;
beforeExecute?: (cb: (result: any) => Promise<any>) => void;
};
export type WebWorkerResult = {
error?: any;
result?: any;
};
export type SqlWebResult = {
api: string;
data: any;
};
export type EventQueue = {
event: EVENT;
callback: Function;
};
export type SetQuery = {
key: string;
value: any;
};
export type TStringAny = {
[key: string]: any;
};
export type TMiddleware = (request: WebWorkerRequest) => Promise<any>;
export type InitDbResult = {
isCreated: boolean;
database?: IDataBase;
oldVersion: number;
newVersion: number;
};