import { Metadata } from '@grpc/grpc-js'; import { RpcException } from '@nestjs/microservices'; import { GrpcErrorCode } from '../constants'; import { GrpcConsumerError, GrpcExceptionOptions } from '../interfaces'; export declare function getGrpcStatusDescription(code: number): string; export declare function httpStatusToGrpcStatus(httpStatus: number): number; export declare class GrpcConsumerException extends Error { readonly error: GrpcConsumerError; constructor(error: GrpcConsumerError); isRetryable(): boolean; getCode(): number; getDetails(): any; getMetadata(): any; getServiceName(): string; getMethodName(): string; getDuration(): number; getTimestamp(): Date; } export declare class GrpcConsumerErrorHandler { private readonly logger; handleError(error: any, serviceName: string, methodName: string, startTime: number): GrpcConsumerException; private extractGrpcError; private logError; isRetryableError(error: Error): boolean; } export declare class GrpcException extends RpcException { private readonly code; private readonly details; private readonly metadata; constructor(options: GrpcExceptionOptions | string); private static normalizeOptions; private static validateMetadata; getCode(): GrpcErrorCode; getDetails(): any; getMetadata(): Record; toMetadata(): Metadata; getError(): any; static ok(message: string, details?: any, metadata?: Record): GrpcException; static cancelled(message: string, details?: any, metadata?: Record): GrpcException; static unknown(message: string, details?: any, metadata?: Record): GrpcException; static invalidArgument(message: string, details?: any, metadata?: Record): GrpcException; static deadlineExceeded(message: string, details?: any, metadata?: Record): GrpcException; static notFound(message: string, details?: any, metadata?: Record): GrpcException; static alreadyExists(message: string, details?: any, metadata?: Record): GrpcException; static permissionDenied(message: string, details?: any, metadata?: Record): GrpcException; static resourceExhausted(message: string, details?: any, metadata?: Record): GrpcException; static failedPrecondition(message: string, details?: any, metadata?: Record): GrpcException; static aborted(message: string, details?: any, metadata?: Record): GrpcException; static outOfRange(message: string, details?: any, metadata?: Record): GrpcException; static unimplemented(message: string, details?: any, metadata?: Record): GrpcException; static internal(message: string, details?: any, metadata?: Record): GrpcException; static unavailable(message: string, details?: any, metadata?: Record): GrpcException; static dataLoss(message: string, details?: any, metadata?: Record): GrpcException; static unauthenticated(message: string, details?: any, metadata?: Record): GrpcException; }