import { ConfSchema, TimeInterval } from '../../../private/node/conf-store.js'; import { LocalStorage } from '../local-storage.js'; import { RequestModeInput } from '../http.js'; import { rawRequest, RequestDocument, Variables } from 'graphql-request'; import { TypedDocumentNode } from '@graphql-typed-document-node/core'; export type Exact> = { [K in keyof T]: T[K]; }; export type GraphQLVariables = Record; export type GraphQLResponse = Awaited>>; export interface CacheOptions { cacheTTL: TimeInterval; cacheExtraKey?: string; cacheStore?: LocalStorage; } interface RefreshedTokenOnAuthorizedResponse { token?: string; } export type RefreshTokenOnAuthorizedResponse = Promise; export interface UnauthorizedHandler { type: 'token_refresh'; handler: () => RefreshTokenOnAuthorizedResponse; } interface GraphQLRequestBaseOptions { api: string; url: string; token?: string; addedHeaders?: Record; responseOptions?: GraphQLResponseOptions; cacheOptions?: CacheOptions; preferredBehaviour?: RequestModeInput; } export type GraphQLRequestOptions = GraphQLRequestBaseOptions & { query: RequestDocument; variables?: Variables; unauthorizedHandler?: UnauthorizedHandler; }; export type GraphQLRequestDocOptions = GraphQLRequestBaseOptions & { query: TypedDocumentNode | TypedDocumentNode>>; variables?: TVariables; unauthorizedHandler?: UnauthorizedHandler; autoRateLimitRestore?: boolean; }; export interface GraphQLResponseOptions { handleErrors?: boolean; onResponse?: (response: GraphQLResponse) => void; } /** * Executes a GraphQL query to an endpoint. * * @param options - GraphQL request options. * @returns The response of the query of generic type . */ export declare function graphqlRequest(options: GraphQLRequestOptions): Promise; /** * Executes a GraphQL query to an endpoint. Uses typed documents. * * @param options - GraphQL request options. * @returns The response of the query of generic type . */ export declare function graphqlRequestDoc(options: GraphQLRequestDocOptions): Promise; export {};