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 | mergeFragmentTypes: boolean;
|
20 | }
|
21 | export interface RawDocumentsConfig extends RawTypesConfig {
|
22 | |
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | preResolveTypes?: boolean;
|
35 | |
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | skipTypeNameForRoot?: boolean;
|
47 | |
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | globalNamespace?: boolean;
|
59 | |
60 |
|
61 |
|
62 |
|
63 | operationResultSuffix?: string;
|
64 | |
65 |
|
66 |
|
67 |
|
68 | dedupeOperationSuffix?: boolean;
|
69 | |
70 |
|
71 |
|
72 |
|
73 | omitOperationSuffix?: boolean;
|
74 | |
75 |
|
76 |
|
77 |
|
78 | exportFragmentSpreadSubTypes?: boolean;
|
79 | |
80 |
|
81 |
|
82 |
|
83 | experimentalFragmentVariables?: boolean;
|
84 | |
85 |
|
86 |
|
87 |
|
88 | mergeFragmentTypes?: boolean;
|
89 | |
90 |
|
91 |
|
92 | namespacedImportName?: string;
|
93 | }
|
94 | export declare class BaseDocumentsVisitor<TRawConfig extends RawDocumentsConfig = RawDocumentsConfig, TPluginConfig extends ParsedDocumentsConfig = ParsedDocumentsConfig> extends BaseVisitor<TRawConfig, TPluginConfig> {
|
95 | protected _schema: GraphQLSchema;
|
96 | protected _unnamedCounter: number;
|
97 | protected _variablesTransfomer: OperationVariablesToObject;
|
98 | protected _selectionSetToObject: SelectionSetToObject;
|
99 | protected _globalDeclarations: Set<string>;
|
100 | constructor(rawConfig: TRawConfig, additionalConfig: TPluginConfig, _schema: GraphQLSchema, defaultScalars?: NormalizedScalarsMap);
|
101 | getGlobalDeclarations(noExport?: boolean): string[];
|
102 | setSelectionSetHandler(handler: SelectionSetToObject): void;
|
103 | setDeclarationBlockConfig(config: DeclarationBlockConfig): void;
|
104 | setVariablesTransformer(variablesTransfomer: OperationVariablesToObject): void;
|
105 | get schema(): GraphQLSchema;
|
106 | get addTypename(): boolean;
|
107 | private handleAnonymousOperation;
|
108 | FragmentDefinition(node: FragmentDefinitionNode): string;
|
109 | protected applyVariablesWrapper(variablesBlock: string): string;
|
110 | OperationDefinition(node: OperationDefinitionNode): string;
|
111 | }
|