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

Bundled output for commit d268894e61

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

[skip ci]
This commit is contained in:
flarum-bot
2021-12-27 19:02:33 +00:00
parent d268894e61
commit 3d62a6af27
67 changed files with 578 additions and 615 deletions

View File

@@ -215,9 +215,6 @@ export default class Application {
* Make an AJAX request, handling any low-level errors that may occur.
*
* @see https://mithril.js.org/request.html
*
* @param options
* @return {Promise}
*/
request<ResponseType>(originalOptions: FlarumRequestOptions<ResponseType>): Promise<ResponseType>;
/**

View File

@@ -28,8 +28,8 @@ export default abstract class Fragment {
* containing all of the `li` elements inside the DOM element of this
* fragment.
*
* @param {String} [selector] a jQuery-compatible selector string
* @returns {jQuery} the jQuery object for the DOM node
* @param [selector] a jQuery-compatible selector string
* @returns the jQuery object for the DOM node
* @final
*/
$(selector?: string): JQuery;

View File

@@ -4,8 +4,8 @@ declare var _default: {
Store: typeof Store;
'utils/BasicEditorDriver': typeof BasicEditorDriver;
'utils/evented': {
handlers: Object;
getHandlers(event: string): any[];
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;

View File

@@ -15,14 +15,14 @@ export default class Checkbox extends Component<import("../Component").Component
/**
* Get the template for the checkbox's display (tick/cross icon).
*
* @return {*}
* @return {import('mithril').Children}
* @protected
*/
protected getDisplay(): any;
protected getDisplay(): import('mithril').Children;
/**
* Run a callback when the state of the checkbox is changed.
*
* @param {Boolean} checked
* @param {boolean} checked
* @protected
*/
protected onchange(checked: boolean): void;

View File

@@ -22,17 +22,17 @@ export default class Dropdown extends Component<import("../Component").Component
/**
* Get the template for the button.
*
* @return {*}
* @return {import('mithril').Children}
* @protected
*/
protected getButton(children: any): any;
protected getButton(children: any): import('mithril').Children;
/**
* Get the template for the button's content.
*
* @return {*}
* @return {import('mithril').Children}
* @protected
*/
protected getButtonContent(children: any): any;
protected getButtonContent(children: any): import('mithril').Children;
getMenu(items: any): JSX.Element;
}
import Component from "../Component";

View File

@@ -16,10 +16,10 @@ export default class LinkButton extends Button<import("./Button").IButtonAttrs>
/**
* Determine whether a component with the given attrs is 'active'.
*
* @param {Object} attrs
* @return {Boolean}
* @param {object} attrs
* @return {boolean}
*/
static isActive(attrs: Object): boolean;
static isActive(attrs: object): boolean;
constructor();
}
import Button from "./Button";

View File

@@ -18,23 +18,23 @@ export default class Navigation extends Component<import("../Component").Compone
/**
* Get the back button.
*
* @return {Object}
* @return {import('mithril').Children}
* @protected
*/
protected getBackButton(): Object;
protected getBackButton(): import('mithril').Children;
/**
* Get the pane pinned toggle button.
*
* @return {Object|String}
* @return {import('mithril').Children}
* @protected
*/
protected getPaneButton(): Object | string;
protected getPaneButton(): import('mithril').Children;
/**
* Get the drawer toggle button.
*
* @return {Object|String}
* @return {import('mithril').Children}
* @protected
*/
protected getDrawerButton(): Object | string;
protected getDrawerButton(): import('mithril').Children;
}
import Component from "../Component";

View File

@@ -7,9 +7,10 @@ export default class SplitDropdown extends Dropdown {
* Get the first child. If the first child is an array, the first item in that
* array will be returned.
*
* @return {*}
* @param {unknown[] | unknown} children
* @return {unknown}
* @protected
*/
protected getFirstChild(children: any): any;
protected getFirstChild(children: unknown[] | unknown): unknown;
}
import Dropdown from "./Dropdown";

View File

@@ -36,19 +36,19 @@ export default class TextEditor extends Component<import("../Component").Compone
/**
* Build an item list for the text editor controls.
*
* @return {ItemList}
* @return {ItemList<import('mithril').Children>}
*/
controlItems(): ItemList<any>;
controlItems(): ItemList<import('mithril').Children>;
/**
* Build an item list for the toolbar controls.
*
* @return {ItemList}
* @return {ItemList<import('mithril').Children>}
*/
toolbarItems(): ItemList<any>;
toolbarItems(): ItemList<import('mithril').Children>;
/**
* Handle input into the textarea.
*
* @param {String} value
* @param {string} value
*/
oninput(value: string): void;
/**

View File

@@ -23,7 +23,7 @@
* @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 object, K extends KeyOfType<T, Function>>(object: T, methods: K | K[], callback: (this: T, val: ReturnType<T[K]>, ...args: Parameters<T[K]>) => void): void;
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.
@@ -51,4 +51,4 @@ export declare function extend<T extends object, K extends KeyOfType<T, Function
* @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 object, K extends KeyOfType<T, Function>>(object: T, methods: K | K[], newMethod: (this: T, orig: T[K], ...args: Parameters<T[K]>) => void): void;
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;

View File

@@ -6,7 +6,7 @@
* punctuateSeries(['Toby', 'Franz', 'Dominion']) // Toby, Franz, and Dominion
* ```
*
* @param {Array} items
* @return {VirtualElement}
* @param {import('mithril').Children[]} items
* @return {import('mithril').Children}')}
*/
export default function punctuateSeries(items: any[]): any;
export default function punctuateSeries(items: import('mithril').Children[]): import('mithril').Children;

View File

@@ -20,7 +20,7 @@ export default class AlertManagerState {
/**
* Show an Alert in the alerts area.
*
* @returns The alert's ID, which can be used to dismiss the alert.
* @return The alert's ID, which can be used to dismiss the alert.
*/
show(children: Mithril.Children): AlertIdentifier;
show(attrs: AlertAttrs, children: Mithril.Children): AlertIdentifier;

View File

@@ -45,7 +45,7 @@ export default class ModalManagerState {
/**
* Checks if a modal is currently open.
*
* @returns `true` if a modal dialog is currently open, otherwise `false`.
* @return `true` if a modal dialog is currently open, otherwise `false`.
*/
isModalOpen(): boolean;
}

View File

@@ -5,12 +5,11 @@ export default class PageState {
/**
* Determine whether the page matches the given class and data.
*
* @param {object} type The page class to check against. Subclasses are
* accepted as well.
* @param {object} data
* @param {object} type The page class to check against. Subclasses are accepted as well.
* @param {Record<string, unknown>} data
* @return {boolean}
*/
matches(type: object, data?: object): boolean;
matches(type: object, data?: Record<string, unknown>): boolean;
get(key: any): any;
set(key: any, value: any): void;
}

View File

@@ -34,20 +34,15 @@ export default class Drawer {
* Check whether or not the drawer is currently open.
*
* @return {boolean}
* @public
*/
public isOpen(): boolean;
isOpen(): boolean;
/**
* Hide the drawer.
*
* @public
*/
public hide(): void;
hide(): void;
/**
* Show the drawer.
*
* @public
*/
public show(): void;
show(): void;
$backdrop: JQuery<HTMLElement> | undefined;
}

View File

@@ -192,7 +192,7 @@ export default class ItemList<T> {
*
* @param content The item's content (objects only)
* @param key The item's key
* @returns Proxied content
* @return Proxied content
*
* @internal
*/

View File

@@ -6,7 +6,6 @@ export default class ScrollListener {
/**
* @param {(top: number) => void} callback The callback to run when the scroll position
* changes.
* @public
*/
constructor(callback: (top: number) => void);
callback: (top: number) => void;
@@ -20,21 +19,15 @@ export default class ScrollListener {
protected loop(): void;
/**
* Run the callback, whether there was a scroll event or not.
*
* @public
*/
public update(): void;
update(): void;
/**
* Start listening to and handling the window's scroll position.
*
* @public
*/
public start(): void;
start(): void;
active: (() => void) | null | undefined;
/**
* Stop listening to and handling the window's scroll position.
*
* @public
*/
public stop(): void;
stop(): void;
}

View File

@@ -8,7 +8,7 @@
* position can be anchor to an element that is in or below the viewport, so
* the content in the viewport will stay the same.
*
* @param {DOMElement} element The element to anchor the scroll position to.
* @param {Function} callback The callback to run that will change page content.
* @param {HTMLElement | SVGElement | Element} element The element to anchor the scroll position to.
* @param {() => void} callback The callback to run that will change page content.
*/
export default function anchorScroll(element: any, callback: Function): void;
export default function anchorScroll(element: HTMLElement | SVGElement | Element, callback: () => void): void;

View File

@@ -3,9 +3,8 @@ import Model from '../Model';
* The `computed` utility creates a function that will cache its output until
* any of the dependent values are dirty.
*
* @param {...String} dependentKeys The keys of the dependent values.
* @param {function} compute The function which computes the value using the
* @param dependentKeys The keys of the dependent values.
* @param compute The function which computes the value using the
* dependent values.
* @return {Function}
*/
export default function computed<T, M = Model>(...args: [...string[], (this: M, ...args: unknown[]) => T]): () => T;

View File

@@ -1,79 +1,97 @@
declare namespace _default {
const handlers: Object;
const handlers: Record<string, unknown>;
/**
* Get all of the registered handlers for an event.
*
* @param {String} event The name of the event.
* @return {Array}
* @param {string} event The name of the event.
* @return {Function[]}
* @protected
*
* @deprecated
*/
function getHandlers(event: string): any[];
function getHandlers(event: string): Function[];
/**
* Get all of the registered handlers for an event.
*
* @param {String} event The name of the event.
* @return {Array}
* @param {string} event The name of the event.
* @return {Function[]}
* @protected
*
* @deprecated
*/
function getHandlers(event: string): any[];
function getHandlers(event: string): Function[];
/**
* Trigger an event.
*
* @param {String} event The name of the event.
* @param {...*} args Arguments to pass to event handlers.
* @public
* @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;
/**
* Trigger an event.
*
* @param {String} event The name of the event.
* @param {...*} args Arguments to pass to event handlers.
* @public
* @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.
* @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.
*
* @param {String} event The name of the event.
* @param {function} handler The function to handle the event.
* @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 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.
* @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;
/**
* 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.
* @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.
* @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.
*
* @param {String} event The name of the event.
* @param {function} handler The function that handles the event.
* @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;
}

View File

@@ -5,8 +5,8 @@
* @example
* class MyClass extends mixin(ExistingClass, evented, etc) {}
*
* @param {Class} Parent The class to extend the new class from.
* @param {...Object} mixins The objects to mix in.
* @return {Class} A new class that extends Parent and contains the mixins.
* @param {object} Parent The class to extend the new class from.
* @param {Record<string, any>[]} mixins The objects to mix in.
* @return {object} A new class that extends Parent and contains the mixins.
*/
export default function mixin(Parent: any, ...mixins: Object[]): any;
export default function mixin(Parent: object, ...mixins: Record<string, any>[]): object;