Bundled output for commit 0107c96fb7

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

[skip ci]
This commit is contained in:
flarum-bot 2024-10-16 17:15:53 +00:00
parent 0107c96fb7
commit db17253ccd
25 changed files with 128 additions and 51 deletions

View File

@ -0,0 +1,25 @@
import Component, { type ComponentAttrs } from 'flarum/common/Component';
import type Mithril from 'mithril';
import ItemList from 'flarum/common/utils/ItemList';
import Stream from 'flarum/common/utils/Stream';
export interface IDiscoverSectionAttrs extends ComponentAttrs {
}
export default class DiscoverSection<CustomAttrs extends IDiscoverSectionAttrs = IDiscoverSectionAttrs> extends Component<CustomAttrs> {
protected search: Stream<string>;
protected warningsDismissed: Stream<boolean>;
oninit(vnode: Mithril.Vnode<CustomAttrs, this>): void;
load(page?: number): void;
view(): JSX.Element;
tabFilters(): Record<string, {
label: Mithril.Children;
active: () => boolean;
}>;
tabItems(): ItemList<unknown>;
warningItems(): ItemList<Mithril.Children>;
private applySearch;
toolbarPrimaryItems(): ItemList<unknown>;
toolbarSecondaryItems(): ItemList<unknown>;
extensionList(): JSX.Element;
footerItems(): ItemList<Mithril.Children>;
private setWarningDismissed;
}

View File

@ -0,0 +1,28 @@
import Component, { type ComponentAttrs } from 'flarum/common/Component';
import { type Extension as ExtensionInfo } from 'flarum/admin/AdminApplication';
import ExternalExtension from '../models/ExternalExtension';
import { UpdatedPackage } from '../states/ControlSectionState';
import ItemList from 'flarum/common/utils/ItemList';
import type Mithril from 'mithril';
export type CommonExtension = ExternalExtension | ExtensionInfo;
export interface IExtensionAttrs extends ComponentAttrs {
extension: CommonExtension;
updates?: UpdatedPackage;
onClickUpdate?: CallableFunction | {
soft: CallableFunction;
hard: CallableFunction;
};
whyNotWarning?: boolean;
isCore?: boolean;
updatable?: boolean;
isDanger?: boolean;
}
export default class ExtensionCard<CustomAttrs extends IExtensionAttrs = IExtensionAttrs> extends Component<CustomAttrs> {
getExtension(): ExtensionInfo;
view(): JSX.Element;
icon(): JSX.Element;
badges(): ItemList<Mithril.Children>;
metaItems(): ItemList<Mithril.Children>;
actionItems(): ItemList<Mithril.Children>;
version(v: string): string;
}

View File

@ -1,20 +0,0 @@
import type Mithril from 'mithril';
import Component, { ComponentAttrs } from 'flarum/common/Component';
import { Extension } from 'flarum/admin/AdminApplication';
import { UpdatedPackage } from '../states/ControlSectionState';
export interface ExtensionItemAttrs extends ComponentAttrs {
extension: Extension;
updates: UpdatedPackage;
onClickUpdate: CallableFunction | {
soft: CallableFunction;
hard: CallableFunction;
};
whyNotWarning?: boolean;
isCore?: boolean;
updatable?: boolean;
isDanger?: boolean;
}
export default class ExtensionItem<Attrs extends ExtensionItemAttrs = ExtensionItemAttrs> extends Component<Attrs> {
view(vnode: Mithril.Vnode<Attrs, this>): Mithril.Children;
version(v: string): string;
}

View File

@ -1,13 +0,0 @@
/// <reference types="mithril" />
import Component, { ComponentAttrs } from 'flarum/common/Component';
import QueueState from '../states/QueueState';
interface PaginationAttrs extends ComponentAttrs {
list: QueueState;
}
/**
* @todo make it abstract in core for reusability.
*/
export default class Pagination extends Component<PaginationAttrs> {
view(): JSX.Element;
}
export {};

View File

@ -1,2 +1,2 @@
declare const _default: import("flarum/common/extenders/Admin").default[]; declare const _default: (import("flarum/common/extenders/Store").default | import("flarum/common/extenders/Admin").default)[];
export default _default; export default _default;

View File

@ -0,0 +1,26 @@
import Model from 'flarum/common/Model';
import type { Extension } from 'flarum/admin/AdminApplication';
export default class ExternalExtension extends Model {
extensionId: () => string;
name: () => string;
title: () => string;
description: () => string;
iconUrl: () => string;
icon: () => {
[key: string]: string;
name: string;
};
highestVersion: () => string;
httpUri: () => string;
discussUri: () => string;
vendor: () => string;
isPremium: () => boolean;
isLocale: () => boolean;
locale: () => string;
latestFlarumVersionSupported: () => string;
downloads: () => number;
readonly installed = false;
isSupported(): boolean;
isStable(): boolean;
toLocalExtension(): Extension;
}

View File

@ -0,0 +1,7 @@
import PaginatedListState, { SortMap } from 'flarum/common/states/PaginatedListState';
import ExternalExtension from '../models/ExternalExtension';
export default class ExtensionListState extends PaginatedListState<ExternalExtension> {
get type(): string;
constructor();
sortMap(): SortMap;
}

View File

@ -1,6 +1,8 @@
import QueueState from './QueueState'; import QueueState from './QueueState';
import ControlSectionState from './ControlSectionState'; import ControlSectionState from './ControlSectionState';
import ExtensionListState from './ExtensionListState';
export default class ExtensionManagerState { export default class ExtensionManagerState {
queue: QueueState; queue: QueueState;
control: ControlSectionState; control: ControlSectionState;
extensions: ExtensionListState;
} }

View File

@ -6,14 +6,19 @@ export default class QueueState {
private limit; private limit;
private offset; private offset;
private total; private total;
private loading;
load(params?: ApiQueryParamsPlural, actionTaken?: boolean): Promise<Task[]>; load(params?: ApiQueryParamsPlural, actionTaken?: boolean): Promise<Task[]>;
isLoading(): boolean;
getItems(): Task[] | null; getItems(): Task[] | null;
getTotalItems(): number;
getTotalPages(): number; getTotalPages(): number;
pageNumber(): number; pageNumber(): number;
getPerPage(): number;
hasPrev(): boolean; hasPrev(): boolean;
hasNext(): boolean; hasNext(): boolean;
prev(): void; prev(): void;
next(): void; next(): void;
goto(page: number): void;
pollQueue(actionTaken?: boolean): void; pollQueue(actionTaken?: boolean): void;
hasPending(): boolean; hasPending(): boolean;
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5,13 +5,14 @@ import IHistory from '../common/IHistory';
import SearchManager from '../common/SearchManager'; import SearchManager from '../common/SearchManager';
import SearchState from '../common/states/SearchState'; import SearchState from '../common/states/SearchState';
import GeneralSearchIndex from './states/GeneralSearchIndex'; import GeneralSearchIndex from './states/GeneralSearchIndex';
export type Extension = { export interface Extension {
id: string; id: string;
name: string; name: string;
version: string; version: string;
description?: string; description?: string;
icon?: { icon?: {
name: string; name: string;
[key: string]: string;
}; };
links: { links: {
authors?: { authors?: {
@ -33,7 +34,7 @@ export type Extension = {
}; };
}; };
require?: Record<string, string>; require?: Record<string, string>;
}; }
export declare enum DatabaseDriver { export declare enum DatabaseDriver {
MySQL = "MySQL", MySQL = "MySQL",
PostgreSQL = "PostgreSQL", PostgreSQL = "PostgreSQL",

View File

@ -50,10 +50,6 @@ export default class UserListPage extends AdminPage {
* `undefined` when page loads as no data has been fetched. * `undefined` when page loads as no data has been fetched.
*/ */
private pageData; private pageData;
/**
* Are there more users available?
*/
private moreData;
private isLoadingPage; private isLoadingPage;
oninit(vnode: Mithril.Vnode<IPageAttrs, this>): void; oninit(vnode: Mithril.Vnode<IPageAttrs, this>): void;
/** /**
@ -89,8 +85,6 @@ export default class UserListPage extends AdminPage {
* @param pageNumber The **zero-based** page number to load and display * @param pageNumber The **zero-based** page number to load and display
*/ */
loadPage(pageNumber: number): Promise<void>; loadPage(pageNumber: number): Promise<void>;
nextPage(): void;
previousPage(): void;
/** /**
* @param page The **1-based** page number * @param page The **1-based** page number
*/ */

View File

@ -1,6 +1,11 @@
import { FlarumRequestOptions } from './Application'; import { FlarumRequestOptions } from './Application';
import Model, { ModelData, SavedModelData } from './Model'; import Model, { ModelData, SavedModelData } from './Model';
export interface MetaInformation { export interface MetaInformation {
page?: {
limit?: number;
offset?: number;
total?: number;
};
[key: string]: any; [key: string]: any;
} }
export interface ApiQueryParamsSingle { export interface ApiQueryParamsSingle {

View File

@ -29,6 +29,7 @@ import './utils/patchMithril';
import './utils/classList'; import './utils/classList';
import './utils/extractText'; import './utils/extractText';
import './utils/formatNumber'; import './utils/formatNumber';
import './utils/formatAmount';
import './utils/mapRoutes'; import './utils/mapRoutes';
import './utils/withAttr'; import './utils/withAttr';
import './utils/focusTrap'; import './utils/focusTrap';

View File

@ -8,7 +8,6 @@ export interface IInputAttrs extends ComponentAttrs {
clearable?: boolean; clearable?: boolean;
clearLabel?: string; clearLabel?: string;
loading?: boolean; loading?: boolean;
inputClassName?: string;
onchange?: (value: string) => void; onchange?: (value: string) => void;
value?: string; value?: string;
stream?: Stream<string>; stream?: Stream<string>;

View File

@ -0,0 +1,12 @@
/// <reference types="mithril" />
import Component, { ComponentAttrs } from '../Component';
export interface IPaginationInterface extends ComponentAttrs {
total: number;
perPage: number;
currentPage: number;
loadingPageNumber?: number;
onChange: (page: number) => void;
}
export default class Pagination<CustomAttrs extends IPaginationInterface = IPaginationInterface> extends Component<CustomAttrs> {
view(): JSX.Element;
}

View File

@ -34,11 +34,13 @@ export default abstract class PaginatedListState<T extends Model, P extends Pagi
static DEFAULT_PAGE_SIZE: number; static DEFAULT_PAGE_SIZE: number;
protected location: PaginationLocation; protected location: PaginationLocation;
pageSize: number | null; pageSize: number | null;
totalItems: number | null;
protected pages: Page<T>[]; protected pages: Page<T>[];
protected params: P; protected params: P;
protected initialLoading: boolean; protected initialLoading: boolean;
protected loadingPrev: boolean; protected loadingPrev: boolean;
protected loadingNext: boolean; protected loadingNext: boolean;
protected loadingPage: boolean;
protected constructor(params?: P, page?: number, pageSize?: number | null); protected constructor(params?: P, page?: number, pageSize?: number | null);
abstract get type(): string; abstract get type(): string;
clear(): void; clear(): void;
@ -67,6 +69,7 @@ export default abstract class PaginatedListState<T extends Model, P extends Pagi
*/ */
refreshParams(newParams: P, page: number): Promise<void>; refreshParams(newParams: P, page: number): Promise<void>;
refresh(page?: number): Promise<void>; refresh(page?: number): Promise<void>;
goto(page: number): Promise<void>;
getPages(): Page<T>[]; getPages(): Page<T>[];
getLocation(): PaginationLocation; getLocation(): PaginationLocation;
isLoading(): boolean; isLoading(): boolean;
@ -106,4 +109,5 @@ export default abstract class PaginatedListState<T extends Model, P extends Pagi
sortValue(sort: SortMapItem): string | undefined; sortValue(sort: SortMapItem): string | undefined;
currentSort(): string | undefined; currentSort(): string | undefined;
changeSort(sort: string): void; changeSort(sort: string): void;
changeFilter(key: string, value: string): void;
} }

View File

@ -0,0 +1 @@
export default function formatAmount(size: number): string;

2
framework/core/js/dist/admin.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
framework/core/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long