import type { CaptureHeaderDecl, DomSelectorDecl, DomListSelectorDecl, GraphqlOpDeclaration } from '@fetchproxy/protocol'; export type Bucket = 'cookies' | 'localStorage' | 'sessionStorage' | 'indexedDb'; export type Command = { kind: 'help'; } | { kind: 'version'; } | { kind: 'profile-list'; } | { kind: 'profile-show'; name: string; } | { kind: 'profile-remove'; name: string; } | { kind: 'profile-add'; name: string; domains: string[]; } | { kind: 'profile-declare'; name: string; cookies: string[]; localStorage: string[]; sessionStorage: string[]; captureHeaders: CaptureHeaderDecl[]; domSelectors: DomSelectorDecl[]; domListSelectors: DomListSelectorDecl[]; download: boolean; cookieWrite: boolean; inPage: boolean; captureRedirect: boolean; graphqlOps: GraphqlOpDeclaration[]; } | { kind: 'pair'; profile: string; domain?: string; subdomain?: string; } | { kind: 'health'; profile: string; } | { kind: 'trust'; action: 'list'; json: boolean; } | { kind: 'trust'; action: 'clear'; serverName?: string; all?: boolean; } | { kind: 'fetch'; profile: string; method: string; url: string; headers: Record; body?: string; json: boolean; viaTab?: string; inPage: boolean; noCredentials: boolean; } | { kind: 'read'; profile: string; bucket: Bucket; keys: string[]; storageDomain?: string; storageSubdomain?: string; } | { kind: 'session'; profile: string; storageDomain?: string; storageSubdomain?: string; } | { kind: 'dom'; profile: string; names: string[]; storageDomain?: string; storageSubdomain?: string; } | { kind: 'dom-list'; profile: string; name: string; storageDomain?: string; storageSubdomain?: string; } | { kind: 'download'; profile: string; url: string; filename?: string; } | { kind: 'capture'; profile: string; names: string[]; timeoutMs?: number; } | { kind: 'write-cookies'; profile: string; cookies: Record; storageDomain?: string; storageSubdomain?: string; } | { kind: 'capture-redirect'; profile: string; host: string; path?: string; timeoutMs?: number; } | { kind: 'graphql'; profile: string; name: string; variables: Record; viaTab?: string; }; /** * The whole of stdin, read synchronously because this parser is synchronous * and the set is wanted before anything dials the bridge. * * A terminal is refused rather than read: nothing closes it, so the loop * above would spin forever with nothing on screen to say why. A redirect or a * pipe is not a terminal, so the forms this flag exists for are untouched. * * A read that genuinely fails — EBADF, EIO — becomes a `UsageError`, the same * shape `parseCookiePair` gives an unreadable `@file`: left raw it reaches * `runCli`'s catch-all and exits 2, "bridge unavailable", which points at the * browser for a problem that is entirely on this side of it. * * `fd` is a parameter only so a test can point the reader at a descriptor it * controls; production reads 0. */ export declare function readStdinSync(fd?: number): string; export declare function parseCliArgs(argv: string[], readFile?: (p: string) => string, readStdin?: () => string): Command;