import { DirectiveNode, FieldNode, FragmentSpreadNode, GraphQLNamedType, GraphQLObjectType, GraphQLSchema, InlineFragmentNode, SelectionNode, SelectionSetNode } from 'graphql'; import { ParsedDocumentsConfig } from './base-documents-visitor.js'; import { BaseVisitorConvertOptions } from './base-visitor.js'; import { BaseSelectionSetProcessor, LinkField, NameAndType, PrimitiveAliasedFields, PrimitiveField } from './selection-set-processor/base.js'; import { ConvertNameFn, FragmentDirectives, GetFragmentSuffixFn, LoadedFragment, NormalizedScalarsMap } from './types.js'; type FragmentSpreadUsage = { fragmentName: string; typeName: string; onType: string; selectionNodes: Array; fragmentDirectives?: DirectiveNode[]; }; type CollectedFragmentNode = (SelectionNode | FragmentSpreadUsage | DirectiveNode) & FragmentDirectives; type GroupedStringifiedTypes = Record>; export declare class SelectionSetToObject { protected _processor: BaseSelectionSetProcessor; protected _scalars: NormalizedScalarsMap; protected _schema: GraphQLSchema; protected _convertName: ConvertNameFn; protected _getFragmentSuffix: GetFragmentSuffixFn; protected _loadedFragments: LoadedFragment[]; protected _config: Config; protected _parentSchemaType?: GraphQLNamedType; protected _selectionSet?: SelectionSetNode; protected _primitiveFields: PrimitiveField[]; protected _primitiveAliasedFields: PrimitiveAliasedFields[]; protected _linksFields: LinkField[]; protected _queriedForTypename: boolean; constructor(_processor: BaseSelectionSetProcessor, _scalars: NormalizedScalarsMap, _schema: GraphQLSchema, _convertName: ConvertNameFn, _getFragmentSuffix: GetFragmentSuffixFn, _loadedFragments: LoadedFragment[], _config: Config, _parentSchemaType?: GraphQLNamedType, _selectionSet?: SelectionSetNode); createNext(parentSchemaType: GraphQLNamedType, selectionSet: SelectionSetNode): SelectionSetToObject; /** * traverse the inline fragment nodes recursively for collecting the selectionSets on each type */ _collectInlineFragments(parentType: GraphQLNamedType, nodes: Array, types: Map>): any; protected _createInlineFragmentForFieldNodes(parentType: GraphQLNamedType, fieldNodes: FieldNode[]): InlineFragmentNode; protected buildFragmentSpreadsUsage(spreads: FragmentSpreadNode[]): Record; protected flattenSelectionSet(selections: ReadonlyArray, parentSchemaType?: GraphQLObjectType): Map>; private _appendToTypeMap; /** * mustAddEmptyObject indicates that not all possible types on a union or interface field are covered. */ protected _buildGroupedSelections(): { grouped: GroupedStringifiedTypes; mustAddEmptyObject: boolean; }; protected selectionSetStringFromFields(fields: (string | NameAndType)[]): string | null; protected buildSelectionSet(parentSchemaType: GraphQLObjectType, selectionNodes: Array, options?: { unsetTypes: boolean; }): { typeInfo: { name: string; type: string; }; fields: string[]; }; protected buildTypeNameField(type: GraphQLObjectType, nonOptionalTypename?: boolean, addTypename?: boolean, queriedForTypename?: boolean, skipTypeNameForRoot?: boolean): { name: string; type: string; }; protected getUnknownType(): string; protected getEmptyObjectType(): string; private getEmptyObjectTypeString; transformSelectionSet(): string; transformFragmentSelectionSetToTypes(fragmentName: string, fragmentSuffix: string, declarationBlockConfig: any): string; protected buildFragmentTypeName(name: string, suffix: string, typeName?: string): string; } export {};