/** * Extended blob reference that includes CDN URL from appview responses. */ export interface BlobWithCdn { $type: "blob"; ref: { $link: string; }; mimeType: string; size: number; /** CDN URL from Bluesky appview (e.g., https://cdn.bsky.app/img/avatar/plain/did:plc:xxx/bafkreixxx@jpeg) */ cdnUrl?: string; } /** * Options for {@link useBlueskyAppview}. */ export interface UseBlueskyAppviewOptions { /** DID or handle of the actor. */ did?: string; /** NSID collection (e.g., "app.bsky.feed.post"). */ collection?: string; /** Record key within the collection. */ rkey?: string; /** Override for the Bluesky appview service URL. Defaults to public.api.bsky.app. */ appviewService?: string; /** If true, skip the appview and go straight to Slingshot/PDS fallback. */ skipAppview?: boolean; } /** * Result returned from {@link useBlueskyAppview}. */ export interface UseBlueskyAppviewResult { /** The fetched record value. */ record?: T; /** Indicates whether a fetch is in progress. */ loading: boolean; /** Error encountered during fetch. */ error?: Error; /** Source from which the record was successfully fetched. */ source?: "appview" | "slingshot" | "pds"; } export declare function useBlueskyAppview({ did: handleOrDid, collection, rkey, appviewService, skipAppview, }: UseBlueskyAppviewOptions): UseBlueskyAppviewResult; /** * Shared RPC utility for making appview API calls with proper typing. */ export declare function callAppviewRpc(service: string, nsid: string, params: Record): Promise<{ ok: boolean; data: TResponse; }>; /** * Shared RPC utility for making getRecord calls (Slingshot or PDS). */ export declare function callGetRecord(service: string, did: string, collection: string, rkey: string): Promise<{ ok: boolean; data: { value: T; }; }>; /** * Shared RPC utility for making listRecords calls. */ export declare function callListRecords(service: string, did: string, collection: string, limit: number, cursor?: string): Promise<{ ok: boolean; data: { records: Array<{ uri: string; rkey?: string; value: T; }>; cursor?: string; }; }>;