-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.ts
24 lines (22 loc) · 799 Bytes
/
data.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { Config } from '../../../../infrastructure/indexeddb/api';
import { EventStore } from '../../../../data/store/event';
export const STORE_NAME = 'data';
export class DataStore<K extends string, V extends DataStore.Value> extends EventStore<K, V> {
public static configure(): Config {
return EventStore.configure(STORE_NAME);
}
constructor(
database: string
) {
super(database, STORE_NAME);
void Object.freeze(this);
}
}
export namespace DataStore {
export type EventType = EventStore.EventType;
export const EventType = EventStore.EventType;
export class Event<K extends string> extends EventStore.Event<K> { }
export class Record<K extends string, V extends Value> extends EventStore.Record<K, V> { }
export class Value extends EventStore.Value {
}
}