@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.
259 lines (258 loc) • 7.82 kB
TypeScript
import { type ReferentEffect } from "./effect.js";
import { type ReferentTarget } from "./target.js";
/** A referent. */
export type Referent = "1m:NEU" | "1m:BEN" | "1m:DET" | "2m:NEU" | "2m:BEN" | "2m:DET" | "2p:NEU" | "2p:BEN" | "2p:DET" | "ma:NEU" | "ma:BEN" | "ma:DET" | "pa:NEU" | "pa:BEN" | "pa:DET" | "mi:NEU" | "mi:BEN" | "mi:DET" | "pi:NEU" | "pi:BEN" | "pi:DET" | "Mx:NEU" | "Mx:BEN" | "Mx:DET" | "Rdp:NEU" | "Rdp:BEN" | "Rdp:DET" | "Obv:NEU" | "Obv:BEN" | "Obv:DET" | "PVS:NEU" | "PVS:BEN" | "PVS:DET";
/** An array containing all referents. */
export declare const ALL_REFERENTS: readonly Referent[];
/** An object mapping referents into their Ithkuilic counterparts. */
export declare const REFERENT_TO_ITHKUIL_MAP: {
readonly false: {
readonly "1m:NEU": "l";
readonly "1m:BEN": "r";
readonly "1m:DET": "ř";
readonly "2m:NEU": "s";
readonly "2m:BEN": "š";
readonly "2m:DET": "ž";
readonly "2p:NEU": "n";
readonly "2p:BEN": "t";
readonly "2p:DET": "d";
readonly "ma:NEU": "m";
readonly "ma:BEN": "p";
readonly "ma:DET": "b";
readonly "pa:NEU": "ň";
readonly "pa:BEN": "k";
readonly "pa:DET": "g";
readonly "mi:NEU": "z";
readonly "mi:BEN": "ţ";
readonly "mi:DET": "ḑ";
readonly "pi:NEU": "ż";
readonly "pi:BEN": "f";
readonly "pi:DET": "v";
readonly "Mx:NEU": "c";
readonly "Mx:BEN": "č";
readonly "Mx:DET": "j";
readonly "Rdp:NEU": "th";
readonly "Rdp:BEN": "ph";
readonly "Rdp:DET": "kh";
readonly "Obv:NEU": "ll";
readonly "Obv:BEN": "rr";
readonly "Obv:DET": "řř";
readonly "PVS:NEU": "mm";
readonly "PVS:BEN": "nn";
readonly "PVS:DET": "ňň";
};
readonly true: {
readonly "1m:NEU": "l";
readonly "1m:BEN": "r";
readonly "1m:DET": "ř";
readonly "2m:NEU": "s";
readonly "2m:BEN": "š";
readonly "2m:DET": "ž";
readonly "2p:NEU": "n";
readonly "2p:BEN": "t";
readonly "2p:DET": "d";
readonly "ma:NEU": "m";
readonly "ma:BEN": "p";
readonly "ma:DET": "b";
readonly "pa:NEU": "ň";
readonly "pa:BEN": "k";
readonly "pa:DET": "g";
readonly "mi:NEU": "z";
readonly "mi:BEN": "ţ";
readonly "mi:DET": "ḑ";
readonly "pi:NEU": "ż";
readonly "pi:BEN": "f";
readonly "pi:DET": "v";
readonly "Mx:NEU": "c";
readonly "Mx:BEN": "č";
readonly "Mx:DET": "j";
readonly "Rdp:NEU": "th";
readonly "Rdp:BEN": "ph";
readonly "Rdp:DET": "kh";
readonly "Obv:NEU": "lç";
readonly "Obv:BEN": "rç";
readonly "Obv:DET": "řç";
readonly "PVS:NEU": "mç";
readonly "PVS:BEN": "nç";
readonly "PVS:DET": "ňç";
};
};
/**
* Converts a referent into Ithkuil.
*
* @param referent The referent to be converted.
* @param isReferentialAffix Whether this referent is used in a referential
* affix.
* @returns Romanized Ithkuilic text representing the referent.
*/
export declare function referentToIthkuil(referent: Referent, isReferentialAffix: boolean): string;
/** A deconstructed referent expressed as an object. */
export type ReferentObject = {
/** The target of the referent. */
readonly target: ReferentTarget;
/** The effect of the referent. */
readonly effect: ReferentEffect;
};
/** An object mapping from referents to their referent objects. */
export declare const REFERENT_TO_REFERENT_OBJECT_MAP: {
readonly "1m:NEU": {
readonly target: "1m";
readonly effect: "NEU";
};
readonly "1m:BEN": {
readonly target: "1m";
readonly effect: "BEN";
};
readonly "1m:DET": {
readonly target: "1m";
readonly effect: "DET";
};
readonly "2m:NEU": {
readonly target: "2m";
readonly effect: "NEU";
};
readonly "2m:BEN": {
readonly target: "2m";
readonly effect: "BEN";
};
readonly "2m:DET": {
readonly target: "2m";
readonly effect: "DET";
};
readonly "2p:NEU": {
readonly target: "2p";
readonly effect: "NEU";
};
readonly "2p:BEN": {
readonly target: "2p";
readonly effect: "BEN";
};
readonly "2p:DET": {
readonly target: "2p";
readonly effect: "DET";
};
readonly "ma:NEU": {
readonly target: "ma";
readonly effect: "NEU";
};
readonly "ma:BEN": {
readonly target: "ma";
readonly effect: "BEN";
};
readonly "ma:DET": {
readonly target: "ma";
readonly effect: "DET";
};
readonly "pa:NEU": {
readonly target: "pa";
readonly effect: "NEU";
};
readonly "pa:BEN": {
readonly target: "pa";
readonly effect: "BEN";
};
readonly "pa:DET": {
readonly target: "pa";
readonly effect: "DET";
};
readonly "mi:NEU": {
readonly target: "mi";
readonly effect: "NEU";
};
readonly "mi:BEN": {
readonly target: "mi";
readonly effect: "BEN";
};
readonly "mi:DET": {
readonly target: "mi";
readonly effect: "DET";
};
readonly "pi:NEU": {
readonly target: "pi";
readonly effect: "NEU";
};
readonly "pi:BEN": {
readonly target: "pi";
readonly effect: "BEN";
};
readonly "pi:DET": {
readonly target: "pi";
readonly effect: "DET";
};
readonly "Mx:NEU": {
readonly target: "Mx";
readonly effect: "NEU";
};
readonly "Mx:BEN": {
readonly target: "Mx";
readonly effect: "BEN";
};
readonly "Mx:DET": {
readonly target: "Mx";
readonly effect: "DET";
};
readonly "Rdp:NEU": {
readonly target: "Rdp";
readonly effect: "NEU";
};
readonly "Rdp:BEN": {
readonly target: "Rdp";
readonly effect: "BEN";
};
readonly "Rdp:DET": {
readonly target: "Rdp";
readonly effect: "DET";
};
readonly "Obv:NEU": {
readonly target: "Obv";
readonly effect: "NEU";
};
readonly "Obv:BEN": {
readonly target: "Obv";
readonly effect: "BEN";
};
readonly "Obv:DET": {
readonly target: "Obv";
readonly effect: "DET";
};
readonly "PVS:NEU": {
readonly target: "PVS";
readonly effect: "NEU";
};
readonly "PVS:BEN": {
readonly target: "PVS";
readonly effect: "BEN";
};
readonly "PVS:DET": {
readonly target: "PVS";
readonly effect: "DET";
};
};
/** An object mapping from referent targets to their names. */
export declare const REFERENT_TARGET_TO_NAME_MAP: {
readonly "1m": string;
readonly "2m": string;
readonly "2p": string;
readonly ma: string;
readonly pa: string;
readonly mi: string;
readonly pi: string;
readonly Mx: string;
readonly Rdp: string;
readonly Obv: string;
readonly PVS: string;
};
/**
* Deconstructs an referent into its separate components.
*
* @param referent The referent to be deconstructed.
* @returns An object containing the effect and target of the original referent.
*/
export declare function referentToReferentObject(referent: Referent): ReferentObject;
/**
* Reconstructs a referent object into a single referent.
*
* @param referentObject The referent to be reconstructed.
* @returns A string representing the effect and target of the object.
*/
export declare function referentObjectToReferent(referentObject: ReferentObject): Referent;