import type { GenericPackage } from '@-xun/project-types'; import type { ParametersNoFirst, SyncVersionOf } from "../../../common/src/types.js"; import type { PackageBuildTargets } from "../common.js"; /** * Prefixed to specifiers used in non-source files. */ export declare const prefixAssetImport = "<\u2757ASSET>"; /** * Prefixed to specifiers used in internal files. */ export declare const prefixInternalImport = ""; /** * Prefixed to specifiers used in external files. */ export declare const prefixExternalImport = ""; /** * Prefixed to specifiers used in at least one normally imported file. */ export declare const prefixNormalImport = ""; /** * Prefixed to specifiers used in at least one type-only imported file. */ export declare const prefixTypeOnlyImport = ""; /** * A prefix potentially added to specifier metadata in * {@link PackageBuildTargets}. */ export type MetadataImportsPrefix = typeof prefixAssetImport | typeof prefixInternalImport | typeof prefixExternalImport | typeof prefixNormalImport | typeof prefixTypeOnlyImport; /** * @see {@link gatherPackageBuildTargets} */ export type GatherPackageBuildTargetsOptions = { /** * Use the internal cached result from a previous run, if available. * * Unless `useCached` is `false`, the results returned by this function will * always strictly equal (`===`) each other with respect to call signature. * * @see {@link cache} */ useCached: boolean; /** * If `true`, multiversal import support will be enabled. */ allowMultiversalImports: boolean; /** * If `true`, files under `./test` will be treated the same as files under * `./src`. Testversal imports will also be allowed. * * If `false`, `./test` files files will be ignored and testverse imports are * not allowed. * * Most invocations of this function should set this to `false`. */ includeInternalTestFiles: boolean; /** * Exclude paths from the internals result with respect to the patterns in * `excludeInternalsPatterns`, which are interpreted according to gitignore * rules and _always_ relative to the _project_ (NEVER package or filesystem!) * root. * * @default [] */ excludeInternalsPatterns?: string[]; /** * Include in the externals result all paths matching a pattern in * `includeExternalsPatterns`, which are interpreted as glob strings and * _always_ relative to the _project_ (NEVER package or filesystem!) root. * * @default [] */ includeExternalsPatterns?: string[]; }; declare function gatherPackageBuildTargets_(shouldRunSynchronously: false, package_: GenericPackage, options: GatherPackageBuildTargetsOptions): Promise; declare function gatherPackageBuildTargets_(shouldRunSynchronously: true, package_: GenericPackage, options: GatherPackageBuildTargetsOptions): PackageBuildTargets; /** * Asynchronously construct a {@link PackageBuildTargets} instance derived from * a {@link Package} instance. * * Also performs a lightweight correctness check of all imports as they're * encountered. * * **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 gatherPackageBuildTargets(...args: ParametersNoFirst): Promise; export declare namespace gatherPackageBuildTargets { /** * Synchronously construct a {@link PackageBuildTargets} instance derived from * a {@link Package} instance. * * Also performs a lightweight correctness check of all imports as they're * encountered. * * **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: SyncVersionOf; } /** * Takes a fully-resolved (i.e. _not an alias_) import specifier and returns its * package name. Accounts for imports of namespaced packages like `@babel/core`. * * Useful for translating external NPM package import specifiers into the names * of the individual packages. Examples: * * ``` * specifierToPackageName('next/jest') === 'next' * specifierToPackageName('@babel/core') === '@babel/core' * specifierToPackageName('/something/custom') === '/something/custom' * specifierToPackageName('./something/custom') === './something/custom' * ``` */ export declare function specifierToPackageName(specifier: string): string; export {};