Socket
Socket
Sign inDemoInstall

pdfjs-dist

Package Overview
Dependencies
Maintainers
3
Versions
1541
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdfjs-dist - npm Package Compare versions

Comparing version 4.0.379 to 4.1.392

legacy/web/images/cursor-editorFreeHighlight.svg

4

package.json
{
"name": "pdfjs-dist",
"version": "4.0.379",
"version": "4.1.392",
"main": "build/pdf.mjs",

@@ -17,3 +17,3 @@ "types": "types/src/pdf.d.ts",

"canvas": "^2.11.2",
"path2d-polyfill": "^2.0.1"
"path2d": "^0.1.2"
},

@@ -20,0 +20,0 @@ "browser": {

@@ -29,3 +29,3 @@ export type PDFPageProxy = import("./api").PDFPageProxy;

linkService: IPDFLinkService;
downloadManager: IDownloadManager;
downloadManager?: import("../../web/interfaces").IDownloadManager | undefined;
annotationStorage?: AnnotationStorage | undefined;

@@ -60,3 +60,3 @@ /**

* @property {IPDFLinkService} linkService
* @property {IDownloadManager} downloadManager
* @property {IDownloadManager} [downloadManager]
* @property {AnnotationStorage} [annotationStorage]

@@ -63,0 +63,0 @@ * @property {string} [imageResourcesPath] - Path for image resources, mainly

@@ -65,2 +65,3 @@ /**

};
get editorStats(): any;
#private;

@@ -67,0 +68,0 @@ }

export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
export type BinaryData = TypedArray | ArrayBuffer | Array<number> | string;
export type RefProxy = {

@@ -16,3 +15,4 @@ num: number;

/**
* - Binary PDF data.
* -
* Binary PDF data.
* Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is

@@ -25,3 +25,3 @@ * BASE64-encoded, use `atob()` to convert it to a binary string first.

*/
data?: BinaryData | undefined;
data?: string | number[] | ArrayBuffer | TypedArray | undefined;
/**

@@ -535,5 +535,2 @@ * - Basic authentication headers.

/**
* @typedef { TypedArray | ArrayBuffer | Array<number> | string } BinaryData
*/
/**
* @typedef {Object} RefProxy

@@ -548,3 +545,4 @@ * @property {number} num

* @property {string | URL} [url] - The URL of the PDF.
* @property {BinaryData} [data] - Binary PDF data.
* @property {TypedArray | ArrayBuffer | Array<number> | string} [data] -
* Binary PDF data.
* Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is

@@ -692,3 +690,3 @@ * BASE64-encoded, use `atob()` to convert it to a binary string first.

_progressiveDoneListeners: any[];
_readyCapability: PromiseCapability;
_readyCapability: PromiseWithResolvers<any>;
/**

@@ -744,4 +742,4 @@ * @param {function} listener

export class PDFDocumentLoadingTask {
static "__#39@#docId": number;
_capability: PromiseCapability;
static "__#44@#docId": number;
_capability: PromiseWithResolvers<any>;
_transport: any;

@@ -926,2 +924,13 @@ _worker: any;

/**
* @typedef {Object} GetOptionalContentConfigParameters
* @property {string} [intent] - Determines the optional content groups that
* are visible by default; valid values are:
* - 'display' (viewable groups).
* - 'print' (printable groups).
* - 'any' (all groups).
* The default value is 'display'.
*/
/**
* @param {GetOptionalContentConfigParameters} [params] - Optional content
* config parameters.
* @returns {Promise<OptionalContentConfig>} A promise that is resolved with

@@ -931,3 +940,13 @@ * an {@link OptionalContentConfig} that contains all the optional content

*/
getOptionalContentConfig(): Promise<OptionalContentConfig>;
getOptionalContentConfig({ intent }?: {
/**
* - Determines the optional content groups that
* are visible by default; valid values are:
* - 'display' (viewable groups).
* - 'print' (printable groups).
* - 'any' (all groups).
* The default value is 'display'.
*/
intent?: string | undefined;
} | undefined): Promise<OptionalContentConfig>;
/**

@@ -1237,7 +1256,7 @@ * @returns {Promise<Array<number> | null>} A promise that is resolved with

/**
* @param {GetAnnotationsParameters} params - Annotation parameters.
* @param {GetAnnotationsParameters} [params] - Annotation parameters.
* @returns {Promise<Array<any>>} A promise that is resolved with an
* {Array} of the annotation objects.
*/
getAnnotations({ intent }?: GetAnnotationsParameters): Promise<Array<any>>;
getAnnotations({ intent }?: GetAnnotationsParameters | undefined): Promise<Array<any>>;
/**

@@ -1346,3 +1365,3 @@ * @returns {Promise<Object>} A promise that is resolved with an

export class PDFWorker {
static "__#42@#workerPorts": any;
static "__#47@#workerPorts": any;
/**

@@ -1357,3 +1376,3 @@ * @param {PDFWorkerParameters} params - The worker initialization parameters.

static get workerSrc(): string;
static get "__#42@#mainThreadWorkerMessageHandler"(): any;
static get "__#47@#mainThreadWorkerMessageHandler"(): any;
static get _setupFakeWorkerGlobal(): any;

@@ -1368,3 +1387,3 @@ constructor({ name, port, verbosity, }?: {

verbosity: number;
_readyCapability: PromiseCapability;
_readyCapability: PromiseWithResolvers<any>;
_port: any;

@@ -1443,3 +1462,2 @@ _webWorker: Worker | null;

import { NodeStandardFontDataFactory } from "./node_utils";
import { PromiseCapability } from "../shared/util.js";
import { AnnotationStorage } from "./annotation_storage.js";

@@ -1446,0 +1464,0 @@ import { info } from "../shared/util.js";

@@ -31,3 +31,3 @@ export class BaseCanvasFactory {

addHCMFilter(fgColor: any, bgColor: any): string;
addHighlightHCMFilter(fgColor: any, bgColor: any, newFgColor: any, newBgColor: any): string;
addHighlightHCMFilter(filterName: any, fgColor: any, bgColor: any, newFgColor: any, newBgColor: any): string;
destroy(keepHCM?: boolean): void;

@@ -34,0 +34,0 @@ }

@@ -94,3 +94,3 @@ export type PageViewportParameters = {

addHCMFilter(fgColor: any, bgColor: any): any;
addHighlightHCMFilter(fgColor: any, bgColor: any, newFgColor: any, newBgColor: any): any;
addHighlightHCMFilter(filterName: any, fgColor: any, bgColor: any, newFgColor: any, newBgColor: any): any;
#private;

@@ -97,0 +97,0 @@ }

@@ -8,9 +8,8 @@ /**

static get _svgFactory(): any;
static "__#21@#setBox"(element: any, { x, y, width, height }: {
x: any;
y: any;
width: any;
height: any;
static "__#26@#setBox"(element: any, { x, y, width, height }?: {
x?: number | undefined;
y?: number | undefined;
width?: number | undefined;
height?: number | undefined;
}): void;
static "__#21@#extractPathFromHighlightOutlines"(polygons: any): string;
constructor({ pageIndex }: {

@@ -21,14 +20,13 @@ pageIndex: any;

setParent(parent: any): void;
highlight({ outlines, box }: {
outlines: any;
box: any;
}, color: any, opacity: any): {
highlight(outlines: any, color: any, opacity: any, isPathUpdatable?: boolean): {
id: number;
clipPathId: string;
};
highlightOutline({ outlines, box }: {
outlines: any;
box: any;
}): number;
highlightOutline(outlines: any): number;
finalizeLine(id: any, line: any): void;
updateLine(id: any, line: any): void;
removeFreeHighlight(id: any): void;
updatePath(id: any, line: any): void;
updateBox(id: any, box: any): void;
show(id: any, visible: any): void;
rotate(id: any, angle: any): void;

@@ -35,0 +33,0 @@ changeColor(id: any, color: any): void;

@@ -7,2 +7,3 @@ export class AltText {

finish(): void;
isEmpty(): boolean;
/**

@@ -9,0 +10,0 @@ * Set the alt text data.

@@ -46,3 +46,3 @@ export type AnnotationEditorUIManager = import("./tools.js").AnnotationEditorUIManager;

static _initialized: boolean;
static "__#22@#editorTypes": Map<number, typeof FreeTextEditor | typeof HighlightEditor | typeof InkEditor | typeof StampEditor>;
static "__#27@#editorTypes": Map<number, typeof FreeTextEditor | typeof HighlightEditor | typeof InkEditor | typeof StampEditor>;
/**

@@ -57,2 +57,3 @@ * @param {AnnotationEditorLayerOptions} options

get isEmpty(): boolean;
get isInvisible(): boolean;
/**

@@ -68,2 +69,3 @@ * Update the toolbar if it's required to reflect the tool currently used.

updateMode(mode?: number): void;
hasTextLayer(textLayer: any): boolean;
addInkEditorIfNeeded(isCommitting: any): void;

@@ -81,2 +83,3 @@ /**

togglePointerEvents(enabled?: boolean): void;
toggleAnnotationLayerPointerEvents(enabled?: boolean): void;
/**

@@ -150,3 +153,11 @@ * Enable pointer events on the main div in order to enable

* Create and add a new editor.
* @param {PointerEvent} event
* @param {boolean} isCentered
* @param [Object] data
* @returns {AnnotationEditor}
*/
createAndAddNewEditor(event: PointerEvent, isCentered: boolean, data?: {}): AnnotationEditor;
/**
* Create and add a new editor.
*/
addNewEditor(): void;

@@ -174,13 +185,2 @@ /**

/**
* SelectionChange callback.
* @param {Event} _event
*/
selectionStart(_event: Event): void;
/**
* Called when the user releases the mouse button after having selected
* some text.
* @param {PointerEvent} event
*/
pointerUpAfterSelection(event: PointerEvent): void;
/**
* Pointerup callback.

@@ -222,2 +222,3 @@ * @param {PointerEvent} event

get pageDimensions(): Object;
get scale(): number;
#private;

@@ -224,0 +225,0 @@ }

@@ -12,4 +12,4 @@ export class ColorPicker {

_moveToPrevious(event: any): void;
_moveToBeginning(): void;
_moveToEnd(): void;
_moveToBeginning(event: any): void;
_moveToEnd(event: any): void;
hideDropdown(): void;

@@ -16,0 +16,0 @@ _hideDropdownFromKeyboard(): void;

@@ -39,2 +39,3 @@ export type AnnotationEditorLayer = import("./annotation_editor_layer.js").AnnotationEditorLayer;

static _zIndex: number;
static _telemetryTimeout: number;
static get _resizerKeyboardManager(): any;

@@ -47,3 +48,3 @@ static get _defaultLineColor(): any;

*/
static initialize(l10n: Object, options?: null): void;
static initialize(l10n: Object, _uiManager: any, options: any): void;
/**

@@ -74,3 +75,3 @@ * Update the default parameters for this type of editor.

static paste(item: DataTransferItem, parent: AnnotationEditorLayer): void;
static "__#30@#rotatePoint"(x: any, y: any, angle: any): any[];
static "__#34@#rotatePoint"(x: any, y: any, angle: any): any[];
/**

@@ -93,2 +94,3 @@ * Deserialize the editor.

_initialOptions: any;
_isVisible: boolean;
_uiManager: null;

@@ -180,3 +182,17 @@ _focusEventsAllowed: boolean;

drag(tx: any, ty: any): void;
get _hasBeenMoved(): boolean;
/**
* Get the translation to take into account the editor border.
* The CSS engine positions the element by taking the border into account so
* we must apply the opposite translation to have the editor in the right
* position.
* @returns {Array<number>}
*/
getBaseTranslation(): Array<number>;
/**
* @returns {boolean} true if position must be fixed (i.e. make the x and y
* living in the page).
*/
get _mustFixPosition(): boolean;
/**
* Fix the position of the editor in order to keep it inside its parent page.

@@ -227,2 +243,3 @@ * @param {number} [rotation] - the rotation of the page.

get altTextData(): any;
hasAltText(): boolean;
/**

@@ -377,2 +394,20 @@ * Render this editor in a div.

setAspectRatio(width: number, height: number): void;
/**
* Get the data to report to the telemetry when the editor is added.
* @returns {Object}
*/
get telemetryInitialData(): Object;
/**
* The telemetry data to use when saving/printing.
* @returns {Object|null}
*/
get telemetryFinalData(): Object | null;
_reportTelemetry(data: any, mustWait?: boolean): void;
/**
* Show or hide this editor.
* @param {boolean|undefined} visible
*/
show(visible?: boolean | undefined): void;
enable(): void;
disable(): void;
#private;

@@ -379,0 +414,0 @@ }

@@ -14,3 +14,3 @@ export type AnnotationEditorLayer = import("./annotation_editor_layer.js").AnnotationEditorLayer;

/** @inheritdoc */
static initialize(l10n: any): void;
static initialize(l10n: any, uiManager: any): void;
/** @inheritdoc */

@@ -20,2 +20,4 @@ static updateDefaultParams(type: any, value: any): void;

static get defaultPropertiesToUpdate(): any[][];
static "__#17@#getNodeContent"(node: any): any;
static "__#17@#deserializeContent"(content: any): any;
/** @inheritdoc */

@@ -50,2 +52,3 @@ static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;

overlayDiv: HTMLDivElement | undefined;
editorDivPaste(event: any): void;
/** @inheritdoc */

@@ -52,0 +55,0 @@ serialize(isForCopying?: boolean): {

@@ -7,9 +7,19 @@ /**

static _defaultOpacity: number;
static _defaultThickness: number;
static _l10nPromise: any;
static _type: string;
static _editorType: number;
static initialize(l10n: any): void;
static _freeHighlightId: number;
static _freeHighlight: null;
static _freeHighlightClipId: string;
static get _keyboardManager(): any;
static computeTelemetryFinalData(data: any): {
numberOfColors: any;
};
/** @inheritdoc */
static initialize(l10n: any, uiManager: any): void;
/** @inheritdoc */
static updateDefaultParams(type: any, value: any): void;
static get defaultPropertiesToUpdate(): (number | null)[][];
static "__#18@#rotateBbox"({ x, y, width, height }: {
static "__#23@#rotateBbox"({ x, y, width, height }: {
x: any;

@@ -25,2 +35,9 @@ y: any;

};
static startHighlighting(parent: any, isLTR: any, { target: textLayer, x, y }: {
target: any;
x: any;
y: any;
}): void;
static "__#23@#highlightMove"(parent: any, event: any): void;
static "__#23@#endHighlight"(parent: any, event: any): void;
/** @inheritdoc */

@@ -31,2 +48,17 @@ static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;

/** @inheritdoc */
get telemetryInitialData(): {
action: string;
type: string;
color: any;
thickness: any;
methodOfCreation: string;
};
/** @inheritdoc */
get telemetryFinalData(): {
type: string;
color: any;
};
/** @inheritdoc */
translateInPage(x: any, y: any): void;
/** @inheritdoc */
updateParams(type: any, value: any): void;

@@ -43,2 +75,3 @@ /** @inheritdoc */

pointerleave(): void;
_moveCaret(direction: any): void;
/** @inheritdoc */

@@ -49,4 +82,5 @@ serialize(isForCopying?: boolean): {

opacity: any;
quadPoints: any[];
outlines: any[][];
thickness: any;
quadPoints: any[] | null;
outlines: any;
pageIndex: number;

@@ -53,0 +87,0 @@ rect: any[];

@@ -11,3 +11,3 @@ /**

/** @inheritdoc */
static initialize(l10n: any): void;
static initialize(l10n: any, uiManager: any): void;
/** @inheritdoc */

@@ -22,5 +22,5 @@ static updateDefaultParams(type: any, value: any): void;

*/
static "__#19@#buildPath2D"(bezier: Array<Array<number>>): Path2D;
static "__#19@#toPDFCoordinates"(points: any, rect: any, rotation: any): any;
static "__#19@#fromPDFCoordinates"(points: any, rect: any, rotation: any): any;
static "__#24@#buildPath2D"(bezier: Array<Array<number>>): Path2D;
static "__#24@#toPDFCoordinates"(points: any, rect: any, rotation: any): any;
static "__#24@#fromPDFCoordinates"(points: any, rect: any, rotation: any): any;
/** @inheritdoc */

@@ -27,0 +27,0 @@ static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;

@@ -0,1 +1,19 @@

export class FreeOutliner {
static "__#20@#MIN_DIST": number;
static "__#20@#MIN_DIFF": number;
static "__#20@#MIN": number;
constructor({ x, y }: {
x: any;
y: any;
}, box: any, scaleFactor: any, thickness: any, isLTR: any, innerMargin?: number);
get free(): boolean;
isEmpty(): boolean;
add({ x, y }: {
x: any;
y: any;
}): boolean;
toSVGPath(): string;
getOutlines(): FreeHighlightOutline;
#private;
}
export class Outliner {

@@ -15,13 +33,39 @@ /**

constructor(boxes: Array<Object>, borderWidth?: number, innerMargin?: number, isLTR?: boolean);
getOutlines(): {
outlines: any[][];
box: {
x: number;
y: number;
width: number;
height: number;
lastPoint: any[];
};
getOutlines(): HighlightOutline;
#private;
}
declare class FreeHighlightOutline extends Outline {
constructor(outline: any, points: any, box: any, scaleFactor: any, innerMargin: any, isLTR: any);
serialize([blX, blY, trX, trY]: [any, any, any, any], rotation: any): {
outline: number[];
points: number[][];
};
get box(): null;
getNewOutline(thickness: any, innerMargin: any): FreeHighlightOutline;
#private;
}
declare class HighlightOutline extends Outline {
constructor(outlines: any, box: any);
/**
* Serialize the outlines into the PDF page coordinate system.
* @param {Array<number>} _bbox - the bounding box of the annotation.
* @param {number} _rotation - the rotation of the annotation.
* @returns {Array<Array<number>>}
*/
serialize([blX, blY, trX, trY]: Array<number>, _rotation: number): Array<Array<number>>;
get box(): any;
#private;
}
declare class Outline {
/**
* @returns {string} The SVG path of the outline.
*/
toSVGPath(): string;
/**
* @type {Object|null} The bounding box of the outline.
*/
get box(): Object | null;
serialize(_bbox: any, _rotation: any): void;
get free(): any;
}
export {};

@@ -8,3 +8,3 @@ /**

/** @inheritdoc */
static initialize(l10n: any): void;
static initialize(l10n: any, uiManager: any): void;
static get supportedTypes(): any;

@@ -11,0 +11,0 @@ static get supportedTypesStr(): any;

export class EditorToolbar {
static "__#29@#pointerDown"(e: any): void;
static "__#3@#pointerDown"(e: any): void;
constructor(editor: any);

@@ -12,1 +12,7 @@ render(): HTMLDivElement;

}
export class HighlightToolbar {
constructor(uiManager: any);
show(parent: any, boxes: any, isLTR: any): void;
hide(): void;
#private;
}

@@ -15,3 +15,3 @@ export type AnnotationEditor = import("./editor.js").AnnotationEditor;

static get _keyboardManager(): any;
constructor(container: any, viewer: any, altTextManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any);
constructor(container: any, viewer: any, altTextManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, mlManager: any);
_eventBus: any;

@@ -22,6 +22,10 @@ viewParameters: {

};
isShiftKeyDown: boolean;
destroy(): void;
mlGuess(data: any): Promise<any>;
get hasMLManager(): boolean;
get hcmFilter(): any;
get direction(): any;
get highlightColors(): any;
get highlightColorNames(): any;
setMainHighlightColorPicker(colorPicker: any): void;

@@ -43,2 +47,3 @@ editAltText(editor: any): void;

}): void;
highlightSelection(methodOfCreation?: string): void;
/**

@@ -74,8 +79,14 @@ * Add an editor in the annotation storage.

/**
* Keyup callback.
* @param {KeyboardEvent} event
*/
keyup(event: KeyboardEvent): void;
/**
* Execute an action for a given name.
* For example, the user can click on the "Undo" entry in the context menu
* and it'll trigger the undo action.
* @param {Object} details
*/
onEditingAction(details: Object): void;
onEditingAction({ name }: {
name: any;
}): void;
/**

@@ -128,2 +139,3 @@ * Set the editing state.

updateParams(type: number, value: any): void;
showAllEditors(type: any, visible: any, updateButton?: boolean): void;
enableWaiting(mustWait?: boolean): void;

@@ -174,2 +186,7 @@ /**

/**
* Update the UI of the active editor.
* @param {AnnotationEditor} editor
*/
updateUI(editor: AnnotationEditor): void;
/**
* Add or remove an editor the current selection.

@@ -264,2 +281,8 @@ * @param {AnnotationEditor} editor

get imageManager(): any;
getSelectionBoxes(textLayer: any): {
x: number;
y: number;
width: number;
height: number;
}[] | null;
#private;

@@ -301,2 +324,3 @@ }

* @property {function} undo
* @property {function} [post]
* @property {boolean} mustExec

@@ -311,5 +335,6 @@ * @property {number} type

*/
add({ cmd, undo, mustExec, type, overwriteIfSameType, keepUndo, }: {
add({ cmd, undo, post, mustExec, type, overwriteIfSameType, keepUndo, }: {
cmd: Function;
undo: Function;
post?: Function | undefined;
mustExec: boolean;

@@ -316,0 +341,0 @@ type: number;

@@ -23,3 +23,3 @@ /** @implements {IPDFStream} */

_contentLength: any;
_headersCapability: PromiseCapability;
_headersCapability: PromiseWithResolvers<any>;
_disableRange: any;

@@ -53,3 +53,3 @@ _rangeChunkSize: any;

_withCredentials: any;
_readCapability: PromiseCapability;
_readCapability: PromiseWithResolvers<any>;
_isStreamingSupported: boolean;

@@ -69,3 +69,2 @@ _abortController: AbortController;

}
import { PromiseCapability } from "../shared/util.js";
export {};

@@ -37,3 +37,3 @@ /** @implements {IPDFStream} */

_fullRequestId: any;
_headersReceivedCapability: PromiseCapability;
_headersReceivedCapability: PromiseWithResolvers<any>;
_disableRange: any;

@@ -83,3 +83,2 @@ _contentLength: any;

}
import { PromiseCapability } from "../shared/util.js";
export {};

@@ -42,4 +42,4 @@ export class PDFNodeStream {

_readableStream: any;
_readCapability: PromiseCapability;
_headersCapability: PromiseCapability;
_readCapability: PromiseWithResolvers<any>;
_headersCapability: PromiseWithResolvers<any>;
get headersReady(): Promise<any>;

@@ -63,3 +63,3 @@ get filename(): any;

_readableStream: any;
_readCapability: PromiseCapability;
_readCapability: PromiseWithResolvers<any>;
_isStreamingSupported: boolean;

@@ -72,3 +72,2 @@ get isStreamingSupported(): boolean;

}
import { PromiseCapability } from "../shared/util.js";
export {};

@@ -11,6 +11,3 @@ export class NodeCanvasFactory extends BaseCanvasFactory {

*/
_fetchData(url: any, compressionType: any): Promise<{
cMapData: any;
compressionType: any;
}>;
_fetchData(url: any, compressionType: any): any;
}

@@ -23,3 +20,3 @@ export class NodeFilterFactory extends BaseFilterFactory {

*/
_fetchData(url: any): Promise<any>;
_fetchData(url: any): any;
}

@@ -26,0 +23,0 @@ import { BaseCanvasFactory } from "./base_factory.js";

export class OptionalContentConfig {
constructor(data: any);
constructor(data: any, renderingIntent?: number);
renderingIntent: number;
name: any;

@@ -7,2 +8,6 @@ creator: any;

setVisibility(id: any, visible?: boolean): void;
setOCGState({ state, preserveRB }: {
state: any;
preserveRB: any;
}): void;
get hasInitialVisibility(): boolean;

@@ -9,0 +14,0 @@ getOrder(): any;

@@ -40,7 +40,2 @@ export type PageViewport = import("./display_utils").PageViewport;

textContentItemsStr?: string[] | undefined;
/**
* true if we can use
* OffscreenCanvas to measure string widths.
*/
isOffscreenCanvasSupported?: boolean | undefined;
};

@@ -73,7 +68,2 @@ /**

/**
* true if we can use
* OffscreenCanvas to measure string widths.
*/
isOffscreenCanvasSupported?: boolean | undefined;
/**
* true if the text layer must be rotated.

@@ -88,2 +78,3 @@ */

};
export function cleanupTextLayer(): void;
/**

@@ -95,3 +86,3 @@ * @param {TextLayerRenderParameters} params

export class TextLayerRenderTask {
constructor({ textContentSource, container, viewport, textDivs, textDivProperties, textContentItemsStr, isOffscreenCanvasSupported, }: {
constructor({ textContentSource, container, viewport, textDivs, textDivProperties, textContentItemsStr, }: {
textContentSource: any;

@@ -103,3 +94,2 @@ container: any;

textContentItemsStr: any;
isOffscreenCanvasSupported: any;
});

@@ -112,3 +102,2 @@ _textContentSource: any;

_textContentItemsStr: any;
_isOffscreenCanvasSupported: any;
_fontInspectorEnabled: boolean;

@@ -118,3 +107,3 @@ _reader: any;

_canceled: boolean;
_capability: PromiseCapability;
_capability: PromiseWithResolvers<any>;
_layoutTextParams: {

@@ -126,3 +115,3 @@ prevFontSize: null;

properties: null;
ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D | null;
ctx: any;
};

@@ -158,3 +147,2 @@ _transform: any[];

*/
export function updateTextLayer({ container, viewport, textDivs, textDivProperties, isOffscreenCanvasSupported, mustRotate, mustRescale, }: TextLayerUpdateParameters): undefined;
import { PromiseCapability } from "../shared/util.js";
export function updateTextLayer({ container, viewport, textDivs, textDivProperties, mustRotate, mustRescale, }: TextLayerUpdateParameters): undefined;

@@ -6,12 +6,8 @@ export type IPDFStream = import("../interfaces").IPDFStream;

export class PDFDataTransportStream implements IPDFStream {
constructor({ length, initialData, progressiveDone, contentDispositionFilename, disableRange, disableStream, }: {
length: any;
initialData: any;
progressiveDone?: boolean | undefined;
contentDispositionFilename?: null | undefined;
constructor(pdfDataRangeTransport: any, { disableRange, disableStream }: {
disableRange?: boolean | undefined;
disableStream?: boolean | undefined;
}, pdfDataRangeTransport: any);
});
_queuedChunks: ArrayBuffer[];
_progressiveDone: boolean;
_progressiveDone: any;
_contentDispositionFilename: any;

@@ -18,0 +14,0 @@ _pdfDataRangeTransport: any;

@@ -1,27 +0,25 @@

export type GlobalWorkerOptionsType = {
export class GlobalWorkerOptions {
static "__#39@#port": null;
static "__#39@#src": string;
/**
* - Defines global port for worker
* process. Overrides the `workerSrc` option.
* @param {Worker | null} workerPort - Defines global port for worker process.
* Overrides the `workerSrc` option.
*/
workerPort: Worker | null;
static set workerPort(val: Worker | null);
/**
* - A string containing the path and filename
* of the worker file.
* @type {Worker | null}
*/
static get workerPort(): Worker | null;
/**
* @param {string} workerSrc - A string containing the path and filename of
* the worker file.
*
* NOTE: The `workerSrc` option should always be set, in order to prevent any
* issues when using the PDF.js library.
* NOTE: The `workerSrc` option should always be set, in order to prevent
* any issues when using the PDF.js library.
*/
workerSrc: string;
};
/**
* @typedef {Object} GlobalWorkerOptionsType
* @property {Worker | null} workerPort - Defines global port for worker
* process. Overrides the `workerSrc` option.
* @property {string} workerSrc - A string containing the path and filename
* of the worker file.
*
* NOTE: The `workerSrc` option should always be set, in order to prevent any
* issues when using the PDF.js library.
*/
/** @type {GlobalWorkerOptionsType} */
export const GlobalWorkerOptions: GlobalWorkerOptionsType;
static set workerSrc(val: string);
/**
* @type {string}
*/
static get workerSrc(): string;
}

@@ -43,3 +43,2 @@ export type OnProgressParameters = import("./display/api").OnProgressParameters;

import { PixelsPerInch } from "./display/display_utils.js";
import { PromiseCapability } from "./shared/util.js";
import { RenderingCancelledException } from "./display/display_utils.js";

@@ -55,2 +54,2 @@ import { renderTextLayer } from "./display/text_layer.js";

import { XfaLayer } from "./display/xfa_layer.js";
export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, build, CMapCompressionType, ColorPicker, createValidAbsoluteUrl, DOMSVGFactory, DrawLayer, FeatureTest, fetchData, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getXfaPageViewport, GlobalWorkerOptions, ImageKind, InvalidPDFException, isDataScheme, isPdfFile, MissingPDFException, noContextMenu, normalizeUnicode, OPS, Outliner, PasswordResponses, PDFDataRangeTransport, PDFDateString, PDFWorker, PermissionFlag, PixelsPerInch, PromiseCapability, RenderingCancelledException, renderTextLayer, setLayerDimensions, shadow, UnexpectedResponseException, updateTextLayer, Util, VerbosityLevel, version, XfaLayer };
export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, build, CMapCompressionType, ColorPicker, createValidAbsoluteUrl, DOMSVGFactory, DrawLayer, FeatureTest, fetchData, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getXfaPageViewport, GlobalWorkerOptions, ImageKind, InvalidPDFException, isDataScheme, isPdfFile, MissingPDFException, noContextMenu, normalizeUnicode, OPS, Outliner, PasswordResponses, PDFDataRangeTransport, PDFDateString, PDFWorker, PermissionFlag, PixelsPerInch, RenderingCancelledException, renderTextLayer, setLayerDimensions, shadow, UnexpectedResponseException, updateTextLayer, Util, VerbosityLevel, version, XfaLayer };

@@ -43,2 +43,5 @@ declare const AbortException_base: any;

let HIGHLIGHT_DEFAULT_COLOR: number;
let HIGHLIGHT_THICKNESS: number;
let HIGHLIGHT_FREE: number;
let HIGHLIGHT_SHOW_ALL: number;
}

@@ -192,3 +195,2 @@ export const AnnotationEditorPrefix: "pdfjs_internal_editor_";

}
export function isArrayBuffer(v: any): boolean;
export function isArrayEqual(arr1: any, arr2: any): boolean;

@@ -323,21 +325,2 @@ export const isNodeJS: any;

}
export class PromiseCapability {
/**
* @type {Promise<any>} The Promise object.
*/
promise: Promise<any>;
/**
* @type {function} Fulfills the Promise.
*/
resolve: Function;
/**
* @type {function} Rejects the Promise.
*/
reject: Function;
/**
* @type {boolean} If the Promise has been fulfilled/rejected.
*/
get settled(): boolean;
#private;
}
export namespace RenderingIntentFlag {

@@ -398,3 +381,5 @@ export let ANY: number;

static intersect(rect1: any, rect2: any): number[] | null;
static bezierBoundingBox(x0: any, y0: any, x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): number[];
static "__#1@#getExtremumOnCurve"(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, t: any, minMax: any): void;
static "__#1@#getExtremum"(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, a: any, b: any, c: any, minMax: any): void;
static bezierBoundingBox(x0: any, y0: any, x1: any, y1: any, x2: any, y2: any, x3: any, y3: any, minMax: any): any;
}

@@ -401,0 +386,0 @@ export namespace VerbosityLevel {

@@ -8,10 +8,10 @@ export type PDFPageProxy = import("../src/display/api").PDFPageProxy;

export type AnnotationEditorLayerBuilderOptions = {
uiManager?: import("../src/display/editor/tools.js").AnnotationEditorUIManager | undefined;
pageDiv: HTMLDivElement;
uiManager?: import("../src/pdf").AnnotationEditorUIManager | undefined;
pdfPage: PDFPageProxy;
l10n?: import("./interfaces").IL10n | undefined;
accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
annotationLayer?: import("../src/display/annotation_layer.js").AnnotationLayer | undefined;
annotationLayer?: import("../src/pdf").AnnotationLayer | undefined;
textLayer?: any;
drawLayer?: any;
onAppend?: Function | undefined;
};

@@ -21,3 +21,2 @@ /**

* @property {AnnotationEditorUIManager} [uiManager]
* @property {HTMLDivElement} pageDiv
* @property {PDFPageProxy} pdfPage

@@ -29,2 +28,3 @@ * @property {IL10n} [l10n]

* @property {DrawLayer} [drawLayer]
* @property {function} [onAppend]
*/

@@ -36,13 +36,5 @@ export class AnnotationEditorLayerBuilder {

constructor(options: AnnotationEditorLayerBuilderOptions);
pageDiv: HTMLDivElement;
pdfPage: import("../src/display/api").PDFPageProxy;
accessibilityManager: import("./text_accessibility.js").TextAccessibilityManager | undefined;
l10n: {
getLanguage(): any;
getDirection(): any;
get(ids: any, args: null | undefined, fallback: any): Promise<any>;
translate(element: any): Promise<any>;
pause(): any;
resume(): any;
};
l10n: any;
annotationEditorLayer: AnnotationEditorLayer | null;

@@ -49,0 +41,0 @@ div: HTMLDivElement | null;

@@ -8,3 +8,2 @@ export type PDFPageProxy = import("../src/display/api").PDFPageProxy;

export type AnnotationLayerBuilderOptions = {
pageDiv: HTMLDivElement;
pdfPage: PDFPageProxy;

@@ -27,6 +26,6 @@ annotationStorage?: import("../src/display/annotation_storage").AnnotationStorage | undefined;

accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
onAppend?: Function | undefined;
};
/**
* @typedef {Object} AnnotationLayerBuilderOptions
* @property {HTMLDivElement} pageDiv
* @property {PDFPageProxy} pdfPage

@@ -45,2 +44,3 @@ * @property {AnnotationStorage} [annotationStorage]

* @property {TextAccessibilityManager} [accessibilityManager]
* @property {function} [onAppend]
*/

@@ -51,4 +51,3 @@ export class AnnotationLayerBuilder {

*/
constructor({ pageDiv, pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, enableScripting, hasJSActionsPromise, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, }: AnnotationLayerBuilderOptions);
pageDiv: HTMLDivElement;
constructor({ pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, enableScripting, hasJSActionsPromise, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, onAppend, }: AnnotationLayerBuilderOptions);
pdfPage: import("../src/display/api").PDFPageProxy;

@@ -55,0 +54,0 @@ linkService: import("./interfaces").IPDFLinkService;

export class AppOptions {
static get(name: any): any;
static getAll(kind?: null): any;
static getAll(kind?: null, defaultOnly?: boolean): any;
static set(name: any, value: any): void;

@@ -8,3 +8,2 @@ static setAll(options: any, init?: boolean): void;

}
export const compatibilityParams: any;
export namespace OptionKind {

@@ -11,0 +10,0 @@ let BROWSER: number;

@@ -12,10 +12,12 @@ export type IL10n = import("./interfaces").IL10n;

*/
static "__#53@#generateBundles"(defaultLang: string, baseLang: string): AsyncGenerator<any, void, unknown>;
static "__#53@#createBundle"(lang: any, baseURL: any, paths: any): Promise<any>;
static "__#53@#getPaths"(): Promise<{
static "__#58@#generateBundles"(defaultLang: string, baseLang: string): AsyncGenerator<any, void, unknown>;
static "__#58@#createBundle"(lang: any, baseURL: any, paths: any): Promise<any>;
static "__#58@#getPaths"(): Promise<{
baseURL: any;
paths: any;
}>;
static "__#58@#generateBundlesFallback"(lang: any): AsyncGenerator<any, void, unknown>;
static "__#58@#createBundleFallback"(lang: any): Promise<any>;
constructor(lang: any);
}
import { L10n } from "./l10n.js";

@@ -156,2 +156,10 @@ export type PDFPageProxy = import("../src/display/api").PDFPageProxy;

*/
export class IPDFPrintServiceFactory {
static initGlobals(): void;
static get supportsPrinting(): boolean;
static createPrintService(): void;
}
/**
* @interface
*/
export class IRenderableView {

@@ -158,0 +166,0 @@ /** @type {function | null} */

export type IL10n = import("./interfaces").IL10n;
export const GenericL10n: null;
/** @typedef {import("./interfaces").IL10n} IL10n */

@@ -9,4 +10,4 @@ /**

export class L10n implements IL10n {
static "__#52@#fixupLangCode"(langCode: any): any;
static "__#52@#isRTL"(lang: any): boolean;
static "__#57@#fixupLangCode"(langCode: any): any;
static "__#57@#isRTL"(lang: any): boolean;
constructor({ lang, isRTL }: {

@@ -13,0 +14,0 @@ lang: any;

@@ -105,6 +105,5 @@ export type PDFDocumentProxy = import("../src/display/api").PDFDocumentProxy;

_resumePageIdx: any;
_firstPageCapability: PromiseCapability | undefined;
_firstPageCapability: PromiseWithResolvers<any> | undefined;
_rawQuery: any;
#private;
}
import { PromiseCapability } from "../src/pdf";

@@ -78,3 +78,3 @@ export type ExternalLinkParameters = {

export class PDFLinkService implements IPDFLinkService {
static "__#49@#isValidExplicitDestination"(dest: any): boolean;
static "__#54@#isValidExplicitDestination"(dest: any): boolean;
/**

@@ -81,0 +81,0 @@ * @param {PDFLinkServiceOptions} options

@@ -58,10 +58,5 @@ export type PageViewport = import("../src/display/display_utils").PageViewport;

/**
* - Allows to use an
* OffscreenCanvas if needed.
*/
isOffscreenCanvasSupported?: boolean | undefined;
/**
* - The maximum supported canvas size in
* total pixels, i.e. width * height. Use `-1` for no limit, or `0` for
* CSS-only zooming. The default value is 4096 * 4096 (16 mega-pixels).
* CSS-only zooming. The default value is 4096 * 8192 (32 mega-pixels).
*/

@@ -103,3 +98,2 @@ maxCanvasPixels?: number | undefined;

imageResourcesPath: string;
isOffscreenCanvasSupported: boolean;
maxCanvasPixels: any;

@@ -109,10 +103,3 @@ pageColors: Object | null;

renderingQueue: import("./pdf_rendering_queue").PDFRenderingQueue | undefined;
l10n: {
getLanguage(): any;
getDirection(): any;
get(ids: any, args: null | undefined, fallback: any): Promise<any>;
translate(element: any): Promise<any>;
pause(): any;
resume(): any;
};
l10n: any;
renderTask: any;

@@ -119,0 +106,0 @@ resume: (() => void) | null;

@@ -84,10 +84,2 @@ export type OptionalContentConfig = import("../src/display/optional_content_config").OptionalContentConfig;

cancelRendering(): void;
/**
* @private
*/
private _getPageDrawContext;
/**
* @private
*/
private _convertCanvasToImage;
image: HTMLImageElement | undefined;

@@ -97,6 +89,2 @@ draw(): Promise<any>;

/**
* @private
*/
private _reduceImage;
/**
* @param {string|null} label

@@ -123,5 +111,5 @@ */

export class TempImageFactory {
static "__#62@#tempCanvas": null;
static "__#66@#tempCanvas": null;
static getCanvas(width: any, height: any): (HTMLCanvasElement | CanvasRenderingContext2D | null)[];
static destroyCanvas(): void;
}

@@ -62,11 +62,3 @@ export type PDFDocumentProxy = import("../src/display/api").PDFDocumentProxy;

};
/**
* @private
*/
private _scrollUpdated;
getThumbnail(index: any): any;
/**
* @private
*/
private _getVisibleThumbs;
scrollThumbnailIntoView(pageNumber: any): void;

@@ -78,6 +70,2 @@ _currentPageNumber: any;

cleanup(): void;
/**
* @private
*/
private _resetView;
_thumbnails: any[] | undefined;

@@ -91,6 +79,2 @@ _pageLabels: any[] | null | undefined;

/**
* @private
*/
private _cancelRendering;
/**
* @param {Array|null} labels

@@ -97,0 +81,0 @@ */

@@ -7,3 +7,2 @@ import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";

import { LinkTarget } from "./pdf_link_service.js";
import { NullL10n } from "./l10n_utils.js";
import { parseQueryString } from "./ui_utils.js";

@@ -25,2 +24,2 @@ import { PDFFindController } from "./pdf_find_controller.js";

import { XfaLayerBuilder } from "./xfa_layer_builder.js";
export { AnnotationLayerBuilder, DownloadManager, EventBus, FindState, GenericL10n, LinkTarget, NullL10n, parseQueryString, PDFFindController, PDFHistory, PDFLinkService, PDFPageView, PDFScriptingManager, PDFSinglePageViewer, PDFViewer, ProgressBar, RenderingStates, ScrollMode, SimpleLinkService, SpreadMode, StructTreeLayerBuilder, TextLayerBuilder, XfaLayerBuilder };
export { AnnotationLayerBuilder, DownloadManager, EventBus, FindState, GenericL10n, LinkTarget, parseQueryString, PDFFindController, PDFHistory, PDFLinkService, PDFPageView, PDFScriptingManager, PDFSinglePageViewer, PDFViewer, ProgressBar, RenderingStates, ScrollMode, SimpleLinkService, SpreadMode, StructTreeLayerBuilder, TextLayerBuilder, XfaLayerBuilder };

@@ -88,10 +88,5 @@ export type PDFDocumentProxy = import("../src/display/api").PDFDocumentProxy;

/**
* - Allows to use an
* OffscreenCanvas if needed.
*/
isOffscreenCanvasSupported?: boolean | undefined;
/**
* - The maximum supported canvas size in
* total pixels, i.e. width * height. Use `-1` for no limit, or `0` for
* CSS-only zooming. The default value is 4096 * 4096 (16 mega-pixels).
* CSS-only zooming. The default value is 4096 * 8192 (32 mega-pixels).
*/

@@ -152,7 +147,5 @@ maxCanvasPixels?: number | undefined;

* landscape pages upon printing. The default is `false`.
* @property {boolean} [isOffscreenCanvasSupported] - Allows to use an
* OffscreenCanvas if needed.
* @property {number} [maxCanvasPixels] - The maximum supported canvas size in
* total pixels, i.e. width * height. Use `-1` for no limit, or `0` for
* CSS-only zooming. The default value is 4096 * 4096 (16 mega-pixels).
* CSS-only zooming. The default value is 4096 * 8192 (32 mega-pixels).
* @property {IL10n} [l10n] - Localization service.

@@ -198,12 +191,4 @@ * @property {boolean} [enablePermissions] - Enables PDF document permissions,

removePageBorders: boolean | undefined;
isOffscreenCanvasSupported: boolean;
maxCanvasPixels: number | undefined;
l10n: {
getLanguage(): any;
getDirection(): any;
get(ids: any, args: null | undefined, fallback: any): Promise<any>;
translate(element: any): Promise<any>;
pause(): any;
resume(): any;
};
l10n: any;
pageColors: Object | null;

@@ -314,5 +299,5 @@ defaultRenderingQueue: boolean;

} | null | undefined;
_firstPageCapability: PromiseCapability | undefined;
_onePageRenderedCapability: PromiseCapability | undefined;
_pagesCapability: PromiseCapability | undefined;
_firstPageCapability: PromiseWithResolvers<any> | undefined;
_onePageRenderedCapability: PromiseWithResolvers<any> | undefined;
_pagesCapability: PromiseWithResolvers<any> | undefined;
_previousScrollMode: any;

@@ -504,2 +489,1 @@ _spreadMode: any;

import { SimpleLinkService } from "./pdf_link_service.js";
import { PromiseCapability } from "../src/pdf";

@@ -17,3 +17,3 @@ /**

*/
static "__#4@#compareElementPositions"(e1: HTMLElement, e2: HTMLElement): number;
static "__#6@#compareElementPositions"(e1: HTMLElement, e2: HTMLElement): number;
setTextMapping(textDivs: any): void;

@@ -20,0 +20,0 @@ /**

@@ -12,7 +12,3 @@ export type PageViewport = import("../src/display/display_utils").PageViewport;

accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
/**
* - Allows to use an
* OffscreenCanvas if needed.
*/
isOffscreenCanvasSupported?: boolean | undefined;
onAppend?: Function | undefined;
};

@@ -24,4 +20,3 @@ /**

* @property {TextAccessibilityManager} [accessibilityManager]
* @property {boolean} [isOffscreenCanvasSupported] - Allows to use an
* OffscreenCanvas if needed.
* @property {function} [onAppend]
*/

@@ -34,7 +29,7 @@ /**

export class TextLayerBuilder {
constructor({ highlighter, accessibilityManager, isOffscreenCanvasSupported, enablePermissions, }: {
constructor({ highlighter, accessibilityManager, enablePermissions, onAppend, }: {
highlighter?: null | undefined;
accessibilityManager?: null | undefined;
isOffscreenCanvasSupported?: boolean | undefined;
enablePermissions?: boolean | undefined;
onAppend?: null | undefined;
});

@@ -48,8 +43,2 @@ textContentItemsStr: any[];

accessibilityManager: any;
isOffscreenCanvasSupported: boolean;
/**
* Callback used to attach the textLayer to the DOM.
* @type {function}
*/
onAppend: Function;
div: HTMLDivElement;

@@ -56,0 +45,0 @@ get numTextDivs(): number;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc