1.0.8 • Published 3 months ago

@types/dropbox-chooser v1.0.8

Weekly downloads
19,459
License
MIT
Repository
github
Last release
3 months ago

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

// Type definitions for non-npm package Dropbox Chooser 1.0
// Project: https://www.dropbox.com/developers/chooser
// Definitions by: Michael Su <https://github.com/quas94>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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

    interface ChooserOptions {
        // called when a user selects an item in the Chooser
        success(files: ReadonlyArray<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: Thu, 08 Jul 2021 09:08:55 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Michael Su.

1.0.8

3 months ago

1.0.7

5 months ago

1.0.6

6 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

3 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

6 years ago