@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.
180 lines (179 loc) • 7.49 kB
TypeScript
import type { Affix } from "../affix/index.js";
import { type CA, type PartialCA } from "../ca/index.js";
import { type ShortcutType } from "./shortcut-type.js";
import { type ConcatenationType } from "./slot-1/index.js";
import { type Stem, type Version } from "./slot-2/index.js";
import { type SlotIII } from "./slot-3/index.js";
import { type Context, type Function, type Specification } from "./slot-4/index.js";
import { type Aspect, type CaseScope, type Effect, type Level, type Mood, type Phase, type Valence } from "./slot-8/index.js";
import { type Case, type IllocutionOrValidation } from "./slot-9/index.js";
export * from "./default.js";
export * from "./shortcut-type.js";
export * from "./slot-1/index.js";
export * from "./slot-10/index.js";
export * from "./slot-2/index.js";
export * from "./slot-3/index.js";
export * from "./slot-4/index.js";
export * from "./slot-5/index.js";
export * from "./slot-6/index.js";
export * from "./slot-7/index.js";
export * from "./slot-8/index.js";
export * from "./slot-9/index.js";
/** The core structure shared between all formatives. */
export type CoreFormative = {
/** The version of the formative. */
readonly version: Version;
/** The stem of the formative. */
readonly stem: Stem;
/** The root of the formative. */
readonly root: SlotIII;
/** The function of the formative. */
readonly function: Function;
/** The specification of the formative. */
readonly specification: Specification;
/** The context of the formative. */
readonly context: Context;
/** The Slot V affixes of the formative. */
readonly slotVAffixes: readonly Affix[];
/** The Ca affix complex of the formative. */
readonly ca: CA;
/** The Slot VII affixes of the formative. */
readonly slotVIIAffixes: readonly Affix[];
/** The Vn slot of the formative. */
readonly vn: Valence | Aspect | Phase | Level | Effect;
/** Whether to use a+Ca and Slot VII shortcuts. */
readonly shortcut: ShortcutType;
};
/**
* The core structure shared between all formatives, with all optional slots
* properly marked as optional.
*
* Note that the `type` and `root` properties are still required, and the `ca`
* property is also partial. For these reasons, use `PartialFormative` instead
* of `Partial<Formative>`, as the latter gives improper results.
*/
export type PartialCoreFormative = {
/** The version of the formative. */
readonly version?: Version | undefined;
/** The stem of the formative. */
readonly stem?: Stem | undefined;
/** The root of the formative. */
readonly root: SlotIII;
/** The function of the formative. */
readonly function?: Function | undefined;
/** The specification of the formative. */
readonly specification?: Specification | undefined;
/** The context of the formative. */
readonly context?: Context | undefined;
/** The Slot V affixes of the formative. */
readonly slotVAffixes?: readonly Affix[] | undefined;
/** The Ca affix complex of the formative. */
readonly ca?: PartialCA | undefined;
/** The Slot VII affixes of the formative. */
readonly slotVIIAffixes?: readonly Affix[] | undefined;
/** The Vn slot of the formative. */
readonly vn?: Valence | Aspect | Phase | Level | Effect | undefined;
/** Whether to use a+Ca and Slot VII shortcuts. */
readonly shortcut?: ShortcutType | undefined;
};
/** A nominal formative. */
export type NominalFormative = CoreFormative & {
/** The type of the formative. */
readonly type: "UNF/C";
/** The concatenation type of the formative. */
readonly concatenationType: ConcatenationType;
/** The case-scope of the formative. */
readonly caseScope: CaseScope;
/** The case of the formative. */
readonly case: Case;
};
/**
* A nominal formative, with all optional slots properly marked as optional.
*
* Note that the `type` and `root` properties are still required, and the `ca`
* property is also partial. For these reasons, use `PartialFormative` instead
* of `Partial<Formative>`, as the latter gives improper results.
*/
export type PartialNominalFormative = PartialCoreFormative & {
/** The type of the formative. */
readonly type: "UNF/C";
/** The concatenation type of the formative. */
readonly concatenationType?: ConcatenationType | undefined;
/** The case-scope of the formative. */
readonly caseScope?: CaseScope | undefined;
/** The case of the formative. */
readonly case?: Case | undefined;
};
/** An unframed verbal formative. */
export type UnframedVerbalFormative = CoreFormative & {
/** The type of the formative. */
readonly type: "UNF/K";
/** The mood of the formative. */
readonly mood: Mood;
/** The illocution+validation of the formative. */
readonly illocutionValidation: IllocutionOrValidation;
};
/**
* An unframed verbal formative, with all optional slots properly marked as
* optional.
*
* Note that the `type` and `root` properties are still required, and the `ca`
* property is also partial. For these reasons, use `PartialFormative` instead
* of `Partial<Formative>`, as the latter gives improper results.
*/
export type PartialUnframedVerbalFormative = PartialCoreFormative & {
/** The type of the formative. */
readonly type: "UNF/K";
/** The mood of the formative. */
readonly mood?: Mood | undefined;
/** The illocution+validation of the formative. */
readonly illocutionValidation?: IllocutionOrValidation | undefined;
};
/** A framed verbal formative. */
export type FramedVerbalFormative = CoreFormative & {
/** The type of the formative. */
readonly type: "FRM";
/** The case-scope of the formative. */
readonly caseScope: CaseScope;
/** The case of the formative. */
readonly case: Case;
};
/**
* A framed verbal formative, with all optional slots properly marked as
* optional.
*
* Note that the `type` and `root` properties are still required, and the `ca`
* property is also partial. For these reasons, use `PartialFormative` instead
* of `Partial<Formative>`, as the latter gives improper results.
*/
export type PartialFramedVerbalFormative = PartialCoreFormative & {
/** The type of the formative. */
readonly type: "FRM";
/** The case-scope of the formative. */
readonly caseScope?: CaseScope | undefined;
/** The case of the formative. */
readonly case?: Case | undefined;
};
/** A formative. */
export type Formative = NominalFormative | UnframedVerbalFormative | FramedVerbalFormative;
/**
* A formative, with all optional slots properly marked as optional.
*
* Note that the `type` and `root` properties are still required, and the `ca`
* property is also partial. For these reasons, use `PartialFormative` instead
* of `Partial<Formative>`, as the latter gives improper results.
*/
export type PartialFormative = PartialNominalFormative | PartialUnframedVerbalFormative | PartialFramedVerbalFormative;
/** An object mapping from formative types to their names. */
export declare const FORMATIVE_TYPE_TO_NAME_MAP: {
readonly "UNF/C": "Nominal";
readonly "UNF/K": "Unframed Verbal";
readonly FRM: "Framed Verbal";
};
/**
* Converts a formative into Ithkuil.
*
* @param formative The formative to be converted.
* @returns Romanized Ithkuilic text representing the formative.
*/
export declare function formativeToIthkuil(formative: PartialFormative): string;