mirror of
https://github.com/flarum/core.git
synced 2025-08-13 11:54:32 +02:00
Bundled output for commit 3537f76eab
Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci]
This commit is contained in:
36
js/dist-typings/common/states/AlertManagerState.d.ts
vendored
Normal file
36
js/dist-typings/common/states/AlertManagerState.d.ts
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import Mithril from 'mithril';
|
||||
import Alert, { AlertAttrs } from '../components/Alert';
|
||||
/**
|
||||
* Returned by `AlertManagerState.show`. Used to dismiss alerts.
|
||||
*/
|
||||
export declare type AlertIdentifier = number;
|
||||
export interface AlertState {
|
||||
componentClass: typeof Alert;
|
||||
attrs: AlertAttrs;
|
||||
children: Mithril.Children;
|
||||
}
|
||||
export default class AlertManagerState {
|
||||
protected activeAlerts: {
|
||||
[id: number]: AlertState;
|
||||
};
|
||||
protected alertId: number;
|
||||
getActiveAlerts(): {
|
||||
[id: number]: AlertState;
|
||||
};
|
||||
/**
|
||||
* Show an Alert in the alerts area.
|
||||
*
|
||||
* @returns The alert's ID, which can be used to dismiss the alert.
|
||||
*/
|
||||
show(children: Mithril.Children): AlertIdentifier;
|
||||
show(attrs: AlertAttrs, children: Mithril.Children): AlertIdentifier;
|
||||
show(componentClass: Alert, attrs: AlertAttrs, children: Mithril.Children): AlertIdentifier;
|
||||
/**
|
||||
* Dismiss an alert.
|
||||
*/
|
||||
dismiss(key: AlertIdentifier): void;
|
||||
/**
|
||||
* Clear all alerts.
|
||||
*/
|
||||
clear(): void;
|
||||
}
|
19
js/dist-typings/common/states/ModalManagerState.d.ts
vendored
Normal file
19
js/dist-typings/common/states/ModalManagerState.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
export default class ModalManagerState {
|
||||
modal: {
|
||||
componentClass: any;
|
||||
attrs: any;
|
||||
} | null;
|
||||
/**
|
||||
* Show a modal dialog.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
public show(componentClass: any, attrs: any): void;
|
||||
/**
|
||||
* Close the modal dialog.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
public close(): void;
|
||||
closeTimeout: number | undefined;
|
||||
}
|
16
js/dist-typings/common/states/PageState.d.ts
vendored
Normal file
16
js/dist-typings/common/states/PageState.d.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
export default class PageState {
|
||||
constructor(type: any, data?: {});
|
||||
type: any;
|
||||
data: {};
|
||||
/**
|
||||
* 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
|
||||
* @return {boolean}
|
||||
*/
|
||||
matches(type: object, data?: object): boolean;
|
||||
get(key: any): any;
|
||||
set(key: any, value: any): void;
|
||||
}
|
78
js/dist-typings/common/states/PaginatedListState.d.ts
vendored
Normal file
78
js/dist-typings/common/states/PaginatedListState.d.ts
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
import Model from '../Model';
|
||||
export interface Page<TModel> {
|
||||
number: number;
|
||||
items: TModel[];
|
||||
hasPrev?: boolean;
|
||||
hasNext?: boolean;
|
||||
}
|
||||
export interface PaginationLocation {
|
||||
page: number;
|
||||
startIndex?: number;
|
||||
endIndex?: number;
|
||||
}
|
||||
export default abstract class PaginatedListState<T extends Model> {
|
||||
protected location: PaginationLocation;
|
||||
protected pageSize: number;
|
||||
protected pages: Page<T>[];
|
||||
protected params: any;
|
||||
protected initialLoading: boolean;
|
||||
protected loadingPrev: boolean;
|
||||
protected loadingNext: boolean;
|
||||
protected constructor(params?: any, page?: number, pageSize?: number);
|
||||
abstract get type(): string;
|
||||
clear(): void;
|
||||
loadPrev(): Promise<void>;
|
||||
loadNext(): Promise<void>;
|
||||
protected parseResults(pg: number, results: T[]): void;
|
||||
/**
|
||||
* Load a new page of results.
|
||||
*/
|
||||
protected loadPage(page?: number): Promise<T[]>;
|
||||
/**
|
||||
* Get the parameters that should be passed in the API request.
|
||||
* Do not include page offset unless subclass overrides loadPage.
|
||||
*
|
||||
* @abstract
|
||||
* @see loadPage
|
||||
*/
|
||||
protected requestParams(): any;
|
||||
/**
|
||||
* Update the `this.params` object, calling `refresh` if they have changed.
|
||||
* Use `requestParams` for converting `this.params` into API parameters
|
||||
*
|
||||
* @param newParams
|
||||
* @param page
|
||||
* @see requestParams
|
||||
*/
|
||||
refreshParams(newParams: any, page: number): any;
|
||||
refresh(page?: number): any;
|
||||
getPages(): Page<T>[];
|
||||
getLocation(): PaginationLocation;
|
||||
isLoading(): boolean;
|
||||
isInitialLoading(): boolean;
|
||||
isLoadingPrev(): boolean;
|
||||
isLoadingNext(): boolean;
|
||||
/**
|
||||
* Returns true when the number of items across all loaded pages is not 0.
|
||||
*
|
||||
* @see isEmpty
|
||||
*/
|
||||
hasItems(): boolean;
|
||||
/**
|
||||
* Returns true when there aren't any items *and* the state has already done its initial loading.
|
||||
* If you want to know whether there are items regardless of load state, use `hasItems()` instead
|
||||
*
|
||||
* @see hasItems
|
||||
*/
|
||||
isEmpty(): boolean;
|
||||
hasPrev(): boolean;
|
||||
hasNext(): boolean;
|
||||
/**
|
||||
* Stored state parameters.
|
||||
*/
|
||||
getParams(): any;
|
||||
protected getNextPageNumber(): number;
|
||||
protected getPrevPageNumber(): number;
|
||||
protected paramsChanged(newParams: any): boolean;
|
||||
protected getAllItems(): T[];
|
||||
}
|
Reference in New Issue
Block a user