import { IFolder, INode } from '../../node/index.ts';
export declare const NewMenuEntryCategory: Readonly<{
/**
* For actions where the user is intended to upload from their device
*/
UploadFromDevice: 0;
/**
* For actions that create new nodes on the server without uploading
*/
CreateNew: 1;
/**
* For everything not matching the other categories
*/
Other: 2;
}>;
export type TNewMenuEntryCategory = typeof NewMenuEntryCategory[keyof typeof NewMenuEntryCategory];
export interface NewMenuEntry {
/** Unique ID */
id: string;
/**
* Category to put this entry in
* (supported since Nextcloud 30)
*
* @default NewMenuEntryCategory.CreateNew
* @see NewMenuEntryCategory
* @since 3.3.0
*/
category?: TNewMenuEntryCategory;
/** Translatable string displayed in the menu */
displayName: string;
/**
* Condition wether this entry is shown or not
*
* @param context the creation context. Usually the current folder
*/
enabled?: (context: IFolder) => boolean;
/**
* Either iconSvgInline or iconClass must be defined
* Svg as inline string.
*/
iconSvgInline?: string;
/** Order of the entry in the menu */
order?: number;
/**
* Function to be run after creation
*
* @param context - The creation context. Usually the current folder
* @param content - List of file/folders present in the context folder
*/
handler: (context: IFolder, content: INode[]) => void;
}
export declare class NewMenu {
private _entries;
registerEntry(entry: NewMenuEntry): void;
unregisterEntry(entry: NewMenuEntry | string): void;
/**
* Get the list of registered entries
*
* @param context - The creation context. Usually the current folder
*/
getEntries(context?: IFolder): Array;
private getEntryIndex;
private validateEntry;
}