Skip to content

Commit

Permalink
Deprecate global app typings
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Jul 30, 2021
1 parent ebf5da2 commit e0d53bc
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion js/src/@types/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
/**
* @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';
* ```
*/
declare const app: any;

declare const m: import('mithril').Static;
declare const app: import('../common/Application').default;
declare const dayjs: typeof import('dayjs');

// 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 may be removed in a future version of Flarum.
*/
tooltip: import('./tooltips/index').TooltipJQueryFunction;
}

Expand Down

0 comments on commit e0d53bc

Please sign in to comment.