Consistently use number for numeric data types in JSDoc comments

Sometimes we also used `Number` and `integer`, but `number` is what
the JSDoc documentation recommends.
This commit is contained in:
Tim van der Meij 2019-10-12 15:54:17 +02:00
parent ff37cdb5d7
commit e75991b49e
No known key found for this signature in database
GPG Key ID: 8C3FD2925A5F2762
5 changed files with 16 additions and 16 deletions

View File

@ -530,7 +530,7 @@ class AnnotationBorderStyle {
* *
* @public * @public
* @memberof AnnotationBorderStyle * @memberof AnnotationBorderStyle
* @param {integer} width - The width. * @param {number} width - The width.
* @param {Array} rect - The annotation `Rect` entry. * @param {Array} rect - The annotation `Rect` entry.
*/ */
setWidth(width, rect = [0, 0, 0, 0]) { setWidth(width, rect = [0, 0, 0, 0]) {
@ -642,7 +642,7 @@ class AnnotationBorderStyle {
* *
* @public * @public
* @memberof AnnotationBorderStyle * @memberof AnnotationBorderStyle
* @param {integer} radius - The horizontal corner radius * @param {number} radius - The horizontal corner radius.
*/ */
setHorizontalCornerRadius(radius) { setHorizontalCornerRadius(radius) {
if (Number.isInteger(radius)) { if (Number.isInteger(radius)) {
@ -655,7 +655,7 @@ class AnnotationBorderStyle {
* *
* @public * @public
* @memberof AnnotationBorderStyle * @memberof AnnotationBorderStyle
* @param {integer} radius - The vertical corner radius * @param {number} radius - The vertical corner radius.
*/ */
setVerticalCornerRadius(radius) { setVerticalCornerRadius(radius) {
if (Number.isInteger(radius)) { if (Number.isInteger(radius)) {

View File

@ -22,11 +22,11 @@ import { isDict, isName, isStream } from './primitives';
* Resizes an RGB image with 3 components. * Resizes an RGB image with 3 components.
* @param {TypedArray} src - The source buffer. * @param {TypedArray} src - The source buffer.
* @param {TypedArray} dest - The destination buffer. * @param {TypedArray} dest - The destination buffer.
* @param {Number} w1 - Original width. * @param {number} w1 - Original width.
* @param {Number} h1 - Original height. * @param {number} h1 - Original height.
* @param {Number} w2 - New width. * @param {number} w2 - New width.
* @param {Number} h2 - New height. * @param {number} h2 - New height.
* @param {Number} alpha01 - Size reserved for the alpha channel. * @param {number} alpha01 - Size reserved for the alpha channel.
*/ */
function resizeRgbImage(src, dest, w1, h1, w2, h2, alpha01) { function resizeRgbImage(src, dest, w1, h1, w2, h2, alpha01) {
const COMPONENTS = 3; const COMPONENTS = 3;
@ -390,7 +390,7 @@ class ColorSpace {
* This does not handle Lab, Indexed, or Pattern decode maps since they are * This does not handle Lab, Indexed, or Pattern decode maps since they are
* slightly different. * slightly different.
* @param {Array} decode - Decode map (usually from an image). * @param {Array} decode - Decode map (usually from an image).
* @param {Number} numComps - Number of components the color space has. * @param {number} numComps - Number of components the color space has.
*/ */
static isDefaultDecode(decode, numComps) { static isDefaultDecode(decode, numComps) {
if (!Array.isArray(decode)) { if (!Array.isArray(decode)) {

View File

@ -95,7 +95,7 @@ const ROMAN_NUMBER_MAP = [
/** /**
* Converts positive integers to (upper case) Roman numerals. * Converts positive integers to (upper case) Roman numerals.
* @param {integer} number - The number that should be converted. * @param {number} number - The number that should be converted.
* @param {boolean} lowerCase - Indicates if the result should be converted * @param {boolean} lowerCase - Indicates if the result should be converted
* to lower case letters. The default value is `false`. * to lower case letters. The default value is `false`.
* @return {string} The resulting Roman number. * @return {string} The resulting Roman number.

View File

@ -49,11 +49,11 @@ var PDFImage = (function PDFImageClosure() {
/** /**
* Resizes an image mask with 1 component. * Resizes an image mask with 1 component.
* @param {TypedArray} src - The source buffer. * @param {TypedArray} src - The source buffer.
* @param {Number} bpc - Number of bits per component. * @param {number} bpc - Number of bits per component.
* @param {Number} w1 - Original width. * @param {number} w1 - Original width.
* @param {Number} h1 - Original height. * @param {number} h1 - Original height.
* @param {Number} w2 - New width. * @param {number} w2 - New width.
* @param {Number} h2 - New height. * @param {number} h2 - New height.
* @returns {TypedArray} The resized image mask buffer. * @returns {TypedArray} The resized image mask buffer.
*/ */
function resizeImageMask(src, bpc, w1, h1, w2, h2) { function resizeImageMask(src, bpc, w1, h1, w2, h2) {

View File

@ -215,7 +215,7 @@ function parseQueryString(query) {
* that if the condition is true for one item in the array, then it is also true * that if the condition is true for one item in the array, then it is also true
* for all following items. * for all following items.
* *
* @returns {Number} Index of the first array element to pass the test, * @returns {number} Index of the first array element to pass the test,
* or |items.length| if no such element exists. * or |items.length| if no such element exists.
*/ */
function binarySearchFirstItem(items, condition) { function binarySearchFirstItem(items, condition) {