narraleaf-react
Version:
A React visual novel player framework
26 lines (25 loc) • 1.14 kB
TypeScript
import type { Character } from "../../elements/character";
import { Pausing } from "../../elements/character/pause";
import { Word } from "../../elements/character/word";
import type { ScriptCtx } from "../../elements/script";
import { Sound } from "../../elements/sound";
import { Color, Font } from "../../types";
export type SentenceConfig = {
pause?: boolean | number;
voice: Sound | null;
character: Character | null;
voiceId: string | number | null;
color?: Color;
} & Font;
export type SentenceUserConfig = Partial<Omit<SentenceConfig, "voice"> & {
voice: Sound | string | null | undefined;
}>;
export type DynamicWord = (ctx: ScriptCtx) => DynamicWordResult;
export type DynamicWordResult = string | Word | Pausing | (string | Word | Pausing)[];
export type StaticWord<T extends string | DynamicWord | Pausing = string | DynamicWord | Pausing> = string | Pausing | Word<T>;
export type SingleWord = StaticWord | DynamicWord;
export type SentencePrompt = SingleWord[] | SingleWord;
export declare class Sentence {
constructor(text: SentencePrompt, config?: SentenceUserConfig);
copy(): Sentence;
}