mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-12 15:46:29 +08:00
31 lines
730 B
TypeScript
31 lines
730 B
TypeScript
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>;
|
|
}
|