file-uploader.d.ts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. /*!
  2. * devextreme-angular
  3. * Version: 19.1.16
  4. * Build date: Tue Oct 18 2022
  5. *
  6. * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
  7. *
  8. * This software may be modified and distributed under the terms
  9. * of the MIT license. See the LICENSE file in the root of the project for details.
  10. *
  11. * https://github.com/DevExpress/devextreme-angular
  12. */
  13. import { TransferState } from '@angular/platform-browser';
  14. import { ElementRef, NgZone, OnDestroy, EventEmitter, OnChanges, DoCheck, SimpleChanges } from '@angular/core';
  15. import DxFileUploader from 'devextreme/ui/file_uploader';
  16. import { ControlValueAccessor } from '@angular/forms';
  17. import { DxComponent } from '../core/component';
  18. import { DxTemplateHost } from '../core/template-host';
  19. import { NestedOptionHost } from '../core/nested-option';
  20. import { WatcherHelper } from '../core/watcher-helper';
  21. import { IterableDifferHelper } from '../core/iterable-differ-helper';
  22. /**
  23. * The FileUploader widget enables an end user to upload files to the server. An end user can select files in the file explorer or drag and drop files to the FileUploader area on the page.
  24. */
  25. export declare class DxFileUploaderComponent extends DxComponent implements OnDestroy, ControlValueAccessor, OnChanges, DoCheck {
  26. private _watcherHelper;
  27. private _idh;
  28. instance: DxFileUploader;
  29. /**
  30. * Specifies a file type or several types accepted by the widget.
  31. */
  32. accept: string;
  33. /**
  34. * Specifies the shortcut key that sets focus on the widget.
  35. */
  36. accessKey: string;
  37. /**
  38. * Specifies whether or not the widget changes its state when interacting with a user.
  39. */
  40. activeStateEnabled: boolean;
  41. /**
  42. * Specifies if an end user can remove a file from the selection and interrupt uploading.
  43. */
  44. allowCanceling: boolean;
  45. /**
  46. * Restricts file extensions that can be uploaded to the server.
  47. */
  48. allowedFileExtensions: Array<string>;
  49. /**
  50. * Specifies the chunk size in bytes. Applies only if uploadMode is "instantly" or "useButtons". Requires a server that can process file chunks.
  51. */
  52. chunkSize: number;
  53. /**
  54. * Specifies whether the widget responds to user interaction.
  55. */
  56. disabled: boolean;
  57. /**
  58. * Specifies the attributes to be attached to the widget's root element.
  59. */
  60. elementAttr: any;
  61. /**
  62. * Specifies whether the widget can be focused using keyboard navigation.
  63. */
  64. focusStateEnabled: boolean;
  65. /**
  66. * Specifies the widget's height.
  67. */
  68. height: number | Function | string;
  69. /**
  70. * Specifies text for a hint that appears when a user pauses on the widget.
  71. */
  72. hint: string;
  73. /**
  74. * Specifies whether the widget changes its state when a user pauses on it.
  75. */
  76. hoverStateEnabled: boolean;
  77. /**
  78. * The text displayed when the extension of the file being uploaded is not an allowed file extension.
  79. */
  80. invalidFileExtensionMessage: string;
  81. /**
  82. * The text displayed when the size of the file being uploaded is greater than the maxFileSize.
  83. */
  84. invalidMaxFileSizeMessage: string;
  85. /**
  86. * The text displayed when the size of the file being uploaded is less than the minFileSize.
  87. */
  88. invalidMinFileSizeMessage: string;
  89. /**
  90. * Specifies whether the editor's value is valid.
  91. */
  92. isValid: boolean;
  93. /**
  94. * Specifies the text displayed on the area to which an end-user can drop a file.
  95. */
  96. labelText: string;
  97. /**
  98. * Specifies the maximum file size (in bytes) allowed for uploading. Applies only if uploadMode is "instantly" or "useButtons".
  99. */
  100. maxFileSize: number;
  101. /**
  102. * Specifies the minimum file size (in bytes) allowed for uploading. Applies only if uploadMode is "instantly" or "useButtons".
  103. */
  104. minFileSize: number;
  105. /**
  106. * Specifies whether the widget enables an end-user to select a single file or multiple files.
  107. */
  108. multiple: boolean;
  109. /**
  110. * Specifies the value passed to the name attribute of the underlying input element. Required to access uploaded files on the server.
  111. */
  112. name: string;
  113. /**
  114. * Gets the current progress in percentages.
  115. */
  116. progress: number;
  117. /**
  118. * Specifies whether the editor is read-only.
  119. */
  120. readOnly: boolean;
  121. /**
  122. * The message displayed by the widget when it is ready to upload the specified files.
  123. */
  124. readyToUploadMessage: string;
  125. /**
  126. * Switches the widget to a right-to-left representation.
  127. */
  128. rtlEnabled: boolean;
  129. /**
  130. * The text displayed on the button that opens the file browser.
  131. */
  132. selectButtonText: string;
  133. /**
  134. * Specifies whether or not the widget displays the list of selected files.
  135. */
  136. showFileList: boolean;
  137. /**
  138. * Specifies the number of the element when the Tab key is used for navigating.
  139. */
  140. tabIndex: number;
  141. /**
  142. * The text displayed on the button that starts uploading.
  143. */
  144. uploadButtonText: string;
  145. /**
  146. * The message displayed by the widget when uploading is finished.
  147. */
  148. uploadedMessage: string;
  149. /**
  150. * The message displayed by the widget on uploading failure.
  151. */
  152. uploadFailedMessage: string;
  153. /**
  154. * Specifies headers for the upload request.
  155. */
  156. uploadHeaders: any;
  157. /**
  158. * Specifies the method for the upload request.
  159. */
  160. uploadMethod: string;
  161. /**
  162. * Specifies how the widget uploads files.
  163. */
  164. uploadMode: string;
  165. /**
  166. * Specifies a target Url for the upload request.
  167. */
  168. uploadUrl: string;
  169. /**
  170. * Specifies information on the validation error when using a custom validation engine. Should be changed at runtime along with the isValid option.
  171. */
  172. validationError: any;
  173. /**
  174. * Specifies a File instance representing the selected file. Read-only when uploadMode is "useForm".
  175. */
  176. value: Array<any>;
  177. /**
  178. * Specifies whether the widget is visible.
  179. */
  180. visible: boolean;
  181. /**
  182. * Specifies the widget's width.
  183. */
  184. width: number | Function | string;
  185. /**
  186. * A function that is executed when the widget's content is ready and each time the content is changed.
  187. */
  188. onContentReady: EventEmitter<any>;
  189. /**
  190. * A function that is executed before the widget is disposed of.
  191. */
  192. onDisposing: EventEmitter<any>;
  193. /**
  194. * A function used in JavaScript frameworks to save the widget instance.
  195. */
  196. onInitialized: EventEmitter<any>;
  197. /**
  198. * A function that is executed after a widget option is changed.
  199. */
  200. onOptionChanged: EventEmitter<any>;
  201. /**
  202. * A function that is executed when a file segment is uploaded.
  203. */
  204. onProgress: EventEmitter<any>;
  205. /**
  206. * A function that is executed when the file upload is aborted.
  207. */
  208. onUploadAborted: EventEmitter<any>;
  209. /**
  210. * A function that is executed when a file is successfully uploaded.
  211. */
  212. onUploaded: EventEmitter<any>;
  213. /**
  214. * A function that is executed when an error occurs during the file upload.
  215. */
  216. onUploadError: EventEmitter<any>;
  217. /**
  218. * A function that is executed when the file upload is started.
  219. */
  220. onUploadStarted: EventEmitter<any>;
  221. /**
  222. * A function that is executed when one or several files are added to or removed from the selection.
  223. */
  224. onValueChanged: EventEmitter<any>;
  225. /**
  226. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  227. */
  228. acceptChange: EventEmitter<string>;
  229. /**
  230. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  231. */
  232. accessKeyChange: EventEmitter<string>;
  233. /**
  234. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  235. */
  236. activeStateEnabledChange: EventEmitter<boolean>;
  237. /**
  238. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  239. */
  240. allowCancelingChange: EventEmitter<boolean>;
  241. /**
  242. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  243. */
  244. allowedFileExtensionsChange: EventEmitter<Array<string>>;
  245. /**
  246. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  247. */
  248. chunkSizeChange: EventEmitter<number>;
  249. /**
  250. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  251. */
  252. disabledChange: EventEmitter<boolean>;
  253. /**
  254. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  255. */
  256. elementAttrChange: EventEmitter<any>;
  257. /**
  258. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  259. */
  260. focusStateEnabledChange: EventEmitter<boolean>;
  261. /**
  262. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  263. */
  264. heightChange: EventEmitter<number | Function | string>;
  265. /**
  266. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  267. */
  268. hintChange: EventEmitter<string>;
  269. /**
  270. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  271. */
  272. hoverStateEnabledChange: EventEmitter<boolean>;
  273. /**
  274. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  275. */
  276. invalidFileExtensionMessageChange: EventEmitter<string>;
  277. /**
  278. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  279. */
  280. invalidMaxFileSizeMessageChange: EventEmitter<string>;
  281. /**
  282. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  283. */
  284. invalidMinFileSizeMessageChange: EventEmitter<string>;
  285. /**
  286. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  287. */
  288. isValidChange: EventEmitter<boolean>;
  289. /**
  290. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  291. */
  292. labelTextChange: EventEmitter<string>;
  293. /**
  294. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  295. */
  296. maxFileSizeChange: EventEmitter<number>;
  297. /**
  298. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  299. */
  300. minFileSizeChange: EventEmitter<number>;
  301. /**
  302. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  303. */
  304. multipleChange: EventEmitter<boolean>;
  305. /**
  306. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  307. */
  308. nameChange: EventEmitter<string>;
  309. /**
  310. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  311. */
  312. progressChange: EventEmitter<number>;
  313. /**
  314. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  315. */
  316. readOnlyChange: EventEmitter<boolean>;
  317. /**
  318. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  319. */
  320. readyToUploadMessageChange: EventEmitter<string>;
  321. /**
  322. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  323. */
  324. rtlEnabledChange: EventEmitter<boolean>;
  325. /**
  326. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  327. */
  328. selectButtonTextChange: EventEmitter<string>;
  329. /**
  330. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  331. */
  332. showFileListChange: EventEmitter<boolean>;
  333. /**
  334. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  335. */
  336. tabIndexChange: EventEmitter<number>;
  337. /**
  338. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  339. */
  340. uploadButtonTextChange: EventEmitter<string>;
  341. /**
  342. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  343. */
  344. uploadedMessageChange: EventEmitter<string>;
  345. /**
  346. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  347. */
  348. uploadFailedMessageChange: EventEmitter<string>;
  349. /**
  350. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  351. */
  352. uploadHeadersChange: EventEmitter<any>;
  353. /**
  354. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  355. */
  356. uploadMethodChange: EventEmitter<string>;
  357. /**
  358. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  359. */
  360. uploadModeChange: EventEmitter<string>;
  361. /**
  362. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  363. */
  364. uploadUrlChange: EventEmitter<string>;
  365. /**
  366. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  367. */
  368. validationErrorChange: EventEmitter<any>;
  369. /**
  370. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  371. */
  372. valueChange: EventEmitter<Array<any>>;
  373. /**
  374. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  375. */
  376. visibleChange: EventEmitter<boolean>;
  377. /**
  378. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  379. */
  380. widthChange: EventEmitter<number | Function | string>;
  381. onBlur: EventEmitter<any>;
  382. change(_: any): void;
  383. touched: (_: any) => void;
  384. constructor(elementRef: ElementRef, ngZone: NgZone, templateHost: DxTemplateHost, _watcherHelper: WatcherHelper, _idh: IterableDifferHelper, optionHost: NestedOptionHost, transferState: TransferState, platformId: any);
  385. protected _createInstance(element: any, options: any): DxFileUploader;
  386. writeValue(value: any): void;
  387. setDisabledState(isDisabled: boolean): void;
  388. registerOnChange(fn: (_: any) => void): void;
  389. registerOnTouched(fn: () => void): void;
  390. _createWidget(element: any): void;
  391. ngOnDestroy(): void;
  392. ngOnChanges(changes: SimpleChanges): void;
  393. setupChanges(prop: string, changes: SimpleChanges): void;
  394. ngDoCheck(): void;
  395. _setOption(name: string, value: any): void;
  396. }
  397. export declare class DxFileUploaderModule {
  398. }