export type QrErrorCorrectionLevel = 'L' | 'M' | 'Q' | 'H'; /** The QR spec's mandatory light border. Shrinking it breaks scanners. */ export declare const QR_QUIET_ZONE_MODULES = 4; /** Assumed terminal width when the caller has none to offer. */ export declare const DEFAULT_TERMINAL_COLUMNS = 80; export interface QrTerminalOptions { /** Requested redundancy. Defaults to `'M'`, the usual QR default. */ errorCorrectionLevel?: QrErrorCorrectionLevel; /** Terminal width to fit into. Defaults to {@link DEFAULT_TERMINAL_COLUMNS}. */ columns?: number; /** * Emit SGR colours so the symbol reads correctly on light *and* dark themes. * With `false` the light modules are drawn as block glyphs, which only scans * on a dark background. Callers should pass `false` when stdout is not a TTY. * Defaults to `true`. */ color?: boolean; /** * Drop to a lower redundancy level when the requested one is too wide. * The quiet zone is never traded away - that would break scanning outright. * Defaults to `true`. */ allowLevelDowngrade?: boolean; } export interface QrTerminalRender { /** Rows of the symbol. Empty when `fits` is false. */ lines: string[]; /** Width of each line in terminal cells, including the quiet zone. */ columns: number; /** Number of terminal rows the symbol occupies. */ rows: number; /** Modules per side, excluding the quiet zone. */ moduleCount: number; /** QR version (1-40) that `qr.js` selected. */ version: number; /** Redundancy actually used, which may be below the requested level. */ errorCorrectionLevel: QrErrorCorrectionLevel; /** True when the requested level had to be lowered to fit. */ downgraded: boolean; /** False when even the smallest allowed symbol is wider than `columns`. */ fits: boolean; } /** * Encodes `text` and lays it out for a terminal of `columns` cells. * * Returns `fits: false` with no lines rather than something that would wrap. */ export declare function renderQrToTerminal(text: string, options?: QrTerminalOptions): QrTerminalRender; /** * Convenience wrapper for printing: the symbol when it fits, `null` when it * does not. A `null` return is the caller's cue to show the URL as text. */ export declare function formatQrForTerminal(text: string, options?: QrTerminalOptions): string | null; //# sourceMappingURL=qr-terminal.d.ts.map