UNPKG

2.07 kBTypeScriptView Raw
1import { PatternMetadata } from '../interfaces/pattern-metadata.interface';
2import { Transport } from '../enums';
3export declare enum GrpcMethodStreamingType {
4 NO_STREAMING = "no_stream",
5 RX_STREAMING = "rx_stream",
6 PT_STREAMING = "pt_stream"
7}
8/**
9 * Subscribes to incoming messages which fulfils chosen pattern.
10 */
11export declare const MessagePattern: <T = PatternMetadata>(metadata?: T, transport?: Transport) => MethodDecorator;
12/**
13 * Registers gRPC method handler for specified service.
14 */
15export declare function GrpcMethod(service?: string): MethodDecorator;
16export declare function GrpcMethod(service: string, method?: string): MethodDecorator;
17/**
18 * Registers gRPC call through RX handler for service and method
19 *
20 * @param service String parameter reflecting the name of service definition from proto file
21 */
22export declare function GrpcStreamMethod(service?: string): MethodDecorator;
23/**
24 * @param service String parameter reflecting the name of service definition from proto file
25 * @param method Optional string parameter reflecting the name of method inside of a service definition coming after rpc keyword
26 */
27export declare function GrpcStreamMethod(service: string, method?: string): MethodDecorator;
28/**
29 * Registers gRPC call pass through handler for service and method
30 *
31 * @param service String parameter reflecting the name of service definition from proto file
32 */
33export declare function GrpcStreamCall(service?: string): MethodDecorator;
34/**
35 * @param service String parameter reflecting the name of service definition from proto file
36 * @param method Optional string parameter reflecting the name of method inside of a service definition coming after rpc keyword
37 */
38export declare function GrpcStreamCall(service: string, method?: string): MethodDecorator;
39export declare function createGrpcMethodMetadata(target: object, key: string | symbol, service: string | undefined, method: string | undefined, streaming?: GrpcMethodStreamingType): {
40 service: string;
41 rpc: string;
42 streaming: GrpcMethodStreamingType;
43};