import * as Retries from "@distilled.cloud/core/retry"; /** * Hetzner retry surface -- a veneer over `@distilled.cloud/core/retry`. * * The `Retry` service tag is threaded into every generated operation via * `API.make({ retry: Retry })`, so a caller-installed policy applies to all * Hetzner calls below it and core's `makeDefault` is the fallback when none is * provided. * * Hetzner answers a tripped rate limit with `429 rate_limit_exceeded` and no * `Retry-After`, so `TooManyRequests` arrives without a server hint and the * default policy's own capped backoff drives the wait -- which is what you * want here, since the `RateLimit-Reset` header Hetzner does send points at * the FULL quota refill rather than at the next available request (see * protocol.ts). * * @example * ```ts * import * as Hetzner from "@distilled.cloud/hetzner"; * * myEffect.pipe(Hetzner.Retry.transient); * ``` */ import * as Context from "effect/Context"; import * as Effect from "effect/Effect"; export type Options = Retries.Options; export type Factory = Retries.Factory; export type Policy = Retries.Policy; declare const Retry_base: Context.ServiceClass; /** Context tag for configuring retry behavior of Hetzner API calls. */ export declare class Retry extends /*@__PURE__*/ Retry_base { } /** Provides a custom retry policy to every Hetzner API call below it. */ export declare const policy: { (options: Options): (effect: Effect.Effect) => Effect.Effect>; (factory: Factory): (effect: Effect.Effect) => Effect.Effect>; }; /** Disables all automatic retries. */ export declare const none: (effect: Effect.Effect) => Effect.Effect>; /** * The default retry policy (core's): transient/throttling/retryable errors, * capped exponential backoff with jitter, server `retryAfter` hints honored * with precedence. */ export declare const makeDefault: Factory; export declare const jittered: (self: import("effect/Schedule").Schedule) => import("effect/Schedule").Schedule; export declare const capped: (max: import("effect/Duration").Duration) => (self: import("effect/Schedule").Schedule) => import("effect/Schedule").Schedule; /** Retry options that retry all throttling errors indefinitely. */ export declare const throttlingOptions: Options; /** Retries all throttling errors indefinitely (honoring server hints). */ export declare const throttling: (effect: Effect.Effect) => Effect.Effect>; /** Retry options that retry all transient errors indefinitely. */ export declare const transientOptions: Options; /** Retries all transient errors indefinitely (honoring server hints). */ export declare const transient: (effect: Effect.Effect) => Effect.Effect>; export {}; //# sourceMappingURL=retry.d.ts.map