/**
* DevExtreme (ui/file_manager.d.ts)
* Version: 21.1.0 (build 21016-0316)
* Build date: Sat Jan 16 2021
*
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import '../jquery_augmentation';

import {
    dxElement
} from '../core/element';

import {
    event
} from '../events/index';

import FileSystemItem from '../file_management/file_system_item';

import {
    dxContextMenuItem
} from './context_menu';

import {
    dxToolbarItem
} from './toolbar';

import Widget, {
    WidgetOptions
} from './widget/ui.widget';

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFileManagerOptions extends WidgetOptions<dxFileManager> {
    /**
     */
    allowedFileExtensions?: Array<string>;
    /**
     */
    contextMenu?: dxFileManagerContextMenu;
    /**
     */
    currentPath?: string;
    /**
     */
    currentPathKeys?: Array<string>;
    /**
     */
    customizeDetailColumns?: ((columns: Array<dxFileManagerDetailsColumn>) => Array<dxFileManagerDetailsColumn>);
    /**
     */
    customizeThumbnail?: ((fileSystemItem: FileSystemItem) => string);
    /**
     */
    fileSystemProvider?: any;
    /**
     */
    itemView?: {
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      details?: {
        /**
         * Warning! This type is used for internal purposes. Do not import it directly.
         */
        columns?: Array<dxFileManagerDetailsColumn | string>
      },
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      mode?: 'details' | 'thumbnails',
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      showFolders?: boolean,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      showParentFolder?: boolean
    };
    /**
     */
    onContextMenuItemClick?: ((e: { component?: dxFileManager, element?: dxElement, model?: any, itemData?: any, itemElement?: dxElement, itemIndex?: number, event?: event, fileSystemItem?: FileSystemItem, viewArea?: 'navPane' | 'itemView' }) => any);
    /**
     */
    onCurrentDirectoryChanged?: ((e: { component?: dxFileManager, element?: dxElement, model?: any, directory?: FileSystemItem }) => any);
    /**
     */
    onSelectedFileOpened?: ((e: { component?: dxFileManager, element?: dxElement, model?: any, file?: FileSystemItem }) => any);
    /**
     */
    onSelectionChanged?: ((e: { component?: dxFileManager, element?: dxElement, model?: any, currentSelectedItemKeys?: Array<string>, currentDeselectedItemKeys?: Array<string>, selectedItems?: Array<FileSystemItem>, selectedItemKeys?: Array<string>}) => any);
    /**
     */
    onToolbarItemClick?: ((e: { component?: dxFileManager, element?: dxElement, model?: any, itemData?: any, itemElement?: dxElement, itemIndex?: number, event?: event }) => any);
    /**
     */
    onFocusedItemChanged?: ((e: { component?: dxFileManager, element?: dxElement, model?: any, item?: FileSystemItem, itemElement?: dxElement }) => any);
    /**
     */
    onErrorOccurred?: ((e: { component?: dxFileManager, element?: dxElement, model?: any, errorCode?: number, errorText?: string, fileSystemItem?: FileSystemItem }) => any);
    /**
     */
    permissions?: {
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      copy?: boolean,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      create?: boolean,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      download?: boolean,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      move?: boolean,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      delete?: boolean,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      rename?: boolean,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      upload?: boolean
    };
    /**
     */
    rootFolderName?: string;
    /**
     */
    selectionMode?: 'multiple' | 'single';
    /**
     */
    selectedItemKeys?: Array<string>;
    /**
     */
    focusedItemKey?: string;
    /**
     */
    toolbar?: dxFileManagerToolbar;
    /**
     */
    upload?: {
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      maxFileSize?: number,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      chunkSize?: number
    };
}
/**
 */
export default class dxFileManager extends Widget {
    constructor(element: Element, options?: dxFileManagerOptions)
    constructor(element: JQuery, options?: dxFileManagerOptions)
    /**
     */
    getCurrentDirectory(): any;
    /**
     */
    getSelectedItems(): Array<any>;
    /**
     */
    refresh(): Promise<any> & JQueryPromise<any>;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFileManagerContextMenu {
    /**
     */
    items?: Array<dxFileManagerContextMenuItem | 'create' | 'upload' | 'refresh' | 'download' | 'move' | 'copy' | 'rename' | 'delete'>;
}
/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFileManagerContextMenuItem extends dxContextMenuItem {
    /**
     */
    items?: Array<dxFileManagerContextMenuItem>;
    /**
     */
    name?: 'create' | 'upload' | 'refresh' | 'download' | 'move' | 'copy' | 'rename' | 'delete' | string;
    /**
     */
    visible?: boolean;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFileManagerToolbar {
    /**
     */
    fileSelectionItems?: Array<dxFileManagerToolbarItem | 'showNavPane' | 'create' | 'upload' | 'refresh' | 'switchView' | 'download' | 'move' | 'copy' | 'rename' | 'delete' | 'clearSelection' | 'separator'>;
    /**
     */
    items?: Array<dxFileManagerToolbarItem | 'showNavPane' | 'create' | 'upload' | 'refresh' | 'switchView' | 'download' | 'move' | 'copy' | 'rename' | 'delete' | 'clearSelection' | 'separator'>;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFileManagerToolbarItem extends dxToolbarItem {
    /**
     */
    icon?: string;
    /**
     */
    location?: 'after' | 'before' | 'center';
    /**
     */
    name?: 'showNavPane' | 'create' | 'upload' | 'refresh' | 'switchView' | 'download' | 'move' | 'copy' | 'rename' | 'delete' | 'clearSelection' | 'separator' | string;
    /**
     */
    visible?: boolean;
}


/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxFileManagerDetailsColumn {
    /**
     */
    alignment?: 'center' | 'left' | 'right' | undefined;
    /**
     */
    caption?: string;
    /**
     */
    cssClass?: string;
    /**
     */
    dataField?: string;
    /**
     */
    dataType?: 'string' | 'number' | 'date' | 'boolean' | 'object' | 'datetime';
    /**
     */
    hidingPriority?: number;
    /**
     */
    sortIndex?: number;
    /**
     */
    sortOrder?: 'asc' | 'desc' | undefined;
    /**
     */
    visible?: boolean;
    /**
     */
    visibleIndex?: number;
    /**
     */
    width?: number | string;
}

declare global {
interface JQuery {
    dxFileManager(): JQuery;
    dxFileManager(options: "instance"): dxFileManager;
    dxFileManager(options: string): any;
    dxFileManager(options: string, ...params: any[]): any;
    dxFileManager(options: dxFileManagerOptions): JQuery;
}
}
/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export type Options = dxFileManagerOptions;

/** @deprecated use Options instead */
/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export type IOptions = dxFileManagerOptions;
