mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 06:18:45 +08:00
feat(nbstore): rename SyncStorage to DocSyncStorage (#10751)
This commit is contained in:
+7
-3
@@ -1,9 +1,13 @@
|
||||
import { share } from '../../connection';
|
||||
import { type DocClock, type DocClocks, SyncStorageBase } from '../../storage';
|
||||
import {
|
||||
type DocClock,
|
||||
type DocClocks,
|
||||
DocSyncStorageBase,
|
||||
} from '../../storage';
|
||||
import { IDBConnection, type IDBConnectionOptions } from './db';
|
||||
|
||||
export class IndexedDBSyncStorage extends SyncStorageBase {
|
||||
static readonly identifier = 'IndexedDBSyncStorage';
|
||||
export class IndexedDBDocSyncStorage extends DocSyncStorageBase {
|
||||
static readonly identifier = 'IndexedDBDocSyncStorage';
|
||||
|
||||
constructor(private readonly options: IDBConnectionOptions) {
|
||||
super();
|
||||
@@ -1,14 +1,14 @@
|
||||
import type { StorageConstructor } from '..';
|
||||
import { IndexedDBBlobStorage } from './blob';
|
||||
import { IndexedDBDocStorage } from './doc';
|
||||
import { IndexedDBSyncStorage } from './sync';
|
||||
import { IndexedDBDocSyncStorage } from './doc-sync';
|
||||
|
||||
export * from './blob';
|
||||
export * from './doc';
|
||||
export * from './sync';
|
||||
export * from './doc-sync';
|
||||
|
||||
export const idbStorages = [
|
||||
IndexedDBDocStorage,
|
||||
IndexedDBBlobStorage,
|
||||
IndexedDBSyncStorage,
|
||||
IndexedDBDocSyncStorage,
|
||||
] satisfies StorageConstructor[];
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
import { share } from '../../connection';
|
||||
import { type DocClock, SyncStorageBase } from '../../storage';
|
||||
import { type DocClock, DocSyncStorageBase } from '../../storage';
|
||||
import { NativeDBConnection, type SqliteNativeDBOptions } from './db';
|
||||
|
||||
export class SqliteSyncStorage extends SyncStorageBase {
|
||||
static readonly identifier = 'SqliteSyncStorage';
|
||||
export class SqliteDocSyncStorage extends DocSyncStorageBase {
|
||||
static readonly identifier = 'SqliteDocSyncStorage';
|
||||
|
||||
override connection = share(new NativeDBConnection(this.options));
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import type { StorageConstructor } from '..';
|
||||
import { SqliteBlobStorage } from './blob';
|
||||
import { SqliteDocStorage } from './doc';
|
||||
import { SqliteSyncStorage } from './sync';
|
||||
import { SqliteDocSyncStorage } from './doc-sync';
|
||||
|
||||
export * from './blob';
|
||||
export { bindNativeDBApis, type NativeDBApis } from './db';
|
||||
export * from './doc';
|
||||
export * from './sync';
|
||||
export * from './doc-sync';
|
||||
|
||||
export const sqliteStorages = [
|
||||
SqliteDocStorage,
|
||||
SqliteBlobStorage,
|
||||
SqliteSyncStorage,
|
||||
SqliteDocSyncStorage,
|
||||
] satisfies StorageConstructor[];
|
||||
|
||||
Reference in New Issue
Block a user