Built-in actions
Note that EssentialActions
, DefaultActions
and ExtraActions
as combined into a
single object called ChonkyActions
:
export const ChonkyActions = {...EssentialActions,...DefaultActions,...ExtraActions,};
This object is exported directly from chonky
:
import { ChonkyActions } from 'chonky';console.log(ChonkyActions.OpenFiles);
See Built-in actions page for more info.
EssentialActions
Object literal
Source code on GitHub: src/action-definitions/essential.ts
Action that is dispatched when the user clicks on a file entry using their mouse. Both single clicks and double clicks trigger this action.
type MouseClickFilePayload = {altKey: boolean;clickType: 'single' | 'double';ctrlKey: boolean;file: FileData;fileDisplayIndex: number;shiftKey: boolean;}
Action that is dispatched when the user "clicks" on a file using their keyboard. Using Space and Enter keys counts as clicking.
type KeyboardClickFilePayload = {altKey: boolean;ctrlKey: boolean;enterKey: boolean;file: FileData;fileDisplayIndex: number;shiftKey: boolean;spaceKey: boolean;}
Action that is dispatched when user starts dragging some file.
type StartDragNDropPayload = {draggedFile: FileData;selectedFiles: FileData[];source: Nullable<FileData>;sourceInstanceId: string;}
Action that is dispatched when user either cancels the drag & drop interaction, or drops a file somewhere.
type EndDragNDropPayload = StartDragNDropPayload & {copy: boolean;destination: FileData;}
Action that is dispatched when user moves files from one folder to another, usually by dragging & dropping some files into the folder.
type MoveFilesPayload = EndDragNDropPayload & {files: FileData[];}
Action that is dispatched when the selection changes for any reason.
type ChangeSelectionPayload = {selection: Set<string>;}
Action that is dispatched when user wants to open some files. This action is often triggered by other actions.
type OpenFilesPayload = {files: FileData[];targetFile: FileData;}
Action that is triggered when user wants to go up a directory.
Action that is dispatched when user opens the context menu, either by right click on something or using the context menu button on their keyboard.
type OpenFileContextMenuPayload = {clientX: number;clientY: number;triggerFileId: Nullable<string>;}
DefaultActions
Object literal
Source code on GitHub: src/action-definitions/default.ts
Action that can be used to open currently selected files.
Action that selects all files.
Action that clear the file selection.
Action that enables List view.
Action that enables Compact view. Note that compact view is still experimental and should not be used in production.
Action that enables Grid view.
Action that sorts files by file.name
.
Action that sorts files by file.size
.
Action that sorts files by file.modDate
.
Action that toggles whether hidden files are shown to the user or not.
Action that toggles whether folders should appear before files regardless of current sort function.
Action that focuses the search input when it is dispatched.
Action that enables List view.
ExtraActions
Object literal
Source code on GitHub: src/action-definitions/extra.ts
Action that adds a button and shortcut to copy files.
Action that adds a button to create a new folder.
Action that adds a button to upload files.
Action that adds a button to download files.
Action that adds a button and shortcut to delete files.