Skip to content

Commit

Permalink
fix(federation): 🐛 Fix broken types (forgot to rename)
Browse files Browse the repository at this point in the history
  • Loading branch information
CPlusPatch committed Jun 19, 2024
1 parent f998264 commit 1a4890d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
43 changes: 24 additions & 19 deletions federation/http/index.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
import type {
Dislike,
Extension,
Follow,
FollowAccept,
FollowReject,
Like,
Note,
Patch,
ServerMetadata,
Undo,
User,
} from "../schemas";
import type { EntityValidator } from "../validator/index";

type MaybePromise<T> = T | Promise<T>;

type ParserCallbacks<T> = {
note: (note: typeof EntityValidator.$Note) => MaybePromise<T>;
follow: (follow: typeof EntityValidator.$Follow) => MaybePromise<T>;
followAccept: (
followAccept: typeof EntityValidator.$FollowAccept,
) => MaybePromise<T>;
followReject: (
followReject: typeof EntityValidator.$FollowReject,
) => MaybePromise<T>;
user: (user: typeof EntityValidator.$User) => MaybePromise<T>;
like: (like: typeof EntityValidator.$Like) => MaybePromise<T>;
dislike: (dislike: typeof EntityValidator.$Dislike) => MaybePromise<T>;
undo: (undo: typeof EntityValidator.$Undo) => MaybePromise<T>;
serverMetadata: (
serverMetadata: typeof EntityValidator.$ServerMetadata,
) => MaybePromise<T>;
extension: (
extension: typeof EntityValidator.$Extension,
) => MaybePromise<T>;
patch: (patch: typeof EntityValidator.$Patch) => MaybePromise<T>;
note: (note: Note) => MaybePromise<T>;
follow: (follow: Follow) => MaybePromise<T>;
followAccept: (followAccept: FollowAccept) => MaybePromise<T>;
followReject: (followReject: FollowReject) => MaybePromise<T>;
user: (user: User) => MaybePromise<T>;
like: (like: Like) => MaybePromise<T>;
dislike: (dislike: Dislike) => MaybePromise<T>;
undo: (undo: Undo) => MaybePromise<T>;
serverMetadata: (serverMetadata: ServerMetadata) => MaybePromise<T>;
extension: (extension: Extension) => MaybePromise<T>;
patch: (patch: Patch) => MaybePromise<T>;
};

/**
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"workspaces": ["federation", "client"],
"scripts": {
"lint": "bunx @biomejs/biome check .",
"build": "bun run build.ts"
"build": "bun run build.ts",
"check": "bunx tsc -p ."
},
"devDependencies": {
"@biomejs/biome": "^1.8.1",
Expand Down

0 comments on commit 1a4890d

Please sign in to comment.