diff --git a/src/core/ccitt.js b/src/core/ccitt.js index 2f9bb4fe0..3f81e339a 100644 --- a/src/core/ccitt.js +++ b/src/core/ccitt.js @@ -458,7 +458,7 @@ let CCITTFaxDecoder = (function CCITTFaxDecoder() { /** * @param {CCITTFaxDecoderSource} source - The data which should be decoded. - * @param {Object} options - (optional) Decoding options. + * @param {Object} [options] - Decoding options. */ function CCITTFaxDecoder(source, options = {}) { if (!source || typeof source.next !== 'function') { diff --git a/src/core/obj.js b/src/core/obj.js index 9b74c7b1b..e854e1e1f 100644 --- a/src/core/obj.js +++ b/src/core/obj.js @@ -863,8 +863,8 @@ class Catalog { * @property {Dict} destDict - The dictionary containing the destination. * @property {Object} resultObj - The object where the parsed destination * properties will be placed. - * @property {string} docBaseUrl - (optional) The document base URL that is - * used when attempting to recover valid absolute URLs from relative ones. + * @property {string} [docBaseUrl] - The document base URL that is used when + * attempting to recover valid absolute URLs from relative ones. */ /** diff --git a/src/display/annotation_layer.js b/src/display/annotation_layer.js index fdf06a62e..9bd3c08ee 100644 --- a/src/display/annotation_layer.js +++ b/src/display/annotation_layer.js @@ -31,8 +31,8 @@ import { * @property {PageViewport} viewport * @property {IPDFLinkService} linkService * @property {DownloadManager} downloadManager - * @property {string} imageResourcesPath - (optional) Path for image resources, - * mainly for annotation icons. Include trailing slash. + * @property {string} [imageResourcesPath] - Path for image resources, mainly + * for annotation icons. Include trailing slash. * @property {boolean} renderInteractiveForms * @property {Object} svgFactory */ @@ -1328,8 +1328,8 @@ class FileAttachmentAnnotationElement extends AnnotationElement { * @property {PDFPage} page * @property {IPDFLinkService} linkService * @property {DownloadManager} downloadManager - * @property {string} imageResourcesPath - (optional) Path for image resources, - * mainly for annotation icons. Include trailing slash. + * @property {string} [imageResourcesPath] - Path for image resources, mainly + * for annotation icons. Include trailing slash. * @property {boolean} renderInteractiveForms */ diff --git a/src/display/display_utils.js b/src/display/display_utils.js index e2c47b3cf..aa671c802 100644 --- a/src/display/display_utils.js +++ b/src/display/display_utils.js @@ -160,22 +160,22 @@ class DOMSVGFactory { * @property {Array} viewBox - The xMin, yMin, xMax and yMax coordinates. * @property {number} scale - The scale of the viewport. * @property {number} rotation - The rotation, in degrees, of the viewport. - * @property {number} offsetX - (optional) The horizontal, i.e. x-axis, offset. - * The default value is `0`. - * @property {number} offsetY - (optional) The vertical, i.e. y-axis, offset. - * The default value is `0`. - * @property {boolean} dontFlip - (optional) If true, the y-axis will not be - * flipped. The default value is `false`. + * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset. The + * default value is `0`. + * @property {number} [offsetY] - The vertical, i.e. y-axis, offset. The + * default value is `0`. + * @property {boolean} [dontFlip] - If true, the y-axis will not be flipped. + * The default value is `false`. */ /** * @typedef {Object} PageViewportCloneParameters - * @property {number} scale - (optional) The scale, overriding the one in the - * cloned viewport. The default value is `this.scale`. - * @property {number} rotation - (optional) The rotation, in degrees, overriding - * the one in the cloned viewport. The default value is `this.rotation`. - * @property {boolean} dontFlip - (optional) If true, the x-axis will not be - * flipped. The default value is `false`. + * @property {number} [scale] - The scale, overriding the one in the cloned + * viewport. The default value is `this.scale`. + * @property {number} [rotation] - The rotation, in degrees, overriding the one + * in the cloned viewport. The default value is `this.rotation`. + * @property {boolean} [dontFlip] - If true, the x-axis will not be flipped. + * The default value is `false`. */ /** @@ -251,7 +251,7 @@ class PageViewport { /** * Clones viewport, with optional additional properties. - * @param {PageViewportCloneParameters} - (optional) + * @param {PageViewportCloneParameters} [params] * @return {PageViewport} Cloned viewport. */ clone({ scale = this.scale, rotation = this.rotation, @@ -334,12 +334,12 @@ const LinkTargetStringMap = [ * @typedef ExternalLinkParameters * @typedef {Object} ExternalLinkParameters * @property {string} url - An absolute URL. - * @property {LinkTarget} target - (optional) The link target. - * The default value is `LinkTarget.NONE`. - * @property {string} rel - (optional) The link relationship. - * The default value is `DEFAULT_LINK_REL`. - * @property {boolean} enabled - (optional) Whether the link should be enabled. - * The default value is true. + * @property {LinkTarget} [target] - The link target. The default value is + * `LinkTarget.NONE`. + * @property {string} [rel] - The link relationship. The default value is + * `DEFAULT_LINK_REL`. + * @property {boolean} [enabled] - Whether the link should be enabled. The + * default value is true. */ /** diff --git a/src/display/text_layer.js b/src/display/text_layer.js index 1bd06bfd5..d900d2d32 100644 --- a/src/display/text_layer.js +++ b/src/display/text_layer.js @@ -20,24 +20,23 @@ import globalScope from '../shared/global_scope'; * Text layer render parameters. * * @typedef {Object} TextLayerRenderParameters - * @property {TextContent} textContent - (optional) Text content to render - * (the object is returned by the page's getTextContent() method). - * @property {ReadableStream} textContentStream - (optional) Text content - * stream to render (the stream is returned by the page's - * streamTextContent() method). + * @property {TextContent} [textContent] - Text content to render (the object + * is returned by the page's `getTextContent` method). + * @property {ReadableStream} [textContentStream] - Text content stream to + * render (the stream is returned by the page's `streamTextContent` method). * @property {HTMLElement} container - HTML element that will contain text runs. * @property {PageViewport} viewport - The target viewport to properly * layout the text runs. - * @property {Array} textDivs - (optional) HTML elements that are correspond - * the text items of the textContent input. This is output and shall be + * @property {Array} [textDivs] - HTML elements that are correspond to the + * text items of the textContent input. This is output and shall be * initially be set to empty array. - * @property {Array} textContentItemsStr - (optional) Strings that correspond - * the `str` property of the text items of textContent input. This is output + * @property {Array} [textContentItemsStr] - Strings that correspond to the + * `str` property of the text items of textContent input. This is output * and shall be initially be set to empty array. - * @property {number} timeout - (optional) Delay in milliseconds before - * rendering of the text runs occurs. - * @property {boolean} enhanceTextSelection - (optional) Whether to turn on the - * text selection enhancement. + * @property {number} [timeout] - Delay in milliseconds before rendering of the + * text runs occurs. + * @property {boolean} [enhanceTextSelection] - Whether to turn on the text + * selection enhancement. */ var renderTextLayer = (function renderTextLayerClosure() { var MAX_TEXT_DIVS_TO_RENDER = 100000; diff --git a/src/shared/message_handler.js b/src/shared/message_handler.js index 869a4a92f..bed45e28a 100644 --- a/src/shared/message_handler.js +++ b/src/shared/message_handler.js @@ -134,7 +134,7 @@ MessageHandler.prototype = { * Sends a message to the comObj to invoke the action with the supplied data. * @param {string} actionName - Action to call. * @param {JSON} data - JSON data to send. - * @param {Array} [transfers] - Optional list of transfers/ArrayBuffers + * @param {Array} [transfers] - List of transfers/ArrayBuffers. */ send(actionName, data, transfers) { this.postMessage({ @@ -149,7 +149,7 @@ MessageHandler.prototype = { * Expects that the other side will callback with the response. * @param {string} actionName - Action to call. * @param {JSON} data - JSON data to send. - * @param {Array} [transfers] - Optional list of transfers/ArrayBuffers. + * @param {Array} [transfers] - List of transfers/ArrayBuffers. * @returns {Promise} Promise to be resolved with response data. */ sendWithPromise(actionName, data, transfers) { @@ -174,9 +174,9 @@ MessageHandler.prototype = { * Expect that the other side will callback to signal 'start_complete'. * @param {string} actionName - Action to call. * @param {JSON} data - JSON data to send. - * @param {Object} queueingStrategy - strategy to signal backpressure based on + * @param {Object} queueingStrategy - Strategy to signal backpressure based on * internal queue. - * @param {Array} [transfers] - Optional list of transfers/ArrayBuffers. + * @param {Array} [transfers] - List of transfers/ArrayBuffers. * @return {ReadableStream} ReadableStream to read data in chunks. */ sendWithStream(actionName, data, queueingStrategy, transfers) { diff --git a/web/annotation_layer_builder.js b/web/annotation_layer_builder.js index 10f1eeec0..9805c2e29 100644 --- a/web/annotation_layer_builder.js +++ b/web/annotation_layer_builder.js @@ -21,8 +21,8 @@ import { SimpleLinkService } from './pdf_link_service'; * @typedef {Object} AnnotationLayerBuilderOptions * @property {HTMLDivElement} pageDiv * @property {PDFPage} pdfPage - * @property {string} imageResourcesPath - (optional) Path for image resources, - * mainly for annotation icons. Include trailing slash. + * @property {string} [imageResourcesPath] - Path for image resources, mainly + * for annotation icons. Include trailing slash. * @property {boolean} renderInteractiveForms * @property {IPDFLinkService} linkService * @property {DownloadManager} downloadManager @@ -109,8 +109,8 @@ class DefaultAnnotationLayerFactory { /** * @param {HTMLDivElement} pageDiv * @param {PDFPage} pdfPage - * @param {string} imageResourcesPath - (optional) Path for image resources, - * mainly for annotation icons. Include trailing slash. + * @param {string} [imageResourcesPath] - Path for image resources, mainly + * for annotation icons. Include trailing slash. * @param {boolean} renderInteractiveForms * @param {IL10n} l10n * @returns {AnnotationLayerBuilder} diff --git a/web/app.js b/web/app.js index f8ca4d2ae..a0390ca15 100644 --- a/web/app.js +++ b/web/app.js @@ -609,9 +609,9 @@ let PDFViewerApplication = { /** * Opens PDF document specified by URL or array with additional arguments. * @param {string|TypedArray|ArrayBuffer} file - PDF location or binary data. - * @param {Object} args - (optional) Additional arguments for the getDocument - * call, e.g. HTTP headers ('httpHeaders') or - * alternative data transport ('range'). + * @param {Object} [args] - Additional arguments for the getDocument call, + * e.g. HTTP headers ('httpHeaders') or alternative + * data transport ('range'). * @returns {Promise} - Returns the promise, which is resolved when document * is opened. */ @@ -764,10 +764,10 @@ let PDFViewerApplication = { /** * Show the error box. - * @param {string} message A message that is human readable. - * @param {Object} moreInfo (optional) Further information about the error - * that is more technical. Should have a 'message' - * and optionally a 'stack' property. + * @param {string} message - A message that is human readable. + * @param {Object} [moreInfo] - Further information about the error that is + * more technical. Should have a 'message' and + * optionally a 'stack' property. */ error(message, moreInfo) { let moreInfoText = [this.l10n.get('error_version_info', diff --git a/web/base_viewer.js b/web/base_viewer.js index ff10255d9..d7675e5c8 100644 --- a/web/base_viewer.js +++ b/web/base_viewer.js @@ -33,36 +33,35 @@ const DEFAULT_CACHE_SIZE = 10; /** * @typedef {Object} PDFViewerOptions * @property {HTMLDivElement} container - The container for the viewer element. - * @property {HTMLDivElement} viewer - (optional) The viewer element. + * @property {HTMLDivElement} [viewer] - The viewer element. * @property {EventBus} eventBus - The application event bus. * @property {IPDFLinkService} linkService - The navigation/linking service. - * @property {DownloadManager} downloadManager - (optional) The download - * manager component. - * @property {PDFFindController} findController - (optional) The find - * controller component. - * @property {PDFRenderingQueue} renderingQueue - (optional) The rendering - * queue object. - * @property {boolean} removePageBorders - (optional) Removes the border shadow - * around the pages. The default value is `false`. - * @property {number} textLayerMode - (optional) Controls if the text layer used - * for selection and searching is created, and if the improved text selection + * @property {DownloadManager} [downloadManager] - The download manager + * component. + * @property {PDFFindController} [findController] - The find controller + * component. + * @property {PDFRenderingQueue} [renderingQueue] - The rendering queue object. + * @property {boolean} [removePageBorders] - Removes the border shadow around + * the pages. The default value is `false`. + * @property {number} [textLayerMode] - Controls if the text layer used for + * selection and searching is created, and if the improved text selection * behaviour is enabled. The constants from {TextLayerMode} should be used. * The default value is `TextLayerMode.ENABLE`. - * @property {string} imageResourcesPath - (optional) Path for image resources, + * @property {string} [imageResourcesPath] - Path for image resources, mainly * mainly for annotation icons. Include trailing slash. - * @property {boolean} renderInteractiveForms - (optional) Enables rendering of + * @property {boolean} [renderInteractiveForms] - Enables rendering of * interactive form elements. The default is `false`. - * @property {boolean} enablePrintAutoRotate - (optional) Enables automatic - * rotation of pages whose orientation differ from the first page upon - * printing. The default is `false`. + * @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of + * pages whose orientation differ from the first page upon printing. The + * default is `false`. * @property {string} renderer - 'canvas' or 'svg'. The default is 'canvas'. - * @property {boolean} enableWebGL - (optional) Enables WebGL accelerated - * rendering for some operations. The default value is `false`. - * @property {boolean} useOnlyCssZoom - (optional) Enables CSS only zooming. - * The default value is `false`. - * @property {number} maxCanvasPixels - (optional) The maximum supported canvas - * size in total pixels, i.e. width * height. Use -1 for no limit. - * The default value is 4096 * 4096 (16 mega-pixels). + * @property {boolean} [enableWebGL] - Enables WebGL accelerated rendering for + * some operations. The default value is `false`. + * @property {boolean} [useOnlyCssZoom] - Enables CSS only zooming. The default + * value is `false`. + * @property {number} [maxCanvasPixels] - The maximum supported canvas size in + * total pixels, i.e. width * height. Use -1 for no limit. The default value + * is 4096 * 4096 (16 mega-pixels). * @property {IL10n} l10n - Localization service. */ @@ -666,10 +665,10 @@ class BaseViewer { /** * @typedef ScrollPageIntoViewParameters * @property {number} pageNumber - The page number. - * @property {Array} destArray - (optional) The original PDF destination - * array, in the format: - * @property {boolean} allowNegativeOffset - (optional) Allow negative page - * offsets. The default value is `false`. + * @property {Array} [destArray] - The original PDF destination array, in the + * format: + * @property {boolean} [allowNegativeOffset] - Allow negative page offsets. + * The default value is `false`. */ /** @@ -1009,8 +1008,8 @@ class BaseViewer { /** * @param {HTMLDivElement} pageDiv * @param {PDFPage} pdfPage - * @param {string} imageResourcesPath - (optional) Path for image resources, - * mainly for annotation icons. Include trailing slash. + * @param {string} [imageResourcesPath] - Path for image resources, mainly + * for annotation icons. Include trailing slash. * @param {boolean} renderInteractiveForms * @param {IL10n} l10n * @returns {AnnotationLayerBuilder} diff --git a/web/chromecom.js b/web/chromecom.js index 9b461e65d..96d84a200 100644 --- a/web/chromecom.js +++ b/web/chromecom.js @@ -30,11 +30,11 @@ let ChromeCom = { * Creates an event that the extension is listening for and will * asynchronously respond by calling the callback. * - * @param {string} action The action to trigger. - * @param {string} data Optional data to send. - * @param {Function} callback Optional response callback that will be called - * with one data argument. When the request cannot be handled, the callback - * is immediately invoked with no arguments. + * @param {string} action - The action to trigger. + * @param {string} [data] - The data to send. + * @param {Function} [callback] - Response callback that will be called with + * one data argument. When the request cannot be handled, the callback is + * immediately invoked with no arguments. */ request(action, data, callback) { let message = { diff --git a/web/firefoxcom.js b/web/firefoxcom.js index e0af9fa12..05d31420f 100644 --- a/web/firefoxcom.js +++ b/web/firefoxcom.js @@ -32,8 +32,8 @@ let FirefoxCom = (function FirefoxComClosure() { * synchronously respond to. * NOTE: It is reccomended to use request() instead since one day we may not * be able to synchronously reply. - * @param {string} action The action to trigger. - * @param {string} data Optional data to send. + * @param {string} action - The action to trigger. + * @param {string} [data] - The data to send. * @return {*} The response. */ requestSync(action, data) { @@ -52,10 +52,10 @@ let FirefoxCom = (function FirefoxComClosure() { /** * Creates an event that the extension is listening for and will * asynchronously respond by calling the callback. - * @param {string} action The action to trigger. - * @param {string} data Optional data to send. - * @param {Function} callback Optional response callback that will be called - * with one data argument. + * @param {string} action - The action to trigger. + * @param {string} [data] - The data to send. + * @param {Function} [callback] - Response callback that will be called + * with one data argument. */ request(action, data, callback) { let request = document.createTextNode(''); diff --git a/web/interfaces.js b/web/interfaces.js index bb22e0bed..a8780f9ba 100644 --- a/web/interfaces.js +++ b/web/interfaces.js @@ -156,8 +156,8 @@ class IPDFAnnotationLayerFactory { /** * @param {HTMLDivElement} pageDiv * @param {PDFPage} pdfPage - * @param {string} imageResourcesPath - (optional) Path for image resources, - * mainly for annotation icons. Include trailing slash. + * @param {string} [imageResourcesPath] - Path for image resources, mainly + * for annotation icons. Include trailing slash. * @param {boolean} renderInteractiveForms * @param {IL10n} l10n * @returns {AnnotationLayerBuilder} diff --git a/web/overlay_manager.js b/web/overlay_manager.js index 461244076..2a7688f99 100644 --- a/web/overlay_manager.js +++ b/web/overlay_manager.js @@ -27,13 +27,13 @@ class OverlayManager { /** * @param {string} name - The name of the overlay that is registered. * @param {HTMLDivElement} element - The overlay's DOM element. - * @param {function} callerCloseMethod - (optional) The method that, if - * present, calls `OverlayManager.close` from the object - * registering the overlay. Access to this method is - * necessary in order to run cleanup code when e.g. - * the overlay is force closed. The default is `null`. - * @param {boolean} canForceClose - (optional) Indicates if opening the - * overlay closes an active overlay. The default is `false`. + * @param {function} [callerCloseMethod] - The method that, if present, calls + * `OverlayManager.close` from the object registering the + * overlay. Access to this method is necessary in order to + * run cleanup code when e.g. the overlay is force closed. + * The default is `null`. + * @param {boolean} [canForceClose] - Indicates if opening the overlay closes + * an active overlay. The default is `false`. * @returns {Promise} A promise that is resolved when the overlay has been * registered. */ diff --git a/web/pdf_cursor_tools.js b/web/pdf_cursor_tools.js index 252963944..d7965aca0 100644 --- a/web/pdf_cursor_tools.js +++ b/web/pdf_cursor_tools.js @@ -25,9 +25,9 @@ const CursorTool = { * @typedef {Object} PDFCursorToolsOptions * @property {HTMLDivElement} container - The document container. * @property {EventBus} eventBus - The application event bus. - * @property {number} cursorToolOnLoad - (optional) The cursor tool that will be - * enabled on load; the constants from {CursorTool} should be used. - * The default value is `CursorTool.SELECT`. + * @property {number} [cursorToolOnLoad] - The cursor tool that will be enabled + * on load; the constants from {CursorTool} should be used. The default value + * is `CursorTool.SELECT`. */ class PDFCursorTools { diff --git a/web/pdf_history.js b/web/pdf_history.js index c94aa3b19..74042ba39 100644 --- a/web/pdf_history.js +++ b/web/pdf_history.js @@ -33,15 +33,15 @@ const UPDATE_VIEWAREA_TIMEOUT = 1000; // milliseconds /** * @typedef {Object} InitializeParameters * @property {string} fingerprint - The PDF document's unique fingerprint. - * @property {boolean} resetHistory - (optional) Reset the browsing history. - * @property {boolean} updateUrl - (optional) Attempt to update the document - * URL, with the current hash, when pushing/replacing browser history entries. + * @property {boolean} [resetHistory] - Reset the browsing history. + * @property {boolean} [updateUrl] - Attempt to update the document URL, with + * the current hash, when pushing/replacing browser history entries. */ /** * @typedef {Object} PushParameters - * @property {string} namedDest - (optional) The named destination. If absent, - * a stringified version of `explicitDest` is used. + * @property {string} [namedDest] - The named destination. If absent, a + * stringified version of `explicitDest` is used. * @property {Array} explicitDest - The explicit destination array. * @property {number} pageNumber - The page to which the destination points. */ diff --git a/web/pdf_link_service.js b/web/pdf_link_service.js index 42bfb9f99..a34c4fe71 100644 --- a/web/pdf_link_service.js +++ b/web/pdf_link_service.js @@ -18,11 +18,11 @@ import { getGlobalEventBus, parseQueryString } from './ui_utils'; /** * @typedef {Object} PDFLinkServiceOptions * @property {EventBus} eventBus - The application event bus. - * @property {number} externalLinkTarget - (optional) Specifies the `target` - * attribute for external links. Must use one of the values from {LinkTarget}. + * @property {number} [externalLinkTarget] - Specifies the `target` attribute + * for external links. Must use one of the values from {LinkTarget}. * Defaults to using no target. - * @property {string} externalLinkRel - (optional) Specifies the `rel` attribute - * for external links. Defaults to stripping the referrer. + * @property {string} [externalLinkRel] - Specifies the `rel` attribute for + * external links. Defaults to stripping the referrer. */ /** diff --git a/web/pdf_page_view.js b/web/pdf_page_view.js index 8f13a608d..c1bdef65e 100644 --- a/web/pdf_page_view.js +++ b/web/pdf_page_view.js @@ -32,23 +32,23 @@ import { viewerCompatibilityParams } from './viewer_compatibility'; * @property {PageViewport} defaultViewport - The page viewport. * @property {PDFRenderingQueue} renderingQueue - The rendering queue object. * @property {IPDFTextLayerFactory} textLayerFactory - * @property {number} textLayerMode - (optional) Controls if the text layer used - * for selection and searching is created, and if the improved text selection + * @property {number} [textLayerMode] - Controls if the text layer used for + * selection and searching is created, and if the improved text selection * behaviour is enabled. The constants from {TextLayerMode} should be used. * The default value is `TextLayerMode.ENABLE`. * @property {IPDFAnnotationLayerFactory} annotationLayerFactory - * @property {string} imageResourcesPath - (optional) Path for image resources, - * mainly for annotation icons. Include trailing slash. + * @property {string} [imageResourcesPath] - Path for image resources, mainly + * for annotation icons. Include trailing slash. * @property {boolean} renderInteractiveForms - Turns on rendering of * interactive form elements. The default is `false`. * @property {string} renderer - 'canvas' or 'svg'. The default is 'canvas'. - * @property {boolean} enableWebGL - (optional) Enables WebGL accelerated - * rendering for some operations. The default value is `false`. - * @property {boolean} useOnlyCssZoom - (optional) Enables CSS only zooming. - * The default value is `false`. - * @property {number} maxCanvasPixels - (optional) The maximum supported canvas - * size in total pixels, i.e. width * height. Use -1 for no limit. - * The default value is 4096 * 4096 (16 mega-pixels). + * @property {boolean} [enableWebGL] - Enables WebGL accelerated rendering for + * some operations. The default value is `false`. + * @property {boolean} [useOnlyCssZoom] - Enables CSS only zooming. The default + * value is `false`. + * @property {number} [maxCanvasPixels] - The maximum supported canvas size in + * total pixels, i.e. width * height. Use -1 for no limit. The default value + * is 4096 * 4096 (16 mega-pixels). * @property {IL10n} l10n - Localization service. */ diff --git a/web/pdf_presentation_mode.js b/web/pdf_presentation_mode.js index 93eedb2bf..bea6a3a13 100644 --- a/web/pdf_presentation_mode.js +++ b/web/pdf_presentation_mode.js @@ -32,11 +32,11 @@ const SWIPE_ANGLE_THRESHOLD = Math.PI / 6; /** * @typedef {Object} PDFPresentationModeOptions * @property {HTMLDivElement} container - The container for the viewer element. - * @property {HTMLDivElement} viewer - (optional) The viewer element. + * @property {HTMLDivElement} [viewer] - The viewer element. * @property {PDFViewer} pdfViewer - The document viewer. * @property {EventBus} eventBus - The application event bus. - * @property {Array} contextMenuItems - (optional) The menu items that are added - * to the context menu in Presentation Mode. + * @property {Array} [contextMenuItems] - The menu items that are added to the + * context menu in Presentation Mode. */ class PDFPresentationMode { diff --git a/web/pdf_sidebar.js b/web/pdf_sidebar.js index 5b39cf5bf..3cb72907d 100644 --- a/web/pdf_sidebar.js +++ b/web/pdf_sidebar.js @@ -34,8 +34,8 @@ const SidebarView = { * @property {PDFThumbnailViewer} pdfThumbnailViewer - The thumbnail viewer. * @property {EventBus} eventBus - The application event bus. * @property {IL10n} l10n - The localization service. - * @property {boolean} disableNotification - (optional) Disable the notification - * for documents containing outline/attachments. The default value is `false`. + * @property {boolean} [disableNotification] - Disable the notification for + * documents containing outline/attachments. The default value is `false`. */ /** @@ -153,8 +153,8 @@ class PDFSidebar { /** * @param {number} view - The sidebar view that should be switched to, * must be one of the values in {SidebarView}. - * @param {boolean} forceOpen - (optional) Ensure that the sidebar is open. - * The default value is `false`. + * @param {boolean} [forceOpen] - Ensure that the sidebar is open. + * The default value is `false`. */ switchView(view, forceOpen = false) { this._switchView(view, forceOpen); diff --git a/web/pdf_thumbnail_view.js b/web/pdf_thumbnail_view.js index 601ecad7a..6f7c8b486 100644 --- a/web/pdf_thumbnail_view.js +++ b/web/pdf_thumbnail_view.js @@ -30,9 +30,9 @@ const THUMBNAIL_WIDTH = 98; // px * @property {PageViewport} defaultViewport - The page viewport. * @property {IPDFLinkService} linkService - The navigation/linking service. * @property {PDFRenderingQueue} renderingQueue - The rendering queue object. - * @property {boolean} disableCanvasToImageConversion - (optional) Don't convert - * the canvas thumbnails to images. This prevents `toDataURL` calls, - * but increases the overall memory usage. The default value is `false`. + * @property {boolean} [disableCanvasToImageConversion] - Don't convert the + * canvas thumbnails to images. This prevents `toDataURL` calls, but + * increases the overall memory usage. The default value is `false`. * @property {IL10n} l10n - Localization service. */ diff --git a/web/text_layer_builder.js b/web/text_layer_builder.js index 6a59e5527..096b3f120 100644 --- a/web/text_layer_builder.js +++ b/web/text_layer_builder.js @@ -79,8 +79,8 @@ class TextLayerBuilder { /** * Renders the text layer. * - * @param {number} timeout - (optional) wait for a specified amount of - * milliseconds before rendering + * @param {number} [timeout] - Wait for a specified amount of milliseconds + * before rendering. */ render(timeout = 0) { if (!(this.textContent || this.textContentStream) || this.renderingDone) {