mirror of
https://github.com/flarum/core.git
synced 2025-07-22 17:21:27 +02:00
Bundled output for commit 2831ce226c
Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci]
This commit is contained in:
82
js/dist-typings/@types/global.d.ts
vendored
Normal file
82
js/dist-typings/@types/global.d.ts
vendored
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
/**
|
||||||
|
* @deprecated Please import `app` from a namespace instead of using it as a global variable.
|
||||||
|
*
|
||||||
|
* @example App in forum JS
|
||||||
|
* ```
|
||||||
|
* import app from 'flarum/forum/app';
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @example App in admin JS
|
||||||
|
* ```
|
||||||
|
* import app from 'flarum/admin/app';
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @example App in common JS
|
||||||
|
* ```
|
||||||
|
* import app from 'flarum/common/app';
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
declare const app: never;
|
||||||
|
|
||||||
|
declare const m: import('mithril').Static;
|
||||||
|
declare const dayjs: typeof import('dayjs');
|
||||||
|
|
||||||
|
type ESModule = { __esModule: true; [key: string]: unknown };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The global `flarum` variable.
|
||||||
|
*
|
||||||
|
* Contains the compiled ES Modules for all Flarum extensions and core.
|
||||||
|
*
|
||||||
|
* @example <caption>Check if `flarum-tags` is present</captions>
|
||||||
|
* if ('flarum-tags' in flarum.extensions) {
|
||||||
|
* // Tags is installed and enabled!
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
interface FlarumObject {
|
||||||
|
/**
|
||||||
|
* Contains the compiled ES Module for Flarum's core.
|
||||||
|
*
|
||||||
|
* You shouldn't need to access this directly for any reason.
|
||||||
|
*/
|
||||||
|
core: Readonly<ESModule>;
|
||||||
|
/**
|
||||||
|
* Contains the compiled ES Modules for all Flarum extensions.
|
||||||
|
*
|
||||||
|
* @example <caption>Check if `flarum-tags` is present</captions>
|
||||||
|
* if ('flarum-tags' in flarum.extensions) {
|
||||||
|
* // Tags is installed and enabled!
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
extensions: Readonly<Record<string, ESModule>>;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare const flarum: FlarumObject;
|
||||||
|
|
||||||
|
// Extend JQuery with our custom functions, defined with $.fn
|
||||||
|
interface JQuery {
|
||||||
|
/**
|
||||||
|
* Flarum's tooltip JQuery plugin.
|
||||||
|
*
|
||||||
|
* Do not use this directly. Instead use the `<Tooltip>` component that
|
||||||
|
* is exported from `flarum/common/components/Tooltip`.
|
||||||
|
*
|
||||||
|
* This will be removed in a future version of Flarum.
|
||||||
|
*
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
tooltip: import('./tooltips/index').TooltipJQueryFunction;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For more info, see: https://www.typescriptlang.org/docs/handbook/jsx.html#attribute-type-checking
|
||||||
|
*
|
||||||
|
* In a nutshell, we need to add `ElementAttributesProperty` to tell Typescript
|
||||||
|
* what property on component classes to look at for attribute typings. For our
|
||||||
|
* Component class, this would be `attrs` (e.g. `this.attrs...`)
|
||||||
|
*/
|
||||||
|
interface JSX {
|
||||||
|
ElementAttributesProperty: {
|
||||||
|
attrs: Record<string, unknown>;
|
||||||
|
};
|
||||||
|
}
|
53
js/dist-typings/@types/global/index.d.ts
vendored
53
js/dist-typings/@types/global/index.d.ts
vendored
@@ -1,53 +0,0 @@
|
|||||||
// Mithril
|
|
||||||
import Mithril from 'mithril';
|
|
||||||
|
|
||||||
// Other third-party libs
|
|
||||||
import * as _dayjs from 'dayjs';
|
|
||||||
import 'dayjs/plugin/relativeTime';
|
|
||||||
import * as _$ from 'jquery';
|
|
||||||
|
|
||||||
// Globals from flarum/core
|
|
||||||
import Application from '../../src/common/Application';
|
|
||||||
|
|
||||||
import type { TooltipJQueryFunction } from '../tooltips';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* flarum/core exposes several extensions globally:
|
|
||||||
*
|
|
||||||
* - jQuery for convenient DOM manipulation
|
|
||||||
* - Mithril for VDOM and components
|
|
||||||
* - dayjs for date/time operations
|
|
||||||
*
|
|
||||||
* Since these are already part of the global namespace, extensions won't need
|
|
||||||
* to (and should not) bundle these themselves.
|
|
||||||
*/
|
|
||||||
declare global {
|
|
||||||
// $ is already defined by `@types/jquery`
|
|
||||||
const m: Mithril.Static;
|
|
||||||
const dayjs: typeof _dayjs;
|
|
||||||
|
|
||||||
// Extend JQuery with our custom functions, defined with $.fn
|
|
||||||
interface JQuery {
|
|
||||||
tooltip: TooltipJQueryFunction;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* For more info, see: https://www.typescriptlang.org/docs/handbook/jsx.html#attribute-type-checking
|
|
||||||
*
|
|
||||||
* In a nutshell, we need to add `ElementAttributesProperty` to tell Typescript
|
|
||||||
* what property on component classes to look at for attribute typings. For our
|
|
||||||
* Component class, this would be `attrs` (e.g. `this.attrs...`)
|
|
||||||
*/
|
|
||||||
namespace JSX {
|
|
||||||
interface ElementAttributesProperty {
|
|
||||||
attrs: Record<string, unknown>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* All global variables owned by flarum/core.
|
|
||||||
*/
|
|
||||||
declare global {
|
|
||||||
const app: Application;
|
|
||||||
}
|
|
2
js/dist-typings/common/Component.d.ts
vendored
2
js/dist-typings/common/Component.d.ts
vendored
@@ -1,4 +1,4 @@
|
|||||||
import * as Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
export interface ComponentAttrs extends Mithril.Attributes {
|
export interface ComponentAttrs extends Mithril.Attributes {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
2
js/dist-typings/common/Fragment.d.ts
vendored
2
js/dist-typings/common/Fragment.d.ts
vendored
@@ -1,4 +1,4 @@
|
|||||||
import * as Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
/**
|
/**
|
||||||
* The `Fragment` class represents a chunk of DOM that is rendered once with Mithril and then takes
|
* The `Fragment` class represents a chunk of DOM that is rendered once with Mithril and then takes
|
||||||
* over control of its own DOM and lifecycle.
|
* over control of its own DOM and lifecycle.
|
||||||
|
6
js/dist-typings/common/app.d.ts
vendored
Normal file
6
js/dist-typings/common/app.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import type Application from './Application';
|
||||||
|
declare const _default: Application;
|
||||||
|
/**
|
||||||
|
* The instance of Application within the common namespace.
|
||||||
|
*/
|
||||||
|
export default _default;
|
2
js/dist-typings/common/components/Alert.d.ts
vendored
2
js/dist-typings/common/components/Alert.d.ts
vendored
@@ -1,5 +1,5 @@
|
|||||||
import Component, { ComponentAttrs } from '../Component';
|
import Component, { ComponentAttrs } from '../Component';
|
||||||
import Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
export interface AlertAttrs extends ComponentAttrs {
|
export interface AlertAttrs extends ComponentAttrs {
|
||||||
/** The type of alert this is. Will be used to give the alert a class name of `Alert--{type}`. */
|
/** The type of alert this is. Will be used to give the alert a class name of `Alert--{type}`. */
|
||||||
type?: string;
|
type?: string;
|
||||||
|
2
js/dist-typings/common/helpers/avatar.d.ts
vendored
2
js/dist-typings/common/helpers/avatar.d.ts
vendored
@@ -1,4 +1,4 @@
|
|||||||
import * as Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
import User from '../models/User';
|
import User from '../models/User';
|
||||||
/**
|
/**
|
||||||
* The `avatar` helper displays a user's avatar.
|
* The `avatar` helper displays a user's avatar.
|
||||||
|
2
js/dist-typings/common/helpers/fullTime.d.ts
vendored
2
js/dist-typings/common/helpers/fullTime.d.ts
vendored
@@ -1,4 +1,4 @@
|
|||||||
import * as Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
/**
|
/**
|
||||||
* The `fullTime` helper displays a formatted time string wrapped in a <time>
|
* The `fullTime` helper displays a formatted time string wrapped in a <time>
|
||||||
* tag.
|
* tag.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import * as Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
/**
|
/**
|
||||||
* The `highlight` helper searches for a word phrase in a string, and wraps
|
* The `highlight` helper searches for a word phrase in a string, and wraps
|
||||||
* matches with the <mark> tag.
|
* matches with the <mark> tag.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import * as Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
/**
|
/**
|
||||||
* The `humanTime` helper displays a time in a human-friendly time-ago format
|
* The `humanTime` helper displays a time in a human-friendly time-ago format
|
||||||
* (e.g. '12 days ago'), wrapped in a <time> tag with other information about
|
* (e.g. '12 days ago'), wrapped in a <time> tag with other information about
|
||||||
|
2
js/dist-typings/common/helpers/icon.d.ts
vendored
2
js/dist-typings/common/helpers/icon.d.ts
vendored
@@ -1,4 +1,4 @@
|
|||||||
import * as Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
/**
|
/**
|
||||||
* The `icon` helper displays an icon.
|
* The `icon` helper displays an icon.
|
||||||
*
|
*
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import * as Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
/**
|
/**
|
||||||
* The `listItems` helper wraps a collection of components in <li> tags,
|
* The `listItems` helper wraps a collection of components in <li> tags,
|
||||||
* stripping out any unnecessary `Separator` components.
|
* stripping out any unnecessary `Separator` components.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import * as Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
import User from '../models/User';
|
import User from '../models/User';
|
||||||
/**
|
/**
|
||||||
* The `useronline` helper displays a green circle if the user is online
|
* The `useronline` helper displays a green circle if the user is online
|
||||||
|
2
js/dist-typings/common/helpers/username.d.ts
vendored
2
js/dist-typings/common/helpers/username.d.ts
vendored
@@ -1,4 +1,4 @@
|
|||||||
import * as Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
import User from '../models/User';
|
import User from '../models/User';
|
||||||
/**
|
/**
|
||||||
* The `username` helper displays a user's username in a <span class="username">
|
* The `username` helper displays a user's username in a <span class="username">
|
||||||
|
3
js/dist-typings/common/index.d.ts
vendored
3
js/dist-typings/common/index.d.ts
vendored
@@ -1,2 +1,3 @@
|
|||||||
export { Extend };
|
|
||||||
import * as Extend from "./extend/index";
|
import * as Extend from "./extend/index";
|
||||||
|
import app from "./app";
|
||||||
|
export { Extend, app };
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
/**
|
/**
|
||||||
* Generates a route resolver for a given component.
|
* Generates a route resolver for a given component.
|
||||||
* In addition to regular route resolver functionality:
|
* In addition to regular route resolver functionality:
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
import Alert, { AlertAttrs } from '../components/Alert';
|
import Alert, { AlertAttrs } from '../components/Alert';
|
||||||
/**
|
/**
|
||||||
* Returned by `AlertManagerState.show`. Used to dismiss alerts.
|
* Returned by `AlertManagerState.show`. Used to dismiss alerts.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
/**
|
/**
|
||||||
* Mithril 2 does not completely rerender the page if a route change leads to the same route
|
* Mithril 2 does not completely rerender the page if a route change leads to the same route
|
||||||
* (or the same component handling a different route). This util calls m.route.set, forcing a reonit.
|
* (or the same component handling a different route). This util calls m.route.set, forcing a reonit.
|
||||||
|
@@ -24,7 +24,7 @@ export default class CommentPost extends Post {
|
|||||||
cardVisible: boolean | undefined;
|
cardVisible: boolean | undefined;
|
||||||
refreshContent(): void;
|
refreshContent(): void;
|
||||||
contentHtml: any;
|
contentHtml: any;
|
||||||
isEditing(): any;
|
isEditing(): boolean;
|
||||||
/**
|
/**
|
||||||
* Toggle the visibility of a hidden post's content.
|
* Toggle the visibility of a hidden post's content.
|
||||||
*/
|
*/
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { SearchSource } from './Search';
|
import { SearchSource } from './Search';
|
||||||
import Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
/**
|
/**
|
||||||
* The `DiscussionsSearchSource` finds and displays discussion search results in
|
* The `DiscussionsSearchSource` finds and displays discussion search results in
|
||||||
* the search dropdown.
|
* the search dropdown.
|
||||||
|
2
js/dist-typings/forum/components/Search.d.ts
vendored
2
js/dist-typings/forum/components/Search.d.ts
vendored
@@ -2,7 +2,7 @@ import Component, { ComponentAttrs } from '../../common/Component';
|
|||||||
import ItemList from '../../common/utils/ItemList';
|
import ItemList from '../../common/utils/ItemList';
|
||||||
import KeyboardNavigatable from '../utils/KeyboardNavigatable';
|
import KeyboardNavigatable from '../utils/KeyboardNavigatable';
|
||||||
import SearchState from '../states/SearchState';
|
import SearchState from '../states/SearchState';
|
||||||
import Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
/**
|
/**
|
||||||
* The `SearchSource` interface defines a section of search results in the
|
* The `SearchSource` interface defines a section of search results in the
|
||||||
* search dropdown.
|
* search dropdown.
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { SearchSource } from './Search';
|
import { SearchSource } from './Search';
|
||||||
import Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
/**
|
/**
|
||||||
* The `UsersSearchSource` finds and displays user search results in the search
|
* The `UsersSearchSource` finds and displays user search results in the search
|
||||||
* dropdown.
|
* dropdown.
|
||||||
|
6
js/dist/admin.js
generated
vendored
6
js/dist/admin.js
generated
vendored
File diff suppressed because one or more lines are too long
2
js/dist/admin.js.map
generated
vendored
2
js/dist/admin.js.map
generated
vendored
File diff suppressed because one or more lines are too long
8
js/dist/forum.js
generated
vendored
8
js/dist/forum.js
generated
vendored
File diff suppressed because one or more lines are too long
2
js/dist/forum.js.map
generated
vendored
2
js/dist/forum.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user