UNPKG

2.4 kBTypeScriptView Raw
1import { Transport } from '../enums';
2import { PatternMetadata } from '../interfaces/pattern-metadata.interface';
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 *
11 * @publicApi
12 */
13export declare const MessagePattern: {
14 <T = PatternMetadata | string>(metadata?: T): MethodDecorator;
15 <T = PatternMetadata | string>(metadata?: T, transport?: Transport | symbol): MethodDecorator;
16 <T = PatternMetadata | string>(metadata?: T, extras?: Record<string, any>): MethodDecorator;
17 <T = PatternMetadata | string>(metadata?: T, transport?: Transport | symbol, extras?: Record<string, any>): MethodDecorator;
18};
19/**
20 * Registers gRPC method handler for specified service.
21 */
22export declare function GrpcMethod(service?: string): MethodDecorator;
23export declare function GrpcMethod(service: string, method?: string): MethodDecorator;
24/**
25 * Registers gRPC call through RX handler for service and method
26 *
27 * @param service String parameter reflecting the name of service definition from proto file
28 */
29export declare function GrpcStreamMethod(service?: string): MethodDecorator;
30/**
31 * @param service String parameter reflecting the name of service definition from proto file
32 * @param method Optional string parameter reflecting the name of method inside of a service definition coming after rpc keyword
33 */
34export declare function GrpcStreamMethod(service: string, method?: string): MethodDecorator;
35/**
36 * Registers gRPC call pass through handler for service and method
37 *
38 * @param service String parameter reflecting the name of service definition from proto file
39 */
40export declare function GrpcStreamCall(service?: string): MethodDecorator;
41/**
42 * @param service String parameter reflecting the name of service definition from proto file
43 * @param method Optional string parameter reflecting the name of method inside of a service definition coming after rpc keyword
44 */
45export declare function GrpcStreamCall(service: string, method?: string): MethodDecorator;
46export declare function createGrpcMethodMetadata(target: object, key: string | symbol, service: string | undefined, method: string | undefined, streaming?: GrpcMethodStreamingType): {
47 service: string;
48 rpc: string;
49 streaming: GrpcMethodStreamingType;
50};