import type { ScopeValues, SyncAuthErrorContext, SyncAuthLifecycle, SyncAuthOperation, SyncTransportCapabilities, SyncTransportOptions } from '@syncular/core'; export type SyncTransportPath = 'direct' | 'relay'; export interface ClientOptions { /** Base URL for the API (e.g., 'https://api.example.com') */ baseUrl: string; /** Function to get headers for requests (e.g., for auth tokens) */ getHeaders?: () => Record | Promise>; /** Shared auth lifecycle for all transport operations. */ authLifecycle?: SyncAuthLifecycle; /** Custom fetch implementation (defaults to globalThis.fetch) */ fetch?: typeof globalThis.fetch; /** * Transport path telemetry sent to the server. * Defaults to 'direct'. */ transportPath?: SyncTransportPath; /** * Explicit runtime capabilities override. * Use this to avoid environment sniffing in runtimes like React Native. */ capabilities?: Partial; } export type ApiResult = { data?: T; error?: unknown; response: Response; }; export type ResolveAuthRetry = (context: SyncAuthErrorContext, options?: SyncTransportOptions) => Promise; export declare function getErrorMessage(error: unknown): string; export declare function unwrap(promise: Promise<{ data?: T; error?: unknown; }>): Promise; export declare function executeWithAuthRetry(execute: (signal?: AbortSignal) => Promise>, options: SyncTransportOptions | undefined, operation: SyncAuthOperation, resolveAuthRetry: ResolveAuthRetry): Promise>; export declare function executeWithTransientNetworkRetry(args: { execute: (signal?: AbortSignal) => Promise; options?: SyncTransportOptions; }): Promise; export declare const SNAPSHOT_SCOPES_HEADER = "x-syncular-snapshot-scopes"; export declare function resolveRequestUrl(baseUrl: string, path: string): string; export declare function bytesToReadableStream(bytes: Uint8Array): ReadableStream; export declare function encodeSnapshotScopes(scopeValues: ScopeValues | undefined): string | null; export declare function applySnapshotScopesHeader(headers: Headers, scopeValues: ScopeValues | undefined): void; export declare function resolveSnapshotChunkRequestUrl(baseUrl: string, chunkId: string, scopeValues: ScopeValues | undefined): string; //# sourceMappingURL=shared.d.ts.map