@graphiql/react
Version:
[Changelog](https://github.com/graphql/graphiql/blob/main/packages/graphiql-react/CHANGELOG.md) | [API Docs](https://graphiql-test.netlify.app/typedoc/modules/graphiql_react.html) | [NPM](https://www.npmjs.com/package/@graphiql/react)
98 lines (97 loc) • 3.93 kB
TypeScript
import { MonacoEditor } from './types';
/**
* @deprecated Use `const { prettifyEditors } = useGraphiQLActions()` instead.
*/
export declare function usePrettifyEditors(): () => Promise<void>;
/**
* @deprecated Use `const { copyQuery } = useGraphiQLActions()` instead.
*/
export declare function useCopyQuery(): () => Promise<void>;
/**
* @deprecated Use `const { mergeQuery } = useGraphiQLActions()` instead.
*/
export declare function useMergeQuery(): () => void;
/**
* @deprecated Use `useGraphiQLActions` and `useGraphiQL` hooks instead.
*/
export declare function useEditorContext(): {
externalFragments: Map<string, import('graphql').FragmentDefinitionNode>;
shouldPersistHeaders: boolean;
initialQuery: string;
initialVariables: string;
initialHeaders: string;
headerEditor?: import("monaco-editor").editor.IStandaloneCodeEditor | undefined;
queryEditor?: import("monaco-editor").editor.IStandaloneCodeEditor | undefined;
responseEditor?: import("monaco-editor").editor.IStandaloneCodeEditor | undefined;
variableEditor?: import("monaco-editor").editor.IStandaloneCodeEditor | undefined;
addTab: () => void;
changeTab: (index: number) => void;
moveTab: (newOrder: import('./utility/tabs').TabState[]) => void;
closeTab: (index: number) => void;
updateActiveTabValues: (partialTab: Partial<Omit<import('./utility/tabs').TabState, "title" | "id" | "hash">>) => void;
setHeaderEditor: (headerEditor: MonacoEditor) => void;
setQueryEditor: (queryEditor: MonacoEditor) => void;
setResponseEditor: (responseEditor: MonacoEditor) => void;
setVariableEditor: (variableEditor: MonacoEditor) => void;
setOperationName: (operationName: string) => void;
setShouldPersistHeaders: (persist: boolean) => void;
};
/**
* @deprecated Use `useGraphiQLActions` and `useGraphiQL` hooks instead.
*/
export declare function useExecutionContext(): {
isFetching: boolean;
isSubscribed: boolean;
operationName: string | undefined;
run: () => void;
stop: () => void;
};
/**
* @deprecated Use `useGraphiQLActions` and `useGraphiQL` hooks instead.
*/
export declare function usePluginContext(): {
plugins: import('.').GraphiQLPlugin[];
visiblePlugin: import('.').GraphiQLPlugin | null;
setVisiblePlugin: (plugin?: string | import('.').GraphiQLPlugin | null | undefined) => void;
};
/**
* @deprecated Use `useGraphiQLActions` and `useGraphiQL` hooks instead.
*/
export declare function useSchemaContext(): {
isFetching: boolean;
fetchError: string | null;
schema: import('graphql').GraphQLSchema | null | undefined;
validationErrors: readonly import('graphql').GraphQLError[];
introspect: () => Promise<void>;
};
/**
* @deprecated Use `const storage = useGraphiQL(state => state.storage)` instead.
*/
export declare const useStorage: () => import('@graphiql/toolkit/dist/esm/storage/base.mjs').StorageAPI;
/**
* @deprecated Use `const storage = useGraphiQL(state => state.storage)` instead.
*/
export declare const useStorageContext: () => import('@graphiql/toolkit/dist/esm/storage/base.mjs').StorageAPI;
/**
* @deprecated Use `useGraphiQLActions` and `useGraphiQL` hooks instead.
*/
export declare function useTheme(): {
setTheme: (newTheme: import('./types').Theme) => void;
theme: import('./types').Theme;
};
/**
* @deprecated Use `useGraphiQLActions` and `useGraphiQL` hooks instead.
*/
export declare const useEditorStore: typeof useEditorContext;
/**
* @deprecated Use `useGraphiQLActions` and `useGraphiQL` hooks instead.
*/
export declare const useExecutionStore: typeof useExecutionContext;
/**
* @deprecated Use `useGraphiQLActions` and `useGraphiQL` hooks instead.
*/
export declare const usePluginStore: typeof usePluginContext;
/**
* @deprecated Use `useGraphiQLActions` and `useGraphiQL` hooks instead.
*/
export declare const useSchemaStore: typeof useSchemaContext;