UNPKG

sicua

Version:

A tool for analyzing project structure and dependencies

60 lines (59 loc) 2.65 kB
import { TranslationFile } from "../../../types/translation.types"; import { TranslationFileContext } from "../types/translation.additional"; /** * Finds all translation files in the project * @param context Translation file context * @returns Promise that resolves to an array of translation files */ export declare function findTranslationFiles(context: TranslationFileContext): Promise<TranslationFile[]>; export declare function hasNestedStringValues(node: any): boolean; /** * Determines if a JSON object is likely a translation file * @param content JSON content * @returns Boolean indicating if it looks like a translation file */ export declare function isLikelyTranslationFile(content: Record<string, any>): boolean; /** * Counts the number of translation entries in a file (recursive) * @param obj Translation object * @param prefix Optional prefix for recursive calls * @returns Number of translations */ export declare function countTranslationEntries(obj: Record<string, any>, prefix?: string): number; /** * Determines the main translation file (largest one) * @param translationFiles Array of translation files * @returns The largest translation file or null if none found */ export declare function determineMainTranslationFile(translationFiles: TranslationFile[]): TranslationFile | null; /** * Checks if a translation key exists in the translation object * @param fullKey The full dot-notation key * @param translations Translation object * @returns Boolean indicating if the key exists */ export declare function translationExistsInObject(fullKey: string, translations: Record<string, any>): boolean; /** * Extracts all translation keys from a translation object * @param obj Translation object * @param prefix Optional prefix for recursive calls * @param result Array to collect results */ export declare function extractKeysFromTranslations(obj: Record<string, any>, prefix: string, result: string[]): void; /** * Flattens a nested translation object for comparison * @param obj Translation object * @param prefix Optional prefix for recursive calls * @param filePath File path of the translation file * @param valueToKeysMap Map to collect values and their keys */ export declare function flattenTranslations(obj: Record<string, any>, prefix: string, filePath: string, valueToKeysMap: Map<string, { fullKey: string; filePath: string; }[]>): void; /** * Checks if text is significant enough to warn about duplication * @param value The text value to check * @returns Boolean indicating if the text is significant */ export declare function isSignificantText(value: string): boolean;