import { i as TokenType } from "./auth-DHnU77be.js"; import { GraphQLError } from "graphql"; //#region src/errors.d.ts declare class GraphQLRequestError extends Error { readonly response?: Response | undefined; readonly body?: (GraphQLResponse | null) | undefined; readonly rawBody?: string | undefined; constructor(message: string, response?: Response | undefined, body?: (GraphQLResponse | null) | undefined, rawBody?: string | undefined, options?: ErrorOptions); } declare class NotFoundError extends GraphQLRequestError { constructor(message: string, response?: Response, body?: GraphQLResponse | null, rawBody?: string, options?: ErrorOptions); } declare class ValidationError extends GraphQLRequestError { constructor(message: string, response?: Response, body?: GraphQLResponse | null, rawBody?: string, options?: ErrorOptions); } declare class PermissionError extends GraphQLRequestError { constructor(message: string, response?: Response, body?: GraphQLResponse | null, rawBody?: string, options?: ErrorOptions); } declare class NetworkError extends GraphQLRequestError { constructor(message: string, response?: Response, body?: GraphQLResponse | null, rawBody?: string, options?: ErrorOptions); } //#endregion //#region src/types.d.ts interface GraphQLRequestSignal { readonly aborted: boolean; addEventListener?: (type: string, listener: (...args: unknown[]) => void) => void; removeEventListener?: (type: string, listener: (...args: unknown[]) => void) => void; } interface RetryContext { attempt: number; error: GraphQLRequestError; response?: Response; signal?: GraphQLRequestSignal; } interface RetryOptions { maxAttempts: number; shouldRetry?: (context: RetryContext) => boolean | Promise; onRetry?: (context: RetryContext) => void | Promise; delayMs?: number | ((attempt: number) => number | Promise); } interface GraphQLRequestBaseOptions { headers?: Record; signal?: GraphQLRequestSignal; fetch?: typeof fetch; retry?: RetryOptions; } interface GraphQLResponse { data?: TData; errors?: GraphQLError[]; } interface RailwayClientOptions { token: string; tokenType?: TokenType; endpoint?: string; fetch?: typeof fetch; headers?: Record; retry?: RetryOptions; } interface GraphQLRequestOptions> extends GraphQLRequestBaseOptions { query: string; variables?: TVariables; operationName?: string; } type GraphQLDocumentRequestOptions = GraphQLRequestBaseOptions; //#endregion export { GraphQLResponse as a, RetryOptions as c, NotFoundError as d, PermissionError as f, GraphQLRequestSignal as i, GraphQLRequestError as l, GraphQLRequestBaseOptions as n, RailwayClientOptions as o, ValidationError as p, GraphQLRequestOptions as r, RetryContext as s, GraphQLDocumentRequestOptions as t, NetworkError as u };