import { AcApContext } from '../../app'; import { AcEdCommand } from '../../editor'; /** * AutoCAD-style command-line layer command (`-LAYER`). * * This command intentionally avoids any dialog UI and keeps all interactions * in command line prompts. */ export declare class AcApLayerCmd extends AcEdCommand { /** * Creates a command-line `-LAYER` command instance. * * The command is registered as a write-mode command because layer operations * can modify database state (current layer, visibility, lock state, color, * descriptions, and table records). */ constructor(); /** * Runs the interactive `-LAYER` loop. * * The command keeps prompting for top-level options until the user cancels * or confirms an empty input. Each selected keyword dispatches to one * dedicated branch handler. * * @param context - Active application context containing view and document. * @returns Resolves when the command exits. */ execute(context: AcApContext): Promise; /** * Prompts for one top-level `-LAYER` action keyword. * * The prompt is keyword-only and supports empty-enter termination (`allowNone`). * * @returns Selected top-level keyword, or `undefined` when canceled/finished. */ private promptMainKeyword; /** * Adds one localized keyword entry to the main `-LAYER` prompt. * * @param prompt - Target keyword prompt to receive the keyword option. * @param keyword - Translation-key suffix for `jig.layer.keywords.*`. */ private addKeyword; /** * Emits one user-facing message through the command-line output. * * @param message - Message text to display. * @param type - Message severity category. */ private notify; /** * Prints all layer states to browser console and reports summary in UI. * * The list contains the current-layer marker and common status columns * (on/off, frozen, locked, color). * * @param context - Active command context used to resolve the layer table. */ private listLayers; /** * Parses a raw layer-name input string into a distinct name list. * * Supported forms: * - `*` to target all existing layer names. * - Comma-separated names (e.g. `A,B,C`). * * @param input - Raw user input from command line. * @param allNames - All existing layer names, used for wildcard expansion. * @returns Deduplicated list of requested layer names. */ private parseLayerNameInput; /** * Resolves layer records by name and separates missing names. * * @param context - Active command context with access to layer table. * @param names - Layer names to resolve. * @returns Object containing matched records and unresolved names. */ private resolveLayers; /** * Sets or clears the frozen bit in `standardFlags`. * * The explicit bit operation is used to ensure both freeze and thaw are * applied deterministically. * * @param layer - Target layer table record. * @param frozen - `true` to freeze, `false` to thaw. */ private setLayerFrozen; /** * Sets or clears the locked bit in `standardFlags`. * * The explicit bit operation is used to ensure both lock and unlock are * applied deterministically. * * @param layer - Target layer table record. * @param locked - `true` to lock, `false` to unlock. */ private setLayerLocked; /** * Prompts for one or more layer names and parses them into a list. * * This helper powers batch operations such as on/off/freeze/thaw/lock/unlock * and supports wildcard `*` plus comma-separated names. * * @param message - Prompt message shown in command line. * @param context - Active command context used for wildcard expansion. * @returns Parsed layer names, or `undefined` when canceled/invalid. */ private promptLayerNames; /** * Prompts for a single layer name. * * @param message - Prompt message shown in command line. * @returns Trimmed layer name, or `undefined` when canceled/empty. */ private promptSingleLayerName; /** * Handles the `New` branch. * * Creates one or more missing layers while keeping existing ones unchanged. * The method reports creation count and duplicate names separately. * * @param context - Active command context used to access the layer table. * @returns Resolves when branch execution completes. */ private runNew; /** * Handles the `Set` branch. * * Sets one existing layer as current (`CLAYER`) and ensures the target is * visible/unfrozen before assignment. * * @param context - Active command context. * @returns Resolves when branch execution completes. */ private runSet; /** * Handles the `Make` branch. * * Creates the layer if missing, then makes it current. The resulting current * layer is turned on and thawed. * * @param context - Active command context. * @returns Resolves when branch execution completes. */ private runMake; /** * Handles `On` and `Off` branches. * * Batch toggles visibility for selected layers. Turning off the current layer * is skipped and reported as warning. * * @param context - Active command context. * @param off - `true` for `Off`, `false` for `On`. * @returns Resolves when branch execution completes. */ private runOnOff; /** * Handles `Freeze` and `Thaw` branches. * * Batch toggles frozen state using explicit bit operations. Freezing the * current layer is skipped and reported as warning. * * @param context - Active command context. * @param freeze - `true` for `Freeze`, `false` for `Thaw`. * @returns Resolves when branch execution completes. */ private runFreeze; /** * Handles `Lock` and `Unlock` branches. * * Batch toggles lock state using explicit bit operations. * * @param context - Active command context. * @param lock - `true` for `Lock`, `false` for `Unlock`. * @returns Resolves when branch execution completes. */ private runLock; /** * Parses one color input token into `AcCmColor`. * * Supported formats: * - ACI index (`1..255`) * - RGB string accepted by `AcCmColor.fromString` * - CSS color names accepted by `AcCmColor.fromString` * * `ByLayer` and `ByBlock` are rejected for explicit layer color assignment. * * @param input - Raw color input string. * @returns Parsed color object, or `undefined` when invalid/unsupported. */ private parseColorInput; /** * Handles the `Color` branch. * * Prompts target layers first, then prompts color value and applies a cloned * color instance to each resolved layer. * * @param context - Active command context. * @returns Resolves when branch execution completes. */ private runColor; /** * Handles the `Description` branch. * * Updates the description text of one specified layer. Empty description is * allowed and treated as clear. * * @param context - Active command context. * @returns Resolves when branch execution completes. */ private runDescription; } //# sourceMappingURL=AcApLayerCmd.d.ts.map