import { Types, Profiler } from '@graphql-codegen/plugin-helpers'; import { GraphQLConfig, GraphQLExtensionDeclaration } from 'graphql-config'; import { GraphQLSchema } from 'graphql'; export { ensureGraphQlPackage, runCli } from './cli.js'; type CodegenConfig = Types.Config; type YamlCliFlags = { config: string; watch: boolean | string | string[]; require: string[]; overwrite: boolean; project: string; silent: boolean; errorsOnly: boolean; profile: boolean; check?: boolean; verbose?: boolean; debug?: boolean; ignoreNoDocuments?: boolean; emitLegacyCommonJSImports?: boolean; }; declare function generateSearchPlaces(moduleName: string): string[]; interface LoadCodegenConfigOptions { /** * The path to the config file or directory contains the config file. * @default process.cwd() */ configFilePath?: string; /** * The name of the config file * @default codegen */ moduleName?: string; /** * Additional search paths for the config file you want to check */ searchPlaces?: string[]; /** * @default codegen */ packageProp?: string; /** * Overrides or extends the loaders for specific file extensions */ loaders?: Record Promise | Types.Config>; } interface LoadCodegenConfigResult { filepath: string; config: Types.Config; isEmpty?: boolean; } declare function loadCodegenConfig({ configFilePath, moduleName, searchPlaces: additionalSearchPlaces, packageProp, loaders: customLoaders, }: LoadCodegenConfigOptions): Promise; declare function loadContext(configFilePath?: string): Promise | never; declare function buildOptions(): { c: { alias: string; type: "string"; describe: string; }; w: { alias: string; describe: string; coerce: (watch: any) => string | boolean | any[]; }; r: { alias: string; describe: string; type: "array"; default: any[]; }; o: { alias: string; describe: string; type: "boolean"; }; s: { alias: string; describe: string; type: "boolean"; }; e: { alias: string; describe: string; type: "boolean"; }; profile: { describe: string; type: "boolean"; }; p: { alias: string; describe: string; type: "string"; }; v: { alias: string; describe: string; type: "boolean"; default: boolean; }; d: { alias: string; describe: string; type: "boolean"; default: boolean; }; }; declare function parseArgv(argv?: string[]): YamlCliFlags; declare function createContext(cliFlags?: YamlCliFlags): Promise; declare function updateContextWithCliFlags(context: CodegenContext, cliFlags: YamlCliFlags): void; declare class CodegenContext { private _config; private _graphqlConfig?; private config; private _project?; private _checkMode; private _pluginContext; cwd: string; filepath: string; profiler: Profiler; profilerOutput?: string; checkModeStaleFiles: any[]; constructor({ config, graphqlConfig, filepath, }: { config?: Types.Config; graphqlConfig?: GraphQLConfig; filepath?: string; }); useProject(name?: string): void; getConfig(extraConfig?: T): T & Types.Config; updateConfig(config: Partial): void; enableCheckMode(): void; get checkMode(): boolean; useProfiler(): void; getPluginContext(): { [key: string]: any; }; loadSchema(pointer: Types.Schema): Promise; loadDocuments(pointer: Types.OperationDocument[]): Promise; } declare function ensureContext(input: CodegenContext | Types.Config): CodegenContext; declare function shouldEmitLegacyCommonJSImports(config: Types.Config, outputPath: string): boolean; declare function executeCodegen(input: CodegenContext | Types.Config): Promise; declare function generate(input: CodegenContext | (Types.Config & { cwd?: string; }), saveToFile?: boolean): Promise; declare function init(): Promise; type CompositeError = Error; type ListrError = Error & { errors: CompositeError[]; }; declare function isListrError(err: Error & { name?: unknown; errors?: unknown; }): err is ListrError; declare function cliError(err: any, exitOnError?: boolean): void; declare const CodegenExtension: GraphQLExtensionDeclaration; declare function findAndLoadGraphQLConfig(filepath?: string): Promise; export { CodegenConfig, CodegenContext, CodegenExtension, LoadCodegenConfigOptions, LoadCodegenConfigResult, YamlCliFlags, buildOptions, cliError, createContext, ensureContext, executeCodegen, findAndLoadGraphQLConfig, generate, generateSearchPlaces, init, isListrError, loadCodegenConfig, loadContext, parseArgv, shouldEmitLegacyCommonJSImports, updateContextWithCliFlags };