@launchmenu/core
Version:
An environment for visual keyboard controlled applets
44 lines • 1.94 kB
TypeScript
import { Command } from "../../../undoRedo/Command";
import { Resource } from "../../../undoRedo/dependencies/Resource";
import { ITextField } from "../../_types/ITextField";
import { ITextAlteration } from "../commands/_types/ITextAlteration";
import { ITextEditCommand } from "../commands/_types/ITextEditCommand";
import { IAdvancedTextEditData } from "./_types/IAdvancedTextEditData";
import { IAdvancedTextFieldChangeRetriever } from "./_types/IAdvancedTextFieldChangeRetriever";
/** A base command to make a more advanced text edit command composed of multiple commands */
export declare class AdvancedTextEditCommand extends Command implements ITextEditCommand {
metadata: {
name: string;
};
protected readonly dependencies: Resource[];
protected target: ITextField;
protected change: IAdvancedTextFieldChangeRetriever;
protected data?: IAdvancedTextEditData;
protected addedText?: string;
protected selectionChange: boolean;
/**
* Creates a new text edit command
* @param target The field of which to alter the text
* @param change The function to retrieve the new contents of the text field
* @param type The type of the command, used for undo/redo merging
*/
constructor(target: ITextField, change: IAdvancedTextFieldChangeRetriever, type?: {
addedText?: string;
isSelectionChange?: boolean;
});
/**
* Uses the change function to compute the new text and selection for the field
*/
protected computeChange(): IAdvancedTextEditData;
/** @override */
protected onExecute(): void;
/** @override */
protected onRevert(): void;
/** @override */
getAddedText(): string | undefined;
/** @override */
isSelectionChange(): boolean;
/** @override */
getAlterations(): ITextAlteration[];
}
//# sourceMappingURL=AdvancedTextEditCommand.d.ts.map