2018-11-08 21:18:18 +09:00
|
|
|
/* Copyright 2018 Mozilla Foundation
|
2014-09-21 02:21:49 +09:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2019-11-23 19:28:29 +09:00
|
|
|
/* eslint-disable getter-return */
|
2014-09-21 02:21:49 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @interface
|
|
|
|
*/
|
2017-05-08 05:01:49 +09:00
|
|
|
class IPDFLinkService {
|
2018-10-11 17:23:51 +09:00
|
|
|
/**
|
2019-10-13 00:02:54 +09:00
|
|
|
* @type {number}
|
2018-10-11 17:23:51 +09:00
|
|
|
*/
|
|
|
|
get pagesCount() {}
|
|
|
|
|
2014-09-21 02:21:49 +09:00
|
|
|
/**
|
2019-10-13 00:02:54 +09:00
|
|
|
* @type {number}
|
2014-09-21 02:21:49 +09:00
|
|
|
*/
|
2017-05-08 05:01:49 +09:00
|
|
|
get page() {}
|
|
|
|
|
2014-09-21 02:21:49 +09:00
|
|
|
/**
|
|
|
|
* @param {number} value
|
|
|
|
*/
|
2017-05-08 05:01:49 +09:00
|
|
|
set page(value) {}
|
|
|
|
|
2017-08-21 18:56:49 +09:00
|
|
|
/**
|
2019-10-13 00:02:54 +09:00
|
|
|
* @type {number}
|
2017-08-21 18:56:49 +09:00
|
|
|
*/
|
|
|
|
get rotation() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {number} value
|
|
|
|
*/
|
|
|
|
set rotation(value) {}
|
|
|
|
|
2019-08-21 06:43:24 +09:00
|
|
|
/**
|
2019-10-13 00:02:54 +09:00
|
|
|
* @type {boolean}
|
2019-08-21 06:43:24 +09:00
|
|
|
*/
|
|
|
|
get externalLinkEnabled() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {boolean} value
|
|
|
|
*/
|
|
|
|
set externalLinkEnabled(value) {}
|
|
|
|
|
2014-09-21 02:21:49 +09:00
|
|
|
/**
|
2020-10-04 00:43:33 +09:00
|
|
|
* @param {string|Array} dest - The named, or explicit, PDF destination.
|
2014-09-21 02:21:49 +09:00
|
|
|
*/
|
2020-10-04 00:43:33 +09:00
|
|
|
async goToDestination(dest) {}
|
2017-05-08 05:01:49 +09:00
|
|
|
|
2020-10-04 01:08:30 +09:00
|
|
|
/**
|
2020-10-31 18:17:28 +09:00
|
|
|
* @param {number|string} val - The page number, or page label.
|
2020-10-04 01:08:30 +09:00
|
|
|
*/
|
2020-10-31 18:17:28 +09:00
|
|
|
goToPage(val) {}
|
2020-10-04 01:08:30 +09:00
|
|
|
|
2014-09-21 02:21:49 +09:00
|
|
|
/**
|
|
|
|
* @param dest - The PDF destination object.
|
|
|
|
* @returns {string} The hyperlink to the PDF object.
|
|
|
|
*/
|
2017-05-08 05:01:49 +09:00
|
|
|
getDestinationHash(dest) {}
|
|
|
|
|
2014-09-21 02:21:49 +09:00
|
|
|
/**
|
|
|
|
* @param hash - The PDF parameters/hash.
|
|
|
|
* @returns {string} The hyperlink to the PDF object.
|
|
|
|
*/
|
2017-05-08 05:01:49 +09:00
|
|
|
getAnchorUrl(hash) {}
|
|
|
|
|
2014-09-22 20:41:17 +09:00
|
|
|
/**
|
|
|
|
* @param {string} hash
|
|
|
|
*/
|
2017-05-08 05:01:49 +09:00
|
|
|
setHash(hash) {}
|
|
|
|
|
2014-10-01 02:22:38 +09:00
|
|
|
/**
|
|
|
|
* @param {string} action
|
|
|
|
*/
|
2017-05-08 05:01:49 +09:00
|
|
|
executeNamedAction(action) {}
|
2015-04-28 00:25:32 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {number} pageNum - page number.
|
|
|
|
* @param {Object} pageRef - reference to the page.
|
|
|
|
*/
|
2017-05-08 05:01:49 +09:00
|
|
|
cachePageRef(pageNum, pageRef) {}
|
2018-10-30 19:08:26 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {number} pageNumber
|
|
|
|
*/
|
|
|
|
isPageVisible(pageNumber) {}
|
Trigger cleanup, once rendering has finished, in `PDFThumbnailView.draw`
This patch will help reduce memory usage, especially for longer documents, when the user scrolls around in the thumbnailView (in the sidebar).
Note how the `PDFPageProxy.cleanup` method will, assuming it's safe to do so, release main-thread resources associated with the page. These include things such as e.g. image data (which can be arbitrarily large), and also the operatorList (which can also be quite large).
Hence when pages are evicted from the `PDFPageViewBuffer`, on the `BaseViewer`-instance, the `PDFPageView.destroy` method is invoked which will (among other things) call `PDFPageProxy.cleanup` in the API.
However, looking at the `PDFThumbnailViewer`/`PDFThumbnailView` classes you'll notice that there's no attempt to ever call `PDFPageProxy.cleanup`, which implies that in certain circumstances we'll essentially keep all resources allocated permanently on the `PDFPageProxy`-instances in the API.
In particular, this happens when the users opens the sidebar and starts scrolling around in the thumbnails. Generally speaking you obviously need to keep all thumbnail *images* around, since otherwise the thumbnailView is useless, but there's still room for improvement here.
Please note that the case where a *rendered page* is used to create the thumbnail is (obviously) completely unaffected by the issues described above, and this rather only applies to thumbnails being explicitly rendered by the `PDFThumbnailView.draw` method.
For the latter case, we can fix these issues simply by calling `PDFPageProxy.cleanup` once rendering has finished. To prevent *accidentally* pulling the rug out from under `PDFPageViewBuffer` in the viewer, which expects data to be available, this required adding a couple of new methods[1] to enable checking that it's indeed safe to call `PDFPageProxy.cleanup` from the `PDFThumbnailView.draw` method.
It's really quite fascinating that no one has noticed this issue before, since it's been around since basically "forever".
---
[1] While it should be *very* rare for `PDFThumbnailView.draw` to be called for a pageView that's also in the `PDFPageViewBuffer`, given that pages are rendered before thumbnails and that the *rendered page* is used to create the thumbnail, it can still happen since rendering is asynchronous.
Furthermore, it's also possible for `PDFThumbnailView.setImage` to be disabled, in which case checking the `PDFPageViewBuffer` for active pageViews *really* matters.
2020-11-12 23:49:29 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {number} pageNumber
|
|
|
|
*/
|
|
|
|
isPageCached(pageNumber) {}
|
2017-05-08 05:01:49 +09:00
|
|
|
}
|
2014-09-21 02:21:49 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @interface
|
|
|
|
*/
|
2017-05-08 05:01:49 +09:00
|
|
|
class IRenderableView {
|
2014-09-21 02:21:49 +09:00
|
|
|
/**
|
2019-10-13 00:02:54 +09:00
|
|
|
* @type {string} - Unique ID for rendering queue.
|
2014-09-21 02:21:49 +09:00
|
|
|
*/
|
2017-05-08 05:01:49 +09:00
|
|
|
get renderingId() {}
|
|
|
|
|
2014-09-21 02:21:49 +09:00
|
|
|
/**
|
2019-10-13 00:02:54 +09:00
|
|
|
* @type {RenderingStates}
|
2014-09-21 02:21:49 +09:00
|
|
|
*/
|
2017-05-08 05:01:49 +09:00
|
|
|
get renderingState() {}
|
|
|
|
|
2014-09-21 02:21:49 +09:00
|
|
|
/**
|
2014-12-18 05:47:14 +09:00
|
|
|
* @returns {Promise} Resolved on draw completion.
|
2014-09-21 02:21:49 +09:00
|
|
|
*/
|
2017-05-08 05:01:49 +09:00
|
|
|
draw() {}
|
|
|
|
|
|
|
|
resume() {}
|
|
|
|
}
|
2014-09-21 02:21:49 +09:00
|
|
|
|
2014-09-28 23:35:33 +09:00
|
|
|
/**
|
|
|
|
* @interface
|
|
|
|
*/
|
2017-05-08 05:01:49 +09:00
|
|
|
class IPDFTextLayerFactory {
|
2014-09-28 23:35:33 +09:00
|
|
|
/**
|
|
|
|
* @param {HTMLDivElement} textLayerDiv
|
|
|
|
* @param {number} pageIndex
|
|
|
|
* @param {PageViewport} viewport
|
2016-09-02 01:07:12 +09:00
|
|
|
* @param {boolean} enhanceTextSelection
|
2020-02-27 01:16:30 +09:00
|
|
|
* @param {EventBus} eventBus
|
2021-08-19 09:02:29 +09:00
|
|
|
* @param {TextHighlighter} highlighter
|
2014-09-28 23:35:33 +09:00
|
|
|
* @returns {TextLayerBuilder}
|
|
|
|
*/
|
Enable auto-formatting of the entire code-base using Prettier (issue 11444)
Note that Prettier, purposely, has only limited [configuration options](https://prettier.io/docs/en/options.html). The configuration file is based on [the one in `mozilla central`](https://searchfox.org/mozilla-central/source/.prettierrc) with just a few additions (to avoid future breakage if the defaults ever changes).
Prettier is being used for a couple of reasons:
- To be consistent with `mozilla-central`, where Prettier is already in use across the tree.
- To ensure a *consistent* coding style everywhere, which is automatically enforced during linting (since Prettier is used as an ESLint plugin). This thus ends "all" formatting disussions once and for all, removing the need for review comments on most stylistic matters.
Many ESLint options are now redundant, and I've tried my best to remove all the now unnecessary options (but I may have missed some).
Note also that since Prettier considers the `printWidth` option as a guide, rather than a hard rule, this patch resorts to a small hack in the ESLint config to ensure that *comments* won't become too long.
*Please note:* This patch is generated automatically, by appending the `--fix` argument to the ESLint call used in the `gulp lint` task. It will thus require some additional clean-up, which will be done in a *separate* commit.
(On a more personal note, I'll readily admit that some of the changes Prettier makes are *extremely* ugly. However, in the name of consistency we'll probably have to live with that.)
2019-12-25 23:59:37 +09:00
|
|
|
createTextLayerBuilder(
|
|
|
|
textLayerDiv,
|
|
|
|
pageIndex,
|
|
|
|
viewport,
|
2020-02-27 01:16:30 +09:00
|
|
|
enhanceTextSelection = false,
|
2021-08-19 09:02:29 +09:00
|
|
|
eventBus,
|
|
|
|
highlighter
|
Enable auto-formatting of the entire code-base using Prettier (issue 11444)
Note that Prettier, purposely, has only limited [configuration options](https://prettier.io/docs/en/options.html). The configuration file is based on [the one in `mozilla central`](https://searchfox.org/mozilla-central/source/.prettierrc) with just a few additions (to avoid future breakage if the defaults ever changes).
Prettier is being used for a couple of reasons:
- To be consistent with `mozilla-central`, where Prettier is already in use across the tree.
- To ensure a *consistent* coding style everywhere, which is automatically enforced during linting (since Prettier is used as an ESLint plugin). This thus ends "all" formatting disussions once and for all, removing the need for review comments on most stylistic matters.
Many ESLint options are now redundant, and I've tried my best to remove all the now unnecessary options (but I may have missed some).
Note also that since Prettier considers the `printWidth` option as a guide, rather than a hard rule, this patch resorts to a small hack in the ESLint config to ensure that *comments* won't become too long.
*Please note:* This patch is generated automatically, by appending the `--fix` argument to the ESLint call used in the `gulp lint` task. It will thus require some additional clean-up, which will be done in a *separate* commit.
(On a more personal note, I'll readily admit that some of the changes Prettier makes are *extremely* ugly. However, in the name of consistency we'll probably have to live with that.)
2019-12-25 23:59:37 +09:00
|
|
|
) {}
|
2017-05-08 05:01:49 +09:00
|
|
|
}
|
2014-09-30 01:05:28 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @interface
|
|
|
|
*/
|
2017-04-28 19:02:42 +09:00
|
|
|
class IPDFAnnotationLayerFactory {
|
2014-09-30 01:05:28 +09:00
|
|
|
/**
|
|
|
|
* @param {HTMLDivElement} pageDiv
|
|
|
|
* @param {PDFPage} pdfPage
|
2020-08-05 19:57:32 +09:00
|
|
|
* @param {AnnotationStorage} [annotationStorage] - Storage for annotation
|
|
|
|
* data in forms.
|
2019-10-12 23:30:32 +09:00
|
|
|
* @param {string} [imageResourcesPath] - Path for image resources, mainly
|
|
|
|
* for annotation icons. Include trailing slash.
|
[api-minor] Introduce a new `annotationMode`-option, in `PDFPageProxy.{render, getOperatorList}`
*This is a follow-up to PRs 13867 and 13899.*
This patch is tagged `api-minor` for the following reasons:
- It replaces the `renderInteractiveForms`/`includeAnnotationStorage`-options, in the `PDFPageProxy.render`-method, with the single `annotationMode`-option that controls which annotations are being rendered and how. Note that the old options were mutually exclusive, and setting both to `true` would result in undefined behaviour.
- For improved consistency in the API, the `annotationMode`-option will also work together with the `PDFPageProxy.getOperatorList`-method.
- It's now also possible to disable *all* annotation rendering in both the API and the Viewer, since the other changes meant that this could now be supported with a single added line on the worker-thread[1]; fixes 7282.
---
[1] Please note that in order to simplify the overall implementation, we'll purposely only support disabling of *all* annotations and that the option is being shared between the API and the Viewer. For any more "specialized" use-cases, where e.g. only some annotation-types are being rendered and/or the API and Viewer render different sets of annotations, that'll have to be handled in third-party implementations/forks of the PDF.js code-base.
2021-08-08 21:36:28 +09:00
|
|
|
* @param {boolean} renderForms
|
2018-02-13 21:17:11 +09:00
|
|
|
* @param {IL10n} l10n
|
2020-10-29 03:16:56 +09:00
|
|
|
* @param {boolean} [enableScripting]
|
|
|
|
* @param {Promise<boolean>} [hasJSActionsPromise]
|
2020-11-18 22:59:57 +09:00
|
|
|
* @param {Object} [mouseState]
|
2015-12-17 20:54:53 +09:00
|
|
|
* @returns {AnnotationLayerBuilder}
|
2014-09-30 01:05:28 +09:00
|
|
|
*/
|
Enable auto-formatting of the entire code-base using Prettier (issue 11444)
Note that Prettier, purposely, has only limited [configuration options](https://prettier.io/docs/en/options.html). The configuration file is based on [the one in `mozilla central`](https://searchfox.org/mozilla-central/source/.prettierrc) with just a few additions (to avoid future breakage if the defaults ever changes).
Prettier is being used for a couple of reasons:
- To be consistent with `mozilla-central`, where Prettier is already in use across the tree.
- To ensure a *consistent* coding style everywhere, which is automatically enforced during linting (since Prettier is used as an ESLint plugin). This thus ends "all" formatting disussions once and for all, removing the need for review comments on most stylistic matters.
Many ESLint options are now redundant, and I've tried my best to remove all the now unnecessary options (but I may have missed some).
Note also that since Prettier considers the `printWidth` option as a guide, rather than a hard rule, this patch resorts to a small hack in the ESLint config to ensure that *comments* won't become too long.
*Please note:* This patch is generated automatically, by appending the `--fix` argument to the ESLint call used in the `gulp lint` task. It will thus require some additional clean-up, which will be done in a *separate* commit.
(On a more personal note, I'll readily admit that some of the changes Prettier makes are *extremely* ugly. However, in the name of consistency we'll probably have to live with that.)
2019-12-25 23:59:37 +09:00
|
|
|
createAnnotationLayerBuilder(
|
|
|
|
pageDiv,
|
|
|
|
pdfPage,
|
[api-minor] Fix the `AnnotationStorage` usage properly in the viewer/tests (PR 12107 and 12143 follow-up)
*The [api-minor] label probably ought to have been added to the original PR, given the changes to the `createAnnotationLayerBuilder` signature (if nothing else).*
This patch fixes the following things:
- Let the `AnnotationLayer.render` method create an `AnnotationStorage`-instance if none was provided, thus making the parameter *properly* optional. This not only fixes the reference tests, it also prevents issues when the viewer components are used.
- Stop exporting `AnnotationStorage` in the official API, i.e. the `src/pdf.js` file, since it's no longer necessary given the change above. Generally speaking, unless absolutely necessary we probably shouldn't export unused things in the API.
- Fix a number of JSDocs `typedef`s, in `src/display/` and `web/` code, to actually account for the new `annotationStorage` parameter.
- Update `web/interfaces.js` to account for the changes in `createAnnotationLayerBuilder`.
- Initialize the storage, in `AnnotationStorage`, using `Object.create(null)` rather than `{}` (which is the PDF.js default).
2020-07-31 23:13:26 +09:00
|
|
|
annotationStorage = null,
|
Enable auto-formatting of the entire code-base using Prettier (issue 11444)
Note that Prettier, purposely, has only limited [configuration options](https://prettier.io/docs/en/options.html). The configuration file is based on [the one in `mozilla central`](https://searchfox.org/mozilla-central/source/.prettierrc) with just a few additions (to avoid future breakage if the defaults ever changes).
Prettier is being used for a couple of reasons:
- To be consistent with `mozilla-central`, where Prettier is already in use across the tree.
- To ensure a *consistent* coding style everywhere, which is automatically enforced during linting (since Prettier is used as an ESLint plugin). This thus ends "all" formatting disussions once and for all, removing the need for review comments on most stylistic matters.
Many ESLint options are now redundant, and I've tried my best to remove all the now unnecessary options (but I may have missed some).
Note also that since Prettier considers the `printWidth` option as a guide, rather than a hard rule, this patch resorts to a small hack in the ESLint config to ensure that *comments* won't become too long.
*Please note:* This patch is generated automatically, by appending the `--fix` argument to the ESLint call used in the `gulp lint` task. It will thus require some additional clean-up, which will be done in a *separate* commit.
(On a more personal note, I'll readily admit that some of the changes Prettier makes are *extremely* ugly. However, in the name of consistency we'll probably have to live with that.)
2019-12-25 23:59:37 +09:00
|
|
|
imageResourcesPath = "",
|
[api-minor] Introduce a new `annotationMode`-option, in `PDFPageProxy.{render, getOperatorList}`
*This is a follow-up to PRs 13867 and 13899.*
This patch is tagged `api-minor` for the following reasons:
- It replaces the `renderInteractiveForms`/`includeAnnotationStorage`-options, in the `PDFPageProxy.render`-method, with the single `annotationMode`-option that controls which annotations are being rendered and how. Note that the old options were mutually exclusive, and setting both to `true` would result in undefined behaviour.
- For improved consistency in the API, the `annotationMode`-option will also work together with the `PDFPageProxy.getOperatorList`-method.
- It's now also possible to disable *all* annotation rendering in both the API and the Viewer, since the other changes meant that this could now be supported with a single added line on the worker-thread[1]; fixes 7282.
---
[1] Please note that in order to simplify the overall implementation, we'll purposely only support disabling of *all* annotations and that the option is being shared between the API and the Viewer. For any more "specialized" use-cases, where e.g. only some annotation-types are being rendered and/or the API and Viewer render different sets of annotations, that'll have to be handled in third-party implementations/forks of the PDF.js code-base.
2021-08-08 21:36:28 +09:00
|
|
|
renderForms = true,
|
2020-10-29 03:16:56 +09:00
|
|
|
l10n = undefined,
|
|
|
|
enableScripting = false,
|
2020-11-18 22:59:57 +09:00
|
|
|
hasJSActionsPromise = null,
|
|
|
|
mouseState = null
|
Enable auto-formatting of the entire code-base using Prettier (issue 11444)
Note that Prettier, purposely, has only limited [configuration options](https://prettier.io/docs/en/options.html). The configuration file is based on [the one in `mozilla central`](https://searchfox.org/mozilla-central/source/.prettierrc) with just a few additions (to avoid future breakage if the defaults ever changes).
Prettier is being used for a couple of reasons:
- To be consistent with `mozilla-central`, where Prettier is already in use across the tree.
- To ensure a *consistent* coding style everywhere, which is automatically enforced during linting (since Prettier is used as an ESLint plugin). This thus ends "all" formatting disussions once and for all, removing the need for review comments on most stylistic matters.
Many ESLint options are now redundant, and I've tried my best to remove all the now unnecessary options (but I may have missed some).
Note also that since Prettier considers the `printWidth` option as a guide, rather than a hard rule, this patch resorts to a small hack in the ESLint config to ensure that *comments* won't become too long.
*Please note:* This patch is generated automatically, by appending the `--fix` argument to the ESLint call used in the `gulp lint` task. It will thus require some additional clean-up, which will be done in a *separate* commit.
(On a more personal note, I'll readily admit that some of the changes Prettier makes are *extremely* ugly. However, in the name of consistency we'll probably have to live with that.)
2019-12-25 23:59:37 +09:00
|
|
|
) {}
|
2017-05-04 10:05:53 +09:00
|
|
|
}
|
|
|
|
|
2021-03-19 18:11:40 +09:00
|
|
|
/**
|
|
|
|
* @interface
|
|
|
|
*/
|
|
|
|
class IPDFXfaLayerFactory {
|
|
|
|
/**
|
|
|
|
* @param {HTMLDivElement} pageDiv
|
|
|
|
* @param {PDFPage} pdfPage
|
|
|
|
* @returns {XfaLayerBuilder}
|
|
|
|
*/
|
|
|
|
createXfaLayerBuilder(pageDiv, pdfPage) {}
|
|
|
|
}
|
|
|
|
|
2021-04-01 07:07:02 +09:00
|
|
|
/**
|
|
|
|
* @interface
|
|
|
|
*/
|
|
|
|
class IPDFStructTreeLayerFactory {
|
|
|
|
/**
|
|
|
|
* @param {PDFPage} pdfPage
|
|
|
|
* @returns {StructTreeLayerBuilder}
|
|
|
|
*/
|
|
|
|
createStructTreeLayerBuilder(pdfPage) {}
|
|
|
|
}
|
|
|
|
|
2017-05-04 10:05:53 +09:00
|
|
|
/**
|
|
|
|
* @interface
|
|
|
|
*/
|
|
|
|
class IL10n {
|
2018-03-20 21:42:45 +09:00
|
|
|
/**
|
|
|
|
* @returns {Promise<string>} - Resolves to the current locale.
|
|
|
|
*/
|
2018-07-30 23:28:39 +09:00
|
|
|
async getLanguage() {}
|
2018-03-20 21:42:45 +09:00
|
|
|
|
2017-05-04 10:05:53 +09:00
|
|
|
/**
|
|
|
|
* @returns {Promise<string>} - Resolves to 'rtl' or 'ltr'.
|
|
|
|
*/
|
2018-07-30 23:28:39 +09:00
|
|
|
async getDirection() {}
|
2017-05-04 10:05:53 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Translates text identified by the key and adds/formats data using the args
|
|
|
|
* property bag. If the key was not found, translation falls back to the
|
|
|
|
* fallback text.
|
|
|
|
* @param {string} key
|
|
|
|
* @param {object} args
|
|
|
|
* @param {string} fallback
|
|
|
|
* @returns {Promise<string>}
|
|
|
|
*/
|
Enable auto-formatting of the entire code-base using Prettier (issue 11444)
Note that Prettier, purposely, has only limited [configuration options](https://prettier.io/docs/en/options.html). The configuration file is based on [the one in `mozilla central`](https://searchfox.org/mozilla-central/source/.prettierrc) with just a few additions (to avoid future breakage if the defaults ever changes).
Prettier is being used for a couple of reasons:
- To be consistent with `mozilla-central`, where Prettier is already in use across the tree.
- To ensure a *consistent* coding style everywhere, which is automatically enforced during linting (since Prettier is used as an ESLint plugin). This thus ends "all" formatting disussions once and for all, removing the need for review comments on most stylistic matters.
Many ESLint options are now redundant, and I've tried my best to remove all the now unnecessary options (but I may have missed some).
Note also that since Prettier considers the `printWidth` option as a guide, rather than a hard rule, this patch resorts to a small hack in the ESLint config to ensure that *comments* won't become too long.
*Please note:* This patch is generated automatically, by appending the `--fix` argument to the ESLint call used in the `gulp lint` task. It will thus require some additional clean-up, which will be done in a *separate* commit.
(On a more personal note, I'll readily admit that some of the changes Prettier makes are *extremely* ugly. However, in the name of consistency we'll probably have to live with that.)
2019-12-25 23:59:37 +09:00
|
|
|
async get(key, args, fallback) {}
|
2017-05-04 10:05:53 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Translates HTML element.
|
|
|
|
* @param {HTMLElement} element
|
|
|
|
* @returns {Promise<void>}
|
|
|
|
*/
|
Enable auto-formatting of the entire code-base using Prettier (issue 11444)
Note that Prettier, purposely, has only limited [configuration options](https://prettier.io/docs/en/options.html). The configuration file is based on [the one in `mozilla central`](https://searchfox.org/mozilla-central/source/.prettierrc) with just a few additions (to avoid future breakage if the defaults ever changes).
Prettier is being used for a couple of reasons:
- To be consistent with `mozilla-central`, where Prettier is already in use across the tree.
- To ensure a *consistent* coding style everywhere, which is automatically enforced during linting (since Prettier is used as an ESLint plugin). This thus ends "all" formatting disussions once and for all, removing the need for review comments on most stylistic matters.
Many ESLint options are now redundant, and I've tried my best to remove all the now unnecessary options (but I may have missed some).
Note also that since Prettier considers the `printWidth` option as a guide, rather than a hard rule, this patch resorts to a small hack in the ESLint config to ensure that *comments* won't become too long.
*Please note:* This patch is generated automatically, by appending the `--fix` argument to the ESLint call used in the `gulp lint` task. It will thus require some additional clean-up, which will be done in a *separate* commit.
(On a more personal note, I'll readily admit that some of the changes Prettier makes are *extremely* ugly. However, in the name of consistency we'll probably have to live with that.)
2019-12-25 23:59:37 +09:00
|
|
|
async translate(element) {}
|
2017-04-24 03:52:58 +09:00
|
|
|
}
|
2018-11-08 21:18:18 +09:00
|
|
|
|
|
|
|
export {
|
2021-01-09 23:37:44 +09:00
|
|
|
IL10n,
|
|
|
|
IPDFAnnotationLayerFactory,
|
|
|
|
IPDFLinkService,
|
2021-04-01 07:07:02 +09:00
|
|
|
IPDFStructTreeLayerFactory,
|
2018-11-08 21:18:18 +09:00
|
|
|
IPDFTextLayerFactory,
|
2021-03-19 18:11:40 +09:00
|
|
|
IPDFXfaLayerFactory,
|
2021-01-09 23:37:44 +09:00
|
|
|
IRenderableView,
|
2018-11-08 21:18:18 +09:00
|
|
|
};
|