1
0
mirror of https://github.com/flarum/core.git synced 2025-08-09 18:07:02 +02:00

Bundled output for commit 3537f76eab

Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
This commit is contained in:
flarum-bot
2021-05-12 23:29:46 +00:00
parent 3537f76eab
commit c3a684c7ed
213 changed files with 6462 additions and 30 deletions

View File

@@ -0,0 +1,4 @@
export default class AdminHeader extends Component<import("../../common/Component").ComponentAttrs> {
constructor();
}
import Component from "../../common/Component";

View File

@@ -0,0 +1,15 @@
export default class AdminNav extends Component<import("../../common/Component").ComponentAttrs> {
constructor();
query: Stream<string> | undefined;
scrollToActive(): void;
/**
* Build an item list of main links to show in the admin navigation.
*
* @return {ItemList}
*/
items(): ItemList;
extensionItems(): ItemList;
}
import Component from "../../common/Component";
import Stream from "../../common/utils/Stream";
import ItemList from "../../common/utils/ItemList";

View File

@@ -0,0 +1,55 @@
export default class AdminPage extends Page {
settings: {} | undefined;
loading: boolean | undefined;
content(): string;
submitButton(): JSX.Element;
header(): JSX.Element;
headerInfo(): {
className: string;
icon: string;
title: string;
description: string;
};
/**
* buildSettingComponent takes a settings object and turns it into a component.
* Depending on the type of input, you can set the type to 'bool', 'select', or
* any standard <input> type. Any values inside the 'extra' object will be added
* to the component as an attribute.
*
* Alternatively, you can pass a callback that will be executed in ExtensionPage's
* context to include custom JSX elements.
*
* @example
*
* {
* setting: 'acme.checkbox',
* label: app.translator.trans('acme.admin.setting_label'),
* type: 'bool',
* help: app.translator.trans('acme.admin.setting_help'),
* className: 'Setting-item'
* }
*
* @example
*
* {
* setting: 'acme.select',
* label: app.translator.trans('acme.admin.setting_label'),
* type: 'select',
* options: {
* 'option1': 'Option 1 label',
* 'option2': 'Option 2 label',
* },
* default: 'option1',
* }
*
* @param setting
* @returns {JSX.Element}
*/
buildSettingComponent(entry: any): JSX.Element;
onsaved(): void;
setting(key: any, fallback?: string): any;
dirty(): {};
isChanged(): number;
saveSettings(e: any): Promise<void>;
}
import Page from "../../common/components/Page";

View File

@@ -0,0 +1,3 @@
export default class AppearancePage extends AdminPage {
}
import AdminPage from "./AdminPage";

View File

@@ -0,0 +1,15 @@
export default class BasicsPage extends AdminPage {
localeOptions: {} | undefined;
displayNameOptions: {} | undefined;
slugDriverOptions: {} | undefined;
/**
* Build a list of options for the default homepage. Each option must be an
* object with `path` and `label` properties.
*
* @return {ItemList}
* @public
*/
public homePageItems(): ItemList;
}
import AdminPage from "./AdminPage";
import ItemList from "../../common/utils/ItemList";

View File

@@ -0,0 +1,5 @@
export default class DashboardPage extends AdminPage {
availableWidgets(): ItemList;
}
import AdminPage from "./AdminPage";
import ItemList from "../../common/utils/ItemList";

View File

@@ -0,0 +1,16 @@
export default class DashboardWidget extends Component<import("../../common/Component").ComponentAttrs> {
constructor();
/**
* Get the class name to apply to the widget.
*
* @return {String}
*/
className(): string;
/**
* Get the content of the widget.
*
* @return {VirtualElement}
*/
content(): any;
}
import Component from "../../common/Component";

View File

@@ -0,0 +1,3 @@
export default class EditCustomCssModal extends SettingsModal {
}
import SettingsModal from "./SettingsModal";

View File

@@ -0,0 +1,3 @@
export default class EditCustomFooterModal extends SettingsModal {
}
import SettingsModal from "./SettingsModal";

View File

@@ -0,0 +1,3 @@
export default class EditCustomHeaderModal extends SettingsModal {
}
import SettingsModal from "./SettingsModal";

View File

@@ -0,0 +1,24 @@
/**
* The `EditGroupModal` component shows a modal dialog which allows the user
* to create or edit a group.
*/
export default class EditGroupModal extends Modal {
group: any;
nameSingular: Stream<any> | undefined;
namePlural: Stream<any> | undefined;
icon: Stream<any> | undefined;
color: Stream<any> | undefined;
isHidden: Stream<any> | undefined;
fields(): ItemList;
submitData(): {
nameSingular: any;
namePlural: any;
color: any;
icon: any;
isHidden: any;
};
deleteGroup(): void;
}
import Modal from "../../common/components/Modal";
import Stream from "../../common/utils/Stream";
import ItemList from "../../common/utils/ItemList";

View File

@@ -0,0 +1,5 @@
export default class ExtensionLinkButton extends LinkButton {
statusItems(name: any): ItemList;
}
import LinkButton from "../../common/components/LinkButton";
import ItemList from "../../common/utils/ItemList";

View File

@@ -0,0 +1,21 @@
export default class ExtensionPage extends AdminPage {
extension: any;
changingState: boolean | undefined;
infoFields: {
discuss: string;
documentation: string;
support: string;
website: string;
donate: string;
source: string;
} | undefined;
className(): string;
sections(): ItemList;
topItems(): ItemList;
infoItems(): ItemList;
toggle(): void;
isEnabled(): any;
onerror(e: any): void;
}
import AdminPage from "./AdminPage";
import ItemList from "../../common/utils/ItemList";

View File

@@ -0,0 +1,4 @@
export default class ExtensionPermissionGrid extends PermissionGrid {
extensionId: any;
}
import PermissionGrid from "./PermissionGrid";

View File

@@ -0,0 +1,6 @@
export default class ExtensionsWidget extends DashboardWidget {
categorizedExtensions: {} | undefined;
extensionCategory(category: any): JSX.Element;
extensionWidget(extension: any): JSX.Element;
}
import DashboardWidget from "./DashboardWidget";

View File

@@ -0,0 +1,16 @@
/**
* The `HeaderPrimary` component displays primary header controls. On the
* default skin, these are shown just to the right of the forum title.
*/
export default class HeaderPrimary extends Component<import("../../common/Component").ComponentAttrs> {
constructor();
config(isInitialized: any, context: any): void;
/**
* Build an item list for the controls.
*
* @return {ItemList}
*/
items(): ItemList;
}
import Component from "../../common/Component";
import ItemList from "../../common/utils/ItemList";

View File

@@ -0,0 +1,14 @@
/**
* The `HeaderSecondary` component displays secondary header controls.
*/
export default class HeaderSecondary extends Component<import("../../common/Component").ComponentAttrs> {
constructor();
/**
* Build an item list for the controls.
*
* @return {ItemList}
*/
items(): ItemList;
}
import Component from "../../common/Component";
import ItemList from "../../common/utils/ItemList";

View File

@@ -0,0 +1,3 @@
export default class LoadingModal extends Modal {
}
import Modal from "../../common/components/Modal";

View File

@@ -0,0 +1,12 @@
export default class MailPage extends AdminPage {
sendingTest: boolean | undefined;
refresh(): void;
status: {
sending: boolean;
errors: {};
} | undefined;
driverFields: any;
sendTestEmail(): void;
testEmailSuccessAlert: number | undefined;
}
import AdminPage from "./AdminPage";

View File

@@ -0,0 +1,6 @@
export default class PermissionDropdown extends Dropdown {
save(groupIds: any): void;
toggle(groupId: any): void;
isGroupDisabled(id: any): boolean;
}
import Dropdown from "../../common/components/Dropdown";

View File

@@ -0,0 +1,12 @@
export default class PermissionGrid extends Component<import("../../common/Component").ComponentAttrs> {
constructor();
permissionItems(): ItemList;
viewItems(): ItemList;
startItems(): ItemList;
replyItems(): ItemList;
moderateItems(): ItemList;
scopeItems(): ItemList;
scopeControlItems(): ItemList;
}
import Component from "../../common/Component";
import ItemList from "../../common/utils/ItemList";

View File

@@ -0,0 +1,3 @@
export default class PermissionsPage extends AdminPage {
}
import AdminPage from "./AdminPage";

View File

@@ -0,0 +1,14 @@
/**
* The `SessionDropdown` component shows a button with the current user's
* avatar/name, with a dropdown of session controls.
*/
export default class SessionDropdown extends Dropdown {
/**
* Build an item list for the contents of the dropdown menu.
*
* @return {ItemList}
*/
items(): ItemList;
}
import Dropdown from "../../common/components/Dropdown";
import ItemList from "../../common/utils/ItemList";

View File

@@ -0,0 +1,3 @@
export default class SettingDropdown extends SelectDropdown {
}
import SelectDropdown from "../../common/components/SelectDropdown";

View File

@@ -0,0 +1,10 @@
export default class SettingsModal extends Modal {
settings: {} | undefined;
form(): string;
submitButton(): JSX.Element;
setting(key: any, fallback?: string): any;
dirty(): {};
changed(): number;
onsaved(): void;
}
import Modal from "../../common/components/Modal";

View File

@@ -0,0 +1,6 @@
export default class StatusWidget extends DashboardWidget {
items(): ItemList;
handleClearCache(e: any): void;
}
import DashboardWidget from "./DashboardWidget";
import ItemList from "../../common/utils/ItemList";

View File

@@ -0,0 +1,27 @@
export default class UploadImageButton extends Button {
loading: boolean;
/**
* Prompt the user to upload an image.
*/
upload(): void;
/**
* Remove the logo.
*/
remove(): void;
resourceUrl(): string;
/**
* After a successful upload/removal, reload the page.
*
* @param {Object} response
* @protected
*/
protected success(response: Object): void;
/**
* If upload/removal fails, stop loading.
*
* @param {Object} response
* @protected
*/
protected failure(response: Object): void;
}
import Button from "../../common/components/Button";

View File

@@ -0,0 +1,72 @@
/// <reference types="mithril" />
import ItemList from '../../common/utils/ItemList';
import AdminPage from './AdminPage';
/**
* Admin page which displays a paginated list of all users on the forum.
*/
export default class UserListPage extends AdminPage {
/**
* Number of users to load per page.
*/
private numPerPage;
/**
* Current page number. Zero-indexed.
*/
private pageNumber;
/**
* Total number of forum users.
*
* Fetched from the active `AdminApplication` (`app`), with
* data provided by `AdminPayload.php`, or `flarum/statistics`
* if installed.
*/
readonly userCount: number;
/**
* Get total number of user pages.
*/
private getTotalPageCount;
/**
* This page's array of users.
*
* `undefined` when page loads as no data has been fetched.
*/
private pageData;
/**
* Are there more users available?
*/
private moreData;
private isLoadingPage;
/**
* Component to render.
*/
content(): JSX.Element[];
/**
* Build an item list of columns to show for each user.
*
* Each column in the list should be an object with keys `name` and `content`.
*
* `name` is a string that will be used as the column name.
* `content` is a function with the User model passed as the first and only argument.
*
* See `UserListPage.tsx` for examples.
*/
columns(): ItemList;
headerInfo(): {
className: string;
icon: string;
title: any;
description: any;
};
/**
* Asynchronously fetch the next set of users to be rendered.
*
* Returns an array of Users, plus the raw API payload.
*
* Uses the `this.numPerPage` as the response limit, and automatically calculates the offset required from `pageNumber`.
*
* @param pageNumber The page number to load and display
*/
loadPage(pageNumber: number): Promise<void>;
nextPage(): void;
previousPage(): void;
}