import { Language } from './core/model/ArkFile'; export interface Sdk { name: string; path: string; moduleName: string; } export interface TsConfig { extends?: string; compilerOptions?: { baseUrl?: string; paths?: { [key: string]: string[]; }; }; } /** * Build a SceneConfig from a project directory and optional OHOS SDK home. * * SDK resolution order: * 1) explicit `ohosSdkHome` (must contain at least one valid SDK directory: * `/openharmony/ets` or `/hms/ets`) * 2) environment variable `OHOS_SDK_HOME` * * @param project Project root directory path. * @param ohosSdkHome Optional OHOS SDK home path. * @param options Optional SceneOptions. * @returns SceneConfig initialized with project files and discovered SDKs. */ export declare function buildSceneConfigFromProject(project: string, ohosSdkHome?: string, options?: SceneOptions): SceneConfig; /** * Per-language switch and optional file extension list (for tooling and front-end selection; extension lists are * normalized for discovery and future use). */ export interface LanguageOptions { enabled?: boolean; extensions?: string[]; } export interface CppLanguageOptions extends LanguageOptions { sourceExtensions?: string[]; headerExtensions?: string[]; /** Max concurrent C++ AST worker processes; `-1` means auto (same semantics as `CppFrontend`). */ maxParallelProcesses?: number; /** Max AST results in flight before back-pressure; `-1` or omission uses defaults aligned with `CppFrontend`. */ maxPendingAstResults?: number; /** Log per-TU AST payload stats (bytes, node count, etc.) after successful decode. */ logAstInfo?: boolean; } export interface SceneLanguagesOptions { arkts?: LanguageOptions; cpp?: CppLanguageOptions; [option: string]: LanguageOptions | undefined; } export type SceneOptionsValue = string | number | boolean | (string | number)[] | string[] | SceneLanguagesOptions | null | undefined; export interface SceneOptions { supportFileExts?: string[]; ignoreFileNames?: string[]; /** Whether to save source code text in ArkFile by default during IR construction. */ saveSourceCodeByDefault?: boolean; enableLeadingComments?: boolean; enableTrailingComments?: boolean; enableJSDoc?: boolean; enableBuiltIn?: boolean; enableOhModulesBody?: boolean; enableMethodBodyBuild?: boolean; tsconfig?: string; isScanAbc?: boolean; sdkGlobalFolders?: string[]; /** Optional multi-language front-end section; defaults are merged in {@link SceneConfig} construction. */ languages?: SceneLanguagesOptions; /** Max process memory (RSS) in MB; 0 or undefined disables memory monitoring. * Internally converted to a heapUsed limit via RSS_TO_HEAPUSED_RATIO in MemoryMonitor. */ memoryLimitMB?: number; [option: string]: SceneOptionsValue; } export declare class SceneConfig { private targetProjectName; private targetProjectDirectory; private etsSdkPath; private sdksObj; private sdkFiles; private sdkFilesMap; private projectFiles; private includeDirs; private fileLanguages; private ccjsonPath; private cppAstPath; private options; constructor(options?: SceneOptions); getOptions(): SceneOptions; /** * Set the scene's config, * such as the target project's name, the used sdks and the full path. * @param targetProjectName - the target project's name. * @param targetProjectDirectory - the target project's directory. * @param sdks - sdks used in this scene. * @param fullFilePath - the full file path. */ buildConfig(targetProjectName: string, targetProjectDirectory: string, sdks: Sdk[], fullFilePath?: string[]): void; /** * Create a sceneConfig object for a specified project path and set the target project directory to the * targetProjectDirectory property of the sceneConfig object. * @param targetProjectDirectory - the target project directory, such as xxx/xxx/xxx, started from project * directory. * @param includeDirs - Header file directories that the CXX project depends on. * @example * 1. build a sceneConfig object. ```typescript const projectDir = 'xxx/xxx/xxx'; const sceneConfig: SceneConfig = new SceneConfig(); sceneConfig.buildFromProjectDir(projectDir); ``` */ buildFromProjectDir(targetProjectDirectory: string, includeDirs?: string[]): void; buildFromProjectFiles(projectName: string, projectDir: string, filesAndDirectorys: string[], sdks?: Sdk[], languageTags?: Map): void; private processFilePaths; private setLanguageTagForFiles; buildFromJson(configJsonPath: string): void; getTargetProjectName(): string; getTargetProjectDirectory(): string; getProjectFiles(): string[]; /** Obtain the header file directories of the input C++ project dependencies. */ getIncludeDirs(): string[]; setCcjsonPath(ccjsonPath: string): void; /** * Returns compile_commands.json path configured by the project. * * If ccjson is not configured, this value is empty initially. Before AST generation, * astUtils may auto-discover a compile database near source files (for DevEco projects * that load compilation databases). The discovered path is used directly by Scene and is * not backfilled into this config field. */ getCcjsonPath(): string; setCppAstPath(cppAstPath: string): void; getCppAstPath(): string; getFileLanguages(): Map; getSdkFiles(): string[]; getSdkFilesMap(): Map; getEtsSdkPath(): string; getSdksObj(): Sdk[]; private getDefaultConfigPath; private loadDefaultConfig; private normalizeLanguageOptions; private mergeEnabledLanguageExtensionsIntoSupportFileExts; private uniqueFileExtensions; } //# sourceMappingURL=Config.d.ts.map