mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-25 16:11:24 +08:00
Merge pull request #3027 from jimmejardine/master
Improved return type of getTextContent():
This commit is contained in:
16
pdf/pdf.d.ts
vendored
16
pdf/pdf.d.ts
vendored
@@ -255,7 +255,7 @@ interface PDFPageProxy {
|
||||
/**
|
||||
* A promise that is resolved with the string that is the text content frm the page.
|
||||
**/
|
||||
getTextContext(): PDFPromise<string>;
|
||||
getTextContent(): PDFPromise<TextContent>;
|
||||
|
||||
/**
|
||||
* marked as future feature
|
||||
@@ -268,6 +268,20 @@ interface PDFPageProxy {
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface TextContentItem {
|
||||
str: string;
|
||||
transform: number[]; // [0..5] 4=x, 5=y
|
||||
width: number;
|
||||
height: number;
|
||||
dir: string; // Left-to-right (ltr), etc
|
||||
fontName: string; // A lookup into the styles map of the owning TextContent
|
||||
}
|
||||
|
||||
interface TextContent {
|
||||
items: TextContentItem[];
|
||||
styles: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* A PDF document and page is built of many objects. E.g. there are objects for fonts, images, rendering code and such. These objects might get processed inside of a worker. The `PDFObjects` implements some basic functions to manage these objects.
|
||||
**/
|
||||
|
||||
Reference in New Issue
Block a user