import { FieldsSelection } from './genql/runtime/_type-selection.js'; import { C as ClientOptions, G as GetClient } from './_create-client-B5RrFpfM.js'; import { FallbackPlayground } from './bin/util/get-stuff-from-env.js'; import { GraphqlOperation } from './genql/runtime/_generate-graphql-operation.js'; import { GraphQLExact, StripAllArgs } from './type-helpers.js'; import './genql/runtime/_types.js'; import './genql/runtime/_aliasing.js'; import './common-types.js'; interface Scalars { } interface Query { } interface Mutation { } interface QueryGenqlSelection { } interface MutationGenqlSelection { } interface FragmentsMap { } declare function cacheTagFromQuery({ query, sdkBuildId, }: { query: Record; sdkBuildId: string; }): string; type Options = Omit & { draft?: boolean; token?: string; ref?: string; fallbackPlayground?: FallbackPlayground | undefined; }; /** * Create a basehub client. * * @param options (optional) Options for the `fetch` request; for example in Next.js, you can do `{ next: { revalidate: 60 } }` to tweak your app's cache. * @returns A basehub client. * * @example * import { basehub } from 'basehub' * * const firstQuery = await basehub().query({ * __typename: true, * }); * * console.log(firstQuery.__typename) // => 'Query' * */ declare const basehub: = Query, QSel extends Record = QueryGenqlSelection, M extends Record = Mutation, MSel extends Record = MutationGenqlSelection>(options?: Options) => GetClient; type QueryResult = FieldsSelection; declare const generateQueryOp: (fields: QueryGenqlSelection) => GraphqlOperation; type MutationResult = FieldsSelection; declare const generateMutationOp: (fields: MutationGenqlSelection) => GraphqlOperation; /** * Global configuration for the `basehub` SDK */ type BaseHubConfig = Pick & {}; declare function setGlobalConfig(config: BaseHubConfig): void; declare function getGlobalConfig(): BaseHubConfig | null; type OmitDistributive = T extends any ? T extends object ? Id> : T : never; type Id = {} & { [P in keyof T]: T[P]; }; type OmitRecursively = Omit<{ [P in keyof T]: OmitDistributive; }, K>; declare function fragmentOn(name: TypeName, fields: Selection & GraphQLExact, FragmentsMap[TypeName]["selection"]>): Selection & { __fragmentOn: TypeName; }; declare namespace fragmentOn { type infer = T extends { __fragmentOn: infer U extends keyof FragmentsMap; } ? OmitRecursively>, "__fragmentOn"> : never; } type RecursiveCollection = T & { [key in Key]: { items: RecursiveCollection; }; }; declare function fragmentOnRecursiveCollection(name: TypeName, fields: Selection & GraphQLExact, FragmentsMap[TypeName]["selection"]>, options: { recursiveKey: RecursiveKey; levels: number; getLevelArgs?: (level: number) => unknown; }): RecursiveCollection<{ readonly __fragmentOn: TypeName; } & Selection, RecursiveKey>; export { type BaseHubConfig, type FragmentsMap, type Mutation, type MutationGenqlSelection, type MutationResult, type Options, type Query, type QueryGenqlSelection, type QueryResult, type Scalars, basehub, cacheTagFromQuery, fragmentOn, fragmentOnRecursiveCollection, generateMutationOp, generateQueryOp, getGlobalConfig, setGlobalConfig };