UNPKG

@zsnout/ithkuil

Version:

A set of tools which can generate and parse romanized Ithkuil text and which can generate Ithkuil script from text and JSON data.

70 lines (69 loc) 2.69 kB
import { WithWYAlternative } from "../../helpers/with-wy-alternative.js"; import { type SlotIII } from "../slot-3/index.js"; import { type Function } from "../slot-4/index.js"; import { type AffixShortcut } from "./affix-shortcut.js"; import type { Stem } from "./stem.js"; import { type Version } from "./version.js"; export * from "./affix-shortcut.js"; export * from "./stem.js"; export * from "./version.js"; /** Information directly pertaining to Slot II. */ export type SlotII = { /** The stem of the formative. */ readonly stem: Stem; /** The version of the formative. */ readonly version: Version; }; /** Additional information relevant to Slot II. */ export type SlotIIMetadata = { /** The codified contents of Slot I. */ readonly slotI: string; /** The raw contents of Slot III. */ readonly slotIII: SlotIII; /** The affix shortcut (if any) indicated by Slot II. */ readonly affixShortcut?: AffixShortcut | undefined; /** Whether Slot V contains at least two affixes. */ readonly doesSlotVHaveAtLeastTwoAffixes: boolean; /** The function of the formative. */ readonly function: Function; }; /** * An object mapping affix shortcuts, stems, and versions to their Ithkuilic * translations. */ export declare const SLOT_II_MAP: { readonly undefined: readonly [readonly ["o", "ö"], readonly ["a", "ä"], readonly ["e", "i"], readonly ["u", "ü"]]; readonly "NEG/4": readonly [readonly ["oi", "ou"], readonly ["ai", "au"], readonly ["ei", "eu"], readonly ["ui", "iu"]]; readonly "DCD/4": readonly [readonly [WithWYAlternative, WithWYAlternative], readonly [WithWYAlternative, WithWYAlternative], readonly [WithWYAlternative, WithWYAlternative], readonly [WithWYAlternative, WithWYAlternative]]; readonly "DCD/5": readonly [readonly ["oe", "öe"], readonly ["ao", "aö"], readonly ["eo", "eö"], readonly ["oa", "öa"]]; }; /** * An object mapping stems and versions to their indices in the standard vowel * table when an a+Ca shortcut is used. */ export declare const SLOT_II_SHORTCUT_MAP: { readonly 1: { readonly PRC: 1; readonly CPT: 2; }; readonly 2: { readonly PRC: 3; readonly CPT: 4; }; readonly 3: { readonly PRC: 9; readonly CPT: 8; }; readonly 0: { readonly PRC: 7; readonly CPT: 6; }; }; /** * Converts Slot II into Ithkuil. * * @param slot The stem and version of the formative. * @param metadata Additional information relevant to Slot II. * @returns Romanized Ithkuilic text representing Slot II. */ export declare function slotIIToIthkuil(slot: SlotII, metadata: SlotIIMetadata): string;