UNPKG

2.17 kBTypeScriptView Raw
1import { TypeNode, VariableNode, NameNode, ValueNode, DirectiveNode } from 'graphql';
2import { NormalizedScalarsMap, ConvertNameFn, ParsedEnumValuesMap, ParsedDirectiveArgumentAndInputFieldMappings } from './types';
3import { BaseVisitorConvertOptions } from './base-visitor';
4export interface InterfaceOrVariable {
5 name?: NameNode;
6 variable?: VariableNode;
7 type: TypeNode;
8 defaultValue?: ValueNode;
9 directives?: ReadonlyArray<DirectiveNode>;
10}
11export declare class OperationVariablesToObject {
12 protected _scalars: NormalizedScalarsMap;
13 protected _convertName: ConvertNameFn<BaseVisitorConvertOptions>;
14 protected _namespacedImportName: string | null;
15 protected _enumNames: string[];
16 protected _enumPrefix: boolean;
17 protected _enumValues: ParsedEnumValuesMap;
18 protected _applyCoercion: Boolean;
19 protected _directiveArgumentAndInputFieldMappings: ParsedDirectiveArgumentAndInputFieldMappings;
20 constructor(_scalars: NormalizedScalarsMap, _convertName: ConvertNameFn<BaseVisitorConvertOptions>, _namespacedImportName?: string | null, _enumNames?: string[], _enumPrefix?: boolean, _enumValues?: ParsedEnumValuesMap, _applyCoercion?: Boolean, _directiveArgumentAndInputFieldMappings?: ParsedDirectiveArgumentAndInputFieldMappings);
21 getName<TDefinitionType extends InterfaceOrVariable>(node: TDefinitionType): string;
22 transform<TDefinitionType extends InterfaceOrVariable>(variablesNode: ReadonlyArray<TDefinitionType>): string;
23 protected getScalar(name: string): string;
24 protected getDirectiveMapping(name: string): string;
25 protected getDirectiveOverrideType(directives: ReadonlyArray<DirectiveNode>): string | null;
26 protected transformVariable<TDefinitionType extends InterfaceOrVariable>(variable: TDefinitionType): string;
27 wrapAstTypeWithModifiers(_baseType: string, _typeNode: TypeNode, _applyCoercion?: Boolean): string;
28 protected formatFieldString(fieldName: string, isNonNullType: boolean, _hasDefaultValue: boolean): string;
29 protected formatTypeString(fieldType: string, isNonNullType: boolean, hasDefaultValue: boolean): string;
30 protected getPunctuation(): string;
31}