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