/** * DevExtreme (ui/file_manager.d.ts) * Version: 21.1.7 * Build date: Thu Aug 07 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import { UserDefinedElement, DxElement, } from '../core/element'; import { DxPromise, } from '../core/utils/deferred'; import { Cancelable, EventInfo, NativeEventInfo, InitializedEventInfo, ChangedOptionInfo, } from '../events/index'; import FileSystemItem from '../file_management/file_system_item'; import { Item as dxContextMenuItem, } from './context_menu'; import { Item as dxToolbarItem, } from './toolbar'; import Widget, { WidgetOptions, } from './widget/ui.widget'; import { template, } from '../core/templates/template'; /** @public */ export type ContentReadyEvent = EventInfo; /** @public */ export type ContextMenuItemClickEvent = NativeEventInfo & { readonly itemData: any; readonly itemElement: DxElement; readonly itemIndex: number; readonly fileSystemItem?: FileSystemItem; readonly viewArea: 'navPane' | 'itemView'; }; /** @public */ export type ContextMenuShowingEvent = Cancelable & NativeEventInfo & { readonly fileSystemItem?: FileSystemItem; readonly targetElement?: DxElement; readonly viewArea: 'navPane' | 'itemView'; }; /** @public */ export type CurrentDirectoryChangedEvent = EventInfo & { readonly directory: FileSystemItem; }; /** @public */ export type DisposingEvent = EventInfo; /** @public */ export type ErrorOccurredEvent = EventInfo & { readonly errorCode?: number; errorText?: string; readonly fileSystemItem?: FileSystemItem; }; /** @public */ export type FocusedItemChangedEvent = EventInfo & { readonly item?: FileSystemItem; readonly itemElement?: DxElement; }; /** @public */ export type InitializedEvent = InitializedEventInfo; /** @public */ export type OptionChangedEvent = EventInfo & ChangedOptionInfo; /** @public */ export type SelectedFileOpenedEvent = EventInfo & { readonly file: FileSystemItem; }; /** @public */ export type SelectionChangedEvent = EventInfo & { readonly currentSelectedItemKeys: Array; readonly currentDeselectedItemKeys: Array; readonly selectedItems: Array; readonly selectedItemKeys: Array; }; /** @public */ export type ToolbarItemClickEvent = NativeEventInfo & { readonly itemData: any; readonly itemElement: DxElement; readonly itemIndex: number; }; /** * @deprecated use Properties instead * @namespace DevExpress.ui */ export interface dxFileManagerOptions extends WidgetOptions { /** * @docid * @default [] * @public */ allowedFileExtensions?: Array; /** * @docid * @public */ contextMenu?: dxFileManagerContextMenu; /** * @docid * @default "" * @public */ currentPath?: string; /** * @docid * @default [] * @public */ currentPathKeys?: Array; /** * @docid * @public */ customizeDetailColumns?: ((columns: Array) => Array); /** * @docid * @public */ customizeThumbnail?: ((fileSystemItem: FileSystemItem) => string); /** * @docid * @default null * @public */ fileSystemProvider?: any; /** * @docid * @default null * @public */ itemView?: { /** * @docid */ details?: { /** * @docid * @default ["thumbnail", "name", "dateModified", "size"] */ columns?: Array; }; /** * @docid * @type Enums.FileManagerItemViewMode * @default "details" */ mode?: 'details' | 'thumbnails'; /** * @docid * @default true */ showFolders?: boolean; /** * @docid * @default true */ showParentFolder?: boolean; }; /** * @docid * @public */ notifications?: { /** * @docid * @default true */ showPanel?: boolean; /** * @docid * @default true */ showPopup?: boolean; }; /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field1 component:dxFileManager * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @type_function_param1_field4 itemData:object * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field6 itemIndex:number * @type_function_param1_field7 event:event * @type_function_param1_field8 fileSystemItem:FileSystemItem * @type_function_param1_field9 viewArea:Enums.FileManagerViewArea * @action * @public */ onContextMenuItemClick?: ((e: ContextMenuItemClickEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field1 component:dxFileManager * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @type_function_param1_field4 fileSystemItem:FileSystemItem * @type_function_param1_field5 targetElement:DxElement * @type_function_param1_field6 cancel:boolean * @type_function_param1_field7 event:event * @type_function_param1_field8 viewArea:Enums.FileManagerViewArea * @action * @public */ onContextMenuShowing?: ((e: ContextMenuShowingEvent) => void); /** * @docid * @type_function_param1 e:object * @type_function_param1_field1 component:dxFileManager * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @type_function_param1_field4 directory:FileSystemItem * @default null * @action * @public */ onCurrentDirectoryChanged?: ((e: CurrentDirectoryChangedEvent) => void); /** * @docid * @type_function_param1 e:object * @type_function_param1_field1 component:dxFileManager * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @type_function_param1_field4 file:FileSystemItem * @default null * @action * @public */ onSelectedFileOpened?: ((e: SelectedFileOpenedEvent) => void); /** * @docid * @type_function_param1 e:object * @type_function_param1_field1 component:dxFileManager * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @type_function_param1_field4 currentSelectedItemKeys:Array * @type_function_param1_field5 currentDeselectedItemKeys:Array * @type_function_param1_field6 selectedItems:Array * @type_function_param1_field7 selectedItemKeys:Array * @default null * @action * @public */ onSelectionChanged?: ((e: SelectionChangedEvent) => void); /** * @docid * @type_function_param1 e:object * @type_function_param1_field1 component:dxFileManager * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @type_function_param1_field4 itemData:object * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field6 itemIndex:number * @type_function_param1_field7 event:event * @action * @public */ onToolbarItemClick?: ((e: ToolbarItemClickEvent) => void); /** * @docid * @type_function_param1 e:object * @type_function_param1_field1 component:dxFileManager * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @type_function_param1_field4 item:FileSystemItem * @type_function_param1_field5 itemElement:DxElement * @default null * @action * @public */ onFocusedItemChanged?: ((e: FocusedItemChangedEvent) => void); /** * @docid * @type_function_param1 e:object * @type_function_param1_field1 component:dxFileManager * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @type_function_param1_field4 errorCode:number * @type_function_param1_field5 errorText:string * @type_function_param1_field6 fileSystemItem:FileSystemItem * @default null * @action * @public */ onErrorOccurred?: ((e: ErrorOccurredEvent) => void); /** * @docid * @public */ permissions?: { /** * @docid * @default false */ copy?: boolean; /** * @docid * @default false */ create?: boolean; /** * @docid * @default false */ download?: boolean; /** * @docid * @default false */ move?: boolean; /** * @docid * @default false */ delete?: boolean; /** * @docid * @default false */ rename?: boolean; /** * @docid * @default false */ upload?: boolean; }; /** * @docid * @default "Files" * @public */ rootFolderName?: string; /** * @docid * @type Enums.FileManagerSelectionMode * @default "multiple" * @public */ selectionMode?: 'multiple' | 'single'; /** * @docid * @default [] * @public */ selectedItemKeys?: Array; /** * @docid * @default null * @public */ focusedItemKey?: string; /** * @docid * @public */ toolbar?: dxFileManagerToolbar; /** * @docid * @public */ upload?: { /** * @docid * @default 0 */ maxFileSize?: number; /** * @docid * @default 200000 */ chunkSize?: number; }; } /** * @docid * @inherits Widget * @namespace DevExpress.ui * @public */ export default class dxFileManager extends Widget { constructor(element: UserDefinedElement, options?: dxFileManagerOptions) /** * @docid * @publicName getCurrentDirectory() * @return object * @public */ getCurrentDirectory(): any; /** * @docid * @publicName getSelectedItems() * @return Array * @public */ getSelectedItems(): Array; /** * @docid * @publicName refresh() * @return Promise * @public */ refresh(): DxPromise; } /** * @docid * @type object * @namespace DevExpress.ui */ export interface dxFileManagerContextMenu { /** * @docid * @type Array * @default [ "create", "upload", "rename", "move", "copy", "delete", "refresh", "download" ] * @public */ items?: Array; } /** * @public * @namespace DevExpress.ui.dxFileManager */ export type ContextMenuItem = dxFileManagerContextMenuItem; /** * @deprecated Use ContextMenuItem instead * @namespace DevExpress.ui */ export interface dxFileManagerContextMenuItem extends dxContextMenuItem { /** * @docid * @public * @type Array */ items?: Array; /** * @docid * @type Enums.FileManagerContextMenuItem|string * @public */ name?: 'create' | 'upload' | 'refresh' | 'download' | 'move' | 'copy' | 'rename' | 'delete' | string; /** * @docid * @default undefined * @public */ visible?: boolean; /** * @docid * @hidden */ template?: template | (() => string | UserDefinedElement); } /** * @docid * @type object * @namespace DevExpress.ui */ export interface dxFileManagerToolbar { /** * @docid * @type Array * @default [ "download", "separator", "move", "copy", "rename", "separator", "delete", "clearSelection", { name: "separator", location: "after" }, "refresh" ] * @public */ fileSelectionItems?: Array; /** * @docid * @type Array * @default [ "showNavPane", "create", "upload", "switchView", { name: "separator", location: "after" }, "refresh" ] * @public */ items?: Array; } /** * @public * @namespace DevExpress.ui.dxFileManager */ export type ToolbarItem = dxFileManagerToolbarItem; /** * @deprecated Use ToolbarItem instead * @namespace DevExpress.ui */ export interface dxFileManagerToolbarItem extends dxToolbarItem { /** * @docid * @default "" * @public */ icon?: string; /** * @docid * @type Enums.ToolbarItemLocation|string * @default "before" * @type Enums.ToolbarItemLocation * @public */ location?: 'after' | 'before' | 'center'; /** * @docid * @type Enums.FileManagerToolbarItem|string * @public */ name?: 'showNavPane' | 'create' | 'upload' | 'refresh' | 'switchView' | 'download' | 'move' | 'copy' | 'rename' | 'delete' | 'clearSelection' | 'separator' | string; /** * @docid * @default undefined * @public */ visible?: boolean; /** * @docid * @hidden */ html?: string; /** * @docid * @hidden */ template?: template | (() => string | UserDefinedElement); /** * @docid * @hidden */ menuItemTemplate?: template | (() => string | UserDefinedElement); } /** * @docid * @type object * @namespace DevExpress.ui */ export interface dxFileManagerDetailsColumn { /** * @docid * @type Enums.HorizontalAlignment * @default undefined * @acceptValues undefined * @public */ alignment?: 'center' | 'left' | 'right' | undefined; /** * @docid * @default undefined * @public */ caption?: string; /** * @docid * @default undefined * @public */ cssClass?: string; /** * @docid * @default undefined * @public */ dataField?: string; /** * @docid * @type Enums.GridColumnDataType * @default undefined * @public */ dataType?: 'string' | 'number' | 'date' | 'boolean' | 'object' | 'datetime'; /** * @docid * @default undefined * @public */ hidingPriority?: number; /** * @docid * @default undefined * @public */ sortIndex?: number; /** * @docid * @type Enums.SortOrder * @default undefined * @acceptValues undefined * @public */ sortOrder?: 'asc' | 'desc' | undefined; /** * @docid * @default true * @public */ visible?: boolean; /** * @docid * @default undefined * @public */ visibleIndex?: number; /** * @docid * @default undefined * @public */ width?: number | string; } /** @public */ export type Properties = dxFileManagerOptions; /** @deprecated use Properties instead */ export type Options = dxFileManagerOptions; /** @deprecated use Properties instead */ export type IOptions = dxFileManagerOptions;