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.