data.ts 642 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import Dexie from "dexie";
  2. export interface ICell {
  3. id?: number,
  4. p: object,
  5. s: number,
  6. v: string | number | boolean,
  7. m: string,
  8. f: string,
  9. fm: object,
  10. h: string,
  11. n: string
  12. }
  13. export interface IJson {
  14. id?: number,
  15. j: ICell[]
  16. }
  17. export interface IText {
  18. id?: number,
  19. t: string
  20. }
  21. export class AppDatabase extends Dexie {
  22. cells: Dexie.Table<ICell, number>;
  23. jsons: Dexie.Table<IJson, number>;
  24. text: Dexie.Table<IText, number>;
  25. public constructor() {
  26. super('database');
  27. this.version(3).stores({
  28. cells: '++id, p, s, v, m, f, fm, h, n',
  29. text: '++id, tx',
  30. jsons: '++id, t',
  31. });
  32. }
  33. }