mirror of
https://github.com/flarum/core.git
synced 2025-08-02 22:47:33 +02:00
chore: revert tsconfig changes for local development (#3545)
* chore: delete unwanted dist typings
* chore: revert 4e52f0e420
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
This commit is contained in:
1
extensions/akismet/js/dist-typings/extensions/akismet/js/src/admin/index.d.ts
generated
vendored
1
extensions/akismet/js/dist-typings/extensions/akismet/js/src/admin/index.d.ts
generated
vendored
@@ -1 +0,0 @@
|
|||||||
export {};
|
|
1
extensions/akismet/js/dist-typings/extensions/akismet/js/src/forum/index.d.ts
generated
vendored
1
extensions/akismet/js/dist-typings/extensions/akismet/js/src/forum/index.d.ts
generated
vendored
@@ -1 +0,0 @@
|
|||||||
export {};
|
|
11
extensions/akismet/js/dist-typings/extensions/flags/js/src/forum/models/Flag.d.ts
generated
vendored
11
extensions/akismet/js/dist-typings/extensions/flags/js/src/forum/models/Flag.d.ts
generated
vendored
@@ -1,11 +0,0 @@
|
|||||||
import Model from 'flarum/common/Model';
|
|
||||||
import type Post from 'flarum/common/models/Post';
|
|
||||||
import type User from 'flarum/common/models/User';
|
|
||||||
export default class Flag extends Model {
|
|
||||||
type(): string;
|
|
||||||
reason(): string | null;
|
|
||||||
reasonDetail(): string | null;
|
|
||||||
createdAt(): Date | null | undefined;
|
|
||||||
post(): false | Post;
|
|
||||||
user(): false | User | null;
|
|
||||||
}
|
|
@@ -1,16 +0,0 @@
|
|||||||
export default class FlagListState {
|
|
||||||
constructor(app: any);
|
|
||||||
app: any;
|
|
||||||
/**
|
|
||||||
* Whether or not the flags are loading.
|
|
||||||
*
|
|
||||||
* @type {Boolean}
|
|
||||||
*/
|
|
||||||
loading: boolean;
|
|
||||||
/**
|
|
||||||
* Load flags into the application's cache if they haven't already
|
|
||||||
* been loaded.
|
|
||||||
*/
|
|
||||||
load(): void;
|
|
||||||
cache: any;
|
|
||||||
}
|
|
60
extensions/akismet/js/dist-typings/framework/core/js/src/admin/AdminApplication.d.ts
generated
vendored
60
extensions/akismet/js/dist-typings/framework/core/js/src/admin/AdminApplication.d.ts
generated
vendored
@@ -1,60 +0,0 @@
|
|||||||
import { AdminRoutes } from './routes';
|
|
||||||
import Application, { ApplicationData } from '../common/Application';
|
|
||||||
import ExtensionData from './utils/ExtensionData';
|
|
||||||
import IHistory from '../common/IHistory';
|
|
||||||
export declare type Extension = {
|
|
||||||
id: string;
|
|
||||||
version: string;
|
|
||||||
description?: string;
|
|
||||||
icon?: {
|
|
||||||
name: string;
|
|
||||||
};
|
|
||||||
links: {
|
|
||||||
authors?: {
|
|
||||||
name?: string;
|
|
||||||
link?: string;
|
|
||||||
}[];
|
|
||||||
discuss?: string;
|
|
||||||
documentation?: string;
|
|
||||||
support?: string;
|
|
||||||
website?: string;
|
|
||||||
donate?: string;
|
|
||||||
source?: string;
|
|
||||||
};
|
|
||||||
extra: {
|
|
||||||
'flarum-extension': {
|
|
||||||
title: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
export interface AdminApplicationData extends ApplicationData {
|
|
||||||
extensions: Record<string, Extension>;
|
|
||||||
settings: Record<string, string>;
|
|
||||||
modelStatistics: Record<string, {
|
|
||||||
total: number;
|
|
||||||
}>;
|
|
||||||
}
|
|
||||||
export default class AdminApplication extends Application {
|
|
||||||
extensionData: ExtensionData;
|
|
||||||
extensionCategories: {
|
|
||||||
feature: number;
|
|
||||||
theme: number;
|
|
||||||
language: number;
|
|
||||||
};
|
|
||||||
history: IHistory;
|
|
||||||
/**
|
|
||||||
* Settings are serialized to the admin dashboard as strings.
|
|
||||||
* Additional encoding/decoding is possible, but must take
|
|
||||||
* place on the client side.
|
|
||||||
*
|
|
||||||
* @inheritdoc
|
|
||||||
*/
|
|
||||||
data: AdminApplicationData;
|
|
||||||
route: typeof Application.prototype.route & AdminRoutes;
|
|
||||||
constructor();
|
|
||||||
/**
|
|
||||||
* @inheritdoc
|
|
||||||
*/
|
|
||||||
mount(): void;
|
|
||||||
getRequiredPermissions(permission: string): string[];
|
|
||||||
}
|
|
3
extensions/akismet/js/dist-typings/framework/core/js/src/admin/app.d.ts
generated
vendored
3
extensions/akismet/js/dist-typings/framework/core/js/src/admin/app.d.ts
generated
vendored
@@ -1,3 +0,0 @@
|
|||||||
import Admin from './AdminApplication';
|
|
||||||
declare const app: Admin;
|
|
||||||
export default app;
|
|
165
extensions/akismet/js/dist-typings/framework/core/js/src/admin/compat.d.ts
generated
vendored
165
extensions/akismet/js/dist-typings/framework/core/js/src/admin/compat.d.ts
generated
vendored
@@ -1,165 +0,0 @@
|
|||||||
import saveSettings from './utils/saveSettings';
|
|
||||||
import ExtensionData from './utils/ExtensionData';
|
|
||||||
import isExtensionEnabled from './utils/isExtensionEnabled';
|
|
||||||
import getCategorizedExtensions from './utils/getCategorizedExtensions';
|
|
||||||
import SettingDropdown from './components/SettingDropdown';
|
|
||||||
import EditCustomFooterModal from './components/EditCustomFooterModal';
|
|
||||||
import SessionDropdown from './components/SessionDropdown';
|
|
||||||
import HeaderPrimary from './components/HeaderPrimary';
|
|
||||||
import AdminPage from './components/AdminPage';
|
|
||||||
import AppearancePage from './components/AppearancePage';
|
|
||||||
import StatusWidget from './components/StatusWidget';
|
|
||||||
import ExtensionsWidget from './components/ExtensionsWidget';
|
|
||||||
import HeaderSecondary from './components/HeaderSecondary';
|
|
||||||
import SettingsModal from './components/SettingsModal';
|
|
||||||
import DashboardWidget from './components/DashboardWidget';
|
|
||||||
import ExtensionPage from './components/ExtensionPage';
|
|
||||||
import ExtensionLinkButton from './components/ExtensionLinkButton';
|
|
||||||
import PermissionGrid from './components/PermissionGrid';
|
|
||||||
import ExtensionPermissionGrid from './components/ExtensionPermissionGrid';
|
|
||||||
import MailPage from './components/MailPage';
|
|
||||||
import UploadImageButton from './components/UploadImageButton';
|
|
||||||
import LoadingModal from './components/LoadingModal';
|
|
||||||
import DashboardPage from './components/DashboardPage';
|
|
||||||
import BasicsPage from './components/BasicsPage';
|
|
||||||
import UserListPage from './components/UserListPage';
|
|
||||||
import EditCustomHeaderModal from './components/EditCustomHeaderModal';
|
|
||||||
import PermissionsPage from './components/PermissionsPage';
|
|
||||||
import PermissionDropdown from './components/PermissionDropdown';
|
|
||||||
import AdminNav from './components/AdminNav';
|
|
||||||
import AdminHeader from './components/AdminHeader';
|
|
||||||
import EditCustomCssModal from './components/EditCustomCssModal';
|
|
||||||
import EditGroupModal from './components/EditGroupModal';
|
|
||||||
import routes from './routes';
|
|
||||||
import AdminApplication from './AdminApplication';
|
|
||||||
import generateElementId from './utils/generateElementId';
|
|
||||||
declare const _default: {
|
|
||||||
extend: any;
|
|
||||||
Session: typeof import("../common/Session").default;
|
|
||||||
Store: typeof import("../common/Store").default;
|
|
||||||
'utils/BasicEditorDriver': typeof import("../common/utils/BasicEditorDriver").default;
|
|
||||||
'utils/evented': {
|
|
||||||
handlers: Record<string, unknown>;
|
|
||||||
getHandlers(event: string): Function[];
|
|
||||||
trigger(event: string, ...args: any[]): void;
|
|
||||||
on(event: string, handler: Function): void;
|
|
||||||
one(event: string, handler: Function): void;
|
|
||||||
off(event: string, handler: Function): void;
|
|
||||||
};
|
|
||||||
'utils/liveHumanTimes': typeof import("../common/utils/liveHumanTimes").default;
|
|
||||||
'utils/ItemList': typeof import("../common/utils/ItemList").default;
|
|
||||||
'utils/mixin': typeof import("../common/utils/mixin").default;
|
|
||||||
'utils/humanTime': typeof import("../common/utils/humanTime").default;
|
|
||||||
'utils/computed': typeof import("../common/utils/computed").default;
|
|
||||||
'utils/insertText': typeof import("../common/utils/insertText").default;
|
|
||||||
'utils/styleSelectedText': typeof import("../common/utils/styleSelectedText").default;
|
|
||||||
'utils/Drawer': typeof import("../common/utils/Drawer").default;
|
|
||||||
'utils/anchorScroll': typeof import("../common/utils/anchorScroll").default;
|
|
||||||
'utils/RequestError': typeof import("../common/utils/RequestError").default;
|
|
||||||
'utils/abbreviateNumber': typeof import("../common/utils/abbreviateNumber").default;
|
|
||||||
'utils/string': typeof import("../common/utils/string");
|
|
||||||
'utils/SubtreeRetainer': typeof import("../common/utils/SubtreeRetainer").default;
|
|
||||||
'utils/escapeRegExp': typeof import("../common/utils/escapeRegExp").default;
|
|
||||||
'utils/extract': typeof import("../common/utils/extract").default;
|
|
||||||
'utils/ScrollListener': typeof import("../common/utils/ScrollListener").default;
|
|
||||||
'utils/stringToColor': typeof import("../common/utils/stringToColor").default;
|
|
||||||
'utils/Stream': typeof import("mithril/stream");
|
|
||||||
'utils/subclassOf': typeof import("../common/utils/subclassOf").default;
|
|
||||||
'utils/setRouteWithForcedRefresh': typeof import("../common/utils/setRouteWithForcedRefresh").default;
|
|
||||||
'utils/patchMithril': typeof import("../common/utils/patchMithril").default;
|
|
||||||
'utils/proxifyCompat': typeof import("../common/utils/proxifyCompat").default;
|
|
||||||
'utils/classList': (...classes: import("clsx").ClassValue[]) => string;
|
|
||||||
'utils/extractText': typeof import("../common/utils/extractText").default;
|
|
||||||
'utils/formatNumber': typeof import("../common/utils/formatNumber").default;
|
|
||||||
'utils/mapRoutes': typeof import("../common/utils/mapRoutes").default;
|
|
||||||
'utils/withAttr': (key: string, cb: Function) => (this: Element) => void;
|
|
||||||
'utils/throttleDebounce': typeof import("../common/utils/throttleDebounce");
|
|
||||||
'utils/isObject': typeof import("../common/utils/isObject").default;
|
|
||||||
'utils/focusTrap': typeof import("../common/utils/focusTrap");
|
|
||||||
'models/Notification': typeof import("../common/models/Notification").default;
|
|
||||||
'models/User': typeof import("../common/models/User").default;
|
|
||||||
'models/Post': typeof import("flarum/common/models/Post").default;
|
|
||||||
'models/Discussion': typeof import("../common/models/Discussion").default;
|
|
||||||
'models/Group': typeof import("../common/models/Group").default;
|
|
||||||
'models/Forum': typeof import("../common/models/Forum").default;
|
|
||||||
Component: typeof import("../common/Component").default;
|
|
||||||
Fragment: typeof import("../common/Fragment").default;
|
|
||||||
Translator: typeof import("../common/Translator").default;
|
|
||||||
'components/AlertManager': typeof import("../common/components/AlertManager").default;
|
|
||||||
'components/Page': typeof import("../common/components/Page").default;
|
|
||||||
'components/Switch': typeof import("../common/components/Switch").default;
|
|
||||||
'components/Badge': typeof import("../common/components/Badge").default;
|
|
||||||
'components/LoadingIndicator': typeof import("../common/components/LoadingIndicator").default;
|
|
||||||
'components/Placeholder': typeof import("../common/components/Placeholder").default;
|
|
||||||
'components/Separator': typeof import("../common/components/Separator").default;
|
|
||||||
'components/Dropdown': typeof import("../common/components/Dropdown").default;
|
|
||||||
'components/SplitDropdown': typeof import("../common/components/SplitDropdown").default;
|
|
||||||
'components/RequestErrorModal': typeof import("../common/components/RequestErrorModal").default;
|
|
||||||
'components/FieldSet': typeof import("../common/components/FieldSet").default;
|
|
||||||
'components/Select': typeof import("../common/components/Select").default;
|
|
||||||
'components/Navigation': typeof import("../common/components/Navigation").default;
|
|
||||||
'components/Alert': typeof import("../common/components/Alert").default;
|
|
||||||
'components/Link': typeof import("../common/components/Link").default;
|
|
||||||
'components/LinkButton': typeof import("../common/components/LinkButton").default;
|
|
||||||
'components/Checkbox': typeof import("../common/components/Checkbox").default;
|
|
||||||
'components/ColorPreviewInput': typeof import("../common/components/ColorPreviewInput").default;
|
|
||||||
'components/SelectDropdown': typeof import("../common/components/SelectDropdown").default;
|
|
||||||
'components/ModalManager': typeof import("../common/components/ModalManager").default;
|
|
||||||
'components/Button': typeof import("../common/components/Button").default;
|
|
||||||
'components/Modal': typeof import("../common/components/Modal").default;
|
|
||||||
'components/GroupBadge': typeof import("../common/components/GroupBadge").default;
|
|
||||||
'components/TextEditor': typeof import("../common/components/TextEditor").default;
|
|
||||||
'components/TextEditorButton': typeof import("../common/components/TextEditorButton").default;
|
|
||||||
'components/Tooltip': typeof import("../common/components/Tooltip").default;
|
|
||||||
'components/EditUserModal': typeof import("../common/components/EditUserModal").default;
|
|
||||||
Model: typeof import("../common/Model").default;
|
|
||||||
Application: typeof import("../common/Application").default;
|
|
||||||
'helpers/fullTime': typeof import("../common/helpers/fullTime").default;
|
|
||||||
'helpers/avatar': typeof import("../common/helpers/avatar").default;
|
|
||||||
'helpers/icon': typeof import("../common/helpers/icon").default;
|
|
||||||
'helpers/humanTime': typeof import("../common/helpers/humanTime").default;
|
|
||||||
'helpers/punctuateSeries': typeof import("../common/helpers/punctuateSeries").default;
|
|
||||||
'helpers/highlight': typeof import("../common/helpers/highlight").default;
|
|
||||||
'helpers/username': typeof import("../common/helpers/username").default;
|
|
||||||
'helpers/userOnline': typeof import("../common/helpers/userOnline").default;
|
|
||||||
'helpers/listItems': typeof import("../common/helpers/listItems").default;
|
|
||||||
'resolvers/DefaultResolver': typeof import("../common/resolvers/DefaultResolver").default;
|
|
||||||
'states/PaginatedListState': typeof import("../common/states/PaginatedListState").default;
|
|
||||||
} & {
|
|
||||||
'utils/saveSettings': typeof saveSettings;
|
|
||||||
'utils/ExtensionData': typeof ExtensionData;
|
|
||||||
'utils/isExtensionEnabled': typeof isExtensionEnabled;
|
|
||||||
'utils/getCategorizedExtensions': typeof getCategorizedExtensions;
|
|
||||||
'utils/generateElementId': typeof generateElementId;
|
|
||||||
'components/SettingDropdown': typeof SettingDropdown;
|
|
||||||
'components/EditCustomFooterModal': typeof EditCustomFooterModal;
|
|
||||||
'components/SessionDropdown': typeof SessionDropdown;
|
|
||||||
'components/HeaderPrimary': typeof HeaderPrimary;
|
|
||||||
'components/AdminPage': typeof AdminPage;
|
|
||||||
'components/AppearancePage': typeof AppearancePage;
|
|
||||||
'components/StatusWidget': typeof StatusWidget;
|
|
||||||
'components/ExtensionsWidget': typeof ExtensionsWidget;
|
|
||||||
'components/HeaderSecondary': typeof HeaderSecondary;
|
|
||||||
'components/SettingsModal': typeof SettingsModal;
|
|
||||||
'components/DashboardWidget': typeof DashboardWidget;
|
|
||||||
'components/ExtensionPage': typeof ExtensionPage;
|
|
||||||
'components/ExtensionLinkButton': typeof ExtensionLinkButton;
|
|
||||||
'components/PermissionGrid': typeof PermissionGrid;
|
|
||||||
'components/ExtensionPermissionGrid': typeof ExtensionPermissionGrid;
|
|
||||||
'components/MailPage': typeof MailPage;
|
|
||||||
'components/UploadImageButton': typeof UploadImageButton;
|
|
||||||
'components/LoadingModal': typeof LoadingModal;
|
|
||||||
'components/DashboardPage': typeof DashboardPage;
|
|
||||||
'components/BasicsPage': typeof BasicsPage;
|
|
||||||
'components/UserListPage': typeof UserListPage;
|
|
||||||
'components/EditCustomHeaderModal': typeof EditCustomHeaderModal;
|
|
||||||
'components/PermissionsPage': typeof PermissionsPage;
|
|
||||||
'components/PermissionDropdown': typeof PermissionDropdown;
|
|
||||||
'components/AdminNav': typeof AdminNav;
|
|
||||||
'components/AdminHeader': typeof AdminHeader;
|
|
||||||
'components/EditCustomCssModal': typeof EditCustomCssModal;
|
|
||||||
'components/EditGroupModal': typeof EditGroupModal;
|
|
||||||
routes: typeof routes;
|
|
||||||
AdminApplication: typeof AdminApplication;
|
|
||||||
};
|
|
||||||
export default _default;
|
|
@@ -1,5 +0,0 @@
|
|||||||
export default class AdminHeader extends Component<import("../../common/Component").ComponentAttrs, undefined> {
|
|
||||||
constructor();
|
|
||||||
view(vnode: any): JSX.Element[];
|
|
||||||
}
|
|
||||||
import Component from "../../common/Component";
|
|
19
extensions/akismet/js/dist-typings/framework/core/js/src/admin/components/AdminNav.d.ts
generated
vendored
19
extensions/akismet/js/dist-typings/framework/core/js/src/admin/components/AdminNav.d.ts
generated
vendored
@@ -1,19 +0,0 @@
|
|||||||
export default class AdminNav extends Component<import("../../common/Component").ComponentAttrs, undefined> {
|
|
||||||
constructor();
|
|
||||||
oninit(vnode: any): void;
|
|
||||||
query: Stream<string> | undefined;
|
|
||||||
view(): JSX.Element;
|
|
||||||
oncreate(vnode: any): void;
|
|
||||||
onupdate(vnode: any): void;
|
|
||||||
scrollToActive(): void;
|
|
||||||
/**
|
|
||||||
* Build an item list of main links to show in the admin navigation.
|
|
||||||
*
|
|
||||||
* @return {ItemList<import('mithril').Children>}
|
|
||||||
*/
|
|
||||||
items(): ItemList<import('mithril').Children>;
|
|
||||||
extensionItems(): ItemList<any>;
|
|
||||||
}
|
|
||||||
import Component from "../../common/Component";
|
|
||||||
import Stream from "../../common/utils/Stream";
|
|
||||||
import ItemList from "../../common/utils/ItemList";
|
|
204
extensions/akismet/js/dist-typings/framework/core/js/src/admin/components/AdminPage.d.ts
generated
vendored
204
extensions/akismet/js/dist-typings/framework/core/js/src/admin/components/AdminPage.d.ts
generated
vendored
@@ -1,204 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
import Page, { IPageAttrs } from '../../common/components/Page';
|
|
||||||
import Stream from '../../common/utils/Stream';
|
|
||||||
import ItemList from '../../common/utils/ItemList';
|
|
||||||
export interface AdminHeaderOptions {
|
|
||||||
title: Mithril.Children;
|
|
||||||
description: Mithril.Children;
|
|
||||||
icon: string;
|
|
||||||
/**
|
|
||||||
* Will be used as the class for the AdminPage.
|
|
||||||
*
|
|
||||||
* Will also be appended with `-header` and set as the class for the `AdminHeader` component.
|
|
||||||
*/
|
|
||||||
className: string;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* A type that matches any valid value for the `type` attribute on an HTML `<input>` element.
|
|
||||||
*
|
|
||||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-type
|
|
||||||
*
|
|
||||||
* Note: this will be exported from a different location in the future.
|
|
||||||
*
|
|
||||||
* @see https://github.com/flarum/core/issues/3039
|
|
||||||
*/
|
|
||||||
export declare type HTMLInputTypes = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week';
|
|
||||||
export interface CommonSettingsItemOptions extends Mithril.Attributes {
|
|
||||||
setting: string;
|
|
||||||
label: Mithril.Children;
|
|
||||||
help?: Mithril.Children;
|
|
||||||
className?: string;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Valid options for the setting component builder to generate an HTML input element.
|
|
||||||
*/
|
|
||||||
export interface HTMLInputSettingsComponentOptions extends CommonSettingsItemOptions {
|
|
||||||
/**
|
|
||||||
* Any valid HTML input `type` value.
|
|
||||||
*/
|
|
||||||
type: HTMLInputTypes;
|
|
||||||
}
|
|
||||||
declare const BooleanSettingTypes: readonly ["bool", "checkbox", "switch", "boolean"];
|
|
||||||
declare const SelectSettingTypes: readonly ["select", "dropdown", "selectdropdown"];
|
|
||||||
declare const TextareaSettingTypes: readonly ["textarea"];
|
|
||||||
declare const ColorPreviewSettingType: "color-preview";
|
|
||||||
/**
|
|
||||||
* Valid options for the setting component builder to generate a Switch.
|
|
||||||
*/
|
|
||||||
export interface SwitchSettingComponentOptions extends CommonSettingsItemOptions {
|
|
||||||
type: typeof BooleanSettingTypes[number];
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Valid options for the setting component builder to generate a Select dropdown.
|
|
||||||
*/
|
|
||||||
export interface SelectSettingComponentOptions extends CommonSettingsItemOptions {
|
|
||||||
type: typeof SelectSettingTypes[number];
|
|
||||||
/**
|
|
||||||
* Map of values to their labels
|
|
||||||
*/
|
|
||||||
options: {
|
|
||||||
[value: string]: Mithril.Children;
|
|
||||||
};
|
|
||||||
default: string;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Valid options for the setting component builder to generate a Textarea.
|
|
||||||
*/
|
|
||||||
export interface TextareaSettingComponentOptions extends CommonSettingsItemOptions {
|
|
||||||
type: typeof TextareaSettingTypes[number];
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Valid options for the setting component builder to generate a ColorPreviewInput.
|
|
||||||
*/
|
|
||||||
export interface ColorPreviewSettingComponentOptions extends CommonSettingsItemOptions {
|
|
||||||
type: typeof ColorPreviewSettingType;
|
|
||||||
}
|
|
||||||
export interface CustomSettingComponentOptions extends CommonSettingsItemOptions {
|
|
||||||
type: string;
|
|
||||||
[key: string]: unknown;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* All valid options for the setting component builder.
|
|
||||||
*/
|
|
||||||
export declare type SettingsComponentOptions = HTMLInputSettingsComponentOptions | SwitchSettingComponentOptions | SelectSettingComponentOptions | TextareaSettingComponentOptions | ColorPreviewSettingComponentOptions | CustomSettingComponentOptions;
|
|
||||||
/**
|
|
||||||
* Valid attrs that can be returned by the `headerInfo` function
|
|
||||||
*/
|
|
||||||
export declare type AdminHeaderAttrs = AdminHeaderOptions & Partial<Omit<Mithril.Attributes, 'class'>>;
|
|
||||||
export declare type SettingValue = string;
|
|
||||||
export declare type MutableSettings = Record<string, Stream<SettingValue>>;
|
|
||||||
export default abstract class AdminPage<CustomAttrs extends IPageAttrs = IPageAttrs> extends Page<CustomAttrs> {
|
|
||||||
settings: MutableSettings;
|
|
||||||
loading: boolean;
|
|
||||||
view(vnode: Mithril.Vnode<CustomAttrs, this>): Mithril.Children;
|
|
||||||
/**
|
|
||||||
* Returns the content of the AdminPage.
|
|
||||||
*/
|
|
||||||
abstract content(vnode: Mithril.Vnode<CustomAttrs, this>): Mithril.Children;
|
|
||||||
/**
|
|
||||||
* Returns the submit button for this AdminPage.
|
|
||||||
*
|
|
||||||
* Calls `this.saveSettings` when the button is clicked.
|
|
||||||
*/
|
|
||||||
submitButton(vnode: Mithril.Vnode<CustomAttrs, this>): Mithril.Children;
|
|
||||||
/**
|
|
||||||
* Returns the Header component for this AdminPage.
|
|
||||||
*/
|
|
||||||
header(vnode: Mithril.Vnode<CustomAttrs, this>): Mithril.Children;
|
|
||||||
/**
|
|
||||||
* Returns the options passed to the AdminHeader component.
|
|
||||||
*/
|
|
||||||
headerInfo(): AdminHeaderAttrs;
|
|
||||||
/**
|
|
||||||
* A list of extension-defined custom setting components to be available through
|
|
||||||
* {@link AdminPage.buildSettingComponent}.
|
|
||||||
*
|
|
||||||
* The ItemList key represents the value for `type` to be provided when calling
|
|
||||||
* {@link AdminPage.buildSettingComponent}. Other attributes passed are provided
|
|
||||||
* as arguments to the function added to the ItemList.
|
|
||||||
*
|
|
||||||
* ItemList priority has no effect here.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* ```tsx
|
|
||||||
* extend(AdminPage.prototype, 'customSettingComponents', function (items) {
|
|
||||||
* // You can access the AdminPage instance with `this` to access its `settings` property.
|
|
||||||
*
|
|
||||||
* // Prefixing the key with your extension ID is recommended to avoid collisions.
|
|
||||||
* items.add('my-ext.setting-component', (attrs) => {
|
|
||||||
* return (
|
|
||||||
* <div className={attrs.className}>
|
|
||||||
* <label>{attrs.label}</label>
|
|
||||||
* {attrs.help && <p class="helpText">{attrs.help}</p>}
|
|
||||||
*
|
|
||||||
* My setting component!
|
|
||||||
* </div>
|
|
||||||
* );
|
|
||||||
* })
|
|
||||||
* })
|
|
||||||
* ```
|
|
||||||
*/
|
|
||||||
customSettingComponents(): ItemList<(attributes: CommonSettingsItemOptions) => Mithril.Children>;
|
|
||||||
/**
|
|
||||||
* `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',
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
*
|
|
||||||
* () => {
|
|
||||||
* return <p>My cool component</p>;
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
buildSettingComponent(entry: ((this: this) => Mithril.Children) | SettingsComponentOptions): Mithril.Children;
|
|
||||||
/**
|
|
||||||
* Called when `saveSettings` completes successfully.
|
|
||||||
*/
|
|
||||||
onsaved(): void;
|
|
||||||
/**
|
|
||||||
* Returns a function that fetches the setting from the `app` global.
|
|
||||||
*/
|
|
||||||
setting(key: string, fallback?: string): Stream<string>;
|
|
||||||
/**
|
|
||||||
* Returns a map of settings keys to values which includes only those which have been modified but not yet saved.
|
|
||||||
*/
|
|
||||||
dirty(): Record<string, string>;
|
|
||||||
/**
|
|
||||||
* Returns the number of settings that have been modified.
|
|
||||||
*/
|
|
||||||
isChanged(): number;
|
|
||||||
/**
|
|
||||||
* Saves the modified settings to the database.
|
|
||||||
*/
|
|
||||||
saveSettings(e: SubmitEvent & {
|
|
||||||
redraw: boolean;
|
|
||||||
}): Promise<void>;
|
|
||||||
}
|
|
||||||
export {};
|
|
@@ -1,14 +0,0 @@
|
|||||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
|
||||||
export default class AppearancePage extends AdminPage<import("../../common/components/Page").IPageAttrs> {
|
|
||||||
constructor();
|
|
||||||
headerInfo(): {
|
|
||||||
className: string;
|
|
||||||
icon: string;
|
|
||||||
title: import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
description: import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
};
|
|
||||||
content(): JSX.Element[];
|
|
||||||
colorItems(): ItemList<any>;
|
|
||||||
}
|
|
||||||
import AdminPage from "./AdminPage";
|
|
||||||
import ItemList from "../../common/utils/ItemList";
|
|
@@ -1,27 +0,0 @@
|
|||||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
|
||||||
export default class BasicsPage extends AdminPage<import("../../common/components/Page").IPageAttrs> {
|
|
||||||
constructor();
|
|
||||||
oninit(vnode: any): void;
|
|
||||||
localeOptions: {} | undefined;
|
|
||||||
displayNameOptions: {} | undefined;
|
|
||||||
slugDriverOptions: {} | undefined;
|
|
||||||
headerInfo(): {
|
|
||||||
className: string;
|
|
||||||
icon: string;
|
|
||||||
title: import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
description: import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
};
|
|
||||||
content(): JSX.Element[];
|
|
||||||
/**
|
|
||||||
* Build a list of options for the default homepage. Each option must be an
|
|
||||||
* object with `path` and `label` properties.
|
|
||||||
*
|
|
||||||
* @return {ItemList<{ path: string, label: import('mithril').Children }>}
|
|
||||||
*/
|
|
||||||
homePageItems(): ItemList<{
|
|
||||||
path: string;
|
|
||||||
label: import('mithril').Children;
|
|
||||||
}>;
|
|
||||||
}
|
|
||||||
import AdminPage from "./AdminPage";
|
|
||||||
import ItemList from "../../common/utils/ItemList";
|
|
@@ -1,16 +0,0 @@
|
|||||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
|
||||||
import ItemList from '../../common/utils/ItemList';
|
|
||||||
import AdminPage from './AdminPage';
|
|
||||||
import type { Children } from 'mithril';
|
|
||||||
export default class DashboardPage extends AdminPage {
|
|
||||||
headerInfo(): {
|
|
||||||
className: string;
|
|
||||||
icon: string;
|
|
||||||
title: import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
description: import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
};
|
|
||||||
content(): (Children & {
|
|
||||||
itemName: string;
|
|
||||||
})[];
|
|
||||||
availableWidgets(): ItemList<Children>;
|
|
||||||
}
|
|
@@ -1,9 +0,0 @@
|
|||||||
import type { Children, Vnode } from 'mithril';
|
|
||||||
import Component, { ComponentAttrs } from '../../common/Component';
|
|
||||||
export interface IDashboardWidgetAttrs extends ComponentAttrs {
|
|
||||||
}
|
|
||||||
export default class DashboardWidget<CustomAttrs extends IDashboardWidgetAttrs = IDashboardWidgetAttrs> extends Component<CustomAttrs> {
|
|
||||||
view(vnode: Vnode<CustomAttrs, this>): Children;
|
|
||||||
className(): string;
|
|
||||||
content(): Children;
|
|
||||||
}
|
|
@@ -1,9 +0,0 @@
|
|||||||
/// <reference types="mithril" />
|
|
||||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
|
||||||
import SettingsModal from './SettingsModal';
|
|
||||||
export default class EditCustomCssModal extends SettingsModal {
|
|
||||||
className(): string;
|
|
||||||
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
form(): JSX.Element[];
|
|
||||||
onsaved(): void;
|
|
||||||
}
|
|
@@ -1,9 +0,0 @@
|
|||||||
/// <reference types="mithril" />
|
|
||||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
|
||||||
import SettingsModal from './SettingsModal';
|
|
||||||
export default class EditCustomFooterModal extends SettingsModal {
|
|
||||||
className(): string;
|
|
||||||
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
form(): JSX.Element[];
|
|
||||||
onsaved(): void;
|
|
||||||
}
|
|
@@ -1,9 +0,0 @@
|
|||||||
/// <reference types="mithril" />
|
|
||||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
|
||||||
import SettingsModal from './SettingsModal';
|
|
||||||
export default class EditCustomHeaderModal extends SettingsModal {
|
|
||||||
className(): string;
|
|
||||||
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
form(): JSX.Element[];
|
|
||||||
onsaved(): void;
|
|
||||||
}
|
|
@@ -1,35 +0,0 @@
|
|||||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
|
||||||
import Modal, { IInternalModalAttrs } from '../../common/components/Modal';
|
|
||||||
import Group from '../../common/models/Group';
|
|
||||||
import ItemList from '../../common/utils/ItemList';
|
|
||||||
import Stream from '../../common/utils/Stream';
|
|
||||||
import Mithril from 'mithril';
|
|
||||||
export interface IEditGroupModalAttrs extends IInternalModalAttrs {
|
|
||||||
group?: Group;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `EditGroupModal` component shows a modal dialog which allows the user
|
|
||||||
* to create or edit a group.
|
|
||||||
*/
|
|
||||||
export default class EditGroupModal<CustomAttrs extends IEditGroupModalAttrs = IEditGroupModalAttrs> extends Modal<CustomAttrs> {
|
|
||||||
group: Group;
|
|
||||||
nameSingular: Stream<string>;
|
|
||||||
namePlural: Stream<string>;
|
|
||||||
icon: Stream<string>;
|
|
||||||
color: Stream<string>;
|
|
||||||
isHidden: Stream<boolean>;
|
|
||||||
oninit(vnode: Mithril.Vnode<CustomAttrs, this>): void;
|
|
||||||
className(): string;
|
|
||||||
title(): (Mithril.Vnode<{}, {}> | import("@askvortsov/rich-icu-message-formatter").NestedStringArray)[];
|
|
||||||
content(): JSX.Element;
|
|
||||||
fields(): ItemList<unknown>;
|
|
||||||
submitData(): {
|
|
||||||
nameSingular: string;
|
|
||||||
namePlural: string;
|
|
||||||
color: string;
|
|
||||||
icon: string;
|
|
||||||
isHidden: boolean;
|
|
||||||
};
|
|
||||||
onsubmit(e: SubmitEvent): void;
|
|
||||||
deleteGroup(): void;
|
|
||||||
}
|
|
@@ -1,6 +0,0 @@
|
|||||||
export default class ExtensionLinkButton extends LinkButton {
|
|
||||||
getButtonContent(children: any): import("mithril").ChildArray;
|
|
||||||
statusItems(name: any): ItemList<any>;
|
|
||||||
}
|
|
||||||
import LinkButton from "../../common/components/LinkButton";
|
|
||||||
import ItemList from "../../common/utils/ItemList";
|
|
@@ -1,32 +0,0 @@
|
|||||||
import ItemList from '../../common/utils/ItemList';
|
|
||||||
import AdminPage from './AdminPage';
|
|
||||||
import RequestError from '../../common/utils/RequestError';
|
|
||||||
import { Extension } from '../AdminApplication';
|
|
||||||
import { IPageAttrs } from '../../common/components/Page';
|
|
||||||
import type Mithril from 'mithril';
|
|
||||||
export interface ExtensionPageAttrs extends IPageAttrs {
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
export default class ExtensionPage<Attrs extends ExtensionPageAttrs = ExtensionPageAttrs> extends AdminPage<Attrs> {
|
|
||||||
extension: Extension;
|
|
||||||
changingState: boolean;
|
|
||||||
infoFields: {
|
|
||||||
discuss: string;
|
|
||||||
documentation: string;
|
|
||||||
support: string;
|
|
||||||
website: string;
|
|
||||||
donate: string;
|
|
||||||
source: string;
|
|
||||||
};
|
|
||||||
oninit(vnode: Mithril.Vnode<Attrs, this>): void;
|
|
||||||
className(): string;
|
|
||||||
view(vnode: Mithril.VnodeDOM<Attrs, this>): JSX.Element | null;
|
|
||||||
header(): JSX.Element[];
|
|
||||||
sections(vnode: Mithril.VnodeDOM<Attrs, this>): ItemList<unknown>;
|
|
||||||
content(vnode: Mithril.VnodeDOM<Attrs, this>): JSX.Element;
|
|
||||||
topItems(): ItemList<Mithril.Children>;
|
|
||||||
infoItems(): ItemList<Mithril.Children>;
|
|
||||||
toggle(): void;
|
|
||||||
isEnabled(): any;
|
|
||||||
onerror(e: RequestError): void;
|
|
||||||
}
|
|
@@ -1,19 +0,0 @@
|
|||||||
import PermissionGrid, { PermissionGridEntry } from './PermissionGrid';
|
|
||||||
import ItemList from '../../common/utils/ItemList';
|
|
||||||
import Mithril from 'mithril';
|
|
||||||
export interface IExtensionPermissionGridAttrs {
|
|
||||||
extensionId: string;
|
|
||||||
}
|
|
||||||
export default class ExtensionPermissionGrid<CustomAttrs extends IExtensionPermissionGridAttrs = IExtensionPermissionGridAttrs> extends PermissionGrid<CustomAttrs> {
|
|
||||||
protected extensionId: string;
|
|
||||||
oninit(vnode: Mithril.Vnode<CustomAttrs, this>): void;
|
|
||||||
permissionItems(): ItemList<{
|
|
||||||
label: Mithril.Children;
|
|
||||||
children: PermissionGridEntry[];
|
|
||||||
}>;
|
|
||||||
viewItems(): ItemList<import("./PermissionGrid").PermissionConfig>;
|
|
||||||
startItems(): ItemList<import("./PermissionGrid").PermissionConfig>;
|
|
||||||
replyItems(): ItemList<import("./PermissionGrid").PermissionConfig>;
|
|
||||||
moderateItems(): ItemList<import("./PermissionGrid").PermissionConfig>;
|
|
||||||
scopeControlItems(): ItemList<unknown>;
|
|
||||||
}
|
|
@@ -1,9 +0,0 @@
|
|||||||
export default class ExtensionsWidget extends DashboardWidget<import("./DashboardWidget").IDashboardWidgetAttrs> {
|
|
||||||
constructor();
|
|
||||||
oninit(vnode: any): void;
|
|
||||||
categorizedExtensions: {} | undefined;
|
|
||||||
content(): JSX.Element;
|
|
||||||
extensionCategory(category: any): JSX.Element;
|
|
||||||
extensionWidget(extension: any): JSX.Element;
|
|
||||||
}
|
|
||||||
import DashboardWidget from "./DashboardWidget";
|
|
@@ -1,17 +0,0 @@
|
|||||||
/**
|
|
||||||
* 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, undefined> {
|
|
||||||
constructor();
|
|
||||||
view(): JSX.Element;
|
|
||||||
config(isInitialized: any, context: any): void;
|
|
||||||
/**
|
|
||||||
* Build an item list for the controls.
|
|
||||||
*
|
|
||||||
* @return {ItemList<import('mithril').Children>}
|
|
||||||
*/
|
|
||||||
items(): ItemList<import('mithril').Children>;
|
|
||||||
}
|
|
||||||
import Component from "../../common/Component";
|
|
||||||
import ItemList from "../../common/utils/ItemList";
|
|
@@ -1,15 +0,0 @@
|
|||||||
/**
|
|
||||||
* The `HeaderSecondary` component displays secondary header controls.
|
|
||||||
*/
|
|
||||||
export default class HeaderSecondary extends Component<import("../../common/Component").ComponentAttrs, undefined> {
|
|
||||||
constructor();
|
|
||||||
view(): JSX.Element;
|
|
||||||
/**
|
|
||||||
* Build an item list for the controls.
|
|
||||||
*
|
|
||||||
* @return {ItemList<import('mithril').Children>}
|
|
||||||
*/
|
|
||||||
items(): ItemList<import('mithril').Children>;
|
|
||||||
}
|
|
||||||
import Component from "../../common/Component";
|
|
||||||
import ItemList from "../../common/utils/ItemList";
|
|
@@ -1,14 +0,0 @@
|
|||||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
|
||||||
import Modal, { IInternalModalAttrs } from '../../common/components/Modal';
|
|
||||||
export interface ILoadingModalAttrs extends IInternalModalAttrs {
|
|
||||||
}
|
|
||||||
export default class LoadingModal<ModalAttrs extends ILoadingModalAttrs = ILoadingModalAttrs> extends Modal<ModalAttrs> {
|
|
||||||
/**
|
|
||||||
* @inheritdoc
|
|
||||||
*/
|
|
||||||
static readonly isDismissible: boolean;
|
|
||||||
className(): string;
|
|
||||||
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
content(): string;
|
|
||||||
onsubmit(e: Event): void;
|
|
||||||
}
|
|
23
extensions/akismet/js/dist-typings/framework/core/js/src/admin/components/MailPage.d.ts
generated
vendored
23
extensions/akismet/js/dist-typings/framework/core/js/src/admin/components/MailPage.d.ts
generated
vendored
@@ -1,23 +0,0 @@
|
|||||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
|
||||||
export default class MailPage extends AdminPage<import("../../common/components/Page").IPageAttrs> {
|
|
||||||
constructor();
|
|
||||||
oninit(vnode: any): void;
|
|
||||||
sendingTest: boolean | undefined;
|
|
||||||
headerInfo(): {
|
|
||||||
className: string;
|
|
||||||
icon: string;
|
|
||||||
title: import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
description: import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
};
|
|
||||||
refresh(): void;
|
|
||||||
status: {
|
|
||||||
sending: boolean;
|
|
||||||
errors: {};
|
|
||||||
} | undefined;
|
|
||||||
driverFields: any;
|
|
||||||
content(): JSX.Element;
|
|
||||||
sendTestEmail(): void;
|
|
||||||
testEmailSuccessAlert: number | undefined;
|
|
||||||
saveSettings(e: any): void;
|
|
||||||
}
|
|
||||||
import AdminPage from "./AdminPage";
|
|
@@ -1,6 +0,0 @@
|
|||||||
export default class PermissionDropdown extends Dropdown {
|
|
||||||
save(groupIds: any): void;
|
|
||||||
toggle(groupId: any): void;
|
|
||||||
isGroupDisabled(id: any): boolean;
|
|
||||||
}
|
|
||||||
import Dropdown from "../../common/components/Dropdown";
|
|
@@ -1,36 +0,0 @@
|
|||||||
import Component, { ComponentAttrs } from '../../common/Component';
|
|
||||||
import ItemList from '../../common/utils/ItemList';
|
|
||||||
import type Mithril from 'mithril';
|
|
||||||
export interface PermissionConfig {
|
|
||||||
permission: string;
|
|
||||||
icon: string;
|
|
||||||
label: Mithril.Children;
|
|
||||||
allowGuest?: boolean;
|
|
||||||
}
|
|
||||||
export interface PermissionSetting {
|
|
||||||
setting: () => Mithril.Children;
|
|
||||||
icon: string;
|
|
||||||
label: Mithril.Children;
|
|
||||||
}
|
|
||||||
export declare type PermissionGridEntry = PermissionConfig | PermissionSetting;
|
|
||||||
export declare type PermissionType = 'view' | 'start' | 'reply' | 'moderate';
|
|
||||||
export interface ScopeItem {
|
|
||||||
label: Mithril.Children;
|
|
||||||
render: (permission: PermissionGridEntry) => Mithril.Children;
|
|
||||||
onremove?: () => void;
|
|
||||||
}
|
|
||||||
export interface IPermissionGridAttrs extends ComponentAttrs {
|
|
||||||
}
|
|
||||||
export default class PermissionGrid<CustomAttrs extends IPermissionGridAttrs = IPermissionGridAttrs> extends Component<CustomAttrs> {
|
|
||||||
view(vnode: Mithril.Vnode<CustomAttrs, this>): JSX.Element;
|
|
||||||
permissionItems(): ItemList<{
|
|
||||||
label: Mithril.Children;
|
|
||||||
children: PermissionGridEntry[];
|
|
||||||
}>;
|
|
||||||
viewItems(): ItemList<PermissionGridEntry>;
|
|
||||||
startItems(): ItemList<PermissionGridEntry>;
|
|
||||||
replyItems(): ItemList<PermissionGridEntry>;
|
|
||||||
moderateItems(): ItemList<PermissionGridEntry>;
|
|
||||||
scopeItems(): ItemList<ScopeItem>;
|
|
||||||
scopeControlItems(): ItemList<unknown>;
|
|
||||||
}
|
|
@@ -1,12 +0,0 @@
|
|||||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
|
||||||
export default class PermissionsPage extends AdminPage<import("../../common/components/Page").IPageAttrs> {
|
|
||||||
constructor();
|
|
||||||
headerInfo(): {
|
|
||||||
className: string;
|
|
||||||
icon: string;
|
|
||||||
title: import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
description: import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
};
|
|
||||||
content(): JSX.Element[];
|
|
||||||
}
|
|
||||||
import AdminPage from "./AdminPage";
|
|
@@ -1,18 +0,0 @@
|
|||||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
|
||||||
import Modal, { IInternalModalAttrs } from '../../common/components/Modal';
|
|
||||||
import ExtensionReadme from '../models/ExtensionReadme';
|
|
||||||
import type Mithril from 'mithril';
|
|
||||||
import type { Extension } from '../AdminApplication';
|
|
||||||
export interface IReadmeModalAttrs extends IInternalModalAttrs {
|
|
||||||
extension: Extension;
|
|
||||||
}
|
|
||||||
export default class ReadmeModal<CustomAttrs extends IReadmeModalAttrs = IReadmeModalAttrs> extends Modal<CustomAttrs> {
|
|
||||||
protected name: string;
|
|
||||||
protected extName: string;
|
|
||||||
protected readme: ExtensionReadme;
|
|
||||||
oninit(vnode: Mithril.Vnode<CustomAttrs, this>): void;
|
|
||||||
className(): string;
|
|
||||||
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
content(): JSX.Element;
|
|
||||||
loadReadme(): Promise<void>;
|
|
||||||
}
|
|
@@ -1,15 +0,0 @@
|
|||||||
/**
|
|
||||||
* 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 {
|
|
||||||
getButtonContent(): (string | JSX.Element)[];
|
|
||||||
/**
|
|
||||||
* Build an item list for the contents of the dropdown menu.
|
|
||||||
*
|
|
||||||
* @return {ItemList}
|
|
||||||
*/
|
|
||||||
items(): ItemList<any>;
|
|
||||||
}
|
|
||||||
import Dropdown from "../../common/components/Dropdown";
|
|
||||||
import ItemList from "../../common/utils/ItemList";
|
|
@@ -1,3 +0,0 @@
|
|||||||
export default class SettingDropdown extends SelectDropdown {
|
|
||||||
}
|
|
||||||
import SelectDropdown from "../../common/components/SelectDropdown";
|
|
@@ -1,18 +0,0 @@
|
|||||||
import Modal, { IInternalModalAttrs } from '../../common/components/Modal';
|
|
||||||
import Stream from '../../common/utils/Stream';
|
|
||||||
import Mithril from 'mithril';
|
|
||||||
import { MutableSettings, SettingValue } from './AdminPage';
|
|
||||||
export interface ISettingsModalAttrs extends IInternalModalAttrs {
|
|
||||||
}
|
|
||||||
export default abstract class SettingsModal<CustomAttrs extends ISettingsModalAttrs = ISettingsModalAttrs> extends Modal<CustomAttrs> {
|
|
||||||
settings: MutableSettings;
|
|
||||||
loading: boolean;
|
|
||||||
form(): Mithril.Children;
|
|
||||||
content(): JSX.Element;
|
|
||||||
submitButton(): Mithril.Children;
|
|
||||||
setting(key: string, fallback?: string): Stream<SettingValue>;
|
|
||||||
dirty(): Record<string, string>;
|
|
||||||
changed(): number;
|
|
||||||
onsubmit(e: SubmitEvent): void;
|
|
||||||
onsaved(): void;
|
|
||||||
}
|
|
@@ -1,9 +0,0 @@
|
|||||||
export default class StatusWidget extends DashboardWidget<import("./DashboardWidget").IDashboardWidgetAttrs> {
|
|
||||||
constructor();
|
|
||||||
content(): JSX.Element;
|
|
||||||
items(): ItemList<any>;
|
|
||||||
toolsItems(): ItemList<any>;
|
|
||||||
handleClearCache(e: any): void;
|
|
||||||
}
|
|
||||||
import DashboardWidget from "./DashboardWidget";
|
|
||||||
import ItemList from "../../common/utils/ItemList";
|
|
@@ -1,29 +0,0 @@
|
|||||||
export default class UploadImageButton extends Button<import("../../common/components/Button").IButtonAttrs> {
|
|
||||||
constructor();
|
|
||||||
loading: boolean;
|
|
||||||
view(vnode: any): JSX.Element;
|
|
||||||
/**
|
|
||||||
* 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";
|
|
@@ -1,85 +0,0 @@
|
|||||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
|
||||||
import type Mithril from 'mithril';
|
|
||||||
import type User from '../../common/models/User';
|
|
||||||
import ItemList from '../../common/utils/ItemList';
|
|
||||||
import AdminPage from './AdminPage';
|
|
||||||
declare type ColumnData = {
|
|
||||||
/**
|
|
||||||
* Column title
|
|
||||||
*/
|
|
||||||
name: Mithril.Children;
|
|
||||||
/**
|
|
||||||
* Component(s) to show for this column.
|
|
||||||
*/
|
|
||||||
content: (user: User) => Mithril.Children;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 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<ColumnData>;
|
|
||||||
headerInfo(): {
|
|
||||||
className: string;
|
|
||||||
icon: string;
|
|
||||||
title: import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
description: import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
export {};
|
|
3
extensions/akismet/js/dist-typings/framework/core/js/src/admin/index.d.ts
generated
vendored
3
extensions/akismet/js/dist-typings/framework/core/js/src/admin/index.d.ts
generated
vendored
@@ -1,3 +0,0 @@
|
|||||||
import app from './app';
|
|
||||||
export { app };
|
|
||||||
export declare const compat: Record<string, unknown>;
|
|
@@ -1,4 +0,0 @@
|
|||||||
export default class ExtensionReadme extends Model {
|
|
||||||
content: () => any;
|
|
||||||
}
|
|
||||||
import Model from "../../common/Model";
|
|
@@ -1,10 +0,0 @@
|
|||||||
import DefaultResolver from '../../common/resolvers/DefaultResolver';
|
|
||||||
import ExtensionPage, { ExtensionPageAttrs } from '../components/ExtensionPage';
|
|
||||||
/**
|
|
||||||
* A custom route resolver for ExtensionPage that generates handles routes
|
|
||||||
* to default extension pages or a page provided by an extension.
|
|
||||||
*/
|
|
||||||
export default class ExtensionPageResolver<Attrs extends ExtensionPageAttrs = ExtensionPageAttrs, RouteArgs extends Record<string, unknown> = {}> extends DefaultResolver<Attrs, ExtensionPage<Attrs>, RouteArgs> {
|
|
||||||
static extension: string | null;
|
|
||||||
onmatch(args: Attrs & RouteArgs, requestedPath: string, route: string): new () => ExtensionPage<Attrs>;
|
|
||||||
}
|
|
10
extensions/akismet/js/dist-typings/framework/core/js/src/admin/routes.d.ts
generated
vendored
10
extensions/akismet/js/dist-typings/framework/core/js/src/admin/routes.d.ts
generated
vendored
@@ -1,10 +0,0 @@
|
|||||||
import AdminApplication from './AdminApplication';
|
|
||||||
/**
|
|
||||||
* Helper functions to generate URLs to admin pages.
|
|
||||||
*/
|
|
||||||
export interface AdminRoutes {
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `routes` initializer defines the forum app's routes.
|
|
||||||
*/
|
|
||||||
export default function (app: AdminApplication): void;
|
|
96
extensions/akismet/js/dist-typings/framework/core/js/src/admin/utils/ExtensionData.d.ts
generated
vendored
96
extensions/akismet/js/dist-typings/framework/core/js/src/admin/utils/ExtensionData.d.ts
generated
vendored
@@ -1,96 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
import ItemList from '../../common/utils/ItemList';
|
|
||||||
import { SettingsComponentOptions } from '../components/AdminPage';
|
|
||||||
import ExtensionPage, { ExtensionPageAttrs } from '../components/ExtensionPage';
|
|
||||||
import { PermissionConfig, PermissionType } from '../components/PermissionGrid';
|
|
||||||
declare type SettingConfigInput = SettingsComponentOptions | (() => Mithril.Children);
|
|
||||||
declare type SettingConfigInternal = SettingsComponentOptions | ((() => Mithril.Children) & {
|
|
||||||
setting: string;
|
|
||||||
});
|
|
||||||
export declare type CustomExtensionPage<Attrs extends ExtensionPageAttrs = ExtensionPageAttrs> = new () => ExtensionPage<Attrs>;
|
|
||||||
declare type ExtensionConfig = {
|
|
||||||
settings?: ItemList<SettingConfigInternal>;
|
|
||||||
permissions?: {
|
|
||||||
view?: ItemList<PermissionConfig>;
|
|
||||||
start?: ItemList<PermissionConfig>;
|
|
||||||
reply?: ItemList<PermissionConfig>;
|
|
||||||
moderate?: ItemList<PermissionConfig>;
|
|
||||||
};
|
|
||||||
page?: CustomExtensionPage;
|
|
||||||
};
|
|
||||||
declare type InnerDataNoActiveExtension = {
|
|
||||||
currentExtension: null;
|
|
||||||
data: {
|
|
||||||
[key: string]: ExtensionConfig | undefined;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
declare type InnerDataActiveExtension = {
|
|
||||||
currentExtension: string;
|
|
||||||
data: {
|
|
||||||
[key: string]: ExtensionConfig;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
export default class ExtensionData {
|
|
||||||
protected state: InnerDataActiveExtension | InnerDataNoActiveExtension;
|
|
||||||
/**
|
|
||||||
* This function simply takes the extension id
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* app.extensionData.for('flarum-tags')
|
|
||||||
*
|
|
||||||
* flarum/flags -> flarum-flags | acme/extension -> acme-extension
|
|
||||||
*/
|
|
||||||
for(extension: string): this;
|
|
||||||
/**
|
|
||||||
* This function registers your settings with Flarum
|
|
||||||
*
|
|
||||||
* It takes either a settings object or a callback.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
*
|
|
||||||
* .registerSetting({
|
|
||||||
* setting: 'flarum-flags.guidelines_url',
|
|
||||||
* type: 'text', // This will be inputted into the input tag for the setting (text/number/etc)
|
|
||||||
* label: app.translator.trans('flarum-flags.admin.settings.guidelines_url_label')
|
|
||||||
* }, 15) // priority is optional (ItemList)
|
|
||||||
*/
|
|
||||||
registerSetting(content: SettingConfigInput, priority?: number): this;
|
|
||||||
/**
|
|
||||||
* This function registers your permission with Flarum
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
*
|
|
||||||
* .registerPermission('permissions', {
|
|
||||||
* icon: 'fas fa-flag',
|
|
||||||
* label: app.translator.trans('flarum-flags.admin.permissions.view_flags_label'),
|
|
||||||
* permission: 'discussion.viewFlags'
|
|
||||||
* }, 'moderate', 65)
|
|
||||||
*/
|
|
||||||
registerPermission(content: PermissionConfig, permissionType: PermissionType, priority?: number): this;
|
|
||||||
/**
|
|
||||||
* Replace the default extension page with a custom component.
|
|
||||||
* This component would typically extend ExtensionPage
|
|
||||||
*/
|
|
||||||
registerPage(component: CustomExtensionPage): this;
|
|
||||||
/**
|
|
||||||
* Get an extension's registered settings
|
|
||||||
*/
|
|
||||||
getSettings(extensionId: string): SettingConfigInternal[] | undefined;
|
|
||||||
/**
|
|
||||||
* Get an ItemList of all extensions' registered permissions
|
|
||||||
*/
|
|
||||||
getAllExtensionPermissions(type: PermissionType): ItemList<PermissionConfig>;
|
|
||||||
/**
|
|
||||||
* Get a singular extension's registered permissions
|
|
||||||
*/
|
|
||||||
getExtensionPermissions(extension: string, type: PermissionType): ItemList<PermissionConfig>;
|
|
||||||
/**
|
|
||||||
* Checks whether a given extension has registered permissions.
|
|
||||||
*/
|
|
||||||
extensionHasPermissions(extension: string): boolean;
|
|
||||||
/**
|
|
||||||
* Returns an extension's custom page component if it exists.
|
|
||||||
*/
|
|
||||||
getPage<Attrs extends ExtensionPageAttrs = ExtensionPageAttrs>(extension: string): CustomExtensionPage<Attrs> | undefined;
|
|
||||||
}
|
|
||||||
export {};
|
|
@@ -1 +0,0 @@
|
|||||||
export { nanoid as default } from 'nanoid';
|
|
@@ -1 +0,0 @@
|
|||||||
export default function getCategorizedExtensions(): {};
|
|
@@ -1 +0,0 @@
|
|||||||
export default function isExtensionEnabled(name: any): any;
|
|
@@ -1 +0,0 @@
|
|||||||
export default function saveSettings(settings: any): Promise<any>;
|
|
241
extensions/akismet/js/dist-typings/framework/core/js/src/common/Application.d.ts
generated
vendored
241
extensions/akismet/js/dist-typings/framework/core/js/src/common/Application.d.ts
generated
vendored
@@ -1,241 +0,0 @@
|
|||||||
import ItemList from './utils/ItemList';
|
|
||||||
import Translator from './Translator';
|
|
||||||
import Store, { ApiPayload, ApiResponsePlural, ApiResponseSingle } from './Store';
|
|
||||||
import Session from './Session';
|
|
||||||
import Drawer from './utils/Drawer';
|
|
||||||
import RequestError, { InternalFlarumRequestOptions } from './utils/RequestError';
|
|
||||||
import Forum from './models/Forum';
|
|
||||||
import PageState from './states/PageState';
|
|
||||||
import ModalManagerState from './states/ModalManagerState';
|
|
||||||
import AlertManagerState from './states/AlertManagerState';
|
|
||||||
import type DefaultResolver from './resolvers/DefaultResolver';
|
|
||||||
import type Mithril from 'mithril';
|
|
||||||
import type Component from './Component';
|
|
||||||
import type { ComponentAttrs } from './Component';
|
|
||||||
import Model, { SavedModelData } from './Model';
|
|
||||||
import IHistory from './IHistory';
|
|
||||||
export declare type FlarumScreens = 'phone' | 'tablet' | 'desktop' | 'desktop-hd';
|
|
||||||
export declare type FlarumGenericRoute = RouteItem<any, any, any>;
|
|
||||||
export interface FlarumRequestOptions<ResponseType> extends Omit<Mithril.RequestOptions<ResponseType>, 'extract'> {
|
|
||||||
errorHandler?: (error: RequestError) => void;
|
|
||||||
url: string;
|
|
||||||
/**
|
|
||||||
* Manipulate the response text before it is parsed into JSON.
|
|
||||||
*
|
|
||||||
* @deprecated Please use `modifyText` instead.
|
|
||||||
*/
|
|
||||||
extract?: (responseText: string) => string;
|
|
||||||
/**
|
|
||||||
* Manipulate the response text before it is parsed into JSON.
|
|
||||||
*
|
|
||||||
* This overrides any `extract` method provided.
|
|
||||||
*/
|
|
||||||
modifyText?: (responseText: string) => string;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* A valid route definition.
|
|
||||||
*/
|
|
||||||
export declare type RouteItem<Attrs extends ComponentAttrs, Comp extends Component<Attrs & {
|
|
||||||
routeName: string;
|
|
||||||
}>, RouteArgs extends Record<string, unknown> = {}> = {
|
|
||||||
/**
|
|
||||||
* The path for your route.
|
|
||||||
*
|
|
||||||
* This might be a specific URL path (e.g.,`/myPage`), or it might
|
|
||||||
* contain a variable used by a resolver (e.g., `/myPage/:id`).
|
|
||||||
*
|
|
||||||
* @see https://docs.flarum.org/extend/frontend-pages.html#route-resolvers-advanced
|
|
||||||
*/
|
|
||||||
path: `/${string}`;
|
|
||||||
} & ({
|
|
||||||
/**
|
|
||||||
* The component to render when this route matches.
|
|
||||||
*/
|
|
||||||
component: new () => Comp;
|
|
||||||
/**
|
|
||||||
* A custom resolver class.
|
|
||||||
*
|
|
||||||
* This should be the class itself, and **not** an instance of the
|
|
||||||
* class.
|
|
||||||
*/
|
|
||||||
resolverClass?: new (component: new () => Comp, routeName: string) => DefaultResolver<Attrs, Comp, RouteArgs>;
|
|
||||||
} | {
|
|
||||||
/**
|
|
||||||
* An instance of a route resolver.
|
|
||||||
*/
|
|
||||||
resolver: RouteResolver<Attrs, Comp, RouteArgs>;
|
|
||||||
});
|
|
||||||
export interface RouteResolver<Attrs extends ComponentAttrs, Comp extends Component<Attrs & {
|
|
||||||
routeName: string;
|
|
||||||
}>, RouteArgs extends Record<string, unknown> = {}> {
|
|
||||||
/**
|
|
||||||
* A method which selects which component to render based on
|
|
||||||
* conditional logic.
|
|
||||||
*
|
|
||||||
* Returns the component class, and **not** a Vnode or JSX
|
|
||||||
* expression.
|
|
||||||
*
|
|
||||||
* @see https://mithril.js.org/route.html#routeresolveronmatch
|
|
||||||
*/
|
|
||||||
onmatch(this: this, args: RouteArgs, requestedPath: string, route: string): {
|
|
||||||
new (): Comp;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* A function which renders the provided component.
|
|
||||||
*
|
|
||||||
* If not specified, the route will default to rendering the
|
|
||||||
* component on its own, inside of a fragment.
|
|
||||||
*
|
|
||||||
* Returns a Mithril Vnode or other children.
|
|
||||||
*
|
|
||||||
* @see https://mithril.js.org/route.html#routeresolverrender
|
|
||||||
*/
|
|
||||||
render?(this: this, vnode: Mithril.Vnode<Attrs, Comp>): Mithril.Children;
|
|
||||||
}
|
|
||||||
export interface ApplicationData {
|
|
||||||
apiDocument: ApiPayload | null;
|
|
||||||
locale: string;
|
|
||||||
locales: Record<string, string>;
|
|
||||||
resources: SavedModelData[];
|
|
||||||
session: {
|
|
||||||
userId: number;
|
|
||||||
csrfToken: string;
|
|
||||||
};
|
|
||||||
[key: string]: unknown;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `App` class provides a container for an application, as well as various
|
|
||||||
* utilities for the rest of the app to use.
|
|
||||||
*/
|
|
||||||
export default class Application {
|
|
||||||
/**
|
|
||||||
* The forum model for this application.
|
|
||||||
*/
|
|
||||||
forum: Forum;
|
|
||||||
/**
|
|
||||||
* A map of routes, keyed by a unique route name. Each route is an object
|
|
||||||
* containing the following properties:
|
|
||||||
*
|
|
||||||
* - `path` The path that the route is accessed at.
|
|
||||||
* - `component` The Mithril component to render when this route is active.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* app.routes.discussion = { path: '/d/:id', component: DiscussionPage };
|
|
||||||
*/
|
|
||||||
routes: Record<string, FlarumGenericRoute>;
|
|
||||||
/**
|
|
||||||
* An ordered list of initializers to bootstrap the application.
|
|
||||||
*/
|
|
||||||
initializers: ItemList<(app: this) => void>;
|
|
||||||
/**
|
|
||||||
* The app's session.
|
|
||||||
*
|
|
||||||
* Stores info about the current user.
|
|
||||||
*/
|
|
||||||
session: Session;
|
|
||||||
/**
|
|
||||||
* The app's translator.
|
|
||||||
*/
|
|
||||||
translator: Translator;
|
|
||||||
/**
|
|
||||||
* The app's data store.
|
|
||||||
*/
|
|
||||||
store: Store;
|
|
||||||
/**
|
|
||||||
* A local cache that can be used to store data at the application level, so
|
|
||||||
* that is persists between different routes.
|
|
||||||
*/
|
|
||||||
cache: Record<string, unknown>;
|
|
||||||
/**
|
|
||||||
* Whether or not the app has been booted.
|
|
||||||
*/
|
|
||||||
booted: boolean;
|
|
||||||
/**
|
|
||||||
* The page the app is currently on.
|
|
||||||
*
|
|
||||||
* This object holds information about the type of page we are currently
|
|
||||||
* visiting, and sometimes additional arbitrary page state that may be
|
|
||||||
* relevant to lower-level components.
|
|
||||||
*/
|
|
||||||
current: PageState;
|
|
||||||
/**
|
|
||||||
* The page the app was on before the current page.
|
|
||||||
*
|
|
||||||
* Once the application navigates to another page, the object previously
|
|
||||||
* assigned to this.current will be moved to this.previous, while this.current
|
|
||||||
* is re-initialized.
|
|
||||||
*/
|
|
||||||
previous: PageState;
|
|
||||||
/**
|
|
||||||
* An object that manages modal state.
|
|
||||||
*/
|
|
||||||
modal: ModalManagerState;
|
|
||||||
/**
|
|
||||||
* An object that manages the state of active alerts.
|
|
||||||
*/
|
|
||||||
alerts: AlertManagerState;
|
|
||||||
/**
|
|
||||||
* An object that manages the state of the navigation drawer.
|
|
||||||
*/
|
|
||||||
drawer: Drawer;
|
|
||||||
history: IHistory | null;
|
|
||||||
pane: any;
|
|
||||||
data: ApplicationData;
|
|
||||||
private _title;
|
|
||||||
private _titleCount;
|
|
||||||
private set title(value);
|
|
||||||
get title(): string;
|
|
||||||
private set titleCount(value);
|
|
||||||
get titleCount(): number;
|
|
||||||
/**
|
|
||||||
* The key for an Alert that was shown as a result of an AJAX request error.
|
|
||||||
* If present, it will be dismissed on the next successful request.
|
|
||||||
*/
|
|
||||||
private requestErrorAlert;
|
|
||||||
initialRoute: string;
|
|
||||||
load(payload: Application['data']): void;
|
|
||||||
boot(): void;
|
|
||||||
bootExtensions(extensions: Record<string, {
|
|
||||||
extend?: unknown[];
|
|
||||||
}>): void;
|
|
||||||
protected mount(basePath?: string): void;
|
|
||||||
/**
|
|
||||||
* Get the API response document that has been preloaded into the application.
|
|
||||||
*/
|
|
||||||
preloadedApiDocument<M extends Model>(): ApiResponseSingle<M> | null;
|
|
||||||
preloadedApiDocument<Ms extends Model[]>(): ApiResponsePlural<Ms[number]> | null;
|
|
||||||
/**
|
|
||||||
* Determine the current screen mode, based on our media queries.
|
|
||||||
*/
|
|
||||||
screen(): FlarumScreens;
|
|
||||||
/**
|
|
||||||
* Set the `<title>` of the page.
|
|
||||||
*
|
|
||||||
* @param title New page title
|
|
||||||
*/
|
|
||||||
setTitle(title: string): void;
|
|
||||||
/**
|
|
||||||
* Set a number to display in the `<title>` of the page.
|
|
||||||
*
|
|
||||||
* @param count Number to display in title
|
|
||||||
*/
|
|
||||||
setTitleCount(count: number): void;
|
|
||||||
updateTitle(): void;
|
|
||||||
protected transformRequestOptions<ResponseType>(flarumOptions: FlarumRequestOptions<ResponseType>): InternalFlarumRequestOptions<ResponseType>;
|
|
||||||
/**
|
|
||||||
* Make an AJAX request, handling any low-level errors that may occur.
|
|
||||||
*
|
|
||||||
* @see https://mithril.js.org/request.html
|
|
||||||
*/
|
|
||||||
request<ResponseType>(originalOptions: FlarumRequestOptions<ResponseType>): Promise<ResponseType>;
|
|
||||||
/**
|
|
||||||
* By default, show an error alert, and log the error to the console.
|
|
||||||
*/
|
|
||||||
protected requestErrorCatch<ResponseType>(error: RequestError, customErrorHandler: FlarumRequestOptions<ResponseType>['errorHandler']): Promise<never>;
|
|
||||||
protected requestErrorDefaultHandler(e: unknown, isDebug: boolean, formattedErrors: string[]): void;
|
|
||||||
private showDebug;
|
|
||||||
/**
|
|
||||||
* Construct a URL to the route with the given name.
|
|
||||||
*/
|
|
||||||
route(name: string, params?: Record<string, unknown>): string;
|
|
||||||
}
|
|
114
extensions/akismet/js/dist-typings/framework/core/js/src/common/Component.d.ts
generated
vendored
114
extensions/akismet/js/dist-typings/framework/core/js/src/common/Component.d.ts
generated
vendored
@@ -1,114 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
export interface ComponentAttrs extends Mithril.Attributes {
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `Component` class defines a user interface 'building block'. A component
|
|
||||||
* generates a virtual DOM to be rendered on each redraw.
|
|
||||||
*
|
|
||||||
* Essentially, this is a wrapper for Mithril's components that adds several useful features:
|
|
||||||
*
|
|
||||||
* - In the `oninit` and `onbeforeupdate` lifecycle hooks, we store vnode attrs in `this.attrs.
|
|
||||||
* This allows us to use attrs across components without having to pass the vnode to every single
|
|
||||||
* method.
|
|
||||||
* - The static `initAttrs` method allows a convenient way to provide defaults (or to otherwise modify)
|
|
||||||
* the attrs that have been passed into a component.
|
|
||||||
* - When the component is created in the DOM, we store its DOM element under `this.element`; this lets
|
|
||||||
* us use jQuery to modify child DOM state from internal methods via the `this.$()` method.
|
|
||||||
* - A convenience `component` method, which serves as an alternative to hyperscript and JSX.
|
|
||||||
*
|
|
||||||
* As with other Mithril components, components extending Component can be initialized
|
|
||||||
* and nested using JSX, hyperscript, or a combination of both. The `component` method can also
|
|
||||||
* be used.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* return m('div', <MyComponent foo="bar"><p>Hello World</p></MyComponent>);
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* return m('div', MyComponent.component({foo: 'bar'), m('p', 'Hello World!'));
|
|
||||||
*
|
|
||||||
* @see https://mithril.js.org/components.html
|
|
||||||
*/
|
|
||||||
export default abstract class Component<Attrs extends ComponentAttrs = ComponentAttrs, State = undefined> implements Mithril.ClassComponent<Attrs> {
|
|
||||||
/**
|
|
||||||
* The root DOM element for the component.
|
|
||||||
*/
|
|
||||||
element: Element;
|
|
||||||
/**
|
|
||||||
* The attributes passed into the component.
|
|
||||||
*
|
|
||||||
* @see https://mithril.js.org/components.html#passing-data-to-components
|
|
||||||
*/
|
|
||||||
attrs: Attrs;
|
|
||||||
/**
|
|
||||||
* Class component state that is persisted between redraws.
|
|
||||||
*
|
|
||||||
* Updating this will **not** automatically trigger a redraw, unlike
|
|
||||||
* other frameworks.
|
|
||||||
*
|
|
||||||
* This is different to Vnode state, which is always an instance of your
|
|
||||||
* class component.
|
|
||||||
*
|
|
||||||
* This is `undefined` by default.
|
|
||||||
*/
|
|
||||||
state: State;
|
|
||||||
/**
|
|
||||||
* @inheritdoc
|
|
||||||
*/
|
|
||||||
abstract view(vnode: Mithril.Vnode<Attrs, this>): Mithril.Children;
|
|
||||||
/**
|
|
||||||
* @inheritdoc
|
|
||||||
*/
|
|
||||||
oninit(vnode: Mithril.Vnode<Attrs, this>): void;
|
|
||||||
/**
|
|
||||||
* @inheritdoc
|
|
||||||
*/
|
|
||||||
oncreate(vnode: Mithril.VnodeDOM<Attrs, this>): void;
|
|
||||||
/**
|
|
||||||
* @inheritdoc
|
|
||||||
*/
|
|
||||||
onbeforeupdate(vnode: Mithril.VnodeDOM<Attrs, this>): void;
|
|
||||||
/**
|
|
||||||
* @inheritdoc
|
|
||||||
*/
|
|
||||||
onupdate(vnode: Mithril.VnodeDOM<Attrs, this>): void;
|
|
||||||
/**
|
|
||||||
* @inheritdoc
|
|
||||||
*/
|
|
||||||
onbeforeremove(vnode: Mithril.VnodeDOM<Attrs, this>): void;
|
|
||||||
/**
|
|
||||||
* @inheritdoc
|
|
||||||
*/
|
|
||||||
onremove(vnode: Mithril.VnodeDOM<Attrs, this>): void;
|
|
||||||
/**
|
|
||||||
* Returns a jQuery object for this component's element. If you pass in a
|
|
||||||
* selector string, this method will return a jQuery object, using the current
|
|
||||||
* element as its buffer.
|
|
||||||
*
|
|
||||||
* For example, calling `component.$('li')` will return a jQuery object
|
|
||||||
* containing all of the `li` elements inside the DOM element of this
|
|
||||||
* component.
|
|
||||||
*
|
|
||||||
* @param [selector] a jQuery-compatible selector string
|
|
||||||
* @returns the jQuery object for the DOM node
|
|
||||||
* @final
|
|
||||||
*/
|
|
||||||
$(selector?: string): JQuery;
|
|
||||||
/**
|
|
||||||
* Convenience method to attach a component without JSX.
|
|
||||||
* Has the same effect as calling `m(THIS_CLASS, attrs, children)`.
|
|
||||||
*
|
|
||||||
* @see https://mithril.js.org/hyperscript.html#mselector,-attributes,-children
|
|
||||||
*/
|
|
||||||
static component<SAttrs extends ComponentAttrs = ComponentAttrs>(attrs?: SAttrs, children?: Mithril.Children): Mithril.Vnode;
|
|
||||||
/**
|
|
||||||
* Saves a reference to the vnode attrs after running them through initAttrs,
|
|
||||||
* and checking for common issues.
|
|
||||||
*/
|
|
||||||
private setAttrs;
|
|
||||||
/**
|
|
||||||
* Initialize the component's attrs.
|
|
||||||
*
|
|
||||||
* This can be used to assign default values for missing, optional attrs.
|
|
||||||
*/
|
|
||||||
static initAttrs(attrs: unknown): void;
|
|
||||||
}
|
|
53
extensions/akismet/js/dist-typings/framework/core/js/src/common/Fragment.d.ts
generated
vendored
53
extensions/akismet/js/dist-typings/framework/core/js/src/common/Fragment.d.ts
generated
vendored
@@ -1,53 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
/**
|
|
||||||
* The `Fragment` class represents a chunk of DOM that is rendered once with Mithril and then takes
|
|
||||||
* over control of its own DOM and lifecycle.
|
|
||||||
*
|
|
||||||
* This is very similar to the `Component` wrapper class, but is used for more fine-grained control over
|
|
||||||
* the rendering and display of some significant chunks of the DOM. In contrast to components, fragments
|
|
||||||
* do not offer Mithril's lifecycle hooks.
|
|
||||||
*
|
|
||||||
* Use this when you want to enjoy the benefits of JSX / VDOM for initial rendering, combined with
|
|
||||||
* small helper methods that then make updates to that DOM directly, instead of fully redrawing
|
|
||||||
* everything through Mithril.
|
|
||||||
*
|
|
||||||
* This should only be used when necessary, and only with `m.render`. If you are unsure whether you need
|
|
||||||
* this or `Component, you probably need `Component`.
|
|
||||||
*/
|
|
||||||
export default abstract class Fragment {
|
|
||||||
/**
|
|
||||||
* The root DOM element for the fragment.
|
|
||||||
*/
|
|
||||||
protected element: Element;
|
|
||||||
/**
|
|
||||||
* Returns a jQuery object for this fragment's element. If you pass in a
|
|
||||||
* selector string, this method will return a jQuery object, using the current
|
|
||||||
* element as its buffer.
|
|
||||||
*
|
|
||||||
* For example, calling `fragment.$('li')` will return a jQuery object
|
|
||||||
* containing all of the `li` elements inside the DOM element of this
|
|
||||||
* fragment.
|
|
||||||
*
|
|
||||||
* @param [selector] a jQuery-compatible selector string
|
|
||||||
* @returns the jQuery object for the DOM node
|
|
||||||
* @final
|
|
||||||
*/
|
|
||||||
$(selector?: string): JQuery;
|
|
||||||
/**
|
|
||||||
* Get the renderable virtual DOM that represents the fragment's view.
|
|
||||||
*
|
|
||||||
* This should NOT be overridden by subclasses. Subclasses wishing to define
|
|
||||||
* their virtual DOM should override Fragment#view instead.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* const fragment = new MyFragment();
|
|
||||||
* m.render(document.body, fragment.render());
|
|
||||||
*
|
|
||||||
* @final
|
|
||||||
*/
|
|
||||||
render(): Mithril.Vnode<Mithril.Attributes, this>;
|
|
||||||
/**
|
|
||||||
* Creates a view out of virtual elements.
|
|
||||||
*/
|
|
||||||
abstract view(): Mithril.Vnode<Mithril.Attributes, this>;
|
|
||||||
}
|
|
14
extensions/akismet/js/dist-typings/framework/core/js/src/common/IHistory.d.ts
generated
vendored
14
extensions/akismet/js/dist-typings/framework/core/js/src/common/IHistory.d.ts
generated
vendored
@@ -1,14 +0,0 @@
|
|||||||
export interface HistoryEntry {
|
|
||||||
name: string;
|
|
||||||
title: string;
|
|
||||||
url: string;
|
|
||||||
}
|
|
||||||
export default interface IHistory {
|
|
||||||
canGoBack(): boolean;
|
|
||||||
getCurrent(): HistoryEntry | null;
|
|
||||||
getPrevious(): HistoryEntry | null;
|
|
||||||
push(name: string, title: string, url: string): void;
|
|
||||||
back(): void;
|
|
||||||
backUrl(): string;
|
|
||||||
home(): void;
|
|
||||||
}
|
|
147
extensions/akismet/js/dist-typings/framework/core/js/src/common/Model.d.ts
generated
vendored
147
extensions/akismet/js/dist-typings/framework/core/js/src/common/Model.d.ts
generated
vendored
@@ -1,147 +0,0 @@
|
|||||||
import { FlarumRequestOptions } from './Application';
|
|
||||||
import Store, { ApiPayloadSingle, ApiResponseSingle, MetaInformation } from './Store';
|
|
||||||
export interface ModelIdentifier {
|
|
||||||
type: string;
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
export interface ModelAttributes {
|
|
||||||
[key: string]: unknown;
|
|
||||||
}
|
|
||||||
export interface ModelRelationships {
|
|
||||||
[relationship: string]: {
|
|
||||||
data: ModelIdentifier | ModelIdentifier[];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
export interface UnsavedModelData {
|
|
||||||
type?: string;
|
|
||||||
attributes?: ModelAttributes;
|
|
||||||
relationships?: ModelRelationships;
|
|
||||||
}
|
|
||||||
export interface SavedModelData {
|
|
||||||
type: string;
|
|
||||||
id: string;
|
|
||||||
attributes?: ModelAttributes;
|
|
||||||
relationships?: ModelRelationships;
|
|
||||||
}
|
|
||||||
export declare type ModelData = UnsavedModelData | SavedModelData;
|
|
||||||
export interface SaveRelationships {
|
|
||||||
[relationship: string]: null | Model | Model[];
|
|
||||||
}
|
|
||||||
export interface SaveAttributes {
|
|
||||||
[key: string]: unknown;
|
|
||||||
relationships?: SaveRelationships;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `Model` class represents a local data resource. It provides methods to
|
|
||||||
* persist changes via the API.
|
|
||||||
*/
|
|
||||||
export default abstract class Model {
|
|
||||||
/**
|
|
||||||
* The resource object from the API.
|
|
||||||
*/
|
|
||||||
data: ModelData;
|
|
||||||
/**
|
|
||||||
* The time at which the model's data was last updated. Watching the value
|
|
||||||
* of this property is a fast way to retain/cache a subtree if data hasn't
|
|
||||||
* changed.
|
|
||||||
*/
|
|
||||||
freshness: Date;
|
|
||||||
/**
|
|
||||||
* Whether or not the resource exists on the server.
|
|
||||||
*/
|
|
||||||
exists: boolean;
|
|
||||||
/**
|
|
||||||
* The data store that this resource should be persisted to.
|
|
||||||
*/
|
|
||||||
protected store: Store;
|
|
||||||
/**
|
|
||||||
* @param data A resource object from the API.
|
|
||||||
* @param store The data store that this model should be persisted to.
|
|
||||||
*/
|
|
||||||
constructor(data?: ModelData, store?: Store);
|
|
||||||
/**
|
|
||||||
* Get the model's ID.
|
|
||||||
*
|
|
||||||
* @final
|
|
||||||
*/
|
|
||||||
id(): string | undefined;
|
|
||||||
/**
|
|
||||||
* Get one of the model's attributes.
|
|
||||||
*
|
|
||||||
* @final
|
|
||||||
*/
|
|
||||||
attribute<T = unknown>(attribute: string): T;
|
|
||||||
/**
|
|
||||||
* Merge new data into this model locally.
|
|
||||||
*
|
|
||||||
* @param data A resource object to merge into this model
|
|
||||||
*/
|
|
||||||
pushData(data: ModelData | {
|
|
||||||
relationships?: SaveRelationships;
|
|
||||||
}): this;
|
|
||||||
/**
|
|
||||||
* Merge new attributes into this model locally.
|
|
||||||
*
|
|
||||||
* @param attributes The attributes to merge.
|
|
||||||
*/
|
|
||||||
pushAttributes(attributes: ModelAttributes): void;
|
|
||||||
/**
|
|
||||||
* Merge new attributes into this model, both locally and with persistence.
|
|
||||||
*
|
|
||||||
* @param attributes The attributes to save. If a 'relationships' key
|
|
||||||
* exists, it will be extracted and relationships will also be saved.
|
|
||||||
*/
|
|
||||||
save(attributes: SaveAttributes, options?: Omit<FlarumRequestOptions<ApiPayloadSingle>, 'url'> & {
|
|
||||||
meta?: MetaInformation;
|
|
||||||
}): Promise<ApiResponseSingle<this>>;
|
|
||||||
/**
|
|
||||||
* Send a request to delete the resource.
|
|
||||||
*
|
|
||||||
* @param body Data to send along with the DELETE request.
|
|
||||||
*/
|
|
||||||
delete(body?: FlarumRequestOptions<void>['body'], options?: Omit<FlarumRequestOptions<void>, 'url'>): Promise<void>;
|
|
||||||
/**
|
|
||||||
* Construct a path to the API endpoint for this resource.
|
|
||||||
*/
|
|
||||||
protected apiEndpoint(): string;
|
|
||||||
protected copyData(): ModelData;
|
|
||||||
protected rawRelationship<M extends Model>(relationship: string): undefined | ModelIdentifier;
|
|
||||||
protected rawRelationship<M extends Model[]>(relationship: string): undefined | ModelIdentifier[];
|
|
||||||
/**
|
|
||||||
* Generate a function which returns the value of the given attribute.
|
|
||||||
*
|
|
||||||
* @param transform A function to transform the attribute value
|
|
||||||
*/
|
|
||||||
static attribute<T>(name: string): () => T;
|
|
||||||
static attribute<T, O = unknown>(name: string, transform: (attr: O) => T): () => T;
|
|
||||||
/**
|
|
||||||
* Generate a function which returns the value of the given has-one
|
|
||||||
* relationship.
|
|
||||||
*
|
|
||||||
* @return false if no information about the
|
|
||||||
* relationship exists; undefined if the relationship exists but the model
|
|
||||||
* has not been loaded; or the model if it has been loaded.
|
|
||||||
*/
|
|
||||||
static hasOne<M extends Model>(name: string): () => M | false;
|
|
||||||
static hasOne<M extends Model | null>(name: string): () => M | null | false;
|
|
||||||
/**
|
|
||||||
* Generate a function which returns the value of the given has-many
|
|
||||||
* relationship.
|
|
||||||
*
|
|
||||||
* @return false if no information about the relationship
|
|
||||||
* exists; an array if it does, containing models if they have been
|
|
||||||
* loaded, and undefined for those that have not.
|
|
||||||
*/
|
|
||||||
static hasMany<M extends Model>(name: string): () => (M | undefined)[] | false;
|
|
||||||
/**
|
|
||||||
* Transform the given value into a Date object.
|
|
||||||
*/
|
|
||||||
static transformDate(value: string): Date;
|
|
||||||
static transformDate(value: string | null): Date | null;
|
|
||||||
static transformDate(value: string | undefined): Date | undefined;
|
|
||||||
static transformDate(value: string | null | undefined): Date | null | undefined;
|
|
||||||
/**
|
|
||||||
* Get a resource identifier object for the given model.
|
|
||||||
*/
|
|
||||||
protected static getIdentifier(model: Model): ModelIdentifier;
|
|
||||||
}
|
|
33
extensions/akismet/js/dist-typings/framework/core/js/src/common/Session.d.ts
generated
vendored
33
extensions/akismet/js/dist-typings/framework/core/js/src/common/Session.d.ts
generated
vendored
@@ -1,33 +0,0 @@
|
|||||||
import User from './models/User';
|
|
||||||
import { FlarumRequestOptions } from './Application';
|
|
||||||
export declare type LoginParams = {
|
|
||||||
/**
|
|
||||||
* The username/email
|
|
||||||
*/
|
|
||||||
identification: string;
|
|
||||||
password: string;
|
|
||||||
remember: boolean;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* The `Session` class defines the current user session. It stores a reference
|
|
||||||
* to the current authenticated user, and provides methods to log in/out.
|
|
||||||
*/
|
|
||||||
export default class Session {
|
|
||||||
/**
|
|
||||||
* The current authenticated user.
|
|
||||||
*/
|
|
||||||
user: User | null;
|
|
||||||
/**
|
|
||||||
* The CSRF token.
|
|
||||||
*/
|
|
||||||
csrfToken: string;
|
|
||||||
constructor(user: User | null, csrfToken: string);
|
|
||||||
/**
|
|
||||||
* Attempt to log in a user.
|
|
||||||
*/
|
|
||||||
login(body: LoginParams, options?: Omit<FlarumRequestOptions<any>, 'url' | 'body' | 'method'>): Promise<any>;
|
|
||||||
/**
|
|
||||||
* Log the user out.
|
|
||||||
*/
|
|
||||||
logout(): void;
|
|
||||||
}
|
|
127
extensions/akismet/js/dist-typings/framework/core/js/src/common/Store.d.ts
generated
vendored
127
extensions/akismet/js/dist-typings/framework/core/js/src/common/Store.d.ts
generated
vendored
@@ -1,127 +0,0 @@
|
|||||||
import { FlarumRequestOptions } from './Application';
|
|
||||||
import Model, { ModelData, SavedModelData } from './Model';
|
|
||||||
export interface MetaInformation {
|
|
||||||
[key: string]: any;
|
|
||||||
}
|
|
||||||
export interface ApiQueryParamsSingle {
|
|
||||||
fields?: string[];
|
|
||||||
include?: string;
|
|
||||||
bySlug?: boolean;
|
|
||||||
meta?: MetaInformation;
|
|
||||||
}
|
|
||||||
export interface ApiQueryParamsPlural {
|
|
||||||
fields?: string[];
|
|
||||||
include?: string;
|
|
||||||
filter?: {
|
|
||||||
q: string;
|
|
||||||
} | Record<string, string>;
|
|
||||||
page?: {
|
|
||||||
near?: number;
|
|
||||||
offset?: number;
|
|
||||||
number?: number;
|
|
||||||
limit?: number;
|
|
||||||
size?: number;
|
|
||||||
};
|
|
||||||
sort?: string;
|
|
||||||
meta?: MetaInformation;
|
|
||||||
}
|
|
||||||
export declare type ApiQueryParams = ApiQueryParamsPlural | ApiQueryParamsSingle;
|
|
||||||
export interface ApiPayloadSingle {
|
|
||||||
data: SavedModelData;
|
|
||||||
included?: SavedModelData[];
|
|
||||||
meta?: MetaInformation;
|
|
||||||
}
|
|
||||||
export interface ApiPayloadPlural {
|
|
||||||
data: SavedModelData[];
|
|
||||||
included?: SavedModelData[];
|
|
||||||
links?: {
|
|
||||||
first: string;
|
|
||||||
next?: string;
|
|
||||||
prev?: string;
|
|
||||||
};
|
|
||||||
meta?: MetaInformation;
|
|
||||||
}
|
|
||||||
export declare type ApiPayload = ApiPayloadSingle | ApiPayloadPlural;
|
|
||||||
export declare type ApiResponseSingle<M extends Model> = M & {
|
|
||||||
payload: ApiPayloadSingle;
|
|
||||||
};
|
|
||||||
export declare type ApiResponsePlural<M extends Model> = M[] & {
|
|
||||||
payload: ApiPayloadPlural;
|
|
||||||
};
|
|
||||||
export declare type ApiResponse<M extends Model> = ApiResponseSingle<M> | ApiResponsePlural<M>;
|
|
||||||
interface ApiQueryRequestOptions<ResponseType> extends Omit<FlarumRequestOptions<ResponseType>, 'url'> {
|
|
||||||
}
|
|
||||||
interface StoreData {
|
|
||||||
[type: string]: Partial<Record<string, Model>>;
|
|
||||||
}
|
|
||||||
export declare function payloadIsPlural(payload: ApiPayload): payload is ApiPayloadPlural;
|
|
||||||
/**
|
|
||||||
* The `Store` class defines a local data store, and provides methods to
|
|
||||||
* retrieve data from the API.
|
|
||||||
*/
|
|
||||||
export default class Store {
|
|
||||||
/**
|
|
||||||
* The local data store. A tree of resource types to IDs, such that
|
|
||||||
* accessing data[type][id] will return the model for that type/ID.
|
|
||||||
*/
|
|
||||||
protected data: StoreData;
|
|
||||||
/**
|
|
||||||
* The model registry. A map of resource types to the model class that
|
|
||||||
* should be used to represent resources of that type.
|
|
||||||
*/
|
|
||||||
models: Record<string, typeof Model>;
|
|
||||||
constructor(models: Record<string, typeof Model>);
|
|
||||||
/**
|
|
||||||
* Push resources contained within an API payload into the store.
|
|
||||||
*
|
|
||||||
* @return The model(s) representing the resource(s) contained
|
|
||||||
* within the 'data' key of the payload.
|
|
||||||
*/
|
|
||||||
pushPayload<M extends Model>(payload: ApiPayloadSingle): ApiResponseSingle<M>;
|
|
||||||
pushPayload<Ms extends Model[]>(payload: ApiPayloadPlural): ApiResponsePlural<Ms[number]>;
|
|
||||||
/**
|
|
||||||
* Create a model to represent a resource object (or update an existing one),
|
|
||||||
* and push it into the store.
|
|
||||||
*
|
|
||||||
* @param data The resource object
|
|
||||||
* @return The model, or null if no model class has been
|
|
||||||
* registered for this resource type.
|
|
||||||
*/
|
|
||||||
pushObject<M extends Model>(data: SavedModelData): M | null;
|
|
||||||
pushObject<M extends Model>(data: SavedModelData, allowUnregistered: false): M;
|
|
||||||
/**
|
|
||||||
* Make a request to the API to find record(s) of a specific type.
|
|
||||||
*/
|
|
||||||
find<M extends Model>(type: string, params?: ApiQueryParamsSingle): Promise<ApiResponseSingle<M>>;
|
|
||||||
find<Ms extends Model[]>(type: string, params?: ApiQueryParamsPlural): Promise<ApiResponsePlural<Ms[number]>>;
|
|
||||||
find<M extends Model>(type: string, id: string, params?: ApiQueryParamsSingle, options?: ApiQueryRequestOptions<ApiPayloadSingle>): Promise<ApiResponseSingle<M>>;
|
|
||||||
find<Ms extends Model[]>(type: string, ids: string[], params?: ApiQueryParamsPlural, options?: ApiQueryRequestOptions<ApiPayloadPlural>): Promise<ApiResponsePlural<Ms[number]>>;
|
|
||||||
/**
|
|
||||||
* Get a record from the store by ID.
|
|
||||||
*/
|
|
||||||
getById<M extends Model>(type: string, id: string): M | undefined;
|
|
||||||
/**
|
|
||||||
* Get a record from the store by the value of a model attribute.
|
|
||||||
*
|
|
||||||
* @param type The resource type.
|
|
||||||
* @param key The name of the method on the model.
|
|
||||||
* @param value The value of the model attribute.
|
|
||||||
*/
|
|
||||||
getBy<M extends Model, T = unknown>(type: string, key: keyof M, value: T): M | undefined;
|
|
||||||
/**
|
|
||||||
* Get all loaded records of a specific type.
|
|
||||||
*/
|
|
||||||
all<M extends Model>(type: string): M[];
|
|
||||||
/**
|
|
||||||
* Remove the given model from the store.
|
|
||||||
*/
|
|
||||||
remove(model: Model): void;
|
|
||||||
/**
|
|
||||||
* Create a new record of the given type.
|
|
||||||
*
|
|
||||||
* @param type The resource type
|
|
||||||
* @param data Any data to initialize the model with
|
|
||||||
*/
|
|
||||||
createRecord<M extends Model>(type: string, data?: ModelData): M;
|
|
||||||
}
|
|
||||||
export {};
|
|
41
extensions/akismet/js/dist-typings/framework/core/js/src/common/Translator.d.ts
generated
vendored
41
extensions/akismet/js/dist-typings/framework/core/js/src/common/Translator.d.ts
generated
vendored
@@ -1,41 +0,0 @@
|
|||||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
|
||||||
import { RichMessageFormatter } from '@askvortsov/rich-icu-message-formatter';
|
|
||||||
import { pluralTypeHandler, selectTypeHandler } from '@ultraq/icu-message-formatter';
|
|
||||||
declare type Translations = Record<string, string>;
|
|
||||||
declare type TranslatorParameters = Record<string, unknown>;
|
|
||||||
export default class Translator {
|
|
||||||
/**
|
|
||||||
* A map of translation keys to their translated values.
|
|
||||||
*/
|
|
||||||
translations: Translations;
|
|
||||||
/**
|
|
||||||
* The underlying ICU MessageFormatter util.
|
|
||||||
*/
|
|
||||||
protected formatter: RichMessageFormatter;
|
|
||||||
/**
|
|
||||||
* Sets the formatter's locale to the provided value.
|
|
||||||
*/
|
|
||||||
setLocale(locale: string): void;
|
|
||||||
/**
|
|
||||||
* Returns the formatter's current locale.
|
|
||||||
*/
|
|
||||||
getLocale(): string | null;
|
|
||||||
addTranslations(translations: Translations): void;
|
|
||||||
/**
|
|
||||||
* An extensible entrypoint for extenders to register type handlers for translations.
|
|
||||||
*/
|
|
||||||
protected formatterTypeHandlers(): {
|
|
||||||
plural: typeof pluralTypeHandler;
|
|
||||||
select: typeof selectTypeHandler;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* A temporary system to preprocess parameters.
|
|
||||||
* Should not be used by extensions.
|
|
||||||
* TODO: An extender will be added in v1.x.
|
|
||||||
*
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
protected preprocessParameters(parameters: TranslatorParameters): TranslatorParameters;
|
|
||||||
trans(id: string, parameters?: TranslatorParameters): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
}
|
|
||||||
export {};
|
|
6
extensions/akismet/js/dist-typings/framework/core/js/src/common/app.d.ts
generated
vendored
6
extensions/akismet/js/dist-typings/framework/core/js/src/common/app.d.ts
generated
vendored
@@ -1,6 +0,0 @@
|
|||||||
import type Application from './Application';
|
|
||||||
declare const _default: Application;
|
|
||||||
/**
|
|
||||||
* The instance of Application within the common namespace.
|
|
||||||
*/
|
|
||||||
export default _default;
|
|
174
extensions/akismet/js/dist-typings/framework/core/js/src/common/compat.d.ts
generated
vendored
174
extensions/akismet/js/dist-typings/framework/core/js/src/common/compat.d.ts
generated
vendored
@@ -1,174 +0,0 @@
|
|||||||
import Session from './Session';
|
|
||||||
import Store from './Store';
|
|
||||||
import BasicEditorDriver from './utils/BasicEditorDriver';
|
|
||||||
import liveHumanTimes from './utils/liveHumanTimes';
|
|
||||||
import ItemList from './utils/ItemList';
|
|
||||||
import mixin from './utils/mixin';
|
|
||||||
import humanTime from './utils/humanTime';
|
|
||||||
import computed from './utils/computed';
|
|
||||||
import insertText from './utils/insertText';
|
|
||||||
import styleSelectedText from './utils/styleSelectedText';
|
|
||||||
import Drawer from './utils/Drawer';
|
|
||||||
import anchorScroll from './utils/anchorScroll';
|
|
||||||
import RequestError from './utils/RequestError';
|
|
||||||
import abbreviateNumber from './utils/abbreviateNumber';
|
|
||||||
import escapeRegExp from './utils/escapeRegExp';
|
|
||||||
import * as string from './utils/string';
|
|
||||||
import * as ThrottleDebounce from './utils/throttleDebounce';
|
|
||||||
import Stream from './utils/Stream';
|
|
||||||
import SubtreeRetainer from './utils/SubtreeRetainer';
|
|
||||||
import setRouteWithForcedRefresh from './utils/setRouteWithForcedRefresh';
|
|
||||||
import extract from './utils/extract';
|
|
||||||
import ScrollListener from './utils/ScrollListener';
|
|
||||||
import stringToColor from './utils/stringToColor';
|
|
||||||
import subclassOf from './utils/subclassOf';
|
|
||||||
import patchMithril from './utils/patchMithril';
|
|
||||||
import proxifyCompat from './utils/proxifyCompat';
|
|
||||||
import extractText from './utils/extractText';
|
|
||||||
import formatNumber from './utils/formatNumber';
|
|
||||||
import mapRoutes from './utils/mapRoutes';
|
|
||||||
import * as FocusTrap from './utils/focusTrap';
|
|
||||||
import Notification from './models/Notification';
|
|
||||||
import User from './models/User';
|
|
||||||
import Post from './models/Post';
|
|
||||||
import Discussion from './models/Discussion';
|
|
||||||
import Group from './models/Group';
|
|
||||||
import Forum from './models/Forum';
|
|
||||||
import Component from './Component';
|
|
||||||
import Translator from './Translator';
|
|
||||||
import AlertManager from './components/AlertManager';
|
|
||||||
import Page from './components/Page';
|
|
||||||
import Switch from './components/Switch';
|
|
||||||
import Badge from './components/Badge';
|
|
||||||
import LoadingIndicator from './components/LoadingIndicator';
|
|
||||||
import Placeholder from './components/Placeholder';
|
|
||||||
import Separator from './components/Separator';
|
|
||||||
import Dropdown from './components/Dropdown';
|
|
||||||
import SplitDropdown from './components/SplitDropdown';
|
|
||||||
import RequestErrorModal from './components/RequestErrorModal';
|
|
||||||
import FieldSet from './components/FieldSet';
|
|
||||||
import Select from './components/Select';
|
|
||||||
import Navigation from './components/Navigation';
|
|
||||||
import Alert from './components/Alert';
|
|
||||||
import Link from './components/Link';
|
|
||||||
import LinkButton from './components/LinkButton';
|
|
||||||
import Checkbox from './components/Checkbox';
|
|
||||||
import ColorPreviewInput from './components/ColorPreviewInput';
|
|
||||||
import SelectDropdown from './components/SelectDropdown';
|
|
||||||
import ModalManager from './components/ModalManager';
|
|
||||||
import Button from './components/Button';
|
|
||||||
import Modal from './components/Modal';
|
|
||||||
import GroupBadge from './components/GroupBadge';
|
|
||||||
import TextEditor from './components/TextEditor';
|
|
||||||
import TextEditorButton from './components/TextEditorButton';
|
|
||||||
import EditUserModal from './components/EditUserModal';
|
|
||||||
import Tooltip from './components/Tooltip';
|
|
||||||
import Model from './Model';
|
|
||||||
import Application from './Application';
|
|
||||||
import fullTime from './helpers/fullTime';
|
|
||||||
import avatar from './helpers/avatar';
|
|
||||||
import icon from './helpers/icon';
|
|
||||||
import humanTimeHelper from './helpers/humanTime';
|
|
||||||
import punctuateSeries from './helpers/punctuateSeries';
|
|
||||||
import highlight from './helpers/highlight';
|
|
||||||
import username from './helpers/username';
|
|
||||||
import userOnline from './helpers/userOnline';
|
|
||||||
import listItems from './helpers/listItems';
|
|
||||||
import Fragment from './Fragment';
|
|
||||||
import DefaultResolver from './resolvers/DefaultResolver';
|
|
||||||
import PaginatedListState from './states/PaginatedListState';
|
|
||||||
import isObject from './utils/isObject';
|
|
||||||
declare const _default: {
|
|
||||||
extend: any;
|
|
||||||
Session: typeof Session;
|
|
||||||
Store: typeof Store;
|
|
||||||
'utils/BasicEditorDriver': typeof BasicEditorDriver;
|
|
||||||
'utils/evented': {
|
|
||||||
handlers: Record<string, unknown>;
|
|
||||||
getHandlers(event: string): Function[];
|
|
||||||
trigger(event: string, ...args: any[]): void;
|
|
||||||
on(event: string, handler: Function): void;
|
|
||||||
one(event: string, handler: Function): void;
|
|
||||||
off(event: string, handler: Function): void;
|
|
||||||
};
|
|
||||||
'utils/liveHumanTimes': typeof liveHumanTimes;
|
|
||||||
'utils/ItemList': typeof ItemList;
|
|
||||||
'utils/mixin': typeof mixin;
|
|
||||||
'utils/humanTime': typeof humanTime;
|
|
||||||
'utils/computed': typeof computed;
|
|
||||||
'utils/insertText': typeof insertText;
|
|
||||||
'utils/styleSelectedText': typeof styleSelectedText;
|
|
||||||
'utils/Drawer': typeof Drawer;
|
|
||||||
'utils/anchorScroll': typeof anchorScroll;
|
|
||||||
'utils/RequestError': typeof RequestError;
|
|
||||||
'utils/abbreviateNumber': typeof abbreviateNumber;
|
|
||||||
'utils/string': typeof string;
|
|
||||||
'utils/SubtreeRetainer': typeof SubtreeRetainer;
|
|
||||||
'utils/escapeRegExp': typeof escapeRegExp;
|
|
||||||
'utils/extract': typeof extract;
|
|
||||||
'utils/ScrollListener': typeof ScrollListener;
|
|
||||||
'utils/stringToColor': typeof stringToColor;
|
|
||||||
'utils/Stream': typeof Stream;
|
|
||||||
'utils/subclassOf': typeof subclassOf;
|
|
||||||
'utils/setRouteWithForcedRefresh': typeof setRouteWithForcedRefresh;
|
|
||||||
'utils/patchMithril': typeof patchMithril;
|
|
||||||
'utils/proxifyCompat': typeof proxifyCompat;
|
|
||||||
'utils/classList': (...classes: import("clsx").ClassValue[]) => string;
|
|
||||||
'utils/extractText': typeof extractText;
|
|
||||||
'utils/formatNumber': typeof formatNumber;
|
|
||||||
'utils/mapRoutes': typeof mapRoutes;
|
|
||||||
'utils/withAttr': (key: string, cb: Function) => (this: Element) => void;
|
|
||||||
'utils/throttleDebounce': typeof ThrottleDebounce;
|
|
||||||
'utils/isObject': typeof isObject;
|
|
||||||
'utils/focusTrap': typeof FocusTrap;
|
|
||||||
'models/Notification': typeof Notification;
|
|
||||||
'models/User': typeof User;
|
|
||||||
'models/Post': typeof Post;
|
|
||||||
'models/Discussion': typeof Discussion;
|
|
||||||
'models/Group': typeof Group;
|
|
||||||
'models/Forum': typeof Forum;
|
|
||||||
Component: typeof Component;
|
|
||||||
Fragment: typeof Fragment;
|
|
||||||
Translator: typeof Translator;
|
|
||||||
'components/AlertManager': typeof AlertManager;
|
|
||||||
'components/Page': typeof Page;
|
|
||||||
'components/Switch': typeof Switch;
|
|
||||||
'components/Badge': typeof Badge;
|
|
||||||
'components/LoadingIndicator': typeof LoadingIndicator;
|
|
||||||
'components/Placeholder': typeof Placeholder;
|
|
||||||
'components/Separator': typeof Separator;
|
|
||||||
'components/Dropdown': typeof Dropdown;
|
|
||||||
'components/SplitDropdown': typeof SplitDropdown;
|
|
||||||
'components/RequestErrorModal': typeof RequestErrorModal;
|
|
||||||
'components/FieldSet': typeof FieldSet;
|
|
||||||
'components/Select': typeof Select;
|
|
||||||
'components/Navigation': typeof Navigation;
|
|
||||||
'components/Alert': typeof Alert;
|
|
||||||
'components/Link': typeof Link;
|
|
||||||
'components/LinkButton': typeof LinkButton;
|
|
||||||
'components/Checkbox': typeof Checkbox;
|
|
||||||
'components/ColorPreviewInput': typeof ColorPreviewInput;
|
|
||||||
'components/SelectDropdown': typeof SelectDropdown;
|
|
||||||
'components/ModalManager': typeof ModalManager;
|
|
||||||
'components/Button': typeof Button;
|
|
||||||
'components/Modal': typeof Modal;
|
|
||||||
'components/GroupBadge': typeof GroupBadge;
|
|
||||||
'components/TextEditor': typeof TextEditor;
|
|
||||||
'components/TextEditorButton': typeof TextEditorButton;
|
|
||||||
'components/Tooltip': typeof Tooltip;
|
|
||||||
'components/EditUserModal': typeof EditUserModal;
|
|
||||||
Model: typeof Model;
|
|
||||||
Application: typeof Application;
|
|
||||||
'helpers/fullTime': typeof fullTime;
|
|
||||||
'helpers/avatar': typeof avatar;
|
|
||||||
'helpers/icon': typeof icon;
|
|
||||||
'helpers/humanTime': typeof humanTimeHelper;
|
|
||||||
'helpers/punctuateSeries': typeof punctuateSeries;
|
|
||||||
'helpers/highlight': typeof highlight;
|
|
||||||
'helpers/username': typeof username;
|
|
||||||
'helpers/userOnline': typeof userOnline;
|
|
||||||
'helpers/listItems': typeof listItems;
|
|
||||||
'resolvers/DefaultResolver': typeof DefaultResolver;
|
|
||||||
'states/PaginatedListState': typeof PaginatedListState;
|
|
||||||
};
|
|
||||||
export default _default;
|
|
19
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Alert.d.ts
generated
vendored
19
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Alert.d.ts
generated
vendored
@@ -1,19 +0,0 @@
|
|||||||
import Component, { ComponentAttrs } from '../Component';
|
|
||||||
import type Mithril from 'mithril';
|
|
||||||
export interface AlertAttrs extends ComponentAttrs {
|
|
||||||
/** The type of alert this is. Will be used to give the alert a class name of `Alert--{type}`. */
|
|
||||||
type?: string;
|
|
||||||
/** An array of controls to show in the alert. */
|
|
||||||
controls?: Mithril.Children;
|
|
||||||
/** Whether or not the alert can be dismissed. */
|
|
||||||
dismissible?: boolean;
|
|
||||||
/** A callback to run when the alert is dismissed */
|
|
||||||
ondismiss?: Function;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `Alert` component represents an alert box, which contains a message,
|
|
||||||
* some controls, and may be dismissible.
|
|
||||||
*/
|
|
||||||
export default class Alert<T extends AlertAttrs = AlertAttrs> extends Component<T> {
|
|
||||||
view(vnode: Mithril.VnodeDOM<T, this>): JSX.Element;
|
|
||||||
}
|
|
@@ -1,14 +0,0 @@
|
|||||||
import Component, { ComponentAttrs } from '../Component';
|
|
||||||
import AlertManagerState from '../states/AlertManagerState';
|
|
||||||
import type Mithril from 'mithril';
|
|
||||||
export interface IAlertManagerAttrs extends ComponentAttrs {
|
|
||||||
state: AlertManagerState;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `AlertManager` component provides an area in which `Alert` components can
|
|
||||||
* be shown and dismissed.
|
|
||||||
*/
|
|
||||||
export default class AlertManager<CustomAttrs extends IAlertManagerAttrs = IAlertManagerAttrs> extends Component<CustomAttrs, AlertManagerState> {
|
|
||||||
oninit(vnode: Mithril.Vnode<CustomAttrs, this>): void;
|
|
||||||
view(): JSX.Element;
|
|
||||||
}
|
|
24
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Badge.d.ts
generated
vendored
24
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Badge.d.ts
generated
vendored
@@ -1,24 +0,0 @@
|
|||||||
/// <reference types="mithril" />
|
|
||||||
import Component, { ComponentAttrs } from '../Component';
|
|
||||||
export interface IBadgeAttrs extends ComponentAttrs {
|
|
||||||
icon: string;
|
|
||||||
type?: string;
|
|
||||||
label?: string;
|
|
||||||
color?: string;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `Badge` component represents a user/discussion badge, indicating some
|
|
||||||
* status (e.g. a discussion is stickied, a user is an admin).
|
|
||||||
*
|
|
||||||
* A badge may have the following special attrs:
|
|
||||||
*
|
|
||||||
* - `type` The type of badge this is. This will be used to give the badge a
|
|
||||||
* class name of `Badge--{type}`.
|
|
||||||
* - `icon` The name of an icon to show inside the badge.
|
|
||||||
* - `label`
|
|
||||||
*
|
|
||||||
* All other attrs will be assigned as attributes on the badge element.
|
|
||||||
*/
|
|
||||||
export default class Badge<CustomAttrs extends IBadgeAttrs = IBadgeAttrs> extends Component<CustomAttrs> {
|
|
||||||
view(): JSX.Element;
|
|
||||||
}
|
|
69
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Button.d.ts
generated
vendored
69
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Button.d.ts
generated
vendored
@@ -1,69 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
import Component, { ComponentAttrs } from '../Component';
|
|
||||||
export interface IButtonAttrs extends ComponentAttrs {
|
|
||||||
/**
|
|
||||||
* Class(es) of an optional icon to be rendered within the button.
|
|
||||||
*
|
|
||||||
* If provided, the button will gain a `has-icon` class.
|
|
||||||
*/
|
|
||||||
icon?: string;
|
|
||||||
/**
|
|
||||||
* Disables button from user input.
|
|
||||||
*
|
|
||||||
* Default: `false`
|
|
||||||
*/
|
|
||||||
disabled?: boolean;
|
|
||||||
/**
|
|
||||||
* Show a loading spinner within the button.
|
|
||||||
*
|
|
||||||
* If `true`, also disables the button.
|
|
||||||
*
|
|
||||||
* Default: `false`
|
|
||||||
*/
|
|
||||||
loading?: boolean;
|
|
||||||
/**
|
|
||||||
* **DEPRECATED:** Please use the `aria-label` attribute instead. For tooltips, use
|
|
||||||
* the `<Tooltip>` component.
|
|
||||||
*
|
|
||||||
* Accessible text for the button. This should always be present if the button only
|
|
||||||
* contains an icon.
|
|
||||||
*
|
|
||||||
* The textual content of this attribute is passed to the DOM element as `aria-label`.
|
|
||||||
*
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
title?: string | Mithril.ChildArray;
|
|
||||||
/**
|
|
||||||
* Accessible text for the button. This should always be present if the button only
|
|
||||||
* contains an icon.
|
|
||||||
*
|
|
||||||
* The textual content of this attribute is passed to the DOM element as `aria-label`.
|
|
||||||
*/
|
|
||||||
'aria-label'?: string | Mithril.ChildArray;
|
|
||||||
/**
|
|
||||||
* Button type.
|
|
||||||
*
|
|
||||||
* Default: `"button"`
|
|
||||||
*
|
|
||||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type
|
|
||||||
*/
|
|
||||||
type?: string;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `Button` component defines an element which, when clicked, performs an
|
|
||||||
* action.
|
|
||||||
*
|
|
||||||
* Other attrs will be assigned as attributes on the `<button>` element.
|
|
||||||
*
|
|
||||||
* Note that a Button has no default class names. This is because a Button can
|
|
||||||
* be used to represent any generic clickable control, like a menu item. Common
|
|
||||||
* styles can be applied by providing `className="Button"` to the Button component.
|
|
||||||
*/
|
|
||||||
export default class Button<CustomAttrs extends IButtonAttrs = IButtonAttrs> extends Component<CustomAttrs> {
|
|
||||||
view(vnode: Mithril.VnodeDOM<CustomAttrs, this>): JSX.Element;
|
|
||||||
oncreate(vnode: Mithril.VnodeDOM<CustomAttrs, this>): void;
|
|
||||||
/**
|
|
||||||
* Get the template for the button's content.
|
|
||||||
*/
|
|
||||||
protected getButtonContent(children: Mithril.Children): Mithril.ChildArray;
|
|
||||||
}
|
|
31
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Checkbox.d.ts
generated
vendored
31
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Checkbox.d.ts
generated
vendored
@@ -1,31 +0,0 @@
|
|||||||
import Component, { ComponentAttrs } from '../Component';
|
|
||||||
import type Mithril from 'mithril';
|
|
||||||
export interface ICheckboxAttrs extends ComponentAttrs {
|
|
||||||
state?: boolean;
|
|
||||||
loading?: boolean;
|
|
||||||
disabled?: boolean;
|
|
||||||
onchange: (checked: boolean, component: Checkbox<this>) => void;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `Checkbox` component defines a checkbox input.
|
|
||||||
*
|
|
||||||
* ### Attrs
|
|
||||||
*
|
|
||||||
* - `state` Whether or not the checkbox is checked.
|
|
||||||
* - `className` The class name for the root element.
|
|
||||||
* - `disabled` Whether or not the checkbox is disabled.
|
|
||||||
* - `loading` Whether or not the checkbox is loading.
|
|
||||||
* - `onchange` A callback to run when the checkbox is checked/unchecked.
|
|
||||||
* - `children` A text label to display next to the checkbox.
|
|
||||||
*/
|
|
||||||
export default class Checkbox<CustomAttrs extends ICheckboxAttrs = ICheckboxAttrs> extends Component<CustomAttrs> {
|
|
||||||
view(vnode: Mithril.Vnode<CustomAttrs, this>): JSX.Element;
|
|
||||||
/**
|
|
||||||
* Get the template for the checkbox's display (tick/cross icon).
|
|
||||||
*/
|
|
||||||
protected getDisplay(): Mithril.Children;
|
|
||||||
/**
|
|
||||||
* Run a callback when the state of the checkbox is changed.
|
|
||||||
*/
|
|
||||||
protected onchange(checked: boolean): void;
|
|
||||||
}
|
|
@@ -1,5 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
import Component, { ComponentAttrs } from '../Component';
|
|
||||||
export default class ColorPreviewInput extends Component {
|
|
||||||
view(vnode: Mithril.Vnode<ComponentAttrs, this>): JSX.Element;
|
|
||||||
}
|
|
@@ -1,19 +0,0 @@
|
|||||||
/**
|
|
||||||
* The `ConfirmDocumentUnload` component can be used to register a global
|
|
||||||
* event handler that prevents closing the browser window/tab based on the
|
|
||||||
* return value of a given callback prop.
|
|
||||||
*
|
|
||||||
* ### Attrs
|
|
||||||
*
|
|
||||||
* - `when` - a callback returning true when the browser should prompt for
|
|
||||||
* confirmation before closing the window/tab
|
|
||||||
*/
|
|
||||||
export default class ConfirmDocumentUnload extends Component<import("../Component").ComponentAttrs, undefined> {
|
|
||||||
constructor();
|
|
||||||
handler(): any;
|
|
||||||
oncreate(vnode: any): void;
|
|
||||||
boundHandler: (() => any) | undefined;
|
|
||||||
onremove(vnode: any): void;
|
|
||||||
view(vnode: any): JSX.Element;
|
|
||||||
}
|
|
||||||
import Component from "../Component";
|
|
41
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Dropdown.d.ts
generated
vendored
41
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Dropdown.d.ts
generated
vendored
@@ -1,41 +0,0 @@
|
|||||||
/**
|
|
||||||
* The `Dropdown` component displays a button which, when clicked, shows a
|
|
||||||
* dropdown menu beneath it.
|
|
||||||
*
|
|
||||||
* ### Attrs
|
|
||||||
*
|
|
||||||
* - `buttonClassName` A class name to apply to the dropdown toggle button.
|
|
||||||
* - `menuClassName` A class name to apply to the dropdown menu.
|
|
||||||
* - `icon` The name of an icon to show in the dropdown toggle button.
|
|
||||||
* - `caretIcon` The name of an icon to show on the right of the button.
|
|
||||||
* - `label` The label of the dropdown toggle button. Defaults to 'Controls'.
|
|
||||||
* - `accessibleToggleLabel` The label used to describe the dropdown toggle button to assistive readers. Defaults to 'Toggle dropdown menu'.
|
|
||||||
* - `onhide`
|
|
||||||
* - `onshow`
|
|
||||||
*
|
|
||||||
* The children will be displayed as a list inside of the dropdown menu.
|
|
||||||
*/
|
|
||||||
export default class Dropdown extends Component<import("../Component").ComponentAttrs, undefined> {
|
|
||||||
static initAttrs(attrs: any): void;
|
|
||||||
constructor();
|
|
||||||
oninit(vnode: any): void;
|
|
||||||
showing: boolean | undefined;
|
|
||||||
view(vnode: any): JSX.Element;
|
|
||||||
oncreate(vnode: any): void;
|
|
||||||
/**
|
|
||||||
* Get the template for the button.
|
|
||||||
*
|
|
||||||
* @return {import('mithril').Children}
|
|
||||||
* @protected
|
|
||||||
*/
|
|
||||||
protected getButton(children: any): import('mithril').Children;
|
|
||||||
/**
|
|
||||||
* Get the template for the button's content.
|
|
||||||
*
|
|
||||||
* @return {import('mithril').Children}
|
|
||||||
* @protected
|
|
||||||
*/
|
|
||||||
protected getButtonContent(children: any): import('mithril').Children;
|
|
||||||
getMenu(items: any): JSX.Element;
|
|
||||||
}
|
|
||||||
import Component from "../Component";
|
|
@@ -1,31 +0,0 @@
|
|||||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
|
||||||
import Modal, { IInternalModalAttrs } from './Modal';
|
|
||||||
import ItemList from '../utils/ItemList';
|
|
||||||
import Stream from '../utils/Stream';
|
|
||||||
import type Mithril from 'mithril';
|
|
||||||
import type User from '../models/User';
|
|
||||||
import type { SaveAttributes } from '../Model';
|
|
||||||
export interface IEditUserModalAttrs extends IInternalModalAttrs {
|
|
||||||
user: User;
|
|
||||||
}
|
|
||||||
export default class EditUserModal<CustomAttrs extends IEditUserModalAttrs = IEditUserModalAttrs> extends Modal<CustomAttrs> {
|
|
||||||
protected username: Stream<string>;
|
|
||||||
protected email: Stream<string>;
|
|
||||||
protected isEmailConfirmed: Stream<boolean>;
|
|
||||||
protected setPassword: Stream<boolean>;
|
|
||||||
protected password: Stream<string>;
|
|
||||||
protected groups: Record<string, Stream<boolean>>;
|
|
||||||
oninit(vnode: Mithril.Vnode<CustomAttrs, this>): void;
|
|
||||||
className(): string;
|
|
||||||
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
|
||||||
content(): JSX.Element;
|
|
||||||
fields(): ItemList<unknown>;
|
|
||||||
activate(): void;
|
|
||||||
data(): SaveAttributes;
|
|
||||||
onsubmit(e: SubmitEvent): void;
|
|
||||||
nonAdminEditingAdmin(): boolean | null;
|
|
||||||
/**
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
protected userIsAdmin(user: User | null): boolean | null;
|
|
||||||
}
|
|
14
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/FieldSet.d.ts
generated
vendored
14
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/FieldSet.d.ts
generated
vendored
@@ -1,14 +0,0 @@
|
|||||||
/**
|
|
||||||
* The `FieldSet` component defines a collection of fields, displayed in a list
|
|
||||||
* underneath a title. Accepted properties are:
|
|
||||||
*
|
|
||||||
* - `className` The class name for the fieldset.
|
|
||||||
* - `label` The title of this group of fields.
|
|
||||||
*
|
|
||||||
* The children should be an array of items to show in the fieldset.
|
|
||||||
*/
|
|
||||||
export default class FieldSet extends Component<import("../Component").ComponentAttrs, undefined> {
|
|
||||||
constructor();
|
|
||||||
view(vnode: any): JSX.Element;
|
|
||||||
}
|
|
||||||
import Component from "../Component";
|
|
@@ -1,8 +0,0 @@
|
|||||||
import Badge, { IBadgeAttrs } from './Badge';
|
|
||||||
import Group from '../models/Group';
|
|
||||||
export interface IGroupAttrs extends IBadgeAttrs {
|
|
||||||
group?: Group;
|
|
||||||
}
|
|
||||||
export default class GroupBadge<CustomAttrs extends IGroupAttrs = IGroupAttrs> extends Badge<CustomAttrs> {
|
|
||||||
static initAttrs(attrs: IGroupAttrs): void;
|
|
||||||
}
|
|
13
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Link.d.ts
generated
vendored
13
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Link.d.ts
generated
vendored
@@ -1,13 +0,0 @@
|
|||||||
/**
|
|
||||||
* The link component enables both internal and external links.
|
|
||||||
* It will return a regular HTML link for any links to external sites,
|
|
||||||
* and it will use Mithril's m.route.Link for any internal links.
|
|
||||||
*
|
|
||||||
* Links will default to internal; the 'external' attr must be set to
|
|
||||||
* `true` for the link to be external.
|
|
||||||
*/
|
|
||||||
export default class Link extends Component<import("../Component").ComponentAttrs, undefined> {
|
|
||||||
constructor();
|
|
||||||
view(vnode: any): JSX.Element;
|
|
||||||
}
|
|
||||||
import Component from "../Component";
|
|
@@ -1,26 +0,0 @@
|
|||||||
/**
|
|
||||||
* The `LinkButton` component defines a `Button` which links to a route.
|
|
||||||
*
|
|
||||||
* ### Attrs
|
|
||||||
*
|
|
||||||
* All of the attrs accepted by `Button`, plus:
|
|
||||||
*
|
|
||||||
* - `active` Whether or not the page that this button links to is currently
|
|
||||||
* active.
|
|
||||||
* - `href` The URL to link to. If the current URL `m.route()` matches this,
|
|
||||||
* the `active` prop will automatically be set to true.
|
|
||||||
* - `force` Whether the page should be fully rerendered. Defaults to `true`.
|
|
||||||
*/
|
|
||||||
export default class LinkButton extends Button<import("./Button").IButtonAttrs> {
|
|
||||||
static initAttrs(attrs: any): void;
|
|
||||||
/**
|
|
||||||
* Determine whether a component with the given attrs is 'active'.
|
|
||||||
*
|
|
||||||
* @param {object} attrs
|
|
||||||
* @return {boolean}
|
|
||||||
*/
|
|
||||||
static isActive(attrs: object): boolean;
|
|
||||||
constructor();
|
|
||||||
view(vnode: any): JSX.Element;
|
|
||||||
}
|
|
||||||
import Button from "./Button";
|
|
@@ -1,56 +0,0 @@
|
|||||||
/// <reference types="mithril" />
|
|
||||||
import Component, { ComponentAttrs } from '../Component';
|
|
||||||
export interface LoadingIndicatorAttrs extends ComponentAttrs {
|
|
||||||
/**
|
|
||||||
* Custom classes for the loading indicator's container.
|
|
||||||
*/
|
|
||||||
className?: string;
|
|
||||||
/**
|
|
||||||
* Custom classes for the loading indicator's container.
|
|
||||||
*/
|
|
||||||
containerClassName?: string;
|
|
||||||
/**
|
|
||||||
* Optional size for the loading indicator.
|
|
||||||
*/
|
|
||||||
size?: 'large' | 'medium' | 'small';
|
|
||||||
/**
|
|
||||||
* Optional attributes to apply to the loading indicator's container.
|
|
||||||
*/
|
|
||||||
containerAttrs?: Partial<ComponentAttrs>;
|
|
||||||
/**
|
|
||||||
* Display type of the spinner.
|
|
||||||
*
|
|
||||||
* @default 'block'
|
|
||||||
*/
|
|
||||||
display?: 'block' | 'inline' | 'unset';
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `LoadingIndicator` component displays a simple CSS-based loading spinner.
|
|
||||||
*
|
|
||||||
* To set a custom color, use the CSS `color` property.
|
|
||||||
*
|
|
||||||
* To increase spacing around the spinner, use the CSS `height` property on the
|
|
||||||
* spinner's **container**. Setting the `display` attribute to `block` will set
|
|
||||||
* a height of `100px` by default.
|
|
||||||
*
|
|
||||||
* To apply a custom size to the loading indicator, set the `--size` and
|
|
||||||
* `--thickness` CSS custom properties on the loading indicator container.
|
|
||||||
*
|
|
||||||
* If you *really* want to change how this looks as part of your custom theme,
|
|
||||||
* you can override the `border-radius` and `border` then set either a
|
|
||||||
* background image, or use `content: "\<glyph>"` (e.g. `content: "\f1ce"`)
|
|
||||||
* and `font-family: 'Font Awesome 5 Free'` to set an FA icon if you'd rather.
|
|
||||||
*
|
|
||||||
* ### Attrs
|
|
||||||
*
|
|
||||||
* - `containerClassName` Class name(s) to apply to the indicator's parent
|
|
||||||
* - `className` Class name(s) to apply to the indicator itself
|
|
||||||
* - `display` Determines how the spinner should be displayed (`inline`, `block` (default) or `unset`)
|
|
||||||
* - `size` Size of the loading indicator (`small`, `medium` or `large`)
|
|
||||||
* - `containerAttrs` Optional attrs to be applied to the container DOM element
|
|
||||||
*
|
|
||||||
* All other attrs will be assigned as attributes on the DOM element.
|
|
||||||
*/
|
|
||||||
export default class LoadingIndicator extends Component<LoadingIndicatorAttrs> {
|
|
||||||
view(): JSX.Element;
|
|
||||||
}
|
|
68
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Modal.d.ts
generated
vendored
68
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Modal.d.ts
generated
vendored
@@ -1,68 +0,0 @@
|
|||||||
import Component from '../Component';
|
|
||||||
import { AlertAttrs } from './Alert';
|
|
||||||
import type Mithril from 'mithril';
|
|
||||||
import type ModalManagerState from '../states/ModalManagerState';
|
|
||||||
import type RequestError from '../utils/RequestError';
|
|
||||||
import type ModalManager from './ModalManager';
|
|
||||||
export interface IInternalModalAttrs {
|
|
||||||
state: ModalManagerState;
|
|
||||||
animateShow: ModalManager['animateShow'];
|
|
||||||
animateHide: ModalManager['animateHide'];
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `Modal` component displays a modal dialog, wrapped in a form. Subclasses
|
|
||||||
* should implement the `className`, `title`, and `content` methods.
|
|
||||||
*/
|
|
||||||
export default abstract class Modal<ModalAttrs extends IInternalModalAttrs = IInternalModalAttrs> extends Component<ModalAttrs> {
|
|
||||||
/**
|
|
||||||
* Determine whether or not the modal should be dismissible via an 'x' button.
|
|
||||||
*/
|
|
||||||
static readonly isDismissible: boolean;
|
|
||||||
protected loading: boolean;
|
|
||||||
/**
|
|
||||||
* Attributes for an alert component to show below the header.
|
|
||||||
*/
|
|
||||||
alertAttrs: AlertAttrs | null;
|
|
||||||
oninit(vnode: Mithril.Vnode<ModalAttrs, this>): void;
|
|
||||||
oncreate(vnode: Mithril.VnodeDOM<ModalAttrs, this>): void;
|
|
||||||
onbeforeremove(vnode: Mithril.VnodeDOM<ModalAttrs, this>): Promise<void> | void;
|
|
||||||
/**
|
|
||||||
* @todo split into FormModal and Modal in 2.0
|
|
||||||
*/
|
|
||||||
view(): JSX.Element;
|
|
||||||
/**
|
|
||||||
* Get the class name to apply to the modal.
|
|
||||||
*/
|
|
||||||
abstract className(): string;
|
|
||||||
/**
|
|
||||||
* Get the title of the modal dialog.
|
|
||||||
*/
|
|
||||||
abstract title(): Mithril.Children;
|
|
||||||
/**
|
|
||||||
* Get the content of the modal.
|
|
||||||
*/
|
|
||||||
abstract content(): Mithril.Children;
|
|
||||||
/**
|
|
||||||
* Handle the modal form's submit event.
|
|
||||||
*/
|
|
||||||
onsubmit(e: SubmitEvent): void;
|
|
||||||
/**
|
|
||||||
* Callback executed when the modal is shown and ready to be interacted with.
|
|
||||||
*
|
|
||||||
* @remark Focuses the first input in the modal.
|
|
||||||
*/
|
|
||||||
onready(): void;
|
|
||||||
/**
|
|
||||||
* Hides the modal.
|
|
||||||
*/
|
|
||||||
hide(): void;
|
|
||||||
/**
|
|
||||||
* Sets `loading` to false and triggers a redraw.
|
|
||||||
*/
|
|
||||||
loaded(): void;
|
|
||||||
/**
|
|
||||||
* Shows an alert describing an error returned from the API, and gives focus to
|
|
||||||
* the first relevant field involved in the error.
|
|
||||||
*/
|
|
||||||
onerror(error: RequestError): void;
|
|
||||||
}
|
|
@@ -1,25 +0,0 @@
|
|||||||
import Component from '../Component';
|
|
||||||
import { FocusTrap } from '../utils/focusTrap';
|
|
||||||
import type ModalManagerState from '../states/ModalManagerState';
|
|
||||||
import type Mithril from 'mithril';
|
|
||||||
interface IModalManagerAttrs {
|
|
||||||
state: ModalManagerState;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `ModalManager` component manages a modal dialog. Only one modal dialog
|
|
||||||
* can be shown at once; loading a new component into the ModalManager will
|
|
||||||
* overwrite the previous one.
|
|
||||||
*/
|
|
||||||
export default class ModalManager extends Component<IModalManagerAttrs> {
|
|
||||||
protected focusTrap: FocusTrap | undefined;
|
|
||||||
/**
|
|
||||||
* Whether a modal is currently shown by this modal manager.
|
|
||||||
*/
|
|
||||||
protected modalShown: boolean;
|
|
||||||
view(vnode: Mithril.VnodeDOM<IModalManagerAttrs, this>): Mithril.Children;
|
|
||||||
oncreate(vnode: Mithril.VnodeDOM<IModalManagerAttrs, this>): void;
|
|
||||||
onupdate(vnode: Mithril.VnodeDOM<IModalManagerAttrs, this>): void;
|
|
||||||
animateShow(readyCallback: () => void): void;
|
|
||||||
animateHide(): void;
|
|
||||||
}
|
|
||||||
export {};
|
|
@@ -1,32 +0,0 @@
|
|||||||
import Component from '../Component';
|
|
||||||
import type Mithril from 'mithril';
|
|
||||||
/**
|
|
||||||
* The `Navigation` component displays a set of navigation buttons. Typically
|
|
||||||
* this is just a back button which pops the app's History. If the user is on
|
|
||||||
* the root page and there is no history to pop, then in some instances it may
|
|
||||||
* show a button that toggles the app's drawer.
|
|
||||||
*
|
|
||||||
* If the app has a pane, it will also include a 'pin' button which toggles the
|
|
||||||
* pinned state of the pane.
|
|
||||||
*
|
|
||||||
* Accepts the following attrs:
|
|
||||||
*
|
|
||||||
* - `className` The name of a class to set on the root element.
|
|
||||||
* - `drawer` Whether or not to show a button to toggle the app's drawer if
|
|
||||||
* there is no more history to pop.
|
|
||||||
*/
|
|
||||||
export default class Navigation extends Component {
|
|
||||||
view(): JSX.Element;
|
|
||||||
/**
|
|
||||||
* Get the back button.
|
|
||||||
*/
|
|
||||||
protected getBackButton(): Mithril.Children;
|
|
||||||
/**
|
|
||||||
* Get the pane pinned toggle button.
|
|
||||||
*/
|
|
||||||
protected getPaneButton(): Mithril.Children;
|
|
||||||
/**
|
|
||||||
* Get the drawer toggle button.
|
|
||||||
*/
|
|
||||||
protected getDrawerButton(): Mithril.Children;
|
|
||||||
}
|
|
28
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Page.d.ts
generated
vendored
28
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Page.d.ts
generated
vendored
@@ -1,28 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
import Component from '../Component';
|
|
||||||
export interface IPageAttrs {
|
|
||||||
key?: number;
|
|
||||||
routeName: string;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `Page` component
|
|
||||||
*
|
|
||||||
* @abstract
|
|
||||||
*/
|
|
||||||
export default abstract class Page<CustomAttrs extends IPageAttrs = IPageAttrs, CustomState = undefined> extends Component<CustomAttrs, CustomState> {
|
|
||||||
/**
|
|
||||||
* A class name to apply to the body while the route is active.
|
|
||||||
*/
|
|
||||||
protected bodyClass: string;
|
|
||||||
/**
|
|
||||||
* Whether we should scroll to the top of the page when its rendered.
|
|
||||||
*/
|
|
||||||
protected scrollTopOnCreate: boolean;
|
|
||||||
/**
|
|
||||||
* Whether the browser should restore scroll state on refreshes.
|
|
||||||
*/
|
|
||||||
protected useBrowserScrollRestoration: boolean;
|
|
||||||
oninit(vnode: Mithril.Vnode<CustomAttrs, this>): void;
|
|
||||||
oncreate(vnode: Mithril.VnodeDOM<CustomAttrs, this>): void;
|
|
||||||
onremove(vnode: Mithril.VnodeDOM<CustomAttrs, this>): void;
|
|
||||||
}
|
|
@@ -1,13 +0,0 @@
|
|||||||
/**
|
|
||||||
* The `Placeholder` component displays a muted text with some call to action,
|
|
||||||
* usually used as an empty state.
|
|
||||||
*
|
|
||||||
* ### Attrs
|
|
||||||
*
|
|
||||||
* - `text`
|
|
||||||
*/
|
|
||||||
export default class Placeholder extends Component<import("../Component").ComponentAttrs, undefined> {
|
|
||||||
constructor();
|
|
||||||
view(): JSX.Element;
|
|
||||||
}
|
|
||||||
import Component from "../Component";
|
|
@@ -1,12 +0,0 @@
|
|||||||
/// <reference types="mithril" />
|
|
||||||
import type RequestError from '../utils/RequestError';
|
|
||||||
import Modal, { IInternalModalAttrs } from './Modal';
|
|
||||||
export interface IRequestErrorModalAttrs extends IInternalModalAttrs {
|
|
||||||
error: RequestError;
|
|
||||||
formattedError: string[];
|
|
||||||
}
|
|
||||||
export default class RequestErrorModal<CustomAttrs extends IRequestErrorModalAttrs = IRequestErrorModalAttrs> extends Modal<CustomAttrs> {
|
|
||||||
className(): string;
|
|
||||||
title(): string;
|
|
||||||
content(): JSX.Element;
|
|
||||||
}
|
|
17
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Select.d.ts
generated
vendored
17
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Select.d.ts
generated
vendored
@@ -1,17 +0,0 @@
|
|||||||
/**
|
|
||||||
* The `Select` component displays a <select> input, surrounded with some extra
|
|
||||||
* elements for styling. It accepts the following attrs:
|
|
||||||
*
|
|
||||||
* - `options` A map of option values to labels.
|
|
||||||
* - `onchange` A callback to run when the selected value is changed.
|
|
||||||
* - `value` The value of the selected option.
|
|
||||||
* - `disabled` Disabled state for the input.
|
|
||||||
* - `wrapperAttrs` A map of attrs to be passed to the DOM element wrapping the `<select>`
|
|
||||||
*
|
|
||||||
* Other attributes are passed directly to the `<select>` element rendered to the DOM.
|
|
||||||
*/
|
|
||||||
export default class Select extends Component<import("../Component").ComponentAttrs, undefined> {
|
|
||||||
constructor();
|
|
||||||
view(): JSX.Element;
|
|
||||||
}
|
|
||||||
import Component from "../Component";
|
|
@@ -1,14 +0,0 @@
|
|||||||
/**
|
|
||||||
* The `SelectDropdown` component is the same as a `Dropdown`, except the toggle
|
|
||||||
* button's label is set as the label of the first child which has a truthy
|
|
||||||
* `active` prop.
|
|
||||||
*
|
|
||||||
* ### Attrs
|
|
||||||
*
|
|
||||||
* - `caretIcon`
|
|
||||||
* - `defaultLabel`
|
|
||||||
*/
|
|
||||||
export default class SelectDropdown extends Dropdown {
|
|
||||||
getButtonContent(children: any): JSX.Element[];
|
|
||||||
}
|
|
||||||
import Dropdown from "./Dropdown";
|
|
@@ -1,12 +0,0 @@
|
|||||||
export default Separator;
|
|
||||||
/**
|
|
||||||
* The `Separator` component defines a menu separator item.
|
|
||||||
*/
|
|
||||||
declare class Separator extends Component<import("../Component").ComponentAttrs, undefined> {
|
|
||||||
constructor();
|
|
||||||
view(): JSX.Element;
|
|
||||||
}
|
|
||||||
declare namespace Separator {
|
|
||||||
const isListItem: boolean;
|
|
||||||
}
|
|
||||||
import Component from "../Component";
|
|
@@ -1,17 +0,0 @@
|
|||||||
/**
|
|
||||||
* The `SplitDropdown` component is similar to `Dropdown`, but the first child
|
|
||||||
* is displayed as its own button prior to the toggle button.
|
|
||||||
*/
|
|
||||||
export default class SplitDropdown extends Dropdown {
|
|
||||||
getButton(children: any): JSX.Element[];
|
|
||||||
/**
|
|
||||||
* Get the first child. If the first child is an array, the first item in that
|
|
||||||
* array will be returned.
|
|
||||||
*
|
|
||||||
* @param {unknown[] | unknown} children
|
|
||||||
* @return {unknown}
|
|
||||||
* @protected
|
|
||||||
*/
|
|
||||||
protected getFirstChild(children: unknown[] | unknown): unknown;
|
|
||||||
}
|
|
||||||
import Dropdown from "./Dropdown";
|
|
10
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Switch.d.ts
generated
vendored
10
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Switch.d.ts
generated
vendored
@@ -1,10 +0,0 @@
|
|||||||
/// <reference types="mithril" />
|
|
||||||
import Checkbox, { ICheckboxAttrs } from './Checkbox';
|
|
||||||
/**
|
|
||||||
* The `Switch` component is a `Checkbox`, but with a switch display instead of
|
|
||||||
* a tick/cross one.
|
|
||||||
*/
|
|
||||||
export default class Switch extends Checkbox {
|
|
||||||
static initAttrs(attrs: ICheckboxAttrs): void;
|
|
||||||
getDisplay(): import("mithril").Children;
|
|
||||||
}
|
|
@@ -1,65 +0,0 @@
|
|||||||
/**
|
|
||||||
* The `TextEditor` component displays a textarea with controls, including a
|
|
||||||
* submit button.
|
|
||||||
*
|
|
||||||
* ### Attrs
|
|
||||||
*
|
|
||||||
* - `composer`
|
|
||||||
* - `submitLabel`
|
|
||||||
* - `value`
|
|
||||||
* - `placeholder`
|
|
||||||
* - `disabled`
|
|
||||||
* - `preview`
|
|
||||||
*/
|
|
||||||
export default class TextEditor extends Component<import("../Component").ComponentAttrs, undefined> {
|
|
||||||
constructor();
|
|
||||||
oninit(vnode: any): void;
|
|
||||||
/**
|
|
||||||
* The value of the editor.
|
|
||||||
*
|
|
||||||
* @type {String}
|
|
||||||
*/
|
|
||||||
value: string | undefined;
|
|
||||||
/**
|
|
||||||
* Whether the editor is disabled.
|
|
||||||
*/
|
|
||||||
disabled: any;
|
|
||||||
view(): JSX.Element;
|
|
||||||
oncreate(vnode: any): void;
|
|
||||||
onupdate(vnode: any): void;
|
|
||||||
buildEditorParams(): {
|
|
||||||
classNames: string[];
|
|
||||||
disabled: any;
|
|
||||||
placeholder: any;
|
|
||||||
value: string | undefined;
|
|
||||||
oninput: (value: string) => void;
|
|
||||||
inputListeners: never[];
|
|
||||||
onsubmit: () => void;
|
|
||||||
};
|
|
||||||
buildEditor(dom: any): BasicEditorDriver;
|
|
||||||
/**
|
|
||||||
* Build an item list for the text editor controls.
|
|
||||||
*
|
|
||||||
* @return {ItemList<import('mithril').Children>}
|
|
||||||
*/
|
|
||||||
controlItems(): ItemList<import('mithril').Children>;
|
|
||||||
/**
|
|
||||||
* Build an item list for the toolbar controls.
|
|
||||||
*
|
|
||||||
* @return {ItemList<import('mithril').Children>}
|
|
||||||
*/
|
|
||||||
toolbarItems(): ItemList<import('mithril').Children>;
|
|
||||||
/**
|
|
||||||
* Handle input into the textarea.
|
|
||||||
*
|
|
||||||
* @param {string} value
|
|
||||||
*/
|
|
||||||
oninput(value: string): void;
|
|
||||||
/**
|
|
||||||
* Handle the submit button being clicked.
|
|
||||||
*/
|
|
||||||
onsubmit(): void;
|
|
||||||
}
|
|
||||||
import Component from "../Component";
|
|
||||||
import BasicEditorDriver from "../utils/BasicEditorDriver";
|
|
||||||
import ItemList from "../utils/ItemList";
|
|
@@ -1,15 +0,0 @@
|
|||||||
/**
|
|
||||||
* The `TextEditorButton` component displays a button suitable for the text
|
|
||||||
* editor toolbar.
|
|
||||||
*
|
|
||||||
* Automatically creates tooltips using the Tooltip component and provided text.
|
|
||||||
*
|
|
||||||
* ## Attrs
|
|
||||||
* - `title` - Tooltip for the button
|
|
||||||
*/
|
|
||||||
export default class TextEditorButton extends Button<import("./Button").IButtonAttrs> {
|
|
||||||
static initAttrs(attrs: any): void;
|
|
||||||
constructor();
|
|
||||||
view(vnode: any): JSX.Element;
|
|
||||||
}
|
|
||||||
import Button from "./Button";
|
|
116
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Tooltip.d.ts
generated
vendored
116
extensions/akismet/js/dist-typings/framework/core/js/src/common/components/Tooltip.d.ts
generated
vendored
@@ -1,116 +0,0 @@
|
|||||||
import Component from '../Component';
|
|
||||||
import type Mithril from 'mithril';
|
|
||||||
export interface TooltipAttrs extends Mithril.CommonAttributes<TooltipAttrs, Tooltip> {
|
|
||||||
/**
|
|
||||||
* Tooltip textual content.
|
|
||||||
*
|
|
||||||
* String arrays, like those provided by the translator, will be flattened
|
|
||||||
* into strings.
|
|
||||||
*/
|
|
||||||
text: string | string[];
|
|
||||||
/**
|
|
||||||
* Use to manually show or hide the tooltip. `undefined` will show based on cursor events.
|
|
||||||
*
|
|
||||||
* Default: `undefined`.
|
|
||||||
*/
|
|
||||||
tooltipVisible?: boolean;
|
|
||||||
/**
|
|
||||||
* Whether to show on focus.
|
|
||||||
*
|
|
||||||
* Default: `true`.
|
|
||||||
*/
|
|
||||||
showOnFocus?: boolean;
|
|
||||||
/**
|
|
||||||
* Tooltip position around element.
|
|
||||||
*
|
|
||||||
* Default: `'top'`.
|
|
||||||
*/
|
|
||||||
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
||||||
/**
|
|
||||||
* Whether HTML content is allowed in the tooltip.
|
|
||||||
*
|
|
||||||
* **Warning:** this is a possible XSS attack vector. This option shouldn't
|
|
||||||
* be used wherever possible, and may not work when we migrate to another
|
|
||||||
* tooltip library. Be prepared for this to break in Flarum stable.
|
|
||||||
*
|
|
||||||
* Default: `false`.
|
|
||||||
*
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
html?: boolean;
|
|
||||||
/**
|
|
||||||
* Sets the delay between a trigger state occurring and the tooltip appearing
|
|
||||||
* on-screen.
|
|
||||||
*
|
|
||||||
* **Warning:** this option may be removed when switching to another tooltip
|
|
||||||
* library. Be prepared for this to break in Flarum stable.
|
|
||||||
*
|
|
||||||
* Default: `0`.
|
|
||||||
*
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
delay?: number;
|
|
||||||
/**
|
|
||||||
* Used to disable the warning for passing text to the `title` attribute.
|
|
||||||
*
|
|
||||||
* Tooltip text should be passed to the `text` attribute.
|
|
||||||
*/
|
|
||||||
ignoreTitleWarning?: boolean;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `Tooltip` component is used to create a tooltip for an element. It
|
|
||||||
* requires a single child element to be passed to it. Passing multiple
|
|
||||||
* children or fragments will throw an error.
|
|
||||||
*
|
|
||||||
* You should use this for any tooltips you create to allow for backwards
|
|
||||||
* compatibility when we switch to another tooltip library instead of
|
|
||||||
* Bootstrap tooltips.
|
|
||||||
*
|
|
||||||
* If you need to pass multiple children, surround them with another element,
|
|
||||||
* such as a `<span>` or `<div>`.
|
|
||||||
*
|
|
||||||
* **Note:** this component will overwrite the `title` attribute of the first
|
|
||||||
* child you pass to it, as this is how the current tooltip system works in
|
|
||||||
* Flarum. This shouldn't be an issue if you're using this component correctly.
|
|
||||||
*
|
|
||||||
* @example <caption>Basic usage</caption>
|
|
||||||
* <Tooltip text="You wish!">
|
|
||||||
* <Button>
|
|
||||||
* Click for free money!
|
|
||||||
* </Button>
|
|
||||||
* </Tooltip>
|
|
||||||
*
|
|
||||||
* @example <caption>Use of `position` and `showOnFocus` attrs</caption>
|
|
||||||
* <Tooltip text="Woah! That's cool!" position="bottom" showOnFocus>
|
|
||||||
* <span>3 replies</span>
|
|
||||||
* </Tooltip>
|
|
||||||
*
|
|
||||||
* @example <caption>Incorrect usage</caption>
|
|
||||||
* // This is wrong! Surround the children with a <span> or similar.
|
|
||||||
* <Tooltip text="This won't work">
|
|
||||||
* Click
|
|
||||||
* <a href="/">here</a>
|
|
||||||
* </Tooltip>
|
|
||||||
*/
|
|
||||||
export default class Tooltip extends Component<TooltipAttrs> {
|
|
||||||
private firstChild;
|
|
||||||
private childDomNode;
|
|
||||||
private oldText;
|
|
||||||
private oldVisibility;
|
|
||||||
private shouldRecreateTooltip;
|
|
||||||
private shouldChangeTooltipVisibility;
|
|
||||||
view(vnode: Mithril.Vnode<TooltipAttrs, this>): Mithril.ChildArray;
|
|
||||||
oncreate(vnode: Mithril.VnodeDOM<TooltipAttrs, this>): void;
|
|
||||||
onupdate(vnode: Mithril.VnodeDOM<TooltipAttrs, this>): void;
|
|
||||||
private recreateTooltip;
|
|
||||||
private updateVisibility;
|
|
||||||
private createTooltip;
|
|
||||||
private getRealText;
|
|
||||||
/**
|
|
||||||
* Checks if the tooltip DOM node has changed.
|
|
||||||
*
|
|
||||||
* If it has, it updates `this.childDomNode` to the new node, and sets
|
|
||||||
* `shouldRecreateTooltip` to `true`.
|
|
||||||
*/
|
|
||||||
private checkDomNodeChanged;
|
|
||||||
}
|
|
54
extensions/akismet/js/dist-typings/framework/core/js/src/common/extend.d.ts
generated
vendored
54
extensions/akismet/js/dist-typings/framework/core/js/src/common/extend.d.ts
generated
vendored
@@ -1,54 +0,0 @@
|
|||||||
/**
|
|
||||||
* Extend an object's method by running its output through a mutating callback
|
|
||||||
* every time it is called.
|
|
||||||
*
|
|
||||||
* The callback accepts the method's return value and should perform any
|
|
||||||
* mutations directly on this value. For this reason, this function will not be
|
|
||||||
* effective on methods which return scalar values (numbers, strings, booleans).
|
|
||||||
*
|
|
||||||
* Care should be taken to extend the correct object – in most cases, a class'
|
|
||||||
* prototype will be the desired target of extension, not the class itself.
|
|
||||||
*
|
|
||||||
* @example <caption>Example usage of extending one method.</caption>
|
|
||||||
* extend(Discussion.prototype, 'badges', function(badges) {
|
|
||||||
* // do something with `badges`
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* @example <caption>Example usage of extending multiple methods.</caption>
|
|
||||||
* extend(IndexPage.prototype, ['oncreate', 'onupdate'], function(vnode) {
|
|
||||||
* // something that needs to be run on creation and update
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* @param object The object that owns the method
|
|
||||||
* @param methods The name or names of the method(s) to extend
|
|
||||||
* @param callback A callback which mutates the method's output
|
|
||||||
*/
|
|
||||||
export declare function extend<T extends Record<string, any>, K extends KeyOfType<T, Function>>(object: T, methods: K | K[], callback: (this: T, val: ReturnType<T[K]>, ...args: Parameters<T[K]>) => void): void;
|
|
||||||
/**
|
|
||||||
* Override an object's method by replacing it with a new function, so that the
|
|
||||||
* new function will be run every time the object's method is called.
|
|
||||||
*
|
|
||||||
* The replacement function accepts the original method as its first argument,
|
|
||||||
* which is like a call to `super`. Any arguments passed to the original method
|
|
||||||
* are also passed to the replacement.
|
|
||||||
*
|
|
||||||
* Care should be taken to extend the correct object – in most cases, a class'
|
|
||||||
* prototype will be the desired target of extension, not the class itself.
|
|
||||||
*
|
|
||||||
* @example <caption>Example usage of overriding one method.</caption>
|
|
||||||
* override(Discussion.prototype, 'badges', function(original) {
|
|
||||||
* const badges = original();
|
|
||||||
* // do something with badges
|
|
||||||
* return badges;
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* @example <caption>Example usage of overriding multiple methods.</caption>
|
|
||||||
* extend(Discussion.prototype, ['oncreate', 'onupdate'], function(original, vnode) {
|
|
||||||
* // something that needs to be run on creation and update
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* @param object The object that owns the method
|
|
||||||
* @param methods The name or names of the method(s) to override
|
|
||||||
* @param newMethod The method to replace it with
|
|
||||||
*/
|
|
||||||
export declare function override<T extends Record<any, any>, K extends KeyOfType<T, Function>>(object: T, methods: K | K[], newMethod: (this: T, orig: T[K], ...args: Parameters<T[K]>) => void): void;
|
|
12
extensions/akismet/js/dist-typings/framework/core/js/src/common/extend/Model.d.ts
generated
vendored
12
extensions/akismet/js/dist-typings/framework/core/js/src/common/extend/Model.d.ts
generated
vendored
@@ -1,12 +0,0 @@
|
|||||||
export default class Model {
|
|
||||||
constructor(type: any, model?: null);
|
|
||||||
type: any;
|
|
||||||
attributes: any[];
|
|
||||||
hasOnes: any[];
|
|
||||||
hasManys: any[];
|
|
||||||
model: any;
|
|
||||||
attribute(name: any): Model;
|
|
||||||
hasOne(type: any): Model;
|
|
||||||
hasMany(type: any): Model;
|
|
||||||
extend(app: any, extension: any): void;
|
|
||||||
}
|
|
@@ -1,5 +0,0 @@
|
|||||||
export default class PostTypes {
|
|
||||||
postComponents: {};
|
|
||||||
add(name: any, component: any): PostTypes;
|
|
||||||
extend(app: any, extension: any): void;
|
|
||||||
}
|
|
5
extensions/akismet/js/dist-typings/framework/core/js/src/common/extend/Routes.d.ts
generated
vendored
5
extensions/akismet/js/dist-typings/framework/core/js/src/common/extend/Routes.d.ts
generated
vendored
@@ -1,5 +0,0 @@
|
|||||||
export default class Routes {
|
|
||||||
routes: {};
|
|
||||||
add(name: any, path: any, component: any): Routes;
|
|
||||||
extend(app: any, extension: any): void;
|
|
||||||
}
|
|
3
extensions/akismet/js/dist-typings/framework/core/js/src/common/extend/index.d.ts
generated
vendored
3
extensions/akismet/js/dist-typings/framework/core/js/src/common/extend/index.d.ts
generated
vendored
@@ -1,3 +0,0 @@
|
|||||||
export { default as Model } from "./Model";
|
|
||||||
export { default as PostTypes } from "./PostTypes";
|
|
||||||
export { default as Routes } from "./Routes";
|
|
12
extensions/akismet/js/dist-typings/framework/core/js/src/common/helpers/avatar.d.ts
generated
vendored
12
extensions/akismet/js/dist-typings/framework/core/js/src/common/helpers/avatar.d.ts
generated
vendored
@@ -1,12 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
import type { ComponentAttrs } from '../Component';
|
|
||||||
import User from '../models/User';
|
|
||||||
export interface AvatarAttrs extends ComponentAttrs {
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* The `avatar` helper displays a user's avatar.
|
|
||||||
*
|
|
||||||
* @param user
|
|
||||||
* @param attrs Attributes to apply to the avatar element
|
|
||||||
*/
|
|
||||||
export default function avatar(user: User | null, attrs?: ComponentAttrs): Mithril.Vnode;
|
|
@@ -1,8 +0,0 @@
|
|||||||
/**
|
|
||||||
* Fire a Flarum error which is shown in the JS console for everyone and in an alert for the admin.
|
|
||||||
*
|
|
||||||
* @param userTitle: a user friendly title of the error, should be localized.
|
|
||||||
* @param consoleTitle: an error title that goes in the console, doesn't have to be localized.
|
|
||||||
* @param error: the error.
|
|
||||||
*/
|
|
||||||
export default function fireApplicationError(userTitle: string, consoleTitle: string, error: any): void;
|
|
@@ -1,26 +0,0 @@
|
|||||||
/**
|
|
||||||
* Calls `console.warn` with the provided arguments, but only if the forum is in debug mode.
|
|
||||||
*
|
|
||||||
* This function is intended to provide warnings to extension developers about issues with
|
|
||||||
* their extensions that may not be easily noticed when testing, such as accessibility
|
|
||||||
* issues.
|
|
||||||
*
|
|
||||||
* These warnings should be hidden on production forums to ensure webmasters are not
|
|
||||||
* inundated with do-gooders telling them they have an issue when it isn't something they
|
|
||||||
* can fix.
|
|
||||||
*/
|
|
||||||
export default function fireDebugWarning(...args: Parameters<typeof console.warn>): void;
|
|
||||||
/**
|
|
||||||
* Fire a Flarum deprecation warning which is shown in the JS console.
|
|
||||||
*
|
|
||||||
* These warnings are only shown when the forum is in debug mode, and the function exists to
|
|
||||||
* reduce bundle size caused by multiple warnings across our JavaScript.
|
|
||||||
*
|
|
||||||
* @param message The message to display. (Short, but sweet, please!)
|
|
||||||
* @param githubId The PR or Issue ID with more info in relation to this change.
|
|
||||||
* @param [removedFrom] The version in which this feature will be completely removed. (default: 2.0)
|
|
||||||
* @param [repo] The repo which the issue or PR is located in. (default: flarum/core)
|
|
||||||
*
|
|
||||||
* @see {@link fireDebugWarning}
|
|
||||||
*/
|
|
||||||
export declare function fireDeprecationWarning(message: string, githubId: string, removedFrom?: string, repo?: string): void;
|
|
@@ -1,6 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
/**
|
|
||||||
* The `fullTime` helper displays a formatted time string wrapped in a <time>
|
|
||||||
* tag.
|
|
||||||
*/
|
|
||||||
export default function fullTime(time: Date): Mithril.Vnode;
|
|
11
extensions/akismet/js/dist-typings/framework/core/js/src/common/helpers/highlight.d.ts
generated
vendored
11
extensions/akismet/js/dist-typings/framework/core/js/src/common/helpers/highlight.d.ts
generated
vendored
@@ -1,11 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
/**
|
|
||||||
* The `highlight` helper searches for a word phrase in a string, and wraps
|
|
||||||
* matches with the <mark> tag.
|
|
||||||
*
|
|
||||||
* @param string The string to highlight.
|
|
||||||
* @param phrase The word or words to highlight.
|
|
||||||
* @param [length] The number of characters to truncate the string to.
|
|
||||||
* The string will be truncated surrounding the first match.
|
|
||||||
*/
|
|
||||||
export default function highlight(string: string, phrase?: string | RegExp, length?: number): Mithril.Vnode<any, any> | string;
|
|
@@ -1,7 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
/**
|
|
||||||
* The `humanTime` helper displays a time in a human-friendly time-ago format
|
|
||||||
* (e.g. '12 days ago'), wrapped in a <time> tag with other information about
|
|
||||||
* the time.
|
|
||||||
*/
|
|
||||||
export default function humanTime(time: Date): Mithril.Vnode;
|
|
8
extensions/akismet/js/dist-typings/framework/core/js/src/common/helpers/icon.d.ts
generated
vendored
8
extensions/akismet/js/dist-typings/framework/core/js/src/common/helpers/icon.d.ts
generated
vendored
@@ -1,8 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
/**
|
|
||||||
* The `icon` helper displays an icon.
|
|
||||||
*
|
|
||||||
* @param fontClass The full icon class, prefix and the icon’s name.
|
|
||||||
* @param attrs Any other attributes to apply.
|
|
||||||
*/
|
|
||||||
export default function icon(fontClass: string, attrs?: Mithril.Attributes): Mithril.Vnode;
|
|
34
extensions/akismet/js/dist-typings/framework/core/js/src/common/helpers/listItems.d.ts
generated
vendored
34
extensions/akismet/js/dist-typings/framework/core/js/src/common/helpers/listItems.d.ts
generated
vendored
@@ -1,34 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
import { ComponentAttrs } from '../Component';
|
|
||||||
declare type ModdedVnodeAttrs = {
|
|
||||||
itemClassName?: string;
|
|
||||||
key?: string;
|
|
||||||
};
|
|
||||||
declare type ModdedTag = Mithril.Vnode['tag'] & {
|
|
||||||
isListItem?: boolean;
|
|
||||||
isActive?: (attrs: ComponentAttrs) => boolean;
|
|
||||||
};
|
|
||||||
declare type ModdedVnode = Mithril.Vnode<ModdedVnodeAttrs> & {
|
|
||||||
itemName?: string;
|
|
||||||
itemClassName?: string;
|
|
||||||
tag: ModdedTag;
|
|
||||||
};
|
|
||||||
declare type ModdedChild = ModdedVnode | string | number | boolean | null | undefined;
|
|
||||||
declare type ModdedChildArray = ModdedChildren[];
|
|
||||||
declare type ModdedChildren = ModdedChild | ModdedChildArray;
|
|
||||||
/**
|
|
||||||
* This type represents an element of a list returned by `ItemList.toArray()`,
|
|
||||||
* coupled with some static properties used on various components.
|
|
||||||
*/
|
|
||||||
export declare type ModdedChildrenWithItemName = ModdedChildren & {
|
|
||||||
itemName?: string;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* The `listItems` helper wraps an array of components in the provided tag,
|
|
||||||
* stripping out any unnecessary `Separator` components.
|
|
||||||
*
|
|
||||||
* By default, this tag is an `<li>` tag, but this is customisable through the
|
|
||||||
* second function parameter, `customTag`.
|
|
||||||
*/
|
|
||||||
export default function listItems<Attrs extends ComponentAttrs>(rawItems: ModdedChildrenWithItemName[], customTag?: VnodeElementTag<Attrs>, attributes?: Attrs): Mithril.Vnode[];
|
|
||||||
export {};
|
|
@@ -1,12 +0,0 @@
|
|||||||
/**
|
|
||||||
* The `punctuateSeries` helper formats a list of strings (e.g. names) to read
|
|
||||||
* fluently in the application's locale.
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* punctuateSeries(['Toby', 'Franz', 'Dominion']) // Toby, Franz, and Dominion
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* @param {import('mithril').Children[]} items
|
|
||||||
* @return {import('mithril').Children}')}
|
|
||||||
*/
|
|
||||||
export default function punctuateSeries(items: import('mithril').Children[]): import('mithril').Children;
|
|
@@ -1,6 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
import User from '../models/User';
|
|
||||||
/**
|
|
||||||
* The `useronline` helper displays a green circle if the user is online
|
|
||||||
*/
|
|
||||||
export default function userOnline(user: User): Mithril.Vnode<{}, {}> | null;
|
|
@@ -1,7 +0,0 @@
|
|||||||
import type Mithril from 'mithril';
|
|
||||||
import User from '../models/User';
|
|
||||||
/**
|
|
||||||
* The `username` helper displays a user's username in a <span class="username">
|
|
||||||
* tag. If the user doesn't exist, the username will be displayed as [deleted].
|
|
||||||
*/
|
|
||||||
export default function username(user: User | null | undefined | false): Mithril.Vnode;
|
|
13
extensions/akismet/js/dist-typings/framework/core/js/src/common/index.d.ts
generated
vendored
13
extensions/akismet/js/dist-typings/framework/core/js/src/common/index.d.ts
generated
vendored
@@ -1,13 +0,0 @@
|
|||||||
import 'expose-loader?exposes=$,jQuery!jquery';
|
|
||||||
import 'expose-loader?exposes=m!mithril';
|
|
||||||
import 'expose-loader?exposes=dayjs!dayjs';
|
|
||||||
import 'bootstrap/js/affix';
|
|
||||||
import 'bootstrap/js/dropdown';
|
|
||||||
import 'bootstrap/js/modal';
|
|
||||||
import 'bootstrap/js/tooltip';
|
|
||||||
import 'bootstrap/js/transition';
|
|
||||||
import 'jquery.hotkeys/jquery.hotkeys';
|
|
||||||
import * as Extend from './extend/index';
|
|
||||||
import app from './app';
|
|
||||||
export { Extend, app };
|
|
||||||
import './utils/arrayFlatPolyfill';
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user