import * as React from 'react'; import { Components } from '@singularsystems/neo-core'; import { FileContext, IFileComponentProps } from './FileContext'; import { IButtonOptions } from '@singularsystems/neo-core/dist/Components/ButtonOptions'; import ComponentBase from '../ComponentBase'; import { AxiosPromise } from 'axios'; export interface IFileEditorProps extends IFileComponentProps, Partial { /** Browse button options */ browseButton?: IButtonOptions; /** Set this if you want to allow the user to choose a new file. */ changeFileText?: string; /** Text to show in the download link. Use {0} as a placeholder for fileName */ downloadLinkText?: string; /** * Path of API endpoint which will handle downloading a file. Only required if downloadLinkText is specified. * Use `downloadEndpointAsync` when asynchronously returning a download link with sas token. */ downloadEndpoint?: string | ((fileID: any) => string); /** * Path of API endpoint which will handle downloading a file. Only required if downloadLinkText is specified. */ downloadEndpointAsync?: ((fileId: any) => Promise) | ((fileId: any) => AxiosPromise); isReadOnly?: boolean; /** Placeholder text for drag here... */ placeholder?: string; } /** * The file manager component manages uploading, and binding of files to a model. */ export default class FileInput extends ComponentBase { static contextType: React.Context; context: React.ContextType; private fileManager; private gettingDownloadUrl; constructor(props: IFileEditorProps); render(): React.JSX.Element; private getFileDisplayComponent; /** Renders when the file is busy uploading. */ private renderBusy; /** Renders where a file has not yet been selected. */ private renderEmpty; /** Renders where a file has been selected. */ private renderSelected; private onDownloadLinkClicked; }