UNPKG

2.19 kBTypeScriptView Raw
1import { ThroughStream } from 'event-stream';
2import { KeyInfo, Map } from './lib';
3export declare function rewriteLocalizeCalls(): ThroughStream;
4export declare function createMetaDataFiles(): ThroughStream;
5export declare function bundleMetaDataFiles(id: string, outDir: string): ThroughStream;
6export interface Language {
7 id: string;
8 folderName?: string;
9}
10export declare function createAdditionalLanguageFiles(languages: Language[], i18nBaseDir: string, baseDir?: string, logProblems?: boolean): ThroughStream;
11export declare function bundleLanguageFiles(): ThroughStream;
12export declare function debug(prefix?: string): ThroughStream;
13/**
14 * A stream the creates additional key/value pair files for structured nls files.
15 *
16 * @param commentSeparator - if provided comments will be joined into one string using
17 * the commentSeparator value. If omitted comments will be includes as a string array.
18 */
19export declare function createKeyValuePairFile(commentSeparator?: string | undefined): ThroughStream;
20interface PackageJsonMessageFormat {
21 message: string;
22 comment: string[];
23}
24declare type MessageInfo = string | PackageJsonMessageFormat;
25declare namespace MessageInfo {
26 function message(value: MessageInfo): string;
27 function comment(value: MessageInfo): string[] | undefined;
28}
29export declare class Line {
30 private buffer;
31 constructor(indent?: number);
32 append(value: string): Line;
33 toString(): string;
34}
35export interface Resource {
36 name: string;
37 project: string;
38}
39export interface ParsedXLF {
40 messages: Map<string>;
41 originalFilePath: string;
42 language: string;
43}
44export declare class XLF {
45 project: string;
46 private buffer;
47 private files;
48 constructor(project: string);
49 toString(): string;
50 addFile(original: string, keys: KeyInfo[], messages: MessageInfo[]): void;
51 private addStringItem;
52 private appendHeader;
53 private appendFooter;
54 private appendNewLine;
55 static parse(xlfString: string): Promise<ParsedXLF[]>;
56}
57export declare function createXlfFiles(projectName: string, extensionName: string): ThroughStream;
58export declare function prepareJsonFiles(): ThroughStream;
59export {};