import { TOAST_ARIA_LIVE_ASSERTIVE, TOAST_ARIA_LIVE_OFF, TOAST_ARIA_LIVE_POLITE, TOAST_DEFAULT_TIMEOUT, TOAST_PERMANENT_TIMEOUT, TOAST_UNDO_TIMEOUT, ToastAriaLive, ToastHandle, ToastOptions, ToastType, showError, showInfo, showLoading, showMessage, showSuccess, showUndo, showWarning } from "./toast.mjs"; import { INode } from "@nextcloud/files"; //#region lib/conflict-picker.d.ts type ConflictInput = File | FileSystemEntry | INode; interface ConflictResolutionResult { /** * The selected incoming nodes. * Meaning this selected incoming nodes should overwrite the existing nodes. */ selected: T[]; /** * The incoming nodes which should be renamed. * Meaning those nodes still should be uploaded but with a new unique name to not override existing nodes. */ renamed: T[]; /** * The nodes not selected for upload. * Meaning those incoming nodes should be skipped from the action and not be used. */ skipped: T[]; } interface ConflictPickerOptions { /** * The container for the conflict picker dialog. * Defaults to the ``. */ container?: string; /** * When this is set to true a hint is shown that conflicts in directories are handles recursively * You still need to call this function for each directory separately. */ recursive?: boolean; /** * When this is set to true a hint is shown that any folder content will be overwritten. * This is useful if the operation with conflicts is a move that will not perform any "write-into" logic. */ overwriting?: boolean; } /** * Open the conflict resolver for uploading nodes. * Given the current content of the directory and the conflicting new nodes, * this will ask the user for resolving the conflicts and return the conflict resolution. * * @param dirname - The directory name with conflicts (its name is shown in the description) * @param conflicts - The incoming nodes * @param content - The current content of the directory (existing nodes) * @param options Optional settings for the conflict picker * * @return The conflict resolution or null if the user aborted. */ export declare function openConflictPicker(dirname: string | undefined, conflicts: T[], content: INode[], options?: ConflictPickerOptions): Promise | null>; //#endregion //#region lib/components/types.d.ts type IDialogSeverity = 'info' | 'warning' | 'error'; /** * Interface for defining buttons passed to the Dialog component * See NcDialogButton */ interface IDialogButton { /** Label of the button */ label: string; /** Callback on button click */ callback: () => void; /** * Optional Icon for the button * Should be a SVG image as raw string */ icon?: string; /** * Button type * * @see https://nextcloud-vue-components.netlify.app/#/Components/NcButton */ variant?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'warning' | 'success'; /** * Disabled state of the button * * @default false */ disabled?: boolean; } /** * Interface to define buttons of the FilePicker component * The buttons are based on the Dialog buttons but the callback gets the array of selected nodes */ interface IFilePickerButton extends Omit { /** * Callback on button click * * @param nodes Array of `@nextcloud/files` Nodes that were selected */ callback: (nodes: INode[]) => void | Promise; } type IFilePickerButtonFactory = (selectedNodes: INode[], currentPath: string, currentView: string) => IFilePickerButton[]; /** * Type of filter functions to filter the FilePicker's file list */ type IFilePickerFilter = (node: INode) => boolean; /** * Type of functions to allow or not picking a node */ type IFilePickerCanPick = (node: INode) => boolean; //#endregion //#region lib/filepicker-builder.d.ts /** * @deprecated */ export declare enum FilePickerType { Choose = 1, Move = 2, Copy = 3, CopyMove = 4, Custom = 5 } /** * Error that is thrown in the rejected promise when the FilePicker was closed */ export declare class FilePickerClosed extends Error {} export declare class FilePicker { private title; private multiSelect; private mimeTypeFilter; private directoriesAllowed; private noMenu; private buttons; private path?; private filter?; private canPick?; private container?; private disabledNavigation; constructor(title: string, multiSelect: IsMultiSelect, mimeTypeFilter: string[], directoriesAllowed: boolean, noMenu: boolean, buttons: IFilePickerButton[] | IFilePickerButtonFactory, path?: string, filter?: IFilePickerFilter, canPick?: IFilePickerCanPick, container?: string, disabledNavigation?: boolean); /** * Pick files using the FilePicker. * * @return Promise with array of picked files or rejected promise on close without picking */ pickNodes(): Promise; /** * Pick files using the FilePicker * * @return Promise with array of paths of picked files or rejected promise on close without picking */ pick(): Promise; } export declare class FilePickerBuilder { private title; private multiSelect; private mimeTypeFilter; private directoriesAllowed; private noMenu; private path?; private filter?; private canPick?; private buttons; private container?; private disabledNavigation; /** * Construct a new FilePicker * * @param title Title of the FilePicker */ constructor(title: string); /** * Set the container where the FilePicker will be mounted * By default 'body' is used * * @param container The dialog container */ setContainer(container: string): this; /** * Enable or disable picking multiple files * * @param ms True to enable picking multiple files, false otherwise */ setMultiSelect(ms: T): FilePickerBuilder; /** * Add allowed MIME type * * @param filter MIME type to allow */ addMimeTypeFilter(filter: string): this; /** * Set allowed MIME types * * @param filter Array of allowed MIME types */ setMimeTypeFilter(filter: string[]): this; /** * Add a button to the FilePicker * Note: This overrides any previous `setButtonFactory` call * * @param button The button */ addButton(button: IFilePickerButton): this; /** * Set the button factory which is used to generate buttons from current view, path and selected nodes * Note: This overrides any previous `addButton` call * * @param factory The button factory */ setButtonFactory(factory: IFilePickerButtonFactory): this; /** * Set FilePicker type based on legacy file picker types * * @param type The legacy filepicker type to emulate * @deprecated Use `addButton` or `setButtonFactory` instead as with setType you do not know which button was pressed */ setType(type: FilePickerType): this; /** * Allow to pick directories besides files * * @param allow True to allow picking directories */ allowDirectories(allow?: boolean): this; /** * Allow to create New folders * * @param noMenu True to hide menu */ setNoMenu(noMenu?: boolean): this; /** * Set starting path of the FilePicker * * @param path Path to start from picking */ startAt(path: string): this; /** * Add filter function to filter file list of FilePicker * * @param filter Filter function to apply */ setFilter(filter: IFilePickerFilter): this; /** * Add function to allow or not picking a node * * @param canPick Function to decide if a node can be picked */ setCanPick(canPick: IFilePickerCanPick): this; /** * Disable navigation (view selection) */ disableNavigation(): this; /** * Construct the configured FilePicker */ build(): FilePicker; } /** * * @param title Title of the file picker */ export declare function getFilePickerBuilder(title: string): FilePickerBuilder; //#endregion //#region lib/components/PublicAuthPrompt.vue.d.ts interface PublicAuthPromptProps { /** * Preselected nickname. * No name preselected by default. */ nickname?: string; /** * Dialog title */ title?: string; /** * Dialog text under the dialog title. * e.g 'Enter your name to access the file'. * Not shown by default. */ text?: string; /** * Dialog notice */ notice?: string; /** * Dialog submit button label */ submitLabel?: string; /** * Whether the dialog is cancellable */ cancellable?: boolean; } //#endregion //#region lib/public-auth.d.ts type GuestUserPromptOptions = PublicAuthPromptProps; /** * Show the public auth prompt dialog * This is used to ask the current user their nickname * as well as show some additional contextual information * * @param props - The props to pass to the dialog * @return The selected name or undefined if dialog was closed */ export declare function showGuestUserPrompt(props: GuestUserPromptOptions): Promise; //#endregion //#region lib/dialogs.d.ts /** * This class provides generic Nextcloud themed dialogs */ export declare class Dialog { #private; constructor(name: string, text: string, buttons?: IDialogButton[], severity?: IDialogSeverity); /** * Spawn and show the dialog - if already open the previous instance will be destroyed * * @return Promise that resolves when the dialog is answered successfully and rejects on close */ show(): Promise; } /** * The DialogBuilder provides an easy to use interface for creating simple dialogs in consistent Nextcloud design * * @example * ```ts * // It is recommended to use `getDialogBuilder` instead * const dialogBuilder = new DialogBuilder('The dialog title') * const dialog = dialogBuilder * .setText('The dialog message') * .setSeverity(DialogSeverity.Warning) * .addButton({ * label: 'Ok', * callback: () => console.warn('Warning was dismissed'), * }) * .build() * ``` */ export declare class DialogBuilder { #private; constructor(name?: string); /** * Set dialog name * * @param name The name or headline of the dialog */ setName(name: string): this; /** * Set the dialog text * * @param text Main text of the dialog */ setText(text: string): this; /** * Set the severity of the dialog * * @param severity Severity of the dialog */ setSeverity(severity: IDialogSeverity): this; /** * Set buttons from array * * @param buttons Either an array of dialog buttons */ setButtons(buttons: IDialogButton[]): this; /** * Add a single button * * @param button Button to add */ addButton(button: IDialogButton): this; build(): Dialog; } /** * Get the dialog builder to create a new dialog * * @param name The name of the dialog (title) * @example * ```ts * const dialog = getDialogBuilder('Confirm action') * .addButton({ * label: 'Ok', * callback: () => console.warn('confirmed'), * }) * .build() * ``` */ export declare function getDialogBuilder(name: string): DialogBuilder; interface ConfirmationDialogOptions { /** The name of the dialog (heading) */ name: string; /** The text of the dialog */ text: string; /** The text of the confirmation button */ labelConfirm?: string; /** The text of the reject button */ labelReject?: string; /** The severity */ severity?: IDialogSeverity; } /** * Open a new confirmation dialog. * The dialog either resolves to true when the confirm-button was pressed, * or to false if the reject-button was pressed. * * @param options - Dialog options see `ConfirmationDialogOptions` */ export declare function showConfirmation(options: ConfirmationDialogOptions): Promise; //#endregion export { type ConflictPickerOptions, type ConflictResolutionResult, type GuestUserPromptOptions, type IDialogButton, type IDialogSeverity, type IFilePickerButton, type IFilePickerCanPick, type IFilePickerFilter, TOAST_ARIA_LIVE_ASSERTIVE, TOAST_ARIA_LIVE_OFF, TOAST_ARIA_LIVE_POLITE, TOAST_DEFAULT_TIMEOUT, TOAST_PERMANENT_TIMEOUT, TOAST_UNDO_TIMEOUT, ToastAriaLive, type ToastHandle, type ToastOptions, ToastType, showError, showInfo, showLoading, showMessage, showSuccess, showUndo, showWarning }; //# sourceMappingURL=index.d.mts.map