• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import {CommonMethod, Color, Resource} from "./common";
17
18export declare enum FontStyle {
19  Normal,
20  Italic
21}
22
23export declare enum FontWeight {
24  Lighter,
25  Normal,
26  Regular,
27  Medium,
28  Bold,
29  Bolder
30}
31
32export declare enum TextAlign {
33  Center,
34  Start,
35  End
36}
37
38export declare enum TextOverflow {
39  Clip,
40  Ellipsis,
41  None
42}
43
44export declare enum TextDecorationType {
45  None,
46  Underline,
47  Overline,
48  LineThrough
49}
50
51export declare enum TextCase {
52  Normal,
53  LowerCase,
54  UpperCase
55}
56
57export declare class TextExtend<T> extends TextAttribute<T> {
58}
59
60interface Text extends TextAttribute<Text> {
61  (content?: string | Resource): Text;
62}
63
64declare class TextAttribute<T> extends CommonMethod<T> {
65  fontColor(value: Color | number | string | Resource): T;
66
67  fontSize(value: number | string | Resource): T;
68
69  minFontSize(value: number | string | Resource): T;
70
71  maxFontSize(value: number | string | Resource): T;
72
73  fontStyle(value: FontStyle): T;
74
75  fontWeight(value: number | FontWeight | string): T;
76
77  textAlign(value: TextAlign): T;
78
79  lineHeight(value: number | string | Resource): T;
80
81  textOverflow(value: { overflow: TextOverflow }): T;
82
83  fontFamily(value: string | Resource): T;
84
85  maxLines(value: number): T;
86
87  decoration(value: { type: TextDecorationType, color?: Color | number | string | Resource }): T;
88
89  letterSpacing(value: number | string): T;
90
91  textCase(value: TextCase): T;
92
93  baselineOffset(value: number | string): T;
94}
95
96export declare const TextInterface: Text;
97