import { GraphQLSchema, DocumentNode } from 'graphql'; import { DocumentFile } from './types'; export declare namespace Types { type InstanceOrArray = T | T[]; type UrlSchema = string | { [url: string]: { headers?: { [headerName: string]: string; }; }; }; type LocalSchemaPath = string; type SchemaGlobPath = string; type Schema = UrlSchema | LocalSchemaPath | SchemaGlobPath; type OperationDocumentGlobPath = string; type OperationDocument = OperationDocumentGlobPath; 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; interface Config { schema: InstanceOrArray; require?: RequireExtension; mergeSchemaFiles?: string; documents?: InstanceOrArray; config?: { [key: string]: any; }; generates: { [filename: string]: OutputConfig | ConfiguredOutput; }; overwrite?: boolean; watch?: boolean; silent?: boolean; } } 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; }