diff --git a/integration/grpc-js/simple.ts b/integration/grpc-js/simple.ts index d0dae3ae0..9b2428918 100644 --- a/integration/grpc-js/simple.ts +++ b/integration/grpc-js/simple.ts @@ -2,9 +2,9 @@ import { CallOptions, ChannelCredentials, - ChannelOptions, Client, ClientDuplexStream, + ClientOptions, ClientReadableStream, ClientUnaryCall, ClientWritableStream, @@ -617,7 +617,7 @@ export interface TestClient extends Client { } export const TestClient = makeGenericClientConstructor(TestService, "simple.Test") as unknown as { - new (address: string, credentials: ChannelCredentials, options?: Partial): TestClient; + new (address: string, credentials: ChannelCredentials, options?: Partial): TestClient; service: typeof TestService; }; diff --git a/src/generate-grpc-js.ts b/src/generate-grpc-js.ts index 0c262e297..219432777 100644 --- a/src/generate-grpc-js.ts +++ b/src/generate-grpc-js.ts @@ -1,15 +1,14 @@ import { Code, code, def, imp, joinCode } from "ts-poet"; import { FileDescriptorProto, ServiceDescriptorProto } from "ts-proto-descriptors"; -import { camelCase } from "./case"; import { Context } from "./context"; import SourceInfo, { Fields } from "./sourceInfo"; -import { messageToTypeName, wrapperTypeName } from "./types"; +import { messageToTypeName } from "./types"; import { assertInstanceOf, FormattedMethodDescriptor, maybeAddComment, maybePrefixPackage } from "./utils"; import { generateDecoder, generateEncoder } from "./encode"; const CallOptions = imp("CallOptions@@grpc/grpc-js"); const ChannelCredentials = imp("ChannelCredentials@@grpc/grpc-js"); -const ChannelOptions = imp("ChannelOptions@@grpc/grpc-js"); +const ClientOptions = imp("ClientOptions@@grpc/grpc-js"); const Client = imp("Client@@grpc/grpc-js"); const ClientDuplexStream = imp("ClientDuplexStream@@grpc/grpc-js"); const ClientReadableStream = imp("ClientReadableStream@@grpc/grpc-js"); @@ -236,7 +235,7 @@ function generateClientConstructor(fileDesc: FileDescriptorProto, serviceDesc: S new ( address: string, credentials: ${ChannelCredentials}, - options?: Partial<${ChannelOptions}>, + options?: Partial<${ClientOptions}>, ): ${serviceDesc.name}Client; service: typeof ${serviceDesc.name}Service; }