/** * True when `packageName` is a *declared* dependency (dependencies / * devDependencies / peer / optional) of the nearest readable `package.json` at * or above `fromDir`. * * Declared, not merely resolvable: under npm/bun's hoisted layouts a package can * sit in `node_modules` purely as a transitive dependency of `@amritk/mjst`, * which makes importing it work locally but break under pnpm/isolated installs * where undeclared packages are not reachable. Generated code has to survive * both, so the question worth asking is whether the *project* asked for the * package, not whether this machine happens to have it. * * Only the nearest package.json is consulted. A workspace root above it may well * declare the package, but a nested package that does not declare it cannot rely * on the hoist — which is exactly the case this is meant to catch. */ export declare const isDependencyDeclared: (fromDir: string, packageName: string) => boolean;