-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing types definitions #886
Conversation
42872c0
to
d6d2b6e
Compare
71e4840
to
912f956
Compare
912f956
to
cc14050
Compare
packages/grpc-web/index.d.ts
Outdated
invoker: (request: Request<Req, Resp>) => | ||
ClientReadableStream<Resp>): ClientReadableStream<Resp>; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this up! I was wondering if you could also add UnaryInterceptor while you're at it?
From: https://github.com/grpc/grpc-web/blob/master/javascript/net/grpc/web/interceptor.js#L47
export interface UnaryInterceptor<Req, Resp> { | |
intercept(request: Request<Req, Resp>, | |
invoker: (request: Request<Req, Resp>) => | |
Promise<UnaryResponse<Req, Resp>>): Promise<UnaryResponse<Req, Resp>>; | |
} | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes literally working on that part as we speak :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@willsalz Added the UnaryInterceptor
interface typings to the PR. Still WIP. Hopefully should land soon.
Fixes #848: Fixed a bug where we can't pass the interceptors into the client constructor because of a type mismatch.
Fixes #868: Added
MethodDescriptor
to the exported types. Replace the deprecatedMethodInfo
withMethodDescriptor
.Fixes #877: Fixed issue where
UnaryResponse
symbols are being optimized away.And in general added some missing classes to the exported types as well.
Added tests for both callback-based
StreamInterceptor
and promise-basedUnaryInterceptor
. And now executetsc
with--strict
.