@almadar/core 10.84.0 → 10.86.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/dist/builders.d.ts +3 -3
- package/dist/builders.js +9 -0
- package/dist/builders.js.map +1 -1
- package/dist/{effect-DruTSW2O.d.ts → effect-BgDiw_bG.d.ts} +19 -3
- package/dist/{entityAccess-BoYVXf3b.d.ts → entityAccess-DK5S_2cT.d.ts} +1 -1
- package/dist/factory/index.d.ts +4 -4
- package/dist/factory/index.js +180 -8
- package/dist/factory/index.js.map +1 -1
- package/dist/factory-runtime/index.d.ts +3 -3
- package/dist/factory-runtime/index.js +9 -0
- package/dist/factory-runtime/index.js.map +1 -1
- package/dist/i18n/index.d.ts +69 -0
- package/dist/i18n/index.js +1910 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/{index-76Ff6JCE.d.ts → index-ChYsqVJj.d.ts} +4 -4
- package/dist/index.d.ts +11 -10
- package/dist/index.js +2197 -13
- package/dist/index.js.map +1 -1
- package/dist/mock/index.d.ts +4 -4
- package/dist/patterns/component-mapping.json +6 -1
- package/dist/patterns/event-contracts.json +1 -1
- package/dist/patterns/index.d.ts +367 -13
- package/dist/patterns/index.js +189 -11
- package/dist/patterns/index.js.map +1 -1
- package/dist/patterns/patterns-registry.json +181 -9
- package/dist/patterns/registry.json +181 -9
- package/dist/{schema-BdeZ8R35.d.ts → schema-BhfQb1oe.d.ts} +498 -2
- package/dist/state-machine/index.js +91 -1
- package/dist/state-machine/index.js.map +1 -1
- package/dist/{trait-DKJWX0Ru.d.ts → trait-pavNlGqm.d.ts} +122 -1
- package/dist/types/index.d.ts +5 -5
- package/dist/types/index.js +10 -0
- package/dist/types/index.js.map +1 -1
- package/dist/{types-CRr2IuTj.d.ts → types-CCAmdxcH.d.ts} +12 -2
- package/package.json +6 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internationalization (i18n) — vocabulary tables for the `.lolo`/`.orb`
|
|
3
|
+
* language (English, Arabic, Slovenian). See `Almadar_i18n.md` / the i18n
|
|
4
|
+
* program plan for the section contract; this module is the JS-path owner.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
type LanguageCode = 'en' | 'ar' | 'sl';
|
|
9
|
+
declare const LANGUAGE_CODES: readonly LanguageCode[];
|
|
10
|
+
declare const I18N_SECTIONS: readonly ["keywords", "shapes", "tags", "categories", "capabilities", "annotations", "sigils", "effects", "types", "units", "literals", "reservedEvents", "orb"];
|
|
11
|
+
type I18nSection = typeof I18N_SECTIONS[number];
|
|
12
|
+
interface I18nMeta {
|
|
13
|
+
code: LanguageCode;
|
|
14
|
+
name: string;
|
|
15
|
+
rtl: boolean;
|
|
16
|
+
}
|
|
17
|
+
type I18nTables = {
|
|
18
|
+
meta: I18nMeta;
|
|
19
|
+
} & Record<I18nSection, Record<string, string>>;
|
|
20
|
+
/** Supplied by the caller (@almadar/std) — core must not import std. */
|
|
21
|
+
interface OperatorTables {
|
|
22
|
+
operators: Record<string, string>;
|
|
23
|
+
}
|
|
24
|
+
/** Validating loader — the one owner of the table shape; every reader (core, pattern-sync) goes through it. */
|
|
25
|
+
declare function parseI18nTables(raw: unknown, source: string): I18nTables;
|
|
26
|
+
declare function parseOperatorTables(raw: unknown, source: string): OperatorTables;
|
|
27
|
+
declare const coreTables: Record<LanguageCode, I18nTables>;
|
|
28
|
+
declare function getVocabulary(lang: LanguageCode): I18nTables;
|
|
29
|
+
/** Native → English map for one section family; operators come from the caller (std). */
|
|
30
|
+
declare function aliasMap(lang: LanguageCode, section: I18nSection | 'operators', operators?: OperatorTables): ReadonlyMap<string, string>;
|
|
31
|
+
/** The token equals exactly one language's `keywords.app` value. */
|
|
32
|
+
/** The keywords that can legally open a `.lolo` program (top-level structure, LOLO.md §3). */
|
|
33
|
+
declare const LOLO_FIRST_TOKEN_KEYWORDS: readonly ["app", "uses", "expects", "type", "theme", "orbital"];
|
|
34
|
+
/** A `.lolo` program's language: its first token is one language's translation of a first-token keyword. */
|
|
35
|
+
declare function languageOfLoloFirstToken(token: string): LanguageCode | undefined;
|
|
36
|
+
/** A top-level `.orb` key equals exactly one language's `orb.orbitals` value. */
|
|
37
|
+
declare function languageOfOrbTopLevelKeys(keys: readonly string[]): LanguageCode | undefined;
|
|
38
|
+
type I18nProblemKind = 'missing' | 'orphan' | 'empty' | 'inconsistent' | 'collision' | 'selector-not-unique' | 'operators-mismatch' | 'identical-to-english';
|
|
39
|
+
interface I18nProblem {
|
|
40
|
+
lang: LanguageCode;
|
|
41
|
+
section: string;
|
|
42
|
+
kind: I18nProblemKind;
|
|
43
|
+
key: string;
|
|
44
|
+
detail?: string;
|
|
45
|
+
}
|
|
46
|
+
interface I18nCoverageInput {
|
|
47
|
+
core: Record<LanguageCode, I18nTables>;
|
|
48
|
+
std?: Record<LanguageCode, OperatorTables>;
|
|
49
|
+
canonicalOperators?: readonly string[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The one implementation of the i18n coverage rules (plan B1):
|
|
53
|
+
* missing/orphan/empty key sets, cross-section translation consistency,
|
|
54
|
+
* native-value collisions (within a section, and across effects∪operators),
|
|
55
|
+
* unique language-selector translations, and operator-set parity.
|
|
56
|
+
* Never truncates — returns every problem found.
|
|
57
|
+
*/
|
|
58
|
+
declare function checkI18nCoverage(input: I18nCoverageInput): {
|
|
59
|
+
ok: boolean;
|
|
60
|
+
problems: I18nProblem[];
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Informational only — NOT part of the coverage gate (Slovenian legitimately
|
|
64
|
+
* carries loanwords identical to English). Lists native values equal to the
|
|
65
|
+
* English value, for a human to spot-check.
|
|
66
|
+
*/
|
|
67
|
+
declare function reportIdenticalToEnglish(input: I18nCoverageInput): I18nProblem[];
|
|
68
|
+
|
|
69
|
+
export { I18N_SECTIONS, type I18nCoverageInput, type I18nMeta, type I18nProblem, type I18nProblemKind, type I18nSection, type I18nTables, LANGUAGE_CODES, LOLO_FIRST_TOKEN_KEYWORDS, type LanguageCode, type OperatorTables, aliasMap, checkI18nCoverage, coreTables, getVocabulary, languageOfLoloFirstToken, languageOfOrbTopLevelKeys, parseI18nTables, parseOperatorTables, reportIdenticalToEnglish };
|