import { GatewayPlugin } from "../gateway/GatewayPlugin.js"; import type { GatewayPluginOptions } from "../gateway/types.js"; type RuntimeProfile = "serverless" | "persistent"; export interface GatewayForwarderDeliveryOptions { timeoutMs?: number; maxRetries?: number; baseBackoffMs?: number; maxBackoffMs?: number; jitterRatio?: number; maxInFlight?: number; maxQueueSize?: number; retryStatusCodes?: number[]; } export interface GatewayForwarderPluginOptions extends GatewayPluginOptions { /** * The URL to forward webhook events to. * Typically this is your base URL in the client, and then `/events` */ webhookUrl: string; /** * Optional headers to add to the webhook request. */ webhookHeaders?: Record; /** * Runtime profile that controls delivery defaults. * * @default "serverless" */ runtimeProfile?: RuntimeProfile; /** * Delivery policy for forwarded events. */ delivery?: GatewayForwarderDeliveryOptions; /** * Custom fetch for forwarding delivery. */ fetch?: (input: string | URL | Request, init?: RequestInit) => Promise; /** * The ed25519 private key in PEM format, used to sign forwarded events. * This should include the BEGIN/END markers. When loading from an environment * variable, the newlines can be escaped (\\n). */ privateKey: string; } export declare class GatewayForwarderPlugin extends GatewayPlugin { readonly id: "gateway"; readonly options: GatewayForwarderPluginOptions; private privateKey; private guildAvailabilityCache; private deliveryPolicy; private deliveryExecutor; private forwardFetch; private deliveryMetrics; private failureReasons; constructor(options: GatewayForwarderPluginOptions); protected setupWebSocket(): void; getDeliveryMetrics(): { queueDepth: number; inFlight: number; policy: Required; failureReasons: { [k: string]: number; }; accepted: number; sent: number; retried: number; failed: number; dropped: number; timeouts: number; lastFailureReason: string | null; lastFailureEventType: string | null; lastFailureAt: number; lastSuccessAt: number; oldestQueuedAgeMs: number; }; private enqueueDelivery; private deliver; private sendWithTimeout; private getRetryDelay; private trackFailure; } export {}; //# sourceMappingURL=GatewayForwarderPlugin.d.ts.map