@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.
37 lines (36 loc) • 1.35 kB
TypeScript
import type { Stress } from "./transform.js";
/** A section of Ithkuil text which represents a single grammatical category. */
export declare class DCLeaf<S extends string, K extends string, const T> {
readonly source: string;
readonly slot: S;
readonly type: K;
readonly value: T;
constructor(source: string, slot: S, type: K, value: T);
}
/** The decomposition of the stress placed on a particular Ithkuil word. */
export declare class DCStress<const T> {
readonly stress: Stress;
readonly value: T;
constructor(stress: Stress, value: T);
}
/**
* A section of Ithkuil text which can further be broken down, but which is tied
* to itself in some way.
*
* Examples include the VnCn compund, which uses the Cn to determine whether the
* Vn is aspectual or not.
*/
export declare class DCGroup<K extends string> {
readonly type: K;
readonly items: readonly DCNode[];
constructor(type: K, ...items: readonly DCNode[]);
}
/** A decomposed string of text. */
export type DCNode = DCLeaf<string, string, unknown> | DCGroup<string>;
/** A completely decomposed Ithkuil word. */
export declare class DCWord<K extends string> {
readonly kind: K;
readonly stress: DCStress<unknown>;
readonly items: readonly DCNode[];
constructor(kind: K, stress: DCStress<unknown>, ...items: readonly DCNode[]);
}