Bundled output for commit 7e6458a125

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

[skip ci]
This commit is contained in:
flarum-bot 2023-02-10 22:08:35 +00:00
parent 7e6458a125
commit 77a0b11bc8
31 changed files with 304 additions and 62 deletions

View File

@ -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<InstallerAttrs> {
packageName: Stream<string>;
oninit(vnode: Mithril.Vnode<InstallerAttrs, this>): void;

View File

@ -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<T extends MajorUpdaterAttrs = MajorUpdaterAttrs> extends Component<T> {
updateState: UpdateState;
oninit(vnode: Mithril.Vnode<T, this>): void;

View File

@ -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<IUpdaterAttrs> {
view(): (JSX.Element | null)[];
lastUpdateCheckView(): JSX.Element | null;

View File

@ -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;

View File

@ -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;
};

View File

@ -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;

View File

@ -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<CustomAttrs extends ITagSelectionModalAttrs = ITagSelectionModalAttrs, CustomState extends ITagSelectionModalState = ITagSelectionModalState> extends Modal<CustomAttrs, CustomState> {
protected loading: boolean;
protected tags: Tag[];

View File

@ -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;

View File

@ -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<Omit<Mithril.Attributes, 'class'>>;
export type SettingValue = string;
export type MutableSettings = Record<string, Stream<SettingValue>>;
export type SaveSubmitEvent = SubmitEvent & {
export declare type AdminHeaderAttrs = AdminHeaderOptions & Partial<Omit<Mithril.Attributes, 'class'>>;
export declare type SettingValue = string;
export declare type MutableSettings = Record<string, Stream<SettingValue>>;
export declare type SaveSubmitEvent = SubmitEvent & {
redraw: boolean;
};
export default abstract class AdminPage<CustomAttrs extends IPageAttrs = IPageAttrs> extends Page<CustomAttrs> {

View File

@ -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;
};

View File

@ -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;

View File

@ -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;
};

View File

@ -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
*/

View File

@ -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<Attrs extends ExtensionPageAttrs = ExtensionPageAttrs> = new () => ExtensionPage<Attrs>;
type ExtensionConfig = {
export declare type CustomExtensionPage<Attrs extends ExtensionPageAttrs = ExtensionPageAttrs> = new () => ExtensionPage<Attrs>;
declare type ExtensionConfig = {
settings?: ItemList<SettingConfigInternal>;
permissions?: {
view?: ItemList<PermissionConfig>;
@ -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;

View File

@ -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<any, any, any>;
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;
@ -36,7 +36,7 @@ export interface FlarumRequestOptions<ResponseType> extends Omit<Mithril.Request
/**
* A valid route definition.
*/
export type RouteItem<Attrs extends ComponentAttrs, Comp extends Component<Attrs & {
export declare type RouteItem<Attrs extends ComponentAttrs, Comp extends Component<Attrs & {
routeName: string;
}>, RouteArgs extends Record<string, unknown> = {}> = {
/**

View File

@ -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[];
}

View File

@ -1,6 +1,6 @@
import User from './models/User';
import { FlarumRequestOptions } from './Application';
export type LoginParams = {
export declare type LoginParams = {
/**
* The username/email
*/

View File

@ -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 extends Model> = M & {
export declare type ApiPayload = ApiPayloadSingle | ApiPayloadPlural;
export declare type ApiResponseSingle<M extends Model> = M & {
payload: ApiPayloadSingle;
};
export type ApiResponsePlural<M extends Model> = M[] & {
export declare type ApiResponsePlural<M extends Model> = M[] & {
payload: ApiPayloadPlural;
};
export type ApiResponse<M extends Model> = ApiResponseSingle<M> | ApiResponsePlural<M>;
export declare type ApiResponse<M extends Model> = ApiResponseSingle<M> | ApiResponsePlural<M>;
interface ApiQueryRequestOptions<ResponseType> extends Omit<FlarumRequestOptions<ResponseType>, 'url'> {
}
interface StoreData {

View File

@ -1,8 +1,8 @@
/// <reference path="../@types/translator-icu-rich.d.ts" />
import { RichMessageFormatter } from '@askvortsov/rich-icu-message-formatter';
import { pluralTypeHandler, selectTypeHandler } from '@ultraq/icu-message-formatter';
type Translations = Record<string, string>;
type TranslatorParameters = Record<string, unknown>;
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.

View File

@ -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;

View File

@ -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<ModdedVnodeAttrs> & {
declare type ModdedVnode = Mithril.Vnode<ModdedVnodeAttrs> & {
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;
};
/**

View File

@ -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 {

View File

@ -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<any, Modal> & {
declare type UnsafeModalClass = ComponentClass<any, Modal> & {
get dismissibleOptions(): IDismissibleOptions;
component: typeof Component.component;
};
type ModalItem = {
declare type ModalItem = {
componentClass: UnsafeModalClass;
attrs?: Record<string, unknown>;
key: number;

View File

@ -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.

View File

@ -1,6 +1,6 @@
import type Mithril from 'mithril';
import type { AlertAttrs } from '../components/Alert';
export type InternalFlarumRequestOptions<ResponseType> = Mithril.RequestOptions<ResponseType> & {
export declare type InternalFlarumRequestOptions<ResponseType> = Mithril.RequestOptions<ResponseType> & {
url: string;
};
export default class RequestError<ResponseType = string> {

View File

@ -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.
*

View File

@ -10,7 +10,7 @@ export interface ISignupModalAttrs extends IInternalModalAttrs {
token?: string;
provided?: string[];
}
export type SignupBody = {
export declare type SignupBody = {
username: string;
email: string;
} & ({

View File

@ -1,5 +1,5 @@
import SearchState from './SearchState';
type SearchParams = Record<string, string>;
declare type SearchParams = Record<string, string>;
export default class GlobalSearchState extends SearchState {
private initialValueSet;
constructor(cachedSearches?: never[]);

View File

@ -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<any, any>} context The parent component under which the controls menu will be displayed.
*
* @return {ItemList<import('mithril').Children>}
*/
function controls(discussion: import("../../common/models/Discussion").default, context: import("../../common/Component").default<any, any>): ItemList<import("mithril").Children>;
/**
* 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<any, any>): ItemList<import("mithril").Children>;
/**
* 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<any, any>} context The parent component under which the controls menu will be displayed.
*
* @return {ItemList<import('mithril').Children>}
* @protected
*/
function userControls(discussion: import("../../common/models/Discussion").default, context: import("../../common/Component").default<any, any>): ItemList<import("mithril").Children>;
/**
* 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<import("mithril").Children>;
/**
* Get controls for a discussion pertaining to moderation (e.g. rename, lock).
*
* @param {import('../../common/models/Discussion').default} discussion
* @param {import('../../common/Component').default<any, any>} context The parent component under which the controls menu will be displayed.
*
* @return {ItemList<import('mithril').Children>}
* @protected
*/
function moderationControls(discussion: import("../../common/models/Discussion").default): ItemList<import("mithril").Children>;
/**
* Get controls for a discussion which are destructive (e.g. delete).
*
* @param {import('../../common/models/Discussion').default} discussion
* @param {import('../../common/Component').default<any, any>} context The parent component under which the controls menu will be displayed.
*
* @return {ItemList<import('mithril').Children>}
* @protected
*/
function destructiveControls(discussion: import("../../common/models/Discussion").default): ItemList<import("mithril").Children>;
/**
* Get controls for a discussion which are destructive (e.g. delete).
*
@ -51,12 +91,36 @@ declare namespace _default {
* @return {Promise<void>}
*/
function replyAction(goToLast: boolean, forceRefresh: boolean): Promise<void>;
/**
* 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<void>}
*/
function replyAction(goToLast: boolean, forceRefresh: boolean): Promise<void>;
/**
* Hide a discussion.
*
* @return {Promise<void>}
*/
function hideAction(): Promise<void>;
/**
* Hide a discussion.
*
* @return {Promise<void>}
*/
function hideAction(): Promise<void>;
/**
* Restore a discussion.
*
* @return {Promise<void>}
*/
function restoreAction(): Promise<void>;
/**
* Restore a discussion.
*
@ -69,6 +133,16 @@ declare namespace _default {
* @return {Promise<void>}
*/
function deleteAction(): Promise<void>;
/**
* Delete the discussion after confirming with the user.
*
* @return {Promise<void>}
*/
function deleteAction(): Promise<void>;
/**
* Rename the discussion.
*/
function renameAction(): any;
/**
* Rename the discussion.
*/

View File

@ -8,6 +8,25 @@ declare namespace _default {
* @return {ItemList<import('mithril').Children>}')}
*/
function controls(post: import("../../common/models/Post").default, context: import("../../common/Component").default<any, any>): ItemList<import("mithril").Children>;
/**
* Get a list of controls for a post.
*
* @param {import('../../common/models/Post').default} post
* @param {import('../../common/Component').default<any, any>} context The parent component under which the controls menu will be displayed.
*
* @return {ItemList<import('mithril').Children>}')}
*/
function controls(post: import("../../common/models/Post").default, context: import("../../common/Component").default<any, any>): ItemList<import("mithril").Children>;
/**
* 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<any, any>} context The parent component under which the controls menu will be displayed.
*
* @return {ItemList<import('mithril').Children>}')}
* @protected
*/
function userControls(post: import("../../common/models/Post").default, context: import("../../common/Component").default<any, any>): ItemList<import("mithril").Children>;
/**
* 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<any, any>): ItemList<import("mithril").Children>;
/**
* Get controls for a post pertaining to moderation (e.g. edit).
*
* @param {import('../../common/models/Post').default} post
* @param {import('../../common/Component').default<any, any>} context The parent component under which the controls menu will be displayed.
*
* @return {ItemList<import('mithril').Children>}')}
* @protected
*/
function moderationControls(post: import("../../common/models/Post").default, context: import("../../common/Component").default<any, any>): ItemList<import("mithril").Children>;
/**
* Get controls for a post that are destructive (e.g. delete).
*
* @param {import('../../common/models/Post').default} post
* @param {import('../../common/Component').default<any, any>} context The parent component under which the controls menu will be displayed.
*
* @return {ItemList<import('mithril').Children>}')}
* @protected
*/
function destructiveControls(post: import("../../common/models/Post").default, context: import("../../common/Component").default<any, any>): ItemList<import("mithril").Children>;
/**
* Get controls for a post that are destructive (e.g. delete).
*
@ -44,6 +83,18 @@ declare namespace _default {
* @return {Promise<void>}
*/
function editAction(): Promise<void>;
/**
* Open the composer to edit a post.
*
* @return {Promise<void>}
*/
function editAction(): Promise<void>;
/**
* Hide a post.
*
* @return {Promise<void>}
*/
function hideAction(): Promise<void>;
/**
* Hide a post.
*
@ -56,6 +107,18 @@ declare namespace _default {
* @return {Promise<void>}
*/
function restoreAction(): Promise<void>;
/**
* Restore a post.
*
* @return {Promise<void>}
*/
function restoreAction(): Promise<void>;
/**
* Delete a post.
*
* @return {Promise<void>}
*/
function deleteAction(context: any): Promise<void>;
/**
* Delete a post.
*

View File

@ -8,6 +8,25 @@ declare namespace _default {
* @return {ItemList<import('mithril').Children>}
*/
function controls(user: import("../../common/models/User").default, context: import("../../common/Component").default<any, any>): ItemList<import("mithril").Children>;
/**
* Get a list of controls for a user.
*
* @param {import('../../common/models/User').default} user
* @param {import('../../common/Component').default<any, any>} context The parent component under which the controls menu will be displayed.
*
* @return {ItemList<import('mithril').Children>}
*/
function controls(user: import("../../common/models/User").default, context: import("../../common/Component").default<any, any>): ItemList<import("mithril").Children>;
/**
* 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<any, any>} context The parent component under which the controls menu will be displayed.
*
* @return {ItemList<import('mithril').Children>}
* @protected
*/
function userControls(): ItemList<import("mithril").Children>;
/**
* 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<import("mithril").Children>;
/**
* Get controls for a user pertaining to moderation (e.g. suspend, edit).
*
* @param {import('../../common/models/User').default} user
* @param {import('../../common/Component').default<any, any>} context The parent component under which the controls menu will be displayed.
*
* @return {ItemList<import('mithril').Children>}
* @protected
*/
function moderationControls(user: import("../../common/models/User").default): ItemList<import("mithril").Children>;
/**
* Get controls for a user which are destructive (e.g. delete).
*
* @param {import('../../common/models/User').default} user
* @param {import('../../common/Component').default<any, any>} context The parent component under which the controls menu will be displayed.
*
* @return {ItemList<import('mithril').Children>}
* @protected
*/
function destructiveControls(user: import("../../common/models/User").default): ItemList<import("mithril").Children>;
/**
* 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";