@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.
96 lines (95 loc) • 3.7 kB
TypeScript
import { type SuppletiveAdjunctType } from "../adjunct/index.js";
import { type Affix } from "../affix/index.js";
import { type Essence, type Perspective } from "../ca/index.js";
import { type Case, type Specification } from "../formative/index.js";
import { type ReferentList } from "./referent/list.js";
/**
* The structure shared between all single-, dual-, and combination
* referentials.
*/
export type ReferentialReferentialCore = {
readonly referents: ReferentList;
readonly perspective: Perspective;
readonly type?: undefined;
readonly case: Case;
readonly case2?: Case | undefined;
readonly essence: Essence;
};
/** The structure shared between all suppletive referentials. */
export type SuppletiveReferentialCore = {
readonly referents?: undefined;
readonly perspective?: undefined;
readonly type: SuppletiveAdjunctType;
readonly case: Case;
readonly case2?: Case | undefined;
readonly essence: Essence;
};
/** The core structure of a referential. */
export type ReferentialCore = ReferentialReferentialCore | SuppletiveReferentialCore;
/**
* The structure shared between all single-, dual-, and combination
* referentials, with all optional slots properly marked optional. Note that the
* `referents` slot is still required.
*/
export type PartialReferentialReferentialCore = {
readonly referents: ReferentList;
readonly perspective?: Perspective | undefined;
readonly type?: undefined;
readonly case?: Case | undefined;
readonly case2?: Case | undefined;
readonly essence?: Essence | undefined;
};
/**
* The core structure of all suppletive referentials, with all optional slots
* properly marked optional. Note that the `type` slot is still required.
*/
export type PartialSuppletiveReferentialCore = {
readonly referents?: undefined;
readonly perspective?: undefined;
readonly type: SuppletiveAdjunctType;
readonly case?: Case | undefined;
readonly case2?: Case | undefined;
readonly essence?: Essence | undefined;
};
/**
* The core structure of a referent, with optional slots properly marked
* optional. Note that either the `referents` slot or `type` slot must be
* present in instances of this type.
*/
export type PartialReferentialCore = PartialReferentialReferentialCore | PartialSuppletiveReferentialCore;
/** A referential. */
export type Referential = (ReferentialCore & {
readonly referents2?: undefined;
readonly perspective2?: undefined;
readonly specification?: undefined;
readonly affixes?: undefined;
}) | (ReferentialCore & {
readonly referents2: ReferentList;
readonly perspective2: Perspective;
readonly specification?: undefined;
readonly affixes?: undefined;
}) | (ReferentialCore & {
readonly referents2?: undefined;
readonly perspective2?: undefined;
readonly specification: Specification;
readonly affixes: readonly Affix[];
});
/** A referential, with optional slots properly marked optional. */
export type PartialReferential = (PartialReferentialCore & {
readonly referents2: ReferentList;
readonly perspective2?: Perspective | undefined;
readonly specification?: undefined;
readonly affixes?: undefined;
}) | (PartialReferentialCore & {
readonly referents2?: undefined;
readonly perspective2?: undefined;
readonly specification?: Specification | undefined;
readonly affixes?: readonly Affix[] | undefined;
});
/**
* Converts a referential into Ithkuil.
*
* @param referential The referential to convert.
* @returns Romanized Ithkuilic text representing the referential.
*/
export declare function referentialToIthkuil(referential: PartialReferential): string;