import { Command } from 'commander'; /** * `get`'s one input rule: **if `--fields` is present, every positional is a * path.** Otherwise the first positional is the field list, exactly as before. * * The missing-field-list case is handled *here* rather than left to `runGet`. * `options.fields ?? fieldsArg` is `undefined` when neither was given, and * `String(undefined).split(",")` is `["undefined"]` — a field list of length * one, so `runGet`'s `fields.length === 0` guard never fires and a bare * `docmeta get` in a repo with config `paths:` prints `undefined=(unset)` per * file and exits 0. A successful-looking report for a field nobody named is * worse than the error it replaced. * * The positional is folded in on `fieldsArg !== undefined`, not with * `.filter(Boolean)`: an empty-string path is a mistake worth reporting, and * filtering it would silently drop it instead. */ declare function resolveGetInputs(fieldsArg: string | undefined, pathsArg: string[], fieldsOption: unknown, cwd: string): { fields: string[]; paths: string[]; }; /** * `query`'s input rule is `get`'s with SQL in the fields slot: **if `--query` * is present, every positional is a path**; otherwise the first positional is * the SQL. The same three guards apply and for the same reasons — a token * shaped like a path in the SQL slot is a forgotten statement, `-` is stdin * and never SQL, and an absent statement is an error rather than a * plausible-looking run. Real SQL never trips `looksLikePath`: a statement * with a column list contains a comma, and anything else with a space cannot * name a file that exists. * * `--db` relaxes exactly one of those guards: exporting needs no SQL, so with * `sqlOptional` a path-shaped first positional is a path and an absent * statement means "just write the database". */ declare function resolveQueryInputs(sqlArg: string | undefined, pathsArg: string[], queryOption: unknown, cwd: string, sqlOptional?: boolean): { sql: string; paths: string[]; }; /** * `--param` values into `QueryOptions.params` (proposal 0029). * * `name=value` binds the value as a **string** — metadata is mostly strings, * and a projection column has no type affinity, so a bound number would * silently never equal a stored string. `name:=value` parses the value as * JSON for the deliberate typed bind (numbers, booleans, arrays, null) — the * httpie/jq convention. `:=` is checked before `=`, the split happens at the * first separator, and everything after it is the value verbatim, so values * containing `=` need no escaping. */ declare function parseQueryParams(raw: readonly string[]): Record; declare function buildProgram(): Command; declare function main(argv?: string[]): Promise; export { buildProgram, main, parseQueryParams, resolveGetInputs, resolveQueryInputs };