Skip to content

Commit

Permalink
Update JSDoc for ConnectRouter methods service and rpc (#1146)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Stamm <ts@timostamm.de>
  • Loading branch information
timostamm authored Jul 16, 2024
1 parent 311a40b commit 76ee334
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/connect/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,19 @@ import type { MethodType } from "./method-type.js";
export interface ConnectRouter {
readonly handlers: UniversalHandler[];
/**
* Provides implementation for a set of RPCs on the service.
* Register a service implementation, and object with methods for the
* individual RPCs.
*
* You don't have to implement all RPCs of a service. If you omit a method,
* the router adds a method that responds with an error code `unimplemented`.
*/
service<T extends ServiceType>(
service: T,
implementation: Partial<ServiceImpl<T>>,
options?: Partial<UniversalHandlerOptions>,
): this;
/**
* Provides implementation for a single RPC given service and associated method.
* Register a single RPC implementation.
*/
rpc<M extends MethodInfo>(
service: ServiceType,
Expand All @@ -71,7 +75,7 @@ export interface ConnectRouter {
options?: Partial<UniversalHandlerOptions>,
): this;
/**
* Provides implementation for a single RPC given a method type.
* Register a single RPC implementation for a method type.
*
* @private This is an experimental API. Please do not rely on it yet.
*/
Expand Down

0 comments on commit 76ee334

Please sign in to comment.