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.

85 lines (84 loc) 3.43 kB
import { type PartialCA } from "../ca/index.js"; import { type Case } from "../formative/slot-9/case.js"; import { WithWYAlternative } from "../helpers/with-wy-alternative.js"; import { type ReferentList } from "../referential/referent/index.js"; import { type AffixDegree } from "./degree.js"; import { type AffixType } from "./type.js"; export * from "./affixes.js"; export * from "./degree.js"; export * from "./type.js"; /** Cases allowed in referential affixes. */ export type ReferentialAffixCase = "THM" | "INS" | "ABS" | "AFF" | "STM" | "EFF" | "ERG" | "DAT" | "IND" | "POS" | "PRP" | "GEN" | "ATT" | "PDC" | "ITP" | "OGN" | "IDP" | "PAR"; /** An array containing all referential affix cases. */ export declare const ALL_REFERENTIAL_AFFIX_CASES: readonly ["THM", "INS", "ABS", "AFF", "STM", "EFF", "ERG", "DAT", "IND", "POS", "PRP", "GEN", "ATT", "PDC", "ITP", "OGN", "IDP", "PAR"]; /** A plain affix. */ export type PlainAffix = { /** The type of the affix. */ readonly type: AffixType; /** The degree of the affix. */ readonly degree: AffixDegree; /** The consonantal form of the affix, or a number for numeric affixes. */ readonly cs: string | number | bigint; readonly ca?: undefined; readonly referents?: undefined; readonly case?: undefined; }; /** A Ca-stacking affix. */ export type CaStackingAffix = { /** The Ca complex of this affix. */ readonly ca: PartialCA; readonly cs?: undefined; readonly referents?: undefined; readonly case?: undefined; }; /** A referential affix. */ export type ReferentialAffix = { /** The referents of this affix. */ readonly referents: ReferentList; /** The perspective of the referent. */ readonly perspective?: "M" | "G" | "N" | undefined; /** The case of the affix. */ readonly case: ReferentialAffixCase; readonly cs?: undefined; readonly ca?: undefined; }; /** A case-accessor or inverse-accessor affix. */ export type CaseAccessorAffix = { /** The case used in this case accessor affix. */ readonly case: Case; /** The type of the case accessor affix. */ readonly type: AffixType; /** Whether this affix is an inverse case-accessor affix. */ readonly isInverse: boolean; readonly cs?: undefined; readonly ca?: undefined; readonly referents?: undefined; }; /** A case-stacking affix. */ export type CaseStackingAffix = { /** The case used in this case accessor affix. */ readonly case: Case; readonly cs?: undefined; readonly ca?: undefined; readonly referents?: undefined; readonly type?: undefined; }; /** An affix. */ export type Affix = PlainAffix | CaStackingAffix | ReferentialAffix | CaseAccessorAffix | CaseStackingAffix; /** Metadata about the affix. */ export type AffixMetadata = { /** Whether or not the affix is in reversed form. */ readonly reversed: boolean; /** Whether to insert a glottal stop in the vowel form. */ readonly insertGlottalStop?: boolean | undefined; /** Whether the inserted glottal stop will be in word-final position. */ readonly isGlottalStopWordFinal?: boolean | undefined; }; /** * Converts an affix into Ithkuil. * * @param affix The affix to be converted. * @param metadata Metadata about the affix. * @returns Romanized Ithkuilic text representing the affix. */ export declare function affixToIthkuil(affix: Affix, metadata: AffixMetadata): WithWYAlternative;