1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 07:57:46 +02:00

Bundled output for commit 7471ef64d5

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

[skip ci]
This commit is contained in:
flarum-bot
2022-07-14 15:02:48 +00:00
parent 7471ef64d5
commit bacb095382
14 changed files with 63 additions and 51 deletions

View File

@@ -1,6 +1,7 @@
import { AdminRoutes } from './routes';
import Application, { ApplicationData } from '../common/Application';
import ExtensionData from './utils/ExtensionData';
import IHistory from '../common/IHistory';
export declare type Extension = {
id: string;
version: string;
@@ -40,12 +41,7 @@ export default class AdminApplication extends Application {
theme: number;
language: number;
};
history: {
canGoBack: () => boolean;
getPrevious: () => void;
backUrl: () => string;
back: () => void;
};
history: IHistory;
/**
* Settings are serialized to the admin dashboard as strings.
* Additional encoding/decoding is possible, but must take

View File

@@ -13,6 +13,7 @@ import type Mithril from 'mithril';
import type Component from './Component';
import type { ComponentAttrs } from './Component';
import Model, { SavedModelData } from './Model';
import IHistory from './IHistory';
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'> {
@@ -177,6 +178,8 @@ export default class Application {
* An object that manages the state of the navigation drawer.
*/
drawer: Drawer;
history: IHistory | null;
pane: any;
data: ApplicationData;
private _title;
private _titleCount;

View File

@@ -110,5 +110,5 @@ export default abstract class Component<Attrs extends ComponentAttrs = Component
*
* This can be used to assign default values for missing, optional attrs.
*/
static initAttrs<T>(attrs: T): void;
static initAttrs(attrs: unknown): void;
}

14
framework/core/js/dist-typings/common/IHistory.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
export interface HistoryEntry {
name: string;
title: string;
url: string;
}
export default interface IHistory {
canGoBack(): boolean;
getCurrent(): HistoryEntry | null;
getPrevious(): HistoryEntry | null;
push(name: string, title: string, url: string): void;
back(): void;
backUrl(): string;
home(): void;
}

View File

@@ -1,3 +1,11 @@
/// <reference types="mithril" />
import Component, { ComponentAttrs } from '../Component';
export interface IBadgeAttrs extends ComponentAttrs {
icon: string;
type?: string;
label?: string;
color?: string;
}
/**
* The `Badge` component represents a user/discussion badge, indicating some
* status (e.g. a discussion is stickied, a user is an admin).
@@ -11,8 +19,6 @@
*
* All other attrs will be assigned as attributes on the badge element.
*/
export default class Badge extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
export default class Badge<CustomAttrs extends IBadgeAttrs = IBadgeAttrs> extends Component<CustomAttrs> {
view(): JSX.Element;
}
import Component from "../Component";

View File

@@ -1,3 +1,11 @@
import Component, { ComponentAttrs } from '../Component';
import type Mithril from 'mithril';
export interface ICheckboxAttrs extends ComponentAttrs {
state?: boolean;
loading?: boolean;
disabled?: boolean;
onchange: (checked: boolean, component: Checkbox<this>) => void;
}
/**
* The `Checkbox` component defines a checkbox input.
*
@@ -10,22 +18,14 @@
* - `onchange` A callback to run when the checkbox is checked/unchecked.
* - `children` A text label to display next to the checkbox.
*/
export default class Checkbox extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
view(vnode: any): JSX.Element;
export default class Checkbox<CustomAttrs extends ICheckboxAttrs = ICheckboxAttrs> extends Component<CustomAttrs> {
view(vnode: Mithril.Vnode<CustomAttrs, this>): JSX.Element;
/**
* Get the template for the checkbox's display (tick/cross icon).
*
* @return {import('mithril').Children}
* @protected
*/
protected getDisplay(): import('mithril').Children;
protected getDisplay(): Mithril.Children;
/**
* Run a callback when the state of the checkbox is changed.
*
* @param {boolean} checked
* @protected
*/
protected onchange(checked: boolean): void;
}
import Component from "../Component";

View File

@@ -1,4 +1,8 @@
export default class GroupBadge extends Badge {
static initAttrs(attrs: any): void;
import Badge, { IBadgeAttrs } from './Badge';
import Group from '../models/Group';
export interface IGroupAttrs extends IBadgeAttrs {
group?: Group;
}
export default class GroupBadge<CustomAttrs extends IGroupAttrs = IGroupAttrs> extends Badge<CustomAttrs> {
static initAttrs(attrs: IGroupAttrs): void;
}
import Badge from "./Badge";

View File

@@ -1,3 +1,5 @@
import Component from '../Component';
import type Mithril from 'mithril';
/**
* The `Navigation` component displays a set of navigation buttons. Typically
* this is just a back button which pops the app's History. If the user is on
@@ -13,29 +15,18 @@
* - `drawer` Whether or not to show a button to toggle the app's drawer if
* there is no more history to pop.
*/
export default class Navigation extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
export default class Navigation extends Component {
view(): JSX.Element;
/**
* Get the back button.
*
* @return {import('mithril').Children}
* @protected
*/
protected getBackButton(): import('mithril').Children;
protected getBackButton(): Mithril.Children;
/**
* Get the pane pinned toggle button.
*
* @return {import('mithril').Children}
* @protected
*/
protected getPaneButton(): import('mithril').Children;
protected getPaneButton(): Mithril.Children;
/**
* Get the drawer toggle button.
*
* @return {import('mithril').Children}
* @protected
*/
protected getDrawerButton(): import('mithril').Children;
protected getDrawerButton(): Mithril.Children;
}
import Component from "../Component";

View File

@@ -1,8 +1,10 @@
/// <reference types="mithril" />
import Checkbox, { ICheckboxAttrs } from './Checkbox';
/**
* The `Switch` component is a `Checkbox`, but with a switch display instead of
* a tick/cross one.
*/
export default class Switch extends Checkbox {
static initAttrs(attrs: any): void;
static initAttrs(attrs: ICheckboxAttrs): void;
getDisplay(): import("mithril").Children;
}
import Checkbox from "./Checkbox";

View File

@@ -1,8 +1,4 @@
export interface HistoryEntry {
name: string;
title: string;
url: string;
}
import IHistory, { HistoryEntry } from '../../common/IHistory';
/**
* The `History` class keeps track and manages a stack of routes that the user
* has navigated to in their session.
@@ -14,7 +10,7 @@ export interface HistoryEntry {
* popping the history stack will still take them back to the discussion list
* rather than the previous discussion.
*/
export default class History {
export default class History implements IHistory {
/**
* The stack of routes that have been navigated to.
*/

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

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