import { SectionIdent } from "@keymanapp/ldml-keyboard-constants"; import { KMXPlus } from '@keymanapp/common-types'; import { CompilerCallbacks, LDMLKeyboard } from "@keymanapp/developer-utils"; import { SectionCompiler } from "./section-compiler.js"; import Bksp = KMXPlus.Bksp; import DependencySections = KMXPlus.DependencySections; import Tran = KMXPlus.Tran; import LDMLKeyboardXMLSourceFile = LDMLKeyboard.LDMLKeyboardXMLSourceFile; import { Substitutions } from "./substitution-tracker.js"; type TransformCompilerType = 'simple' | 'backspace'; export declare abstract class TransformCompiler extends SectionCompiler { static validateSubstitutions(keyboard: LDMLKeyboard.LKKeyboard, st: Substitutions): boolean; protected type: T; constructor(source: LDMLKeyboardXMLSourceFile, callbacks: CompilerCallbacks); validate(): boolean; /** allocate a new TranBase subclass */ protected newTran(): TranBase; private compileTransforms; private compileTransformGroup; private compileTransformTranGroup; private compileTransform; /** * Validate the 'to' string. * We have already checked that it's not a mapTo, * so there should not be any illegal substitutions. */ private isValidTo; /** * Validate the final regex * @param cookedFrom the regex to use, missing the trailing '$' * @param from the original from - for error reporting * @returns true if OK */ private isValidRegex; private compileReorderTranGroup; private compileReorder; compile(sections: DependencySections): TranBase; get dependencies(): Set; /** * Analyze reorders and regexes for \uXXXX escapes. * The LDML spec requires \u{XXXX} format. * @param cookedFrom the original string * @returns the original string, or null if an error was reported */ private checkEscapes; /** * Analyze character classes such as '[a-z]' for denormalized characters. * Escapes non-NFD characters as hex escapes. * @param cookedFrom input regex string * @returns updated 'from' string */ private checkRanges; } export declare class TranCompiler extends TransformCompiler<'simple', Tran> { constructor(source: LDMLKeyboardXMLSourceFile, callbacks: CompilerCallbacks); protected newTran(): Tran; get id(): SectionIdent; } export declare class BkspCompiler extends TransformCompiler<'backspace', Bksp> { constructor(source: LDMLKeyboardXMLSourceFile, callbacks: CompilerCallbacks); protected newTran(): Bksp; get id(): SectionIdent; } export {}; //# sourceMappingURL=tran.d.ts.map