forked from Henco1/pdf2image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
91 lines (87 loc) · 1.84 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Type definitions for pdf2pic
// Project: https://github.com/yakovmeister/pdf2image
// Definitions by: Jihoon Lee <https://github.com/NoMoreViolence>
// TypeScript Version: 3.7.5
declare module "pdf2pic" {
interface Pdf2picConstructor {
/**
* output pixels per inch */
density: number;
/**
* output file name
*/
savename: string;
/**
* output file location
*/
savedir: string;
/**
* output file format
*/
format: "png" | "jpg" | "jpeg";
/**
* output size in pixels
* example 768x512
*/
size: string;
}
export interface ConvertResult {
/**
* file name
*/
name: string;
/**
* file size
*/
size: number;
/**
* file path
*/
path: string;
page: number;
}
export interface ConvertBase64Result {
/**
* image uri
*/
base64: string;
page: number;
}
class Pdf2pic {
constructor(option?: Pdf2picConstructor);
/**
*
* @param pdfPath path to file
* @param page specific page to convert
*/
public convert(pdfPath: string, page?: number): Promise<ConvertResult>;
/**
*
* @param pdfPath path to file
* @param page page number to be converted (-1 for all pages)
*/
public convertBulk(
pdfPath: string,
page?: number | number[]
): Promise<ConvertResult[]>;
/**
*
* @param pdfPath path to file
* @param page specific page to convert
*/
public convertToBase64(
pdfPath: string,
page?: number
): Promise<ConvertBase64Result>;
/**
*
* @param pdfPath path to file
* @param page page number to be converted (-1 for all pages)
*/
public convertToBase64Bulk(
pdfPath: string,
page?: number
): Promise<ConvertBase64Result[]>;
}
export default Pdf2pic;
}