export type NvimVersion = { /** Command that runs Nvim, e.g. `['wsl.exe', '-d', 'Ubuntu', 'nvim']`. Append args to it. */ readonly cmd: string[]; /** @deprecated Use `cmd`. Same as `cmd[0]`. */ readonly path: string; /** Nvim version, or undefined if there was an error. */ readonly nvimVersion?: string; /** Nvim build type, or undefined if there was an error. */ readonly buildType?: string; /** Nvim LuaJIT version, or undefined if there was an error. */ readonly luaJitVersion?: string; /** Error caught while attempting to access or run Nvim at the given path. */ readonly error?: Readonly; }; export type FindNvimOptions = { /** * (Optional) Minimum `nvim` version (inclusive) to search for. * * - Example: `'0.5.0'` */ readonly minVersion?: string; /** * (Optional) Sort order of list of `nvim` versions. * * - "desc" - (Default) Sort by version in descending order (highest to lowest). * - Example: `['0.5.0', '0.4.4', '0.4.3']` * - "none" - Order is that of the searched `$PATH` components. * - Example: `['0.4.4', '0.5.0', '0.4.3']` */ readonly orderBy?: 'desc' | 'none'; /** * (Optional) Stop searching after found a valid match */ readonly firstMatch?: boolean; /** * (Optional) Other commands that (potentially) invoke Nvim. Not allowed with `dirs`; skips * searching the default locations. Useful for checking a user-configured Nvim location or * arbitrary wrappers such as Windows WSL. * * Example: * ``` * cmds: [ * ['/opt/homebrew/bin/nvim'], * ['C:/Windows/system32/wsl.exe', '-d', 'Ubuntu', 'nvim'], * ], * ``` */ readonly cmds?: string[][]; /** @deprecated */ readonly paths?: string[]; /** * (Optional) Additional directories to search for Nvim executables, before `$PATH` and other * default locations. Not allowed with `cmds`. * * Example: ['/opt/neovim/bin', '/home/user/custom/bin'] */ readonly dirs?: string[]; }; export type FindNvimResult = { /** * List of satisfying `nvim` versions found (if any) on the current system, sorted in the order * specified by `orderBy`. */ readonly matches: ReadonlyArray; /** * List of invalid or failed `nvim` versions found (if any), in order of searched `$PATH` components. */ readonly invalid: ReadonlyArray; }; /** * Tries to find a usable `nvim` binary on the current system. Searches common locations by default. * * @param opt.minVersion See {@link FindNvimOptions.minVersion} * @param opt.orderBy See {@link FindNvimOptions.orderBy} * @param opt.firstMatch See {@link FindNvimOptions.firstMatch} * @param opt.cmds See {@link FindNvimOptions.cmds} * @param opt.dirs See {@link FindNvimOptions.dirs} * @throws {TypeError} If `cmds` and `dirs` are both given. */ export declare function findNvim(opt?: FindNvimOptions): Readonly; export declare let exportsForTesting: any;