mirror of
https://github.com/DocNR/POWR.git
synced 2025-04-23 01:01:27 +00:00
54 lines
1.0 KiB
TypeScript
54 lines
1.0 KiB
TypeScript
![]() |
// types/shared.ts
|
||
|
/**
|
||
|
* Available storage sources for content
|
||
|
*/
|
||
|
export type StorageSource = 'local' | 'backup' | 'nostr';
|
||
|
|
||
|
/**
|
||
|
* Nostr sync metadata
|
||
|
*/
|
||
|
export interface NostrSyncMetadata {
|
||
|
timestamp: number;
|
||
|
metadata: {
|
||
|
id: string;
|
||
|
pubkey: string;
|
||
|
relayUrl: string;
|
||
|
created_at: number;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Last synced information for different storage sources
|
||
|
*/
|
||
|
export interface LastSyncedInfo {
|
||
|
backup?: number;
|
||
|
nostr?: NostrSyncMetadata;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Content availability information
|
||
|
* Tracks where content is stored and when it was last synced
|
||
|
*/
|
||
|
export interface ContentAvailability {
|
||
|
source: StorageSource[];
|
||
|
lastSynced?: LastSyncedInfo;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Generic content metadata interface
|
||
|
* Can be extended by specific content types
|
||
|
*/
|
||
|
export interface ContentMetadata {
|
||
|
created_at: number;
|
||
|
updated_at?: number;
|
||
|
deleted_at?: number;
|
||
|
version?: number;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Base interface for all syncable content
|
||
|
*/
|
||
|
export interface SyncableContent extends ContentMetadata {
|
||
|
id: string;
|
||
|
availability: ContentAvailability;
|
||
|
}
|