1.1.3 • Published 7 months ago

@types/compress.js v1.1.3

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

Installation

npm install --save @types/compress.js

Summary

This package contains type definitions for compress.js (- (link to the repo is missing)).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/compress.js.

index.d.ts

// Type definitions for compress.js 1.1
// Project: - (link to the repo is missing)
// Definitions by: Yuri Drabik <https://github.com/yurist38>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export = Compress;

declare class Compress {
    attach(
        el: string,
        options: CompressOptions,
    ): Promise<CompressResult[]>;

    compress(
        files: File[],
        options: CompressOptions,
    ): Promise<CompressResult[]>;

    static convertBase64ToFile(
        base64: string,
        mime?: string,
    ): File;
}

interface CompressOptions {
    quality?: number | undefined;
    size?: number | undefined;
    maxWidth?: number | undefined;
    maxHeight?: number | undefined;
    resize?: boolean | undefined;
}

interface CompressResult {
    data: string;
    prefix: string;
    elapsedTimeInSeconds: number;
    alt: string;
    initialSizeInMb: number;
    endSizeInMb: number;
    ext: string;
    quality: number;
    endWidthInPx: number;
    endHeightInPx: number;
    initialWidthInPx: number;
    initialHeightInPx: number;
    sizeReducedInPercent: number;
    iterations: number;
}

Additional Details

  • Last updated: Thu, 08 Jul 2021 09:08:05 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Yuri Drabik.