mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Update TypeScript to version 4.6.2
and work-around stricter type checks
I'm guessing that we're now running into the class-related improvements mentioned in https://devblogs.microsoft.com/typescript/announcing-typescript-4-6/#target-es2022 To unblock this update, and any future ones, this patch simply tweaks the JSDocs to get `gulp typestest` to run without errors.
This commit is contained in:
parent
3e593cfc1d
commit
6f600befdd
5 changed files with 33 additions and 12 deletions
|
@ -37,6 +37,9 @@ class DOMCanvasFactory extends BaseCanvasFactory {
|
|||
this._document = ownerDocument;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
_createCanvas(width, height) {
|
||||
const canvas = this._document.createElement("canvas");
|
||||
canvas.width = width;
|
||||
|
@ -91,6 +94,9 @@ async function fetchData(url, asTypedArray = false) {
|
|||
}
|
||||
|
||||
class DOMCMapReaderFactory extends BaseCMapReaderFactory {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
_fetchData(url, compressionType) {
|
||||
return fetchData(url, /* asTypedArray = */ this.isCompressed).then(data => {
|
||||
return { cMapData: data, compressionType };
|
||||
|
@ -99,12 +105,18 @@ class DOMCMapReaderFactory extends BaseCMapReaderFactory {
|
|||
}
|
||||
|
||||
class DOMStandardFontDataFactory extends BaseStandardFontDataFactory {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
_fetchData(url) {
|
||||
return fetchData(url, /* asTypedArray = */ true);
|
||||
}
|
||||
}
|
||||
|
||||
class DOMSVGFactory extends BaseSVGFactory {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
_createSVG(type) {
|
||||
return document.createElementNS(SVG_NS, type);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue