Skip to content

Commit

Permalink
chore: add shims
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideIadeluca committed Oct 5, 2024
1 parent 2c1aee5 commit 98a6eb3
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions js/src/@types/shims.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import Rank from '../common/models/Rank';

declare module 'flarum/common/models/Discussion' {
export default interface Discussion {
votes(): number;
hasUpvoted(): boolean;
hasDownvoted(): boolean;
canVote(): boolean;
seeVotes(): boolean;
}
}

declare module 'flarum/common/models/Post' {
export default interface Post {
upvotes(): unknown;
downvotes(): unknown;
votes(): number;
canVote(): boolean;
canSeeVotes(): boolean;
hasUpvoted(): boolean;
hasDownvoted(): boolean;
seeVoters(): boolean;
}
}

declare module 'flarum/common/models/User' {
export default interface User {
points(): number;
ranks(): Rank[];
canHaveVotingNotifications(): boolean;
}
}

0 comments on commit 98a6eb3

Please sign in to comment.