import { ParseArgsConfig } from 'node:util'; type StdinLoopType = 'loop' | 'loopJson' | 'loopLines' | boolean | undefined; type PositionalType = 'positionalAsNamedObject' | 'positionalAsObject'; type FlagOptions = { [longOption: string]: NonNullable[number] & { description?: string; }; }; declare class Options { /** The name of the module. (__Defaults to the name of the file__) */ name: string | string[]; /** A description of what the module does. */ description: string; /** A list of dependencies required by the module. */ dependencies: string | string[]; /** Positional arguments that the module accepts. Can be specified as an array or a space-separated string. */ positionals: string[] | string; /** A mapping of command line flags to their settings. [parseArgs](https://nodejs.org/api/util.html#utilparseargsconfig) */ flags: FlagOptions; /** The function that executes when the command is run. */ default: null | ((...args: any) => any); /** Specifies if the flags should be strictly validated against the provided flags definitions. (Defaults to `true`) */ useStrictFlags: boolean; /** Determines if stdin should be unshifted into args. (__Defaults to `true`__) */ useUnshiftStdin: boolean; /** When iterating stdin loop uses `Promise.allSettled` instead of `Promise.all`. (__Defaults to `false`__) */ useLoopMethod: string | 'allSettled' | 'all' | 'for-await'; /** * The type of output that the module should produce. (__Defaults to `log`__) * - `bool` - Outputs the result as a boolean value, adds `--emoji`, `--int` flags to command. * - `json` - Outputs the result as a JSON string, pretty prints the result. * - `lines` - Expects an array, and will output each item on a line. * - `log` - Prints the value. * - `stdout` - Prints the value. * - `bash` - Expects function to return string, and executes, adds `--print` flag to the command, which prints the string. * - `false` - Disables output. */ output: string | boolean; /** * Describes how positional rules translate to function arguments. (__Defaults to `positionalAsObject`__) * - `positionalNamedObject` - Uses name in positionals as key in args. * - `positionalAsArray` - Uses escalating `_` as the key separating `--` in positionals. */ positionalType: PositionalType | undefined; /** * Determines if the module should read from stdin and how. (__Defaults to `false`__) * - `false` - Disables stdin. * - `true` - Reads from stdin * - `loopJson` - Reads from stdin as a JSON array and loops over each item. * - `loopLines` - Reads from stdin as a string and loops over each line. * - `loop` - Reads stdin and does `loopJson` with backup to `loopLines`. */ stdin: StdinLoopType | boolean; /** * Set the javscript runtime to evaluate subprocesses under, must expect appending js string. * `node` * `--experimental-strip-types` * `--experimental-detect-module` * `--disable-warning=MODULE_TYPELESS_PACKAGE_JSON` * `--disable-warning=ExperimentalWarning` * `-e` */ runtime: undefined | string | string[]; runtimeKey: string | 'node' | 'deno'; /** path to dir or file */ path: undefined | string; /** path to dir or file */ __filename: undefined | string; importMeta: undefined | ImportMeta; /** current working directory */ cwd: string | undefined; /** command arguments */ argv: string[] | undefined; /** runs the command as a subprocess */ subprocess: boolean; } type KneveeOptions = Partial; declare function knevee(opt?: KneveeOptions): { executable: ({ nullifyRuntime }?: { nullifyRuntime?: boolean; }) => Promise<(number | null)[]>; name?: string | string[] | undefined; description?: string | undefined; dependencies?: string | string[] | undefined; positionals?: string | string[] | undefined; flags?: FlagOptions | undefined; default?: ((...args: any) => any) | null | undefined; useStrictFlags?: boolean | undefined; useUnshiftStdin?: boolean | undefined; useLoopMethod?: string | undefined; output?: string | boolean | undefined; positionalType?: PositionalType | undefined; stdin?: StdinLoopType | boolean; runtime?: undefined | string | string[]; runtimeKey?: string | undefined; path?: undefined | string; __filename?: undefined | string; importMeta?: undefined | ImportMeta; cwd?: string | undefined; argv?: string[] | undefined; subprocess?: boolean | undefined; }; export { type KneveeOptions, knevee };