vscode-nls-dev
Version:
Development time npm module to generate strings bundles from Javascript files
60 lines (59 loc) • 2.19 kB
TypeScript
import { ThroughStream } from 'event-stream';
import { KeyInfo, Map } from './lib';
export declare function rewriteLocalizeCalls(): ThroughStream;
export declare function createMetaDataFiles(): ThroughStream;
export declare function bundleMetaDataFiles(id: string, outDir: string): ThroughStream;
export interface Language {
id: string;
folderName?: string;
}
export declare function createAdditionalLanguageFiles(languages: Language[], i18nBaseDir: string, baseDir?: string, logProblems?: boolean): ThroughStream;
export declare function bundleLanguageFiles(): ThroughStream;
export declare function debug(prefix?: string): ThroughStream;
/**
* A stream the creates additional key/value pair files for structured nls files.
*
* @param commentSeparator - if provided comments will be joined into one string using
* the commentSeparator value. If omitted comments will be includes as a string array.
*/
export declare function createKeyValuePairFile(commentSeparator?: string | undefined): ThroughStream;
interface PackageJsonMessageFormat {
message: string;
comment: string[];
}
declare type MessageInfo = string | PackageJsonMessageFormat;
declare namespace MessageInfo {
function message(value: MessageInfo): string;
function comment(value: MessageInfo): string[] | undefined;
}
export declare class Line {
private buffer;
constructor(indent?: number);
append(value: string): Line;
toString(): string;
}
export interface Resource {
name: string;
project: string;
}
export interface ParsedXLF {
messages: Map<string>;
originalFilePath: string;
language: string;
}
export declare class XLF {
project: string;
private buffer;
private files;
constructor(project: string);
toString(): string;
addFile(original: string, keys: KeyInfo[], messages: MessageInfo[]): void;
private addStringItem;
private appendHeader;
private appendFooter;
private appendNewLine;
static parse(xlfString: string): Promise<ParsedXLF[]>;
}
export declare function createXlfFiles(projectName: string, extensionName: string): ThroughStream;
export declare function prepareJsonFiles(): ThroughStream;
export {};