import { QueryParams } from "./Uri"; type NoReturn any> = T extends ( this: infer U, ...args: infer V ) => any ? unknown extends U ? (...args: V) => void : (this: U, ...args: V) => void : never; /** * @see https://doc.wikimedia.org/mediawiki-core/master/js/module-mediawiki.util.html#~ResizeableThumbnailUrl */ interface ResizeableThumbnailUrl { /** * File name (same format as {@link mw.Title.getMainText()}). */ name: string; /** * Thumbnail width, in pixels. Null when the file is not a thumbnail. */ width: number | null; /** * @param w Width, which must be smaller than the width of the original image (or equal to it; that * only works if `MediaHandler::mustRender` returns true for the file). Null when the * file in the original URL is not a thumbnail. * On wikis with `$wgGenerateThumbnailOnParse` set to true, this will fall back to using * `Special:Redirect` which is less efficient. Otherwise, it is a direct thumbnail URL. * @returns A thumbnail URL (URL-encoded) with that width. */ resizeUrl: ((w: number) => string) | null; } declare global { namespace mw { /** * Utility library provided by the `mediawiki.util` ResourceLoader module. Accessible * inside ResourceLoader modules or for gadgets as part of the {@link mw mw global object}. * * @example * ```js * // Inside MediaWiki extensions * const util = require( 'mediawiki.util' ); * // In gadgets * const mwUtil = mw.util; * ``` * @see https://doc.wikimedia.org/mediawiki-core/master/js/module-mediawiki.util.html */ namespace util { /** * The content wrapper of the skin (`.mw-body`, for example). * * Populated on document ready. To use this property, * wait for `$.ready` and be sure to have a module dependency on * `mediawiki.util` which will ensure * your document ready handler fires after initialization. * * Because of the lazy-initialised nature of this property, * you're discouraged from using it. * * If you need just the wikipage content (not any of the * extra elements output by the skin), use `$( '#mw-content-text' )` * instead. Or listen to {@link mw.hook mw.hook("wikipage.content")} which will * allow your code to re-run when the page changes (e.g. live preview * or re-render after ajax save). * * @see https://doc.wikimedia.org/mediawiki-core/master/js/module-mediawiki.util.html#.$content */ const $content: JQuery; /** * Append a new style block to the head and return the CSSStyleSheet object. * * To access the `