import { type RsbuildConfig } from '@rsbuild/core';
import { type MatchPath } from '../compiled/tsconfig-paths/index.js';
import type { CompilerOptions, ParsedCommandLine } from 'typescript';
import type { DtsEntry, DtsRedirect } from './index.js';
export declare const createRequireFromPackageJson: (cwd: string) => NodeJS.Require;
export declare const loadTypescript: (cwd?: string) => typeof import('typescript');
type ColorFn = (text: string | number) => string;
type ColorMap = Record<'bold' | 'cyan' | 'dim' | 'reset' | 'underline' | 'yellow', ColorFn>;
export declare const color: ColorMap;
export declare const JS_EXTENSIONS_PATTERN: RegExp;
export type CompilerApiTsconfigResultForApi = ParsedCommandLine;
export type GetTsconfigTsconfigResultForExecutable = Pick<CompilerApiTsconfigResultForApi, 'options'>;
export declare function loadTsconfig(tsconfigPath: string, ts?: typeof import('typescript')): CompilerApiTsconfigResultForApi;
export declare function loadTsconfigResultForExecutable(cwd: string, configName: string): {
    path: string;
    config: GetTsconfigTsconfigResultForExecutable;
} | undefined;
export declare function mergeAliasWithTsConfigPaths(paths: Record<string, string[]> | undefined, alias?: Record<string, string>): Record<string, string[]>;
export declare const TEMP_FOLDER = '.rslib';
export declare const TEMP_DTS_DIR: string;
export declare function ensureTempDeclarationDir(cwd: string, name: string): string;
export declare function pathExists(path: string): Promise<boolean>;
export declare function isDirectory(filePath: string): Promise<boolean>;
export declare function emptyDir(dir: string): Promise<void>;
export declare function clearTempDeclarationDir(cwd: string): Promise<void>;
export declare const prettyTime: (seconds: number) => string;
export declare function getTimeCost(start: number): string;
export declare function addBannerAndFooter(dtsFile: string, banner?: string, footer?: string): Promise<void>;
export declare function redirectDtsImports(dtsFile: string, dtsExtension: string, redirect: DtsRedirect, matchPath: MatchPath, outDir: string, rootDir: string): Promise<void>;
export declare function processDtsFiles(bundle: boolean, cwd: string, dir: string, dtsExtension: string, redirect: DtsRedirect, tsconfigPath: string, rootDir: string, paths: Record<string, string[]>, banner?: string, footer?: string): Promise<void>;
export declare function processSourceEntry(bundle: boolean, entryConfig: NonNullable<RsbuildConfig['source']>['entry']): DtsEntry[];
// same as @rslib/core, we should extract into a single published package to share
export declare function calcLongestCommonPath(absPaths: string[]): Promise<string | null>;
export declare const globDtsFiles: (cwd: string, dir: string, patterns: string[]) => Promise<string[]>;
export declare function cleanDtsFiles(cwd: string, dir: string): Promise<void>;
export declare function rewriteDtsExtensions(cwd: string, dir: string, dtsExtension: string, bundle: boolean, hasDeclarationMap?: boolean): Promise<void>;
export declare function cleanTsBuildInfoFile(tsconfigPath: string, compilerOptions: CompilerOptions): Promise<void>;
// the priority of dtsEmitPath is dts.distPath > declarationDir > output.distPath > output.distPath.root
// outDir is not considered since in multiple formats, the dts files may not in the same directory as the js files
export declare function getDtsEmitPath(pathFromPlugin: string | undefined, declarationDir: string | undefined, distPathRoot: string): string;
export declare function warnIfOutside(cwd: string, dir: string | undefined, label: string): void;
/**
 * Rename .d.ts and .d.ts.map files with corresponding extension
 */ export declare function renameDtsFile(fileName: string, dtsExtension: string, bundle: boolean): string;
/**
 * Update source map content for declaration files
 */ export declare function updateDeclarationMapContent(fileName: string, content: string, dtsExtension: string, bundle: boolean, hasDeclarationMap?: boolean): string;
export { };
