@jsonkit/db 3.0.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +0,0 @@
1
- import { Identifiable, DeleteManyOutput, Promisable, JsonEntryParser, MultiEntryFileDbOptions, MultiEntryDb } from '../common';
2
- import { Files } from './files';
3
- export declare class MultiEntryFileDb<T extends Identifiable> extends MultiEntryDb<T> {
4
- protected readonly dirpath: string;
5
- protected readonly files: Files;
6
- protected readonly parser: JsonEntryParser<T>;
7
- readonly noPathlikeIds: boolean;
8
- constructor(dirpath: string, options?: MultiEntryFileDbOptions<T>);
9
- create(entry: T): Promise<T>;
10
- getById(id: T['id']): Promise<T | null>;
11
- update(id: T['id'], updater: (entry: T) => Promisable<Partial<T>>): Promise<T>;
12
- deleteById(id: T['id']): Promise<boolean>;
13
- deleteByIds(ids: T['id'][]): Promise<DeleteManyOutput>;
14
- destroy(): Promise<void>;
15
- protected getFilePath(id: T['id']): string;
16
- protected writeEntry(entry: T): Promise<void>;
17
- isIdValid(id: T['id']): boolean;
18
- protected iterEntries(): AsyncGenerator<T, void, unknown>;
19
- protected iterIds(): AsyncGenerator<string, void, unknown>;
20
- }
@@ -1,13 +0,0 @@
1
- import { JsonEntryParser, Promisable } from '../common/types';
2
- import { Files } from './files';
3
- export declare class SingleEntryFileDb<T> {
4
- protected readonly filepath: string;
5
- protected readonly parser: JsonEntryParser<T>;
6
- protected readonly files: Files;
7
- constructor(filepath: string, parser?: JsonEntryParser<T>);
8
- path(): string;
9
- isInited(): Promise<boolean>;
10
- read(): Promise<T>;
11
- write(updaterOrEntry: T | ((entry: T) => Promisable<Partial<T>>)): Promise<T>;
12
- delete(): Promise<void>;
13
- }
@@ -1,5 +0,0 @@
1
- export * from './file/multiEntryFileDb';
2
- export * from './file/singleEntryFileDb';
3
- export * from './memory/multiEntryMemDb';
4
- export * from './memory/singleEntryMemDb';
5
- export * from './common/types';
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- import { Identifiable, Promisable, MultiEntryDb } from '../common';
2
- export declare class MultiEntryMemDb<T extends Identifiable> extends MultiEntryDb<T> {
3
- protected entries: Map<T['id'], T>;
4
- create(entry: T): Promise<T>;
5
- getById(id: T['id']): Promise<T | null>;
6
- update(id: T['id'], updater: (entry: T) => Promisable<Partial<T>>): Promise<T>;
7
- deleteById(id: T['id']): Promise<boolean>;
8
- destroy(): Promise<void>;
9
- protected iterEntries(): AsyncGenerator<T, void, unknown>;
10
- protected iterIds(): AsyncGenerator<T["id"], void, unknown>;
11
- }
@@ -1,8 +0,0 @@
1
- export declare class SingleEntryMemDb<T> {
2
- protected entry: T | null;
3
- constructor(initialEntry?: T | null);
4
- isInited(): boolean;
5
- read(): T;
6
- write(updaterOrEntry: T | ((entry: T) => Partial<T>)): T;
7
- delete(): void;
8
- }