Installation
npm install --save @types/jsreport-phantom-pdf
Summary
This package contains type definitions for jsreport-phantom-pdf (https://github.com/jsreport/jsreport-phantom-pdf).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsreport-phantom-pdf.
index.d.ts
import { ExtensionDefinition, Template } from "jsreport-core";
declare namespace JsReportPhantomPdf {
interface Margin {
left: number | string;
right: number | string;
top: number | string;
bottom: number | string;
}
interface Phantom {
margin: string | Margin;
header: string;
footer: string;
width: string;
height: string;
headerHeight: string;
footerHeight: string;
format: string;
orientation: "portrait" | "landscape";
blockJavaScript: boolean;
resourceTimeout: number;
waitForJS: boolean;
fitToPage: boolean;
customPhantomJS: boolean;
phantomjsVersion: string;
}
// const enum PhantomStrategy {
// dedicatedProcess = 'dedicated-process',
// phantomServer = 'phantom-server'
// }
interface Options {
allowLocalFilesAccess: boolean;
// appDirectory: string;
defaultPhantomjsVersion: string;
strategy: "dedicated-process" | "phantom-server";
timeout: number;
}
// without exporting enum, it doesn't include the require('jsreport-core') in the test.js for some reason
// help welcome
// export enum Foo { }
interface PhantomPDFTemplate extends Template {
phantom?: Partial<Phantom> | undefined;
recipe: "phantom-pdf" | string;
}
}
declare module "jsreport-core" {
interface TemplateRegistry {
PhantomPDFTemplate: JsReportPhantomPdf.PhantomPDFTemplate;
}
}
declare function JsReportPhantomPdf(options?: Partial<JsReportPhantomPdf.Options>): ExtensionDefinition;
export = JsReportPhantomPdf;
Additional Details
- Last updated: Tue, 07 Nov 2023 03:09:37 GMT
- Dependencies: @types/jsreport-core
Credits
These definitions were written by taoqf.