1 | import type { Diagnostic as DiagnosticType, CompletionItem as CompletionItemType } from 'vscode-languageserver-types';
|
2 | import type { ASTNode, GraphQLSchema } from 'graphql';
|
3 | import type { DocumentNode, FragmentDefinitionNode, NamedTypeNode, TypeDefinitionNode, NameNode } from 'graphql/language';
|
4 | import type { GraphQLArgument, GraphQLEnumValue, GraphQLField, GraphQLInputFieldMap, GraphQLInterfaceType, GraphQLObjectType, GraphQLType } from 'graphql/type/definition';
|
5 | import type { GraphQLDirective } from 'graphql/type/directives';
|
6 | export declare type Maybe<T> = T | null | undefined;
|
7 | import type { GraphQLConfig, GraphQLProjectConfig, GraphQLExtensionDeclaration } from 'graphql-config';
|
8 | export type { GraphQLConfig, GraphQLProjectConfig, GraphQLExtensionDeclaration, };
|
9 | export interface GraphQLCache {
|
10 | getGraphQLConfig: () => GraphQLConfig;
|
11 | getProjectForFile: (uri: string) => GraphQLProjectConfig;
|
12 | getObjectTypeDependencies: (query: string, fragmentDefinitions: Map<string, ObjectTypeInfo>) => Promise<ObjectTypeInfo[]>;
|
13 | getObjectTypeDependenciesForAST: (parsedQuery: ASTNode, fragmentDefinitions: Map<string, ObjectTypeInfo>) => Promise<ObjectTypeInfo[]>;
|
14 | getObjectTypeDefinitions: (graphQLConfig: GraphQLProjectConfig) => Promise<Map<string, ObjectTypeInfo>>;
|
15 | updateObjectTypeDefinition: (rootDir: Uri, filePath: Uri, contents: CachedContent[]) => Promise<void>;
|
16 | updateObjectTypeDefinitionCache: (rootDir: Uri, filePath: Uri, exists: boolean) => Promise<void>;
|
17 | getFragmentDependencies: (query: string, fragmentDefinitions: Maybe<Map<string, FragmentInfo>>) => Promise<FragmentInfo[]>;
|
18 | getFragmentDependenciesForAST: (parsedQuery: ASTNode, fragmentDefinitions: Map<string, FragmentInfo>) => Promise<FragmentInfo[]>;
|
19 | getFragmentDefinitions: (graphQLConfig: GraphQLProjectConfig) => Promise<Map<string, FragmentInfo>>;
|
20 | updateFragmentDefinition: (rootDir: Uri, filePath: Uri, contents: CachedContent[]) => Promise<void>;
|
21 | updateFragmentDefinitionCache: (rootDir: Uri, filePath: Uri, exists: boolean) => Promise<void>;
|
22 | getSchema: (appName?: string, queryHasExtensions?: boolean) => Promise<GraphQLSchema | null>;
|
23 | }
|
24 | export interface IPosition {
|
25 | line: number;
|
26 | character: number;
|
27 | setLine(line: number): void;
|
28 | setCharacter(character: number): void;
|
29 | lessThanOrEqualTo(position: IPosition): boolean;
|
30 | }
|
31 | export interface IRange {
|
32 | start: IPosition;
|
33 | end: IPosition;
|
34 | setEnd(line: number, character: number): void;
|
35 | setStart(line: number, character: number): void;
|
36 | containsPosition(position: IPosition): boolean;
|
37 | }
|
38 | export declare type CachedContent = {
|
39 | query: string;
|
40 | range: IRange | null;
|
41 | };
|
42 | export declare type Uri = string;
|
43 | export declare type GraphQLFileMetadata = {
|
44 | filePath: Uri;
|
45 | size: number;
|
46 | mtime: number;
|
47 | };
|
48 | export declare type GraphQLFileInfo = {
|
49 | filePath: Uri;
|
50 | content: string;
|
51 | asts: DocumentNode[];
|
52 | queries: CachedContent[];
|
53 | size: number;
|
54 | mtime: number;
|
55 | };
|
56 | export declare type AllTypeInfo = {
|
57 | type: Maybe<GraphQLType>;
|
58 | parentType: Maybe<GraphQLType>;
|
59 | inputType: Maybe<GraphQLType>;
|
60 | directiveDef: Maybe<GraphQLDirective>;
|
61 | fieldDef: Maybe<GraphQLField<any, any>>;
|
62 | enumValue: Maybe<GraphQLEnumValue>;
|
63 | argDef: Maybe<GraphQLArgument>;
|
64 | argDefs: Maybe<GraphQLArgument[]>;
|
65 | objectFieldDefs: Maybe<GraphQLInputFieldMap>;
|
66 | interfaceDef: Maybe<GraphQLInterfaceType>;
|
67 | objectTypeDef: Maybe<GraphQLObjectType>;
|
68 | };
|
69 | export declare type FragmentInfo = {
|
70 | filePath?: Uri;
|
71 | content: string;
|
72 | definition: FragmentDefinitionNode;
|
73 | };
|
74 | export declare type NamedTypeInfo = {
|
75 | filePath?: Uri;
|
76 | content: string;
|
77 | definition: NamedTypeNode;
|
78 | };
|
79 | export declare type ObjectTypeInfo = {
|
80 | filePath?: Uri;
|
81 | content: string;
|
82 | definition: TypeDefinitionNode;
|
83 | };
|
84 | export declare type Diagnostic = DiagnosticType;
|
85 | export declare type CompletionItemBase = {
|
86 | label: string;
|
87 | isDeprecated?: boolean;
|
88 | };
|
89 | export declare type CompletionItem = CompletionItemType & {
|
90 | isDeprecated?: boolean;
|
91 | documentation?: string | null;
|
92 | deprecationReason?: string | null;
|
93 | type?: GraphQLType;
|
94 | };
|
95 | export declare type Definition = {
|
96 | path: Uri;
|
97 | position: IPosition;
|
98 | range?: IRange;
|
99 | id?: string;
|
100 | name?: string;
|
101 | language?: string;
|
102 | projectRoot?: Uri;
|
103 | };
|
104 | export declare type TokenKind = 'keyword' | 'class-name' | 'constructor' | 'method' | 'param' | 'string' | 'whitespace' | 'plain' | 'type';
|
105 | export declare type TextToken = {
|
106 | kind: TokenKind;
|
107 | value: string | NameNode;
|
108 | };
|
109 | export declare type TokenizedText = TextToken[];
|
110 | export declare type OutlineTree = {
|
111 | plainText?: string;
|
112 | tokenizedText?: TokenizedText;
|
113 | representativeName?: string;
|
114 | kind: string;
|
115 | startPosition: IPosition;
|
116 | endPosition?: IPosition;
|
117 | children: OutlineTree[];
|
118 | };
|
119 | export declare type Outline = {
|
120 | outlineTrees: OutlineTree[];
|
121 | };
|
122 | export interface FileEvent {
|
123 | uri: string;
|
124 | type: FileChangeType;
|
125 | }
|
126 | export declare const FileChangeTypeKind: {
|
127 | Created: number;
|
128 | Changed: number;
|
129 | Deleted: number;
|
130 | };
|
131 | export declare type FileChangeTypeKind = {
|
132 | Created: 1;
|
133 | Changed: 2;
|
134 | Deleted: 3;
|
135 | };
|
136 | export declare type FileChangeTypeKeys = keyof FileChangeTypeKind;
|
137 | export declare type FileChangeType = FileChangeTypeKind[FileChangeTypeKeys];
|
138 |
|
\ | No newline at end of file |