mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Consistently use @returns
for returned data types in JSDoc comments
Sometimes we also used `@return`, but `@returns` is what the JSDoc documentation recommends. Even though `@return` works as an alias, it's good to use the recommended syntax and to be consistent within the project.
This commit is contained in:
parent
8b4ae6f3eb
commit
ca3a58f93a
16 changed files with 77 additions and 77 deletions
|
@ -209,7 +209,7 @@ class BaseViewer {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return {boolean} Whether the pageNumber is valid (within bounds).
|
||||
* @returns {boolean} Whether the pageNumber is valid (within bounds).
|
||||
* @private
|
||||
*/
|
||||
_setCurrentPageNumber(val, resetCurrentPageView = false) {
|
||||
|
|
|
@ -34,7 +34,7 @@ let FirefoxCom = (function FirefoxComClosure() {
|
|||
* be able to synchronously reply.
|
||||
* @param {string} action - The action to trigger.
|
||||
* @param {string} [data] - The data to send.
|
||||
* @return {*} The response.
|
||||
* @returns {*} The response.
|
||||
*/
|
||||
requestSync(action, data) {
|
||||
let request = document.createTextNode('');
|
||||
|
|
|
@ -93,7 +93,7 @@ GrabToPan.prototype = {
|
|||
* Override this method to change the default behaviour.
|
||||
*
|
||||
* @param node {Element} The target of the event
|
||||
* @return {boolean} Whether to not react to the click event.
|
||||
* @returns {boolean} Whether to not react to the click event.
|
||||
*/
|
||||
ignoreTarget: function GrabToPan_ignoreTarget(node) {
|
||||
// Use matchesSelector to check whether the clicked element
|
||||
|
@ -205,8 +205,8 @@ var isSafari6plus = /Apple/.test(navigator.vendor) &&
|
|||
/**
|
||||
* Whether the left mouse is not pressed.
|
||||
* @param event {MouseEvent}
|
||||
* @return {boolean} True if the left mouse button is not pressed.
|
||||
* False if unsure or if the left mouse button is pressed.
|
||||
* @returns {boolean} True if the left mouse button is not pressed,
|
||||
* False if unsure or if the left mouse button is pressed.
|
||||
*/
|
||||
function isLeftMouseReleased(event) {
|
||||
if ('buttons' in event && isNotIEorIsIE10plus) {
|
||||
|
|
|
@ -83,8 +83,8 @@ class BasePreferences {
|
|||
/**
|
||||
* Stub function for writing preferences to storage.
|
||||
* @param {Object} prefObj The preferences that should be written to storage.
|
||||
* @return {Promise} A promise that is resolved when the preference values
|
||||
* have been written.
|
||||
* @returns {Promise} A promise that is resolved when the preference values
|
||||
* have been written.
|
||||
*/
|
||||
async _writeToStorage(prefObj) {
|
||||
throw new Error('Not implemented: _writeToStorage');
|
||||
|
@ -93,8 +93,8 @@ class BasePreferences {
|
|||
/**
|
||||
* Stub function for reading preferences from storage.
|
||||
* @param {Object} prefObj The preferences that should be read from storage.
|
||||
* @return {Promise} A promise that is resolved with an {Object} containing
|
||||
* the preferences that have been read.
|
||||
* @returns {Promise} A promise that is resolved with an {Object} containing
|
||||
* the preferences that have been read.
|
||||
*/
|
||||
async _readFromStorage(prefObj) {
|
||||
throw new Error('Not implemented: _readFromStorage');
|
||||
|
@ -102,8 +102,8 @@ class BasePreferences {
|
|||
|
||||
/**
|
||||
* Reset the preferences to their default values and update storage.
|
||||
* @return {Promise} A promise that is resolved when the preference values
|
||||
* have been reset.
|
||||
* @returns {Promise} A promise that is resolved when the preference values
|
||||
* have been reset.
|
||||
*/
|
||||
async reset() {
|
||||
await this._initializedPromise;
|
||||
|
@ -115,8 +115,8 @@ class BasePreferences {
|
|||
* Set the value of a preference.
|
||||
* @param {string} name The name of the preference that should be changed.
|
||||
* @param {boolean|number|string} value The new value of the preference.
|
||||
* @return {Promise} A promise that is resolved when the value has been set,
|
||||
* provided that the preference exists and the types match.
|
||||
* @returns {Promise} A promise that is resolved when the value has been set,
|
||||
* provided that the preference exists and the types match.
|
||||
*/
|
||||
async set(name, value) {
|
||||
await this._initializedPromise;
|
||||
|
@ -149,8 +149,8 @@ class BasePreferences {
|
|||
/**
|
||||
* Get the value of a preference.
|
||||
* @param {string} name The name of the preference whose value is requested.
|
||||
* @return {Promise} A promise that is resolved with a {boolean|number|string}
|
||||
* containing the value of the preference.
|
||||
* @returns {Promise} A promise resolved with a {boolean|number|string}
|
||||
* containing the value of the preference.
|
||||
*/
|
||||
async get(name) {
|
||||
await this._initializedPromise;
|
||||
|
@ -170,8 +170,8 @@ class BasePreferences {
|
|||
|
||||
/**
|
||||
* Get the values of all preferences.
|
||||
* @return {Promise} A promise that is resolved with an {Object} containing
|
||||
* the values of all preferences.
|
||||
* @returns {Promise} A promise that is resolved with an {Object} containing
|
||||
* the values of all preferences.
|
||||
*/
|
||||
async getAll() {
|
||||
await this._initializedPromise;
|
||||
|
|
|
@ -87,9 +87,9 @@ let NullL10n = {
|
|||
|
||||
/**
|
||||
* Returns scale factor for the canvas. It makes sense for the HiDPI displays.
|
||||
* @return {Object} The object with horizontal (sx) and vertical (sy)
|
||||
scales. The scaled property is set to false if scaling is
|
||||
not required, true otherwise.
|
||||
* @returns {Object} The object with horizontal (sx) and vertical (sy)
|
||||
* scales. The scaled property is set to false if scaling is
|
||||
* not required, true otherwise.
|
||||
*/
|
||||
function getOutputScale(ctx) {
|
||||
let devicePixelRatio = window.devicePixelRatio || 1;
|
||||
|
@ -296,7 +296,7 @@ function roundToDivide(x, div) {
|
|||
* Gets the size of the specified page, converted from PDF units to inches.
|
||||
* @param {Object} An Object containing the properties: {Array} `view`,
|
||||
* {number} `userUnit`, and {number} `rotate`.
|
||||
* @return {Object} An Object containing the properties: {number} `width`
|
||||
* @returns {Object} An Object containing the properties: {number} `width`
|
||||
* and {number} `height`, given in inches.
|
||||
*/
|
||||
function getPageSizeInches({ view, userUnit, rotate, }) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue