import type { ImapFlowError } from '../errors.js';
export declare const MAX_LITERAL_SIZE: number;
export declare const MAX_LINE_SIZE: number;
export declare const MAX_RESPONSE_SIZE: number;
/**
 * Normalizes a configured size limit. A non-negative integer is honored as-is (including 0, which
 * means "reject anything non-empty"), and `Infinity` disables the limit; anything else falls back
 * to the default, so an explicit 0 is not silently swallowed the way `value || DEFAULT` would
 * swallow it.
 *
 * @param value - The configured value.
 * @param defaultValue - Fallback when the value is not a usable limit.
 * @returns The normalized limit.
 */
export declare const normalizeLimit: (value: unknown, defaultValue: number) => number;
/**
 * Builds the `LiteralTooLarge` error. One shape for every place a literal is refused, so callers
 * can rely on `code`, `literalSize` and `maxSize` regardless of which parser rejected it.
 *
 * @param literalSize - The declared literal size.
 * @param maxSize - The bound that was exceeded.
 * @param reason - What the bound was, when it is not the configured maximum.
 * @returns The error to emit or throw.
 */
export declare const createLiteralTooLargeError: (literalSize: number, maxSize: number, reason?: string | null | undefined) => ImapFlowError;
