@@ -85,7 +85,7 @@ interface Post {
8585 */
8686function getPostsByUserId(userId : string ): Post [] { return []; }
8787// ---cut-before---
88- import { Article , Create } from " @fedify/fedify " ;
88+ import { Article , Create } from " @fedify/vocab " ;
8989
9090federation
9191 .setOutboxDispatcher (" /users/{identifier}/outbox" , async (ctx , identifier ) => {
@@ -178,7 +178,8 @@ Here's an example of how to implement collection pages for the outbox collection
178178with assuming that the database system supports cursor-based pagination:
179179
180180~~~~ typescript twoslash
181- import { Article , Create , type Federation } from " @fedify/fedify" ;
181+ import { type Federation } from " @fedify/fedify" ;
182+ import { Article , Create } from " @fedify/vocab" ;
182183const federation = null as unknown as Federation <void >;
183184/**
184185 * A hypothetical type that represents a post.
@@ -290,7 +291,8 @@ The value for the first cursor is determined by
290291` ~CollectionCallbackSetters.setFirstCursor() ` method:
291292
292293~~~~ typescript twoslash
293- import { Article , Create , type Federation } from " @fedify/fedify" ;
294+ import { type Federation } from " @fedify/fedify" ;
295+ import { Article , Create } from " @fedify/vocab" ;
294296const federation = null as unknown as Federation <void >;
295297/**
296298 * A hypothetical type that represents a post.
@@ -447,7 +449,8 @@ So, the below example assumes that the database system supports offset-based
447449pagination, which is easy to implement backward pagination:
448450
449451~~~~ typescript twoslash
450- import { Article , Create , type Federation } from " @fedify/fedify" ;
452+ import { type Federation } from " @fedify/fedify" ;
453+ import { Article , Create } from " @fedify/vocab" ;
451454const federation = null as unknown as Federation <void >;
452455/**
453456 * A hypothetical type that represents a post.
@@ -610,7 +613,7 @@ async function countInboxByUserId(userId: string): Promise<number> {
610613 return 0 ;
611614}
612615// ---cut-before---
613- import { Activity } from " @fedify/fedify " ;
616+ import { Activity } from " @fedify/vocab " ;
614617
615618federation
616619 .setInboxDispatcher (" /users/{identifier}/inbox" , async (ctx , identifier ) => {
@@ -790,7 +793,8 @@ has to consist of `Recipient` objects that represent the actors.
790793The below example shows how to construct a followers collection:
791794
792795~~~~ typescript twoslash
793- import type { Federation , Recipient } from " @fedify/fedify" ;
796+ import type { Federation } from " @fedify/fedify" ;
797+ import type { Recipient } from " @fedify/vocab" ;
794798const federation = null as unknown as Federation <void >;
795799/**
796800 * A hypothetical type that represents an actor in the database.
@@ -904,7 +908,8 @@ the `Context.sendActivity()` method, you should return the entire followers
904908collection when the ` cursor ` parameter is ` null ` :
905909
906910~~~~ typescript{5-17} twoslash
907- import type { Federation, Recipient } from "@fedify/fedify";
911+ import type { Federation } from "@fedify/fedify";
912+ import type { Recipient } from "@fedify/vocab";
908913const federation = null as unknown as Federation<void>;
909914/**
910915 * A hypothetical type that represents an actor in the database.
@@ -1031,7 +1036,8 @@ The following example shows how to filter the followers collection by the
10311036server:
10321037
10331038~~~~ typescript{8-11} twoslash
1034- import type { Federation, Recipient } from "@fedify/fedify";
1039+ import type { Federation } from "@fedify/fedify";
1040+ import type { Recipient } from "@fedify/vocab";
10351041const federation = null as unknown as Federation<void>;
10361042/**
10371043 * A hypothetical type that represents an actor in the database.
@@ -1146,7 +1152,7 @@ async function getLikedByUserId(userId: string): Promise<Object[]> {
11461152 return [];
11471153}
11481154// ---cut-before---
1149- import type { Object } from " @fedify/fedify " ;
1155+ import type { Object } from " @fedify/vocab " ;
11501156
11511157federation
11521158 .setLikedDispatcher (" /users/{identifier}/liked" , async (ctx , identifier , cursor ) => {
@@ -1171,7 +1177,7 @@ async function getLikedByUserId(userId: string): Promise<Object[]> {
11711177 return [];
11721178}
11731179// ---cut-before---
1174- import type { Object } from " @fedify/fedify " ;
1180+ import type { Object } from " @fedify/vocab " ;
11751181
11761182federation
11771183 .setLikedDispatcher (" /users/{identifier}/liked" , async (ctx , identifier , cursor ) => {
@@ -1238,7 +1244,8 @@ as the outbox collection, so we don't repeat the explanation here.
12381244The below example shows how to construct a featured collection:
12391245
12401246~~~~ typescript twoslash
1241- import type { Object , Federation } from " @fedify/fedify" ;
1247+ import type { Federation } from " @fedify/fedify" ;
1248+ import type { Object } from " @fedify/vocab" ;
12421249const federation = null as unknown as Federation <void >;
12431250/**
12441251 * A hypothetical function that returns the objects that an actor has featured.
@@ -1312,7 +1319,8 @@ way as the outbox collection, so we don't repeat the explanation here.
13121319The below example shows how to construct a featured tags collection:
13131320
13141321~~~~ typescript twoslash
1315- import { Hashtag , type Federation } from " @fedify/fedify" ;
1322+ import { type Federation } from " @fedify/fedify" ;
1323+ import { Hashtag } from " @fedify/vocab" ;
13161324const federation = null as unknown as Federation <void >;
13171325/**
13181326 * A hypothetical function that returns the tags that an actor has featured.
@@ -1401,7 +1409,8 @@ collections. Both methods work similarly to the built-in collection dispatchers.
14011409Here's an example of creating a custom collection of bookmarked posts:
14021410
14031411~~~~ typescript twoslash
1404- import { Article , type Federation } from " @fedify/fedify" ;
1412+ import { type Federation } from " @fedify/fedify" ;
1413+ import { Article } from " @fedify/vocab" ;
14051414const federation = null as unknown as Federation <void >;
14061415/**
14071416 * A hypothetical type that represents a bookmarked post.
@@ -1476,7 +1485,8 @@ federation
14761485For ordered collections, simply use ` setOrderedCollectionDispatcher() ` instead:
14771486
14781487~~~~ typescript twoslash
1479- import { Article , type Federation } from " @fedify/fedify" ;
1488+ import { type Federation } from " @fedify/fedify" ;
1489+ import { Article } from " @fedify/vocab" ;
14801490const federation = null as unknown as Federation <void >;
14811491/**
14821492 * A hypothetical type that represents a bookmarked post.
@@ -1560,7 +1570,8 @@ Custom collections support the same callback methods as built-in collections:
15601570Custom collections can have multiple parameters in their URI patterns:
15611571
15621572~~~~ typescript twoslash
1563- import { Note , type Federation } from " @fedify/fedify" ;
1573+ import { type Federation } from " @fedify/fedify" ;
1574+ import { Note } from " @fedify/vocab" ;
15641575const federation = null as unknown as Federation <void >;
15651576/**
15661577 * A hypothetical function that returns posts by category.
@@ -1628,7 +1639,8 @@ ctx.getCollectionUri("category-posts", {
16281639You can restrict access to custom collections using the ` .authorize() ` method:
16291640
16301641~~~~ typescript twoslash
1631- import { Article , type Federation } from " @fedify/fedify" ;
1642+ import { type Federation } from " @fedify/fedify" ;
1643+ import { Article } from " @fedify/vocab" ;
16321644const federation = null as unknown as Federation <void >;
16331645/**
16341646 * A hypothetical function that checks if a user can access another user's bookmarks.
0 commit comments