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).

40 lines (39 loc) 1.21 kB
import { Dispatch, SetStateAction } from 'react'; import { Connection } from '..'; import { File } from '../types/File'; 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 available (callable) connections */ connections: Connection[]; /** * The currently active connection */ connection: Connection; /** * The function to update the active connection */ setConnection: Dispatch<SetStateAction<Connection | undefined>>; /** * File to save. Forces the FilePicker to go in "Upload" mode and select the folder to upload the provided file */ fileToSave: File; } declare const FilesContainer: ({ appId, consumerId, jwt, onSelect, connections, connection, setConnection, fileToSave }: Props) => JSX.Element; export default FilesContainer;