import { ThemeTypes } from '@viasat/beam-shared/utils/constants'; import { default as List } from './FileUpload.List'; import { FileUploadButtonComponent } from './FileUpload.Button'; import { FileUploadDropzoneComponent } from './FileUpload.Dropzone'; import { FileActions } from '@viasat/beam-shared/components/fileUpload'; import { default as React } from 'react'; import { FormValidator } from '@viasat/beam-shared/components/form'; export interface FileUploadProps extends React.ComponentPropsWithRef<'input'> { /** * Specify what types of files can be uploaded */ accept?: string; /** * Specify Label for FileUpload */ label?: React.ReactNode; /** * Specify HelperText for FileUpload */ helperText?: React.ReactNode; /** * Specify error text and display error state of FileUpload */ error?: string | boolean; /** * Specify if FileUpload is in disabled state * @default false */ disabled?: boolean; /** * Specify if more than one file can be can be uploaded * @default false */ multiple?: boolean; /** * Specify how many files can be uploaded */ fileLimit?: number; /** * Specify the maximum file size that can be uploaded */ maxFileSize?: number; /** * Specify if FileUpload is a required input * @default false */ required?: boolean; /** * Specify if FileUpload is in read-only state */ readOnly?: boolean; /** * Specify if FileUpload displays with an asterisk * @default false */ hideRequiredMarker?: boolean; /** * Specify form validation rules for Select */ validationRules?: Array; /** * Specify if FileUpload is fluid * @default false */ fluid?: boolean; /** * Specify the width of FileUpload */ width?: string; /** * Specify the callback function that is called when a file is uploaded. Setting this prop will make upload asynchronous. * The `actions` argument exposes `progress(percent: number)`, `success()`, * `error(message: string)`, and `dismiss()` to report upload state back to the * component; `abortSignal` fires when the user cancels the upload. */ onUpload?: (file: File, actions: FileActions, abortSignal: AbortSignal) => void; /** * Specify the theme of the FileUpload. By default it inherits the theme from the parent */ theme?: ThemeTypes; } export declare const FileUploadComponent: React.ForwardRefExoticComponent & React.RefAttributes>; type FileUploadType = typeof FileUploadComponent & { List: typeof List; Button: typeof FileUploadButtonComponent; Dropzone: typeof FileUploadDropzoneComponent; }; declare const FileUpload: FileUploadType; export default FileUpload;