-
-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.x] [extensibility] Add (some) missing shims (#4027)
* chore: add some missing shims * chore: remove unused import
- Loading branch information
1 parent
ed72aa0
commit 88f182c
Showing
6 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import Post from 'flarum/common/models/Post'; | ||
import User from 'flarum/common/models/User'; | ||
|
||
declare module 'flarum/common/models/Post' { | ||
export default interface Post { | ||
likes(): User[]; | ||
likesCount(): number; | ||
canLike(): boolean; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |