import { IfAny } from './type-helpers'; /** * Find and parse nearest package.json */ export declare function getPackageDetail(baseDir: string): { packagePath: string | undefined; packageData: any | undefined; }; /** * Require a package if it exists (This function is synchronous and uses require) * @param importFn - Function wrapped import promise which allows us to infer module type (see example) * * @example * // This will have the type of the 'typescript' module * // @ts-ignore - disable missing module warning * const foundModule = requireIfExists('typescript', () => import('typescript')); * * // This will have type: never * // @ts-ignore - disable missing module warning * const missingModule = requireIfExists('missing-module', () => import('missing-module')); */ export declare function requireIfExists Promise>(moduleName: string, importFn: T): ReturnType extends PromiseLike ? IfAny> : never;