import { CID } from 'multiformats'; import { SignedDelegation } from './types.ts'; export declare class DagIncompleteError extends Error { rootCID: string; reason: string; constructor(rootCID: string, reason: string); } /** * Options that tune the store upload path. * * The whole push (retries included) still throws if the proxy never accepts the * CAR, so contracts are preserved; the improvements are resilience and reduced * log noise: transient network hiccups no longer fail on the very first attempt, * and a warning is only emitted once all attempts are exhausted. */ export interface StoreCarOptions { /** Timeout budget per attempt (ms). Default: size-aware floor (see DEFAULT_TIMEOUT_MS). */ timeoutMs?: number; /** Number of redelivery attempts AFTER the initial one. Default: 2 (3 attempts total). */ retries?: number; /** Delay between failed attempts (ms). Default: 500. */ retryDelayMs?: number; } /** Floor for the per-attempt upload timeout — generous enough for a slow/saturated proxy. */ export declare const DEFAULT_TIMEOUT_MS = 600000; /** Default number of retries before the first warning/error is logged. */ export declare const DEFAULT_RETRIES = 2; /** Default delay between retry attempts. */ export declare const DEFAULT_RETRY_DELAY_MS = 500; /** * Store a CAR file using UCAN delegation authentication. * * Uses the delegation spec format (cmd/sub/pol) for authorization. * The delegation and its proof chain are sent via HTTP headers: * - Authorization: Bearer * - ucans: * * Transient (transport/timeout) failures are retried up to `opts.retries` * (default 2, i.e. 3 attempts total) before an error is surfaced. Only the final * failing attempt logs a warning; intermediate attempts are DEBUG-only. HTTP-status * and DAG-verification failures are surfaced immediately and are not retried. * * @param baseUrl - Base URL of the storage server * @param car - CAR file blob to upload * @param delegation - Signed delegation authorizing the store operation * @param signal - Optional external abort signal; when provided the caller owns * timing/cancellation and no retries are applied. * @param opts - Optional per-call tuning (timeoutMs, retries, retryDelayMs). * @returns CID of the stored content */ export declare function storeCar(baseUrl: string, car: Blob, delegation: SignedDelegation, signal?: AbortSignal, opts?: StoreCarOptions): Promise; //# sourceMappingURL=store.d.ts.map