npm.io
1.0.4 • Published 2 years ago

@types/pdf-thumbnail

Licence
MIT
Version
1.0.4
Deps
1
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/pdf-thumbnail

Summary

This package contains type definitions for pdf-thumbnail (https://github.com/nicoFuccella/pdf-thumbnail#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pdf-thumbnail.

index.d.ts

/// <reference types="node" />

declare namespace pdf {
    type Operations = "compress" | "crop" | "resize";

    interface CompressParams {
        type?: string | undefined;
        quality?: number | undefined;
    }

    interface CropParams {
        width: number;
        height: number;
        x: number;
        y: number;
        ratio?: boolean | undefined;
    }

    interface ResizeParams {
        width?: number | undefined;
        height?: number | undefined;
    }

    interface OperationsParams {
        compress: CompressParams;
        crop: CropParams;
        resize: ResizeParams;
    }

    type PDFThumbnailOptions = {
        [op in Operations]?: OperationsParams[op];
    };
}

declare function pdf(
    body: NodeJS.ReadableStream | Buffer | string,
    options?: pdf.PDFThumbnailOptions,
): Promise<NodeJS.ReadableStream>;

export = pdf;

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Kirill Koshil.