@cliff-format/i18n 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +227 -2
- package/dist/chunk-47VERBYX.js +1789 -0
- package/dist/chunk-47VERBYX.js.map +1 -0
- package/dist/index.cjs +1935 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +223 -0
- package/dist/index.js.map +1 -0
- package/dist/lite.cjs +1798 -0
- package/dist/lite.cjs.map +1 -0
- package/dist/lite.d.cts +8 -0
- package/dist/lite.d.ts +8 -0
- package/dist/lite.js +88 -0
- package/dist/lite.js.map +1 -0
- package/dist/react.cjs +59 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +18 -0
- package/dist/react.d.ts +18 -0
- package/dist/react.js +45 -0
- package/dist/react.js.map +1 -0
- package/dist/types-CtbwKSot.d.cts +462 -0
- package/dist/types-CtbwKSot.d.ts +462 -0
- package/dist/vocabulary-riKZ5HrX.d.ts +135 -0
- package/dist/vocabulary-u-i15yFj.d.cts +135 -0
- package/package.json +117 -4
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
import { CliffDocument, CliffGroup, ValidationIssue, Correction, CliffEntry, ParseOptions } from '@cliff-format/core';
|
|
2
|
+
|
|
3
|
+
interface EntryIdCatalogContext {
|
|
4
|
+
readonly knownNamespaces: ReadonlySet<string>;
|
|
5
|
+
readonly knownClans: ReadonlySet<string>;
|
|
6
|
+
readonly defaultGroup: string;
|
|
7
|
+
readonly aliases: Readonly<Record<string, string>>;
|
|
8
|
+
hasCanonical(canonical: string): boolean;
|
|
9
|
+
recordForCanonical(canonical: string): MessageRecord | undefined;
|
|
10
|
+
suffixMatches(suffix: string): readonly string[];
|
|
11
|
+
}
|
|
12
|
+
declare function joinCanonical(namespace: string, clan: string, group: string, id: string): string;
|
|
13
|
+
declare function assertScope(scope: TranslationScope): void;
|
|
14
|
+
declare function resolveEntryId(input: EntryIdInput, scope: TranslationScope, context: EntryIdCatalogContext, strictEntryIds?: boolean): ResolvedEntryId;
|
|
15
|
+
|
|
16
|
+
interface CatalogOptions {
|
|
17
|
+
aliases?: Readonly<Record<string, string>>;
|
|
18
|
+
defaultGroup?: string;
|
|
19
|
+
}
|
|
20
|
+
declare class Catalog implements EntryIdCatalogContext {
|
|
21
|
+
readonly defaultGroup: string;
|
|
22
|
+
readonly aliases: Readonly<Record<string, string>>;
|
|
23
|
+
private readonly documentsList;
|
|
24
|
+
private readonly byLocale;
|
|
25
|
+
private readonly byCanonical;
|
|
26
|
+
private readonly suffixMap;
|
|
27
|
+
private readonly namespaceSet;
|
|
28
|
+
private readonly clanSet;
|
|
29
|
+
private readonly groupSet;
|
|
30
|
+
private readonly localeSet;
|
|
31
|
+
private readonly sourceLanguageSet;
|
|
32
|
+
constructor(options?: CatalogOptions);
|
|
33
|
+
get knownNamespaces(): ReadonlySet<string>;
|
|
34
|
+
get knownClans(): ReadonlySet<string>;
|
|
35
|
+
get documents(): readonly CliffDocument[];
|
|
36
|
+
get sourceLanguages(): readonly string[];
|
|
37
|
+
addDocument(document: CliffDocument): MessageRecord[];
|
|
38
|
+
addDraft(parts: {
|
|
39
|
+
namespace: string;
|
|
40
|
+
clan: string;
|
|
41
|
+
group: string;
|
|
42
|
+
id: string;
|
|
43
|
+
sourceLanguage: string;
|
|
44
|
+
targetLanguage: string;
|
|
45
|
+
}, draft: TranslatedDraft): MessageRecord;
|
|
46
|
+
private ensureDocument;
|
|
47
|
+
private indexRecord;
|
|
48
|
+
hasCanonical(canonical: string): boolean;
|
|
49
|
+
recordForCanonical(canonical: string): MessageRecord | undefined;
|
|
50
|
+
recordsForCanonical(canonical: string): readonly MessageRecord[];
|
|
51
|
+
suffixMatches(suffix: string): readonly string[];
|
|
52
|
+
record(canonical: string, locale: string): MessageRecord | undefined;
|
|
53
|
+
selectRecord(canonical: string, localeChain: readonly string[], sourceLanguage?: string): MessageRecord | undefined;
|
|
54
|
+
localeChain(locale: string, fallbacks?: readonly string[], sourceLanguage?: string): string[];
|
|
55
|
+
namespaces(): string[];
|
|
56
|
+
clans(namespace?: string): string[];
|
|
57
|
+
groups(scope?: Partial<TranslationScope>): string[];
|
|
58
|
+
entryIds(scope?: Partial<TranslationScope>): string[];
|
|
59
|
+
allRecords(): MessageRecord[];
|
|
60
|
+
query(options?: EntryQuery): MessageRecord[];
|
|
61
|
+
untranslated(options?: Omit<EntryQuery, "status" | "target">): MessageRecord[];
|
|
62
|
+
byStatus(status: StatusTag, options?: Omit<EntryQuery, "status">): MessageRecord[];
|
|
63
|
+
statusCounts(options?: Omit<EntryQuery, "status">): StatusCounts;
|
|
64
|
+
locales(): string[];
|
|
65
|
+
findGroup(namespace: string, clan: string, groupPath: string): CliffGroup | undefined;
|
|
66
|
+
files(options?: FileOptions): CliffFile[];
|
|
67
|
+
toCliff(options?: FileOptions): string;
|
|
68
|
+
validate(): ValidationIssue[];
|
|
69
|
+
}
|
|
70
|
+
declare function assertCatalogParts(parts: {
|
|
71
|
+
namespace: string;
|
|
72
|
+
clan: string;
|
|
73
|
+
group: string;
|
|
74
|
+
id: string;
|
|
75
|
+
}): void;
|
|
76
|
+
|
|
77
|
+
type IcuDialect = "plain" | "mf1" | "mf2";
|
|
78
|
+
interface IcuError {
|
|
79
|
+
type: string;
|
|
80
|
+
message: string;
|
|
81
|
+
source?: string;
|
|
82
|
+
}
|
|
83
|
+
type MessagePart = {
|
|
84
|
+
type: "literal";
|
|
85
|
+
value: string;
|
|
86
|
+
} | {
|
|
87
|
+
type: "expression";
|
|
88
|
+
source: string;
|
|
89
|
+
value: string;
|
|
90
|
+
locale?: string;
|
|
91
|
+
} | {
|
|
92
|
+
type: "markup";
|
|
93
|
+
kind: "open" | "close" | "standalone";
|
|
94
|
+
name: string;
|
|
95
|
+
source: string;
|
|
96
|
+
};
|
|
97
|
+
interface IcuFormatResult {
|
|
98
|
+
text: string;
|
|
99
|
+
errors: IcuError[];
|
|
100
|
+
}
|
|
101
|
+
interface IcuPartsResult {
|
|
102
|
+
parts: MessagePart[];
|
|
103
|
+
errors: IcuError[];
|
|
104
|
+
}
|
|
105
|
+
interface IcuAnalysis {
|
|
106
|
+
dialect: IcuDialect;
|
|
107
|
+
arguments: string[];
|
|
108
|
+
errors: IcuError[];
|
|
109
|
+
}
|
|
110
|
+
interface IcuFormatOptions {
|
|
111
|
+
currency?: string;
|
|
112
|
+
timeZone?: string;
|
|
113
|
+
}
|
|
114
|
+
interface IcuRuntime {
|
|
115
|
+
format(message: string, locale: string, values: Record<string, unknown>, options?: IcuFormatOptions): IcuFormatResult;
|
|
116
|
+
formatToParts(message: string, locale: string, values: Record<string, unknown>, options?: IcuFormatOptions): IcuPartsResult;
|
|
117
|
+
analyze(message: string): IcuAnalysis;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
declare const TYPE: {
|
|
121
|
+
readonly noun: "noun";
|
|
122
|
+
readonly verb: "verb";
|
|
123
|
+
readonly adjective: "adjective";
|
|
124
|
+
readonly adverb: "adverb";
|
|
125
|
+
readonly pronoun: "pronoun";
|
|
126
|
+
readonly numeral: "numeral";
|
|
127
|
+
readonly preposition: "preposition";
|
|
128
|
+
readonly conjunction: "conjunction";
|
|
129
|
+
readonly particle: "particle";
|
|
130
|
+
readonly interjection: "interjection";
|
|
131
|
+
readonly "proper-noun": "proper-noun";
|
|
132
|
+
readonly "noun-phrase": "noun-phrase";
|
|
133
|
+
readonly "verb-phrase": "verb-phrase";
|
|
134
|
+
readonly "adjective-phrase": "adjective-phrase";
|
|
135
|
+
readonly "adverb-phrase": "adverb-phrase";
|
|
136
|
+
readonly "fixed-phrase": "fixed-phrase";
|
|
137
|
+
readonly idiom: "idiom";
|
|
138
|
+
readonly sentence: "sentence";
|
|
139
|
+
readonly description: "description";
|
|
140
|
+
readonly narration: "narration";
|
|
141
|
+
readonly dialogue: "dialogue";
|
|
142
|
+
readonly monologue: "monologue";
|
|
143
|
+
readonly prompt: "prompt";
|
|
144
|
+
readonly label: "label";
|
|
145
|
+
readonly subtitle: "subtitle";
|
|
146
|
+
readonly "accessibility-cue": "accessibility-cue";
|
|
147
|
+
};
|
|
148
|
+
type TypeTag = (typeof TYPE)[keyof typeof TYPE];
|
|
149
|
+
declare const EMOTION: {
|
|
150
|
+
readonly neutral: "neutral";
|
|
151
|
+
readonly objective: "objective";
|
|
152
|
+
readonly mechanical: "mechanical";
|
|
153
|
+
readonly joyful: "joyful";
|
|
154
|
+
readonly sad: "sad";
|
|
155
|
+
readonly angry: "angry";
|
|
156
|
+
readonly fearful: "fearful";
|
|
157
|
+
readonly surprised: "surprised";
|
|
158
|
+
readonly curious: "curious";
|
|
159
|
+
readonly disgusted: "disgusted";
|
|
160
|
+
readonly anxious: "anxious";
|
|
161
|
+
readonly calm: "calm";
|
|
162
|
+
readonly playful: "playful";
|
|
163
|
+
readonly serious: "serious";
|
|
164
|
+
readonly urgent: "urgent";
|
|
165
|
+
readonly romantic: "romantic";
|
|
166
|
+
readonly hopeful: "hopeful";
|
|
167
|
+
readonly grateful: "grateful";
|
|
168
|
+
readonly formal: "formal";
|
|
169
|
+
readonly informal: "informal";
|
|
170
|
+
readonly polite: "polite";
|
|
171
|
+
readonly rude: "rude";
|
|
172
|
+
readonly nostalgic: "nostalgic";
|
|
173
|
+
};
|
|
174
|
+
type EmotionTag = (typeof EMOTION)[keyof typeof EMOTION];
|
|
175
|
+
declare const STATUS: {
|
|
176
|
+
readonly initial: "initial";
|
|
177
|
+
readonly translated: "translated";
|
|
178
|
+
readonly reviewed: "reviewed";
|
|
179
|
+
readonly final: "final";
|
|
180
|
+
};
|
|
181
|
+
type StatusTag = (typeof STATUS)[keyof typeof STATUS];
|
|
182
|
+
declare const VARIANT: {
|
|
183
|
+
readonly standard: "standard";
|
|
184
|
+
readonly glossary: "glossary";
|
|
185
|
+
};
|
|
186
|
+
type VariantTag = (typeof VARIANT)[keyof typeof VARIANT];
|
|
187
|
+
declare const STATUS_ORDER: readonly ["initial", "translated", "reviewed", "final"];
|
|
188
|
+
type Params = Record<string, unknown>;
|
|
189
|
+
type EntryIdOf<EntryIds extends string> = string extends EntryIds ? string : EntryIds | (string & {});
|
|
190
|
+
type CliffResource = string | Uint8Array | CliffDocument;
|
|
191
|
+
interface TranslationScope {
|
|
192
|
+
namespace: string;
|
|
193
|
+
clan: string;
|
|
194
|
+
group?: string;
|
|
195
|
+
}
|
|
196
|
+
type EntryIdInput = string | {
|
|
197
|
+
namespace?: string;
|
|
198
|
+
clan?: string;
|
|
199
|
+
group?: string;
|
|
200
|
+
id: string;
|
|
201
|
+
};
|
|
202
|
+
interface EntryQuery {
|
|
203
|
+
namespace?: string;
|
|
204
|
+
clan?: string;
|
|
205
|
+
group?: string;
|
|
206
|
+
locale?: string | "all";
|
|
207
|
+
status?: StatusTag | readonly StatusTag[];
|
|
208
|
+
target?: "any" | "present" | "missing";
|
|
209
|
+
}
|
|
210
|
+
type StatusCounts = Record<StatusTag, number>;
|
|
211
|
+
interface ResolvedEntryId {
|
|
212
|
+
namespace: string;
|
|
213
|
+
clan: string;
|
|
214
|
+
group: string;
|
|
215
|
+
id: string;
|
|
216
|
+
canonical: string;
|
|
217
|
+
exists: boolean;
|
|
218
|
+
ambiguous?: boolean;
|
|
219
|
+
candidates?: readonly string[];
|
|
220
|
+
}
|
|
221
|
+
interface MessageRecord {
|
|
222
|
+
canonical: string;
|
|
223
|
+
namespace: string;
|
|
224
|
+
clan: string;
|
|
225
|
+
group: string;
|
|
226
|
+
id: string;
|
|
227
|
+
locale: string;
|
|
228
|
+
sourceLanguage: string;
|
|
229
|
+
document: CliffDocument;
|
|
230
|
+
groupRef: CliffGroup;
|
|
231
|
+
entry: CliffEntry;
|
|
232
|
+
variant: string;
|
|
233
|
+
source: string;
|
|
234
|
+
target?: string;
|
|
235
|
+
type?: string;
|
|
236
|
+
emotion: string[];
|
|
237
|
+
status?: string;
|
|
238
|
+
context?: string;
|
|
239
|
+
maxWidth?: number;
|
|
240
|
+
reference: string[];
|
|
241
|
+
reviewer?: string;
|
|
242
|
+
extensions: Record<string, string>;
|
|
243
|
+
filePath?: string;
|
|
244
|
+
}
|
|
245
|
+
interface MessageMetadata {
|
|
246
|
+
entryId: string;
|
|
247
|
+
namespace: string;
|
|
248
|
+
clan: string;
|
|
249
|
+
group: string;
|
|
250
|
+
id: string;
|
|
251
|
+
locale: string;
|
|
252
|
+
sourceLanguage: string;
|
|
253
|
+
targetLanguage: string;
|
|
254
|
+
variant: string;
|
|
255
|
+
source: string;
|
|
256
|
+
target?: string;
|
|
257
|
+
type?: string;
|
|
258
|
+
emotion: string[];
|
|
259
|
+
status?: string;
|
|
260
|
+
context?: string;
|
|
261
|
+
maxWidth?: number;
|
|
262
|
+
reference: string[];
|
|
263
|
+
reviewer?: string;
|
|
264
|
+
extensions: Record<string, string>;
|
|
265
|
+
}
|
|
266
|
+
interface MessageState {
|
|
267
|
+
source: boolean;
|
|
268
|
+
type: boolean;
|
|
269
|
+
}
|
|
270
|
+
type RenderMethod<S extends MessageState> = S["source"] extends true ? S["type"] extends true ? (params?: Params) => string : never : (params?: Params) => string;
|
|
271
|
+
type RenderPartsMethod<S extends MessageState> = S["source"] extends true ? S["type"] extends true ? (params?: Params) => MessagePart[] : never : (params?: Params) => MessagePart[];
|
|
272
|
+
interface CommitOptions {
|
|
273
|
+
overwrite?: boolean;
|
|
274
|
+
validate?: boolean;
|
|
275
|
+
}
|
|
276
|
+
interface MessageBuilder<S extends MessageState = {
|
|
277
|
+
source: false;
|
|
278
|
+
type: false;
|
|
279
|
+
}> {
|
|
280
|
+
source(text: string, params?: Params): MessageBuilder<{
|
|
281
|
+
source: true;
|
|
282
|
+
type: S["type"];
|
|
283
|
+
}>;
|
|
284
|
+
type(tag: TypeTag): MessageBuilder<{
|
|
285
|
+
source: S["source"];
|
|
286
|
+
type: true;
|
|
287
|
+
}>;
|
|
288
|
+
typeFromGroup: S extends {
|
|
289
|
+
source: true;
|
|
290
|
+
type: false;
|
|
291
|
+
} ? () => MessageBuilder<{
|
|
292
|
+
source: true;
|
|
293
|
+
type: true;
|
|
294
|
+
}> : never;
|
|
295
|
+
emotion(...tags: readonly (EmotionTag | readonly EmotionTag[])[]): MessageBuilder<S>;
|
|
296
|
+
context(text: string): MessageBuilder<S>;
|
|
297
|
+
maxWidth(cells: number): MessageBuilder<S>;
|
|
298
|
+
reference(...paths: string[]): MessageBuilder<S>;
|
|
299
|
+
reviewer(name: string): MessageBuilder<S>;
|
|
300
|
+
extension(name: string, value: string): MessageBuilder<S>;
|
|
301
|
+
target(text: string, params?: Params): MessageBuilder<S>;
|
|
302
|
+
status(tag: StatusTag): MessageBuilder<S>;
|
|
303
|
+
locale(tag: string): MessageBuilder<S>;
|
|
304
|
+
params(params: Params): MessageBuilder<S>;
|
|
305
|
+
count(value: number): MessageBuilder<S>;
|
|
306
|
+
render: RenderMethod<S>;
|
|
307
|
+
renderToParts: RenderPartsMethod<S>;
|
|
308
|
+
commit: S extends {
|
|
309
|
+
source: true;
|
|
310
|
+
type: true;
|
|
311
|
+
} ? (options?: CommitOptions) => MessageBuilder<S> : never;
|
|
312
|
+
meta(): MessageMetadata;
|
|
313
|
+
entry(): CliffEntry | undefined;
|
|
314
|
+
width(params?: Params): number;
|
|
315
|
+
fits(params?: Params): boolean;
|
|
316
|
+
toString(): string;
|
|
317
|
+
}
|
|
318
|
+
interface TFunction<EntryIds extends string = string> {
|
|
319
|
+
(entryId: EntryIdOf<EntryIds>): MessageBuilder<{
|
|
320
|
+
source: false;
|
|
321
|
+
type: false;
|
|
322
|
+
}>;
|
|
323
|
+
(entryId: EntryIdOf<EntryIds>, params: Params): string;
|
|
324
|
+
render(entryId: EntryIdOf<EntryIds>, params?: Params): string;
|
|
325
|
+
renderToParts(entryId: EntryIdOf<EntryIds>, params?: Params): MessagePart[];
|
|
326
|
+
has(entryId: EntryIdOf<EntryIds>): boolean;
|
|
327
|
+
entry(entryId: EntryIdOf<EntryIds>): CliffEntry | undefined;
|
|
328
|
+
meta(entryId: EntryIdOf<EntryIds>): MessageMetadata | undefined;
|
|
329
|
+
entryIds(): string[];
|
|
330
|
+
}
|
|
331
|
+
interface ScopedI18n<EntryIds extends string = string> {
|
|
332
|
+
readonly t: TFunction<EntryIds>;
|
|
333
|
+
readonly scope: TranslationScope;
|
|
334
|
+
}
|
|
335
|
+
type MissingBehavior = "entryId" | "empty" | "throw" | "source";
|
|
336
|
+
type WidthPolicy = "off" | "warn" | "error";
|
|
337
|
+
type DiagnosticSeverity = "error" | "warning" | "info";
|
|
338
|
+
interface I18nDiagnostic {
|
|
339
|
+
code: string;
|
|
340
|
+
severity: DiagnosticSeverity;
|
|
341
|
+
message: string;
|
|
342
|
+
entryId?: string;
|
|
343
|
+
locale?: string;
|
|
344
|
+
namespace?: string;
|
|
345
|
+
clan?: string;
|
|
346
|
+
group?: string;
|
|
347
|
+
line?: number;
|
|
348
|
+
details?: Record<string, unknown>;
|
|
349
|
+
}
|
|
350
|
+
interface I18nOptions {
|
|
351
|
+
locale: string;
|
|
352
|
+
fallbackLocale?: string | readonly string[];
|
|
353
|
+
resources?: readonly CliffResource[];
|
|
354
|
+
sourceLanguage?: string;
|
|
355
|
+
defaultGroup?: string;
|
|
356
|
+
params?: Params;
|
|
357
|
+
aliases?: Readonly<Record<string, string>>;
|
|
358
|
+
missing?: MissingBehavior;
|
|
359
|
+
strictEntryIds?: boolean;
|
|
360
|
+
requireEmotion?: boolean | readonly TypeTag[];
|
|
361
|
+
enforceMaxWidth?: WidthPolicy;
|
|
362
|
+
icu?: IcuRuntime;
|
|
363
|
+
parse?: ParseOptions;
|
|
364
|
+
onDiagnostic?: (diagnostic: I18nDiagnostic) => void;
|
|
365
|
+
maxDiagnostics?: number;
|
|
366
|
+
}
|
|
367
|
+
interface TranslatedDraft {
|
|
368
|
+
source?: string;
|
|
369
|
+
target?: string;
|
|
370
|
+
type?: string;
|
|
371
|
+
emotion?: readonly string[];
|
|
372
|
+
status?: string;
|
|
373
|
+
context?: string;
|
|
374
|
+
maxWidth?: number;
|
|
375
|
+
reference?: readonly string[];
|
|
376
|
+
reviewer?: string;
|
|
377
|
+
extensions?: Record<string, string>;
|
|
378
|
+
}
|
|
379
|
+
interface AddOptions {
|
|
380
|
+
sourcePath?: string;
|
|
381
|
+
tolerant?: boolean;
|
|
382
|
+
validate?: boolean;
|
|
383
|
+
}
|
|
384
|
+
interface AddResult {
|
|
385
|
+
documents: readonly CliffDocument[];
|
|
386
|
+
issues: readonly ValidationIssue[];
|
|
387
|
+
corrections: readonly Correction[];
|
|
388
|
+
}
|
|
389
|
+
interface FileOptions {
|
|
390
|
+
layout?: "folder" | "flat";
|
|
391
|
+
}
|
|
392
|
+
interface CliffFile {
|
|
393
|
+
filePath: string;
|
|
394
|
+
namespace: string;
|
|
395
|
+
clan: string;
|
|
396
|
+
locale: string;
|
|
397
|
+
text: string;
|
|
398
|
+
document: CliffDocument;
|
|
399
|
+
}
|
|
400
|
+
interface I18n<EntryIds extends string = string> {
|
|
401
|
+
readonly locale: string;
|
|
402
|
+
readonly language: string;
|
|
403
|
+
readonly sourceLanguage: string | undefined;
|
|
404
|
+
getLocale(): string;
|
|
405
|
+
setLocale(locale: string): void;
|
|
406
|
+
changeLanguage(locale: string): void;
|
|
407
|
+
getVersion(): number;
|
|
408
|
+
subscribe(listener: () => void): () => void;
|
|
409
|
+
scope(scope: TranslationScope): ScopedI18n<EntryIds>;
|
|
410
|
+
add(resource: CliffResource, options?: AddOptions): AddResult;
|
|
411
|
+
addDocument(document: CliffDocument, options?: AddOptions): AddResult;
|
|
412
|
+
has(entryId: EntryIdOf<EntryIds> | Exclude<EntryIdInput, string>, scope: TranslationScope): boolean;
|
|
413
|
+
resolve(entryId: EntryIdOf<EntryIds> | Exclude<EntryIdInput, string>, scope: TranslationScope): ResolvedEntryId;
|
|
414
|
+
entryIds(scope?: Partial<TranslationScope>): string[];
|
|
415
|
+
query(options?: EntryQuery): MessageRecord[];
|
|
416
|
+
untranslated(options?: Omit<EntryQuery, "status" | "target">): MessageRecord[];
|
|
417
|
+
byStatus(status: StatusTag, options?: Omit<EntryQuery, "status">): MessageRecord[];
|
|
418
|
+
statusCounts(options?: Omit<EntryQuery, "status">): StatusCounts;
|
|
419
|
+
namespaces(): string[];
|
|
420
|
+
clans(namespace?: string): string[];
|
|
421
|
+
groups(scope?: Partial<TranslationScope>): string[];
|
|
422
|
+
locales(): string[];
|
|
423
|
+
files(options?: FileOptions): CliffFile[];
|
|
424
|
+
toCliff(options?: FileOptions): string;
|
|
425
|
+
validate(): ValidationIssue[];
|
|
426
|
+
diagnostics(): readonly I18nDiagnostic[];
|
|
427
|
+
clearDiagnostics(): void;
|
|
428
|
+
format(message: string, params?: Params, options?: {
|
|
429
|
+
locale?: string;
|
|
430
|
+
currency?: string;
|
|
431
|
+
timeZone?: string;
|
|
432
|
+
}): string;
|
|
433
|
+
formatToParts(message: string, params?: Params, options?: {
|
|
434
|
+
locale?: string;
|
|
435
|
+
currency?: string;
|
|
436
|
+
timeZone?: string;
|
|
437
|
+
}): MessagePart[];
|
|
438
|
+
}
|
|
439
|
+
interface I18nRuntime {
|
|
440
|
+
resolve(entryId: EntryIdInput, scope: TranslationScope): ResolvedEntryId;
|
|
441
|
+
recordFor(canonical: string, locale: string): MessageRecord | undefined;
|
|
442
|
+
format(message: string, params: Params, options: {
|
|
443
|
+
locale: string;
|
|
444
|
+
currency?: string;
|
|
445
|
+
timeZone?: string;
|
|
446
|
+
}): string;
|
|
447
|
+
formatToParts(message: string, params: Params, options: {
|
|
448
|
+
locale: string;
|
|
449
|
+
currency?: string;
|
|
450
|
+
timeZone?: string;
|
|
451
|
+
}): MessagePart[];
|
|
452
|
+
diagnose(diagnostic: I18nDiagnostic): void;
|
|
453
|
+
getSourceLanguage(): string;
|
|
454
|
+
getLocale(): string;
|
|
455
|
+
getCatalog(): Catalog;
|
|
456
|
+
readonly defaultParams: Params;
|
|
457
|
+
readonly missing: MissingBehavior;
|
|
458
|
+
readonly requireEmotion: boolean | readonly TypeTag[];
|
|
459
|
+
readonly enforceMaxWidth: WidthPolicy;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export { type AddOptions as A, type ResolvedEntryId as B, Catalog as C, type DiagnosticSeverity as D, EMOTION as E, type FileOptions as F, STATUS_ORDER as G, type ScopedI18n as H, type I18nOptions as I, type StatusCounts as J, type StatusTag as K, TYPE as L, type MessageBuilder as M, type TranslatedDraft as N, type TranslationScope as O, type Params as P, type TypeTag as Q, type RenderMethod as R, STATUS as S, type TFunction as T, type VariantTag as U, VARIANT as V, type WidthPolicy as W, assertCatalogParts as X, assertScope as Y, joinCanonical as Z, resolveEntryId as _, type I18n as a, type IcuRuntime as b, type AddResult as c, type CatalogOptions as d, type CliffFile as e, type CliffResource as f, type CommitOptions as g, type EmotionTag as h, type EntryIdCatalogContext as i, type EntryIdInput as j, type EntryIdOf as k, type EntryQuery as l, type I18nDiagnostic as m, type I18nRuntime as n, type IcuAnalysis as o, type IcuDialect as p, type IcuError as q, type IcuFormatOptions as r, type IcuFormatResult as s, type IcuPartsResult as t, type MessageMetadata as u, type MessagePart as v, type MessageRecord as w, type MessageState as x, type MissingBehavior as y, type RenderPartsMethod as z };
|