1 | import CodeMirror, { Hints, Hint } from 'codemirror';
|
2 | import 'codemirror/addon/hint/show-hint';
|
3 | import { FragmentDefinitionNode, GraphQLSchema, GraphQLType } from 'graphql';
|
4 | import type { Maybe } from 'graphql-language-service';
|
5 | export interface GraphQLHintOptions {
|
6 | schema?: GraphQLSchema;
|
7 | externalFragments?: string | FragmentDefinitionNode[];
|
8 | }
|
9 | interface IHint extends Hint {
|
10 | isDeprecated?: boolean;
|
11 | type?: Maybe<GraphQLType>;
|
12 | description?: Maybe<string>;
|
13 | deprecationReason?: Maybe<string>;
|
14 | }
|
15 | interface IHints extends Hints {
|
16 | list: IHint[];
|
17 | }
|
18 | declare module 'codemirror' {
|
19 | interface ShowHintOptions {
|
20 | schema?: GraphQLSchema;
|
21 | externalFragments?: string | FragmentDefinitionNode[];
|
22 | }
|
23 | interface CodeMirrorHintMap {
|
24 | graphql: (editor: CodeMirror.Editor, options: GraphQLHintOptions) => IHints | undefined;
|
25 | }
|
26 | }
|
27 | export type { IHint, IHints };
|
28 |
|
\ | No newline at end of file |