@types/jsreport-phantom-pdf
TypeScript icon, indicating that this package has built-in type declarations

1.4.6 • Public • Published

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

Credits

These definitions were written by taoqf.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/jsreport-phantom-pdf

Weekly Downloads

50

Version

1.4.6

License

MIT

Unpacked Size

6.09 kB

Total Files

5

Last publish

Collaborators

  • types