npmextra/dist/npmextra.classes.keyvaluestore.d.ts

45 lines
1.1 KiB
TypeScript
Raw Normal View History

2017-07-12 15:13:29 +00:00
import { Task, TaskOnce } from 'taskbuffer';
2017-03-18 15:23:47 +00:00
export declare type TKeyValueStore = 'path' | 'gitProject' | 'custom';
2017-07-09 17:05:03 +00:00
/**
* kvStore is a simple key vlaue store to store data about projects between runs
*/
2016-09-24 19:53:44 +00:00
export declare class KeyValueStore {
2017-07-12 15:13:29 +00:00
dataObject: any;
deletedObject: any;
initialReadTask: TaskOnce;
syncTask: Task;
2017-03-18 15:23:47 +00:00
type: TKeyValueStore;
2016-09-24 19:53:44 +00:00
identity: string;
filePath: string;
2017-07-12 15:13:29 +00:00
/**
* the constructor of keyvalue store
* @param typeArg
* @param customStringArg
*/
constructor(typeArg: TKeyValueStore, customStringArg: string);
/**
* reads all keyValue pairs at once and returns them
*/
readAll(): Promise<any>;
2016-09-24 19:53:44 +00:00
/**
* reads a keyValueFile from disk
*/
2017-07-12 15:13:29 +00:00
read(keyArg: string): Promise<any>;
2016-09-24 19:53:44 +00:00
/**
* writes a key value file to disk
*/
2017-07-12 15:13:29 +00:00
write(keyValueObject: any): Promise<void>;
2016-09-24 19:53:44 +00:00
/**
* wipes a key value store from disk
*/
2017-07-12 15:13:29 +00:00
wipe(): Promise<void>;
2016-09-24 19:53:44 +00:00
/**
* updates a value
*/
2017-07-12 15:13:29 +00:00
update(keyObject: any): Promise<void>;
2016-09-24 19:53:44 +00:00
/**
* computes the identity
*/
private initFilePath();
}