import type { AuthManager } from './auth.js'; import type { GetObjectsResult, InvitePreview, InviteRedeemResult } from './types.js'; import { type RoolClientInfo } from './client-info.js'; export type InviteErrorCode = 'INVITE_INVALID' | 'INVITE_EXPIRED' | 'INVITE_REVOKED' | 'INVITE_EXHAUSTED' | 'INVITE_EMAIL_MISMATCH'; export declare class InviteError extends Error { readonly code: InviteErrorCode; constructor(code: InviteErrorCode, message: string); } export interface RestClientConfig { apiUrl: string; authManager: AuthManager; clientInfo?: RoolClientInfo; /** Called on shard refusal/drain (421/503). Return the new API base URL. */ onRefused?: () => Promise; } export declare class RestClient { private apiUrl; private authManager; private onRefused?; private clientInfo; constructor(config: RestClientConfig); /** Update the API base URL (used after shard rerouting). */ setApiUrl(apiUrl: string): void; /** Wire the shard-reroute callback (used after shard rerouting). */ setOnRefused(onRefused: () => Promise): void; proxyFetch(spaceId: string, url: string, init?: { method?: string; headers?: Record; body?: unknown; }): Promise; getObjects(spaceId: string, paths: string[]): Promise; importArchive(name: string, archive: Blob): Promise; /** Look up an invite by token. Works without authentication (join page before sign-in). */ previewInvite(token: string): Promise; /** Redeem an invite for the authenticated user, joining (or upgrading in) the space. */ redeemInvite(token: string): Promise; private authenticatedFetch; } //# sourceMappingURL=rest.d.ts.map