UNPKG

@appium/support

Version:

Support libs used across Appium packages

46 lines 1.96 kB
import _ from 'lodash'; import { type NormalizedPackageJson } from 'read-pkg'; import * as semver from 'semver'; /** * Path to the default `APPIUM_HOME` dir (`~/.appium`). */ export declare const DEFAULT_APPIUM_HOME: string; /** * Basename of extension manifest file. */ export declare const MANIFEST_BASENAME = "extensions.yaml"; /** * Relative path to extension manifest file from `APPIUM_HOME`. */ export declare const MANIFEST_RELATIVE_PATH: string; /** * Resolves `true` if an `appium` dependency can be found somewhere in the given `cwd`. */ export declare function hasAppiumDependency(cwd: string): Promise<boolean>; /** * Given `cwd`, use `npm` to find the closest package _or workspace root_, and return the path if the root depends upon `appium`. * * Looks at `dependencies` and `devDependencies` for `appium`. */ export declare const findAppiumDependencyPackage: ((cwd?: string, acceptableVersionRange?: string | semver.Range) => Promise<string | undefined>) & _.MemoizedFunction; /** * Read a `package.json` in dir `cwd`. If none found, return `undefined`. */ export declare const readPackageInDir: ((cwd: string) => Promise<NormalizedPackageJson>) & _.MemoizedFunction; /** * Determines location of Appium's "home" dir * * - If `APPIUM_HOME` is set in the environment, use that * - If we find a `package.json` in or above `cwd` and it has an `appium` dependency, use that. * * All returned paths will be absolute. */ export declare const resolveAppiumHome: ((cwd?: string) => Promise<string>) & _.MemoizedFunction; /** * Figure out manifest path based on `appiumHome`. * * The assumption is that, if `appiumHome` has been provided, it was resolved via {@link resolveAppiumHome `resolveAppiumHome()`}! If unsure, * don't pass a parameter and let `resolveAppiumHome()` handle it. */ export declare const resolveManifestPath: ((appiumHome?: string) => Promise<string>) & _.MemoizedFunction; //# sourceMappingURL=env.d.ts.map