@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)
37 lines (36 loc) • 1.06 kB
TypeScript
import { MONACO_THEME_NAME } from '../constants';
import { StateCreator } from 'zustand';
import { SlicesWithActions, Theme } from '../types';
import type * as monaco from 'monaco-editor';
declare type MonacoTheme = monaco.editor.BuiltinTheme | (typeof MONACO_THEME_NAME)[keyof typeof MONACO_THEME_NAME] | ({} & string);
export interface ThemeSlice {
theme: Theme;
monacoTheme?: MonacoTheme;
}
export interface ThemeActions {
/**
* Set a new theme
*/
setTheme: (newTheme: Theme) => void;
}
export interface ThemeProps {
/**
* @default null
*/
defaultTheme?: Theme;
/**
* Sets the color theme for the monaco editors.
* @default { dark: 'graphiql-DARK', light: 'graphiql-LIGHT' }
*/
editorTheme?: {
dark: MonacoTheme;
light: MonacoTheme;
};
}
declare type CreateThemeSlice = (initial: Pick<ThemeProps, 'editorTheme'>) => StateCreator<SlicesWithActions, [
], [
], ThemeSlice & {
actions: ThemeActions;
}>;
export declare const createThemeSlice: CreateThemeSlice;
export {};