mirror of
https://github.com/flarum/core.git
synced 2025-08-03 23:17:43 +02:00
Bump dependencies, add missing typing libraries (#2753)
* Bump dependencies and add missing typing libraries * Fix expose-loader breaking changes * Expose jQuery using its own typings instead of ours * Extend jQuery typings with our own custom $.fn helpers * Use jQuery typings for Component's `this.$` attribute * Format webpack config file * Use Spin.js 3.1.0
This commit is contained in:
14
framework/core/js/shims.d.ts
vendored
14
framework/core/js/shims.d.ts
vendored
@@ -19,9 +19,21 @@ import Application from './src/common/Application';
|
||||
* to (and should not) bundle these themselves.
|
||||
*/
|
||||
declare global {
|
||||
const $: typeof _$;
|
||||
// $ 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 {
|
||||
/**
|
||||
* Creates a tooltip on a jQuery element reference.
|
||||
*
|
||||
* Optionally accepts placement and delay options.
|
||||
*
|
||||
* Returns the same reference to allow for method chaining.
|
||||
*/
|
||||
tooltip: (tooltipOptions?: { placement?: 'top' | 'bottom' | 'left' | 'right'; delay?: number }) => JQuery;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user