import { IMAPSDKError, IMAPSDKErrorCode } from '../../types/errors'; import type { ParsedResponse } from '../../types/protocol'; export declare const getStatusCode: (response: ParsedResponse | undefined) => string | false; export declare const getErrorText: (response: ParsedResponse | undefined) => string | false; export declare const IMAPAuthError: { new (message: string, serverResponseCode?: string, oauthError?: unknown): { readonly name: "IMAPAuthError"; readonly authenticationFailed: true; readonly code: IMAPSDKErrorCode | `PARSER_${string}`; readonly serverResponseCode?: string; readonly oauthError?: unknown; readonly responseStatus?: "NO" | "BAD"; readonly responseText?: string; readonly throttleReset?: number; readonly extension?: string; readonly parserPosition?: number; readonly parserInput?: string; message: string; stack?: string; cause?: unknown; }; connection(code: typeof IMAPSDKErrorCode.NO_CONNECTION | typeof IMAPSDKErrorCode.CONNECTION_CLOSED | typeof IMAPSDKErrorCode.CONNECT_TIMEOUT | typeof IMAPSDKErrorCode.GREETING_TIMEOUT | typeof IMAPSDKErrorCode.SOCKET_TIMEOUT | typeof IMAPSDKErrorCode.UPGRADE_TIMEOUT | typeof IMAPSDKErrorCode.TLS_FAILED, message: string): IMAPSDKError; authentication(message: string, serverResponseCode?: string, oauthError?: unknown): IMAPSDKError; protocol(message: string, responseStatus?: "NO" | "BAD", responseText?: string, serverResponseCode?: string): IMAPSDKError; commandFailed(message: string, serverResponseCode?: string, responseText?: string): IMAPSDKError; parser(message: string, position?: number, input?: string): IMAPSDKError; throttled(message: string, throttleReset: number): IMAPSDKError; missingExtension(message: string, extension: string): IMAPSDKError; invalidState(message: string): IMAPSDKError; disposed(resource: string): IMAPSDKError; internal(message: string, cause?: unknown): IMAPSDKError; isIMAPSDKError(error: unknown): error is IMAPSDKError; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; export declare const IMAPCommandError: { new (message: string, serverResponseCode?: string, response?: string): { readonly name: "IMAPCommandError"; get response(): string | undefined; readonly code: IMAPSDKErrorCode | `PARSER_${string}`; readonly serverResponseCode?: string; readonly oauthError?: unknown; readonly responseStatus?: "NO" | "BAD"; readonly responseText?: string; readonly throttleReset?: number; readonly extension?: string; readonly parserPosition?: number; readonly parserInput?: string; message: string; stack?: string; cause?: unknown; }; connection(code: typeof IMAPSDKErrorCode.NO_CONNECTION | typeof IMAPSDKErrorCode.CONNECTION_CLOSED | typeof IMAPSDKErrorCode.CONNECT_TIMEOUT | typeof IMAPSDKErrorCode.GREETING_TIMEOUT | typeof IMAPSDKErrorCode.SOCKET_TIMEOUT | typeof IMAPSDKErrorCode.UPGRADE_TIMEOUT | typeof IMAPSDKErrorCode.TLS_FAILED, message: string): IMAPSDKError; authentication(message: string, serverResponseCode?: string, oauthError?: unknown): IMAPSDKError; protocol(message: string, responseStatus?: "NO" | "BAD", responseText?: string, serverResponseCode?: string): IMAPSDKError; commandFailed(message: string, serverResponseCode?: string, responseText?: string): IMAPSDKError; parser(message: string, position?: number, input?: string): IMAPSDKError; throttled(message: string, throttleReset: number): IMAPSDKError; missingExtension(message: string, extension: string): IMAPSDKError; invalidState(message: string): IMAPSDKError; disposed(resource: string): IMAPSDKError; internal(message: string, cause?: unknown): IMAPSDKError; isIMAPSDKError(error: unknown): error is IMAPSDKError; isError(error: unknown): error is Error; captureStackTrace(targetObject: object, constructorOpt?: Function): void; prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any; stackTraceLimit: number; }; export type IMAPAuthError = InstanceType; export type IMAPCommandError = InstanceType; export type ErrorResponseInfo = { readonly response?: ParsedResponse; }; export declare const extractResponseInfo: (error: unknown) => { statusCode: string | false; errorText: string | false; response?: ParsedResponse; }; export declare const createAuthError: (err: unknown, oauthError?: unknown) => IMAPAuthError; export declare const createCommandError: (err: unknown) => IMAPCommandError; //# sourceMappingURL=utils.d.ts.map