import { EventEmitter } from '../../stencil-public-runtime'; import { FileTileSize, FileTileState } from '../../utils/constants'; export declare class NvFiletile { private readonly messageId; /****************************************************************************/ /** * Name of the file, extension included. It is also the accessible name of * the tile and is inserted in the labels of its actions. */ readonly fileName?: string; /** * Size of the file in bytes. It is formatted for the user's language, for * example "1.2 MB" in English and "1,2 Mo" in French. */ readonly fileSize?: number; /** * Type of the file, as an extension ("pdf") or a MIME type * ("application/pdf"). It selects the icon. When omitted, the type is read * from the extension of `fileName`. */ readonly fileType?: string; /** * Where the file stands. `queued`, the default, waits to be sent and shows * no status, so a tile never claims a success it was not given. `uploading` shows the * progress, `processing` shows an indeterminate bar while the server works * on the file, `complete` shows a check, `error` is a failed upload that can * be retried and `invalid` is a file rejected by validation. */ readonly state: `${FileTileState}`; /** * Upload progress between 0 and 100. Only shown while `state` is * `uploading`. */ readonly progress: number; /** * Text shown under the file name. In the `error` and `invalid` states it is * styled as an error and should name the reason, for example * "File too large — max 10 MB". */ readonly message?: string; /** * Density of the tile. Use `sm` in dense layouts and narrow containers. */ readonly size: `${FileTileSize}`; /** * Hides every action. Use it to list files that can no longer be changed. */ readonly readonly: boolean; /** * Keeps the actions visible but prevents the user from using them. */ readonly disabled: boolean; /** * Language of the built-in texts and of the file size, for example "fr" or * "nl-BE". It covers the action labels, the status announced once the upload * completed and the accessible name of the progress bar. If not provided, * the browser language is used. */ readonly locale?: string; /** * Accessible name of the cancel action, read by screen readers on the * trailing icon button while the file is uploading. It is not displayed. * `{fileName}` is replaced by the file name. Defaults to a text in the * language set by `locale`. */ readonly cancelAriaLabel?: string; /** * Accessible name of the remove action, read by screen readers on the * trailing icon button. It is not displayed. `{fileName}` is replaced by * the file name. Defaults to a text in the language set by `locale`. */ readonly removeAriaLabel?: string; /** * Visible text of the retry link shown in the `error` state. Screen readers * read it followed by the file name. Defaults to a text in the language set * by `locale`. */ readonly retryLabel?: string; /****************************************************************************/ /** * Emitted when the user cancels an upload in progress. */ cancelClicked: EventEmitter; /** * Emitted when the user removes the file. */ removeClicked: EventEmitter; /** * Emitted when the user retries a failed upload. */ retryClicked: EventEmitter; /****************************************************************************/ /** * Tells whether the tile is in one of the two error states. * @returns {boolean} True for `error` and `invalid`. */ private hasError; /** * Resolves the icon shown before the file name. * @returns {IconName} The alert icon for a rejected file, the type icon otherwise. */ private getIcon; /** * Emits the event of the trailing action: cancel while uploading, remove * in every other state. */ private handleActionClick; /** * Emits the retry event. */ private handleRetryClick; /****************************************************************************/ render(): any; }