@jsverse/transloco-keys-manager
Version:
Extract translatable keys from projects that uses Transloco
59 lines (58 loc) • 1.36 kB
TypeScript
export type Config = {
input: string[];
config: string;
project: string;
translationsPath: string;
langs: string[];
defaultValue: undefined | string;
replace: boolean;
addMissingKeys: boolean;
removeExtraKeys: boolean;
emitErrorOnExtraKeys: boolean;
scopes: Scopes;
scopePathMap?: {
[scopeAlias: string]: string;
};
files: string[];
output: string;
marker: string;
sort: boolean;
unflat: boolean;
command: 'extract' | 'find';
fileFormat: FileFormats;
};
export type FileFormats = 'json' | 'pot';
export type FileType = 'ts' | 'html';
export type ExtractionResult = {
scopeToKeys: ScopeMap;
fileCount: number;
};
export type ExtractorConfig = {
file: string;
scopes: Scopes;
defaultValue?: string;
scopeToKeys: ScopeMap;
};
export type Scopes = {
scopeToAlias: {
[scope: string]: string;
};
aliasToScope: {
[scopeAlias: string]: string;
};
};
export type ScopeMap = {
__global: Record<string, string>;
[scopePath: string]: Record<string, string>;
};
export declare enum TEMPLATE_TYPE {
STRUCTURAL = 0,
NG_TEMPLATE = 1
}
export type BaseParams = {
defaultValue?: string;
scopeToKeys: ScopeMap;
scopes: Scopes;
};
export type Translation = Record<string, any>;
export type OrArray<T> = T | T[];