Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3398210
D9671.id32602.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9671.id32602.diff
View Options
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,41 @@
+metadata?: Metadata,
};
+ declare export class UnaryInterceptor<REQ, RESP> {
+ intercept(
+ request: Request<REQ, RESP>,
+ invoker: (request: Request<REQ, RESP>) => Promise<UnaryResponse<REQ, RESP>>
+ ): Promise<UnaryResponse<REQ, RESP>>;
+ }
+
+ declare export class Request<REQ, RESP> {
+ getRequestMessage(): REQ;
+ getMethodDescriptor(): MethodDescriptor<REQ, RESP>;
+ getMetadata(): Metadata;
+ getCallOptions(): CallOptions;
+ }
+
+ declare export class UnaryResponse<REQ, RESP> {
+ getResponseMessage(): RESP;
+ getMetadata(): Metadata;
+ getMethodDescriptor(): MethodDescriptor<REQ, RESP>;
+ getStatus(): Status;
+ }
+
+ declare export class CallOptions {
+ constructor(options: { [index: string]: any; }): void;
+ }
+
+ declare export class MethodDescriptor<REQ, RESP> {
+ 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;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 2, 9:46 PM (20 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2609013
Default Alt Text
D9671.id32602.diff (1 KB)
Attached To
Mode
D9671: [web] add flow types for grpc-web unary interceptor
Attached
Detach File
Event Timeline
Log In to Comment