Skip to content

Commit

Permalink
Bundled output for commit 515840f
Browse files Browse the repository at this point in the history
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
  • Loading branch information
flarum-bot committed Oct 22, 2024
1 parent 515840f commit c2db9fa
Show file tree
Hide file tree
Showing 50 changed files with 778 additions and 2 deletions.
7 changes: 7 additions & 0 deletions js/dist-typings/@types/shims.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type Poll from '../forum/models/Poll';

declare module 'flarum/common/models/Post' {
export default interface Post {
polls: () => Poll[];
}
}
10 changes: 10 additions & 0 deletions js/dist-typings/admin/components/PollsSettingsPage.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import ExtensionPage from 'flarum/admin/components/ExtensionPage';
import ItemList from 'flarum/common/utils/ItemList';
import Mithril from 'mithril';
export default class PollsSettingsPage extends ExtensionPage {
content(): JSX.Element;
settingsItems(): ItemList<Mithril.Children>;
generalItems(): ItemList<Mithril.Children>;
globalPollsItems(): ItemList<Mithril.Children>;
imageItems(): ItemList<Mithril.Children>;
}
4 changes: 4 additions & 0 deletions js/dist-typings/admin/components/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import PollsSettingsPage from './PollsSettingsPage';
export declare const components: {
PollsSettingsPage: typeof PollsSettingsPage;
};
1 change: 1 addition & 0 deletions js/dist-typings/admin/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './components';
3 changes: 3 additions & 0 deletions js/dist-typings/forum/addComposerItems.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export declare const addToComposer: (composer: ComponentClass) => void;
declare const _default: () => void;
export default _default;
2 changes: 2 additions & 0 deletions js/dist-typings/forum/addDiscussionBadge.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const _default: () => void;
export default _default;
1 change: 1 addition & 0 deletions js/dist-typings/forum/addNavItem.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default function addNavItem(): void;
2 changes: 2 additions & 0 deletions js/dist-typings/forum/addPollsToPost.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const _default: () => void;
export default _default;
2 changes: 2 additions & 0 deletions js/dist-typings/forum/addPostControls.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const _default: () => void;
export default _default;
19 changes: 19 additions & 0 deletions js/dist-typings/forum/components/AbstractPollPage.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Page, { IPageAttrs } from 'flarum/common/components/Page';
import PollListState from '../states/PollListState';
import Poll from '../models/Poll';
import ItemList from 'flarum/common/utils/ItemList';
import type Mithril from 'mithril';
export declare abstract class AbstractPollPage extends Page<IPageAttrs, PollListState> {
loading: boolean;
poll: Poll | null | undefined;
polls: Poll[];
view(): Mithril.Children;
pageContent(): ItemList<Mithril.Children>;
mainContent(): ItemList<Mithril.Children>;
content(): Mithril.Children;
contentItems(): ItemList<Mithril.Children>;
hero(): Mithril.Children;
sidebar(): Mithril.Children;
sidebarItems(): ItemList<Mithril.Children>;
navItems(): ItemList<Mithril.Children>;
}
13 changes: 13 additions & 0 deletions js/dist-typings/forum/components/ComposePollHero.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Mithril from 'mithril';
import Component, { ComponentAttrs } from 'flarum/common/Component';
import Poll from '../models/Poll';
import ItemList from 'flarum/common/utils/ItemList';
export interface ComposePollHeroAttrs extends ComponentAttrs {
poll: Poll;
}
export default class ComposePollHero extends Component<ComposePollHeroAttrs> {
poll: Poll;
oninit(vnode: Mithril.Vnode<ComposePollHeroAttrs>): void;
view(): Mithril.Children;
controlItems(): ItemList<Mithril.Children>;
}
15 changes: 15 additions & 0 deletions js/dist-typings/forum/components/ComposePollPage.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type Mithril from 'mithril';
import Page from 'flarum/common/components/Page';
import Poll from '../models/Poll';
import PollFormState from '../states/PollFormState';
import ItemList from 'flarum/common/utils/ItemList';
export default class ComposePollPage extends Page {
poll: Poll | null | undefined;
loading: boolean;
oninit(vnode: Mithril.Vnode): void;
loadEditingPoll(editId: string): Promise<Poll>;
view(): Mithril.Children;
onsubmit(data: Object, state: PollFormState): Promise<void>;
sidebarItems(): ItemList<Mithril.Children>;
navItems(): ItemList<Mithril.Children>;
}
15 changes: 15 additions & 0 deletions js/dist-typings/forum/components/CreatePollModal.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type Mithril from 'mithril';
import Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';
import PollModel from '../models/Poll';
import PollFormState from '../states/PollFormState';
interface CreatePollModalAttrs extends IInternalModalAttrs {
poll: PollModel;
onsubmit: (data: object) => Promise<void>;
}
export default class CreatePollModal extends Modal<CreatePollModalAttrs> {
title(): Mithril.Children;
className(): string;
content(): Mithril.Children;
onFormSubmit(data: object, state: PollFormState): Promise<void>;
}
export {};
7 changes: 7 additions & 0 deletions js/dist-typings/forum/components/EditPollModal.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type Mithril from 'mithril';
import CreatePollModal from './CreatePollModal';
import PollFormState from '../states/PollFormState';
export default class EditPollModal extends CreatePollModal {
title(): Mithril.Children;
onFormSubmit(data: object, state: PollFormState): Promise<void>;
}
19 changes: 19 additions & 0 deletions js/dist-typings/forum/components/ListVotersModal.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type Mithril from 'mithril';
import Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';
import PollModel from '../models/Poll';
import PollVote from '../models/PollVote';
import PollOption from '../models/PollOption';
interface ListVotersModalAttrs extends IInternalModalAttrs {
poll: PollModel;
onsubmit: (data: object) => Promise<void>;
}
export default class ListVotersModal extends Modal<ListVotersModalAttrs> {
oninit(vnode: Mithril.Vnode): void;
className(): string;
title(): Mithril.Children;
content(): Mithril.Children;
optionContent(opt: PollOption): Mithril.Children;
optionAnswer(opt: PollOption): string;
voteContent(vote: PollVote): Mithril.Children;
}
export {};
15 changes: 15 additions & 0 deletions js/dist-typings/forum/components/Poll/PollImage.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type Mithril from 'mithril';
import Component, { ComponentAttrs } from 'flarum/common/Component';
import Poll from 'src/forum/models/Poll';
import ItemList from 'flarum/common/utils/ItemList';
interface PollImageAttrs extends ComponentAttrs {
poll: Poll;
}
export default class PollImage extends Component<PollImageAttrs> {
imageUrl: string | null;
imageAlt: string | null;
oninit(vnode: Mithril.Vnode<PollImageAttrs, this>): void;
view(): Mithril.Children;
imageItems(): ItemList<Mithril.Children>;
}
export {};
12 changes: 12 additions & 0 deletions js/dist-typings/forum/components/Poll/PollList.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/// <reference types="mithril" />
import Component, { ComponentAttrs } from 'flarum/common/Component';
import PollListState from '../../states/PollListState';
export interface PollListAttrs extends ComponentAttrs {
state: PollListState;
}
/**
* The `PollList` component displays a list of polls.
*/
export default class PollList extends Component<PollListAttrs> {
view(): JSX.Element;
}
51 changes: 51 additions & 0 deletions js/dist-typings/forum/components/Poll/PollListItem.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import type Mithril from 'mithril';
import Component, { ComponentAttrs } from 'flarum/common/Component';
import type { PollListParams } from '../../states/PollListState';
import SubtreeRetainer from 'flarum/common/utils/SubtreeRetainer';
import Poll from '../../models/Poll';
import ItemList from 'flarum/common/utils/ItemList';
export interface IPollListItemAttrs extends ComponentAttrs {
poll: Poll;
params: PollListParams;
}
/**
* The `PollListItem` component shows a single poll in the
* poll list.
*/
export default class PollListItem<CustomAttrs extends IPollListItemAttrs = IPollListItemAttrs> extends Component<CustomAttrs> {
/**
* Ensures that the poll will not be redrawn
* unless new data comes in.
*/
subtree: SubtreeRetainer;
poll: Poll;
highlightRegExp?: RegExp;
oninit(vnode: Mithril.Vnode<CustomAttrs, this>): void;
elementAttrs(): {
className: any;
};
view(): JSX.Element;
controlsView(controls: Mithril.ChildArray): Mithril.Children;
slidableUnderneathView(): Mithril.Children;
contentView(): Mithril.Children;
mainView(): Mithril.Children;
/**
* Allow extensions to revise the question string.
*/
pollQuestion(poll: Poll): string;
/**
* Allow extensions to revise the subtitle string.
*/
pollSubtitle(poll: Poll): string | null;
oncreate(vnode: Mithril.VnodeDOM<CustomAttrs, this>): void;
onbeforeupdate(vnode: Mithril.VnodeDOM<CustomAttrs, this>): boolean;
/**
* Determine whether or not the discussion is currently being viewed.
*/
active(): boolean;
/**
* Mark the poll as read.
*/
markAsRead(): void;
infoItems(): ItemList<Mithril.Children>;
}
35 changes: 35 additions & 0 deletions js/dist-typings/forum/components/Poll/PollOption.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import Mithril from 'mithril';
import Component, { ComponentAttrs } from 'flarum/common/Component';
import PollOptionModel from '../../models/PollOption';
import PollState from '../../states/PollState';
import Tooltip, { TooltipAttrs } from 'flarum/common/components/Tooltip';
import ItemList from 'flarum/common/utils/ItemList';
import Poll from '../../models/Poll';
interface PollOptionAttrs extends ComponentAttrs {
option: PollOptionModel;
name: string;
state: PollState;
}
export default class PollOption extends Component<PollOptionAttrs, PollState> {
option: PollOptionModel;
name: string;
state: PollState;
hasVoted: boolean;
totalVotes: number;
votes: number;
voted: boolean;
poll: Poll;
canSeeVoteCount: boolean;
answer: string;
oninit(vnode: Mithril.Vnode<PollOptionAttrs, PollState>): void;
percent(): number;
view(): Mithril.Children;
/**
* Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count
* caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available,
* called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job.
*/
hideOptionTooltip(vnode: Mithril.Vnode<TooltipAttrs, Tooltip>): void;
optionDisplayItems(): ItemList<Mithril.Children>;
}
export {};
16 changes: 16 additions & 0 deletions js/dist-typings/forum/components/Poll/PollOptions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type Mithril from 'mithril';
import Component, { ComponentAttrs } from 'flarum/common/Component';
import PollOptionModel from '../../models/PollOption';
import ItemList from 'flarum/common/utils/ItemList';
import PollState from '../../states/PollState';
interface PollOptionsAttrs extends ComponentAttrs {
options: PollOptionModel[];
name: String;
state: PollState;
}
export default class PollOptions extends Component<PollOptionsAttrs> {
view(): Mithril.Children;
pollOptions(): ItemList<Mithril.Children>;
createOptionView(option: PollOptionModel): Mithril.Children;
}
export {};
14 changes: 14 additions & 0 deletions js/dist-typings/forum/components/Poll/PollSubmitButton.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type Mithril from 'mithril';
import Component, { ComponentAttrs } from 'flarum/common/Component';
import PollState from '../../states/PollState';
interface PollSubmitButtonAttrs extends ComponentAttrs {
state: PollState;
}
export default class PollSubmitButton extends Component<PollSubmitButtonAttrs> {
view(): Mithril.Children;
/**
* Event handler for submit button being clicked
*/
pollButtonSubmit(state: PollState, event: Event): void;
}
export {};
11 changes: 11 additions & 0 deletions js/dist-typings/forum/components/Poll/PollSubtitle.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Component, { ComponentAttrs } from 'flarum/common/Component';
import ItemList from 'flarum/common/utils/ItemList';
import Poll from 'src/forum/models/Poll';
import Mithril from 'mithril';
export interface PollSubtitleAttrs extends ComponentAttrs {
poll: Poll;
}
export default class PollSubtitle extends Component<PollSubtitleAttrs> {
view(): JSX.Element | undefined;
pollSubtitleItems(): ItemList<Mithril.Children>;
}
11 changes: 11 additions & 0 deletions js/dist-typings/forum/components/Poll/PollTitle.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Component, { ComponentAttrs } from 'flarum/common/Component';
import ItemList from 'flarum/common/utils/ItemList';
import Poll from 'src/forum/models/Poll';
import Mithril from 'mithril';
export interface PollTitleAttrs extends ComponentAttrs {
poll: Poll;
}
export default class PollTitle extends Component<PollTitleAttrs> {
view(): JSX.Element;
pollTitleItems(): ItemList<Mithril.Children>;
}
42 changes: 42 additions & 0 deletions js/dist-typings/forum/components/PollForm.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import Component, { ComponentAttrs } from 'flarum/common/Component';
import Mithril from 'mithril';
import ItemList from 'flarum/common/utils/ItemList';
import Stream from 'flarum/common/utils/Stream';
import PollFormState from '../states/PollFormState';
import PollModel from '../models/Poll';
import PollOption from '../models/PollOption';
interface PollFormAttrs extends ComponentAttrs {
poll: PollModel;
onsubmit: (data: object, state: PollFormState) => Promise<void>;
}
export default class PollForm extends Component<PollFormAttrs, PollFormState> {
protected options: PollOption[];
protected optionAnswers: Stream<string>[];
protected optionImageUrls: Stream<string>[];
protected question: Stream<string>;
protected subtitle: Stream<string>;
protected image: Stream<string | null>;
protected imageAlt: Stream<string | null>;
protected endDate: Stream<string | null>;
protected publicPoll: Stream<boolean>;
protected allowMultipleVotes: Stream<boolean>;
protected hideVotes: Stream<boolean>;
protected allowChangeVote: Stream<boolean>;
protected maxVotes: Stream<number>;
protected datepickerMinDate: string;
oninit(vnode: Mithril.Vnode): void;
view(): Mithril.Children;
fields(): ItemList<Mithril.Children>;
displayOptions(): ItemList<Mithril.Children>;
addOption(): void;
removeOption(i: number): void;
data(): object;
onsubmit(event: Event): Promise<void>;
delete(): Promise<void>;
formatDate(date?: Date | string | false | undefined | null, def?: Date | false): string | false;
dateToTimestamp(date: Date | false): string | null;
pollImageUploadSuccess(fileName: string | null | undefined): void;
pollOptionImageUploadSuccess(index: number, fileName: string | null | undefined): void;
uploadConditional(hasImage: boolean, isUpload: boolean, ifCanUpload: JSX.Element, uploadButton: JSX.Element, imageUrlInput: JSX.Element): JSX.Element;
}
export {};
19 changes: 19 additions & 0 deletions js/dist-typings/forum/components/PollPageHero.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/// <reference types="flarum/@types/translator-icu-rich" />
import Component, { ComponentAttrs } from 'flarum/common/Component';
import ItemList from 'flarum/common/utils/ItemList';
import type Mithril from 'mithril';
interface PollPageHeroAttrs extends ComponentAttrs {
icon?: string;
title?: string;
}
export default class PollPageHero extends Component<PollPageHeroAttrs> {
oninit(vnode: Mithril.Vnode): void;
get classNames(): string;
get wrapperClasses(): string;
oncreate(vnode: Mithril.Vnode): void;
get title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
get icon(): string;
view(): JSX.Element;
items(): ItemList<unknown>;
}
export {};
13 changes: 13 additions & 0 deletions js/dist-typings/forum/components/PollShowcase.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Component, { ComponentAttrs } from 'flarum/common/Component';
import PollListState from '../states/PollListState';
import type Mithril from 'mithril';
import ItemList from 'flarum/common/utils/ItemList';
export interface PollListAttrs extends ComponentAttrs {
state: PollListState;
}
export default class PollShowcase extends Component<PollListAttrs, PollListState> {
oninit(vnode: Mithril.Vnode): void;
view(): Mithril.Children;
showcaseItems(): ItemList<Mithril.Children>;
endedItems(): ItemList<Mithril.Children>;
}
11 changes: 11 additions & 0 deletions js/dist-typings/forum/components/PollShowcaseItem.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Component, { ComponentAttrs } from 'flarum/common/Component';
import Poll from '../models/Poll';
import type Mithril from 'mithril';
export interface PollShowcaseItemAttrs extends ComponentAttrs {
poll: Poll;
}
export default class PollShowcaseItem extends Component<PollShowcaseItemAttrs> {
poll: Poll;
oninit(vnode: Mithril.Vnode): void;
view(): JSX.Element;
}
Loading

0 comments on commit c2db9fa

Please sign in to comment.