/** * Edit command implementation * * Opens references in external editor for interactive editing. */ import type { CslItem } from "../../core/csl-json/types.js"; import { type EditFormat } from "../../features/edit/index.js"; import { type ExecutionContext } from "../execution-context.js"; /** * Options for the edit command. */ export interface EditCommandOptions { /** One or more identifiers (citation keys or UUIDs) */ identifiers: string[]; /** Edit format: yaml (default) or json */ format: EditFormat; /** Whether identifiers are UUIDs */ useUuid?: boolean; /** Custom editor command (overrides $VISUAL/$EDITOR) */ editor?: string; } /** * State of an individual item after edit operation. */ export type EditItemState = "updated" | "unchanged" | "not_found" | "id_collision"; /** * Result for a single item in the edit operation. */ export interface EditItemResult { /** The identifier (id or uuid) used to locate this item */ id: string; /** The state of this item after the edit operation */ state: EditItemState; /** The updated item (when state is 'updated' or 'unchanged') */ item?: CslItem; /** The original item before changes (when state is 'updated' or 'unchanged') */ oldItem?: CslItem; /** True if the ID was changed due to collision resolution */ idChanged?: boolean; /** The new ID after collision resolution (only when idChanged=true) */ newId?: string; } /** * Result from edit command execution. */ export interface EditCommandResult { success: boolean; updatedCount: number; updatedIds: string[]; /** Detailed results for each edited item */ results: EditItemResult[]; error?: string; aborted?: boolean; } /** * Execute the edit command. * * @param options - Edit command options * @param context - Execution context * @returns Edit result */ export declare function executeEditCommand(options: EditCommandOptions, context: ExecutionContext): Promise; /** * Format edit result for CLI output. */ export declare function formatEditOutput(result: EditCommandResult): string; /** * Options for handleEditAction. */ export interface EditActionOptions { uuid?: boolean; format?: EditFormat; editor?: string; } /** * Handle 'edit' command action. */ export declare function handleEditAction(identifiers: string[], options: EditActionOptions, globalOpts: Record): Promise; //# sourceMappingURL=edit.d.ts.map