@types/lqip-modern
TypeScript icon, indicating that this package has built-in type declarations

1.1.7 • Public • Published

Installation

npm install --save @types/lqip-modern

Summary

This package contains type definitions for lqip-modern (https://github.com/transitive-bullshit/lqip-modern/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lqip-modern.

index.d.ts

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

import sharp = require("sharp");

declare namespace lqip {
    interface LqipResult {
        content: Buffer;
        metadata: {
            originalWidth: number;
            originalHeight: number;
            width: number;
            height: number;
            type: OutputFormat;
            dataURIBase64: string;
        };
    }

    type OutputFormat = WebpOptions["outputFormat"] | JpegOptions["outputFormat"] | JpgOptions["outputFormat"];

    type LqipOptions = WebpOptions | JpegOptions | JpgOptions | DefaultOptions;

    interface DefaultOptions {
        concurrency?: number | undefined;
        resize?: number | readonly any[] | undefined;
    }

    interface WebpOptions extends DefaultOptions {
        readonly outputFormat?: "webp" | undefined;
        readonly outputOptions?: sharp.WebpOptions | undefined;
    }
    interface JpegOptions extends DefaultOptions {
        readonly outputFormat: "jpeg";
        readonly outputOptions?: sharp.JpegOptions | undefined;
    }
    interface JpgOptions extends DefaultOptions {
        readonly outputFormat: "jpg";
        readonly outputOptions?: sharp.JpegOptions | undefined;
    }
}

declare function lqip(input: string | Buffer, options?: lqip.LqipOptions): Promise<lqip.LqipResult>;
declare function lqip(
    input: readonly string[] | readonly Buffer[],
    options?: lqip.LqipOptions,
): Promise<lqip.LqipResult[]>;

export = lqip;

Additional Details

Credits

These definitions were written by Yaroslav Kiliba.

Versions

Current Tags

Version History

Package Sidebar

Install

npm i @types/lqip-modern

Weekly Downloads

496

Version

1.1.7

License

MIT

Unpacked Size

5.63 kB

Total Files

5

Last publish

Collaborators

  • types