Documentation fixes

* Element -> HTMLElement
* JQuery -> jQuery
* Remove `return {void}`

Change-Id: I887dfe98af77358ad4ef4e1c835ccf45c2c64400
This commit is contained in:
Ed Sanders 2023-11-17 16:12:20 +00:00
parent 6d642c38bd
commit c0bf30fb58
20 changed files with 18 additions and 29 deletions

Binary file not shown.

View file

@ -36,7 +36,7 @@ function timedAction( baseAction ) {
*
* @param {Object} initiallyEnabled Allows to disable individual popup types while still showing the
* footer link
* @param {mw.user} user
* @param {mw.User} user
* @param {ext.popups.UserSettings} userSettings
* @param {mw.Map} config The config of the MediaWiki client-side application,
* i.e. `mw.config`

View file

@ -22,7 +22,6 @@
*
* @param {Redux.Store} store
* @param {ext.popups.ChangeListener} callback
* @return {void}
*/
export default function registerChangeListener( store, callback ) {
// This function is based on the example in [the documentation for

View file

@ -14,7 +14,7 @@ export default function linkTitle() {
* Destroys the title attribute of the element, storing its value in local
* state so that it can be restored later (see `restoreTitleAttr`).
*
* @param {Element|undefined} el
* @param {HTMLElement|undefined} el
*/
function destroyTitleAttr( el ) {
// Has the user dwelled on a link? If we've already removed its title attribute, then NOOP.
@ -27,7 +27,7 @@ export default function linkTitle() {
/**
* Restores the title attribute of the element.
*
* @param {Element|undefined} el
* @param {HTMLElement|undefined} el
*/
function restoreTitleAttr( el ) {
// Avoid overwriting a non-empty title with an empty one, just to be sure

View file

@ -57,7 +57,6 @@ function get( state, path ) {
* @param {string} path dot-separated path in the state tree
* @param {Function} sync function to be called with the newest value if
* changed
* @return {void}
*/
function syncIfChanged( oldState, newState, path, sync ) {
const current = get( newState, path );

View file

@ -25,7 +25,6 @@ export default function createContainer() {
* @name Container#set
* @param {string} name
* @param {*} factory
* @return {void}
*/
set( name, factory ) {
factories[ name ] = factory;

View file

@ -107,7 +107,6 @@ function getPageviewTracker( config ) {
* @param {PreviewBehavior} previewBehavior
* @param {EventTracker} statsvTracker
* @param {EventTracker} pageviewTracker
* @return {void}
*/
function registerChangeListeners(
store, registerActions, userSettings, settingsDialog, previewBehavior,

View file

@ -9,7 +9,7 @@
*
* [0]: https://wikitech.wikimedia.org/wiki/Graphite#statsv
*
* @param {mw.user} user The `mw.user` singleton instance
* @param {mw.User} user The `mw.user` singleton instance
* @param {mw.Map} config The `mw.config` singleton instance
* @param {Experiments} experiments
* @return {boolean}

View file

@ -13,7 +13,7 @@ const canSaveToUserPreferences = require( './canSaveToUserPreferences.js' );
* either be logged in and have enabled the preference or be logged out and have
* not disabled previews via the settings modal.
*
* @param {mw.user} user The `mw.user` singleton instance
* @param {mw.User} user The `mw.user` singleton instance
* @param {Object} userSettings An object returned by `userSettings.js`
* @param {mw.Map} config
*

View file

@ -7,7 +7,7 @@ const canSaveToUserPreferences = require( './canSaveToUserPreferences.js' );
* Given the global state of the application, creates a function that gets
* whether or not the user should have Reference Previews enabled.
*
* @param {mw.user} user The `mw.user` singleton instance
* @param {mw.User} user The `mw.user` singleton instance
* @param {Object} userSettings An object returned by `userSettings.js`
* @param {mw.Map} config
*

View file

@ -110,7 +110,7 @@ export function createNullModel( title, url ) {
}
/**
* @param {Element} element
* @param {HTMLElement} element
* @param {string} selector
* @return {boolean}
*/
@ -121,8 +121,8 @@ const elementMatchesSelector = ( element, selector ) => {
/**
* Recursively checks the element and its parents.
*
* @param {Element} element
* @return {Element|null}
* @param {HTMLElement} element
* @return {HTMLElement|null}
*/
export function findNearestEligibleTarget( element ) {
const selector = selectors.join( ', ' );

View file

@ -48,7 +48,6 @@ export { pointerSize, landscapePopupWidth, portraitPopupWidth }; // for use in s
*
* @private
* @param {Object} container DOM object to which pointer masks are appended
* @return {void}
*/
export function createPointerMasks( container ) {
const node = document.createElement( 'div' );
@ -60,7 +59,6 @@ export function createPointerMasks( container ) {
/**
* Initializes the renderer.
*
* @return {void}
*/
export function init() {
if ( !supportsCSSClipPath() ) {
@ -75,7 +73,7 @@ export function init() {
* TODO: Rename `isTall` to `isPortrait`.
*
* @typedef {Object} ext.popups.Preview
* @property {JQuery} el
* @property {jQuery} el
* @property {boolean} hasThumbnail
* @property {Object} thumbnail
* @property {boolean} isTall Sugar around
@ -312,7 +310,6 @@ export function show(
*
* @param {ext.popups.Preview} preview
* @param {ext.popups.PreviewBehavior} behavior
* @return {void}
*/
export function bindBehavior( preview, behavior ) {
preview.el.addEventListener( 'mouseenter', behavior.previewDwell );
@ -535,7 +532,6 @@ export function getClasses( preview, layout ) {
* @param {number} predefinedLandscapeImageHeight landscape image height
* @param {number} pointerSpaceSize
* @param {number} windowHeight
* @return {void}
*/
export function layoutPreview(
preview, layout, classes, predefinedLandscapeImageHeight, pointerSpaceSize, windowHeight
@ -588,7 +584,6 @@ export function layoutPreview(
*
* @param {ext.popups.Preview} preview
* @param {ext.popups.PreviewLayout} layout
* @return {void}
*/
export function setThumbnailClipPath(
{ el, isTall, thumbnail }, { flippedY, flippedX, dir }

View file

@ -24,7 +24,7 @@ const templateHTML = `
* @param {ext.popups.Thumbnail|null} thumbnail
* @param {boolean} withCSSClipPath
* @param {string} linkTitle
* @return {Element}
* @return {HTMLElement}
*/
export function renderPagePreview(
model, thumbnail, withCSSClipPath, linkTitle

View file

@ -9,8 +9,8 @@ const templateHTML = `
`;
/**
* @param {ext.popups.previewTypes} type
* @param {Element} element The contents of the popup.
* @return {Element}
* @param {HTMLElement} element The contents of the popup.
* @return {HTMLElement}
*/
export function renderPopup( type, container ) {

View file

@ -27,7 +27,7 @@ const templateHTML = `
* @param {ext.popups.PagePreviewModel} model
* @param {string|null} message
* @param {string} linkMsg
* @return {JQuery}
* @return {jQuery}
*/
export function renderPreview(
model, message, linkMsg

View file

@ -37,7 +37,7 @@ const replaceWith = ( node, htmlOrOtherNode ) => {
/**
* @param {ext.popups.ReferencePreviewModel} model
* @return {JQuery}
* @return {jQuery}
*/
export function renderReferencePreview(
model

View file

@ -44,7 +44,7 @@ function escapeChoices( choices = [] ) {
/**
* @param {SettingsModel} model
* @return {Element}
* @return {HTMLElement}
*/
export function renderSettingsDialog( model ) {
const heading = escapeHTML( model.heading ),

View file

@ -13,7 +13,7 @@ export function escapeHTML( str ) {
const templates = {};
/**
* @param {string} html markup of the template
* @return {Element} a cloned root element of the template
* @return {HTMLElement} a cloned root element of the template
*/
export function createNodeFromTemplate( html ) {
if ( !templates[ html ] ) {

View file

@ -17,7 +17,7 @@ export const SIZES = {
/**
* @typedef {Object} ext.popups.Thumbnail
* @property {JQuery} el
* @property {jQuery} el
* @property {boolean} isTall Whether or not the thumbnail is portrait
* @property {number} width
* @property {number} height

View file

@ -65,7 +65,6 @@ QUnit.test( '#boot', ( assert ) => {
* of the module.
*
* @param {Object} module
* @return {void}
*/
function setupWait( module ) {
module.waitPromise = $.Deferred().resolve().promise( { abort() {} } );
@ -79,7 +78,6 @@ function setupWait( module ) {
* creator.
*
* @param {Object} module
* @return {void}
*/
function setupEl( module ) {
module.title = TEST_TITLE;