import { GraphQLSchema, DocumentNode } from 'graphql'; import { DocumentFile } from './types'; export declare namespace Types { type InstanceOrArray = T | T[]; type SchemaWithLoader = { [schemaString: string]: { loader: string; }; }; type UrlSchema = string | { [url: string]: { headers?: { [headerName: string]: string; }; }; }; type LocalSchemaPath = string; type SchemaGlobPath = string; type Schema = UrlSchema | LocalSchemaPath | SchemaGlobPath | SchemaWithLoader; type OperationDocumentGlobPath = string; type CustomDocumentLoader = { [path: string]: { loader: string; }; }; type OperationDocument = OperationDocumentGlobPath | CustomDocumentLoader; type PluginConfig = InstanceOrArray | { [key: string]: any; }; type ConfiguredPlugin = { [name: string]: PluginConfig; }; type NamedPlugin = string; type OutputConfig = InstanceOrArray; type ConfiguredOutput = { documents?: InstanceOrArray; schema?: InstanceOrArray; plugins: OutputConfig; config?: { [key: string]: any; }; }; type RequireExtension = InstanceOrArray; type PluginLoaderFn = (pluginName: string) => CodegenPlugin | Promise; interface Config { schema?: InstanceOrArray; require?: RequireExtension; documents?: InstanceOrArray; config?: { [key: string]: any; }; generates: { [filename: string]: OutputConfig | ConfiguredOutput; }; overwrite?: boolean; watch?: boolean; silent?: boolean; pluginLoader?: PluginLoaderFn; } } export declare type PluginFunction = (schema: GraphQLSchema, documents: DocumentFile[], config: T) => Promise | string; export declare type PluginValidateFn = (schema: GraphQLSchema, documents: DocumentFile[], config: T, outputFile: string, allPlugins: Types.ConfiguredPlugin[]) => Promise | void; export interface CodegenPlugin { plugin: PluginFunction; addToSchema?: string | DocumentNode; validate?: PluginValidateFn; }