Merge pull request #11465 from Snuffleupagus/import-file-extension

Ensure that all `import` and `require` statements, in the entire code-base, have a `.js` file extension
This commit is contained in:
Tim van der Meij 2020-01-06 23:24:43 +01:00 committed by GitHub
commit 93aa613db7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
125 changed files with 453 additions and 443 deletions

View File

@ -27,13 +27,13 @@ import {
stringToPDFString, stringToPDFString,
Util, Util,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { Catalog, FileSpec, ObjectLoader } from "./obj"; import { Catalog, FileSpec, ObjectLoader } from "./obj.js";
import { Dict, isDict, isName, isRef, isStream } from "./primitives"; import { Dict, isDict, isName, isRef, isStream } from "./primitives.js";
import { ColorSpace } from "./colorspace"; import { ColorSpace } from "./colorspace.js";
import { getInheritableProperty } from "./core_utils"; import { getInheritableProperty } from "./core_utils.js";
import { OperatorList } from "./operator_list"; import { OperatorList } from "./operator_list.js";
import { Stream } from "./stream"; import { Stream } from "./stream.js";
class AnnotationFactory { class AnnotationFactory {
/** /**

View File

@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { warn } from "../shared/util"; import { warn } from "../shared/util.js";
// Character types for symbols from 0000 to 00FF. // Character types for symbols from 0000 to 00FF.
// Source: ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt // Source: ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt

View File

@ -25,7 +25,7 @@
* or -1 when EOF is reached. * or -1 when EOF is reached.
*/ */
import { info } from "../shared/util"; import { info } from "../shared/util.js";
let CCITTFaxDecoder = (function CCITTFaxDecoder() { let CCITTFaxDecoder = (function CCITTFaxDecoder() {
const ccittEOL = -2; const ccittEOL = -2;

View File

@ -13,9 +13,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { Dict, isDict } from "./primitives"; import { Dict, isDict } from "./primitives.js";
import { CCITTFaxDecoder } from "./ccitt"; import { CCITTFaxDecoder } from "./ccitt.js";
import { DecodeStream } from "./stream"; import { DecodeStream } from "./stream.js";
var CCITTFaxStream = (function CCITTFaxStreamClosure() { var CCITTFaxStream = (function CCITTFaxStreamClosure() {
function CCITTFaxStream(str, maybeLength, params) { function CCITTFaxStream(str, maybeLength, params) {

View File

@ -20,13 +20,13 @@ import {
stringToBytes, stringToBytes,
Util, Util,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { import {
ExpertCharset, ExpertCharset,
ExpertSubsetCharset, ExpertSubsetCharset,
ISOAdobeCharset, ISOAdobeCharset,
} from "./charsets"; } from "./charsets.js";
import { ExpertEncoding, StandardEncoding } from "./encodings"; import { ExpertEncoding, StandardEncoding } from "./encodings.js";
// Maximum subroutine call depth of type 2 chartrings. Matches OTS. // Maximum subroutine call depth of type 2 chartrings. Matches OTS.
var MAX_SUBR_NESTING = 10; var MAX_SUBR_NESTING = 10;

View File

@ -19,8 +19,8 @@ import {
arraysToBytes, arraysToBytes,
createPromiseCapability, createPromiseCapability,
isEmptyObj, isEmptyObj,
} from "../shared/util"; } from "../shared/util.js";
import { MissingDataException } from "./core_utils"; import { MissingDataException } from "./core_utils.js";
class ChunkedStream { class ChunkedStream {
constructor(length, chunkSize, manager) { constructor(length, chunkSize, manager) {

View File

@ -19,11 +19,11 @@ import {
isString, isString,
unreachable, unreachable,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { isCmd, isEOF, isName, isStream } from "./primitives"; import { isCmd, isEOF, isName, isStream } from "./primitives.js";
import { Lexer } from "./parser"; import { Lexer } from "./parser.js";
import { MissingDataException } from "./core_utils"; import { MissingDataException } from "./core_utils.js";
import { Stream } from "./stream"; import { Stream } from "./stream.js";
var BUILT_IN_CMAPS = [ var BUILT_IN_CMAPS = [
// << Start unicode maps. // << Start unicode maps.

View File

@ -21,8 +21,8 @@ import {
shadow, shadow,
unreachable, unreachable,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { isDict, isName, isStream } from "./primitives"; import { isDict, isName, isStream } from "./primitives.js";
/** /**
* Resizes an RGB image with 3 components. * Resizes an RGB image with 3 components.

View File

@ -14,7 +14,7 @@
*/ */
/* eslint no-var: error */ /* eslint no-var: error */
import { assert, BaseException, warn } from "../shared/util"; import { assert, BaseException, warn } from "../shared/util.js";
function getLookupTableFactory(initializer) { function getLookupTableFactory(initializer) {
let lookup; let lookup;

View File

@ -22,9 +22,9 @@ import {
unreachable, unreachable,
utf8StringToString, utf8StringToString,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { isDict, isName, Name } from "./primitives"; import { isDict, isName, Name } from "./primitives.js";
import { DecryptStream } from "./stream"; import { DecryptStream } from "./stream.js";
var ARCFourCipher = (function ARCFourCipherClosure() { var ARCFourCipher = (function ARCFourCipherClosure() {
function ARCFourCipher(key) { function ARCFourCipher(key) {

View File

@ -31,22 +31,22 @@ import {
stringToPDFString, stringToPDFString,
Util, Util,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { Catalog, ObjectLoader, XRef } from "./obj"; import { Catalog, ObjectLoader, XRef } from "./obj.js";
import { Dict, isDict, isName, isStream, Ref } from "./primitives"; import { Dict, isDict, isName, isStream, Ref } from "./primitives.js";
import { import {
getInheritableProperty, getInheritableProperty,
MissingDataException, MissingDataException,
XRefEntryException, XRefEntryException,
XRefParseException, XRefParseException,
} from "./core_utils"; } from "./core_utils.js";
import { NullStream, Stream, StreamsSequenceStream } from "./stream"; import { NullStream, Stream, StreamsSequenceStream } from "./stream.js";
import { AnnotationFactory } from "./annotation"; import { AnnotationFactory } from "./annotation.js";
import { calculateMD5 } from "./crypto"; import { calculateMD5 } from "./crypto.js";
import { Linearization } from "./parser"; import { Linearization } from "./parser.js";
import { OperatorList } from "./operator_list"; import { OperatorList } from "./operator_list.js";
import { PartialEvaluator } from "./evaluator"; import { PartialEvaluator } from "./evaluator.js";
import { PDFFunctionFactory } from "./function"; import { PDFFunctionFactory } from "./function.js";
const DEFAULT_USER_UNIT = 1.0; const DEFAULT_USER_UNIT = 1.0;
const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792];

View File

@ -32,8 +32,8 @@ import {
UNSUPPORTED_FEATURES, UNSUPPORTED_FEATURES,
Util, Util,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { CMapFactory, IdentityCMap } from "./cmap"; import { CMapFactory, IdentityCMap } from "./cmap.js";
import { import {
Cmd, Cmd,
Dict, Dict,
@ -44,7 +44,7 @@ import {
isStream, isStream,
Name, Name,
Ref, Ref,
} from "./primitives"; } from "./primitives.js";
import { import {
ErrorFont, ErrorFont,
Font, Font,
@ -52,7 +52,7 @@ import {
getFontType, getFontType,
IdentityToUnicodeMap, IdentityToUnicodeMap,
ToUnicodeMap, ToUnicodeMap,
} from "./fonts"; } from "./fonts.js";
import { import {
getEncoding, getEncoding,
MacRomanEncoding, MacRomanEncoding,
@ -60,31 +60,31 @@ import {
SymbolSetEncoding, SymbolSetEncoding,
WinAnsiEncoding, WinAnsiEncoding,
ZapfDingbatsEncoding, ZapfDingbatsEncoding,
} from "./encodings"; } from "./encodings.js";
import { import {
getNormalizedUnicodes, getNormalizedUnicodes,
getUnicodeForGlyph, getUnicodeForGlyph,
reverseIfRtl, reverseIfRtl,
} from "./unicode"; } from "./unicode.js";
import { import {
getSerifFonts, getSerifFonts,
getStdFontMap, getStdFontMap,
getSymbolsFonts, getSymbolsFonts,
} from "./standard_fonts"; } from "./standard_fonts.js";
import { getTilingPatternIR, Pattern } from "./pattern"; import { getTilingPatternIR, Pattern } from "./pattern.js";
import { Lexer, Parser } from "./parser"; import { Lexer, Parser } from "./parser.js";
import { bidi } from "./bidi"; import { bidi } from "./bidi.js";
import { ColorSpace } from "./colorspace"; import { ColorSpace } from "./colorspace.js";
import { DecodeStream } from "./stream"; import { DecodeStream } from "./stream.js";
import { getGlyphsUnicode } from "./glyphlist"; import { getGlyphsUnicode } from "./glyphlist.js";
import { getLookupTableFactory } from "./core_utils"; import { getLookupTableFactory } from "./core_utils.js";
import { getMetrics } from "./metrics"; import { getMetrics } from "./metrics.js";
import { isPDFFunction } from "./function"; import { isPDFFunction } from "./function.js";
import { JpegStream } from "./jpeg_stream"; import { JpegStream } from "./jpeg_stream.js";
import { MurmurHash3_64 } from "./murmurhash3"; import { MurmurHash3_64 } from "./murmurhash3.js";
import { NativeImageDecoder } from "./image_utils"; import { NativeImageDecoder } from "./image_utils.js";
import { OperatorList } from "./operator_list"; import { OperatorList } from "./operator_list.js";
import { PDFImage } from "./image"; import { PDFImage } from "./image.js";
var PartialEvaluator = (function PartialEvaluatorClosure() { var PartialEvaluator = (function PartialEvaluatorClosure() {
const DefaultPartialEvaluatorOptions = { const DefaultPartialEvaluatorOptions = {

View File

@ -19,11 +19,11 @@ import {
FormatError, FormatError,
unreachable, unreachable,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { CFFParser } from "./cff_parser"; import { CFFParser } from "./cff_parser.js";
import { getGlyphsUnicode } from "./glyphlist"; import { getGlyphsUnicode } from "./glyphlist.js";
import { StandardEncoding } from "./encodings"; import { StandardEncoding } from "./encodings.js";
import { Stream } from "./stream"; import { Stream } from "./stream.js";
var FontRendererFactory = (function FontRendererFactoryClosure() { var FontRendererFactory = (function FontRendererFactoryClosure() {
function getLong(data, offset) { function getLong(data, offset) {

View File

@ -27,7 +27,7 @@ import {
string32, string32,
unreachable, unreachable,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { import {
CFF, CFF,
CFFCharset, CFFCharset,
@ -39,32 +39,32 @@ import {
CFFStandardStrings, CFFStandardStrings,
CFFStrings, CFFStrings,
CFFTopDict, CFFTopDict,
} from "./cff_parser"; } from "./cff_parser.js";
import { getDingbatsGlyphsUnicode, getGlyphsUnicode } from "./glyphlist"; import { getDingbatsGlyphsUnicode, getGlyphsUnicode } from "./glyphlist.js";
import { import {
getEncoding, getEncoding,
MacRomanEncoding, MacRomanEncoding,
StandardEncoding, StandardEncoding,
SymbolSetEncoding, SymbolSetEncoding,
ZapfDingbatsEncoding, ZapfDingbatsEncoding,
} from "./encodings"; } from "./encodings.js";
import { import {
getGlyphMapForStandardFonts, getGlyphMapForStandardFonts,
getNonStdFontMap, getNonStdFontMap,
getStdFontMap, getStdFontMap,
getSupplementalGlyphMapForArialBlack, getSupplementalGlyphMapForArialBlack,
getSupplementalGlyphMapForCalibri, getSupplementalGlyphMapForCalibri,
} from "./standard_fonts"; } from "./standard_fonts.js";
import { import {
getUnicodeForGlyph, getUnicodeForGlyph,
getUnicodeRangeFor, getUnicodeRangeFor,
mapSpecialUnicodeValues, mapSpecialUnicodeValues,
} from "./unicode"; } from "./unicode.js";
import { FontRendererFactory } from "./font_renderer"; import { FontRendererFactory } from "./font_renderer.js";
import { IdentityCMap } from "./cmap"; import { IdentityCMap } from "./cmap.js";
import { MissingDataException } from "./core_utils"; import { MissingDataException } from "./core_utils.js";
import { Stream } from "./stream"; import { Stream } from "./stream.js";
import { Type1Parser } from "./type1_parser"; import { Type1Parser } from "./type1_parser.js";
// Unicode Private Use Areas: // Unicode Private Use Areas:
const PRIVATE_USE_AREAS = [ const PRIVATE_USE_AREAS = [

View File

@ -20,9 +20,9 @@ import {
isEvalSupported, isEvalSupported,
shadow, shadow,
unreachable, unreachable,
} from "../shared/util"; } from "../shared/util.js";
import { isDict, isStream } from "./primitives"; import { isDict, isStream } from "./primitives.js";
import { PostScriptLexer, PostScriptParser } from "./ps_parser"; import { PostScriptLexer, PostScriptParser } from "./ps_parser.js";
let IsEvalSupportedCached = { let IsEvalSupportedCached = {
get value() { get value() {

View File

@ -14,7 +14,7 @@
*/ */
/* no-babel-preset */ /* no-babel-preset */
var getLookupTableFactory = require("./core_utils").getLookupTableFactory; var getLookupTableFactory = require("./core_utils.js").getLookupTableFactory;
var getGlyphsUnicode = getLookupTableFactory(function(t) { var getGlyphsUnicode = getLookupTableFactory(function(t) {
t["A"] = 0x0041; t["A"] = 0x0041;

View File

@ -13,12 +13,12 @@
* limitations under the License. * limitations under the License.
*/ */
import { assert, FormatError, ImageKind, info, warn } from "../shared/util"; import { assert, FormatError, ImageKind, info, warn } from "../shared/util.js";
import { isName, isStream, Name } from "./primitives"; import { isName, isStream, Name } from "./primitives.js";
import { ColorSpace } from "./colorspace"; import { ColorSpace } from "./colorspace.js";
import { DecodeStream } from "./stream"; import { DecodeStream } from "./stream.js";
import { JpegStream } from "./jpeg_stream"; import { JpegStream } from "./jpeg_stream.js";
import { JpxImage } from "./jpx"; import { JpxImage } from "./jpx.js";
var PDFImage = (function PDFImageClosure() { var PDFImage = (function PDFImageClosure() {
/** /**

View File

@ -14,9 +14,9 @@
*/ */
/* eslint no-var: error */ /* eslint no-var: error */
import { ColorSpace } from "./colorspace"; import { ColorSpace } from "./colorspace.js";
import { JpegStream } from "./jpeg_stream"; import { JpegStream } from "./jpeg_stream.js";
import { Stream } from "./stream"; import { Stream } from "./stream.js";
class NativeImageDecoder { class NativeImageDecoder {
constructor({ constructor({

View File

@ -20,9 +20,9 @@ import {
readUint16, readUint16,
readUint32, readUint32,
shadow, shadow,
} from "../shared/util"; } from "../shared/util.js";
import { ArithmeticDecoder } from "./arithmetic_decoder"; import { ArithmeticDecoder } from "./arithmetic_decoder.js";
import { CCITTFaxDecoder } from "./ccitt"; import { CCITTFaxDecoder } from "./ccitt.js";
class Jbig2Error extends BaseException { class Jbig2Error extends BaseException {
constructor(msg) { constructor(msg) {

View File

@ -13,10 +13,10 @@
* limitations under the License. * limitations under the License.
*/ */
import { isDict, isStream } from "./primitives"; import { isDict, isStream } from "./primitives.js";
import { DecodeStream } from "./stream"; import { DecodeStream } from "./stream.js";
import { Jbig2Image } from "./jbig2"; import { Jbig2Image } from "./jbig2.js";
import { shadow } from "../shared/util"; import { shadow } from "../shared/util.js";
/** /**
* For JBIG2's we use a library to decode these images and * For JBIG2's we use a library to decode these images and

View File

@ -13,10 +13,10 @@
* limitations under the License. * limitations under the License.
*/ */
import { createObjectURL, shadow } from "../shared/util"; import { createObjectURL, shadow } from "../shared/util.js";
import { DecodeStream } from "./stream"; import { DecodeStream } from "./stream.js";
import { isDict } from "./primitives"; import { isDict } from "./primitives.js";
import { JpegImage } from "./jpg"; import { JpegImage } from "./jpg.js";
/** /**
* Depending on the type of JPEG a JpegStream is handled in different ways. For * Depending on the type of JPEG a JpegStream is handled in different ways. For

View File

@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { assert, BaseException, warn } from "../shared/util"; import { assert, BaseException, warn } from "../shared/util.js";
class JpegError extends BaseException { class JpegError extends BaseException {
constructor(msg) { constructor(msg) {

View File

@ -20,8 +20,8 @@ import {
readUint16, readUint16,
readUint32, readUint32,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { ArithmeticDecoder } from "./arithmetic_decoder"; import { ArithmeticDecoder } from "./arithmetic_decoder.js";
class JpxError extends BaseException { class JpxError extends BaseException {
constructor(msg) { constructor(msg) {

View File

@ -13,9 +13,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { DecodeStream } from "./stream"; import { DecodeStream } from "./stream.js";
import { JpxImage } from "./jpx"; import { JpxImage } from "./jpx.js";
import { shadow } from "../shared/util"; import { shadow } from "../shared/util.js";
/** /**
* For JPEG 2000's we use a library to decode these images and * For JPEG 2000's we use a library to decode these images and

View File

@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { getLookupTableFactory } from "./core_utils"; import { getLookupTableFactory } from "./core_utils.js";
// The Metrics object contains glyph widths (in glyph space units). // The Metrics object contains glyph widths (in glyph space units).
// As per PDF spec, for most fonts (Type 3 being an exception) a glyph // As per PDF spec, for most fonts (Type 3 being an exception) a glyph

View File

@ -18,7 +18,7 @@
*/ */
/* eslint no-var: error */ /* eslint no-var: error */
import { isArrayBuffer, isString } from "../shared/util"; import { isArrayBuffer, isString } from "../shared/util.js";
const SEED = 0xc3d2e1f0; const SEED = 0xc3d2e1f0;
// Workaround for missing math precision in JS. // Workaround for missing math precision in JS.

View File

@ -30,7 +30,7 @@ import {
stringToUTF8String, stringToUTF8String,
unreachable, unreachable,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { import {
clearPrimitiveCaches, clearPrimitiveCaches,
Cmd, Cmd,
@ -44,16 +44,16 @@ import {
Ref, Ref,
RefSet, RefSet,
RefSetCache, RefSetCache,
} from "./primitives"; } from "./primitives.js";
import { Lexer, Parser } from "./parser"; import { Lexer, Parser } from "./parser.js";
import { import {
MissingDataException, MissingDataException,
toRomanNumerals, toRomanNumerals,
XRefEntryException, XRefEntryException,
XRefParseException, XRefParseException,
} from "./core_utils"; } from "./core_utils.js";
import { CipherTransformFactory } from "./crypto"; import { CipherTransformFactory } from "./crypto.js";
import { ColorSpace } from "./colorspace"; import { ColorSpace } from "./colorspace.js";
function fetchDestination(dest) { function fetchDestination(dest) {
return isDict(dest) ? dest.get("D") : dest; return isDict(dest) ? dest.get("D") : dest;

View File

@ -14,7 +14,7 @@
*/ */
/* eslint-disable no-unsanitized/method */ /* eslint-disable no-unsanitized/method */
import { assert, ImageKind, OPS } from "../shared/util"; import { assert, ImageKind, OPS } from "../shared/util.js";
var QueueOptimizer = (function QueueOptimizerClosure() { var QueueOptimizer = (function QueueOptimizerClosure() {
function addState(parentState, pattern, checkFn, iterateFn, processFn) { function addState(parentState, pattern, checkFn, iterateFn, processFn) {

View File

@ -22,7 +22,7 @@ import {
NullStream, NullStream,
PredictorStream, PredictorStream,
RunLengthStream, RunLengthStream,
} from "./stream"; } from "./stream.js";
import { import {
assert, assert,
bytesToString, bytesToString,
@ -32,7 +32,7 @@ import {
isSpace, isSpace,
StreamType, StreamType,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { import {
Cmd, Cmd,
Dict, Dict,
@ -43,12 +43,12 @@ import {
isName, isName,
Name, Name,
Ref, Ref,
} from "./primitives"; } from "./primitives.js";
import { CCITTFaxStream } from "./ccitt_stream"; import { CCITTFaxStream } from "./ccitt_stream.js";
import { Jbig2Stream } from "./jbig2_stream"; import { Jbig2Stream } from "./jbig2_stream.js";
import { JpegStream } from "./jpeg_stream"; import { JpegStream } from "./jpeg_stream.js";
import { JpxStream } from "./jpx_stream"; import { JpxStream } from "./jpx_stream.js";
import { MissingDataException } from "./core_utils"; import { MissingDataException } from "./core_utils.js";
const MAX_LENGTH_TO_CACHE = 1000; const MAX_LENGTH_TO_CACHE = 1000;
const MAX_ADLER32_LENGTH = 5552; const MAX_ADLER32_LENGTH = 5552;

View File

@ -21,10 +21,10 @@ import {
UNSUPPORTED_FEATURES, UNSUPPORTED_FEATURES,
Util, Util,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { ColorSpace } from "./colorspace"; import { ColorSpace } from "./colorspace.js";
import { isStream } from "./primitives"; import { isStream } from "./primitives.js";
import { MissingDataException } from "./core_utils"; import { MissingDataException } from "./core_utils.js";
var ShadingType = { var ShadingType = {
FUNCTION_BASED: 1, FUNCTION_BASED: 1,

View File

@ -18,11 +18,11 @@ import {
shadow, shadow,
unreachable, unreachable,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { ChunkedStreamManager } from "./chunked_stream"; import { ChunkedStreamManager } from "./chunked_stream.js";
import { MissingDataException } from "./core_utils"; import { MissingDataException } from "./core_utils.js";
import { PDFDocument } from "./document"; import { PDFDocument } from "./document.js";
import { Stream } from "./stream"; import { Stream } from "./stream.js";
class BasePdfManager { class BasePdfManager {
constructor() { constructor() {

View File

@ -14,7 +14,7 @@
*/ */
/* uses XRef */ /* uses XRef */
import { assert } from "../shared/util"; import { assert } from "../shared/util.js";
var EOF = {}; var EOF = {};

View File

@ -14,8 +14,8 @@
*/ */
/* eslint no-var: error */ /* eslint no-var: error */
import { FormatError, isSpace, shadow } from "../shared/util"; import { FormatError, isSpace, shadow } from "../shared/util.js";
import { EOF } from "./primitives"; import { EOF } from "./primitives.js";
class PostScriptParser { class PostScriptParser {
constructor(lexer) { constructor(lexer) {

View File

@ -14,7 +14,7 @@
*/ */
/* eslint no-var: error */ /* eslint no-var: error */
import { getLookupTableFactory } from "./core_utils"; import { getLookupTableFactory } from "./core_utils.js";
/** /**
* Hold a map of decoded fonts and of the standard fourteen Type1 * Hold a map of decoded fonts and of the standard fourteen Type1

View File

@ -24,8 +24,8 @@ import {
isSpace, isSpace,
stringToBytes, stringToBytes,
unreachable, unreachable,
} from "../shared/util"; } from "../shared/util.js";
import { isDict } from "./primitives"; import { isDict } from "./primitives.js";
var Stream = (function StreamClosure() { var Stream = (function StreamClosure() {
function Stream(arrayBuffer, start, length, dict) { function Stream(arrayBuffer, start, length, dict) {

View File

@ -13,9 +13,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { isSpace, warn } from "../shared/util"; import { isSpace, warn } from "../shared/util.js";
import { getEncoding } from "./encodings"; import { getEncoding } from "./encodings.js";
import { Stream } from "./stream"; import { Stream } from "./stream.js";
// Hinting is currently disabled due to unknown problems on windows // Hinting is currently disabled due to unknown problems on windows
// in tracemonkey and various other pdfs with type1 fonts. // in tracemonkey and various other pdfs with type1 fonts.

View File

@ -14,7 +14,7 @@
*/ */
/* no-babel-preset */ /* no-babel-preset */
var getLookupTableFactory = require("./core_utils").getLookupTableFactory; var getLookupTableFactory = require("./core_utils.js").getLookupTableFactory;
// Some characters, e.g. copyrightserif, are mapped to the private use area // Some characters, e.g. copyrightserif, are mapped to the private use area
// and might not be displayed using standard fonts. Mapping/hacking well-known // and might not be displayed using standard fonts. Mapping/hacking well-known

View File

@ -29,13 +29,13 @@ import {
UNSUPPORTED_FEATURES, UNSUPPORTED_FEATURES,
VerbosityLevel, VerbosityLevel,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { clearPrimitiveCaches, Ref } from "./primitives"; import { clearPrimitiveCaches, Ref } from "./primitives.js";
import { LocalPdfManager, NetworkPdfManager } from "./pdf_manager"; import { LocalPdfManager, NetworkPdfManager } from "./pdf_manager.js";
import { isNodeJS } from "../shared/is_node"; import { isNodeJS } from "../shared/is_node.js";
import { MessageHandler } from "../shared/message_handler"; import { MessageHandler } from "../shared/message_handler.js";
import { PDFWorkerStream } from "./worker_stream"; import { PDFWorkerStream } from "./worker_stream.js";
import { XRefParseException } from "./core_utils"; import { XRefParseException } from "./core_utils.js";
var WorkerTask = (function WorkerTaskClosure() { var WorkerTask = (function WorkerTaskClosure() {
function WorkerTask(name) { function WorkerTask(name) {

View File

@ -14,7 +14,7 @@
*/ */
/* eslint no-var: error */ /* eslint no-var: error */
import { assert } from "../shared/util"; import { assert } from "../shared/util.js";
/** @implements {IPDFStream} */ /** @implements {IPDFStream} */
class PDFWorkerStream { class PDFWorkerStream {

View File

@ -20,7 +20,7 @@ import {
getFilenameFromUrl, getFilenameFromUrl,
LinkTarget, LinkTarget,
PDFDateString, PDFDateString,
} from "./display_utils"; } from "./display_utils.js";
import { import {
AnnotationBorderStyleType, AnnotationBorderStyleType,
AnnotationType, AnnotationType,
@ -28,7 +28,7 @@ import {
unreachable, unreachable,
Util, Util,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
/** /**
* @typedef {Object} AnnotationElementParameters * @typedef {Object} AnnotationElementParameters

View File

@ -37,7 +37,7 @@ import {
UnknownErrorException, UnknownErrorException,
unreachable, unreachable,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { import {
deprecated, deprecated,
DOMCanvasFactory, DOMCanvasFactory,
@ -47,16 +47,16 @@ import {
releaseImageResources, releaseImageResources,
RenderingCancelledException, RenderingCancelledException,
StatTimer, StatTimer,
} from "./display_utils"; } from "./display_utils.js";
import { FontFaceObject, FontLoader } from "./font_loader"; import { FontFaceObject, FontLoader } from "./font_loader.js";
import { apiCompatibilityParams } from "./api_compatibility"; import { apiCompatibilityParams } from "./api_compatibility.js";
import { CanvasGraphics } from "./canvas"; import { CanvasGraphics } from "./canvas.js";
import { GlobalWorkerOptions } from "./worker_options"; import { GlobalWorkerOptions } from "./worker_options.js";
import { isNodeJS } from "../shared/is_node"; import { isNodeJS } from "../shared/is_node.js";
import { MessageHandler } from "../shared/message_handler"; import { MessageHandler } from "../shared/message_handler.js";
import { Metadata } from "./metadata"; import { Metadata } from "./metadata.js";
import { PDFDataTransportStream } from "./transport_stream"; import { PDFDataTransportStream } from "./transport_stream.js";
import { WebGLContext } from "./webgl"; import { WebGLContext } from "./webgl.js";
const DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536 const DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536
const RENDERING_CANCELLED_TIMEOUT = 100; // ms const RENDERING_CANCELLED_TIMEOUT = 100; // ms
@ -1635,7 +1635,7 @@ const PDFWorker = (function PDFWorkerClosure() {
if (typeof SystemJS !== "object") { if (typeof SystemJS !== "object") {
throw new Error("SystemJS must be used to load fake worker."); throw new Error("SystemJS must be used to load fake worker.");
} }
const worker = await SystemJS.import("pdfjs/core/worker"); const worker = await SystemJS.import("pdfjs/core/worker.js");
return worker.WorkerMessageHandler; return worker.WorkerMessageHandler;
} }
if ( if (

View File

@ -15,7 +15,7 @@
let compatibilityParams = Object.create(null); let compatibilityParams = Object.create(null);
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
const { isNodeJS } = require("../shared/is_node"); const { isNodeJS } = require("../shared/is_node.js");
const userAgent = const userAgent =
(typeof navigator !== "undefined" && navigator.userAgent) || ""; (typeof navigator !== "undefined" && navigator.userAgent) || "";

View File

@ -26,8 +26,8 @@ import {
unreachable, unreachable,
Util, Util,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { getShadingPatternFromIR, TilingPattern } from "./pattern_helper"; import { getShadingPatternFromIR, TilingPattern } from "./pattern_helper.js";
// <canvas> contexts store most of the state we need natively. // <canvas> contexts store most of the state we need natively.
// However, PDF needs a bit more state, which we store here. // However, PDF needs a bit more state, which we store here.

View File

@ -23,7 +23,7 @@ import {
stringToBytes, stringToBytes,
Util, Util,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
const DEFAULT_LINK_REL = "noopener noreferrer nofollow"; const DEFAULT_LINK_REL = "noopener noreferrer nofollow";
const SVG_NS = "http://www.w3.org/2000/svg"; const SVG_NS = "http://www.w3.org/2000/svg";

View File

@ -18,13 +18,13 @@ import {
AbortException, AbortException,
assert, assert,
createPromiseCapability, createPromiseCapability,
} from "../shared/util"; } from "../shared/util.js";
import { import {
createResponseStatusError, createResponseStatusError,
extractFilenameFromHeader, extractFilenameFromHeader,
validateRangeRequestCapabilities, validateRangeRequestCapabilities,
validateResponseStatus, validateResponseStatus,
} from "./network_utils"; } from "./network_utils.js";
function createFetchOptions(headers, withCredentials, abortController) { function createFetchOptions(headers, withCredentials, abortController) {
return { return {

View File

@ -22,7 +22,7 @@ import {
unreachable, unreachable,
UNSUPPORTED_FEATURES, UNSUPPORTED_FEATURES,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
class BaseFontLoader { class BaseFontLoader {
constructor({ docId, onUnsupportedFeature }) { constructor({ docId, onUnsupportedFeature }) {

View File

@ -13,8 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { assert } from "../shared/util"; import { assert } from "../shared/util.js";
import { SimpleXMLParser } from "./xml_parser"; import { SimpleXMLParser } from "./xml_parser.js";
class Metadata { class Metadata {
constructor(data) { constructor(data) {

View File

@ -14,12 +14,16 @@
*/ */
/* eslint no-var: error */ /* eslint no-var: error */
import { assert, createPromiseCapability, stringToBytes } from "../shared/util"; import {
assert,
createPromiseCapability,
stringToBytes,
} from "../shared/util.js";
import { import {
createResponseStatusError, createResponseStatusError,
extractFilenameFromHeader, extractFilenameFromHeader,
validateRangeRequestCapabilities, validateRangeRequestCapabilities,
} from "./network_utils"; } from "./network_utils.js";
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("FIREFOX || MOZCENTRAL")) { if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("FIREFOX || MOZCENTRAL")) {
throw new Error( throw new Error(

View File

@ -17,8 +17,8 @@ import {
assert, assert,
MissingPDFException, MissingPDFException,
UnexpectedResponseException, UnexpectedResponseException,
} from "../shared/util"; } from "../shared/util.js";
import { getFilenameFromContentDispositionHeader } from "./content_disposition"; import { getFilenameFromContentDispositionHeader } from "./content_disposition.js";
function validateRangeRequestCapabilities({ function validateRangeRequestCapabilities({
getResponseHeader, getResponseHeader,

View File

@ -24,11 +24,11 @@ import {
assert, assert,
createPromiseCapability, createPromiseCapability,
MissingPDFException, MissingPDFException,
} from "../shared/util"; } from "../shared/util.js";
import { import {
extractFilenameFromHeader, extractFilenameFromHeader,
validateRangeRequestCapabilities, validateRangeRequestCapabilities,
} from "./network_utils"; } from "./network_utils.js";
const fileUriRegex = /^file:\/\/\/[a-zA-Z]:\//; const fileUriRegex = /^file:\/\/\/[a-zA-Z]:\//;

View File

@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { FormatError, info, Util } from "../shared/util"; import { FormatError, info, Util } from "../shared/util.js";
var ShadingIRs = {}; var ShadingIRs = {};

View File

@ -25,9 +25,9 @@ import {
TextRenderingMode, TextRenderingMode,
Util, Util,
warn, warn,
} from "../shared/util"; } from "../shared/util.js";
import { DOMSVGFactory } from "./display_utils"; import { DOMSVGFactory } from "./display_utils.js";
import { isNodeJS } from "../shared/is_node"; import { isNodeJS } from "../shared/is_node.js";
let SVGGraphics = function() { let SVGGraphics = function() {
throw new Error("Not implemented: SVGGraphics"); throw new Error("Not implemented: SVGGraphics");

View File

@ -13,7 +13,11 @@
* limitations under the License. * limitations under the License.
*/ */
import { AbortException, createPromiseCapability, Util } from "../shared/util"; import {
AbortException,
createPromiseCapability,
Util,
} from "../shared/util.js";
/** /**
* Text layer render parameters. * Text layer render parameters.

View File

@ -14,7 +14,7 @@
*/ */
/* eslint no-var: error */ /* eslint no-var: error */
import { assert, createPromiseCapability } from "../shared/util"; import { assert, createPromiseCapability } from "../shared/util.js";
/** @implements {IPDFStream} */ /** @implements {IPDFStream} */
class PDFDataTransportStream { class PDFDataTransportStream {

View File

@ -14,7 +14,7 @@
*/ */
/* eslint-disable no-multi-str */ /* eslint-disable no-multi-str */
import { shadow } from "../shared/util"; import { shadow } from "../shared/util.js";
class WebGLContext { class WebGLContext {
constructor({ enable = false }) { constructor({ enable = false }) {

View File

@ -12,12 +12,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* eslint-disable no-unused-vars */
import { getVerbosityLevel, setVerbosityLevel } from "./shared/util"; import { getVerbosityLevel, setVerbosityLevel } from "./shared/util.js";
import { Jbig2mage } from "./core/jbig2"; import { Jbig2mage } from "./core/jbig2.js";
import { JpegImage } from "./core/jpg"; import { JpegImage } from "./core/jpg.js";
import { JpxImage } from "./core/jpx"; import { JpxImage } from "./core/jpx.js";
// To ensure that the standalone PDF.js image decoders have the same // To ensure that the standalone PDF.js image decoders have the same
// browser/environment compatibility as the regular PDF.js library, // browser/environment compatibility as the regular PDF.js library,
@ -33,7 +32,9 @@ import { JpxImage } from "./core/jpx";
// - Promise // - Promise
// - URL // - URL
// eslint-disable-next-line no-unused-vars
const pdfjsVersion = PDFJSDev.eval("BUNDLE_VERSION"); const pdfjsVersion = PDFJSDev.eval("BUNDLE_VERSION");
// eslint-disable-next-line no-unused-vars
const pdfjsBuild = PDFJSDev.eval("BUNDLE_BUILD"); const pdfjsBuild = PDFJSDev.eval("BUNDLE_BUILD");
export { Jbig2mage, JpegImage, JpxImage, getVerbosityLevel, setVerbosityLevel }; export { Jbig2mage, JpegImage, JpxImage, getVerbosityLevel, setVerbosityLevel };

View File

@ -27,7 +27,7 @@ if (
} }
globalThis._pdfjsCompatibilityChecked = true; globalThis._pdfjsCompatibilityChecked = true;
const { isNodeJS } = require("./is_node"); const { isNodeJS } = require("./is_node.js");
const hasDOM = typeof window === "object" && typeof document === "object"; const hasDOM = typeof window === "object" && typeof document === "object";
const userAgent = const userAgent =
@ -148,7 +148,7 @@ if (
if (String.prototype.startsWith) { if (String.prototype.startsWith) {
return; return;
} }
require("core-js/es/string/starts-with"); require("core-js/es/string/starts-with.js");
})(); })();
// Provides support for String.prototype.endsWith in legacy browsers. // Provides support for String.prototype.endsWith in legacy browsers.
@ -157,7 +157,7 @@ if (
if (String.prototype.endsWith) { if (String.prototype.endsWith) {
return; return;
} }
require("core-js/es/string/ends-with"); require("core-js/es/string/ends-with.js");
})(); })();
// Provides support for String.prototype.includes in legacy browsers. // Provides support for String.prototype.includes in legacy browsers.
@ -166,7 +166,7 @@ if (
if (String.prototype.includes) { if (String.prototype.includes) {
return; return;
} }
require("core-js/es/string/includes"); require("core-js/es/string/includes.js");
})(); })();
// Provides support for Array.prototype.includes in legacy browsers. // Provides support for Array.prototype.includes in legacy browsers.
@ -175,7 +175,7 @@ if (
if (Array.prototype.includes) { if (Array.prototype.includes) {
return; return;
} }
require("core-js/es/array/includes"); require("core-js/es/array/includes.js");
})(); })();
// Provides support for Array.from in legacy browsers. // Provides support for Array.from in legacy browsers.
@ -184,7 +184,7 @@ if (
if (Array.from) { if (Array.from) {
return; return;
} }
require("core-js/es/array/from"); require("core-js/es/array/from.js");
})(); })();
// Provides support for Object.assign in legacy browsers. // Provides support for Object.assign in legacy browsers.
@ -193,7 +193,7 @@ if (
if (Object.assign) { if (Object.assign) {
return; return;
} }
require("core-js/es/object/assign"); require("core-js/es/object/assign.js");
})(); })();
// Provides support for Math.log2 in legacy browsers. // Provides support for Math.log2 in legacy browsers.
@ -202,7 +202,7 @@ if (
if (Math.log2) { if (Math.log2) {
return; return;
} }
Math.log2 = require("core-js/es/math/log2"); Math.log2 = require("core-js/es/math/log2.js");
})(); })();
// Provides support for Number.isNaN in legacy browsers. // Provides support for Number.isNaN in legacy browsers.
@ -211,7 +211,7 @@ if (
if (Number.isNaN) { if (Number.isNaN) {
return; return;
} }
Number.isNaN = require("core-js/es/number/is-nan"); Number.isNaN = require("core-js/es/number/is-nan.js");
})(); })();
// Provides support for Number.isInteger in legacy browsers. // Provides support for Number.isInteger in legacy browsers.
@ -220,7 +220,7 @@ if (
if (Number.isInteger) { if (Number.isInteger) {
return; return;
} }
Number.isInteger = require("core-js/es/number/is-integer"); Number.isInteger = require("core-js/es/number/is-integer.js");
})(); })();
// Support: IE, Safari<11, Chrome<63 // Support: IE, Safari<11, Chrome<63
@ -237,7 +237,7 @@ if (
) { ) {
return; return;
} }
globalThis.Promise = require("core-js/es/promise/index"); globalThis.Promise = require("core-js/es/promise/index.js");
})(); })();
// Support: IE // Support: IE
@ -252,7 +252,7 @@ if (
// builds. // builds.
return; return;
} }
globalThis.URL = require("core-js/web/url"); globalThis.URL = require("core-js/web/url.js");
})(); })();
// Support: IE, Node.js // Support: IE, Node.js
@ -281,7 +281,7 @@ if (
if (isReadableStreamSupported) { if (isReadableStreamSupported) {
return; return;
} }
globalThis.ReadableStream = require("web-streams-polyfill/dist/ponyfill").ReadableStream; globalThis.ReadableStream = require("web-streams-polyfill/dist/ponyfill.js").ReadableStream;
})(); })();
// Support: IE<11, Safari<8, Chrome<36 // Support: IE<11, Safari<8, Chrome<36
@ -289,7 +289,7 @@ if (
if (globalThis.WeakMap) { if (globalThis.WeakMap) {
return; return;
} }
globalThis.WeakMap = require("core-js/es/weak-map/index"); globalThis.WeakMap = require("core-js/es/weak-map/index.js");
})(); })();
// Support: IE11 // Support: IE11
@ -297,7 +297,7 @@ if (
if (globalThis.WeakSet) { if (globalThis.WeakSet) {
return; return;
} }
globalThis.WeakSet = require("core-js/es/weak-set/index"); globalThis.WeakSet = require("core-js/es/weak-set/index.js");
})(); })();
// Provides support for String.codePointAt in legacy browsers. // Provides support for String.codePointAt in legacy browsers.
@ -306,7 +306,7 @@ if (
if (String.prototype.codePointAt) { if (String.prototype.codePointAt) {
return; return;
} }
require("core-js/es/string/code-point-at"); require("core-js/es/string/code-point-at.js");
})(); })();
// Provides support for String.fromCodePoint in legacy browsers. // Provides support for String.fromCodePoint in legacy browsers.
@ -315,7 +315,7 @@ if (
if (String.fromCodePoint) { if (String.fromCodePoint) {
return; return;
} }
String.fromCodePoint = require("core-js/es/string/from-code-point"); String.fromCodePoint = require("core-js/es/string/from-code-point.js");
})(); })();
// Support: IE // Support: IE
@ -323,7 +323,7 @@ if (
if (globalThis.Symbol) { if (globalThis.Symbol) {
return; return;
} }
require("core-js/es/symbol/index"); require("core-js/es/symbol/index.js");
})(); })();
// Provides support for String.prototype.padStart in legacy browsers. // Provides support for String.prototype.padStart in legacy browsers.
@ -332,7 +332,7 @@ if (
if (String.prototype.padStart) { if (String.prototype.padStart) {
return; return;
} }
require("core-js/es/string/pad-start"); require("core-js/es/string/pad-start.js");
})(); })();
// Provides support for String.prototype.padEnd in legacy browsers. // Provides support for String.prototype.padEnd in legacy browsers.
@ -341,7 +341,7 @@ if (
if (String.prototype.padEnd) { if (String.prototype.padEnd) {
return; return;
} }
require("core-js/es/string/pad-end"); require("core-js/es/string/pad-end.js");
})(); })();
// Provides support for Object.values in legacy browsers. // Provides support for Object.values in legacy browsers.
@ -350,6 +350,6 @@ if (
if (Object.values) { if (Object.values) {
return; return;
} }
Object.values = require("core-js/es/object/values"); Object.values = require("core-js/es/object/values.js");
})(); })();
} }

View File

@ -21,7 +21,7 @@ import {
MissingPDFException, MissingPDFException,
UnexpectedResponseException, UnexpectedResponseException,
UnknownErrorException, UnknownErrorException,
} from "./util"; } from "./util.js";
const CallbackKind = { const CallbackKind = {
UNKNOWN: 0, UNKNOWN: 0,

View File

@ -27,6 +27,6 @@ self.importScripts = (function(importScripts) {
importScripts("../node_modules/systemjs/dist/system.js"); importScripts("../node_modules/systemjs/dist/system.js");
importScripts("../systemjs.config.js"); importScripts("../systemjs.config.js");
SystemJS.import("pdfjs/core/worker").then(function() { SystemJS.import("pdfjs/core/worker.js").then(function() {
// Worker is loaded at this point. // Worker is loaded at this point.
}); });

View File

@ -42,10 +42,10 @@
function initializePDFJS(callback) { function initializePDFJS(callback) {
Promise.all([ Promise.all([
SystemJS.import("pdfjs/core/fonts"), SystemJS.import("pdfjs/core/fonts.js"),
SystemJS.import("pdfjs/core/stream"), SystemJS.import("pdfjs/core/stream.js"),
SystemJS.import("pdfjs/core/primitives"), SystemJS.import("pdfjs/core/primitives.js"),
SystemJS.import("pdfjs/core/cmap"), SystemJS.import("pdfjs/core/cmap.js"),
]).then(function(modules) { ]).then(function(modules) {
var fonts = modules[0], var fonts = modules[0],
stream = modules[1], stream = modules[1],

View File

@ -19,7 +19,7 @@ import {
AnnotationFactory, AnnotationFactory,
getQuadPoints, getQuadPoints,
MarkupAnnotation, MarkupAnnotation,
} from "../../src/core/annotation"; } from "../../src/core/annotation.js";
import { import {
AnnotationBorderStyleType, AnnotationBorderStyleType,
AnnotationFieldFlag, AnnotationFieldFlag,
@ -27,11 +27,11 @@ import {
AnnotationType, AnnotationType,
stringToBytes, stringToBytes,
stringToUTF8String, stringToUTF8String,
} from "../../src/shared/util"; } from "../../src/shared/util.js";
import { createIdFactory, XRefMock } from "./test_utils"; import { createIdFactory, XRefMock } from "./test_utils.js";
import { Dict, Name, Ref } from "../../src/core/primitives"; import { Dict, Name, Ref } from "../../src/core/primitives.js";
import { Lexer, Parser } from "../../src/core/parser"; import { Lexer, Parser } from "../../src/core/parser.js";
import { StringStream } from "../../src/core/stream"; import { StringStream } from "../../src/core/stream.js";
describe("annotation", function() { describe("annotation", function() {
class PDFManagerMock { class PDFManagerMock {

View File

@ -19,7 +19,7 @@ import {
NodeCanvasFactory, NodeCanvasFactory,
NodeFileReaderFactory, NodeFileReaderFactory,
TEST_PDFS_PATH, TEST_PDFS_PATH,
} from "./test_utils"; } from "./test_utils.js";
import { import {
createPromiseCapability, createPromiseCapability,
FontType, FontType,
@ -31,23 +31,23 @@ import {
PasswordResponses, PasswordResponses,
PermissionFlag, PermissionFlag,
StreamType, StreamType,
} from "../../src/shared/util"; } from "../../src/shared/util.js";
import { import {
DOMCanvasFactory, DOMCanvasFactory,
RenderingCancelledException, RenderingCancelledException,
StatTimer, StatTimer,
} from "../../src/display/display_utils"; } from "../../src/display/display_utils.js";
import { import {
getDocument, getDocument,
PDFDataRangeTransport, PDFDataRangeTransport,
PDFDocumentProxy, PDFDocumentProxy,
PDFPageProxy, PDFPageProxy,
PDFWorker, PDFWorker,
} from "../../src/display/api"; } from "../../src/display/api.js";
import { AutoPrintRegExp } from "../../web/ui_utils"; import { AutoPrintRegExp } from "../../web/ui_utils.js";
import { GlobalWorkerOptions } from "../../src/display/worker_options"; import { GlobalWorkerOptions } from "../../src/display/worker_options.js";
import { isNodeJS } from "../../src/shared/is_node"; import { isNodeJS } from "../../src/shared/is_node.js";
import { Metadata } from "../../src/display/metadata"; import { Metadata } from "../../src/display/metadata.js";
describe("api", function() { describe("api", function() {
let basicApiFileName = "basicapi.pdf"; let basicApiFileName = "basicapi.pdf";

View File

@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { bidi } from "../../src/core/bidi"; import { bidi } from "../../src/core/bidi.js";
describe("bidi", function() { describe("bidi", function() {
it("should mark text as RTL if more than 30% of text is RTL", function() { it("should mark text as RTL if more than 30% of text is RTL", function() {

View File

@ -19,9 +19,9 @@ import {
CFFFDSelect, CFFFDSelect,
CFFParser, CFFParser,
CFFStrings, CFFStrings,
} from "../../src/core/cff_parser"; } from "../../src/core/cff_parser.js";
import { SEAC_ANALYSIS_ENABLED } from "../../src/core/fonts"; import { SEAC_ANALYSIS_ENABLED } from "../../src/core/fonts.js";
import { Stream } from "../../src/core/stream"; import { Stream } from "../../src/core/stream.js";
describe("CFFParser", function() { describe("CFFParser", function() {
function createWithNullProto(obj) { function createWithNullProto(obj) {

View File

@ -13,10 +13,10 @@
* limitations under the License. * limitations under the License.
*/ */
import { setVerbosityLevel, VerbosityLevel } from "../../src/shared/util"; import { setVerbosityLevel, VerbosityLevel } from "../../src/shared/util.js";
import { isNodeJS } from "../../src/shared/is_node"; import { isNodeJS } from "../../src/shared/is_node.js";
import { PDFNodeStream } from "../../src/display/node_stream"; import { PDFNodeStream } from "../../src/display/node_stream.js";
import { setPDFNetworkStreamFactory } from "../../src/display/api"; import { setPDFNetworkStreamFactory } from "../../src/display/api.js";
// Ensure that this script only runs in Node.js environments. // Ensure that this script only runs in Node.js environments.
if (!isNodeJS) { if (!isNodeJS) {

View File

@ -13,12 +13,12 @@
* limitations under the License. * limitations under the License.
*/ */
import { CMap, CMapFactory, IdentityCMap } from "../../src/core/cmap"; import { CMap, CMapFactory, IdentityCMap } from "../../src/core/cmap.js";
import { DOMCMapReaderFactory } from "../../src/display/display_utils"; import { DOMCMapReaderFactory } from "../../src/display/display_utils.js";
import { isNodeJS } from "../../src/shared/is_node"; import { isNodeJS } from "../../src/shared/is_node.js";
import { Name } from "../../src/core/primitives"; import { Name } from "../../src/core/primitives.js";
import { NodeCMapReaderFactory } from "./test_utils"; import { NodeCMapReaderFactory } from "./test_utils.js";
import { StringStream } from "../../src/core/stream"; import { StringStream } from "../../src/core/stream.js";
var cMapUrl = { var cMapUrl = {
dom: "../../external/bcmaps/", dom: "../../external/bcmaps/",

View File

@ -13,11 +13,11 @@
* limitations under the License. * limitations under the License.
*/ */
import { Dict, Name, Ref } from "../../src/core/primitives"; import { Dict, Name, Ref } from "../../src/core/primitives.js";
import { Stream, StringStream } from "../../src/core/stream"; import { Stream, StringStream } from "../../src/core/stream.js";
import { ColorSpace } from "../../src/core/colorspace"; import { ColorSpace } from "../../src/core/colorspace.js";
import { PDFFunctionFactory } from "../../src/core/function"; import { PDFFunctionFactory } from "../../src/core/function.js";
import { XRefMock } from "./test_utils"; import { XRefMock } from "./test_utils.js";
describe("colorspace", function() { describe("colorspace", function() {
describe("ColorSpace", function() { describe("ColorSpace", function() {

View File

@ -13,12 +13,12 @@
* limitations under the License. * limitations under the License.
*/ */
import { Dict, Ref } from "../../src/core/primitives"; import { Dict, Ref } from "../../src/core/primitives.js";
import { import {
getInheritableProperty, getInheritableProperty,
toRomanNumerals, toRomanNumerals,
} from "../../src/core/core_utils"; } from "../../src/core/core_utils.js";
import { XRefMock } from "./test_utils"; import { XRefMock } from "./test_utils.js";
describe("core_utils", function() { describe("core_utils", function() {
describe("getInheritableProperty", function() { describe("getInheritableProperty", function() {

View File

@ -24,13 +24,13 @@ import {
CipherTransformFactory, CipherTransformFactory,
PDF17, PDF17,
PDF20, PDF20,
} from "../../src/core/crypto"; } from "../../src/core/crypto.js";
import { Dict, Name } from "../../src/core/primitives"; import { Dict, Name } from "../../src/core/primitives.js";
import { import {
PasswordException, PasswordException,
PasswordResponses, PasswordResponses,
stringToBytes, stringToBytes,
} from "../../src/shared/util"; } from "../../src/shared/util.js";
describe("crypto", function() { describe("crypto", function() {
function hex2binary(s) { function hex2binary(s) {

View File

@ -13,10 +13,10 @@
* limitations under the License. * limitations under the License.
*/ */
import { buildGetDocumentParams, NodeCanvasFactory } from "./test_utils"; import { buildGetDocumentParams, NodeCanvasFactory } from "./test_utils.js";
import { DOMCanvasFactory } from "../../src/display/display_utils"; import { DOMCanvasFactory } from "../../src/display/display_utils.js";
import { getDocument } from "../../src/display/api"; import { getDocument } from "../../src/display/api.js";
import { isNodeJS } from "../../src/shared/is_node"; import { isNodeJS } from "../../src/shared/is_node.js";
function getTopLeftPixel(canvasContext) { function getTopLeftPixel(canvasContext) {
let imgData = canvasContext.getImageData(0, 0, 1, 1); let imgData = canvasContext.getImageData(0, 0, 1, 1);

View File

@ -14,12 +14,12 @@
*/ */
/* globals __non_webpack_require__ */ /* globals __non_webpack_require__ */
import { setStubs, unsetStubs } from "../../examples/node/domstubs"; import { setStubs, unsetStubs } from "../../examples/node/domstubs.js";
import { buildGetDocumentParams } from "./test_utils"; import { buildGetDocumentParams } from "./test_utils.js";
import { getDocument } from "../../src/display/api"; import { getDocument } from "../../src/display/api.js";
import { isNodeJS } from "../../src/shared/is_node"; import { isNodeJS } from "../../src/shared/is_node.js";
import { NativeImageDecoding } from "../../src/shared/util"; import { NativeImageDecoding } from "../../src/shared/util.js";
import { SVGGraphics } from "../../src/display/svg"; import { SVGGraphics } from "../../src/display/svg.js";
const XLINK_NS = "http://www.w3.org/1999/xlink"; const XLINK_NS = "http://www.w3.org/1999/xlink";

View File

@ -20,8 +20,8 @@ import {
getFilenameFromUrl, getFilenameFromUrl,
isValidFetchUrl, isValidFetchUrl,
PDFDateString, PDFDateString,
} from "../../src/display/display_utils"; } from "../../src/display/display_utils.js";
import { isNodeJS } from "../../src/shared/is_node"; import { isNodeJS } from "../../src/shared/is_node.js";
describe("display_utils", function() { describe("display_utils", function() {
describe("DOMCanvasFactory", function() { describe("DOMCanvasFactory", function() {

View File

@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { createIdFactory } from "./test_utils"; import { createIdFactory } from "./test_utils.js";
describe("document", function() { describe("document", function() {
describe("Page", function() { describe("Page", function() {

View File

@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { getEncoding } from "../../src/core/encodings"; import { getEncoding } from "../../src/core/encodings.js";
describe("encodings", function() { describe("encodings", function() {
describe("getEncoding", function() { describe("getEncoding", function() {

View File

@ -13,13 +13,13 @@
* limitations under the License. * limitations under the License.
*/ */
import { createIdFactory, XRefMock } from "./test_utils"; import { createIdFactory, XRefMock } from "./test_utils.js";
import { Dict, Name } from "../../src/core/primitives"; import { Dict, Name } from "../../src/core/primitives.js";
import { FormatError, OPS } from "../../src/shared/util"; import { FormatError, OPS } from "../../src/shared/util.js";
import { Stream, StringStream } from "../../src/core/stream"; import { Stream, StringStream } from "../../src/core/stream.js";
import { OperatorList } from "../../src/core/operator_list"; import { OperatorList } from "../../src/core/operator_list.js";
import { PartialEvaluator } from "../../src/core/evaluator"; import { PartialEvaluator } from "../../src/core/evaluator.js";
import { WorkerTask } from "../../src/core/worker"; import { WorkerTask } from "../../src/core/worker.js";
describe("evaluator", function() { describe("evaluator", function() {
function HandlerMock() { function HandlerMock() {

View File

@ -14,8 +14,8 @@
*/ */
/* eslint no-var: error */ /* eslint no-var: error */
import { AbortException } from "../../src/shared/util"; import { AbortException } from "../../src/shared/util.js";
import { PDFFetchStream } from "../../src/display/fetch_stream"; import { PDFFetchStream } from "../../src/display/fetch_stream.js";
describe("fetch_stream", function() { describe("fetch_stream", function() {
const pdfUrl = new URL("../pdfs/tracemonkey.pdf", window.location).href; const pdfUrl = new URL("../pdfs/tracemonkey.pdf", window.location).href;

View File

@ -16,9 +16,9 @@
import { import {
PostScriptCompiler, PostScriptCompiler,
PostScriptEvaluator, PostScriptEvaluator,
} from "../../src/core/function"; } from "../../src/core/function.js";
import { PostScriptLexer, PostScriptParser } from "../../src/core/ps_parser"; import { PostScriptLexer, PostScriptParser } from "../../src/core/ps_parser.js";
import { StringStream } from "../../src/core/stream"; import { StringStream } from "../../src/core/stream.js";
describe("function", function() { describe("function", function() {
beforeEach(function() { beforeEach(function() {

View File

@ -43,42 +43,42 @@
function initializePDFJS(callback) { function initializePDFJS(callback) {
Promise.all( Promise.all(
[ [
"pdfjs/display/api", "pdfjs/display/api.js",
"pdfjs/display/worker_options", "pdfjs/display/worker_options.js",
"pdfjs/display/network", "pdfjs/display/network.js",
"pdfjs/display/fetch_stream", "pdfjs/display/fetch_stream.js",
"pdfjs/shared/is_node", "pdfjs/shared/is_node.js",
"pdfjs-test/unit/annotation_spec", "pdfjs-test/unit/annotation_spec.js",
"pdfjs-test/unit/api_spec", "pdfjs-test/unit/api_spec.js",
"pdfjs-test/unit/bidi_spec", "pdfjs-test/unit/bidi_spec.js",
"pdfjs-test/unit/cff_parser_spec", "pdfjs-test/unit/cff_parser_spec.js",
"pdfjs-test/unit/cmap_spec", "pdfjs-test/unit/cmap_spec.js",
"pdfjs-test/unit/colorspace_spec", "pdfjs-test/unit/colorspace_spec.js",
"pdfjs-test/unit/core_utils_spec", "pdfjs-test/unit/core_utils_spec.js",
"pdfjs-test/unit/crypto_spec", "pdfjs-test/unit/crypto_spec.js",
"pdfjs-test/unit/custom_spec", "pdfjs-test/unit/custom_spec.js",
"pdfjs-test/unit/display_svg_spec", "pdfjs-test/unit/display_svg_spec.js",
"pdfjs-test/unit/display_utils_spec", "pdfjs-test/unit/display_utils_spec.js",
"pdfjs-test/unit/document_spec", "pdfjs-test/unit/document_spec.js",
"pdfjs-test/unit/encodings_spec", "pdfjs-test/unit/encodings_spec.js",
"pdfjs-test/unit/evaluator_spec", "pdfjs-test/unit/evaluator_spec.js",
"pdfjs-test/unit/function_spec", "pdfjs-test/unit/function_spec.js",
"pdfjs-test/unit/fetch_stream_spec", "pdfjs-test/unit/fetch_stream_spec.js",
"pdfjs-test/unit/message_handler_spec", "pdfjs-test/unit/message_handler_spec.js",
"pdfjs-test/unit/metadata_spec", "pdfjs-test/unit/metadata_spec.js",
"pdfjs-test/unit/murmurhash3_spec", "pdfjs-test/unit/murmurhash3_spec.js",
"pdfjs-test/unit/network_spec", "pdfjs-test/unit/network_spec.js",
"pdfjs-test/unit/network_utils_spec", "pdfjs-test/unit/network_utils_spec.js",
"pdfjs-test/unit/parser_spec", "pdfjs-test/unit/parser_spec.js",
"pdfjs-test/unit/pdf_find_controller_spec", "pdfjs-test/unit/pdf_find_controller_spec.js",
"pdfjs-test/unit/pdf_find_utils_spec", "pdfjs-test/unit/pdf_find_utils_spec.js",
"pdfjs-test/unit/pdf_history_spec", "pdfjs-test/unit/pdf_history_spec.js",
"pdfjs-test/unit/primitives_spec", "pdfjs-test/unit/primitives_spec.js",
"pdfjs-test/unit/stream_spec", "pdfjs-test/unit/stream_spec.js",
"pdfjs-test/unit/type1_parser_spec", "pdfjs-test/unit/type1_parser_spec.js",
"pdfjs-test/unit/ui_utils_spec", "pdfjs-test/unit/ui_utils_spec.js",
"pdfjs-test/unit/unicode_spec", "pdfjs-test/unit/unicode_spec.js",
"pdfjs-test/unit/util_spec", "pdfjs-test/unit/util_spec.js",
].map(function(moduleName) { ].map(function(moduleName) {
return SystemJS.import(moduleName); return SystemJS.import(moduleName);
}) })

View File

@ -17,9 +17,9 @@ import {
AbortException, AbortException,
createPromiseCapability, createPromiseCapability,
UnknownErrorException, UnknownErrorException,
} from "../../src/shared/util"; } from "../../src/shared/util.js";
import { LoopbackPort } from "../../src/display/api"; import { LoopbackPort } from "../../src/display/api.js";
import { MessageHandler } from "../../src/shared/message_handler"; import { MessageHandler } from "../../src/shared/message_handler.js";
describe("message_handler", function() { describe("message_handler", function() {
// Sleep function to wait for sometime, similar to setTimeout but faster. // Sleep function to wait for sometime, similar to setTimeout but faster.

View File

@ -13,8 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { isEmptyObj } from "../../src/shared/util"; import { isEmptyObj } from "../../src/shared/util.js";
import { Metadata } from "../../src/display/metadata"; import { Metadata } from "../../src/display/metadata.js";
describe("metadata", function() { describe("metadata", function() {
it("should handle valid metadata", function() { it("should handle valid metadata", function() {

View File

@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { MurmurHash3_64 } from "../../src/core/murmurhash3"; import { MurmurHash3_64 } from "../../src/core/murmurhash3.js";
describe("MurmurHash3_64", function() { describe("MurmurHash3_64", function() {
it("instantiates without seed", function() { it("instantiates without seed", function() {

View File

@ -13,8 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { AbortException } from "../../src/shared/util"; import { AbortException } from "../../src/shared/util.js";
import { PDFNetworkStream } from "../../src/display/network"; import { PDFNetworkStream } from "../../src/display/network.js";
describe("network", function() { describe("network", function() {
var pdf1 = new URL("../pdfs/tracemonkey.pdf", window.location).href; var pdf1 = new URL("../pdfs/tracemonkey.pdf", window.location).href;

View File

@ -18,11 +18,11 @@ import {
extractFilenameFromHeader, extractFilenameFromHeader,
validateRangeRequestCapabilities, validateRangeRequestCapabilities,
validateResponseStatus, validateResponseStatus,
} from "../../src/display/network_utils"; } from "../../src/display/network_utils.js";
import { import {
MissingPDFException, MissingPDFException,
UnexpectedResponseException, UnexpectedResponseException,
} from "../../src/shared/util"; } from "../../src/shared/util.js";
describe("network_utils", function() { describe("network_utils", function() {
describe("validateRangeRequestCapabilities", function() { describe("validateRangeRequestCapabilities", function() {

View File

@ -14,9 +14,9 @@
*/ */
/* globals __non_webpack_require__ */ /* globals __non_webpack_require__ */
import { AbortException, assert } from "../../src/shared/util"; import { AbortException, assert } from "../../src/shared/util.js";
import { isNodeJS } from "../../src/shared/is_node"; import { isNodeJS } from "../../src/shared/is_node.js";
import { PDFNodeStream } from "../../src/display/node_stream"; import { PDFNodeStream } from "../../src/display/node_stream.js";
// Make sure that we only running this script is Node.js environments. // Make sure that we only running this script is Node.js environments.
assert(isNodeJS); assert(isNodeJS);

View File

@ -14,10 +14,10 @@
*/ */
/* eslint no-var: error */ /* eslint no-var: error */
import { Lexer, Linearization, Parser } from "../../src/core/parser"; import { Lexer, Linearization, Parser } from "../../src/core/parser.js";
import { FormatError } from "../../src/shared/util"; import { FormatError } from "../../src/shared/util.js";
import { Name } from "../../src/core/primitives"; import { Name } from "../../src/core/primitives.js";
import { StringStream } from "../../src/core/stream"; import { StringStream } from "../../src/core/stream.js";
describe("parser", function() { describe("parser", function() {
describe("Parser", function() { describe("Parser", function() {

View File

@ -13,11 +13,11 @@
* limitations under the License. * limitations under the License.
*/ */
import { buildGetDocumentParams } from "./test_utils"; import { buildGetDocumentParams } from "./test_utils.js";
import { EventBus } from "../../web/ui_utils"; import { EventBus } from "../../web/ui_utils.js";
import { getDocument } from "../../src/display/api"; import { getDocument } from "../../src/display/api.js";
import { PDFFindController } from "../../web/pdf_find_controller"; import { PDFFindController } from "../../web/pdf_find_controller.js";
import { SimpleLinkService } from "../../web/pdf_link_service"; import { SimpleLinkService } from "../../web/pdf_link_service.js";
class MockLinkService extends SimpleLinkService { class MockLinkService extends SimpleLinkService {
constructor() { constructor() {

View File

@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { CharacterType, getCharacterType } from "../../web/pdf_find_utils"; import { CharacterType, getCharacterType } from "../../web/pdf_find_utils.js";
describe("pdf_find_utils", function() { describe("pdf_find_utils", function() {
describe("getCharacterType", function() { describe("getCharacterType", function() {

View File

@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { isDestArraysEqual, isDestHashesEqual } from "../../web/pdf_history"; import { isDestArraysEqual, isDestHashesEqual } from "../../web/pdf_history.js";
describe("pdf_history", function() { describe("pdf_history", function() {
describe("isDestHashesEqual", function() { describe("isDestHashesEqual", function() {

View File

@ -24,8 +24,8 @@ import {
Name, Name,
Ref, Ref,
RefSet, RefSet,
} from "../../src/core/primitives"; } from "../../src/core/primitives.js";
import { XRefMock } from "./test_utils"; import { XRefMock } from "./test_utils.js";
describe("primitives", function() { describe("primitives", function() {
describe("Name", function() { describe("Name", function() {

View File

@ -13,8 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { PredictorStream, Stream } from "../../src/core/stream"; import { PredictorStream, Stream } from "../../src/core/stream.js";
import { Dict } from "../../src/core/primitives"; import { Dict } from "../../src/core/primitives.js";
describe("stream", function() { describe("stream", function() {
beforeEach(function() { beforeEach(function() {

View File

@ -13,10 +13,10 @@
* limitations under the License. * limitations under the License.
*/ */
import { assert, CMapCompressionType } from "../../src/shared/util"; import { assert, CMapCompressionType } from "../../src/shared/util.js";
import { isNodeJS } from "../../src/shared/is_node"; import { isNodeJS } from "../../src/shared/is_node.js";
import { isRef } from "../../src/core/primitives"; import { isRef } from "../../src/core/primitives.js";
import { Page } from "../../src/core/document"; import { Page } from "../../src/core/document.js";
class DOMFileReaderFactory { class DOMFileReaderFactory {
static async fetch(params) { static async fetch(params) {

View File

@ -13,9 +13,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { SEAC_ANALYSIS_ENABLED } from "../../src/core/fonts"; import { SEAC_ANALYSIS_ENABLED } from "../../src/core/fonts.js";
import { StringStream } from "../../src/core/stream"; import { StringStream } from "../../src/core/stream.js";
import { Type1Parser } from "../../src/core/type1_parser"; import { Type1Parser } from "../../src/core/type1_parser.js";
describe("Type1Parser", function() { describe("Type1Parser", function() {
it("splits tokens", function() { it("splits tokens", function() {

View File

@ -25,9 +25,9 @@ import {
moveToEndOfArray, moveToEndOfArray,
waitOnEventOrTimeout, waitOnEventOrTimeout,
WaitOnType, WaitOnType,
} from "../../web/ui_utils"; } from "../../web/ui_utils.js";
import { createObjectURL } from "../../src/shared/util"; import { createObjectURL } from "../../src/shared/util.js";
import { isNodeJS } from "../../src/shared/is_node"; import { isNodeJS } from "../../src/shared/is_node.js";
describe("ui_utils", function() { describe("ui_utils", function() {
describe("binary search", function() { describe("binary search", function() {

View File

@ -16,14 +16,14 @@
import { import {
getDingbatsGlyphsUnicode, getDingbatsGlyphsUnicode,
getGlyphsUnicode, getGlyphsUnicode,
} from "../../src/core/glyphlist"; } from "../../src/core/glyphlist.js";
import { import {
getNormalizedUnicodes, getNormalizedUnicodes,
getUnicodeForGlyph, getUnicodeForGlyph,
getUnicodeRangeFor, getUnicodeRangeFor,
mapSpecialUnicodeValues, mapSpecialUnicodeValues,
reverseIfRtl, reverseIfRtl,
} from "../../src/core/unicode"; } from "../../src/core/unicode.js";
describe("unicode", function() { describe("unicode", function() {
describe("mapSpecialUnicodeValues", function() { describe("mapSpecialUnicodeValues", function() {

View File

@ -29,7 +29,7 @@ import {
string32, string32,
stringToBytes, stringToBytes,
stringToPDFString, stringToPDFString,
} from "../../src/shared/util"; } from "../../src/shared/util.js";
describe("util", function() { describe("util", function() {
describe("bytesToString", function() { describe("bytesToString", function() {

View File

@ -14,8 +14,8 @@
*/ */
import { AnnotationLayer } from "pdfjs-lib"; import { AnnotationLayer } from "pdfjs-lib";
import { NullL10n } from "./ui_utils"; import { NullL10n } from "./ui_utils.js";
import { SimpleLinkService } from "./pdf_link_service"; import { SimpleLinkService } from "./pdf_link_service.js";
/** /**
* @typedef {Object} AnnotationLayerBuilderOptions * @typedef {Object} AnnotationLayerBuilderOptions

View File

@ -34,8 +34,8 @@ import {
ScrollMode, ScrollMode,
SpreadMode, SpreadMode,
TextLayerMode, TextLayerMode,
} from "./ui_utils"; } from "./ui_utils.js";
import { AppOptions, OptionKind } from "./app_options"; import { AppOptions, OptionKind } from "./app_options.js";
import { import {
build, build,
createObjectURL, createObjectURL,
@ -53,25 +53,25 @@ import {
UNSUPPORTED_FEATURES, UNSUPPORTED_FEATURES,
version, version,
} from "pdfjs-lib"; } from "pdfjs-lib";
import { CursorTool, PDFCursorTools } from "./pdf_cursor_tools"; import { CursorTool, PDFCursorTools } from "./pdf_cursor_tools.js";
import { PDFRenderingQueue, RenderingStates } from "./pdf_rendering_queue"; import { PDFRenderingQueue, RenderingStates } from "./pdf_rendering_queue.js";
import { PDFSidebar, SidebarView } from "./pdf_sidebar"; import { PDFSidebar, SidebarView } from "./pdf_sidebar.js";
import { OverlayManager } from "./overlay_manager"; import { OverlayManager } from "./overlay_manager.js";
import { PasswordPrompt } from "./password_prompt"; import { PasswordPrompt } from "./password_prompt.js";
import { PDFAttachmentViewer } from "./pdf_attachment_viewer"; import { PDFAttachmentViewer } from "./pdf_attachment_viewer.js";
import { PDFDocumentProperties } from "./pdf_document_properties"; import { PDFDocumentProperties } from "./pdf_document_properties.js";
import { PDFFindBar } from "./pdf_find_bar"; import { PDFFindBar } from "./pdf_find_bar.js";
import { PDFFindController } from "./pdf_find_controller"; import { PDFFindController } from "./pdf_find_controller.js";
import { PDFHistory } from "./pdf_history"; import { PDFHistory } from "./pdf_history.js";
import { PDFLinkService } from "./pdf_link_service"; import { PDFLinkService } from "./pdf_link_service.js";
import { PDFOutlineViewer } from "./pdf_outline_viewer"; import { PDFOutlineViewer } from "./pdf_outline_viewer.js";
import { PDFPresentationMode } from "./pdf_presentation_mode"; import { PDFPresentationMode } from "./pdf_presentation_mode.js";
import { PDFSidebarResizer } from "./pdf_sidebar_resizer"; import { PDFSidebarResizer } from "./pdf_sidebar_resizer.js";
import { PDFThumbnailViewer } from "./pdf_thumbnail_viewer"; import { PDFThumbnailViewer } from "./pdf_thumbnail_viewer.js";
import { PDFViewer } from "./pdf_viewer"; import { PDFViewer } from "./pdf_viewer.js";
import { SecondaryToolbar } from "./secondary_toolbar"; import { SecondaryToolbar } from "./secondary_toolbar.js";
import { Toolbar } from "./toolbar"; import { Toolbar } from "./toolbar.js";
import { ViewHistory } from "./view_history"; import { ViewHistory } from "./view_history.js";
const DEFAULT_SCALE_DELTA = 1.1; const DEFAULT_SCALE_DELTA = 1.1;
const DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000; // ms const DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000; // ms
@ -1769,7 +1769,7 @@ async function loadFakeWorker() {
if (typeof SystemJS !== "object") { if (typeof SystemJS !== "object") {
throw new Error("SystemJS must be used to load fake worker."); throw new Error("SystemJS must be used to load fake worker.");
} }
window.pdfjsWorker = await SystemJS.import("pdfjs/core/worker"); window.pdfjsWorker = await SystemJS.import("pdfjs/core/worker.js");
return undefined; return undefined;
} }
return loadScript(PDFWorker.getWorkerSrc()); return loadScript(PDFWorker.getWorkerSrc());

View File

@ -14,7 +14,7 @@
*/ */
import { apiCompatibilityParams } from "pdfjs-lib"; import { apiCompatibilityParams } from "pdfjs-lib";
import { viewerCompatibilityParams } from "./viewer_compatibility"; import { viewerCompatibilityParams } from "./viewer_compatibility.js";
const OptionKind = { const OptionKind = {
VIEWER: 0x02, VIEWER: 0x02,

View File

@ -36,13 +36,13 @@ import {
UNKNOWN_SCALE, UNKNOWN_SCALE,
VERTICAL_PADDING, VERTICAL_PADDING,
watchScroll, watchScroll,
} from "./ui_utils"; } from "./ui_utils.js";
import { PDFRenderingQueue, RenderingStates } from "./pdf_rendering_queue"; import { PDFRenderingQueue, RenderingStates } from "./pdf_rendering_queue.js";
import { AnnotationLayerBuilder } from "./annotation_layer_builder"; import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";
import { createPromiseCapability } from "pdfjs-lib"; import { createPromiseCapability } from "pdfjs-lib";
import { PDFPageView } from "./pdf_page_view"; import { PDFPageView } from "./pdf_page_view.js";
import { SimpleLinkService } from "./pdf_link_service"; import { SimpleLinkService } from "./pdf_link_service.js";
import { TextLayerBuilder } from "./text_layer_builder"; import { TextLayerBuilder } from "./text_layer_builder.js";
const DEFAULT_CACHE_SIZE = 10; const DEFAULT_CACHE_SIZE = 10;

View File

@ -14,11 +14,11 @@
*/ */
/* globals chrome */ /* globals chrome */
import { DefaultExternalServices, PDFViewerApplication } from "./app"; import { DefaultExternalServices, PDFViewerApplication } from "./app.js";
import { AppOptions } from "./app_options"; import { AppOptions } from "./app_options.js";
import { BasePreferences } from "./preferences"; import { BasePreferences } from "./preferences.js";
import { DownloadManager } from "./download_manager"; import { DownloadManager } from "./download_manager.js";
import { GenericL10n } from "./genericl10n"; import { GenericL10n } from "./genericl10n.js";
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("CHROME")) { if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("CHROME")) {
throw new Error( throw new Error(

Some files were not shown because too many files have changed in this diff Show More