///
import { EventEmitter } from 'events';
import { GraphQLConfig } from 'graphql-config';
import { Fragment, Operation } from 'graphql-tool-utilities';
import { PrintDocumentOptions, PrintSchemaOptions } from './print';
import { EnumFormat, ExportFormat } from './types';
export { EnumFormat, ExportFormat };
export interface Options extends PrintDocumentOptions, PrintSchemaOptions {
addTypename: boolean;
schemaTypesPath: string;
config?: GraphQLConfig;
}
export interface BuilderOptions extends Options {
cwd?: string;
}
export interface RunOptions {
watch?: boolean;
}
export interface SchemaBuild {
schemaPath: string;
schemaTypesPath: string;
}
export interface DocumentBuild {
documentPath: string;
definitionPath: string;
operation?: Operation;
fragments: Fragment[];
}
export declare class Builder extends EventEmitter {
private readonly options;
private readonly config;
private readonly documentMapByProject;
private readonly watchers;
constructor({ cwd, ...options }: BuilderOptions);
once(event: 'error', handler: (error: Error) => void): this;
once(event: 'build:docs', handler: (built: DocumentBuild) => void): this;
once(event: 'build:schema', handler: (built: SchemaBuild) => void): this;
once(event: 'start:docs' | 'end:docs' | 'start:schema' | 'end:schema', handler: () => void): this;
on(event: 'error', handler: (error: Error) => void): this;
on(event: 'build:docs', handler: (built: DocumentBuild) => void): this;
on(event: 'build:schema', handler: (built: SchemaBuild) => void): this;
on(event: 'start:docs' | 'end:docs' | 'start:schema' | 'end:schema', handler: () => void): this;
emit(event: 'error', error: Error): boolean;
emit(event: 'build:docs', built: DocumentBuild): boolean;
emit(event: 'build:schema', built: SchemaBuild): boolean;
emit(event: 'start:docs' | 'end:docs' | 'start:schema' | 'end:schema'): boolean;
run({ watch: watchGlobs }?: {
watch?: boolean | undefined;
}): Promise;
stop(): void;
private setupDocumentWatchers;
private setupSchemaWatcher;
private generateSchemaTypes;
private generateDocumentTypes;
private checkForDuplicateOperations;
private checkForDuplicateFragments;
private generateDocumentTypesForProject;
private writeDocumentFile;
private getDocumentDefinition;
private updateDocumentsForProject;
private updateDocumentForFile;
private setDocumentForFilePath;
}