import { PromiseOrValue } from '@envelop/core';
import { YogaLogger } from '../logger.cjs';
import { Plugin } from './types.cjs';
export declare function shouldRenderGraphiQL({ headers, method }: Request): boolean;
export type GraphiQLOptions = {
    /**
     * An optional GraphQL string to use when no query is provided and no stored
     * query exists from a previous session.  If undefined is provided, GraphiQL
     * will use its own default query.
     */
    defaultQuery?: string;
    /**
     * Whether to open the variable editor by default. Defaults to `true`.
     *
     * @deprecated Obsolete option. Variable editor was opened by default
     */
    defaultVariableEditorOpen?: boolean;
    /**
     * The initial headers to render inside the header editor. Defaults to `"{}"`.
     * The value should be a JSON encoded string, for example:
     * `headers: JSON.stringify({Authorization: "Bearer your-auth-key"})`
     */
    headers?: string;
    /**
     * More info there: https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials
     */
    credentials?: RequestCredentials;
    /**
     * Whether the header editor is enabled. Defaults to `true`.
     *
     * @deprecated Obsolete option. Header editor was enabled by default
     */
    headerEditorEnabled?: boolean;
    /**
     * The title to display at the top of the page. Defaults to `"Yoga GraphiQL"`.
     */
    title?: string;
    /**
     * Protocol for subscriptions
     */
    subscriptionsProtocol?: 'SSE' | 'GRAPHQL_SSE' | 'WS' | 'LEGACY_WS';
    /**
     * Extra headers you always want to pass with users' headers input
     */
    additionalHeaders?: Record<string, string>;
};
export type GraphiQLRendererOptions = {
    /**
     * The endpoint requests should be sent. Defaults to `"/graphql"`.
     */
    endpoint?: string;
} & GraphiQLOptions;
export declare const renderGraphiQL: (opts: GraphiQLRendererOptions) => string;
export type GraphiQLOptionsFactory<TServerContext> = (request: Request, ...args: {} extends TServerContext ? [serverContext?: TServerContext | undefined] : [serverContext: TServerContext]) => PromiseOrValue<GraphiQLOptions | boolean>;
export type GraphiQLOptionsOrFactory<TServerContext> = GraphiQLOptions | GraphiQLOptionsFactory<TServerContext> | boolean;
export interface GraphiQLPluginConfig<TServerContext> {
    graphqlEndpoint: string;
    options?: GraphiQLOptionsOrFactory<TServerContext>;
    render?(options: GraphiQLRendererOptions): PromiseOrValue<BodyInit>;
    logger?: YogaLogger;
}
export declare function useGraphiQL<TServerContext extends Record<string, any>>(config: GraphiQLPluginConfig<TServerContext>): Plugin<{}, TServerContext>;
