diff --git a/web/flow-typed/npm/grpc-web_v1.x.x.js b/web/flow-typed/npm/grpc-web_v1.x.x.js --- a/web/flow-typed/npm/grpc-web_v1.x.x.js +++ b/web/flow-typed/npm/grpc-web_v1.x.x.js @@ -3,7 +3,7 @@ declare module 'grpc-web' { - declare export type Metadata = { +[s: string]: string }; + declare export type Metadata = { [s: string]: string }; declare export type StatusCode = | 0 // OK @@ -30,6 +30,43 @@ +metadata?: Metadata, }; + declare export class UnaryInterceptor { + intercept( + request: Request, + invoker: (request: Request) => Promise> + ): Promise>; + } + + declare export class Request { + getRequestMessage(): REQ; + getMethodDescriptor(): MethodDescriptor; + getMetadata(): Metadata; + getCallOptions(): CallOptions; + } + + declare export class UnaryResponse { + getResponseMessage(): RESP; + getMetadata(): Metadata; + getMethodDescriptor(): MethodDescriptor; + getStatus(): Status; + } + + declare export class CallOptions { + constructor(options: { [index: string]: mixed; }): void; + } + + declare export class MethodDescriptor { + constructor( + name: string, + methodType: string, + requestType: (...args: mixed[]) => REQ, + responseType: (...args: mixed[]) => RESP, + requestSerializeFn: any, + responseDeserializeFn: any, + ): void; + getName(): string; + } + declare export class RpcError extends Error { constructor(code: StatusCode, message: string, metadata: Metadata): void; code: StatusCode;