import { EndpointType, KnownEndpoint, OptionsByEndpoint } from "@gw2api/types/endpoints"; import { SchemaVersion } from "@gw2api/types/schema"; //#region src/index.d.ts type RequiredKeys = { [K in keyof T]-?: {} extends Pick ? never : K }[keyof T]; type Args = RequiredKeys> extends never ? [endpoint: Url, options?: FetchGw2ApiOptions & OptionsByEndpoint & FetchOptions] : [endpoint: Url, options: FetchGw2ApiOptions & OptionsByEndpoint & FetchOptions]; declare function fetchGw2Api(...[endpoint, options]: Args): Promise>; type FetchGw2ApiOptions = { /** The schema to use when making the API request */schema?: Schema; /** onRequest handler allows to modify the request made to the Guild Wars 2 API. */ onRequest?: (request: Request) => Request | Promise; /** * onResponse handler. Called for all responses, successful or not. * Make sure to clone the response in case of consuming the body. */ onResponse?: (response: Response) => void | Promise; }; type FetchOptions = { /** @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal */signal?: AbortSignal; /** @see https://developer.mozilla.org/en-US/docs/Web/API/Request/cache */ cache?: RequestCache; }; declare class Gw2ApiError extends Error { response: Response; constructor(message: string, response: Response); } //#endregion export { FetchGw2ApiOptions, FetchOptions, Gw2ApiError, fetchGw2Api };