import type { AbsolutePath } from '@-xun/fs'; import type { ProjectMetadata } from '@-xun/project-types'; import type { Merge, PackageJson } from 'type-fest'; /** * @see {@link analyzeProjectStructure} */ export type AnalyzeProjectStructureOptions = { /** * The current working directory as an absolute path. * * @default process.cwd() */ cwd?: AbsolutePath; /** * Allow unnamed packages in this project, which will result in looser and * less useful types in the returned {@link ProjectMetadata} object. Setting * this to `true` is only useful when analyzing projects that do not adhere to * standard symbiote (or npm/node) best practices. * * When this option is `false`, unnamed sub-root packages will be considered * "broken," and an unnamed `rootPackage`/`cwdPackage` will throw an error; * broken packages will be available under * `ProjectMetadata.subRootPackages.broken`. * * When `true`, unnamed packages will be available under * `ProjectMetadata.subRootPackages.unnamed` and `rootPackage`/`cwdPackage` * can be unnamed. * * Unnamed packages are _never_ included in the * {@link ProjectMetadata.subRootPackages} map itself regardless of this * option. * * @default false */ allowUnnamedPackages?: boolean; /** * Use the internal cached result from a previous run, if available. * * **WARNING: the results returned by this function, while functionally * identical to each other, will _NOT_ strictly equal (`===`) each other.** * However, each {@link Package} instance within the returned results _will_ * strictly equal each other, respectively. * * @see {@link cache} */ useCached: boolean; }; /** * Asynchronously returns information about the structure of the project at the * current working directory. * * This function will throw upon encountering an unnamed repository. * * **NOTE: the result of this function is memoized! This does NOT _necessarily_ * mean results will strictly equal each other. See `useCached` in this specific * function's options for details.** To fetch fresh results, set the `useCached` * option to `false` or clear the internal cache with {@link cache.clear}. */ export declare function analyzeProjectStructure(options: Merge): Promise; /** * Asynchronously returns information about the structure of the project at the * current working directory. * * This function will NOT throw upon encountering an unnamed repository. * * **NOTE: the result of this function is memoized! This does NOT _necessarily_ * mean results will strictly equal each other. See `useCached` in this specific * function's options for details.** To fetch fresh results, set the `useCached` * option to `false` or clear the internal cache with {@link cache.clear}. */ export declare function analyzeProjectStructure(options: Merge): Promise>; export declare namespace analyzeProjectStructure { /** * Synchronously returns information about the structure of the project at the * current working directory. * * Depending on which overload of this function is used, an error may be * thrown upon encountering an unnamed repository. * * **NOTE: the result of this function is memoized! This does NOT * _necessarily_ mean results will strictly equal each other. See `useCached` * in this specific function's options for details.** To fetch fresh results, * set the `useCached` option to `false` or clear the internal cache with * {@link cache.clear}. */ const sync: typeof syncAnalyzeProjectStructure; } declare function syncAnalyzeProjectStructure(options: Merge): ProjectMetadata; declare function syncAnalyzeProjectStructure(options: Merge): ProjectMetadata; export {};