/
text-base.d.ts
134 lines (107 loc) · 3.42 KB
/
text-base.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/**
* @module "ui/text-base"
*/ /** */
import { View, AddChildFromBuilder, Property, CssProperty, InheritedCssProperty, Style, Length } from "../core/view";
import { FormattedString } from "../../text/formatted-string";
export * from "../core/view";
export { FormattedString } from "../../text/formatted-string";
export class TextBase extends View implements AddChildFromBuilder {
/**
* Gets of the text widget. In some cases(android TextInputLayout) the TextView is made of 2 views: the layout and the text view
* So we need a different getter for the layout and text functions
*/
public readonly nativeTextViewProtected: any;
/**
* Gets or sets the text.
*/
text: string;
/**
* Gets or sets a formatted string.
*/
formattedText: FormattedString;
/**
* Gets or sets font-size style property.
*/
fontSize: number;
/**
* Gets or sets letterSpace style property.
*/
letterSpacing: number;
/**
* Gets or sets lineHeight style property.
*/
lineHeight: number;
/**
* Gets or sets text-alignment style property.
*/
textAlignment: TextAlignment;
/**
* Gets or sets text decorations style property.
*/
textDecoration: TextDecoration;
/**
* Gets or sets text transform style property.
*/
textTransform: TextTransform;
/**
* Gets or sets white space style property.
*/
whiteSpace: WhiteSpace;
/**
* Gets or sets padding style property.
*/
padding: string | Length;
/**
* Specify the bottom padding of this layout.
*/
paddingBottom: Length;
/**
* Specify the left padding of this layout.
*/
paddingLeft: Length;
/**
* Specify the right padding of this layout.
*/
paddingRight: Length;
/**
* Specify the top padding of this layout.
*/
paddingTop: Length;
/**
* Called for every child element declared in xml.
* This method will add a child element (value) to current element.
* @private
* @param name - Name of the element.
* @param value - Value of the element.
*/
_addChildFromBuilder(name: string, value: any): void;
//@private
/**
* Called when the text property is changed to request layout.
* @private
*/
_requestLayoutOnTextChanged(): void;
/**
* @private
*/
_setNativeText(reset?: boolean): void;
/**
* @private
*/
_isSingleLine: boolean;
//@endprivate
}
export const textProperty: Property<TextBase, string>;
export const formattedTextProperty: Property<TextBase, FormattedString>;
export type WhiteSpace = "initial" | "normal" | "nowrap";
export type TextAlignment = "initial" | "left" | "center" | "right";
export type TextTransform = "initial" | "none" | "capitalize" | "uppercase" | "lowercase";
export type TextDecoration = "none" | "underline" | "line-through" | "underline line-through";
export const textAlignmentProperty: InheritedCssProperty<Style, TextAlignment>;
export const textDecorationProperty: CssProperty<Style, TextDecoration>;
export const textTransformProperty: CssProperty<Style, TextTransform>;
export const whiteSpaceProperty: CssProperty<Style, WhiteSpace>;
export const letterSpacingProperty: CssProperty<Style, number>;
//Used by tab view
export function getTransformedText(text: string, textTransform: TextTransform): string;
export const resetSymbol: symbol;