mirror of
https://github.com/flarum/framework.git
synced 2024-11-23 02:13:37 +08:00
27d562f3fc
From using PhpStorm to try and see if the autocomplete works properly, it appears as it doesn't. The intention was to not have to import Mithril every time we wanted to type something with Mithril.*, but that doesn't seem to be possible - and it's not a big deal anyway
33 lines
722 B
TypeScript
33 lines
722 B
TypeScript
// 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';
|
|
|
|
/**
|
|
* 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 {
|
|
const $: typeof _$;
|
|
const m: Mithril.Static;
|
|
const dayjs: typeof _dayjs;
|
|
}
|
|
|
|
/**
|
|
* All global variables owned by flarum/core.
|
|
*/
|
|
declare global {
|
|
const app: Application;
|
|
}
|