///
import { Api, Types } from "ivipbase-core";
import type { DataBase } from ".";
export declare class StorageDBClient extends Api {
readonly db: DataBase;
private _realtimeQueries;
readonly url: string;
private readonly app;
constructor(db: DataBase);
get serverPingUrl(): string;
private initialize;
get isConnected(): boolean;
get isConnecting(): boolean;
get connectionState(): "disconnected" | "connecting" | "connected" | "disconnecting";
private _request;
connect(retry?: boolean): void;
disconnect(): void;
subscribe(path: string, event: string, callback: Types.EventSubscriptionCallback, settings?: Types.EventSubscriptionSettings): Promise;
unsubscribe(path: string, event?: string, callback?: Types.EventSubscriptionCallback): Promise;
getInfo(): Promise<{
dbname: string;
version: string;
time: number;
process: number;
platform?: NodeJS.Platform;
arch?: string;
release?: string;
host?: string;
uptime?: string;
load?: number[];
mem?: {
total: string;
free: string;
process: {
arrayBuffers: string;
external: string;
heapTotal: string;
heapUsed: string;
residentSet: string;
};
};
cpus?: any;
network?: any;
data?: Array<{
cpuUsage: number;
networkStats: {
sent: number;
received: number;
};
memoryUsage: {
total: number;
free: number;
used: number;
};
timestamp: number;
}>;
}>;
stats(): Promise<{
writes: number;
reads: number;
bytesRead: number;
bytesWritten: number;
}>;
set(path: string, value: any, options?: {
suppress_events?: boolean;
context?: any;
}): Promise<{
cursor?: string;
}>;
update(path: string, updates: Record, options?: {
suppress_events?: boolean;
context?: any;
}): Promise<{
cursor?: string;
}>;
transaction(path: string, callback: (currentValue: any) => Promise, options?: {
suppress_events?: boolean;
context?: any;
}): Promise<{
cursor?: string | undefined;
}>;
get(path: string, options?: {
include?: string[];
exclude?: string[];
child_objects?: boolean;
}): Promise<{
value: any;
context: any;
cursor?: string;
}>;
exists(path: string): Promise;
query(path: string, query: Types.Query, options?: Types.QueryOptions): Promise<{
results: Array<{
path: string;
val: any;
}> | string[];
context: any;
stop(): Promise;
}>;
reflect(path: string, type: "info" | "children", args: any): Promise;
export(path: string, write: Types.StreamWriteFunction, options?: {
format?: "json";
type_safe?: boolean;
}): ReturnType;
import(path: string, read: Types.StreamReadFunction, options?: {
format?: "json";
suppress_events?: boolean;
method?: "set" | "update" | "merge";
}): Promise;
getServerInfo(): Promise;
setSchema(path: string, schema: string | Record, warnOnly?: boolean): Promise;
getSchema(path: string): Promise;
getSchemas(): Promise;
validateSchema(path: string, value: any, isUpdate: boolean): Promise<{
ok: boolean;
reason?: string;
warning?: string;
}>;
}
//# sourceMappingURL=StorageDBClient.d.ts.map