1.4.6 • Published 7 months ago

@types/jsreport-phantom-pdf v1.4.6

Weekly downloads
312
License
MIT
Repository
github
Last release
7 months ago

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

// Type definitions for jsreport-phantom-pdf 1.4
// Project: https://github.com/jsreport/jsreport-phantom-pdf
// Definitions by: taoqf <https://github.com/taoqf>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

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.

1.4.6

7 months ago

1.4.5

7 months ago

1.4.4

8 months ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

4 years ago

1.4.0

6 years ago