narraleaf-react
Version:
A React visual novel player framework
38 lines (37 loc) • 1.27 kB
TypeScript
import { Pausing } from "../../../nlcore/elements/character/pause";
import { Sentence } from "../../../nlcore/elements/character/sentence";
import { Word } from "../../../nlcore/elements/character/word";
import { GameState } from "../../../../game/nlcore/common/game";
import { Color } from "../../../../game/nlcore/types";
import React from "react";
import { DialogElementProps } from "./type";
import { DialogState } from "./UIDialog";
type BaseTextsProps = {
/**
* The default color of the text
*/
defaultColor?: Color;
className?: string;
style?: React.CSSProperties;
dialog?: DialogState;
} & React.HTMLAttributes<HTMLDivElement>;
/**
* Props-based wrapper component
* Provides a clean interface for direct prop usage
*/
export interface TextsProps extends DialogElementProps {
sentence: Sentence;
gameState: GameState;
useTypeEffect?: boolean;
onCompleted?: () => void;
finished?: boolean;
count?: number;
words?: Word<Pausing | string>[];
}
export declare function RawTexts(props: BaseTextsProps): React.JSX.Element;
/**
* Context-based wrapper component
* Provides integration with the sentence context
*/
export declare function Texts(props: BaseTextsProps): React.JSX.Element;
export default Texts;