fix(core): update
This commit is contained in:
@@ -1,20 +1,38 @@
|
||||
import * as plugins from './levelcache.plugins';
|
||||
|
||||
export interface ICacheEntryConstructorOptions {}
|
||||
export interface ICacheEntryConstructorOptions {
|
||||
key?: string;
|
||||
ttl: number;
|
||||
typeInfo?: string;
|
||||
contents: Buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* a CacheEntry
|
||||
*/
|
||||
export class CacheEntry {
|
||||
public static fromBuffer() {}
|
||||
public static fromString() {}
|
||||
export class CacheEntry extends plugins.smartjson.Smartjson implements ICacheEntryConstructorOptions {
|
||||
public static fromStorageJsonString(storageJsonString: string) {
|
||||
return new CacheEntry(plugins.smartjson.parse(storageJsonString));
|
||||
}
|
||||
|
||||
type: 'string' | 'blob';
|
||||
mode: 'complete' | 'stream';
|
||||
keyArg: string;
|
||||
cacheStream: ReadableStream;
|
||||
cacheContents: Buffer;
|
||||
cacheValue: string;
|
||||
@plugins.smartjson.foldDec()
|
||||
public key: string;
|
||||
|
||||
constructor(optionsArg: {}) {}
|
||||
@plugins.smartjson.foldDec()
|
||||
public ttl: number;
|
||||
|
||||
@plugins.smartjson.foldDec()
|
||||
public typeInfo: string;
|
||||
|
||||
@plugins.smartjson.foldDec()
|
||||
contents: Buffer;
|
||||
|
||||
public toStorageJsonString(): string {
|
||||
return this.foldToJson();
|
||||
}
|
||||
|
||||
constructor(optionsArg: ICacheEntryConstructorOptions) {
|
||||
super();
|
||||
Object.assign(this, optionsArg);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user