Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.x] [extensibility] Add (some) missing shims #4027

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: add some missing shims
  • Loading branch information
DavideIadeluca committed Oct 2, 2024
commit 3bd77402d37d5674d1d75605e0b6b922b4064757
12 changes: 12 additions & 0 deletions extensions/approval/js/src/@types/shims.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
declare module 'flarum/common/models/Discussion' {
export default interface Discussion {
isApproved(): boolean;
}
}

declare module 'flarum/common/models/Post' {
export default interface Post {
isApproved(): boolean;
canApprove(): boolean;
}
}
1 change: 1 addition & 0 deletions extensions/likes/js/src/@types/shims.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ declare module 'flarum/common/models/Post' {
export default interface Post {
likes(): User[];
likesCount(): number;
canLike(): boolean;
}
}
6 changes: 6 additions & 0 deletions extensions/lock/js/src/@types/shims.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module 'flarum/common/models/Discussion' {
export default interface Discussion {
isLocked(): boolean;
canLock(): boolean;
}
}
5 changes: 5 additions & 0 deletions extensions/nicknames/js/src/@types/shims.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'flarum/common/models/User' {
export default interface User {
canEditNickname(): boolean;
}
}
6 changes: 6 additions & 0 deletions extensions/sticky/js/src/@types/shims.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module 'flarum/common/models/Discussion' {
export default interface Discussion {
isSticky(): boolean;
canSticky(): boolean;
}
}
8 changes: 8 additions & 0 deletions extensions/suspend/js/src/@types/shims.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
declare module 'flarum/common/models/User' {
export default interface User {
canSuspend(): boolean;
suspendedUntil(): Date | string | null | undefined;
suspendReason(): string | null | undefined;
suspendMessage(): string | null | undefined;
}
}