UNPKG

1.06 kBTypeScriptView Raw
1/// <reference types="node" />
2import { Type } from '@nestjs/common';
3import { ClientProxy } from '../client';
4import { TcpSocket } from '../helpers';
5import { Transport } from '../enums/transport.enum';
6import { Deserializer } from './deserializer.interface';
7import { GrpcOptions, KafkaOptions, MqttOptions, NatsOptions, RedisOptions, RmqOptions } from './microservice-configuration.interface';
8import { Serializer } from './serializer.interface';
9import { ConnectionOptions } from 'tls';
10export type ClientOptions = RedisOptions | NatsOptions | MqttOptions | GrpcOptions | KafkaOptions | TcpClientOptions | RmqOptions;
11/**
12 * @publicApi
13 */
14export interface CustomClientOptions {
15 customClass: Type<ClientProxy>;
16 options?: Record<string, any>;
17}
18/**
19 * @publicApi
20 */
21export interface TcpClientOptions {
22 transport: Transport.TCP;
23 options?: {
24 host?: string;
25 port?: number;
26 serializer?: Serializer;
27 deserializer?: Deserializer;
28 tlsOptions?: ConnectionOptions;
29 socketClass?: Type<TcpSocket>;
30 };
31}