import { ComposeNamedOutputType, ComposeOutputType, ObjectTypeComposer, SchemaComposer } from 'graphql-compose'; import { AstDirNode, AstFileNode, AstRootNode, AstRootTypeNode, RootTypeNames } from './directoryToAst'; import { FieldConfig } from './typeDefs'; interface VisitInfoData { node: TNode; nodeParent: AstDirNode | AstRootTypeNode | AstRootNode; operation: RootTypeNames; fieldName: string; fieldPath: string[]; schemaComposer: SchemaComposer; } export declare class VisitInfo { node: TNode; /** Parent AST node from directoryToAst */ nodeParent: AstDirNode | AstRootTypeNode | AstRootNode; /** Brunch of schema under which is working visitor. Can be: query, mutation, subscription */ operation: RootTypeNames; /** Name of field for current FieldConfig */ fieldName: string; /** List of parent names starting from root */ fieldPath: string[]; /** Type registry */ schemaComposer: SchemaComposer; constructor(data: VisitInfoData); /** * Check that this entrypoint belongs to Query */ isQuery(): boolean; /** * Check that this entrypoint belongs to Mutation */ isMutation(): boolean; /** * Check that this entrypoint belongs to Subscription */ isSubscription(): boolean; /** * Return array of fieldNames. * Dotted names will be automatically splitted. * * @example * Assume: * name: 'ping' * path: ['query.storage', 'viewer', 'utils.debug'] * For empty options will be returned: * ['storage', 'viewer', 'utils', 'debug', 'ping'] * For `{ includeOperation: true }` will be returned: * ['query', 'storage', 'viewer', 'utils', 'debug', 'ping'] */ getFieldPathArray(opts?: { includeOperation?: boolean; omitFieldName?: boolean; }): string[]; /** * Return dotted path for current field */ getFieldPathDotted(opts?: { includeOperation?: boolean; omitFieldName?: boolean; }): string; /** * Return path as CamelCase string. * * Useful for getting type name according to path */ getFieldPathCamelCase(opts?: { includeOperation?: boolean; omitFieldName?: boolean; }): string; /** * Get FieldConfig for file or dir. * This is mutable object and is shared between all calls. */ get fieldConfig(): FieldConfig; /** * Get TypeComposer instance for output type (object, scalar, enum, interface, union). * It's mutable object. */ getOutputAnyTC(): ComposeOutputType; /** * Check that output type is an object */ isOutputTypeIsObject(): boolean; /** * Get TypeComposer instance for output type (object, scalar, enum, interface, union). * It's mutable object. */ getOutputUnwrappedTC(): ComposeNamedOutputType; /** * Get TypeComposer instance for output type (object, scalar, enum, interface, union). * It's mutable object. */ getOutputUnwrappedOTC(): ObjectTypeComposer; toString(): string; toJSON(): string; } export {}; //# sourceMappingURL=VisitInfo.d.ts.map