UNPKG

simple-i18n-next

Version:

A CLI to generate TypeScript code from translation files in JSON format and Markdown files for Next.js projects.

48 lines (47 loc) 2.04 kB
export declare const capitalize: (str: string) => string; export declare function getDirectories(currentPath: string): string[]; export declare function arrayToCamelCase(arr: string[]): string; export declare function generatePropTypes(template: string, functionName: string): { name: string; content: string; } | null; export declare function componentNameFromFilepath(filepath: string): string; export declare function findMdxFiles(dir: string): string[]; export declare const generateComponent: (markdownContent: string, filepath: string, localesDir: string) => { componentName: string; componentString: string; }; export declare function findCaseInsensitiveDuplicates(json: Record<string, any>): string[]; export declare function getLanguages(localesDir: string): { langs: string[]; invalidLangs: string[]; }; export declare const getJsonFileNames: (dir: string) => string[]; export declare function generateLocale({ localesDir, defaultLanguage, outputDir: outputDirPath, silent, }: { localesDir: string; defaultLanguage?: string; outputDir?: string; silent: boolean; }): void; export declare class Plurals { validCategories: string[]; pluralRulesCategories: string[]; pluralOrdinalRulesCategories: string[]; pluralRules: Intl.PluralRules; pluralOrdinalRules: Intl.PluralRules; pluralKeys: Record<string, Array<[string, string]>>; pluralOrdinalKeys: Record<string, Array<[string, string]>>; unnecessaryPluralKeys: string[]; unnecessaryPluralOrdinalKeys: string[]; constructor(lang: string); isPluralKey(key: string): boolean; storePluralKeyIfNeeded(key: string, value: string): boolean; getPluralKeys: () => { pluralKeys: Record<string, [string, string][]>; pluralOrdinalKeys: Record<string, [string, string][]>; incompletePluralKeys: Record<string, string[]>; unnecessaryPluralKeys: string[]; incompletePluralOrdinalKeys: Record<string, string[]>; unnecessaryPluralOrdinalKeys: string[]; }; }