UNPKG

@wuchale/svelte

Version:

Protobuf-like i18n from plain code: Svelte adapter

41 lines (40 loc) 2.23 kB
import type { AnyNode } from "acorn"; import { type AST } from "svelte/compiler"; import { Message } from 'wuchale'; import { Transformer } from 'wuchale/adapter-vanilla'; import type { IndexTracker, HeuristicFunc, TransformOutput, CatalogExpr, RuntimeConf } from 'wuchale'; import { MixedVisitor, type CommentDirectives } from "wuchale/adapter-utils"; type MixedNodesTypes = AST.Text | AST.Tag | AST.ElementLike | AST.Block | AST.Comment; export declare class SvelteTransformer extends Transformer { currentElement?: string; inCompoundText: boolean; commentDirectivesStack: CommentDirectives[]; lastVisitIsComment: boolean; currentSnippet: number; mixedVisitor: MixedVisitor<MixedNodesTypes>; constructor(content: string, filename: string, index: IndexTracker, heuristic: HeuristicFunc, pluralsFunc: string, catalogExpr: CatalogExpr, rtConf: RuntimeConf); visitExpressionTag: (node: AST.ExpressionTag) => Message[]; initMixedVisitor: () => MixedVisitor<MixedNodesTypes>; visitFragment: (node: AST.Fragment) => Message[]; visitRegularElement: (node: AST.ElementLike) => Message[]; visitComponent: (node: AST.ElementLike) => Message[]; visitText: (node: AST.Text) => Message[]; visitSpreadAttribute: (node: AST.SpreadAttribute) => Message[]; visitAttribute: (node: AST.Attribute) => Message[]; visitSnippetBlock: (node: AST.SnippetBlock) => Message[]; visitIfBlock: (node: AST.IfBlock) => Message[]; visitEachBlock: (node: AST.EachBlock) => Message[]; visitKeyBlock: (node: AST.KeyBlock) => Message[]; visitAwaitBlock: (node: AST.AwaitBlock) => Message[]; visitSvelteBody: (node: AST.SvelteBody) => Message[]; visitSvelteDocument: (node: AST.SvelteDocument) => Message[]; visitSvelteElement: (node: AST.SvelteElement) => Message[]; visitSvelteBoundary: (node: AST.SvelteBoundary) => Message[]; visitSvelteHead: (node: AST.SvelteHead) => Message[]; visitTitleElement: (node: AST.TitleElement) => Message[]; visitSvelteWindow: (node: AST.SvelteWindow) => Message[]; visitRoot: (node: AST.Root) => Message[]; visitSv: (node: AST.SvelteNode | AnyNode) => Message[]; transformSv: () => TransformOutput; } export {};