-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci]
- Loading branch information
1 parent
67759e6
commit ef8e540
Showing
38 changed files
with
237 additions
and
2 deletions.
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,37 @@ | ||
import 'flarum/common/models/Discussion'; | ||
import 'flarum/common/models/Post'; | ||
import 'flarum/common/models/User'; | ||
|
||
import Rank from '../common/models/Rank'; | ||
import type User from 'flarum/common/models/User'; | ||
|
||
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(): User[]; | ||
downvotes(): User[]; | ||
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; | ||
} | ||
} |
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,13 @@ | ||
/// <reference types="mithril" /> | ||
import Component from 'flarum/common/Component'; | ||
interface GroupSettingsAttrs { | ||
value: string; | ||
onchange: (value: string) => void; | ||
} | ||
export default class GroupSettings extends Component<GroupSettingsAttrs> { | ||
newGroupId: any; | ||
newMinPoints: any; | ||
newMaxPoints: any; | ||
view(): JSX.Element; | ||
} | ||
export {}; |
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,42 @@ | ||
export default class SettingsPage extends ExtensionPage<import("flarum/admin/components/ExtensionPage").ExtensionPageAttrs> { | ||
constructor(); | ||
oninit(vnode: any): void; | ||
fields: string[] | undefined; | ||
switches: string[] | undefined; | ||
ranks: import("flarum/common/Model").default[] | undefined; | ||
values: {} | undefined; | ||
settingsPrefix: string | undefined; | ||
newRank: { | ||
points: any; | ||
name: any; | ||
color: any; | ||
} | undefined; | ||
/** | ||
* @returns {*} | ||
*/ | ||
content(): any; | ||
updateName(rank: any, value: any): void; | ||
updatePoints(rank: any, value: any): void; | ||
updateColor(rank: any, value: any): void; | ||
deleteRank(rankToDelete: any): void; | ||
addRank(): void; | ||
/** | ||
* | ||
* @returns boolean | ||
*/ | ||
changed(): boolean; | ||
prepareSubmissionData(): {}; | ||
/** | ||
* @param e | ||
*/ | ||
onsubmit(e: any): void; | ||
/** | ||
* @returns string | ||
*/ | ||
addPrefix(key: any): string; | ||
settingsItems(): ItemList<any>; | ||
voteItems(): ItemList<any>; | ||
rankingsItems(): ItemList<any>; | ||
} | ||
import ExtensionPage from "flarum/admin/components/ExtensionPage"; | ||
import ItemList from "flarum/common/utils/ItemList"; |
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,3 @@ | ||
export default class UploadImageButton extends FlarumUploadImageButton { | ||
} | ||
import FlarumUploadImageButton from "flarum/admin/components/UploadImageButton"; |
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 @@ | ||
export namespace components { | ||
export { SettingsPage }; | ||
export { UploadImageButton }; | ||
} | ||
import SettingsPage from "./SettingsPage"; | ||
import UploadImageButton from "./UploadImageButton"; |
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,2 @@ | ||
declare const _default: import("flarum/common/extenders/Store").default[]; | ||
export default _default; |
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,3 @@ | ||
export { default as extend } from './extend'; | ||
export * from '../common/helpers'; | ||
export * from './components'; |
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,2 @@ | ||
declare const _default: import("flarum/common/extenders/Store").default[]; | ||
export default _default; |
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,4 @@ | ||
export namespace helpers { | ||
export { rankLabel }; | ||
} | ||
import rankLabel from "./rankLabel"; |
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 @@ | ||
export default function rankLabel(rank: any, attrs?: {}): any; |
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 @@ | ||
export * from './models'; |
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 @@ | ||
import Model from 'flarum/common/Model'; | ||
export default class Rank extends Model { | ||
points(): number; | ||
name(): string; | ||
color(): string; | ||
} |
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,4 @@ | ||
import Rank from './Rank'; | ||
export declare const models: { | ||
Rank: typeof Rank; | ||
}; |
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 @@ | ||
export default function addAlternateLayout(): void; |
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 @@ | ||
export default function _default(): void; |
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 @@ | ||
export default function addNotifications(): void; |
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,2 @@ | ||
declare function _default(): void; | ||
export default _default; |
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 @@ | ||
export default function addUpvoteTabToUserProfile(): void; |
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 @@ | ||
export default function _default(): void; |
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 @@ | ||
export default function _default(): void; |
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 @@ | ||
export default function _default(): void; |
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,4 @@ | ||
/** | ||
* Adds our custom {@link Voters} component to the discussion sidebar. | ||
*/ | ||
export default function addVotersToDiscussionPageSideBar(): void; |
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 @@ | ||
export default function _default(): void; |
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 @@ | ||
/// <reference types="mithril" /> | ||
import Component, { ComponentAttrs } from 'flarum/common/Component'; | ||
export interface RankingImageAttrs extends ComponentAttrs { | ||
place: number; | ||
} | ||
export default class RankingImage extends Component<RankingImageAttrs> { | ||
view(): JSX.Element; | ||
} |
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,16 @@ | ||
/** | ||
* This page re-uses Flarum's IndexPage CSS classes | ||
*/ | ||
export default class RankingsPage extends Page<import("flarum/common/components/Page").IPageAttrs, undefined> { | ||
constructor(); | ||
oninit(vnode: any): void; | ||
loading: boolean | undefined; | ||
users: any[] | undefined; | ||
view(): JSX.Element; | ||
refresh(clear?: boolean): Promise<void>; | ||
addOrdinalSuffix(i: any): any; | ||
loadResults(offset: any): Promise<import("flarum/common/Store").ApiResponseSingle<import("flarum/common/Model").default>>; | ||
loadMore(): void; | ||
parseResults(results: any): any; | ||
} | ||
import Page from "flarum/common/components/Page"; |
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 @@ | ||
/// <reference types="flarum/@types/translator-icu-rich" /> | ||
export default class UpvotedNotification extends Notification<import("flarum/forum/components/Notification").INotificationAttrs> { | ||
constructor(); | ||
content(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray; | ||
} | ||
import Notification from "flarum/forum/components/Notification"; |
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,17 @@ | ||
import Component, { ComponentAttrs } from 'flarum/common/Component'; | ||
import SubtreeRetainer from 'flarum/common/utils/SubtreeRetainer'; | ||
import type Mithril from 'mithril'; | ||
import type Post from 'flarum/common/models/Post'; | ||
export interface VotersAttrs extends ComponentAttrs { | ||
post: Post; | ||
} | ||
export default class Voters extends Component<VotersAttrs> { | ||
subtreeRetainer: SubtreeRetainer; | ||
lastRenderVotes: number; | ||
loading: boolean; | ||
oninit(vnode: Mithril.Vnode): void; | ||
onbeforeupdate(vnode: Mithril.Vnode): boolean; | ||
onupdate(): void; | ||
view(): JSX.Element; | ||
load(): Promise<void>; | ||
} |
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,9 @@ | ||
/// <reference types="flarum/@types/translator-icu-rich" /> | ||
export default class VotesModal extends Modal<import("flarum/common/components/Modal").IInternalModalAttrs, undefined> { | ||
constructor(); | ||
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray; | ||
oninit(vnode: any): void; | ||
content(): JSX.Element; | ||
load(): Promise<void>; | ||
} | ||
import Modal from "flarum/common/components/Modal"; |
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,14 @@ | ||
import PostsUserPage from 'flarum/forum/components/PostsUserPage'; | ||
import type Post from 'flarum/common/models/Post'; | ||
/** | ||
* The `VotesUserPage` component shows posts which user voted on. | ||
*/ | ||
export default class VotesUserPage extends PostsUserPage { | ||
/** | ||
* Load a new page of the user's activity feed. | ||
* | ||
* @param offset The position to start getting results from. | ||
* @protected | ||
*/ | ||
loadResults(offset: number): Promise<import("flarum/common/Store").ApiResponsePlural<Post>>; | ||
} |
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 @@ | ||
import RankingsPage from './RankingsPage'; | ||
import VoteNotification from './VoteNotification'; | ||
import VotesModal from './VotesModal'; | ||
import Voters from './Voters'; | ||
import RankingImage from './RankingImage'; | ||
export declare const components: { | ||
RankingImage: typeof RankingImage; | ||
RankingsPage: typeof RankingsPage; | ||
VoteNotification: typeof VoteNotification; | ||
VotesModal: typeof VotesModal; | ||
Voters: typeof Voters; | ||
}; |
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,2 @@ | ||
declare const _default: (import("flarum/common/extenders/Store").default | import("flarum/common/extenders/Routes").default | import("flarum/common/extenders/Model").default)[]; | ||
export default _default; |
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 @@ | ||
export const helpers: { | ||
rankLabel: typeof import("../../common/helpers/rankLabel").default; | ||
saveVote: (post: any, upvoted: any, downvoted: any, load: any, discussion?: any) => any; | ||
setting: (key: any, isBool?: boolean) => unknown; | ||
}; |
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,2 @@ | ||
declare function _default(post: any, upvoted: any, downvoted: any, load: any, discussion?: any): any; | ||
export default _default; |
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,2 @@ | ||
declare function _default(key: any, isBool?: boolean): unknown; | ||
export default _default; |
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,3 @@ | ||
export { default as extend } from './extend'; | ||
export * from './components'; | ||
export * from './helpers'; |
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 @@ | ||
export default function useAlternatePostVoteLayout(): void; |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.