import { IContentsModel } from 'jupyter-js-services'; import { Message } from 'phosphor-messaging'; import { Widget } from 'phosphor-widget'; import { FileBrowserModel } from './model'; /** * A widget which hosts a file list area. */ export declare class DirListing extends Widget { /** * Create the DOM node for a dir listing. */ static createNode(): HTMLElement; /** * Create the header node for a dir listing. * * @returns A new DOM node to use as the dir listing header. * * #### Notes * This method may be reimplemented to create custom headers. */ static createHeaderNode(): HTMLElement; /** * Create a new item node for a dir listing. * * @returns A new DOM node to use as a content item. * * #### Notes * This method may be reimplemented to create custom items. */ static createItemNode(): HTMLElement; /** * Update an item node to reflect the current state of a model. * * @param node - A node created by a call to [[createItemNode]]. * * @param model - The model object to use for the item state. * * #### Notes * This is called automatically when the item should be updated. * * If the [[createItemNode]] method is reimplemented, this method * should also be reimplemented so that the item state is properly * updated. */ static updateItemNode(node: HTMLElement, model: IContentsModel): void; /** * Construct a new file browser directory listing widget. * * @param model - The file browser view model. */ constructor(model: FileBrowserModel); /** * Dispose of the resources held by the directory listing. */ dispose(): void; /** * Get the widget factory for the widget. */ /** * Set the widget factory for the widget. */ widgetFactory: (model: IContentsModel) => Widget; /** * Get the dir listing header node. * * #### Notes * This is the node which holds the header cells. * * Modifying this node directly can lead to undefined behavior. * * This is a read-only property. */ headerNode: HTMLElement; /** * Get the dir listing content node. * * #### Notes * This is the node which holds the item nodes. * * Modifying this node directly can lead to undefined behavior. * * This is a read-only property. */ contentNode: HTMLElement; /** * Rename the first currently selected item. */ rename(): Promise; /** * Cut the selected items. */ cut(): void; /** * Copy the selected items. */ copy(): void; /** * Paste the items from the clipboard. */ paste(): Promise; /** * Delete the currently selected item(s). */ delete(): Promise; /** * Duplicate the currently selected item(s). */ duplicate(): Promise; /** * Download the currently selected item(s). */ download(): Promise; /** * Shut down kernels on the applicable currently selected items. */ shutdownKernels(): Promise; /** * Select next item. * * @param keepExisting - Whether to keep the current selection and add to it. */ selectNext(keepExisting?: boolean): void; /** * Select previous item. * * @param keepExisting - Whether to keep the current selection and add to it. */ selectPrevious(keepExisting?: boolean): void; /** * Handle the DOM events for the directory listing. * * @param event - The DOM event sent to the widget. * * #### Notes * This method implements the DOM `EventListener` interface and is * called in response to events on the panel's DOM node. It should * not be called directly by user code. */ handleEvent(event: Event): void; /** * A message handler invoked on an `'after-attach'` message. */ protected onAfterAttach(msg: Message): void; /** * A message handler invoked on a `'before-detach'` message. */ protected onBeforeDetach(msg: Message): void; /** * A handler invoked on an `'update-request'` message. */ protected onUpdateRequest(msg: Message): void; /** * Handle the `'click'` event for the widget. */ private _evtClick(event); /** * Handle the `'scroll'` event for the widget. */ private _evtScroll(event); /** * Handle the `'mousedown'` event for the widget. */ private _evtMousedown(event); /** * Handle the `'mouseup'` event for the widget. */ private _evtMouseup(event); /** * Handle the `'mousemove'` event for the widget. */ private _evtMousemove(event); /** * Handle the `'keydown'` event for the widget. */ private _evtKeydown(event); /** * Handle the `'dblclick'` event for the widget. */ private _evtDblClick(event); /** * Handle the `'p-dragenter'` event for the widget. */ private _evtDragEnter(event); /** * Handle the `'p-dragleave'` event for the widget. */ private _evtDragLeave(event); /** * Handle the `'p-dragover'` event for the widget. */ private _evtDragOver(event); /** * Handle the `'p-drop'` event for the widget. */ private _evtDrop(event); /** * Start a drag event. */ private _startDrag(index, clientX, clientY); /** * Handle selection on a file node. */ private _handleFileSelect(event); /** * Handle a multiple select on a file item node. */ private _handleMultiSelect(selected, index); /** * Get the currently selected items. */ private _getSelectedItems(); /** * Copy the selected items, and optionally cut as well. */ private _copy(); /** * Allow the user to rename item on a given row. */ private _doRename(); /** * Select a given item. */ private _selectItem(index, keepExisting); /** * Handle the `refreshed` signal from the model. */ private _onModelRefreshed(); /** * Handle the `selectionChanged` signal from the model. */ private _onSelectionChanged(); private _model; private _editNode; private _items; private _drag; private _dragData; private _selectTimer; private _noSelectTimer; private _isCut; private _prevPath; private _clipboard; private _widgetFactory; private _softSelection; }