From 77a0b11bc885a1d05e2c17ac617e1efb9abe080c Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Fri, 10 Feb 2023 22:08:35 +0000 Subject: [PATCH] Bundled output for commit 7e6458a125d9bdd13c66e0560d178b46ad4e3002 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- .../js/dist-typings/components/Installer.d.ts | 2 +- .../dist-typings/components/MajorUpdater.d.ts | 2 +- .../js/dist-typings/components/Updater.d.ts | 2 +- .../js/dist-typings/models/Task.d.ts | 2 +- .../states/ControlSectionState.d.ts | 18 ++--- .../pusher/js/dist-typings/forum/index.d.ts | 2 +- .../common/components/TagSelectionModal.d.ts | 2 +- .../dist-typings/admin/AdminApplication.d.ts | 2 +- .../admin/components/AdminPage.d.ts | 12 +-- .../admin/components/BasicsPage.d.ts | 2 +- .../admin/components/PermissionGrid.d.ts | 4 +- .../admin/components/SettingDropdown.d.ts | 2 +- .../admin/components/UserListPage.d.ts | 2 +- .../admin/utils/ExtensionData.d.ts | 12 +-- .../js/dist-typings/common/Application.d.ts | 6 +- .../core/js/dist-typings/common/Model.d.ts | 2 +- .../core/js/dist-typings/common/Session.d.ts | 2 +- .../core/js/dist-typings/common/Store.d.ts | 10 +-- .../js/dist-typings/common/Translator.d.ts | 4 +- .../dist-typings/common/extenders/Routes.d.ts | 2 +- .../common/helpers/listItems.d.ts | 14 ++-- .../common/states/AlertManagerState.d.ts | 4 +- .../common/states/ModalManagerState.d.ts | 4 +- .../common/utils/KeyboardNavigatable.d.ts | 4 +- .../common/utils/RequestError.d.ts | 2 +- .../js/dist-typings/common/utils/evented.d.ts | 47 ++++++++++++ .../forum/components/SignUpModal.d.ts | 2 +- .../forum/states/GlobalSearchState.d.ts | 2 +- .../forum/utils/DiscussionControls.d.ts | 74 +++++++++++++++++++ .../forum/utils/PostControls.d.ts | 63 ++++++++++++++++ .../forum/utils/UserControls.d.ts | 58 +++++++++++++++ 31 files changed, 304 insertions(+), 62 deletions(-) diff --git a/extensions/package-manager/js/dist-typings/components/Installer.d.ts b/extensions/package-manager/js/dist-typings/components/Installer.d.ts index 8fd754318..645728cb5 100644 --- a/extensions/package-manager/js/dist-typings/components/Installer.d.ts +++ b/extensions/package-manager/js/dist-typings/components/Installer.d.ts @@ -3,7 +3,7 @@ import Component, { ComponentAttrs } from 'flarum/common/Component'; import Stream from 'flarum/common/utils/Stream'; export interface InstallerAttrs extends ComponentAttrs { } -export type InstallerLoadingTypes = 'extension-install' | null; +export declare type InstallerLoadingTypes = 'extension-install' | null; export default class Installer extends Component { packageName: Stream; oninit(vnode: Mithril.Vnode): void; diff --git a/extensions/package-manager/js/dist-typings/components/MajorUpdater.d.ts b/extensions/package-manager/js/dist-typings/components/MajorUpdater.d.ts index 3e0e3c288..4e2d99487 100644 --- a/extensions/package-manager/js/dist-typings/components/MajorUpdater.d.ts +++ b/extensions/package-manager/js/dist-typings/components/MajorUpdater.d.ts @@ -5,7 +5,7 @@ export interface MajorUpdaterAttrs extends ComponentAttrs { coreUpdate: UpdatedPackage; updateState: UpdateState; } -export type MajorUpdaterLoadingTypes = 'major-update' | 'major-update-dry-run'; +export declare type MajorUpdaterLoadingTypes = 'major-update' | 'major-update-dry-run'; export default class MajorUpdater extends Component { updateState: UpdateState; oninit(vnode: Mithril.Vnode): void; diff --git a/extensions/package-manager/js/dist-typings/components/Updater.d.ts b/extensions/package-manager/js/dist-typings/components/Updater.d.ts index 13f19b9c7..16eb093b6 100644 --- a/extensions/package-manager/js/dist-typings/components/Updater.d.ts +++ b/extensions/package-manager/js/dist-typings/components/Updater.d.ts @@ -3,7 +3,7 @@ import Component, { ComponentAttrs } from 'flarum/common/Component'; import ItemList from '@flarum/core/src/common/utils/ItemList'; export interface IUpdaterAttrs extends ComponentAttrs { } -export type UpdaterLoadingTypes = 'check' | 'minor-update' | 'global-update' | 'extension-update' | null; +export declare type UpdaterLoadingTypes = 'check' | 'minor-update' | 'global-update' | 'extension-update' | null; export default class Updater extends Component { view(): (JSX.Element | null)[]; lastUpdateCheckView(): JSX.Element | null; diff --git a/extensions/package-manager/js/dist-typings/models/Task.d.ts b/extensions/package-manager/js/dist-typings/models/Task.d.ts index 619e68333..8644ffef3 100644 --- a/extensions/package-manager/js/dist-typings/models/Task.d.ts +++ b/extensions/package-manager/js/dist-typings/models/Task.d.ts @@ -1,5 +1,5 @@ import Model from 'flarum/common/Model'; -export type TaskOperations = 'extension_install' | 'extension_remove' | 'extension_update' | 'update_global' | 'update_minor' | 'update_major' | 'update_check' | 'why_not'; +export declare type TaskOperations = 'extension_install' | 'extension_remove' | 'extension_update' | 'update_global' | 'update_minor' | 'update_major' | 'update_check' | 'why_not'; export default class Task extends Model { status(): "running" | "pending" | "success" | "failure"; operation(): TaskOperations; diff --git a/extensions/package-manager/js/dist-typings/states/ControlSectionState.d.ts b/extensions/package-manager/js/dist-typings/states/ControlSectionState.d.ts index fcd5362f6..342033f8c 100644 --- a/extensions/package-manager/js/dist-typings/states/ControlSectionState.d.ts +++ b/extensions/package-manager/js/dist-typings/states/ControlSectionState.d.ts @@ -2,7 +2,7 @@ import { UpdaterLoadingTypes } from '../components/Updater'; import { InstallerLoadingTypes } from '../components/Installer'; import { MajorUpdaterLoadingTypes } from '../components/MajorUpdater'; import { Extension } from 'flarum/admin/AdminApplication'; -export type UpdatedPackage = { +export declare type UpdatedPackage = { name: string; version: string; latest: string; @@ -11,28 +11,28 @@ export type UpdatedPackage = { 'latest-status': string; description: string; }; -export type ComposerUpdates = { +export declare type ComposerUpdates = { installed: UpdatedPackage[]; }; -export type LastUpdateCheck = { +export declare type LastUpdateCheck = { checkedAt: Date | null; updates: ComposerUpdates; }; -type UpdateType = 'major' | 'minor' | 'global'; -type UpdateStatus = 'success' | 'failure' | null; -export type UpdateState = { +declare type UpdateType = 'major' | 'minor' | 'global'; +declare type UpdateStatus = 'success' | 'failure' | null; +export declare type UpdateState = { ranAt: Date | null; status: UpdateStatus; limitedPackages: string[]; incompatibleExtensions: string[]; }; -export type LastUpdateRun = { +export declare type LastUpdateRun = { [key in UpdateType]: UpdateState; } & { limitedPackages: () => string[]; }; -export type LoadingTypes = UpdaterLoadingTypes | InstallerLoadingTypes | MajorUpdaterLoadingTypes; -export type CoreUpdate = { +export declare type LoadingTypes = UpdaterLoadingTypes | InstallerLoadingTypes | MajorUpdaterLoadingTypes; +export declare type CoreUpdate = { package: UpdatedPackage; extension: Extension; }; diff --git a/extensions/pusher/js/dist-typings/forum/index.d.ts b/extensions/pusher/js/dist-typings/forum/index.d.ts index 76988b4d9..c33625216 100644 --- a/extensions/pusher/js/dist-typings/forum/index.d.ts +++ b/extensions/pusher/js/dist-typings/forum/index.d.ts @@ -1,5 +1,5 @@ import * as PusherTypes from 'pusher-js'; -export type PusherBinding = { +export declare type PusherBinding = { channels: { main: PusherTypes.Channel; user: PusherTypes.Channel | null; diff --git a/extensions/tags/js/dist-typings/common/components/TagSelectionModal.d.ts b/extensions/tags/js/dist-typings/common/components/TagSelectionModal.d.ts index 4f080cc8b..51cf3b63b 100644 --- a/extensions/tags/js/dist-typings/common/components/TagSelectionModal.d.ts +++ b/extensions/tags/js/dist-typings/common/components/TagSelectionModal.d.ts @@ -44,7 +44,7 @@ export interface ITagSelectionModalAttrs extends IInternalModalAttrs { /** Callback for when the selection is submitted. */ onsubmit?: (selected: Tag[]) => void; } -export type ITagSelectionModalState = undefined; +export declare type ITagSelectionModalState = undefined; export default class TagSelectionModal extends Modal { protected loading: boolean; protected tags: Tag[]; diff --git a/framework/core/js/dist-typings/admin/AdminApplication.d.ts b/framework/core/js/dist-typings/admin/AdminApplication.d.ts index 83e358926..07bbc6a2f 100644 --- a/framework/core/js/dist-typings/admin/AdminApplication.d.ts +++ b/framework/core/js/dist-typings/admin/AdminApplication.d.ts @@ -2,7 +2,7 @@ import { AdminRoutes } from './routes'; import Application, { ApplicationData } from '../common/Application'; import ExtensionData from './utils/ExtensionData'; import IHistory from '../common/IHistory'; -export type Extension = { +export declare type Extension = { id: string; name: string; version: string; diff --git a/framework/core/js/dist-typings/admin/components/AdminPage.d.ts b/framework/core/js/dist-typings/admin/components/AdminPage.d.ts index b8ed80130..1489a19bc 100644 --- a/framework/core/js/dist-typings/admin/components/AdminPage.d.ts +++ b/framework/core/js/dist-typings/admin/components/AdminPage.d.ts @@ -22,7 +22,7 @@ export interface AdminHeaderOptions { * * @see https://github.com/flarum/core/issues/3039 */ -export 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 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; @@ -80,14 +80,14 @@ export interface CustomSettingComponentOptions extends CommonSettingsItemOptions /** * All valid options for the setting component builder. */ -export type SettingsComponentOptions = HTMLInputSettingsComponentOptions | SwitchSettingComponentOptions | SelectSettingComponentOptions | TextareaSettingComponentOptions | ColorPreviewSettingComponentOptions | CustomSettingComponentOptions; +export declare type SettingsComponentOptions = HTMLInputSettingsComponentOptions | SwitchSettingComponentOptions | SelectSettingComponentOptions | TextareaSettingComponentOptions | ColorPreviewSettingComponentOptions | CustomSettingComponentOptions; /** * Valid attrs that can be returned by the `headerInfo` function */ -export type AdminHeaderAttrs = AdminHeaderOptions & Partial>; -export type SettingValue = string; -export type MutableSettings = Record>; -export type SaveSubmitEvent = SubmitEvent & { +export declare type AdminHeaderAttrs = AdminHeaderOptions & Partial>; +export declare type SettingValue = string; +export declare type MutableSettings = Record>; +export declare type SaveSubmitEvent = SubmitEvent & { redraw: boolean; }; export default abstract class AdminPage extends Page { diff --git a/framework/core/js/dist-typings/admin/components/BasicsPage.d.ts b/framework/core/js/dist-typings/admin/components/BasicsPage.d.ts index 55091ad78..cc28dc71e 100644 --- a/framework/core/js/dist-typings/admin/components/BasicsPage.d.ts +++ b/framework/core/js/dist-typings/admin/components/BasicsPage.d.ts @@ -3,7 +3,7 @@ import ItemList from '../../common/utils/ItemList'; import AdminPage from './AdminPage'; import type { IPageAttrs } from '../../common/components/Page'; import type Mithril from 'mithril'; -export type HomePageItem = { +export declare type HomePageItem = { path: string; label: Mithril.Children; }; diff --git a/framework/core/js/dist-typings/admin/components/PermissionGrid.d.ts b/framework/core/js/dist-typings/admin/components/PermissionGrid.d.ts index 8bf4eec8d..e11fa8f17 100644 --- a/framework/core/js/dist-typings/admin/components/PermissionGrid.d.ts +++ b/framework/core/js/dist-typings/admin/components/PermissionGrid.d.ts @@ -12,8 +12,8 @@ export interface PermissionSetting { icon: string; label: Mithril.Children; } -export type PermissionGridEntry = PermissionConfig | PermissionSetting; -export type PermissionType = 'view' | 'start' | 'reply' | 'moderate'; +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; diff --git a/framework/core/js/dist-typings/admin/components/SettingDropdown.d.ts b/framework/core/js/dist-typings/admin/components/SettingDropdown.d.ts index f85c3a3f1..cb83c0c2c 100644 --- a/framework/core/js/dist-typings/admin/components/SettingDropdown.d.ts +++ b/framework/core/js/dist-typings/admin/components/SettingDropdown.d.ts @@ -1,6 +1,6 @@ import SelectDropdown, { ISelectDropdownAttrs } from '../../common/components/SelectDropdown'; import Mithril from 'mithril'; -export type SettingDropdownOption = { +export declare type SettingDropdownOption = { value: any; label: string; }; diff --git a/framework/core/js/dist-typings/admin/components/UserListPage.d.ts b/framework/core/js/dist-typings/admin/components/UserListPage.d.ts index f5ac65f9e..6047d194a 100644 --- a/framework/core/js/dist-typings/admin/components/UserListPage.d.ts +++ b/framework/core/js/dist-typings/admin/components/UserListPage.d.ts @@ -3,7 +3,7 @@ import type Mithril from 'mithril'; import type User from '../../common/models/User'; import ItemList from '../../common/utils/ItemList'; import AdminPage from './AdminPage'; -type ColumnData = { +declare type ColumnData = { /** * Column title */ diff --git a/framework/core/js/dist-typings/admin/utils/ExtensionData.d.ts b/framework/core/js/dist-typings/admin/utils/ExtensionData.d.ts index ab3150777..c1abfe45b 100644 --- a/framework/core/js/dist-typings/admin/utils/ExtensionData.d.ts +++ b/framework/core/js/dist-typings/admin/utils/ExtensionData.d.ts @@ -3,12 +3,12 @@ import ItemList from '../../common/utils/ItemList'; import { SettingsComponentOptions } from '../components/AdminPage'; import ExtensionPage, { ExtensionPageAttrs } from '../components/ExtensionPage'; import { PermissionConfig, PermissionType } from '../components/PermissionGrid'; -type SettingConfigInput = SettingsComponentOptions | (() => Mithril.Children); -type SettingConfigInternal = SettingsComponentOptions | ((() => Mithril.Children) & { +declare type SettingConfigInput = SettingsComponentOptions | (() => Mithril.Children); +declare type SettingConfigInternal = SettingsComponentOptions | ((() => Mithril.Children) & { setting: string; }); -export type CustomExtensionPage = new () => ExtensionPage; -type ExtensionConfig = { +export declare type CustomExtensionPage = new () => ExtensionPage; +declare type ExtensionConfig = { settings?: ItemList; permissions?: { view?: ItemList; @@ -18,13 +18,13 @@ type ExtensionConfig = { }; page?: CustomExtensionPage; }; -type InnerDataNoActiveExtension = { +declare type InnerDataNoActiveExtension = { currentExtension: null; data: { [key: string]: ExtensionConfig | undefined; }; }; -type InnerDataActiveExtension = { +declare type InnerDataActiveExtension = { currentExtension: string; data: { [key: string]: ExtensionConfig; diff --git a/framework/core/js/dist-typings/common/Application.d.ts b/framework/core/js/dist-typings/common/Application.d.ts index 82f7902cb..39582fc88 100644 --- a/framework/core/js/dist-typings/common/Application.d.ts +++ b/framework/core/js/dist-typings/common/Application.d.ts @@ -15,8 +15,8 @@ import type { ComponentAttrs } from './Component'; import Model, { SavedModelData } from './Model'; import IHistory from './IHistory'; import IExtender from './extenders/IExtender'; -export type FlarumScreens = 'phone' | 'tablet' | 'desktop' | 'desktop-hd'; -export type FlarumGenericRoute = RouteItem; +export declare type FlarumScreens = 'phone' | 'tablet' | 'desktop' | 'desktop-hd'; +export declare type FlarumGenericRoute = RouteItem; export interface FlarumRequestOptions extends Omit, 'extract'> { errorHandler?: (error: RequestError) => void; url: string; @@ -36,7 +36,7 @@ export interface FlarumRequestOptions extends Omit, RouteArgs extends Record = {}> = { /** diff --git a/framework/core/js/dist-typings/common/Model.d.ts b/framework/core/js/dist-typings/common/Model.d.ts index bc20049af..070a299ab 100644 --- a/framework/core/js/dist-typings/common/Model.d.ts +++ b/framework/core/js/dist-typings/common/Model.d.ts @@ -23,7 +23,7 @@ export interface SavedModelData { attributes?: ModelAttributes; relationships?: ModelRelationships; } -export type ModelData = UnsavedModelData | SavedModelData; +export declare type ModelData = UnsavedModelData | SavedModelData; export interface SaveRelationships { [relationship: string]: null | Model | Model[]; } diff --git a/framework/core/js/dist-typings/common/Session.d.ts b/framework/core/js/dist-typings/common/Session.d.ts index 8b8bf0a52..a11c8f770 100644 --- a/framework/core/js/dist-typings/common/Session.d.ts +++ b/framework/core/js/dist-typings/common/Session.d.ts @@ -1,6 +1,6 @@ import User from './models/User'; import { FlarumRequestOptions } from './Application'; -export type LoginParams = { +export declare type LoginParams = { /** * The username/email */ diff --git a/framework/core/js/dist-typings/common/Store.d.ts b/framework/core/js/dist-typings/common/Store.d.ts index 9bd667432..150a50c84 100644 --- a/framework/core/js/dist-typings/common/Store.d.ts +++ b/framework/core/js/dist-typings/common/Store.d.ts @@ -25,7 +25,7 @@ export interface ApiQueryParamsPlural { sort?: string; meta?: MetaInformation; } -export type ApiQueryParams = ApiQueryParamsPlural | ApiQueryParamsSingle; +export declare type ApiQueryParams = ApiQueryParamsPlural | ApiQueryParamsSingle; export interface ApiPayloadSingle { data: SavedModelData; included?: SavedModelData[]; @@ -41,14 +41,14 @@ export interface ApiPayloadPlural { }; meta?: MetaInformation; } -export type ApiPayload = ApiPayloadSingle | ApiPayloadPlural; -export type ApiResponseSingle = M & { +export declare type ApiPayload = ApiPayloadSingle | ApiPayloadPlural; +export declare type ApiResponseSingle = M & { payload: ApiPayloadSingle; }; -export type ApiResponsePlural = M[] & { +export declare type ApiResponsePlural = M[] & { payload: ApiPayloadPlural; }; -export type ApiResponse = ApiResponseSingle | ApiResponsePlural; +export declare type ApiResponse = ApiResponseSingle | ApiResponsePlural; interface ApiQueryRequestOptions extends Omit, 'url'> { } interface StoreData { diff --git a/framework/core/js/dist-typings/common/Translator.d.ts b/framework/core/js/dist-typings/common/Translator.d.ts index 576642a7c..ba50f23d5 100644 --- a/framework/core/js/dist-typings/common/Translator.d.ts +++ b/framework/core/js/dist-typings/common/Translator.d.ts @@ -1,8 +1,8 @@ /// import { RichMessageFormatter } from '@askvortsov/rich-icu-message-formatter'; import { pluralTypeHandler, selectTypeHandler } from '@ultraq/icu-message-formatter'; -type Translations = Record; -type TranslatorParameters = Record; +declare type Translations = Record; +declare type TranslatorParameters = Record; export default class Translator { /** * A map of translation keys to their translated values. diff --git a/framework/core/js/dist-typings/common/extenders/Routes.d.ts b/framework/core/js/dist-typings/common/extenders/Routes.d.ts index e89d41299..0d5b87be7 100644 --- a/framework/core/js/dist-typings/common/extenders/Routes.d.ts +++ b/framework/core/js/dist-typings/common/extenders/Routes.d.ts @@ -1,6 +1,6 @@ import Application from '../Application'; import IExtender, { IExtensionModule } from './IExtender'; -type HelperRoute = (...args: any) => string; +declare type HelperRoute = (...args: any) => string; export default class Routes implements IExtender { private routes; private helpers; diff --git a/framework/core/js/dist-typings/common/helpers/listItems.d.ts b/framework/core/js/dist-typings/common/helpers/listItems.d.ts index 3d43aad3a..9df80263a 100644 --- a/framework/core/js/dist-typings/common/helpers/listItems.d.ts +++ b/framework/core/js/dist-typings/common/helpers/listItems.d.ts @@ -1,26 +1,26 @@ import type Mithril from 'mithril'; import { ComponentAttrs } from '../Component'; -type ModdedVnodeAttrs = { +declare type ModdedVnodeAttrs = { itemClassName?: string; key?: string; }; -type ModdedTag = Mithril.Vnode['tag'] & { +declare type ModdedTag = Mithril.Vnode['tag'] & { isListItem?: boolean; isActive?: (attrs: ComponentAttrs) => boolean; }; -type ModdedVnode = Mithril.Vnode & { +declare type ModdedVnode = Mithril.Vnode & { itemName?: string; itemClassName?: string; tag: ModdedTag; }; -type ModdedChild = ModdedVnode | string | number | boolean | null | undefined; -type ModdedChildArray = ModdedChildren[]; -type ModdedChildren = ModdedChild | ModdedChildArray; +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 type ModdedChildrenWithItemName = ModdedChildren & { +export declare type ModdedChildrenWithItemName = ModdedChildren & { itemName?: string; }; /** diff --git a/framework/core/js/dist-typings/common/states/AlertManagerState.d.ts b/framework/core/js/dist-typings/common/states/AlertManagerState.d.ts index 949947c18..f2a548e8c 100644 --- a/framework/core/js/dist-typings/common/states/AlertManagerState.d.ts +++ b/framework/core/js/dist-typings/common/states/AlertManagerState.d.ts @@ -3,8 +3,8 @@ import Alert, { AlertAttrs } from '../components/Alert'; /** * Returned by `AlertManagerState.show`. Used to dismiss alerts. */ -export type AlertIdentifier = number; -export type AlertArray = { +export declare type AlertIdentifier = number; +export declare type AlertArray = { [id: AlertIdentifier]: AlertState; }; export interface AlertState { diff --git a/framework/core/js/dist-typings/common/states/ModalManagerState.d.ts b/framework/core/js/dist-typings/common/states/ModalManagerState.d.ts index 6546e2ef9..3871714c7 100644 --- a/framework/core/js/dist-typings/common/states/ModalManagerState.d.ts +++ b/framework/core/js/dist-typings/common/states/ModalManagerState.d.ts @@ -7,11 +7,11 @@ import Modal, { IDismissibleOptions } from '../components/Modal'; * https://github.com/Microsoft/TypeScript/issues/1213 * Therefore, we have to use this ugly, messy workaround. */ -type UnsafeModalClass = ComponentClass & { +declare type UnsafeModalClass = ComponentClass & { get dismissibleOptions(): IDismissibleOptions; component: typeof Component.component; }; -type ModalItem = { +declare type ModalItem = { componentClass: UnsafeModalClass; attrs?: Record; key: number; diff --git a/framework/core/js/dist-typings/common/utils/KeyboardNavigatable.d.ts b/framework/core/js/dist-typings/common/utils/KeyboardNavigatable.d.ts index 0a6a41b38..fdd5d6a98 100644 --- a/framework/core/js/dist-typings/common/utils/KeyboardNavigatable.d.ts +++ b/framework/core/js/dist-typings/common/utils/KeyboardNavigatable.d.ts @@ -1,5 +1,5 @@ -type KeyboardEventHandler = (event: KeyboardEvent) => void; -type ShouldHandle = (event: KeyboardEvent) => boolean; +declare type KeyboardEventHandler = (event: KeyboardEvent) => void; +declare type ShouldHandle = (event: KeyboardEvent) => boolean; /** * The `KeyboardNavigatable` class manages lists that can be navigated with the * keyboard, calling callbacks for each actions. diff --git a/framework/core/js/dist-typings/common/utils/RequestError.d.ts b/framework/core/js/dist-typings/common/utils/RequestError.d.ts index 3d180c77d..88a26afac 100644 --- a/framework/core/js/dist-typings/common/utils/RequestError.d.ts +++ b/framework/core/js/dist-typings/common/utils/RequestError.d.ts @@ -1,6 +1,6 @@ import type Mithril from 'mithril'; import type { AlertAttrs } from '../components/Alert'; -export type InternalFlarumRequestOptions = Mithril.RequestOptions & { +export declare type InternalFlarumRequestOptions = Mithril.RequestOptions & { url: string; }; export default class RequestError { diff --git a/framework/core/js/dist-typings/common/utils/evented.d.ts b/framework/core/js/dist-typings/common/utils/evented.d.ts index 9d687da2d..70c243658 100644 --- a/framework/core/js/dist-typings/common/utils/evented.d.ts +++ b/framework/core/js/dist-typings/common/utils/evented.d.ts @@ -10,6 +10,16 @@ declare namespace _default { * @deprecated */ function getHandlers(event: string): Function[]; + /** + * Get all of the registered handlers for an event. + * + * @param {string} event The name of the event. + * @return {Function[]} + * @protected + * + * @deprecated + */ + function getHandlers(event: string): Function[]; /** * Trigger an event. * @@ -19,6 +29,24 @@ declare namespace _default { * @deprecated */ function trigger(event: string, ...args: any[]): void; + /** + * Trigger an event. + * + * @param {string} event The name of the event. + * @param {any[]} args Arguments to pass to event handlers. + * + * @deprecated + */ + function trigger(event: string, ...args: any[]): void; + /** + * Register an event handler. + * + * @param {string} event The name of the event. + * @param {Function} handler The function to handle the event. + * + * @deprecated + */ + function on(event: string, handler: Function): void; /** * Register an event handler. * @@ -38,6 +66,25 @@ declare namespace _default { * @deprecated */ function one(event: string, handler: Function): void; + /** + * Register an event handler so that it will run only once, and then + * unregister itself. + * + * @param {string} event The name of the event. + * @param {Function} handler The function to handle the event. + * + * @deprecated + */ + function one(event: string, handler: Function): void; + /** + * Unregister an event handler. + * + * @param {string} event The name of the event. + * @param {Function} handler The function that handles the event. + * + * @deprecated + */ + function off(event: string, handler: Function): void; /** * Unregister an event handler. * diff --git a/framework/core/js/dist-typings/forum/components/SignUpModal.d.ts b/framework/core/js/dist-typings/forum/components/SignUpModal.d.ts index 7a1e303bf..592c8844b 100644 --- a/framework/core/js/dist-typings/forum/components/SignUpModal.d.ts +++ b/framework/core/js/dist-typings/forum/components/SignUpModal.d.ts @@ -10,7 +10,7 @@ export interface ISignupModalAttrs extends IInternalModalAttrs { token?: string; provided?: string[]; } -export type SignupBody = { +export declare type SignupBody = { username: string; email: string; } & ({ diff --git a/framework/core/js/dist-typings/forum/states/GlobalSearchState.d.ts b/framework/core/js/dist-typings/forum/states/GlobalSearchState.d.ts index 3e53af384..61d2379b3 100644 --- a/framework/core/js/dist-typings/forum/states/GlobalSearchState.d.ts +++ b/framework/core/js/dist-typings/forum/states/GlobalSearchState.d.ts @@ -1,5 +1,5 @@ import SearchState from './SearchState'; -type SearchParams = Record; +declare type SearchParams = Record; export default class GlobalSearchState extends SearchState { private initialValueSet; constructor(cachedSearches?: never[]); diff --git a/framework/core/js/dist-typings/forum/utils/DiscussionControls.d.ts b/framework/core/js/dist-typings/forum/utils/DiscussionControls.d.ts index c6e224401..8091a90e8 100644 --- a/framework/core/js/dist-typings/forum/utils/DiscussionControls.d.ts +++ b/framework/core/js/dist-typings/forum/utils/DiscussionControls.d.ts @@ -1,4 +1,13 @@ declare namespace _default { + /** + * Get a list of controls for a discussion. + * + * @param {import('../../common/models/Discussion').default} discussion + * @param {import('../../common/Component').default} context The parent component under which the controls menu will be displayed. + * + * @return {ItemList} + */ + function controls(discussion: import("../../common/models/Discussion").default, context: import("../../common/Component").default): ItemList; /** * Get a list of controls for a discussion. * @@ -19,6 +28,17 @@ declare namespace _default { * @protected */ function userControls(discussion: import("../../common/models/Discussion").default, context: import("../../common/Component").default): ItemList; + /** + * Get controls for a discussion pertaining to the current user (e.g. reply, + * follow). + * + * @param {import('../../common/models/Discussion').default} discussion + * @param {import('../../common/Component').default} context The parent component under which the controls menu will be displayed. + * + * @return {ItemList} + * @protected + */ + function userControls(discussion: import("../../common/models/Discussion").default, context: import("../../common/Component").default): ItemList; /** * Get controls for a discussion pertaining to moderation (e.g. rename, lock). * @@ -29,6 +49,26 @@ declare namespace _default { * @protected */ function moderationControls(discussion: import("../../common/models/Discussion").default): ItemList; + /** + * Get controls for a discussion pertaining to moderation (e.g. rename, lock). + * + * @param {import('../../common/models/Discussion').default} discussion + * @param {import('../../common/Component').default} context The parent component under which the controls menu will be displayed. + * + * @return {ItemList} + * @protected + */ + function moderationControls(discussion: import("../../common/models/Discussion").default): ItemList; + /** + * Get controls for a discussion which are destructive (e.g. delete). + * + * @param {import('../../common/models/Discussion').default} discussion + * @param {import('../../common/Component').default} context The parent component under which the controls menu will be displayed. + * + * @return {ItemList} + * @protected + */ + function destructiveControls(discussion: import("../../common/models/Discussion").default): ItemList; /** * Get controls for a discussion which are destructive (e.g. delete). * @@ -51,12 +91,36 @@ declare namespace _default { * @return {Promise} */ function replyAction(goToLast: boolean, forceRefresh: boolean): Promise; + /** + * Open the reply composer for the discussion. A promise will be returned, + * which resolves when the composer opens successfully. If the user is not + * logged in, they will be prompted. If they don't have permission to + * reply, the promise will be rejected. + * + * @param {boolean} goToLast Whether or not to scroll down to the last post if the discussion is being viewed. + * @param {boolean} forceRefresh Whether or not to force a reload of the composer component, even if it is already open for this discussion. + * + * @return {Promise} + */ + function replyAction(goToLast: boolean, forceRefresh: boolean): Promise; /** * Hide a discussion. * * @return {Promise} */ function hideAction(): Promise; + /** + * Hide a discussion. + * + * @return {Promise} + */ + function hideAction(): Promise; + /** + * Restore a discussion. + * + * @return {Promise} + */ + function restoreAction(): Promise; /** * Restore a discussion. * @@ -69,6 +133,16 @@ declare namespace _default { * @return {Promise} */ function deleteAction(): Promise; + /** + * Delete the discussion after confirming with the user. + * + * @return {Promise} + */ + function deleteAction(): Promise; + /** + * Rename the discussion. + */ + function renameAction(): any; /** * Rename the discussion. */ diff --git a/framework/core/js/dist-typings/forum/utils/PostControls.d.ts b/framework/core/js/dist-typings/forum/utils/PostControls.d.ts index 5298e0739..6e94fb67a 100644 --- a/framework/core/js/dist-typings/forum/utils/PostControls.d.ts +++ b/framework/core/js/dist-typings/forum/utils/PostControls.d.ts @@ -8,6 +8,25 @@ declare namespace _default { * @return {ItemList}')} */ function controls(post: import("../../common/models/Post").default, context: import("../../common/Component").default): ItemList; + /** + * Get a list of controls for a post. + * + * @param {import('../../common/models/Post').default} post + * @param {import('../../common/Component').default} context The parent component under which the controls menu will be displayed. + * + * @return {ItemList}')} + */ + function controls(post: import("../../common/models/Post").default, context: import("../../common/Component").default): ItemList; + /** + * Get controls for a post pertaining to the current user (e.g. report). + * + * @param {import('../../common/models/Post').default} post + * @param {import('../../common/Component').default} context The parent component under which the controls menu will be displayed. + * + * @return {ItemList}')} + * @protected + */ + function userControls(post: import("../../common/models/Post").default, context: import("../../common/Component").default): ItemList; /** * Get controls for a post pertaining to the current user (e.g. report). * @@ -28,6 +47,26 @@ declare namespace _default { * @protected */ function moderationControls(post: import("../../common/models/Post").default, context: import("../../common/Component").default): ItemList; + /** + * Get controls for a post pertaining to moderation (e.g. edit). + * + * @param {import('../../common/models/Post').default} post + * @param {import('../../common/Component').default} context The parent component under which the controls menu will be displayed. + * + * @return {ItemList}')} + * @protected + */ + function moderationControls(post: import("../../common/models/Post").default, context: import("../../common/Component").default): ItemList; + /** + * Get controls for a post that are destructive (e.g. delete). + * + * @param {import('../../common/models/Post').default} post + * @param {import('../../common/Component').default} context The parent component under which the controls menu will be displayed. + * + * @return {ItemList}')} + * @protected + */ + function destructiveControls(post: import("../../common/models/Post").default, context: import("../../common/Component").default): ItemList; /** * Get controls for a post that are destructive (e.g. delete). * @@ -44,6 +83,18 @@ declare namespace _default { * @return {Promise} */ function editAction(): Promise; + /** + * Open the composer to edit a post. + * + * @return {Promise} + */ + function editAction(): Promise; + /** + * Hide a post. + * + * @return {Promise} + */ + function hideAction(): Promise; /** * Hide a post. * @@ -56,6 +107,18 @@ declare namespace _default { * @return {Promise} */ function restoreAction(): Promise; + /** + * Restore a post. + * + * @return {Promise} + */ + function restoreAction(): Promise; + /** + * Delete a post. + * + * @return {Promise} + */ + function deleteAction(context: any): Promise; /** * Delete a post. * diff --git a/framework/core/js/dist-typings/forum/utils/UserControls.d.ts b/framework/core/js/dist-typings/forum/utils/UserControls.d.ts index 301ba37ca..da72199cc 100644 --- a/framework/core/js/dist-typings/forum/utils/UserControls.d.ts +++ b/framework/core/js/dist-typings/forum/utils/UserControls.d.ts @@ -8,6 +8,25 @@ declare namespace _default { * @return {ItemList} */ function controls(user: import("../../common/models/User").default, context: import("../../common/Component").default): ItemList; + /** + * Get a list of controls for a user. + * + * @param {import('../../common/models/User').default} user + * @param {import('../../common/Component').default} context The parent component under which the controls menu will be displayed. + * + * @return {ItemList} + */ + function controls(user: import("../../common/models/User").default, context: import("../../common/Component").default): ItemList; + /** + * Get controls for a user pertaining to the current user (e.g. poke, follow). + * + * @param {import('../../common/models/User').default} user + * @param {import('../../common/Component').default} context The parent component under which the controls menu will be displayed. + * + * @return {ItemList} + * @protected + */ + function userControls(): ItemList; /** * Get controls for a user pertaining to the current user (e.g. poke, follow). * @@ -28,6 +47,26 @@ declare namespace _default { * @protected */ function moderationControls(user: import("../../common/models/User").default): ItemList; + /** + * Get controls for a user pertaining to moderation (e.g. suspend, edit). + * + * @param {import('../../common/models/User').default} user + * @param {import('../../common/Component').default} context The parent component under which the controls menu will be displayed. + * + * @return {ItemList} + * @protected + */ + function moderationControls(user: import("../../common/models/User").default): ItemList; + /** + * Get controls for a user which are destructive (e.g. delete). + * + * @param {import('../../common/models/User').default} user + * @param {import('../../common/Component').default} context The parent component under which the controls menu will be displayed. + * + * @return {ItemList} + * @protected + */ + function destructiveControls(user: import("../../common/models/User").default): ItemList; /** * Get controls for a user which are destructive (e.g. delete). * @@ -44,6 +83,19 @@ declare namespace _default { * @param {import('../../common/models/User').default} user */ function deleteAction(user: import("../../common/models/User").default): void; + /** + * Delete the user. + * + * @param {import('../../common/models/User').default} user + */ + function deleteAction(user: import("../../common/models/User").default): void; + /** + * Show deletion alert of user. + * + * @param {import('../../common/models/User').default} user + * @param {string} type + */ + function showDeletionAlert(user: import("../../common/models/User").default, type: string): void; /** * Show deletion alert of user. * @@ -57,6 +109,12 @@ declare namespace _default { * @param {import('../../common/models/User').default} user */ function editAction(user: import("../../common/models/User").default): void; + /** + * Edit the user. + * + * @param {import('../../common/models/User').default} user + */ + function editAction(user: import("../../common/models/User").default): void; } export default _default; import ItemList from "../../common/utils/ItemList";