Skip to content

Commit 8eab636

Browse files
docs(core): ZodSchema overload JSDoc — "the" → "a" supported form (3-arg is also one)
1 parent e5f48f1 commit 8eab636

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/client/src/client/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ export class Client extends Protocol<ClientContext> {
349349
paramsSchema: P,
350350
handler: (params: StandardSchemaV1.InferOutput<P>, ctx: ClientContext) => Result | Promise<Result>
351351
): void;
352-
/** For spec methods the method-string form is more concise; this overload is the supported call form for non-spec methods or when you want full-envelope validation. */
352+
/** For spec methods the method-string form is more concise; this overload is a supported call form for non-spec methods (alongside the three-arg `(method, paramsSchema, handler)` form) or when you want full-envelope validation. */
353353
public override setRequestHandler<T extends ZodLikeRequestSchema>(
354354
requestSchema: T,
355355
handler: (request: ReturnType<T['parse']>, ctx: ClientContext) => Result | Promise<Result>

packages/core/src/shared/protocol.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ export abstract class Protocol<ContextT extends BaseContext> {
10551055
paramsSchema: P,
10561056
handler: (params: StandardSchemaV1.InferOutput<P>, ctx: ContextT) => Result | Promise<Result>
10571057
): void;
1058-
/** For spec methods the method-string form is more concise; this overload is the supported call form for non-spec methods or when you want full-envelope validation. */
1058+
/** For spec methods the method-string form is more concise; this overload is a supported call form for non-spec methods (alongside the three-arg `(method, paramsSchema, handler)` form) or when you want full-envelope validation. */
10591059
setRequestHandler<T extends ZodLikeRequestSchema>(
10601060
requestSchema: T,
10611061
handler: (request: ReturnType<T['parse']>, ctx: ContextT) => Result | Promise<Result>
@@ -1154,7 +1154,7 @@ export abstract class Protocol<ContextT extends BaseContext> {
11541154
paramsSchema: P,
11551155
handler: (params: StandardSchemaV1.InferOutput<P>) => void | Promise<void>
11561156
): void;
1157-
/** For spec methods the method-string form is more concise; this overload is the supported call form for non-spec methods or when you want full-envelope validation. */
1157+
/** For spec methods the method-string form is more concise; this overload is a supported call form for non-spec methods (alongside the three-arg `(method, paramsSchema, handler)` form) or when you want full-envelope validation. */
11581158
setNotificationHandler<T extends ZodLikeRequestSchema>(
11591159
notificationSchema: T,
11601160
handler: (notification: ReturnType<T['parse']>) => void | Promise<void>

packages/server/src/server/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export class Server extends Protocol<ServerContext> {
237237
paramsSchema: P,
238238
handler: (params: StandardSchemaV1.InferOutput<P>, ctx: ServerContext) => Result | Promise<Result>
239239
): void;
240-
/** For spec methods the method-string form is more concise; this overload is the supported call form for non-spec methods or when you want full-envelope validation. */
240+
/** For spec methods the method-string form is more concise; this overload is a supported call form for non-spec methods (alongside the three-arg `(method, paramsSchema, handler)` form) or when you want full-envelope validation. */
241241
public override setRequestHandler<T extends ZodLikeRequestSchema>(
242242
requestSchema: T,
243243
handler: (request: ReturnType<T['parse']>, ctx: ServerContext) => Result | Promise<Result>

0 commit comments

Comments
 (0)