1 | import { NormalizedScalarsMap } from './types';
|
2 | import { DeclarationBlockConfig } from './utils';
|
3 | import { GraphQLSchema, FragmentDefinitionNode, OperationDefinitionNode } from 'graphql';
|
4 | import { SelectionSetToObject } from './selection-set-to-object';
|
5 | import { OperationVariablesToObject } from './variables-to-object';
|
6 | import { BaseVisitor } from './base-visitor';
|
7 | import { ParsedTypesConfig, RawTypesConfig } from './base-types-visitor';
|
8 | export interface ParsedDocumentsConfig extends ParsedTypesConfig {
|
9 | addTypename: boolean;
|
10 | preResolveTypes: boolean;
|
11 | globalNamespace: boolean;
|
12 | operationResultSuffix: string;
|
13 | dedupeOperationSuffix: boolean;
|
14 | omitOperationSuffix: boolean;
|
15 | namespacedImportName: string | null;
|
16 | exportFragmentSpreadSubTypes: boolean;
|
17 | skipTypeNameForRoot: boolean;
|
18 | experimentalFragmentVariables: boolean;
|
19 | }
|
20 | export interface RawDocumentsConfig extends RawTypesConfig {
|
21 | |
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | preResolveTypes?: boolean;
|
33 | |
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 | skipTypeNameForRoot?: boolean;
|
45 | |
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | globalNamespace?: boolean;
|
57 | |
58 |
|
59 |
|
60 |
|
61 | operationResultSuffix?: string;
|
62 | |
63 |
|
64 |
|
65 |
|
66 | dedupeOperationSuffix?: boolean;
|
67 | |
68 |
|
69 |
|
70 |
|
71 | omitOperationSuffix?: boolean;
|
72 | |
73 |
|
74 |
|
75 |
|
76 | exportFragmentSpreadSubTypes?: boolean;
|
77 | |
78 |
|
79 |
|
80 |
|
81 | experimentalFragmentVariables?: boolean;
|
82 | |
83 |
|
84 |
|
85 | namespacedImportName?: string;
|
86 | }
|
87 | export declare class BaseDocumentsVisitor<TRawConfig extends RawDocumentsConfig = RawDocumentsConfig, TPluginConfig extends ParsedDocumentsConfig = ParsedDocumentsConfig> extends BaseVisitor<TRawConfig, TPluginConfig> {
|
88 | protected _schema: GraphQLSchema;
|
89 | protected _unnamedCounter: number;
|
90 | protected _variablesTransfomer: OperationVariablesToObject;
|
91 | protected _selectionSetToObject: SelectionSetToObject;
|
92 | protected _globalDeclarations: Set<string>;
|
93 | constructor(rawConfig: TRawConfig, additionalConfig: TPluginConfig, _schema: GraphQLSchema, defaultScalars?: NormalizedScalarsMap);
|
94 | getGlobalDeclarations(noExport?: boolean): string[];
|
95 | setSelectionSetHandler(handler: SelectionSetToObject): void;
|
96 | setDeclarationBlockConfig(config: DeclarationBlockConfig): void;
|
97 | setVariablesTransformer(variablesTransfomer: OperationVariablesToObject): void;
|
98 | get schema(): GraphQLSchema;
|
99 | get addTypename(): boolean;
|
100 | private handleAnonymousOperation;
|
101 | FragmentDefinition(node: FragmentDefinitionNode): string;
|
102 | protected applyVariablesWrapper(variablesBlock: string): string;
|
103 | OperationDefinition(node: OperationDefinitionNode): string;
|
104 | }
|