UNPKG

@webpro/next-translate-plugin

Version:

Tiny and powerful i18n plugin to translate your Next.js pages.

30 lines (29 loc) 2.72 kB
import ts from 'typescript'; import { ParsedFilePkg } from './types'; export declare const INTERNAL_CONFIG_KEY = "__i18nConfig"; export declare const clientLine: string[]; export declare const defaultLoader = "(l, n) => import(`@next-translate-root/locales/${l}/${n}`).then(m => m.default)"; export declare function getDefaultAppJs(existLocalesFolder: boolean): string; export declare function addLoadLocalesFrom(existLocalesFolder: boolean): string; export declare function getTsCompilerOptions(basePath: string, cutDependencies?: boolean): ts.CompilerOptions; export declare function getFilePkg(program: ts.Program, filename: string): ParsedFilePkg; export declare function parseFile(basePath: string, filename: string): ParsedFilePkg; export declare function parseCode(format: string, code: string): ParsedFilePkg; export declare function getSymbol(filePkg: ParsedFilePkg, node: ts.Node): any; export declare function getImportedNames(filePkg: ParsedFilePkg, moduleName: string): Map<string, ts.Identifier> | undefined; export declare function resolveParenthesis(filePkg: ParsedFilePkg, parenthesizedExpression: ts.ParenthesizedExpression): ts.Expression; export declare function resolveIdentifier(filePkg: ParsedFilePkg, identifier: ts.Identifier): ts.Declaration | ts.Identifier; export declare function getNamedExport(filePkg: ParsedFilePkg, name: string, resolveExport?: boolean): ts.Declaration | ts.Expression | undefined; export declare function getDefaultExport(filePkg: ParsedFilePkg, resolveExport?: boolean): ts.Declaration | ts.Expression | undefined; export declare function hasExportName(filePkg: ParsedFilePkg, name: string): boolean; export declare function getStaticName(filePkg: ParsedFilePkg, target: ts.Declaration | ts.Expression, name: string): ts.Symbol | undefined; export declare function hasStaticName(filePkg: ParsedFilePkg, target: ts.Declaration | ts.Expression, name: string): boolean; export declare function isPageToIgnore(pageFilePath: string): boolean; export declare function hasHOC(filePkg: ParsedFilePkg): boolean; export declare function isNotExportModifier(modifier: ts.Modifier): boolean; export declare function interceptExport(filePkg: ParsedFilePkg, exportName: string, defaultLocalName: string): string; export declare function removeCommentsFromCode(code: string): string; export declare function calculatePageDir(name: 'pages' | 'app', pagesInDir: string | undefined, dir: string): string; export declare function existPages(dir: string, pages: string | undefined): boolean | "" | undefined; export declare function existLocalesFolderWithNamespaces(dir: string): boolean; export declare function isInsideAppDir(path: string, appFolder: string, pagesFolder: string): boolean;