UNPKG

2.34 kBTypeScriptView Raw
1/**
2 * Contains the FormattedString and Span classes, which are used to create a formatted (rich text) strings.
3 */
4
5import { Span } from './span';
6import { ObservableArray } from '../../data/observable-array';
7import { ViewBase } from '../core/view-base';
8import { Color } from '../../color';
9import { FontStyleType, FontVariationSettingsType, FontWeightType } from '../styling/font';
10import { CoreTypes } from '../../core-types';
11
12/**
13 * A class used to create a formatted (rich text) string.
14 */
15export class FormattedString extends ViewBase {
16 /**
17 * An observable collection of Span objects used to define common text properties.
18 */
19 public spans: ObservableArray<Span>;
20
21 /**
22 * A human readable representation of the formatted string.
23 */
24 public toString(): string;
25
26 /**
27 * Gets or sets the font family which will be used for all spans that doesn't have a specific value.
28 */
29 public fontFamily: string;
30
31 /**
32 * Gets or sets the font size which will be used for all spans that doesn't have a specific value.
33 */
34 public fontSize: number;
35
36 /**
37 * Gets or sets the font style which will be used for all spans that doesn't have a specific value.
38 */
39 public fontStyle: FontStyleType;
40
41 /**
42 * Gets or sets the font weight which will be used for all spans that doesn't have a specific value.
43 */
44 public fontWeight: FontWeightType;
45
46 /**
47 * Gets or sets the font variation settings which will be used for all spans that doesn't have a specific value.
48 */
49 public fontVariationSettings: FontVariationSettingsType[];
50
51 /**
52 * Gets or sets text decorations which will be used for all spans that doesn't have a specific value.
53 */
54 public textDecoration: CoreTypes.TextDecorationType;
55
56 /**
57 * Gets or sets the font foreground color which will be used for all spans that doesn't have a specific value.
58 */
59 public color: Color;
60
61 /**
62 * Gets or sets the font background color which will be used for all spans that doesn't have a specific value.
63 */
64 public backgroundColor: Color;
65
66 /**
67 * Defines whether accessibility font scale should affect font size.
68 */
69 iosAccessibilityAdjustsFontSize: boolean;
70
71 /**
72 * Gets or sets the minimum accessibility font scale.
73 */
74 iosAccessibilityMinFontScale: number;
75
76 /**
77 * Gets or sets the maximum accessibility font scale.
78 */
79 iosAccessibilityMaxFontScale: number;
80}