UNPKG

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