/** * Copyright (c) 2021 GraphQL Contributors * All rights reserved. * * This source code is licensed under the license found in the * LICENSE file in the root directory of this source tree. * * @flow */ import type { Outline, Diagnostic, ContextToken, ContextTokenUnion, IPosition, DefinitionQueryResult, Uri, GraphQLCache, CompletionItem, CompletionItemBase, TypeInfo, State, } from 'graphql-language-service-types'; import type { ValidationRule, GraphQLSchema } from 'graphql'; import type { Hover } from 'vscode-languageserver-types'; import { GraphQLDirective } from "graphql"; import type { FragmentDefinitionNode } from "graphql"; declare export function getOutline(queryText: string): ?Outline; declare export function getDiagnostics( query: string, schema: ?GraphQLSchema, customRules?: Array, isRelayCompatMode?: boolean, externalFragments?: Array | string ): Array; declare export function getAutocompleteSuggestions( schema: GraphQLSchema, queryText: string, cursor: IPosition, contextToken?: ContextToken, externalFragments?: Array ): Array; declare export class GraphQLLanguageService { constructor(cache: GraphQLCache): GraphQLLanguageService; getDefinition( query: string, position: IPosition, filePath: Uri, ): Promise; getDiagnostics( query: string, uri: Uri, isRelayCompatMode?: boolean, ): Promise>; getHoverInformation( query: string, position: IPosition, filePath: Uri, ): Promise; getAutocompleteSuggestions( query: string, position: IPosition, filePath: Uri, ): Promise>; } declare export function canUseDirective( state: $PropertyType, directive: GraphQLDirective ): boolean; declare export function getDefinitionState( tokenState: State ): State | null | void; declare export function getFragmentDefinitions( queryText: string ): Array; declare export function getTypeInfo( schema: GraphQLSchema, tokenState: State ): TypeInfo; declare export function hintList( token: ContextTokenUnion, list: Array ): Array; declare export function objectValues(object: { [key: string]: any, }): Array;