UNPKG

wuchale

Version:

Protobuf-like i18n from normal code

69 lines 4.08 kB
import MagicString from "magic-string"; import type Estree from 'estree'; import type { Program, Options as ParserOptions } from "acorn"; import { NestText } from '../adapters.js'; import type { CommentDirectives, HeuristicDetailsBase, HeuristicFunc, IndexTracker, ScriptDeclType, TransformOutput, RuntimeOptions } from "../adapters.js"; import { type RuntimeVars } from "../adapter-utils/index.js"; export declare const scriptParseOptions: ParserOptions; export declare function scriptParseOptionsWithComments(): [ParserOptions, Estree.Comment[][]]; export declare function parseScript(content: string): [Program, Estree.Comment[][]]; export declare class Transformer { index: IndexTracker; heuristic: HeuristicFunc; content: string; comments: Estree.Comment[][]; filename: string; mstr: MagicString; pluralFunc: string; vars: RuntimeVars; runtimeOpts: RuntimeOptions; initRuntimeExpr: string; commentDirectives: CommentDirectives; insideProgram: boolean; declaring: ScriptDeclType; currentFuncDef: string | null; currentCall: string; currentTopLevelCall: string; constructor(content: string, filename: string, index: IndexTracker, heuristic: HeuristicFunc, pluralsFunc: string, runtimeOpts: RuntimeOptions, initRuntimeExpr: string); checkHeuristic: (text: string, detailsBase: HeuristicDetailsBase) => [boolean, NestText]; visitLiteral: (node: Estree.Literal & { start: number; end: number; }) => NestText[]; visitArrayExpression: (node: Estree.ArrayExpression) => NestText[]; visitObjectExpression: (node: Estree.ObjectExpression) => NestText[]; visitProperty: (node: Estree.Property) => NestText[]; visitSpreadElement: (node: Estree.SpreadElement) => NestText[]; visitMemberExpression: (node: Estree.MemberExpression) => NestText[]; visitNewExpression: (node: Estree.NewExpression) => NestText[]; defaultVisitCallExpression: (node: Estree.CallExpression) => NestText[]; visitCallExpression: (node: Estree.CallExpression) => NestText[]; visitBinaryExpression: (node: Estree.BinaryExpression) => NestText[]; visitUnaryExpression: (node: Estree.UnaryExpression) => NestText[]; visitLogicalExpression: (node: Estree.LogicalExpression) => NestText[]; visitAwaitExpression: (node: Estree.AwaitExpression) => NestText[]; visitAssignmentExpression: (node: Estree.BinaryExpression) => NestText[]; visitExpressionStatement: (node: Estree.ExpressionStatement) => NestText[]; visitForOfStatement: (node: Estree.ForOfStatement) => NestText[]; visitForInStatement: (node: Estree.ForInStatement) => NestText[]; visitForStatement: (node: Estree.ForStatement) => NestText[]; getMemberChainName: (node: Estree.MemberExpression) => string; getCalleeName: (callee: Estree.Expression | Estree.Super) => string; visitVariableDeclaration: (node: Estree.VariableDeclaration) => NestText[]; visitExportNamedDeclaration: (node: Estree.ExportNamedDeclaration) => NestText[]; visitExportDefaultDeclaration: (node: Estree.ExportNamedDeclaration) => NestText[]; visitFunctionBody: (node: Estree.BlockStatement | Estree.Expression, name: string | null) => NestText[]; visitFunctionDeclaration: (node: Estree.FunctionDeclaration) => NestText[]; visitArrowFunctionExpression: (node: Estree.ArrowFunctionExpression) => NestText[]; visitFunctionExpression: (node: Estree.FunctionExpression) => NestText[]; visitBlockStatement: (node: Estree.BlockStatement) => NestText[]; visitReturnStatement: (node: Estree.ReturnStatement) => NestText[]; visitIfStatement: (node: Estree.IfStatement) => NestText[]; visitTemplateLiteral: (node: Estree.TemplateLiteral) => NestText[]; visitProgram: (node: Estree.Program) => NestText[]; processCommentDirectives: (data: string) => CommentDirectives; visit: (node: Estree.BaseNode) => NestText[]; finalize: (txts: NestText[]) => TransformOutput; transform: (headerHead: string) => TransformOutput; } //# sourceMappingURL=transformer.d.ts.map