@cosmicdrift/kumiko-types 0.321.0 → 0.323.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.321.0",
3
+ "version": "0.323.0",
4
4
  "description": "Framework-Type-Definitions für Kumiko — FeatureDefinition, BootCheck-Types und die reinen Engine-Types. Erlaubt Downstream-Konsumenten, gegen die Type-Contracts zu bauen, ohne das ganze Framework-Package zu importieren. Enthaelt keine identitaets-sensitiven Runtime-Werte mehr (Error-Klassen leben seit #1629 in kumiko-framework, Brand-Symbole nutzen Symbol.for) und ist deshalb eine plain dependency, keine peerDependency.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -0,0 +1,18 @@
1
+ // Type-level contract for PluralForms (#3344): `other` is the CLDR-mandated
2
+ // fallback and must stay required. The body below is never invoked — tsc
3
+ // checks it, bun:test does not run it. If `other` ever becomes optional the
4
+ // `@ts-expect-error` turns into an "unused directive" compile error.
5
+
6
+ import { expect, test } from "bun:test";
7
+ import type { PluralForms } from "../config";
8
+
9
+ function _pluralFormsRequireOther(): readonly PluralForms[] {
10
+ const withOther: PluralForms = { other: "items" };
11
+ // @ts-expect-error — `other` is required; a plural entry without it must not typecheck.
12
+ const missingOther: PluralForms = { one: "item" };
13
+ return [withOther, missingOther];
14
+ }
15
+
16
+ test("PluralForms: compile-time contract is wired", () => {
17
+ expect(_pluralFormsRequireOther).toBeDefined();
18
+ });
package/src/config.ts CHANGED
@@ -453,7 +453,19 @@ export type NotificationDefinition = {
453
453
 
454
454
  // --- Translations ---
455
455
 
456
- export type TranslationEntry = Readonly<Record<string, string>>;
456
+ // CLDR plural categories for one locale's variants of a translation string.
457
+ // `other` is the CLDR-mandated fallback and therefore required; the rest
458
+ // only exist in some locales (e.g. "few"/"many" for Slavic plurals).
459
+ export type PluralForms = {
460
+ readonly zero?: string;
461
+ readonly one?: string;
462
+ readonly two?: string;
463
+ readonly few?: string;
464
+ readonly many?: string;
465
+ readonly other: string;
466
+ };
467
+ export type TranslationValue = string | PluralForms;
468
+ export type TranslationEntry = Readonly<Record<string, TranslationValue>>;
457
469
  export type TranslationKeys = Readonly<Record<string, TranslationEntry>>;
458
470
 
459
471
  export type TranslationsDef = {
package/src/fields.ts CHANGED
@@ -160,6 +160,11 @@ export type Findability = "exact" | "fuzzy" | "none" | "secret";
160
160
  // force every OTHER intersected property (e.g. a factory's `required?: R`)
161
161
  // to `never` too, since its index signature applies to all string keys.
162
162
  // Naming the three annotation keys explicitly avoids that trap.
163
+ //
164
+ // kumiko-framework#2921: no longer part of PersonalAnnotations /
165
+ // PersonalAnnotationsLongText — text and longText fields must declare an
166
+ // explicit stance. It still applies to PersonalAnnotationsNoFind, whose
167
+ // factories keep `personal` optional.
163
168
  type NoPersonalAnnotation = {
164
169
  readonly personal?: never;
165
170
  readonly find?: never;
@@ -178,8 +183,7 @@ export type PersonalAnnotations =
178
183
  readonly personal: false;
179
184
  readonly reason: string;
180
185
  readonly anonymize?: () => unknown | Promise<unknown>;
181
- }
182
- | NoPersonalAnnotation;
186
+ };
183
187
 
184
188
  // longText has no lookupable/searchable machinery ("Kein searchable" — see
185
189
  // LongTextFieldDef doc) — only "does this need to stay a secret" applies.
@@ -197,8 +201,7 @@ export type PersonalAnnotationsLongText =
197
201
  readonly personal: false;
198
202
  readonly reason: string;
199
203
  readonly anonymize?: () => unknown | Promise<unknown>;
200
- }
201
- | NoPersonalAnnotation;
204
+ };
202
205
 
203
206
  // Same as PersonalAnnotations but without `find` — for field types with no
204
207
  // full-text/blind-index machinery (everything except text and longText).