From 19705091311713f197c1f5f2f73b45b71e567643 Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Tue, 7 Jan 2025 22:05:55 +0000 Subject: [PATCH] Method documentation --- src/server/index.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/server/index.ts b/src/server/index.ts index 8bb900ef..159b382a 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -603,8 +603,14 @@ export class Server< }); } + /** + * Registers a resource `name` at a fixed URI, which will use the given callback to respond to read requests. + */ resource(name: string, uri: string, readCallback: ReadResourceCallback): void; + /** + * Registers a resource `name` at a fixed URI with metadata, which will use the given callback to respond to read requests. + */ resource( name: string, uri: string, @@ -612,12 +618,18 @@ export class Server< readCallback: ReadResourceCallback, ): void; + /** + * Registers a resource `name` with a URI template pattern, which will use the given callback to respond to read requests. + */ resource( name: string, uriTemplate: UriTemplate, readCallback: ReadResourceCallback, ): void; + /** + * Registers a resource `name` with a URI template pattern and metadata, which will use the given callback to respond to read requests. + */ resource( name: string, uriTemplate: UriTemplate, @@ -625,6 +637,9 @@ export class Server< readCallback: ReadResourceCallback, ): void; + /** + * Registers a resource `name` with a URI template pattern, which will use the list callback to enumerate matching resources and read callback to respond to read requests. + */ resource( name: string, uriTemplate: UriTemplate, @@ -632,6 +647,9 @@ export class Server< readCallback: ReadResourceCallback, ): void; + /** + * Registers a resource `name` with a URI template pattern and metadata, which will use the list callback to enumerate matching resources and read callback to respond to read requests. + */ resource( name: string, uriTemplate: UriTemplate,