Skip to content

Commit 1970509

Browse files
committed
Method documentation
1 parent 098266a commit 1970509

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/server/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,35 +603,53 @@ export class Server<
603603
});
604604
}
605605

606+
/**
607+
* Registers a resource `name` at a fixed URI, which will use the given callback to respond to read requests.
608+
*/
606609
resource(name: string, uri: string, readCallback: ReadResourceCallback): void;
607610

611+
/**
612+
* Registers a resource `name` at a fixed URI with metadata, which will use the given callback to respond to read requests.
613+
*/
608614
resource(
609615
name: string,
610616
uri: string,
611617
metadata: ResourceMetadata,
612618
readCallback: ReadResourceCallback,
613619
): void;
614620

621+
/**
622+
* Registers a resource `name` with a URI template pattern, which will use the given callback to respond to read requests.
623+
*/
615624
resource(
616625
name: string,
617626
uriTemplate: UriTemplate,
618627
readCallback: ReadResourceCallback,
619628
): void;
620629

630+
/**
631+
* Registers a resource `name` with a URI template pattern and metadata, which will use the given callback to respond to read requests.
632+
*/
621633
resource(
622634
name: string,
623635
uriTemplate: UriTemplate,
624636
metadata: ResourceMetadata,
625637
readCallback: ReadResourceCallback,
626638
): void;
627639

640+
/**
641+
* 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.
642+
*/
628643
resource(
629644
name: string,
630645
uriTemplate: UriTemplate,
631646
listCallback: ListResourcesCallback,
632647
readCallback: ReadResourceCallback,
633648
): void;
634649

650+
/**
651+
* 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.
652+
*/
635653
resource(
636654
name: string,
637655
uriTemplate: UriTemplate,

0 commit comments

Comments
 (0)