import { Rule, AST, Linter } from 'eslint'; import * as ESTree from 'estree'; import { GraphQLSchema, ASTKindToNode } from 'graphql'; import { IGraphQLConfig } from 'graphql-config'; import { JSONSchema } from 'json-schema-to-ts'; import { GraphQLESTreeNode } from './estree-converter/types.js'; import { SiblingOperations } from './siblings.js'; import '@graphql-tools/utils'; type Schema = GraphQLSchema | null; type Pointer = string | string[]; type ParserConfigGraphQLConfig = { graphQLConfig?: IGraphQLConfig; filePath: string; }; type ParserConfigProgrammatic = { schemaSdl: string; filePath: string; }; type ParserOptions = ParserConfigGraphQLConfig | ParserConfigProgrammatic; type ParserServices = { schema: Schema; siblingOperations: SiblingOperations; }; type GraphQLESLintParseResult = Linter.ESLintParseResult & { services: ParserServices; }; type Location = AST.SourceLocation | ESTree.Position; type ReportDescriptorLocation = { loc: Location; } | { node: { loc: Location; }; }; type ReportDescriptor = ReportDescriptorLocation & Rule.ReportDescriptorMessage & Rule.ReportDescriptorOptions; type GraphQLESLintRuleContext = Omit & { options: Options; parserServices: ParserServices; report(descriptor: ReportDescriptor): void; }; type CategoryType = 'Operations' | 'Schema'; type RuleMetaDataDocs = Required['docs']; type RuleDocsInfo = Omit & { category: CategoryType | CategoryType[]; requiresSchema?: true; requiresSiblings?: true; examples?: { title: string; code: string; usage?: T; }[]; configOptions?: T | { schema?: T; operations?: T; }; graphQLJSRuleName?: string; isDisabledForAllConfig?: true; whenNotToUseIt?: string; }; type GraphQLESLintRuleListener = Record & { [K in keyof ASTKindToNode]?: (node: GraphQLESTreeNode) => void; }; type GraphQLESLintRule = { meta: Omit & { docs?: RuleDocsInfo; schema: Readonly | []; }; create(context: GraphQLESLintRuleContext): GraphQLESLintRuleListener; }; type ValueOf = T[keyof T]; type Id = { [P in keyof T]: T[P]; } & {}; type OmitDistributive = T extends object ? Id> : T; type OmitRecursively = Omit<{ [P in keyof T]: OmitDistributive; }, K>; type ConfigName = 'operations-all' | 'operations-recommended' | 'schema-all' | 'schema-recommended' | 'schema-relay'; export { type CategoryType, type ConfigName, type GraphQLESLintParseResult, type GraphQLESLintRule, type GraphQLESLintRuleContext, type GraphQLESLintRuleListener, GraphQLESTreeNode, type OmitRecursively, type ParserConfigGraphQLConfig, type ParserConfigProgrammatic, type ParserOptions, type ParserServices, type Pointer, type ReportDescriptor, type RuleDocsInfo, type Schema, type ValueOf };