i18next-mcp-server
Version:
A comprehensive Model Context Protocol (MCP) server for i18next translation management, health checking, and automated translation workflows
52 lines (51 loc) • 1.72 kB
TypeScript
import type { I18nConfig, KeyAddition, KeyRemoval, KeyRename, BatchKeyOperation, OperationResult } from '../types/index.js';
import type { FileManager } from '../core/file-manager.js';
export declare class KeyManager {
private config;
private fileManager;
constructor(config: I18nConfig, fileManager: FileManager);
/**
* Add a new translation key to specified languages and namespaces
*/
addKey(operation: KeyAddition): Promise<OperationResult>;
/**
* Remove a translation key from specified languages and namespaces
*/
removeKey(operation: KeyRemoval): Promise<OperationResult>;
/**
* Rename a translation key across specified languages and namespaces
*/
renameKey(operation: KeyRename): Promise<OperationResult>;
/**
* Execute multiple key operations in a batch
*/
batchOperation(operations: BatchKeyOperation): Promise<OperationResult>;
/**
* Sync keys from a source namespace to target namespaces
*/
syncKeys(sourceNamespace: string, targetNamespaces: string[], language?: string, copyValues?: boolean): Promise<OperationResult>;
/**
* Check for key conflicts before operations
*/
private checkKeyConflicts;
/**
* Get nested value from object using dot notation
*/
private getNestedValue;
/**
* Set nested value in object using dot notation
*/
private setNestedValue;
/**
* Delete nested value from object using dot notation
*/
private deleteNestedValue;
/**
* Remove empty parent objects after deletion
*/
private cleanupEmptyObjects;
/**
* Get all keys from a nested object
*/
private getAllKeys;
}