UNPKG

868 BTypeScriptView Raw
1/// <reference types="react" />
2import type { Font } from "./font";
3export interface ITriggerProps<T> {
4 onClick: (event?: unknown) => void;
5 ref: (v: T) => void;
6}
7export interface IReactToPrintProps {
8 bodyClass?: string;
9 children?: React.ReactNode;
10 content?: () => React.ReactInstance | null;
11 copyStyles?: boolean;
12 documentTitle?: string;
13 fonts?: Font[];
14 nonce?: string;
15 onAfterPrint?: () => void;
16 onBeforeGetContent?: () => void | Promise<any>;
17 onBeforePrint?: () => void | Promise<any>;
18 onPrintError?: (errorLocation: "onBeforeGetContent" | "onBeforePrint" | "print", error: Error) => void;
19 pageStyle?: string | (() => string);
20 print?: (target: HTMLIFrameElement) => Promise<any>;
21 removeAfterPrint?: boolean;
22 suppressErrors?: boolean;
23 trigger?: <T>() => React.ReactElement<ITriggerProps<T>>;
24}