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

1.0.8 • Public • Published

Installation

npm install --save @types/dropbox-chooser

Summary

This package contains type definitions for dropbox-chooser (https://www.dropbox.com/developers/chooser).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dropbox-chooser.

index.d.ts

declare namespace Dropbox {
    interface Chooser {
        choose(options: ChooserOptions): void;
    }

    interface ChooserOptions {
        // called when a user selects an item in the Chooser
        success(files: readonly ChooserFile[]): void;

        // called when the user closes the dialog without selecting a file
        cancel?(): void;

        // default: 'preview'
        linkType?: "preview" | "direct" | undefined;

        // default: false
        multiselect?: boolean | undefined;

        // eg. '.png'
        extensions?: string[] | undefined;

        // default: false
        folderselect?: boolean | undefined;

        // any positive number
        sizeLimit?: number | undefined;
    }

    interface ChooserFile {
        // Unique ID for the file, compatible with Dropbox API v2.
        id: string;

        // Name of the file.
        name: string;

        // URL to access the file, which varies depending on the linkType specified when the
        // Chooser was triggered.
        link: string;

        // Size of the file in bytes.
        bytes: number;

        // URL to a 64x64px icon for the file based on the file's extension.
        icon: string;

        // A thumbnail URL generated when the user selects images and videos.
        // If the user didn't select an image or video, no thumbnail will be included.
        thumbnailLink?: string | undefined;

        // whether or not the file is actually a directory
        isDir: boolean;
    }

    // Refer to "Handling the response" section of: https://www.dropbox.com/developers/chooser
    type ChooserFileBoundingBox = 75 | 256 | 800 | 1280 | 2048;
    type ChooserFileMode = "fit" | "crop" | "fit_one_and_overflow";
}

interface Window {
    Dropbox?: Dropbox.Chooser | undefined;
}

Additional Details

  • Last updated: Tue, 30 Jan 2024 21:35:45 GMT
  • Dependencies: none

Credits

These definitions were written by Michael Su.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/dropbox-chooser

Weekly Downloads

13,396

Version

1.0.8

License

MIT

Unpacked Size

6.17 kB

Total Files

5

Last publish

Collaborators

  • types