An in-browser wisp.place site explorer
at main 70 lines 1.1 kB view raw
1/** 2 * ATProto-related types for the client 3 */ 4 5/** 6 * Resolution result from handle/DID to PDS 7 */ 8export interface ResolutionResult { 9 handle?: string; 10 did: string; 11 pdsUrl: string; 12} 13 14/** 15 * Site information from a wisp.fs record 16 */ 17export interface WispSiteInfo { 18 rkey: string; 19 site: string; 20 fileCount?: number; 21 createdAt?: string; 22} 23 24/** 25 * Blob fetch result 26 */ 27export interface BlobResult { 28 cid: string; 29 data: Uint8Array; 30 mimeType: string; 31} 32 33/** 34 * Cache entry types 35 */ 36export interface CacheEntry<T> { 37 data: T; 38 timestamp: number; 39 ttl?: number; 40} 41 42/** 43 * Error types 44 */ 45export class ResolutionError extends Error { 46 constructor( 47 message: string, 48 public readonly code?: string 49 ) { 50 super(message); 51 this.name = 'ResolutionError'; 52 } 53} 54 55export class FetchError extends Error { 56 constructor( 57 message: string, 58 public readonly statusCode?: number 59 ) { 60 super(message); 61 this.name = 'FetchError'; 62 } 63} 64 65export class CorsError extends Error { 66 constructor(message: string) { 67 super(message); 68 this.name = 'CorsError'; 69 } 70}