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.

49 lines (48 loc) 2.29 kB
import type { CaseScope } from "./case-scope.js"; import type { Mood } from "./mood.js"; /** * A class representing a value that could either be a mood or a case-scope, * depending on the context. This is mainly used when parsing modular adjuncts, * although it can also be passed to any slot expecting a Cn value. */ export declare class MoodOrCaseScope<M extends Mood = Mood, C extends CaseScope = CaseScope, N extends string = string, A extends string = string> { /** The mood this object represents. */ readonly mood: M; /** The case-scope this object represents. */ readonly caseScope: C; /** * The Cn value this object has when its corresponding Vn value isn't an * Aspect. */ readonly nonAspectualValue: N; /** The Cn value this object has when its corresponding Vn value is an Aspect. */ readonly aspectualValue: A; private constructor(); /** * Converts this `MoodOrCaseScope` into a Cn form. * * @param isAspectual Whether the corresponding Vn value is an Aspect. * @returns Romanized Ithkuilic text representing this Cn value. */ toString(isAspectual: boolean): N | A; /** * Converts this `MoodOrCaseScope` into JSON. * * @returns A string containing slash-separated mood and case-scope. */ toJSON(): string; } /** A `MoodOrCaseScope` representing FAC/CCN mood/case-scope. */ export declare const FAC_CCN: MoodOrCaseScope<"FAC", "CCN", "h", "w">; /** A `MoodOrCaseScope` representing SUB/CCA mood/case-scope. */ export declare const SUB_CCA: MoodOrCaseScope<"SUB", "CCA", "hl", "hw">; /** A `MoodOrCaseScope` representing ASM/CCS mood/case-scope. */ export declare const ASM_CCS: MoodOrCaseScope<"ASM", "CCS", "hr", "hrw">; /** A `MoodOrCaseScope` representing SPC/CCQ mood/case-scope. */ export declare const SPC_CCQ: MoodOrCaseScope<"SPC", "CCQ", "hm", "hmw">; /** A `MoodOrCaseScope` representing COU/CCP mood/case-scope. */ export declare const COU_CCP: MoodOrCaseScope<"COU", "CCP", "hn", "hnw">; /** A `MoodOrCaseScope` representing HYP/CCV mood/case-scope. */ export declare const HYP_CCV: MoodOrCaseScope<"HYP", "CCV", "hň", "hňw">; /** An array containing all `MoodOrCaseScope`s. */ export declare const ALL_MOOD_OR_CASE_SCOPES: readonly MoodOrCaseScope[];