UNPKG

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