2021-04-08 13:52:31 +00:00
|
|
|
/*
|
|
|
|
* https://github.com/morethanwords/tweb
|
|
|
|
* Copyright (C) 2019-2021 Eduard Kuzmenko
|
|
|
|
* https://github.com/morethanwords/tweb/blob/master/LICENSE
|
|
|
|
*/
|
|
|
|
|
2021-02-13 15:32:10 +00:00
|
|
|
import { IDBStore } from "../lib/idb";
|
|
|
|
import Modes from "./modes";
|
|
|
|
|
2021-04-24 17:06:24 +00:00
|
|
|
export type DatabaseStoreName = 'session' | 'stickerSets' | 'users' | 'chats' | 'messages' | 'dialogs';
|
2021-02-13 15:32:10 +00:00
|
|
|
export type DatabaseStore = Omit<IDBStore, 'name'> & {name: DatabaseStoreName};
|
|
|
|
const Database = {
|
|
|
|
name: 'tweb' + (Modes.test ? '_test' : ''),
|
2021-04-26 14:33:51 +00:00
|
|
|
version: 7,
|
2021-02-13 15:32:10 +00:00
|
|
|
stores: [{
|
|
|
|
name: 'session'
|
|
|
|
}, {
|
|
|
|
name: 'stickerSets'
|
2021-04-26 14:33:51 +00:00
|
|
|
}, {
|
|
|
|
name: 'users'
|
|
|
|
}, {
|
|
|
|
name: 'chats'
|
|
|
|
}, {
|
|
|
|
name: 'dialogs'
|
|
|
|
}, {
|
|
|
|
name: 'messages'
|
2021-02-13 15:32:10 +00:00
|
|
|
}] as DatabaseStore[],
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Database;
|