@awesome-fe/translate
Version:
Translation utils
20 lines (19 loc) • 671 B
TypeScript
import { DomElement, DomParentNode } from '../tiny-dom/dom-models';
import { Dict } from '../dict/dict';
export interface DictEntry {
file: string;
xpath: string;
english: string;
chinese: string;
}
export declare class Extractor {
extractFile(filename: string): DictEntry[];
extract(content: string, filename: string): DictEntry[];
extractFilesToDict(files: string[], dict: Dict, filter?: RegExp): Promise<void>;
}
export interface SentencePair {
english: DomElement;
chinese: DomElement;
}
export declare function extractAll(body: DomParentNode): SentencePair[];
export declare function getPathsTo(element: DomParentNode): string[];