import type { Metadata } from '@midwayjs/grpc'; import type { Context as Context, GrpcContext, NextFunction } from '@mwcp/share'; import { RpcMethodType } from '@mwcp/share'; import type { TextMapGetter, TextMapSetter } from '@opentelemetry/api'; import type { TraceService } from '../../lib/index.js'; /** * Catch and sample top exception if __isTraced is false or undefined, * ex will NOT be thrown again */ export declare function handleTopExceptionAndNext(ctx: GrpcContext, traceSvc: TraceService, next: NextFunction): Promise; /** * Catch and sample exception, * re-throw ex */ export declare function handleAppExceptionAndNext(webCtx: Context, traceSvc: TraceService, next: NextFunction): Promise; export declare const metadataSetter: TextMapSetter>; export declare const metadataGetter: TextMapGetter; export declare function detectRpcMethodType(ctx: GrpcContext): RpcMethodType.unary | RpcMethodType.bidi; export declare function isGrpcContextFinished(ctx: GrpcContext): boolean;