UNPKG

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