import type { CslItem } from "../../core/csl-json/types.js"; import { type IdentifierType } from "../../core/library-interface.js"; import type { UpdateOperationResult } from "../../features/operations/update.js"; import { type ExecutionContext } from "../execution-context.js"; /** * Operator type for --set option. */ export type SetOperator = "=" | "+=" | "-="; /** * Parsed result of a --set option. */ export interface SetOperation { field: string; operator: SetOperator; value: string; } /** * Parse a --set option string. * * @param input - Input string in format "field=value", "field+=value", or "field-=value" * @returns Parsed SetOperation * @throws Error if syntax is invalid */ export declare function parseSetOption(input: string): SetOperation; /** * Apply set operations to create a partial CslItem updates object. * * @param operations - Array of set operations * @returns Partial CslItem object with updates * @throws Error if a protected or unsupported field is specified */ export declare function applySetOperations(operations: SetOperation[]): Record; /** * Check if updates contain $add or $remove operations that need resolution. */ export declare function hasArrayOperations(updates: Record): boolean; /** * Resolve $add/$remove operations against existing item data. * * @param updates - Updates object potentially containing $add/$remove operations * @param existingItem - The existing item to resolve against * @returns Updates object with $add/$remove resolved to actual arrays */ export declare function resolveArrayOperations(updates: Record, existingItem: CslItem): Record; /** * Options for the update command. */ export interface UpdateCommandOptions { identifier: string; updates: Partial; idType?: IdentifierType; } /** * Result from update command execution. */ export type UpdateCommandResult = UpdateOperationResult; /** * Execute update command. * Uses context.library.update() which works for both local and server modes. * * @param options - Update command options * @param context - Execution context * @returns Update result */ export declare function executeUpdate(options: UpdateCommandOptions, context: ExecutionContext): Promise; /** * Format update result for CLI output. * * @param result - Update result * @param identifier - The identifier that was used * @returns Formatted output string */ export declare function formatUpdateOutput(result: UpdateCommandResult, identifier: string): string; /** * Options for handleUpdateAction. */ export interface UpdateActionOptions { uuid?: boolean; set?: string[]; output?: "json" | "text"; full?: boolean; } /** * Handle 'update' command action. */ export declare function handleUpdateAction(identifierArg: string | undefined, file: string | undefined, options: UpdateActionOptions, globalOpts: Record): Promise; /** * Collect multiple --set options into an array. */ export declare function collectSetOption(value: string, previous: string[]): string[]; //# sourceMappingURL=update.d.ts.map