@iobroker/db-objects-file
Version:
The Library contains the Database classes for File based objects database client and server.
104 lines • 3.04 kB
TypeScript
/**
* This class inherits InMemoryFileDB class and adds all relevant logic for objects
* including the available methods for use by js-controller directly
*/
export class ObjectsInMemoryFileDB extends InMemoryFileDB {
constructor(settings: any);
change: any;
META_ID: string;
fileOptions: {};
files: {};
writeTimer: NodeJS.Timeout | null;
writeIds: any[];
preserveSettings: string[];
defaultNewAcl: any;
namespace: any;
writeFileInterval: number;
objectsDir: string;
existingMetaObjects: {};
_normalizeFilename(name: any): any;
_saveFileSettings(id: any, force: any): void;
_loadFileSettings(id: any): void;
syncFileDirectory(limitId: any): {
numberSuccess: number;
notifications: any[];
};
_writeFile(id: any, name: any, data: any, options: any): void;
_readFile(id: any, name: any, options: any): {
fileContent: any;
fileMime: any;
};
/**
* Check if given object exists
*
* @param id id of the object
* @returns if the object exists
*/
_objectExists(id: any): boolean;
/**
* Check if given file exists
*
* @param id id of the namespace
* @param [name] name of the file
* @returns
*/
_fileExists(id: any, name?: any): boolean;
/**
* Check if given directory exists
*
* @param id id of the namespace
* @param [name] name of the directory
* @returns
*/
dirExists(id: any, name?: any): boolean;
_unlink(id: any, name: any): void;
_readDir(id: any, name: any, options: any): {
file: string;
stats: fs.Stats;
isDir: boolean;
acl: any;
modifiedAt: any;
createdAt: any;
}[];
_rename(id: any, oldName: any, newName: any): void;
_clone(obj: any): any;
_subscribeMeta(client: any, pattern: any): void;
_subscribeConfigForClient(client: any, pattern: any): void;
_unsubscribeConfigForClient(client: any, pattern: any): void;
_subscribeFileForClient(client: any, id: any, pattern: any): void;
_unsubscribeFileForClient(client: any, id: any, pattern: any): void;
_getObject(id: any): any;
_getKeys(pattern: any): string[];
_getObjects(keys: any): any;
_ensureMetaDict(): any;
/**
* Get value of given meta id
*
* @param id
* @returns
*/
getMeta(id: any): any;
/**
* Sets given value to id in metaNamespace
*
* @param id
* @param value
*/
setMeta(id: any, value: any): void;
_setObjectDirect(id: any, obj: any): void;
/**
* Delete the given object from the dataset
*
* @param id unique id of the object
*/
_delObject(id: any): void;
_applyView(func: any, params: any): {
rows: never[];
};
_getObjectView(design: any, search: any, params: any): {
rows: never[];
};
}
import { InMemoryFileDB } from '@iobroker/db-base';
import fs from 'fs-extra';
//# sourceMappingURL=objectsInMemFileDB.d.ts.map