import { Code } from '../util/error'; /** * Determines whether an error code represents a permanent error when received * in response to a non-write operation. * * See isPermanentWriteError for classifying write errors. */ export declare function isPermanentError(code: Code): boolean; /** * Determines whether an error code represents a permanent error when received * in response to a write operation. * * Write operations must be handled specially because as of b/119437764, ABORTED * errors on the write stream should be retried too (even though ABORTED errors * are not generally retryable). * * Note that during the initial handshake on the write stream an ABORTED error * signals that we should discard our stream token (i.e. it is permanent). This * means a handshake error should be classified with isPermanentError, above. */ export declare function isPermanentWriteError(code: Code): boolean; /** * Maps an error Code from a GRPC status identifier like 'NOT_FOUND'. * * @returns The Code equivalent to the given status string or undefined if * there is no match. */ export declare function mapCodeFromRpcStatus(status: string): Code | undefined; /** * Maps an error Code from GRPC status code number, like 0, 1, or 14. These * are not the same as HTTP status codes. * * @returns The Code equivalent to the given GRPC status code. Fails if there * is no match. */ export declare function mapCodeFromRpcCode(code: number | undefined): Code; /** * Maps an RPC code from a Code. This is the reverse operation from * mapCodeFromRpcCode and should really only be used in tests. */ export declare function mapRpcCodeFromCode(code: Code | undefined): number; /** * Converts an HTTP Status Code to the equivalent error code. * * @param status An HTTP Status Code, like 200, 404, 503, etc. * @returns The equivalent Code. Unknown status codes are mapped to * Code.UNKNOWN. */ export declare function mapCodeFromHttpStatus(status: number): Code;