mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Consistently use @type
for getter data types in JSDoc comments
Sometimes we also used `@return` or `@returns`, but `@type` is what the JSDoc documentation recommends. This also improves the documentation because before this commit the types were not shown and now they are.
This commit is contained in:
parent
f4daafc077
commit
8b4ae6f3eb
13 changed files with 56 additions and 56 deletions
|
@ -178,14 +178,14 @@ class BaseViewer {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean} true if all {PDFPageView} objects are initialized.
|
||||
* @type {boolean} - True if all {PDFPageView} objects are initialized.
|
||||
*/
|
||||
get pageViewsReady() {
|
||||
return this._pageViewsReady;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
* @type {number}
|
||||
*/
|
||||
get currentPageNumber() {
|
||||
return this._currentPageNumber;
|
||||
|
@ -238,8 +238,8 @@ class BaseViewer {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns {string|null} Returns the current page label,
|
||||
* or `null` if no page labels exist.
|
||||
* @type {string|null} Returns the current page label, or `null` if no page
|
||||
* labels exist.
|
||||
*/
|
||||
get currentPageLabel() {
|
||||
return this._pageLabels && this._pageLabels[this._currentPageNumber - 1];
|
||||
|
@ -267,7 +267,7 @@ class BaseViewer {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
* @type {number}
|
||||
*/
|
||||
get currentScale() {
|
||||
return this._currentScale !== UNKNOWN_SCALE ? this._currentScale :
|
||||
|
@ -288,7 +288,7 @@ class BaseViewer {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
* @type {string}
|
||||
*/
|
||||
get currentScaleValue() {
|
||||
return this._currentScaleValue;
|
||||
|
@ -305,7 +305,7 @@ class BaseViewer {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
* @type {number}
|
||||
*/
|
||||
get pagesRotation() {
|
||||
return this._pagesRotation;
|
||||
|
@ -1029,8 +1029,8 @@ class BaseViewer {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean} Whether all pages of the PDF document have identical
|
||||
* widths and heights.
|
||||
* @type {boolean} Whether all pages of the PDF document have identical
|
||||
* widths and heights.
|
||||
*/
|
||||
get hasEqualPageSizes() {
|
||||
let firstPageView = this._pages[0];
|
||||
|
@ -1074,7 +1074,7 @@ class BaseViewer {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return {number} One of the values in {ScrollMode}.
|
||||
* @type {number} One of the values in {ScrollMode}.
|
||||
*/
|
||||
get scrollMode() {
|
||||
return this._scrollMode;
|
||||
|
@ -1120,7 +1120,7 @@ class BaseViewer {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return {number} One of the values in {SpreadMode}.
|
||||
* @type {number} One of the values in {SpreadMode}.
|
||||
*/
|
||||
get spreadMode() {
|
||||
return this._spreadMode;
|
||||
|
|
|
@ -18,12 +18,12 @@
|
|||
*/
|
||||
class IPDFLinkService {
|
||||
/**
|
||||
* @returns {number}
|
||||
* @type {number}
|
||||
*/
|
||||
get pagesCount() {}
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
* @type {number}
|
||||
*/
|
||||
get page() {}
|
||||
|
||||
|
@ -33,7 +33,7 @@ class IPDFLinkService {
|
|||
set page(value) {}
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
* @type {number}
|
||||
*/
|
||||
get rotation() {}
|
||||
|
||||
|
@ -43,7 +43,7 @@ class IPDFLinkService {
|
|||
set rotation(value) {}
|
||||
|
||||
/**
|
||||
* @returns {boolean}
|
||||
* @type {boolean}
|
||||
*/
|
||||
get externalLinkEnabled() {}
|
||||
|
||||
|
@ -117,12 +117,12 @@ class IPDFHistory {
|
|||
*/
|
||||
class IRenderableView {
|
||||
/**
|
||||
* @returns {string} - Unique ID for rendering queue.
|
||||
* @type {string} - Unique ID for rendering queue.
|
||||
*/
|
||||
get renderingId() {}
|
||||
|
||||
/**
|
||||
* @returns {RenderingStates}
|
||||
* @type {RenderingStates}
|
||||
*/
|
||||
get renderingState() {}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ class PDFCursorTools {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns {number} One of the values in {CursorTool}.
|
||||
* @type {number} One of the values in {CursorTool}.
|
||||
*/
|
||||
get activeTool() {
|
||||
return this.active;
|
||||
|
|
|
@ -223,7 +223,7 @@ class PDFFindController {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return {string} The (current) normalized search query.
|
||||
* @type {string} The (current) normalized search query.
|
||||
*/
|
||||
get _query() {
|
||||
if (this._state.query !== this._rawQuery) {
|
||||
|
|
|
@ -272,7 +272,7 @@ class PDFHistory {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean} Indicating if the user is currently moving through the
|
||||
* @type {boolean} Indicating if the user is currently moving through the
|
||||
* browser history, useful e.g. for skipping the next 'hashchange' event.
|
||||
*/
|
||||
get popStateInProgress() {
|
||||
|
|
|
@ -64,14 +64,14 @@ class PDFLinkService {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
* @type {number}
|
||||
*/
|
||||
get pagesCount() {
|
||||
return this.pdfDocument ? this.pdfDocument.numPages : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
* @type {number}
|
||||
*/
|
||||
get page() {
|
||||
return this.pdfViewer.currentPageNumber;
|
||||
|
@ -85,7 +85,7 @@ class PDFLinkService {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
* @type {number}
|
||||
*/
|
||||
get rotation() {
|
||||
return this.pdfViewer.pagesRotation;
|
||||
|
@ -428,14 +428,14 @@ class SimpleLinkService {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
* @type {number}
|
||||
*/
|
||||
get pagesCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
* @type {number}
|
||||
*/
|
||||
get page() {
|
||||
return 0;
|
||||
|
@ -447,7 +447,7 @@ class SimpleLinkService {
|
|||
set page(value) {}
|
||||
|
||||
/**
|
||||
* @returns {number}
|
||||
* @type {number}
|
||||
*/
|
||||
get rotation() {
|
||||
return 0;
|
||||
|
|
|
@ -109,7 +109,7 @@ class PDFSidebar {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns {number} One of the values in {SidebarView}.
|
||||
* @type {number} One of the values in {SidebarView}.
|
||||
*/
|
||||
get visibleView() {
|
||||
return (this.isOpen ? this.active : SidebarView.NONE);
|
||||
|
|
|
@ -65,7 +65,7 @@ class PDFSidebarResizer {
|
|||
}
|
||||
|
||||
/**
|
||||
* returns {number}
|
||||
* @type {number}
|
||||
*/
|
||||
get outerContainerWidth() {
|
||||
if (!this._outerContainerWidth) {
|
||||
|
|
|
@ -132,7 +132,7 @@ class SecondaryToolbar {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return {boolean}
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isOpen() {
|
||||
return this.opened;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue