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

Bundled output for commit 3537f76eab

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

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

View File

@@ -0,0 +1,160 @@
declare namespace _default {
/**
* Get a list of controls for a discussion.
*
* @param {Discussion} discussion
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @public
*/
function controls(discussion: any, context: any): ItemList;
/**
* Get a list of controls for a discussion.
*
* @param {Discussion} discussion
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @public
*/
function controls(discussion: any, context: any): ItemList;
/**
* Get controls for a discussion pertaining to the current user (e.g. reply,
* follow).
*
* @param {Discussion} discussion
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function userControls(discussion: any, context: any): ItemList;
/**
* Get controls for a discussion pertaining to the current user (e.g. reply,
* follow).
*
* @param {Discussion} discussion
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function userControls(discussion: any, context: any): ItemList;
/**
* Get controls for a discussion pertaining to moderation (e.g. rename, lock).
*
* @param {Discussion} discussion
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function moderationControls(discussion: any): ItemList;
/**
* Get controls for a discussion pertaining to moderation (e.g. rename, lock).
*
* @param {Discussion} discussion
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function moderationControls(discussion: any): ItemList;
/**
* Get controls for a discussion which are destructive (e.g. delete).
*
* @param {Discussion} discussion
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function destructiveControls(discussion: any): ItemList;
/**
* Get controls for a discussion which are destructive (e.g. delete).
*
* @param {Discussion} discussion
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function destructiveControls(discussion: any): ItemList;
/**
* 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<any>;
/**
* 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<any>;
/**
* Hide a discussion.
*
* @return {Promise}
*/
function hideAction(): Promise<any>;
/**
* Hide a discussion.
*
* @return {Promise}
*/
function hideAction(): Promise<any>;
/**
* Restore a discussion.
*
* @return {Promise}
*/
function restoreAction(): Promise<any>;
/**
* Restore a discussion.
*
* @return {Promise}
*/
function restoreAction(): Promise<any>;
/**
* Delete the discussion after confirming with the user.
*
* @return {Promise}
*/
function deleteAction(): Promise<any>;
/**
* Delete the discussion after confirming with the user.
*
* @return {Promise}
*/
function deleteAction(): Promise<any>;
/**
* Rename the discussion.
*
* @return {Promise}
*/
function renameAction(): Promise<any>;
/**
* Rename the discussion.
*
* @return {Promise}
*/
function renameAction(): Promise<any>;
}
export default _default;
import ItemList from "../../common/utils/ItemList";

View File

@@ -0,0 +1,70 @@
/**
* The `History` class keeps track and manages a stack of routes that the user
* has navigated to in their session.
*
* An item can be pushed to the top of the stack using the `push` method. An
* item in the stack has a name and a URL. The name need not be unique; if it is
* the same as the item before it, that will be overwritten with the new URL. In
* this way, if a user visits a discussion, and then visits another discussion,
* popping the history stack will still take them back to the discussion list
* rather than the previous discussion.
*/
export default class History {
constructor(defaultRoute: any);
/**
* The stack of routes that have been navigated to.
*
* @type {Array}
* @protected
*/
protected stack: any[];
/**
* Get the item on the top of the stack.
*
* @return {Object}
* @public
*/
public getCurrent(): Object;
/**
* Get the previous item on the stack.
*
* @return {Object}
* @public
*/
public getPrevious(): Object;
/**
* Push an item to the top of the stack.
*
* @param {String} name The name of the route.
* @param {String} title The title of the route.
* @param {String} [url] The URL of the route. The current URL will be used if
* not provided.
* @public
*/
public push(name: string, title: string, url?: string | undefined): void;
/**
* Check whether or not the history stack is able to be popped.
*
* @return {Boolean}
* @public
*/
public canGoBack(): boolean;
/**
* Go back to the previous route in the history stack.
*
* @public
*/
public back(): void;
/**
* Get the URL of the previous page.
*
* @public
*/
public backUrl(): any;
/**
* Go to the first route in the history stack.
*
* @public
*/
public home(): void;
}

View File

@@ -0,0 +1,67 @@
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.
*
* This helper encapsulates the key binding logic, providing a simple fluent
* API for use.
*/
export default class KeyboardNavigatable {
/**
* Callback to be executed for a specified input.
*/
protected callbacks: Map<number, KeyboardEventHandler>;
/**
* Callback that determines whether keyboard input should be handled.
* By default, always handle keyboard navigation.
*/
protected whenCallback: ShouldHandle;
/**
* Provide a callback to be executed when navigating upwards.
*
* This will be triggered by the Up key.
*/
onUp(callback: KeyboardEventHandler): KeyboardNavigatable;
/**
* Provide a callback to be executed when navigating downwards.
*
* This will be triggered by the Down key.
*/
onDown(callback: KeyboardEventHandler): KeyboardNavigatable;
/**
* Provide a callback to be executed when the current item is selected..
*
* This will be triggered by the Return and Tab keys..
*/
onSelect(callback: KeyboardEventHandler): KeyboardNavigatable;
/**
* Provide a callback to be executed when the navigation is canceled.
*
* This will be triggered by the Escape key.
*/
onCancel(callback: KeyboardEventHandler): KeyboardNavigatable;
/**
* Provide a callback to be executed when previous input is removed.
*
* This will be triggered by the Backspace key.
*
* @public
* @param {KeyboardNavigatable~keyCallback} callback
* @return {KeyboardNavigatable}
*/
onRemove(callback: KeyboardEventHandler): KeyboardNavigatable;
/**
* Provide a callback that determines whether keyboard input should be handled.
*/
when(callback: ShouldHandle): KeyboardNavigatable;
/**
* Set up the navigation key bindings on the given jQuery element.
*/
bindTo($element: JQuery): void;
/**
* Interpret the given keyboard event as navigation commands.
*/
navigate(event: KeyboardEvent): void;
}
export {};

89
js/dist-typings/forum/utils/Pane.d.ts vendored Normal file
View File

@@ -0,0 +1,89 @@
/**
* The `Pane` class manages the page's discussion list sidepane. The pane is a
* part of the content view (DiscussionPage component), but its visibility is
* determined by CSS classes applied to the outer page element. This class
* manages the application of those CSS classes.
*/
export default class Pane {
constructor(element: any);
/**
* The localStorage key to store the pane's pinned state with.
*
* @type {String}
* @protected
*/
protected pinnedKey: string;
/**
* The page element.
*
* @type {jQuery}
* @protected
*/
protected $element: JQueryStatic;
/**
* Whether or not the pane is currently pinned.
*
* @type {Boolean}
* @protected
*/
protected pinned: boolean;
/**
* Whether or not the pane is currently exists.
*
* @type {Boolean}
* @protected
*/
protected active: boolean;
/**
* Whether or not the pane is currently showing, or is hidden off the edge
* of the screen.
*
* @type {Boolean}
* @protected
*/
protected showing: boolean;
/**
* Enable the pane.
*
* @public
*/
public enable(): void;
/**
* Disable the pane.
*
* @public
*/
public disable(): void;
/**
* Show the pane.
*
* @public
*/
public show(): void;
/**
* Hide the pane.
*
* @public
*/
public hide(): void;
/**
* Begin a timeout to hide the pane, which can be cancelled by showing the
* pane.
*
* @public
*/
public onmouseleave(): void;
hideTimeout: number | undefined;
/**
* Toggle whether or not the pane is pinned.
*
* @public
*/
public togglePinned(): void;
/**
* Apply the appropriate CSS classes to the page element.
*
* @protected
*/
protected render(): void;
}

View File

@@ -0,0 +1,132 @@
declare namespace _default {
/**
* Get a list of controls for a post.
*
* @param {Post} post
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @public
*/
function controls(post: any, context: any): ItemList;
/**
* Get a list of controls for a post.
*
* @param {Post} post
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @public
*/
function controls(post: any, context: any): ItemList;
/**
* Get controls for a post pertaining to the current user (e.g. report).
*
* @param {Post} post
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function userControls(post: any, context: any): ItemList;
/**
* Get controls for a post pertaining to the current user (e.g. report).
*
* @param {Post} post
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function userControls(post: any, context: any): ItemList;
/**
* Get controls for a post pertaining to moderation (e.g. edit).
*
* @param {Post} post
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function moderationControls(post: any, context: any): ItemList;
/**
* Get controls for a post pertaining to moderation (e.g. edit).
*
* @param {Post} post
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function moderationControls(post: any, context: any): ItemList;
/**
* Get controls for a post that are destructive (e.g. delete).
*
* @param {Post} post
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function destructiveControls(post: any, context: any): ItemList;
/**
* Get controls for a post that are destructive (e.g. delete).
*
* @param {Post} post
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function destructiveControls(post: any, context: any): ItemList;
/**
* Open the composer to edit a post.
*
* @return {Promise}
*/
function editAction(): Promise<any>;
/**
* Open the composer to edit a post.
*
* @return {Promise}
*/
function editAction(): Promise<any>;
/**
* Hide a post.
*
* @return {Promise}
*/
function hideAction(): Promise<any>;
/**
* Hide a post.
*
* @return {Promise}
*/
function hideAction(): Promise<any>;
/**
* Restore a post.
*
* @return {Promise}
*/
function restoreAction(): Promise<any>;
/**
* Restore a post.
*
* @return {Promise}
*/
function restoreAction(): Promise<any>;
/**
* Delete a post.
*
* @return {Promise}
*/
function deleteAction(context: any): Promise<any>;
/**
* Delete a post.
*
* @return {Promise}
*/
function deleteAction(context: any): Promise<any>;
}
export default _default;
import ItemList from "../../common/utils/ItemList";

View File

@@ -0,0 +1,122 @@
declare namespace _default {
/**
* Get a list of controls for a user.
*
* @param {User} user
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @public
*/
function controls(user: any, context: any): ItemList;
/**
* Get a list of controls for a user.
*
* @param {User} user
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @public
*/
function controls(user: any, context: any): ItemList;
/**
* Get controls for a user pertaining to the current user (e.g. poke, follow).
*
* @param {User} user
* @param {*} 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).
*
* @param {User} user
* @param {*} 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 moderation (e.g. suspend, edit).
*
* @param {User} user
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function moderationControls(user: any): ItemList;
/**
* Get controls for a user pertaining to moderation (e.g. suspend, edit).
*
* @param {User} user
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function moderationControls(user: any): ItemList;
/**
* Get controls for a user which are destructive (e.g. delete).
*
* @param {User} user
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function destructiveControls(user: any): ItemList;
/**
* Get controls for a user which are destructive (e.g. delete).
*
* @param {User} user
* @param {*} context The parent component under which the controls menu will
* be displayed.
* @return {ItemList}
* @protected
*/
function destructiveControls(user: any): ItemList;
/**
* Delete the user.
*
* @param {User} user
*/
function deleteAction(user: any): void;
/**
* Delete the user.
*
* @param {User} user
*/
function deleteAction(user: any): void;
/**
* Show deletion alert of user.
*
* @param {User} user
* @param {string} type
*/
function showDeletionAlert(user: any, type: string): void;
/**
* Show deletion alert of user.
*
* @param {User} user
* @param {string} type
*/
function showDeletionAlert(user: any, type: string): void;
/**
* Edit the user.
*
* @param {User} user
*/
function editAction(user: any): void;
/**
* Edit the user.
*
* @param {User} user
*/
function editAction(user: any): void;
}
export default _default;
import ItemList from "../../common/utils/ItemList";

View File

@@ -0,0 +1,6 @@
/**
* Shows an alert if the user has not yet confirmed their email address.
*
* @param {ForumApplication} app
*/
export default function alertEmailConfirmation(app: any): void;

View File

@@ -0,0 +1,4 @@
/**
* @see https://stackoverflow.com/a/31732310
*/
export default function isSafariMobile(): boolean;

View File

@@ -0,0 +1,14 @@
/**
* The `slidable` utility adds touch gestures to an element so that it can be
* slid away to reveal controls underneath, and then released to activate those
* controls.
*
* It relies on the element having children with particular CSS classes.
* TODO: document
*
* @param {DOMElement} element
* @return {Object}
* @property {function} reset Revert the slider to its original position. This
* should be called, for example, when a controls dropdown is closed.
*/
export default function slidable(element: any): Object;