UNPKG

use-file-picker

Version:

Simple react hook to open browser file selector.

13 lines (9 loc) 1.05 kB
import { U as UseFilePickerConfig, F as FilePickerReturnTypes, E as ExtractContentTypeFromConfig, u as useImperativeFilePickerConfig, I as ImperativeFilePickerReturnTypes } from './interfaces-DZ8vOLhN.js'; export { a as FileWithPath } from './interfaces-DZ8vOLhN.js'; import 'file-selector'; declare function useFilePicker<CustomErrors = unknown, ConfigType extends UseFilePickerConfig<CustomErrors> = UseFilePickerConfig<CustomErrors>>(props?: ConfigType): FilePickerReturnTypes<ExtractContentTypeFromConfig<ConfigType>, CustomErrors>; /** * A version of useFilePicker hook that keeps selected files between selections. On top of that it allows to remove files from the selection. */ declare function useImperativeFilePicker<CustomErrors = unknown, ConfigType extends useImperativeFilePickerConfig<CustomErrors> = useImperativeFilePickerConfig<CustomErrors>>(props: ConfigType): ImperativeFilePickerReturnTypes<ExtractContentTypeFromConfig<ConfigType>, CustomErrors>; export { UseFilePickerConfig, useFilePicker, useImperativeFilePicker };