UNPKG

@apideck/file-picker

Version:

A React file picker component that works with the Apideck [File Storage API](https://developers.apideck.com/apis/file-storage/reference).

57 lines (56 loc) 1.54 kB
import React, { ReactElement } from 'react'; import { File } from '../types/File'; export interface Props { /** * The ID of your Unify application */ appId: string; /** * The ID of the consumer which you want to fetch files from */ consumerId: string; /** * The JSON Web Token returned from the Create Session call */ jwt: string; /** * The function that gets called when a file is selected */ onSelect: (file: File) => any; /** * The component that should trigger the File Picker modal on click */ trigger?: ReactElement; /** * Title shown in the modal */ title?: string; /** * Subtitle shown in the modal */ subTitle?: string; /** * Show powered by Apideck in the modal backdrop */ showAttribution?: boolean; /** * Opens the file picker if set to true */ open?: boolean; /** * Callback function that gets called when the modal is closed */ onClose?: () => any; /** * File to save. Forces the FilePicker to go in "Upload" mode and only * allows to change the file name and select the folder to upload the provided file to */ fileToSave: File; } export declare const EventsContext: React.Context<{ onSelect: undefined; }>; /** * The Apideck File Picker component */ export declare const FilePicker: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;