@types/pdfjs-dist
Advanced tools
Comparing version 2.1.4 to 2.1.5
// Type definitions for PDF.js v2.1 | ||
// Project: https://github.com/mozilla/pdf.js | ||
// Definitions by: Josh Baldwin <https://github.com/jbaldwin>, Dmitrii Sorin <https://github.com/1999> | ||
// Definitions by: Josh Baldwin <https://github.com/jbaldwin> | ||
// Dmitrii Sorin <https://github.com/1999> | ||
// Kamil Socha <https://github.com/ksocha> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -14,3 +16,3 @@ // TypeScript Version: 3.0 | ||
interface GlobalWorkerOptions { | ||
workerSrc: string; | ||
workerSrc: string; | ||
} | ||
@@ -39,3 +41,3 @@ | ||
IsXFAPresent: boolean; | ||
[key: string]: any; // return type is string, typescript chokes | ||
[key: string]: any; // return type is string, typescript chokes | ||
} | ||
@@ -50,3 +52,3 @@ | ||
interface PDFDataRangeTransportListener { | ||
(loaded: number, total: number): void | ||
(loaded: number, total: number): void; | ||
} | ||
@@ -56,49 +58,51 @@ | ||
ERRORS = 0, | ||
WARNINGS= 1, | ||
INFOS= 5, | ||
WARNINGS = 1, | ||
INFOS = 5, | ||
} | ||
declare class PDFDataRangeTransport { | ||
constructor(length: number, initialData: Uint8Array|BufferSource, progressiveDone?: boolean); | ||
addRangeListener(listener: PDFDataRangeTransportListener):void | ||
addProgressListener(listener: PDFDataRangeTransportListener): void | ||
addProgressiveReadListener(listener: PDFDataRangeTransportListener): void | ||
addProgressiveDoneListener(listener: PDFDataRangeTransportListener): void | ||
onDataRange(begin: number, chunk: unknown): void | ||
onDataProgress(loaded: number, total: number): void | ||
onDataProgressiveRead(chunk: unknown): void | ||
onDataProgressiveDone(): void | ||
transportReady() : void | ||
requestDataRange(begin: number, end: number): void | ||
abort(): void | ||
constructor(length: number, initialData: Uint8Array | BufferSource, progressiveDone?: boolean); | ||
addRangeListener(listener: PDFDataRangeTransportListener): void; | ||
addProgressListener(listener: PDFDataRangeTransportListener): void; | ||
addProgressiveReadListener(listener: PDFDataRangeTransportListener): void; | ||
addProgressiveDoneListener(listener: PDFDataRangeTransportListener): void; | ||
onDataRange(begin: number, chunk: unknown): void; | ||
onDataProgress(loaded: number, total: number): void; | ||
onDataProgressiveRead(chunk: unknown): void; | ||
onDataProgressiveDone(): void; | ||
transportReady(): void; | ||
requestDataRange(begin: number, end: number): void; | ||
abort(): void; | ||
} | ||
interface PDFWorkerParameters { | ||
name?: string | ||
port?: any | ||
verbosity?: VerbosityLevel | ||
name?: string; | ||
port?: any; | ||
verbosity?: VerbosityLevel; | ||
} | ||
declare class PDFWorker { | ||
constructor(params?: PDFWorkerParameters) | ||
readonly promise: Promise<unknown> | ||
readonly port: any |null | ||
readonly messageHandler: unknown | null | ||
destroy(): void | ||
static fromPort(params?: PDFWorkerParameters): PDFWorker | ||
static getWorkerSrc(): string | ||
constructor(params?: PDFWorkerParameters); | ||
readonly promise: Promise<unknown>; | ||
readonly port: any | null; | ||
readonly messageHandler: unknown | null; | ||
destroy(): void; | ||
static fromPort(params?: PDFWorkerParameters): PDFWorker; | ||
static getWorkerSrc(): string; | ||
} | ||
declare enum CMapCompressionType { | ||
declare enum CMapCompressionType { | ||
NONE = 0, | ||
BINARY= 1, | ||
STREAM= 2, | ||
} | ||
BINARY = 1, | ||
STREAM = 2, | ||
} | ||
interface CMapReaderFactory { | ||
new (params: {baseUrl: string, isCompressed: boolean}): CMapReader | ||
new (params: { baseUrl: string; isCompressed: boolean }): CMapReader; | ||
} | ||
interface CMapReader { | ||
fetch(params: {name: string}): Promise<{ | ||
cMapData: any, | ||
compressionType: CMapCompressionType | ||
}> | ||
fetch(params: { | ||
name: string; | ||
}): Promise<{ | ||
cMapData: any; | ||
compressionType: CMapCompressionType; | ||
}>; | ||
} | ||
@@ -118,3 +122,3 @@ interface PDFSource { | ||
httpHeaders?: { | ||
[key: string]: string | ||
[key: string]: string; | ||
}; | ||
@@ -126,16 +130,16 @@ /** | ||
/** | ||
* Indicates whether or not cross-site | ||
* Access-Control requests should be made using credentials such as cookies | ||
* or authorization headers. The default is false. | ||
*/ | ||
* Indicates whether or not cross-site | ||
* Access-Control requests should be made using credentials such as cookies | ||
* or authorization headers. The default is false. | ||
*/ | ||
withCredentials?: boolean; | ||
/* | ||
* A typed array with the first portion or | ||
* all of the pdf data. Used by the extension since some data is already | ||
* loaded before the switch to range requests. */ | ||
* A typed array with the first portion or | ||
* all of the pdf data. Used by the extension since some data is already | ||
* loaded before the switch to range requests. */ | ||
initialData?: Uint8Array | BufferSource; | ||
/* | ||
* The PDF file length. It's used for progress | ||
* reports and range requests operations. | ||
*/ | ||
* The PDF file length. It's used for progress | ||
* reports and range requests operations. | ||
*/ | ||
length?: number; | ||
@@ -148,3 +152,3 @@ /** range */ | ||
* 2^16 = 65536. */ | ||
rangeChunkSize?: number | ||
rangeChunkSize?: number; | ||
/** | ||
@@ -167,20 +171,20 @@ * The worker that will be used for | ||
/** | ||
* Strategy for | ||
* decoding certain (simple) JPEG images in the browser. This is useful for | ||
* environments without DOM image and canvas support, such as e.g. Node.js. | ||
* Valid values are 'decode', 'display' or 'none'; where 'decode' is intended | ||
* for browsers with full image/canvas support, 'display' for environments | ||
* with limited image support through stubs (useful for SVG conversion), | ||
* and 'none' where JPEG images will be decoded entirely by PDF.js. | ||
* The default value is 'decode'. | ||
*/ | ||
nativeImageDecoderSupport?: "decode"|"display"|"none" | ||
* Strategy for | ||
* decoding certain (simple) JPEG images in the browser. This is useful for | ||
* environments without DOM image and canvas support, such as e.g. Node.js. | ||
* Valid values are 'decode', 'display' or 'none'; where 'decode' is intended | ||
* for browsers with full image/canvas support, 'display' for environments | ||
* with limited image support through stubs (useful for SVG conversion), | ||
* and 'none' where JPEG images will be decoded entirely by PDF.js. | ||
* The default value is 'decode'. | ||
*/ | ||
nativeImageDecoderSupport?: 'decode' | 'display' | 'none'; | ||
/** | ||
* The URL where the predefined | ||
* Adobe CMaps are located. Include trailing slash. */ | ||
cMapUrl?: string | ||
cMapUrl?: string; | ||
/** | ||
* Specifies if the Adobe CMaps are | ||
* binary packed. */ | ||
cMapPacked?: boolean | ||
cMapPacked?: boolean; | ||
/** | ||
@@ -192,3 +196,3 @@ * The factory that will be | ||
*/ | ||
CMapReaderFactory?: any | ||
CMapReaderFactory?: any; | ||
/** | ||
@@ -200,3 +204,3 @@ * Reject certain promises, e.g. | ||
*/ | ||
stopAtErrors?: boolean | ||
stopAtErrors?: boolean; | ||
/** | ||
@@ -207,3 +211,3 @@ * The maximum allowed image size | ||
*/ | ||
maxImageSize?: number | ||
maxImageSize?: number; | ||
/** | ||
@@ -214,3 +218,3 @@ * Determines if we can eval | ||
*/ | ||
isEvalSupported?: boolean | ||
isEvalSupported?: boolean; | ||
/** | ||
@@ -222,3 +226,3 @@ * By default fonts are | ||
*/ | ||
disableFontFace?: boolean | ||
disableFontFace?: boolean; | ||
/** | ||
@@ -230,3 +234,3 @@ * Disable range request loading | ||
*/ | ||
disableRange?: boolean | ||
disableRange?: boolean; | ||
/** | ||
@@ -237,3 +241,3 @@ * Disable streaming of PDF file | ||
*/ | ||
disableStream?: boolean | ||
disableStream?: boolean; | ||
/** | ||
@@ -247,3 +251,3 @@ * Disable pre-fetching of PDF | ||
*/ | ||
disableAutoFetch?: boolean | ||
disableAutoFetch?: boolean; | ||
/** | ||
@@ -254,3 +258,3 @@ * Disable the use of | ||
*/ | ||
disableCreateObjectURL?: boolean | ||
disableCreateObjectURL?: boolean; | ||
/** | ||
@@ -260,3 +264,3 @@ * Enables special hooks for debugging | ||
*/ | ||
pdfBug?: boolean | ||
pdfBug?: boolean; | ||
} | ||
@@ -270,3 +274,2 @@ | ||
interface PDFDocumentProxy { | ||
/** | ||
@@ -404,2 +407,3 @@ * Total number of pages the PDF contains. | ||
imageLayer?: PDFRenderImageLayer; | ||
renderInteractiveForms?: boolean; | ||
continueCallback?: (_continue: () => void) => void; | ||
@@ -417,3 +421,2 @@ } | ||
interface PDFRenderTask extends PDFLoadingTask<PDFPageProxy> { | ||
/** | ||
@@ -426,3 +429,2 @@ * Cancel the rendering task. If the task is currently rendering it will not be cancelled until graphics pauses with a timeout. The promise that this object extends will resolve when cancelled. | ||
interface PDFPageProxy { | ||
/** | ||
@@ -522,3 +524,3 @@ * Page index of the page. First page is 0. | ||
**/ | ||
normalizeRect(rect:number[]): number[]; | ||
normalizeRect(rect: number[]): number[]; | ||
} | ||
@@ -659,6 +661,6 @@ | ||
/** | ||
* yet another viewer, this will render only one page at the time, reducing rendering time | ||
* very important for mobile development | ||
* @params {PDFViewerParams} | ||
*/ | ||
* yet another viewer, this will render only one page at the time, reducing rendering time | ||
* very important for mobile development | ||
* @params {PDFViewerParams} | ||
*/ | ||
PDFSinglePageViewer(params: PDFViewerParams): void; | ||
@@ -688,3 +690,3 @@ } | ||
passwordCallback?: (fn: (password: string) => void, reason: string) => string, | ||
progressCallback?: (progressData: PDFProgressData) => void | ||
progressCallback?: (progressData: PDFProgressData) => void, | ||
): PDFLoadingTask<PDFDocumentProxy>; | ||
@@ -696,3 +698,3 @@ | ||
passwordCallback?: (fn: (password: string) => void, reason: string) => string, | ||
progressCallback?: (progressData: PDFProgressData) => void | ||
progressCallback?: (progressData: PDFProgressData) => void, | ||
): PDFLoadingTask<PDFDocumentProxy>; | ||
@@ -704,3 +706,3 @@ | ||
passwordCallback?: (fn: (password: string) => void, reason: string) => string, | ||
progressCallback?: (progressData: PDFProgressData) => void | ||
progressCallback?: (progressData: PDFProgressData) => void, | ||
): PDFLoadingTask<PDFDocumentProxy>; |
{ | ||
"name": "@types/pdfjs-dist", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"description": "TypeScript definitions for PDF.js", | ||
@@ -16,2 +16,7 @@ "license": "MIT", | ||
"githubUsername": "1999" | ||
}, | ||
{ | ||
"name": "Kamil Socha", | ||
"url": "https://github.com/ksocha", | ||
"githubUsername": "ksocha" | ||
} | ||
@@ -28,4 +33,4 @@ ], | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "f69a8b7c9ef807f72c0509ed04a8697c01911cbc0543cb5e6f1d96ac39c18e37", | ||
"typesPublisherContentHash": "c6f7e161685b20ba6e6a4fc78442eefb98b80ff36a01e3b1c541e0c2ffc99edd", | ||
"typeScriptVersion": "3.0" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Fri, 15 May 2020 11:31:59 GMT | ||
* Last updated: Mon, 20 Jul 2020 20:48:46 GMT | ||
* Dependencies: none | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by [Josh Baldwin](https://github.com/jbaldwin), and [Dmitrii Sorin](https://github.com/1999). | ||
These definitions were written by [Josh Baldwin](https://github.com/jbaldwin), [Dmitrii Sorin](https://github.com/1999), and [Kamil Socha](https://github.com/ksocha). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23668
602