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

5.0.4 • Public • Published

Installation

npm install --save @types/pdf-fill-form

Summary

This package contains type definitions for pdf-fill-form (https://github.com/tpisto/pdf-fill-form#readme).

Details

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

index.d.ts

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

export interface WritableFields {
    [key: string]: string | boolean | number;
}

export type ReadableFields = Array<{
    name: string;
    page: number;
    value: string;
    id: number;
    type: string;
}>;

export interface PdfOptions {
    save?: string | undefined;
    cores?: number | undefined;
    scale?: number | undefined;
    antialias?: boolean | undefined;
}

export interface ImgPdfOptions extends PdfOptions {
    startPage?: number | undefined;
    endPage?: number | undefined;
}

export type Options = PdfOptions | ImgPdfOptions;

export type WriteAsyncCallback = (err: Error, result: Buffer) => void;

export function read(sourceFile: string): Promise<ReadableFields>;
export function readSync(sourceFile: string): ReadableFields;
export function readBuffer(sourceBuffer: Buffer): Promise<ReadableFields>;
export function readBufferSync(sourceBuffer: Buffer): ReadableFields;

export function write(sourceFile: string, fields: WritableFields, options?: Options): Promise<Buffer>;
export function writeSync(sourceFile: string, fields: WritableFields, options?: Options): Buffer;
export function writeBuffer(sourceBuffer: Buffer, fields: WritableFields, options?: Options): Promise<Buffer>;
export function writeBufferSync(sourceBuffer: Buffer, fields: WritableFields, options?: Options): Buffer;

// Options are not optional here because the callback MUST be defined to avoid a crash
export function writeAsync(
    sourceFile: string,
    fields: WritableFields,
    options: Options,
    callback: WriteAsyncCallback,
): void;

Additional Details

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

Credits

These definitions were written by Grégoire Lodi.

Versions

Current Tags

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 5.0.4
    15
  • 5.0.3
    1
  • 5.0.2
    52
  • 5.0.1
    908
  • 5.0.0
    0

Package Sidebar

Install

npm i @types/pdf-fill-form

Weekly Downloads

976

Version

5.0.4

License

MIT

Unpacked Size

5.82 kB

Total Files

5

Last publish

Collaborators

  • types