import type { EncryptedKeyEntry } from "./crypto.js"; export declare class ApiError extends Error { readonly status: number; constructor(message: string, status: number); } export declare class RoomFullError extends ApiError { constructor(message?: string); } export declare class RoomNotFoundError extends ApiError { constructor(message?: string); } export interface RoomFileMeta { name: string; originalName?: string; type?: string; storageType?: string; size: number; status: "pending" | "uploading" | "ready" | "downloading"; downloaded?: boolean; isVoiceNote?: boolean; path?: string; encryptedSymmetricKeys?: EncryptedKeyEntry[]; } export interface RoomState { createdAt?: number; expiresAt?: number | null; senderPresent?: boolean; receiverPresent?: boolean; status?: string; files?: Record; receiverClientId?: string | null; receiverLastSeen?: number; } type KeyAction = "store-sender-key" | "store-receiver-key" | "get-sender-key" | "get-receiver-key"; export declare class JustDropApi { readonly baseUrl: string; constructor(baseUrl: string); private request; createRoom(timerMinutes: number): Promise<{ roomCode: string; expiresAt: number | null; }>; join(roomCode: string, clientId: string): Promise; exists(roomCode: string): Promise; storeKey(roomCode: string, action: Extract, publicKey: string, clientId?: string): Promise; /** Returns the base64 public key, or null when the other party hasn't shared one yet. */ getKey(roomCode: string, action: Extract): Promise; requestUpload(params: { roomCode: string; fileName: string; fileSize: number; originalFileType?: string; encryptedSymmetricKeys: EncryptedKeyEntry[]; }): Promise<{ fileId: string; signedUrl: string; filePath: string; }>; finalizeUpload(roomCode: string, fileId: string, filePath: string): Promise; download(roomCode: string, fileId: string): Promise<{ downloadURL: string; fileData: RoomFileMeta; }>; markDownloaded(roomCode: string, fileId: string): Promise; presence(roomCode: string, userType: "sender" | "receiver", isPresent: boolean, clientId?: string): Promise; closeRoom(roomCode: string): Promise; } /** Uploads an encrypted payload to the GCS signed URL minted by requestUpload. */ export declare function putToSignedUrl(signedUrl: string, payload: Uint8Array): Promise; export {};