UNPKG

1.57 kBTypeScriptView Raw
1import { FragmentDefinitionNode, GraphQLDirective, GraphQLSchema } from 'graphql';
2import { CompletionItem, AllTypeInfo, IPosition } from 'graphql-language-service-types';
3import { CharacterStream, ContextToken, State, ContextTokenForCodeMirror } from 'graphql-language-service-parser';
4export declare const SuggestionCommand: {
5 command: string;
6 title: string;
7};
8export declare type AutocompleteSuggestionOptions = {
9 fillLeafsOnComplete?: boolean;
10 schema?: GraphQLSchema;
11};
12export declare function getAutocompleteSuggestions(schema: GraphQLSchema, queryText: string, cursor: IPosition, contextToken?: ContextTokenForCodeMirror, fragmentDefs?: FragmentDefinitionNode[] | string, options?: AutocompleteSuggestionOptions): Array<CompletionItem>;
13export declare function getVariableCompletions(queryText: string, schema: GraphQLSchema, token: ContextToken): CompletionItem[];
14export declare function getFragmentDefinitions(queryText: string): Array<FragmentDefinitionNode>;
15export declare function getTokenAtPosition(queryText: string, cursor: IPosition): ContextToken;
16declare type callbackFnType = (stream: CharacterStream, state: State, style: string, index: number) => void | 'BREAK';
17export declare function runOnlineParser(queryText: string, callback: callbackFnType): ContextToken;
18export declare function canUseDirective(state: State['prevState'], directive: GraphQLDirective): boolean;
19export declare function getTypeInfo(schema: GraphQLSchema, tokenState: State): AllTypeInfo;
20export {};
21//# sourceMappingURL=getAutocompleteSuggestions.d.ts.map
\No newline at end of file