mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-18 18:41:52 +08:00
feat(nbstore): add blob sync storage (#10752)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import type { Connection } from '../connection';
|
||||
import type { Storage } from './storage';
|
||||
|
||||
export interface BlobSyncStorage extends Storage {
|
||||
readonly storageType: 'blobSync';
|
||||
|
||||
setBlobUploadedAt(
|
||||
peer: string,
|
||||
blobId: string,
|
||||
uploadedAt: Date | null
|
||||
): Promise<void>;
|
||||
|
||||
getBlobUploadedAt(peer: string, blobId: string): Promise<Date | null>;
|
||||
}
|
||||
|
||||
export abstract class BlobSyncStorageBase implements BlobSyncStorage {
|
||||
readonly storageType = 'blobSync';
|
||||
abstract readonly connection: Connection;
|
||||
|
||||
abstract setBlobUploadedAt(
|
||||
peer: string,
|
||||
blobId: string,
|
||||
uploadedAt: Date | null
|
||||
): Promise<void>;
|
||||
|
||||
abstract getBlobUploadedAt(
|
||||
peer: string,
|
||||
blobId: string
|
||||
): Promise<Date | null>;
|
||||
}
|
||||
Reference in New Issue
Block a user