@sap-ux/store
Version:
NPM module for storing persistent data
19 lines • 1.02 kB
TypeScript
import type { FSWatcher } from 'fs';
import type { DataAccess } from '.';
import type { Logger } from '@sap-ux/logger';
import type { ServiceOptions } from '../types';
import type { Entity } from '../constants';
export declare const basedir: ({ baseDirectory }?: {
baseDirectory?: string;
}) => string;
/** Return an FSWatcher for a given entity name
* The client is responsible for disposing of the FSWatcher
*/
export declare function getFilesystemWatcherFor(entityName: Entity, callback: (entityName: string) => void, options?: ServiceOptions): FSWatcher | undefined;
/**
* Filesystem store. The entity is stored in JSON format (don't depend on the format, this could change).
* The entity is stored in a file named with the plural form of the entity name in the base directory. Again, this is an
* implementation detail, please don't depend on it.
*/
export declare function getFilesystemStore<E extends object>(logger: Logger, options?: ServiceOptions): DataAccess<E>;
//# sourceMappingURL=filesystem.d.ts.map