/** * ZUI Text Component * Text display with typography presets and scrolling support */ import { Component } from '../../core/Component'; import type { BaseProps, Rect, TextAlign } from '../../core/types'; import type { FontSizeKey, FontWeightKey, TextCase } from '../../theme/typography'; export interface TextProps extends BaseProps { /** Text content */ text: string; /** Typography style preset */ textStyle?: FontSizeKey; /** Custom font size (overrides textStyle) */ fontSize?: number; /** Font weight */ fontWeight?: FontWeightKey; /** Text color (hex string or rgba) */ color?: string; /** Text alignment */ align?: TextAlign; /** Maximum number of lines (0 = unlimited) */ maxLines?: number; /** Enable auto-scrolling for overflow text */ scrolling?: boolean; /** Scroll speed (px per ms) - defaults to ZeppOS spec */ scrollSpeed?: number; /** Text case transformation */ textCase?: TextCase; /** Container width (for alignment and scrolling) */ width?: number; /** Position X */ x?: number; /** Position Y */ y?: number; } /** * Text component for displaying text content * * @example * ```ts * // Simple text * const text = new Text({ text: 'Hello World' }); * * // Styled text * const title = new Text({ * text: 'Page Title', * textStyle: 'title', * fontWeight: 'bold', * color: '#FFFFFF', * align: 'center', * }); * * // Scrolling text * const longText = new Text({ * text: 'This is a very long text that will scroll...', * width: 200, * scrolling: true, * }); * ``` */ export declare class Text extends Component { readonly type = "Text"; private textWidget; private scrollAnimationId; private scrollOffset; private textWidth; protected getDefaultProps(): Partial; protected calculateLayout(parentRect?: Rect): void; private estimateTextWidth; protected createWidgets(): void; protected updateWidgets(): void; protected destroyWidgets(): void; private startScrolling; private stopScrolling; /** * Update text content */ setText(text: string): void; /** * Get current text content */ getText(): string; } /** * Create a Text component */ export declare function createText(props: TextProps): Text; /** * Create a title text */ export declare function Title(text: string, props?: Partial): Text; /** * Create a body text */ export declare function Body(text: string, props?: Partial): Text; /** * Create a caption text */ export declare function Caption(text: string, props?: Partial): Text; //# sourceMappingURL=Text.d.ts.map