import { UmbControllerBase } from '../../../../libs/class-api/index.js'; export interface UmbEntityBulkActionProgressArgs { /** * The headline shown in the progress dialog. */ headline: string; /** * The unique identifiers of the entities to process. */ uniques: Array; /** * Called once per entity, sequentially. Sequential processing is intentional: * concurrent writes cause database locking (notably with SQLite). */ process: (unique: string) => Promise<{ error?: unknown; }>; } export interface UmbEntityBulkActionProgressResult { /** * The number of entities that were processed successfully. */ succeeded: number; /** * The number of entities that failed to process. */ failed: number; /** * Whether the operation was stopped by the user closing the dialog before completion. */ cancelled: boolean; } export interface UmbEntityBulkActionIndeterminateArgs { /** * The headline shown in the progress dialog. */ headline: string; /** * The operation to await. The dialog is only shown if it does not settle within `delayMs`. */ operation: Promise; /** * How long to wait before showing the dialog. Defaults to 400ms. */ delayMs?: number; } /** * Presents progress for a bulk entity action while it runs. * * Use `runWithProgress` for a sequence of per-item operations with a determinate counter and a * cancel affordance, or `runIndeterminate` for a single opaque operation that only surfaces a * spinner if it takes longer than a short delay. */ export declare class UmbEntityBulkActionProgressController extends UmbControllerBase { /** * Runs a bulk operation sequentially while presenting a determinate progress dialog with a * "X / Y" counter and a cancel affordance. Closing the dialog (cancel button, escape or backdrop) * stops the operation after the item currently being processed. * @param {UmbEntityBulkActionProgressArgs} args - The dialog headline, the uniques to process and the per-item processor. * @returns {Promise} The succeeded/failed counts and whether the user cancelled. */ runWithProgress(args: UmbEntityBulkActionProgressArgs): Promise; /** * Awaits a single operation, showing an indeterminate progress dialog only if it does not settle * within `delayMs` (default 400ms). There is no cancel affordance. The dialog is closed once the * operation settles. * @template T The type the awaited operation resolves to. * @param {UmbEntityBulkActionIndeterminateArgs} args - The dialog headline, the operation to await and the optional delay. * @returns {Promise} The resolved value of the awaited operation. */ runIndeterminate(args: UmbEntityBulkActionIndeterminateArgs): Promise; }