import { ServiceDefinition, UntypedServiceImplementation } from '@grpc/grpc-js'; import { CallOptions as DefaultGrpcCallOptions } from 'nice-grpc'; import { ActionSession, ActionVersion } from '@diia-inhouse/types'; export interface GrpcClientConfig { defaultDeadlineMs?: number; } export interface GrpcServerConfig { isEnabled: boolean; port: number; services: string[]; isReflectionEnabled: boolean; maxReceiveMessageLength: number; keepAlive?: GrpcServerKeepalive; } export interface GrpcServerKeepalive { interval?: number; timeout?: number; permitWithoutcalls?: 0 | 1; } export interface GrpcClientMetadata { /** @deprecated params should be provided explicitly without a session as sessions are not a part of proto contracts */ session?: ActionSession; /** @deprecated a method that contains a version in his name should be used */ version?: ActionVersion; deadline?: number; } export interface CallOptions extends DefaultGrpcCallOptions { deadline?: number; } export interface GrpcServiceStatus { grpcServer: 'UNKNOWN' | 'SERVING' | 'NOT_SERVING' | 'DISABLED'; } export declare enum GrpcMethodType { UNARY = 0, CLIENT_STREAM = 1, SERVER_STREAM = 2, BIDI_STREAM = 3 } export interface StreamKey { streamId: string; mobileUid: string; } export declare enum DeviceMultipleConnectionPolicy { ALLOW_MULTIPLE_CONNECTIONS = 0, FORBID_REJECT_NEW_CONNECTION = 1, FORBID_CLOSE_PREVIOUS_CONNECTION = 2 } export type GrpcServiceImplementationProvider = (service: ServiceDefinition) => UntypedServiceImplementation;