Skip to content

Commit

Permalink
Merge pull request grpc#1343 from Patrick-Remy/patch/grpc-native-type…
Browse files Browse the repository at this point in the history
…script-definition-complience

grpc-js: adjust ts definitions to equal native-core
  • Loading branch information
murgatroid99 authored Apr 9, 2020
2 parents 4823d97 + c622039 commit 9485062
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/grpc-js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
Deserialize,
loadPackageDefinition,
makeClientConstructor,
MethodDefinition,
Serialize,
ServiceDefinition,
} from './make-client';
Expand Down Expand Up @@ -230,6 +231,7 @@ export {
ClientWritableStream,
ClientDuplexStream,
CallOptions,
MethodDefinition,
StatusObject,
ServiceError,
ServerUnaryCall,
Expand Down
5 changes: 3 additions & 2 deletions packages/grpc-js/src/make-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import { ChannelCredentials } from './channel-credentials';
import { ChannelOptions } from './channel-options';
import { Client } from './client';
import { UntypedServiceImplementation } from './server';

export interface Serialize<T> {
(value: T): Buffer;
Expand Down Expand Up @@ -49,9 +50,9 @@ export interface MethodDefinition<RequestType, ResponseType>
extends ClientMethodDefinition<RequestType, ResponseType>,
ServerMethodDefinition<RequestType, ResponseType> {}

export interface ServiceDefinition {
export type ServiceDefinition<ImplementationType = UntypedServiceImplementation> = {
// tslint:disable-next-line no-any
[index: string]: MethodDefinition<any, any>;
readonly [index in keyof ImplementationType]: MethodDefinition<any, any>;
}

export interface ProtobufTypeDefinition {
Expand Down

0 comments on commit 9485062

Please sign in to comment.