mirror of
https://github.com/flarum/core.git
synced 2025-07-24 10:11:43 +02:00
Update core to use new Webpack config, flarum-tsconfig
, and build action (#2856)
* Update core to use new Webpack and TSConfig * Bump webpack dep * Update JS build action * Copy custom `.d.ts` files to `dist-typings` folder on typings compile * Run workflow against action v2 This allows us to have a moving tag, like first party actions have. * Remove bundle analyzer from core * Use webpack config 0.1.0-beta.16.2 * Add note about checking flarum-tsconfig
This commit is contained in:
39
js/@types/global/index.d.ts
vendored
Normal file
39
js/@types/global/index.d.ts
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
// Mithril
|
||||
import Mithril from 'mithril';
|
||||
|
||||
// Other third-party libs
|
||||
import * as _dayjs from 'dayjs';
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* All global variables owned by flarum/core.
|
||||
*/
|
||||
declare global {
|
||||
const app: Application;
|
||||
}
|
Reference in New Issue
Block a user