TextBlockComponent Class

Abstract representation of any of the building blocks that make up a TextBlock document - namely Runs, Paragraphs, and TextBlock itself. Each component can specify a TextStyle that formats its contents and optional styleOverrides to customize that formatting.

Extended by

Methods

Name Description
applyStyle(styleName: string, options?: ApplyTextStyleOptions): void Apply the TextStyle specified by styleName to this component, optionally preserving styleOverrides and/or preventing propagation to sub-components.  
clearStyleOverrides(): void Reset any styleOverrides applied to this component's TextStyle.  
clone(): TextBlockComponent Abstract Create a deep copy of this component.  
equals(other: TextBlockComponent): boolean Returns true if this is equivalent to other.  
stringify(options?: TextBlockStringifyOptions): string Abstract Compute a string representation of the contents of this component and all of its sub-components.  
toJSON(): TextBlockComponentProps Convert this component to its JSON representation.  

Properties

Name Type Description
overridesStyle Accessor ReadOnly boolean Returns true if styleOverrides specifies any deviations from this component's base TextStyle.  
styleName Accessor string The name of the TextStyle that provides the base formatting for the contents of this component.  
styleOverrides Accessor TextStyleSettingsProps Deviations in individual properties of the TextStyle specified by styleName.  

Defined in

Last Updated: 17 December, 2024