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

0.4.4 • Public • Published

Installation

npm install --save @types/uploadcare

Summary

This package contains type definitions for uploadcare (https://github.com/rexmorgan/uploadcare-node).

Details

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

index.d.ts

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

import { ReadStream } from "fs";

declare namespace Uploadcare {
    interface File {
        original_file_url: string;
        image_info: ImageInfo;
        mime_type: string;
        is_ready: boolean;
        url: string;
        uuid: string;
        original_filename: string;
        datetime_uploaded: string;
        size: number;
        is_image: boolean;
        datetime_stored: string;
        datetime_removed: string | null;
    }

    interface ImageInfo {
        orientation: null;
        sequence: boolean;
        format: string;
        height: number;
        width: number;
        geo_location: null;
        datetime_original: null;
        dpi: number[];
    }

    interface Instance {
        file: {
            upload: (
                readStream: ReadStream,
                options: { store?: boolean | undefined },
                callback: (err: Error, res: { file: string }) => void,
            ) => void;
            fromUrl: (
                url: string,
                options: { store?: boolean | undefined },
                callback: (err: Error, res: File) => void,
            ) => void;
        };
        files: {
            store: (
                uuid: string,
                callback: (err: Error, res: File) => void,
            ) => void;
            remove: (
                uuid: string,
                callback: (err: Error, res: File) => void,
            ) => void;
        };
    }
}

declare function Uploadcare(
    publicKey: string,
    privateKey: string,
): Uploadcare.Instance;

export = Uploadcare;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Jinesh Shah.

Dependents (2)

Package Sidebar

Install

npm i @types/uploadcare

Weekly Downloads

375

Version

0.4.4

License

MIT

Unpacked Size

5.85 kB

Total Files

5

Last publish

Collaborators

  • types