js: Add JSDoc to exported functions and fix incorrect JSDoc formatting

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1499>
This commit is contained in:
Evan Welsh
2023-07-30 15:56:59 +03:00
committed by Florian Müllner
parent 4642a8541d
commit 64aa871a8a
56 changed files with 623 additions and 280 deletions

View File

@ -7,18 +7,22 @@ const St = imports.gi.St;
const Main = imports.ui.main;
const Params = imports.misc.params;
// GrabHelper:
// @owner: the actor that owns the GrabHelper
// @params: optional parameters to pass to Main.pushModal()
//
// Creates a new GrabHelper object, for dealing with keyboard and pointer grabs
// associated with a set of actors.
//
// Note that the grab can be automatically dropped at any time by the user, and
// your code just needs to deal with it; you shouldn't adjust behavior directly
// after you call ungrab(), but instead pass an 'onUngrab' callback when you
// call grab().
var GrabHelper = class GrabHelper {
/**
* GrabHelper:
*
* Creates a new GrabHelper object, for dealing with keyboard and pointer grabs
* associated with a set of actors.
*
* Note that the grab can be automatically dropped at any time by the user, and
* your code just needs to deal with it; you shouldn't adjust behavior directly
* after you call ungrab(), but instead pass an 'onUngrab' callback when you
* call grab().
*/
class GrabHelper {
/**
* @param {Clutter.Actor} owner the actor that owns the GrabHelper
* @param {*} params optional parameters to pass to Main.pushModal()
*/
constructor(owner, params) {
if (!(owner instanceof Clutter.Actor))
throw new Error('GrabHelper owner must be a Clutter.Actor');