import { type Channel, type ChannelCredentials, type ChannelOptions, type CompatServiceDefinition, createChannel, type DefaultCallOptions, type NormalizedServiceDefinition, } from "nice-grpc"; export type RemoveTypeUrl = Omit; export type ClientOptions = { defaultCallOptions?: DefaultCallOptions>; }; export type HostOrChannel = | { host: string; credentials?: ChannelCredentials; channelOptions?: ChannelOptions; channel?: never; } | { host?: never; channel: Channel; }; export function createChannelFromConfig(config: HostOrChannel): Channel { if (config.host !== undefined) { return createChannel(config.host, config.credentials, config.channelOptions); } return config.channel; }