import { Logger } from "@logtape/logtape";

//#region src/glob.d.ts
type GlobPatterns = {
  include: string | string[];
  exclude?: string | string[];
};
/**
 * Finds files matching the given patterns.
 * @param cwd - Current working directory.
 * @param patterns - File patterns to match.
 * @returns Array of absolute file paths.
 */
declare const findFiles: (cwd: string, patterns: GlobPatterns) => Promise<string[]>;
/**
 * Creates a matcher function.
 * @internal
 * @param patterns - File patterns to match.
 * @returns A function that checks if a file path matches the patterns.
 */
declare const createMatcher: (patterns: GlobPatterns) => ((filePath: string) => boolean);
//#endregion
//#region src/generator.d.ts
type GenerateConfig = {
  scalars?: Record<string, string>;
};
//#endregion
//#region src/context.d.ts
/**
 * Stateful context for incremental code generation.
 * Reads and caches file contents when files are added/updated.
 */
declare class CodegenContext {
  private schemas;
  private documents;
  private cwd;
  private config?;
  constructor(cwd?: string);
  setConfig(config: GenerateConfig): void;
  /**
   * Adds a schema file by reading it.
   * @param filePath - Schema file path.
   */
  addSchema(filePath: string): Promise<void>;
  /**
   * Removes a schema file.
   * @param filePath - Schema file path.
   */
  removeSchema(filePath: string): void;
  /**
   * Adds a document file by reading and extracting operations.
   * @param filePath - Document file path.
   */
  addDocument(filePath: string): Promise<void>;
  /**
   * Removes a document file.
   * @param filePath - Document file path.
   */
  removeDocument(filePath: string): void;
  /**
   * Generates code from cached schemas and documents and writes to files.
   * @returns Written file paths.
   * @throws {Error} If generation or writing fails.
   */
  generate(): Promise<void>;
}
//#endregion
//#region src/logger.d.ts
declare const logger: Logger;
/**
 * Reports an error using the provided logger.
 * @param logger - The logger to use.
 * @param error - The error to report.
 */
declare const report: (logger: Logger, error: unknown) => void;
//#endregion
export { CodegenContext, createMatcher, findFiles, logger, report };