import { z } from 'zod';
export declare function countWords(text: string): number;
export declare function formatBytes(bytes: number): string;
export declare function formatNumber(n: number | null | undefined): string;
export declare function getExtension(filePath: string): string;
export declare function normalizeRelativePath(filePath: string): string;
export declare function buildExcludeDirGlobs(excludeDir: string[]): string[];
/**
 * Canonical directory names that are almost never wanted in scans or code
 * indexes: package installs, VCS internals, build output, and tool caches.
 * Exported so hosts can pass (or extend) one shared list instead of
 * maintaining their own.
 */
export declare const DEFAULT_EXCLUDE_DIRS: readonly string[];
export declare const EXTENSION_TO_TYPE: Record<string, string>;
export declare const OFFICE_EXTENSIONS: string[];
export declare const METRIC_FIELDS: readonly ["words", "pages", "paragraphs", "sheets", "rows", "cells", "slides"];
export declare const MetricFieldSchema: z.ZodEnum<{
    words: "words";
    pages: "pages";
    paragraphs: "paragraphs";
    sheets: "sheets";
    rows: "rows";
    cells: "cells";
    slides: "slides";
}>;
export type MetricField = z.infer<typeof MetricFieldSchema>;
export interface IgnoreMatcherOptions {
    excludeDir?: string[];
    noGitignore?: boolean;
    ignorePatterns?: string[];
    overlayIgnorePatterns?: string[];
}
export interface IgnoreMatcher {
    ignores(relativePath: string): boolean;
}
export declare function createIgnoreMatcher(rootDir: string, options?: IgnoreMatcherOptions): Promise<IgnoreMatcher>;
export declare function abortIfNeeded(signal?: AbortSignal): void;
export interface CooperativeYieldEvent {
    elapsedMs: number;
    sinceYieldMs: number;
}
export interface CooperativeConfig {
    yieldEveryMs?: number;
    onYield?: (event: CooperativeYieldEvent) => void;
}
export type CooperativeOption = boolean | CooperativeConfig;
export interface Yielder {
    tick(): Promise<void>;
}
export declare function isCooperative(option: CooperativeOption | undefined): option is true | CooperativeConfig;
export declare function createYielder(option: CooperativeOption | undefined, signal?: AbortSignal): Yielder;
/**
 * Map `items` through an async `fn` with at most `concurrency` calls in flight.
 *
 * Results are returned in input order (each worker writes into its item's slot).
 * Non-finite `concurrency` (NaN/Infinity) falls back to 1. The signal is checked
 * before each item is dispatched; an abort surfaces as OccAbortError. The first
 * rejection from `fn` propagates and stops further dispatch (in-flight items may
 * still complete) — callers that need per-item error capture should catch inside `fn`.
 */
export declare function mapWithConcurrency<T, R>(items: readonly T[], concurrency: number, fn: (item: T, index: number) => Promise<R>, signal?: AbortSignal): Promise<R[]>;
export declare function sanitizeForkExecArgv(execArgv?: string[]): string[];
export declare function hasKey(field: string): string;
export declare function writeStream(stream: NodeJS.WritableStream, text: string): Promise<void>;
/** Noisy pdf.js output prefixes suppressed while parsing PDFs (font parsing, deprecated API, etc.). */
export declare const PDF_LOG_SUPPRESSED_PREFIXES: readonly string[];
/**
 * Run `fn` while console.log lines starting with any of `prefixes` are dropped.
 * Lines that match no active prefix list pass through unchanged. Safe to overlap
 * and nest across concurrent callers.
 */
export declare function suppressConsoleLogWhile<T>(prefixes: readonly string[], fn: () => Promise<T>): Promise<T>;
/**
 * Rethrow a lazy `import()` failure with the offending package named, so a
 * missing/broken heavy dependency surfaces as an actionable diagnostic instead
 * of a generic per-file parse failure.
 */
export declare function wrapDependencyLoadError(pkg: string, error: unknown): never;
export declare function extractOfficeText(input: string | Buffer): Promise<string>;
