import chex from '@darkobits/chex'; import { type NormalizedPackageJson, type Options } from 'read-pkg-up'; import { ThenArg } from "../etc/types"; /** * If the provided value is an array, it is returned as-is. Otherwise, the value * is wrapped in an array and returned. */ export declare function ensureArray(value: any): Array; /** * Provided a string (or an array of strings), returns a string of label * arguments suitable for passing to `docker build`. */ export declare function parseLabels(labels: any): string; /** * Object returned by `pkgInfo`. */ export interface PkgInfoResult { /** * Object containing the parsed/normalized contents of the package's * package.json. */ json: NormalizedPackageJson; /** * Root directory of the package. * * Note: This is _not_ the path to its package.json. */ root: string; } /** * Wraps `readPackageUp` and automatically throws if a package.json file could * not be found. */ export declare function pkgInfo(cwd: Options['cwd']): Promise; /** * Provided a normalized package.json object, returns its first "bin" entry or, * if the package does not declare a "bin", its "main" entry. */ export declare function computePackageEntry(pkg: NormalizedPackageJson): string; /** * Provided a base image name and a package.json object, computes a final image * name to use and then validates it. */ export declare function computeTag(tagFromOptions: string | undefined, packageJson: NormalizedPackageJson): string; export interface RenderTemplateOptions { template: string; dest: string; data: any; } /** * Provided a path to an EJS template and a data object, returns a string * representing the rendered template. */ export declare function renderTemplate({ template, dest, data }: RenderTemplateOptions): Promise; /** * Provided a package's root directory and a target directory, gets a pack list * and copies all files therein to the provided destination directory. */ export declare function copyPackFiles(pkgRoot: string, destDir: string): Promise; /** * Provided a package's root directory and a target directory, determines if the * package has a 'package-lock.json' and, if so, copies it to the target * directory. * * Returns true if the a lockfile was copied and false otherwise. */ export declare function copyPackageLockfile(pkgRoot: string, destDir: string): Promise; /** * Provided an `npmrc` option from the Dockerize function, finds the appropriate * .npmrc file and copies it to the indicated destination directory. */ export declare function copyNpmrc(npmrcOption: string | undefined, destDir: string): Promise; /** * Provided a Docker image name, returns its size. */ export declare function getImageSize(docker: ThenArg>, imageName: string): Promise; /** * Returns the current LTS version of NodeJS. */ export declare function getNodeLtsVersion(): Promise;