@mui/x-data-grid-premium
Version:
The Premium plan edition of the MUI X Data Grid Components.
40 lines • 1.69 kB
TypeScript
import type { ReorderOperation, ReorderExecutionContext } from "./types.js";
/**
* Base class for all reorder operations.
* Provides abstract methods for operation detection and execution.
*/
export declare abstract class BaseReorderOperation {
abstract readonly operationType: string;
/**
* Detects if this operation can handle the given context.
*/
abstract detectOperation(ctx: ReorderExecutionContext): ReorderOperation | null;
/**
* Executes the detected operation.
*/
abstract executeOperation(operation: ReorderOperation, ctx: ReorderExecutionContext): Promise<void> | void;
}
/**
* Handles reordering of items within the same parent group.
*/
export declare class SameParentSwapOperation extends BaseReorderOperation {
readonly operationType = "same-parent-swap";
detectOperation(ctx: ReorderExecutionContext): ReorderOperation | null;
executeOperation(operation: ReorderOperation, ctx: ReorderExecutionContext): void;
}
/**
* Handles moving leaf nodes between different parent groups.
*/
export declare class CrossParentLeafOperation extends BaseReorderOperation {
readonly operationType = "cross-parent-leaf";
detectOperation(ctx: ReorderExecutionContext): ReorderOperation | null;
executeOperation(operation: ReorderOperation, ctx: ReorderExecutionContext): Promise<void>;
}
/**
* Handles moving entire groups between different parents.
*/
export declare class CrossParentGroupOperation extends BaseReorderOperation {
readonly operationType = "cross-parent-group";
detectOperation(ctx: ReorderExecutionContext): ReorderOperation | null;
executeOperation(operation: ReorderOperation, ctx: ReorderExecutionContext): Promise<void>;
}