forked from im-salman/react-component-export-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.d.ts
37 lines (31 loc) · 1017 Bytes
/
main.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
declare module 'react-component-export-image' {
import { Options } from 'html2canvas';
import { RefObject, ReactInstance } from 'react';
type PDFOptions = {
x: number;
y: number;
w: number;
h: number;
unit: "pt" | "mm" | "cm" | "m" | "in" | "px";
orientation: 'l' | 'p';
pdfFormat: string | Array<number>;
}
type Params = {
fileName?: string,
html2CanvasOptions?: Partial<Options>,
pdfOptions?: Partial<PDFOptions>,
}
type ExportComponentReturn = Promise<(canvas: HTMLCanvasElement) => void>;
export function exportComponentAsJPEG(
node: RefObject<ReactInstance>,
params?: Params
): ExportComponentReturn;
export function exportComponentAsPDF(
node: RefObject<ReactInstance>,
params?: Params
): ExportComponentReturn;
export function exportComponentAsPNG(
node: RefObject<ReactInstance>,
params?: Params
): ExportComponentReturn;
}