@optolith/entity-descriptions 0.15.0 → 0.16.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/lib/creator.d.ts +13 -1
  3. package/lib/creator.js +32 -16
  4. package/lib/entities/activatable.d.ts +1 -1
  5. package/lib/entities/alternativeRule.d.ts +1 -1
  6. package/lib/entities/attribute.d.ts +1 -1
  7. package/lib/entities/combatTechnique.d.ts +2 -2
  8. package/lib/entities/condition.d.ts +2 -2
  9. package/lib/entities/culture.d.ts +1 -1
  10. package/lib/entities/curriculum.d.ts +1 -1
  11. package/lib/entities/derivedCharacteristic.d.ts +1 -1
  12. package/lib/entities/disease.d.ts +1 -1
  13. package/lib/entities/disease.js +5 -6
  14. package/lib/entities/elixir.d.ts +1 -1
  15. package/lib/entities/elixir.js +2 -2
  16. package/lib/entities/equipment.d.ts +4 -4
  17. package/lib/entities/equipmentPackage.d.ts +1 -1
  18. package/lib/entities/experienceLevel.d.ts +1 -1
  19. package/lib/entities/focusRule.d.ts +1 -1
  20. package/lib/entities/influence.d.ts +1 -1
  21. package/lib/entities/liturgicalChant.d.ts +3 -3
  22. package/lib/entities/optionalRule.d.ts +1 -1
  23. package/lib/entities/partial/commonnessRatedAdvantagesAndDisadvantages.d.ts +1 -1
  24. package/lib/entities/partial/enhancements.d.ts +1 -1
  25. package/lib/entities/partial/herbary.d.ts +6 -3
  26. package/lib/entities/partial/herbary.js +5 -3
  27. package/lib/entities/partial/prerequisites/index.d.ts +1 -1
  28. package/lib/entities/partial/rated/activatable/effect.d.ts +1 -1
  29. package/lib/entities/partial/rated/activatable/index.d.ts +1 -1
  30. package/lib/entities/partial/rated/activatable/targetCategory.d.ts +1 -1
  31. package/lib/entities/partial/rated/improvementCost.d.ts +1 -1
  32. package/lib/entities/personalityTrait.d.ts +1 -1
  33. package/lib/entities/poison.d.ts +1 -1
  34. package/lib/entities/poison.js +2 -2
  35. package/lib/entities/profession.d.ts +1 -1
  36. package/lib/entities/race.d.ts +1 -1
  37. package/lib/entities/sexPractice.d.ts +1 -1
  38. package/lib/entities/skill.d.ts +1 -1
  39. package/lib/entities/spell.d.ts +16 -16
  40. package/lib/entities/state.d.ts +1 -1
  41. package/lib/entities/tradeSecret.d.ts +1 -1
  42. package/lib/entityDescription.d.ts +118 -0
  43. package/lib/entityDescription.js +1 -0
  44. package/lib/index.d.ts +10 -213
  45. package/lib/rawEntityDescription.d.ts +144 -0
  46. package/lib/rawEntityDescription.js +1 -0
  47. package/lib/tsconfig.tsbuildinfo +1 -1
  48. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [0.16.0](https://github.com/Optolith/entity-descriptions/compare/v0.15.0...v0.16.0) (2026-09-27)
6
+
7
+ ### ⚠ BREAKING CHANGES
8
+
9
+ * extract raw and final description types into separate files and exports
10
+
11
+ * extract raw and final description types into separate files and exports ([4566a3e](https://github.com/Optolith/entity-descriptions/commit/4566a3e47b4635a39fc2a84394bb64e322de7885))
5
12
  ## [0.15.0](https://github.com/Optolith/entity-descriptions/compare/v0.14.0...v0.15.0) (2026-09-26)
6
13
 
7
14
  ### ⚠ BREAKING CHANGES
package/lib/creator.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { type AnyNonNullish } from "@elyukai/utils/nullable";
2
+ import { Reader } from "@elyukai/utils/reader";
2
3
  import type { EntityMap } from "@optolith/database-schema/gen";
4
+ import type { EntityDescription } from "./entityDescription.js";
3
5
  import type { StdEnv } from "./env.js";
4
6
  import type { LocaleEnvironment } from "./helpers/locale.js";
5
- import type { EntityDescription, RawEntityDescription } from "./index.js";
7
+ import type { RawEntityDescription } from "./rawEntityDescription.js";
6
8
  import { type PublicationOptions } from "./references/publicationOptions.js";
7
9
  /**
8
10
  * A union type of entities with their names as a discriminant property.
@@ -26,3 +28,13 @@ export declare const createEntityDescriptionCreator: <ES extends keyof EntityMap
26
28
  export type EntityDescriptionCreator<ES extends keyof EntityMap = keyof EntityMap, A = AnyNonNullish, R = EntityDescription<string>> = (databaseAccessors: A, locale: LocaleEnvironment, entry: TaggedEntity<ES>, options: {
27
29
  publications: PublicationOptions;
28
30
  }) => R | undefined;
31
+ /**
32
+ * Bridge between Reader and plain string instances in a definition list item.
33
+ */
34
+ export declare const combatDLItem: <T, E>(item: {
35
+ label: Reader<E, string>;
36
+ value: Reader<E, T>;
37
+ } | undefined, env: E) => {
38
+ label: string;
39
+ value: T;
40
+ } | undefined;
package/lib/creator.js CHANGED
@@ -1,15 +1,16 @@
1
1
  import { ensureNonEmpty } from "@elyukai/utils/array/nonEmpty";
2
2
  import { isNotNullish } from "@elyukai/utils/nullable";
3
+ import { Reader } from "@elyukai/utils/reader";
3
4
  import { assertExhaustive } from "@elyukai/utils/typeSafety";
4
5
  import { getReferencesTranslation } from "./references/index.js";
5
6
  import { isEntryFromIncludedPublication, } from "./references/publicationOptions.js";
6
- const mapRawSectionContent = (mapDefinitionList, section) => {
7
+ const mapRawSectionContent = (mapDefinitionList, section, env) => {
7
8
  switch (section.type) {
8
9
  case "plain":
9
10
  case "table":
10
11
  return section;
11
12
  case "definitionList":
12
- return mapDefinitionList(section);
13
+ return mapDefinitionList(section, env);
13
14
  default:
14
15
  return assertExhaustive(section);
15
16
  }
@@ -22,31 +23,35 @@ const mapNestedDefinitionList = (definitionListSection) => ({
22
23
  ? item.value
23
24
  : item.value
24
25
  .filter(isNotNullish)
25
- .map(subsection => mapRawSectionContent(mapNestedDefinitionList, subsection)),
26
+ .map(subsection => mapRawSectionContent(mapNestedDefinitionList, subsection, null)),
26
27
  })),
27
28
  });
28
- const mapDefinitionList = (section) => ({
29
+ const mapDefinitionList = (section, env) => ({
29
30
  ...section,
30
- items: section.items.filter(isNotNullish).map(item => ({
31
- ...item,
32
- value: typeof item.value === "string"
33
- ? item.value
34
- : item.value
35
- .filter(isNotNullish)
36
- .map(subsection => mapRawSectionContent(mapNestedDefinitionList, subsection)),
37
- })),
31
+ items: section.items.filter(isNotNullish).map(item => {
32
+ const normalizedValue = item.value instanceof Reader ? item.value.run(env) : item.value;
33
+ return {
34
+ ...item,
35
+ label: typeof item.label === "string" ? item.label : item.label.run(env),
36
+ value: typeof normalizedValue === "string"
37
+ ? normalizedValue
38
+ : normalizedValue
39
+ .filter(isNotNullish)
40
+ .map(subsection => mapRawSectionContent(mapNestedDefinitionList, subsection, env)),
41
+ };
42
+ }),
38
43
  });
39
- const mapRawSection = (section) => {
44
+ const mapRawSection = (section, env) => {
40
45
  switch (section.type) {
41
46
  case "labeled":
42
47
  return {
43
48
  ...section,
44
- value: mapRawSectionContent(mapDefinitionList, section.value),
49
+ value: mapRawSectionContent(mapDefinitionList, section.value, env),
45
50
  };
46
51
  case "plain":
47
52
  case "table":
48
53
  case "definitionList":
49
- return mapRawSectionContent(mapDefinitionList, section);
54
+ return mapRawSectionContent(mapDefinitionList, section, env);
50
55
  default:
51
56
  return assertExhaustive(section);
52
57
  }
@@ -115,7 +120,9 @@ export const createEntityDescriptionCreator = (fn) => (databaseAccessors, locale
115
120
  label: rawEntry.category.label.run(databaseAccessors),
116
121
  value: rawEntry.category.value.run(databaseAccessors),
117
122
  },
118
- body: rawEntry.body.filter(isNotNullish).map(mapRawSection),
123
+ body: rawEntry.body
124
+ .filter(isNotNullish)
125
+ .map(section => mapRawSection(section, databaseAccessors)),
119
126
  errata: rawEntry.errata?.map(({ date, description }) => ({
120
127
  date: locale.formatDate(new Date(date)),
121
128
  description: description.trim(),
@@ -128,3 +135,12 @@ export const createEntityDescriptionCreator = (fn) => (databaseAccessors, locale
128
135
  }),
129
136
  };
130
137
  };
138
+ /**
139
+ * Bridge between Reader and plain string instances in a definition list item.
140
+ */
141
+ export const combatDLItem = (item, env) => item === undefined
142
+ ? undefined
143
+ : {
144
+ label: item.label.run(env),
145
+ value: item.value.run(env),
146
+ };
@@ -60,5 +60,5 @@ export declare const getActivatableEntityDescription: import("../creator.js").En
60
60
  getAllResolvedNewSkillApplications: GetAllResolvedNewSkillApplications;
61
61
  getAllResolvedSkillUses: GetAllResolvedSkillUses;
62
62
  translateMap: TranslateMap;
63
- } & StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
63
+ } & StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
64
64
  export {};
@@ -4,4 +4,4 @@ import type { GetInstanceById } from "../helpers/getTypes.js";
4
4
  */
5
5
  export declare const getAlternativeRuleEntityDescription: import("../creator.js").EntityDescriptionCreator<"AlternativeRule", {
6
6
  getInstanceById: GetInstanceById<"Publication" | "PlayerType">;
7
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
7
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Get a JSON representation of the rules text for an attribute.
3
3
  */
4
- export declare const getAttributeEntityDescription: import("../creator.js").EntityDescriptionCreator<"Attribute", import("@elyukai/utils/nullable").AnyNonNullish & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
4
+ export declare const getAttributeEntityDescription: import("../creator.js").EntityDescriptionCreator<"Attribute", import("@elyukai/utils/nullable").AnyNonNullish & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -4,10 +4,10 @@ import type { GetInstanceById } from "../helpers/getTypes.js";
4
4
  */
5
5
  export declare const getCloseCombatTechniqueEntityDescription: import("../creator.js").EntityDescriptionCreator<"CloseCombatTechnique", {
6
6
  getInstanceById: GetInstanceById<"Publication" | "Attribute">;
7
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
7
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
8
8
  /**
9
9
  * Get a JSON representation of the rules text for a ranged combat technique.
10
10
  */
11
11
  export declare const getRangedCombatTechniqueEntityDescription: import("../creator.js").EntityDescriptionCreator<"RangedCombatTechnique", {
12
12
  getInstanceById: GetInstanceById<"Publication" | "Attribute">;
13
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
13
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Get a JSON representation of the rules text for a condition.
3
3
  */
4
- export declare const getConditionEntityDescription: import("../creator.js").EntityDescriptionCreator<"Condition", import("@elyukai/utils/nullable").AnyNonNullish & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
4
+ export declare const getConditionEntityDescription: import("../creator.js").EntityDescriptionCreator<"Condition", import("@elyukai/utils/nullable").AnyNonNullish & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
5
5
  /**
6
6
  * Get a JSON representation of the rules text for a meta condition.
7
7
  */
8
- export declare const getMetaConditionEntityDescription: import("../creator.js").EntityDescriptionCreator<"MetaCondition", import("@elyukai/utils/nullable").AnyNonNullish & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
8
+ export declare const getMetaConditionEntityDescription: import("../creator.js").EntityDescriptionCreator<"MetaCondition", import("@elyukai/utils/nullable").AnyNonNullish & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -8,4 +8,4 @@ export declare const getCultureEntityDescription: import("../creator.js").Entity
8
8
  getInstanceById: GetInstanceById<"Publication" | "Advantage" | "Disadvantage" | "Skill" | "Language" | "LanguageSpecialization" | "Script" | "SocialStatus" | "ProfessionVariant" | "MagicalTradition" | "BlessedTradition">;
9
9
  getChildInstancesForInstanceId: GetAllChildInstancesForParent<"ProfessionVersion">;
10
10
  getResolvedSelectOptionById: GetResolvedSelectOptionById;
11
- } & StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
11
+ } & StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -8,4 +8,4 @@ export declare const getCurriculumEntityDescription: import("../creator.js").Ent
8
8
  getAllInstances: GetAllInstances<"Profession">;
9
9
  getChildInstancesForInstanceId: GetAllChildInstancesForParent<"LessonPackage" | "ProfessionVersion" | "ProfessionPackage">;
10
10
  idMap: IdMap;
11
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
11
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -4,4 +4,4 @@ import type { GetInstanceById } from "../helpers/getTypes.js";
4
4
  */
5
5
  export declare const getDerivedCharacteristicEntityDescription: import("../creator.js").EntityDescriptionCreator<"DerivedCharacteristic", {
6
6
  getInstanceById: GetInstanceById<"Publication" | "Attribute" | "DerivedCharacteristic">;
7
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
7
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -6,4 +6,4 @@ import type { IdMap } from "../index.js";
6
6
  export declare const getDiseaseEntityDescription: import("../creator.js").EntityDescriptionCreator<"Disease" | "AnimalDisease", {
7
7
  getInstanceById: GetInstanceById<"Publication" | "AnimalType" | "DerivedCharacteristic">;
8
8
  idMap: IdMap;
9
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
9
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -1,6 +1,6 @@
1
1
  import { ensureNonEmpty } from "@elyukai/utils/array/nonEmpty";
2
2
  import { isNotNullish } from "@elyukai/utils/nullable";
3
- import { createEntityDescriptionCreator } from "../creator.js";
3
+ import { combatDLItem, createEntityDescriptionCreator } from "../creator.js";
4
4
  import { renderAnimalTypesSection } from "./partial/animalTypes.js";
5
5
  import { renderAlternativeNames, renderChance, renderResistance } from "./partial/herbary.js";
6
6
  import { parensIf } from "./partial/rated/activatable/parensIf.js";
@@ -18,7 +18,8 @@ const renderCauses = (translate, translateMap, causes) => causes
18
18
  /**
19
19
  * Get a JSON representation of the rules text for an optional rule.
20
20
  */
21
- export const getDiseaseEntityDescription = createEntityDescriptionCreator(({ getInstanceById, idMap }, { translate, translateMap, compare: localeCompare }, { entity, content: entry }) => {
21
+ export const getDiseaseEntityDescription = createEntityDescriptionCreator(({ getInstanceById, idMap }, locale, { entity, content: entry }) => {
22
+ const { translate, translateMap, compare: localeCompare } = locale;
22
23
  const baseEntry = entry;
23
24
  const translation = translateMap(baseEntry.translations);
24
25
  if (translation === undefined) {
@@ -38,7 +39,7 @@ export const getDiseaseEntityDescription = createEntityDescriptionCreator(({ get
38
39
  {
39
40
  type: "definitionList",
40
41
  items: [
41
- renderAlternativeNames(translate, translation.alternative_names),
42
+ combatDLItem(renderAlternativeNames(translation.alternative_names), locale),
42
43
  { label: translate("Level"), value: baseEntry.level.toFixed() },
43
44
  { label: translate("Progress"), value: translation.progress },
44
45
  {
@@ -52,9 +53,7 @@ export const getDiseaseEntityDescription = createEntityDescriptionCreator(({ get
52
53
  {
53
54
  label: translate("Damage"),
54
55
  value: translation.damage.default +
55
- (translation.damage.reduced === undefined
56
- ? ""
57
- : ` / ${translation.damage.reduced}`),
56
+ (translation.damage.reduced === undefined ? "" : ` / ${translation.damage.reduced}`),
58
57
  },
59
58
  {
60
59
  label: translate("Duration"),
@@ -7,4 +7,4 @@ import type { GetResolvedSelectOptionById } from "./partial/prerequisites/single
7
7
  export declare const getElixirEntityDescription: import("../creator.js").EntityDescriptionCreator<"Elixir", {
8
8
  getInstanceById: GetInstanceById<"Publication" | "DerivedCharacteristic" | ActivatableIdentifier["kind"] | RatedIdentifier["kind"] | "Race" | "Culture" | "State" | "Enhancement" | "PactCategory" | "PactDomain" | "SocialStatus" | "Aspect" | "Property" | "PersonalityTrait" | "Blessing" | "Cantrip">;
9
9
  getResolvedSelectOptionById: GetResolvedSelectOptionById;
10
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
10
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -1,6 +1,6 @@
1
1
  import { mapNullable } from "@elyukai/utils/nullable";
2
2
  import { sign } from "@elyukai/utils/string/number";
3
- import { createEntityDescriptionCreator } from "../creator.js";
3
+ import { combatDLItem, createEntityDescriptionCreator } from "../creator.js";
4
4
  import { renderAlternativeNames, renderLaboratoryLevel } from "./partial/herbary.js";
5
5
  import { printPlainGeneralPrerequisites } from "./partial/prerequisites/index.js";
6
6
  import { parensIf } from "./partial/rated/activatable/parensIf.js";
@@ -28,7 +28,7 @@ export const getElixirEntityDescription = createEntityDescriptionCreator(({ getI
28
28
  {
29
29
  type: "definitionList",
30
30
  items: [
31
- renderAlternativeNames(translate, translation.alternative_names),
31
+ combatDLItem(renderAlternativeNames(translation.alternative_names), locale),
32
32
  {
33
33
  label: translate("Typical Ingredients"),
34
34
  value: translation.typical_ingredients.join(", "),
@@ -4,7 +4,7 @@ import type { StdEnv } from "../env.js";
4
4
  import type { GetInstanceById } from "../helpers/getTypes.js";
5
5
  import type { LocaleJoin } from "../helpers/locale.js";
6
6
  import { type Format, type Translate, type TranslateMap } from "../helpers/translate.js";
7
- import { type LabeledEntityDescriptionSection, type RawEntityDescriptionSectionContent } from "../index.js";
7
+ import { type RawLabeledEntityDescriptionSection } from "../rawEntityDescription.js";
8
8
  /**
9
9
  * Get the name of an equipment item.
10
10
  */
@@ -12,12 +12,12 @@ export declare const getEquipmentName: (translate: Translate, translateMap: Tran
12
12
  /**
13
13
  * Render combat values of a melee weapon.
14
14
  */
15
- export declare const renderMeleeWeapon: <Damage>(translate: Translate, translateMap: TranslateMap, localeJoin: LocaleJoin, getInstanceById: GetInstanceById<"Attribute" | "CloseCombatTechnique" | "Reach">, measurements: Required<LocaleMeasurementAdjustments>, renderDamage: (damage: Damage) => string, closeCombatTechniqueId: string, use: GenMeleeWeapon<Damage>) => LabeledEntityDescriptionSection<RawEntityDescriptionSectionContent>;
15
+ export declare const renderMeleeWeapon: <Damage>(translate: Translate, translateMap: TranslateMap, localeJoin: LocaleJoin, getInstanceById: GetInstanceById<"Attribute" | "CloseCombatTechnique" | "Reach">, measurements: Required<LocaleMeasurementAdjustments>, renderDamage: (damage: Damage) => string, closeCombatTechniqueId: string, use: GenMeleeWeapon<Damage>) => RawLabeledEntityDescriptionSection;
16
16
  /**
17
17
  * Render combat values of a ranged weapon.
18
18
  */
19
- export declare const renderRangedWeapon: <Damage>(translate: Translate, translateMap: TranslateMap, format: Format, getInstanceById: GetInstanceById<"RangedCombatTechnique" | AmmunitionishIdentifier["kind"]>, measurements: Required<LocaleMeasurementAdjustments>, renderDamage: (damage: Damage) => string, rangedCombatTechniqueId: string, use: GenRangedWeapon<Damage>) => LabeledEntityDescriptionSection<RawEntityDescriptionSectionContent>;
19
+ export declare const renderRangedWeapon: <Damage>(translate: Translate, translateMap: TranslateMap, format: Format, getInstanceById: GetInstanceById<"RangedCombatTechnique" | AmmunitionishIdentifier["kind"]>, measurements: Required<LocaleMeasurementAdjustments>, renderDamage: (damage: Damage) => string, rangedCombatTechniqueId: string, use: GenRangedWeapon<Damage>) => RawLabeledEntityDescriptionSection;
20
20
  /**
21
21
  * Get a JSON representation of the rules text for equipment.
22
22
  */
23
- export declare const getEquipmentEntityDescription: import("../creator.js").EntityDescriptionCreator<"Weapon" | "Ammunition" | "Armor" | "Animal" | "AnimalCare" | "BandageOrRemedy" | "Book" | "CeremonialItem" | "Clothes" | "ClothingPackage" | "Container" | "EquipmentOfBlessedOnes" | "GemOrPreciousStone" | "IlluminationLightSource" | "IlluminationRefillOrSupply" | "Jewelry" | "Laboratory" | "Liebesspielzeug" | "LuxuryGood" | "MagicalArtifact" | "MusicalInstrument" | "Newspaper" | "OrienteeringAid" | "RopeOrChain" | "Stationery" | "ThievesTool" | "ToolOfTheTrade" | "TravelGearOrTool" | "Vehicle" | "WeaponAccessory" | "WorkingSupernaturalCreature", StdEnv<"f" | "fn" | "t" | "tm" | "lj" | "lc" | "rts" | "ibi" | "ma" | "idm", "BlessedTradition" | "MagicalTradition" | "Publication" | "Race" | "Culture" | "SocialStatus" | "Attribute" | "Skill" | "CloseCombatTechnique" | "RangedCombatTechnique" | "Weapon" | "Profession" | "Ammunition" | "DerivedCharacteristic" | "Reach"> & StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
23
+ export declare const getEquipmentEntityDescription: import("../creator.js").EntityDescriptionCreator<"Weapon" | "Ammunition" | "Armor" | "Animal" | "AnimalCare" | "BandageOrRemedy" | "Book" | "CeremonialItem" | "Clothes" | "ClothingPackage" | "Container" | "EquipmentOfBlessedOnes" | "GemOrPreciousStone" | "IlluminationLightSource" | "IlluminationRefillOrSupply" | "Jewelry" | "Laboratory" | "Liebesspielzeug" | "LuxuryGood" | "MagicalArtifact" | "MusicalInstrument" | "Newspaper" | "OrienteeringAid" | "RopeOrChain" | "Stationery" | "ThievesTool" | "ToolOfTheTrade" | "TravelGearOrTool" | "Vehicle" | "WeaponAccessory" | "WorkingSupernaturalCreature", StdEnv<"f" | "fn" | "t" | "tm" | "lj" | "lc" | "rts" | "ibi" | "ma" | "idm", "BlessedTradition" | "MagicalTradition" | "Publication" | "Race" | "Culture" | "SocialStatus" | "Attribute" | "Skill" | "CloseCombatTechnique" | "RangedCombatTechnique" | "Weapon" | "Profession" | "Ammunition" | "DerivedCharacteristic" | "Reach"> & StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -5,4 +5,4 @@ import type { GetInstanceById } from "../helpers/getTypes.js";
5
5
  */
6
6
  export declare const getEquipmentPackageEntityDescription: import("../creator.js").EntityDescriptionCreator<"EquipmentPackage", {
7
7
  getInstanceById: GetInstanceById<"Publication" | EquipmentIdentifier["kind"] | "SocialStatus">;
8
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
8
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Get a JSON representation of the rules text for an experience level.
3
3
  */
4
- export declare const getExperienceLevelEntityDescription: import("../creator.js").EntityDescriptionCreator<"ExperienceLevel", import("@elyukai/utils/nullable").AnyNonNullish & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
4
+ export declare const getExperienceLevelEntityDescription: import("../creator.js").EntityDescriptionCreator<"ExperienceLevel", import("@elyukai/utils/nullable").AnyNonNullish & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -4,4 +4,4 @@ import type { GetInstanceById } from "../helpers/getTypes.js";
4
4
  */
5
5
  export declare const getFocusRuleEntityDescription: import("../creator.js").EntityDescriptionCreator<"FocusRule", {
6
6
  getInstanceById: GetInstanceById<"Publication" | "Subject">;
7
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
7
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -8,4 +8,4 @@ export declare const getInfluenceEntityDescription: import("../creator.js").Enti
8
8
  getInstanceById: GetInstanceById<"Publication" | "Influence" | "Race" | ActivatableIdentifier["kind"] | "Aspect">;
9
9
  getResolvedSelectOptionById: GetResolvedSelectOptionById;
10
10
  getChildInstancesForInstanceId: GetAllChildInstancesForParent<"ProfessionVersion">;
11
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
11
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -7,7 +7,7 @@ import type { IdMap } from "../index.js";
7
7
  export declare const getBlessingEntityDescription: import("../creator.js").EntityDescriptionCreator<"Blessing", {
8
8
  getInstanceById: GetInstanceById<"Publication" | "TargetCategory">;
9
9
  getAllInstances: GetAllInstances<"BlessedTradition">;
10
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
10
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
11
11
  /**
12
12
  * Get a JSON representation of the rules text for a liturgical chant.
13
13
  */
@@ -15,7 +15,7 @@ export declare const getLiturgicalChantEntityDescription: import("../creator.js"
15
15
  getInstanceById: GetInstanceById<"Publication" | "Attribute" | "SkillModificationLevel" | "TargetCategory" | "Aspect" | "BlessedTradition" | "DerivedCharacteristic" | RatedIdentifier["kind"] | "Enhancement" | "FocusRule">;
16
16
  getChildInstancesForInstanceId: GetAllChildInstancesForParent<"Enhancement">;
17
17
  idMap: IdMap;
18
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
18
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
19
19
  /**
20
20
  * Get a JSON representation of the rules text for a ceremony.
21
21
  */
@@ -23,4 +23,4 @@ export declare const getCeremonyEntityDescription: import("../creator.js").Entit
23
23
  getInstanceById: GetInstanceById<"Publication" | "Attribute" | "SkillModificationLevel" | "TargetCategory" | "Aspect" | "BlessedTradition" | "DerivedCharacteristic" | RatedIdentifier["kind"] | "Enhancement" | "FocusRule">;
24
24
  getChildInstancesForInstanceId: GetAllChildInstancesForParent<"Enhancement">;
25
25
  idMap: IdMap;
26
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
26
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Get a JSON representation of the rules text for an optional rule.
3
3
  */
4
- export declare const getOptionalRuleEntityDescription: import("../creator.js").EntityDescriptionCreator<"OptionalRule", import("@elyukai/utils/nullable").AnyNonNullish & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
4
+ export declare const getOptionalRuleEntityDescription: import("../creator.js").EntityDescriptionCreator<"OptionalRule", import("@elyukai/utils/nullable").AnyNonNullish & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -1,7 +1,7 @@
1
1
  import type { CommonnessRatedAdvantageDisadvantage } from "@optolith/database-schema/gen";
2
2
  import type { StdReader } from "../../env.js";
3
3
  import type { TranslationKeysWithoutParams } from "../../helpers/translate.js";
4
- import type { RawDefinitionListEntityDescriptionSectionItem } from "../../index.js";
4
+ import type { RawDefinitionListEntityDescriptionSectionItem } from "../../rawEntityDescription.js";
5
5
  /**
6
6
  * Render the names of either commonness-rated advantages or commonness-rated disadvantages.
7
7
  */
@@ -1,6 +1,6 @@
1
1
  import type { ImprovementCost, RatedIdentifier, SkillWithEnhancementsIdentifier } from "@optolith/database-schema/gen";
2
2
  import type { StdReader } from "../../env.js";
3
- import type { RawEntityDescriptionSection } from "../../index.js";
3
+ import type { RawEntityDescriptionSection } from "../../rawEntityDescription.js";
4
4
  /**
5
5
  * Render the enhancements section for an entity description, if applicable.
6
6
  */
@@ -1,3 +1,4 @@
1
+ import { Reader } from "@elyukai/utils/reader";
1
2
  import type { AlternativeName, LaboratoryLevel, Resistance } from "@optolith/database-schema/gen";
2
3
  import type { GetInstanceById } from "../../helpers/getTypes.js";
3
4
  import type { LocaleMap, Translate, TranslateMap } from "../../helpers/translate.js";
@@ -22,7 +23,9 @@ export declare const renderChance: (translate: Translate, translateMap: Translat
22
23
  /**
23
24
  * Renders a list of alternative names into a localized string, or returns undefined if there are no alternative names.
24
25
  */
25
- export declare const renderAlternativeNames: (translate: Translate, alternativeNames: AlternativeName[] | undefined) => {
26
- label: string;
27
- value: string;
26
+ export declare const renderAlternativeNames: (alternativeNames: AlternativeName[] | undefined) => {
27
+ label: Reader<{
28
+ translate: Translate;
29
+ }, string>;
30
+ value: Reader<unknown, string>;
28
31
  } | undefined;
@@ -1,8 +1,10 @@
1
1
  import { isNotEmpty } from "@elyukai/utils/array/nonEmpty";
2
+ import { Reader } from "@elyukai/utils/reader";
2
3
  import { assertExhaustive } from "@elyukai/utils/typeSafety";
3
4
  import { renderDice } from "./dice.js";
4
5
  import { attributedName } from "./markdown.js";
5
6
  import { parensIf } from "./rated/activatable/parensIf.js";
7
+ import { translateR } from "./reader.js";
6
8
  import { MISSING_VALUE } from "./unknown.js";
7
9
  /**
8
10
  * Renders a laboratory level into a localized string.
@@ -56,11 +58,11 @@ export const renderChance = (translate, translateMap, item, includePercentage =
56
58
  /**
57
59
  * Renders a list of alternative names into a localized string, or returns undefined if there are no alternative names.
58
60
  */
59
- export const renderAlternativeNames = (translate, alternativeNames) => alternativeNames === undefined || !isNotEmpty(alternativeNames)
61
+ export const renderAlternativeNames = (alternativeNames) => alternativeNames === undefined || !isNotEmpty(alternativeNames)
60
62
  ? undefined
61
63
  : {
62
- label: translate(".input {$hiddenCount :number} {{Alternative Names}}", {
64
+ label: translateR(".input {$hiddenCount :number} {{Alternative Names}}", {
63
65
  hiddenCount: alternativeNames.length,
64
66
  }),
65
- value: alternativeNames.map(name => name.name + parensIf(name.region)).join(", "),
67
+ value: Reader.of(alternativeNames.map(name => name.name + parensIf(name.region)).join(", ")),
66
68
  };
@@ -1,7 +1,7 @@
1
1
  import { Reader } from "@elyukai/utils/reader";
2
2
  import type { ActivatableIdentifier, AdvantageDisadvantagePrerequisites, AnimistPowerPrerequisites, ArcaneTraditionPrerequisites, DerivedCharacteristicPrerequisites, EnhancementPrerequisites, GeneralPrerequisites, GeodeRitualPrerequisites, InfluencePrerequisites, LanguagePrerequisites, LiturgyPrerequisites, PersonalityTraitPrerequisites, PlainGeneralPrerequisites, ProfessionPrerequisites, ProfessionVariantPrerequisites, PublicationPrerequisites, SpellworkPrerequisites } from "@optolith/database-schema/gen";
3
3
  import type { StdEnv, StdReader } from "../../../env.js";
4
- import type { RawEntityDescriptionBadge } from "../../../index.js";
4
+ import type { RawEntityDescriptionBadge } from "../../../rawEntityDescription.js";
5
5
  import { printAdvantageDisadvantagePrerequisiteGroup, printAnimistPowerPrerequisiteGroup, printArcaneTraditionPrerequisiteGroup, printDerivedCharacteristicPrerequisiteGroup, printEnhancementPrerequisiteGroup, printGeneralPrerequisiteGroup, printGeodeRitualPrerequisiteGroup, printInfluencePrerequisiteGroup, printLanguagePrerequisiteGroup, printLiturgyPrerequisiteGroup, printPersonalityTraitPrerequisiteGroup, printProfessionPrerequisiteGroup, printPublicationPrerequisiteGroup, printSpellworkPrerequisiteGroup } from "./prerequisiteGroups.js";
6
6
  type DeriveEnvF<T extends (...args: any[]) => any> = ReturnType<T> extends Reader<infer E, unknown> ? E : never;
7
7
  /**
@@ -1,6 +1,6 @@
1
1
  import type { ActivatableSkillEffect } from "@optolith/database-schema/gen";
2
2
  import type { StdReader } from "../../../../env.js";
3
- import type { RawDefinitionListEntityDescriptionSectionItem } from "../../../../index.js";
3
+ import type { RawDefinitionListEntityDescriptionSectionItem } from "../../../../rawEntityDescription.js";
4
4
  /**
5
5
  * Gets the text for the effect of an activatable skill.
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import type { FastOneTimePerformanceParameters, FastSustainedPerformanceParameters, OneTimePerformanceParameters, ResponsiveTextOptional, SlowOneTimePerformanceParameters, SlowSustainedPerformanceParameters } from "@optolith/database-schema/gen";
2
2
  import type { StdReader } from "../../../../env.js";
3
- import type { RawDefinitionListEntityDescriptionSectionItem } from "../../../../index.js";
3
+ import type { RawDefinitionListEntityDescriptionSectionItem } from "../../../../rawEntityDescription.js";
4
4
  type RenderedPerformanceParameters = {
5
5
  castingTime: string;
6
6
  cost: string;
@@ -1,6 +1,6 @@
1
1
  import type { AffectedTargetCategories } from "@optolith/database-schema/gen";
2
2
  import type { StdReader } from "../../../../env.js";
3
- import { type RawDefinitionListEntityDescriptionSectionItem } from "../../../../index.js";
3
+ import { type RawDefinitionListEntityDescriptionSectionItem } from "../../../../rawEntityDescription.js";
4
4
  /**
5
5
  * Get the text for the target category.
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import type { ImprovementCost } from "@optolith/database-schema/gen";
2
2
  import type { StdReader } from "../../../env.js";
3
- import { type RawDefinitionListEntityDescriptionSectionItem } from "../../../index.js";
3
+ import { type RawDefinitionListEntityDescriptionSectionItem } from "../../../rawEntityDescription.js";
4
4
  /**
5
5
  * Renders an improvement cost value as a string.
6
6
  */
@@ -4,4 +4,4 @@ import type { GetInstanceById } from "../helpers/getTypes.js";
4
4
  */
5
5
  export declare const getPersonalityTraitEntityDescription: import("../creator.js").EntityDescriptionCreator<"PersonalityTrait", {
6
6
  getInstanceById: GetInstanceById<"Publication" | "Race" | "Culture" | "PersonalityTrait">;
7
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
7
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -9,4 +9,4 @@ export declare const getPoisonEntityDescription: import("../creator.js").EntityD
9
9
  getInstanceById: GetInstanceById<"Publication" | "DerivedCharacteristic" | "Disease" | ActivatableIdentifier["kind"] | RatedIdentifier["kind"] | "Race" | "Culture" | "State" | "Enhancement" | "PactCategory" | "PactDomain" | "SocialStatus" | "Aspect" | "Property" | "PersonalityTrait" | "Blessing" | "Cantrip">;
10
10
  getResolvedSelectOptionById: GetResolvedSelectOptionById;
11
11
  idMap: IdMap;
12
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
12
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -3,7 +3,7 @@ import { isNotNullish, mapNullable } from "@elyukai/utils/nullable";
3
3
  import { Reader } from "@elyukai/utils/reader";
4
4
  import { sign } from "@elyukai/utils/string/number";
5
5
  import { assertExhaustive } from "@elyukai/utils/typeSafety";
6
- import { createEntityDescriptionCreator } from "../creator.js";
6
+ import { combatDLItem, createEntityDescriptionCreator } from "../creator.js";
7
7
  import { renderDice, renderDiceR } from "./partial/dice.js";
8
8
  import { renderAlternativeNames, renderChance, renderLaboratoryLevel, renderResistance, } from "./partial/herbary.js";
9
9
  import { renderMathOperationR } from "./partial/mathOperation.js";
@@ -277,7 +277,7 @@ export const getPoisonEntityDescription = createEntityDescriptionCreator(({ getI
277
277
  {
278
278
  type: "definitionList",
279
279
  items: [
280
- renderAlternativeNames(translate, translation.alternative_names),
280
+ combatDLItem(renderAlternativeNames(translation.alternative_names), locale),
281
281
  {
282
282
  label: translate("Level"),
283
283
  value: typeof level === "number" ? level.toFixed() : level,
@@ -10,4 +10,4 @@ export declare const getProfessionVersionEntityDescription: import("../creator.j
10
10
  getAllInstances: GetAllInstances<"SkillGroup">;
11
11
  getChildInstancesForInstanceId: GetAllChildInstancesForParent<"ProfessionPackage" | "ProfessionVariant">;
12
12
  getResolvedSelectOptionById: GetResolvedSelectOptionById;
13
- } & StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
13
+ } & StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -14,4 +14,4 @@ export declare const getRaceEntityDescription: import("../creator.js").EntityDes
14
14
  countInstances: CountInstances<"Attribute">;
15
15
  getChildInstancesForInstanceId: GetAllChildInstancesForParent<"RaceVariant">;
16
16
  getResolvedSelectOptionById: GetResolvedSelectOptionById;
17
- } & StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
17
+ } & StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Get a JSON representation of the rules text for a sex practice.
3
3
  */
4
- export declare const getSexPracticeEntityDescription: import("../creator.js").EntityDescriptionCreator<"SexPractice", import("@elyukai/utils/nullable").AnyNonNullish & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
4
+ export declare const getSexPracticeEntityDescription: import("../creator.js").EntityDescriptionCreator<"SexPractice", import("@elyukai/utils/nullable").AnyNonNullish & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;
@@ -10,4 +10,4 @@ export declare const getSkillEntityDescription: import("../creator.js").EntityDe
10
10
  getChildInstancesForInstanceId: GetAllChildInstancesForParent<"SkillApplication">;
11
11
  getAllResolvedNewSkillApplications: GetAllResolvedNewSkillApplications;
12
12
  getAllResolvedSkillUses: GetAllResolvedSkillUses;
13
- } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../index.js").EntityDescription<string>>;
13
+ } & import("../env.js").StdEnv<"fd" | "t" | "tm" | "ibi", "Publication">, import("../entityDescription.js").EntityDescription<string>>;