Nashville Plays Music

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

    0.4.1 • 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

    // Type definitions for uploadcare 0.4
    // Project: https://github.com/rexmorgan/uploadcare-node
    // Definitions by: Jinesh Shah <https://github.com/jineshshah36>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    /// <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: Fri, 02 Jul 2021 18:04:51 GMT
    • Dependencies: @types/node
    • Global values: none

    Credits

    These definitions were written by Jinesh Shah.

    Keywords

    none

    Install

    npm i @types/uploadcare

    DownloadsWeekly Downloads

    479

    Version

    0.4.1

    License

    MIT

    Unpacked Size

    6.32 kB

    Total Files

    4

    Last publish

    Collaborators

    • types