docs(federation): 📝 Document RequestParserHandler

This commit is contained in:
Jesse Wierzbinski 2024-06-25 19:34:54 -10:00
parent 7c5c2d9f70
commit 80130a1f22
No known key found for this signature in database
2 changed files with 28 additions and 0 deletions

View file

@ -32,13 +32,17 @@ type ParserCallbacks<T> = {
/**
* A class to parse the body of a request and call the appropriate callback.
* @example
* const body = { ... };
* const validator = new EntityValidator();
* const parser = new RequestParserHandler(body, validator);
*
* await parser.parseBody({
* note: (note) => {
* // If the object is a Note, this will be called
* console.log(note);
* },
* follow: (follow) => {
* // If the object is a Follow, this will be called
* console.log(follow);
* },
* ...