mirror of
https://github.com/flarum/framework.git
synced 2025-02-01 17:27:49 +08:00
Bundled output for commit 5097620b6e
Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci]
This commit is contained in:
parent
5097620b6e
commit
1b2a6c7e99
82
framework/core/js/dist-typings/@types/global.d.ts
vendored
Normal file
82
framework/core/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>;
|
||||
};
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
import * as Mithril from 'mithril';
|
||||
import type Mithril from 'mithril';
|
||||
export interface ComponentAttrs extends Mithril.Attributes {
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
* over control of its own DOM and lifecycle.
|
||||
|
|
6
framework/core/js/dist-typings/common/app.d.ts
vendored
Normal file
6
framework/core/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;
|
|
@ -1,5 +1,5 @@
|
|||
import Component, { ComponentAttrs } from '../Component';
|
||||
import Mithril from 'mithril';
|
||||
import type Mithril from 'mithril';
|
||||
export interface AlertAttrs extends ComponentAttrs {
|
||||
/** The type of alert this is. Will be used to give the alert a class name of `Alert--{type}`. */
|
||||
type?: string;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as Mithril from 'mithril';
|
||||
import type Mithril from 'mithril';
|
||||
import User from '../models/User';
|
||||
/**
|
||||
* The `avatar` helper displays a user's avatar.
|
||||
|
|
|
@ -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>
|
||||
* 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
|
||||
* 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
|
||||
* (e.g. '12 days ago'), wrapped in a <time> tag with other information about
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as Mithril from 'mithril';
|
||||
import type Mithril from 'mithril';
|
||||
/**
|
||||
* 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,
|
||||
* 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';
|
||||
/**
|
||||
* The `useronline` helper displays a green circle if the user is online
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as Mithril from 'mithril';
|
||||
import type Mithril from 'mithril';
|
||||
import User from '../models/User';
|
||||
/**
|
||||
* The `username` helper displays a user's username in a <span class="username">
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
export { Extend };
|
||||
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.
|
||||
* 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';
|
||||
/**
|
||||
* 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
|
||||
* (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;
|
||||
refreshContent(): void;
|
||||
contentHtml: any;
|
||||
isEditing(): any;
|
||||
isEditing(): boolean;
|
||||
/**
|
||||
* Toggle the visibility of a hidden post's content.
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { SearchSource } from './Search';
|
||||
import Mithril from 'mithril';
|
||||
import type Mithril from 'mithril';
|
||||
/**
|
||||
* The `DiscussionsSearchSource` finds and displays discussion search results in
|
||||
* the search dropdown.
|
||||
|
|
|
@ -2,7 +2,7 @@ import Component, { ComponentAttrs } from '../../common/Component';
|
|||
import ItemList from '../../common/utils/ItemList';
|
||||
import KeyboardNavigatable from '../utils/KeyboardNavigatable';
|
||||
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
|
||||
* search dropdown.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { SearchSource } from './Search';
|
||||
import Mithril from 'mithril';
|
||||
import type Mithril from 'mithril';
|
||||
/**
|
||||
* The `UsersSearchSource` finds and displays user search results in the search
|
||||
* dropdown.
|
||||
|
|
6
framework/core/js/dist/admin.js
generated
vendored
6
framework/core/js/dist/admin.js
generated
vendored
File diff suppressed because one or more lines are too long
2
framework/core/js/dist/admin.js.map
generated
vendored
2
framework/core/js/dist/admin.js.map
generated
vendored
File diff suppressed because one or more lines are too long
8
framework/core/js/dist/forum.js
generated
vendored
8
framework/core/js/dist/forum.js
generated
vendored
File diff suppressed because one or more lines are too long
2
framework/core/js/dist/forum.js.map
generated
vendored
2
framework/core/js/dist/forum.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user