• 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
16/**
17 * Provide text decoration.
18 * @since 7
19 */
20interface SpanInterface {
21  /**
22   * Called when text is entered in span.
23   * @since 7
24   */
25  (value: string | Resource): SpanAttribute;
26}
27
28/**
29 * @since 7
30 */
31declare class SpanAttribute extends CommonMethod<SpanAttribute> {
32  /**
33   * Called when the font color is set.
34   * @since 7
35   */
36  fontColor(value: ResourceColor): SpanAttribute;
37
38  /**
39   * Called when the font size is set.
40   * @since 7
41   */
42  fontSize(value: number | string | Resource): SpanAttribute;
43
44  /**
45   * Called when the font style of a font is set.
46   * @since 7
47   */
48  fontStyle(value: FontStyle): SpanAttribute;
49
50  /**
51   * Called when the font weight is set.
52   * @since 7
53   */
54  fontWeight(value: number | FontWeight | string): SpanAttribute;
55
56  /**
57   * Called when the font list of text is set.
58   * @since 7
59   */
60  fontFamily(value: string | Resource): SpanAttribute;
61
62  /**
63   * Called when the text decoration of the text is set.
64   * @since 7
65   */
66  decoration(value: { type: TextDecorationType; color?: ResourceColor }): SpanAttribute;
67
68  /**
69   * Called when the distance between text fonts is set.
70   * @since 7
71   */
72  letterSpacing(value: number | string): SpanAttribute;
73
74  /**
75   * Called when the type of letter in the text font is set.
76   */
77  textCase(value: TextCase): SpanAttribute;
78}
79
80declare const Span: SpanInterface;
81declare const SpanInstance: SpanAttribute;
82