@bufbuild/connect-web
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -9,5 +9,5 @@ import type { ServiceType } from "@bufbuild/protobuf"; | ||
*/ | ||
export declare type AnyClient = Record<string, AnyClientMethod>; | ||
declare type AnyClientMethod = (...args: any[]) => any; | ||
declare type CreateAnyClientMethod = (method: MethodInfo & { | ||
export type AnyClient = Record<string, AnyClientMethod>; | ||
type AnyClientMethod = (...args: any[]) => any; | ||
type CreateAnyClientMethod = (method: MethodInfo & { | ||
localName: string; | ||
@@ -14,0 +14,0 @@ service: ServiceType; |
@@ -22,6 +22,6 @@ import type { MethodInfoServerStreaming, MethodInfoUnary, PartialMessage, ServiceType } from "@bufbuild/protobuf"; | ||
*/ | ||
export declare type CallbackClient<T extends ServiceType> = { | ||
export type CallbackClient<T extends ServiceType> = { | ||
[P in keyof T["methods"]]: T["methods"][P] extends MethodInfoUnary<infer I, infer O> ? (request: PartialMessage<I>, callback: (error: ConnectError | undefined, response: O) => void, options?: CallOptions) => CancelFn : T["methods"][P] extends MethodInfoServerStreaming<infer I, infer O> ? (request: PartialMessage<I>, messageCallback: (response: O) => void, closeCallback: (error: ConnectError | undefined) => void, options?: CallOptions) => CancelFn : never; | ||
}; | ||
declare type CancelFn = () => void; | ||
type CancelFn = () => void; | ||
/** | ||
@@ -28,0 +28,0 @@ * Create a CallbackClient for the given service, invoking RPCs through the |
@@ -27,3 +27,3 @@ import type { AnyMessage, Message, MethodInfo, ServiceType } from "@bufbuild/protobuf"; | ||
*/ | ||
export declare type Interceptor = (next: AnyFn) => AnyFn; | ||
export type Interceptor = (next: AnyFn) => AnyFn; | ||
/** | ||
@@ -35,3 +35,3 @@ * Interceptors apply to both UnaryFn and ServerStreamFn. In order to handle | ||
*/ | ||
declare type AnyFn = (req: UnaryRequest) => Promise<UnaryResponse | StreamResponse>; | ||
type AnyFn = (req: UnaryRequest) => Promise<UnaryResponse | StreamResponse>; | ||
/** | ||
@@ -44,3 +44,3 @@ * UnaryFn represents the client-side invocation of a unary RPC - a method | ||
*/ | ||
declare type UnaryFn<I extends Message<I> = AnyMessage, O extends Message<O> = AnyMessage> = (req: UnaryRequest<I>) => Promise<UnaryResponse<O>>; | ||
type UnaryFn<I extends Message<I> = AnyMessage, O extends Message<O> = AnyMessage> = (req: UnaryRequest<I>) => Promise<UnaryResponse<O>>; | ||
/** | ||
@@ -53,3 +53,3 @@ * ServerStreamFn represents the client-side invocation of a server-streaming | ||
*/ | ||
declare type ServerStreamFn<I extends Message<I> = AnyMessage, O extends Message<O> = AnyMessage> = (req: UnaryRequest<I>) => Promise<StreamResponse<O>>; | ||
type ServerStreamFn<I extends Message<I> = AnyMessage, O extends Message<O> = AnyMessage> = (req: UnaryRequest<I>) => Promise<StreamResponse<O>>; | ||
/** | ||
@@ -56,0 +56,0 @@ * UnaryRequest is used in interceptors to represent a request with a |
@@ -1,2 +0,2 @@ | ||
export declare type ReadableStreamReadResultLike<T> = ReadableStreamReadValueResultLike<T> | ReadableStreamReadDoneResultLike; | ||
export type ReadableStreamReadResultLike<T> = ReadableStreamReadValueResultLike<T> | ReadableStreamReadDoneResultLike; | ||
interface ReadableStreamReadValueResultLike<T> { | ||
@@ -3,0 +3,0 @@ done: false; |
@@ -9,3 +9,3 @@ import type { MethodInfoServerStreaming, MethodInfoUnary, PartialMessage, ServiceType } from "@bufbuild/protobuf"; | ||
*/ | ||
export declare type PromiseClient<T extends ServiceType> = { | ||
export type PromiseClient<T extends ServiceType> = { | ||
[P in keyof T["methods"]]: T["methods"][P] extends MethodInfoUnary<infer I, infer O> ? (request: PartialMessage<I>, options?: CallOptions) => Promise<O> : T["methods"][P] extends MethodInfoServerStreaming<infer I, infer O> ? (request: PartialMessage<I>, options?: CallOptions) => AsyncIterable<O> : never; | ||
@@ -12,0 +12,0 @@ }; |
{ | ||
"name": "@bufbuild/connect-web", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"license": "Apache-2.0", | ||
@@ -26,3 +26,3 @@ "repository": { | ||
"peerDependencies": { | ||
"@bufbuild/protobuf": "0.2.1" | ||
"@bufbuild/protobuf": "0.3.0" | ||
}, | ||
@@ -29,0 +29,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
157305