Merge pull request #1343 from Patrick-Remy/patch/grpc-native-typescript-definition-complience

grpc-js: adjust ts definitions to equal native-core
This commit is contained in:
Michael Lumish 2020-04-09 16:30:53 -07:00 committed by GitHub
commit 9485062a31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -35,6 +35,7 @@ import {
Deserialize,
loadPackageDefinition,
makeClientConstructor,
MethodDefinition,
Serialize,
ServiceDefinition,
} from './make-client';
@ -230,6 +231,7 @@ export {
ClientWritableStream,
ClientDuplexStream,
CallOptions,
MethodDefinition,
StatusObject,
ServiceError,
ServerUnaryCall,

View File

@ -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;
@ -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 {