• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2023 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 * Provides a way to control the textclock status.
18 *
19 * @since 8
20 */
21/**
22 * Provides a way to control the textclock status.
23 *
24 * @crossplatform
25 * @since 10
26 */
27declare class TextClockController {
28  /**
29   * constructor.
30   *
31   * @syscap SystemCapability.ArkUI.ArkUI.Full
32   * @since 8
33   */
34  /**
35   * constructor.
36   *
37   * @syscap SystemCapability.ArkUI.ArkUI.Full
38   * @crossplatform
39   * @since 10
40   */
41  constructor();
42  /**
43   * Provides a start event for textclock.
44   *
45   * @syscap SystemCapability.ArkUI.ArkUI.Full
46   * @since 8
47   */
48  /**
49   * Provides a start event for textclock.
50   *
51   * @syscap SystemCapability.ArkUI.ArkUI.Full
52   * @crossplatform
53   * @since 10
54   */
55  start();
56  /**
57   * Provides a stop event for textclock.
58   *
59   * @syscap SystemCapability.ArkUI.ArkUI.Full
60   * @since 8
61   */
62  /**
63   * Provides a stop event for textclock.
64   *
65   * @syscap SystemCapability.ArkUI.ArkUI.Full
66   * @crossplatform
67   * @since 10
68   */
69  stop();
70}
71
72/**
73 * TextClock component, which provides the text clock capability.
74 *
75 * @interface TextClockInterface
76 * @syscap SystemCapability.ArkUI.ArkUI.Full
77 * @since 8
78 */
79/**
80 * TextClock component, which provides the text clock capability.
81 *
82 * @interface TextClockInterface
83 * @syscap SystemCapability.ArkUI.ArkUI.Full
84 * @crossplatform
85 * @since 10
86 */
87interface TextClockInterface {
88  /**
89   * Construct the text clock component.
90   * Specifies the current time zone.
91   * The valid value is an integer ranging from - 14 to 12,
92   * Where a negative value indicates the eastern time zone, for example, -8.
93   *
94   * @param { object } options
95   * @returns { TextClockAttribute }
96   * @syscap SystemCapability.ArkUI.ArkUI.Full
97   * @since 8
98   */
99  /**
100   * Construct the text clock component.
101   * Specifies the current time zone.
102   * The valid value is an integer ranging from - 14 to 12,
103   * Where a negative value indicates the eastern time zone, for example, -8.
104   *
105   * @param { object } options
106   * @returns { TextClockAttribute }
107   * @syscap SystemCapability.ArkUI.ArkUI.Full
108   * @crossplatform
109   * @since 10
110   */
111  (options?: { timeZoneOffset?: number; controller?: TextClockController }): TextClockAttribute;
112}
113
114declare class TextClockAttribute extends CommonMethod<TextClockAttribute> {
115  /**
116   * set display time format,such as "yyyy/mm/dd","yyyy-mm-dd".
117   * support time format:yyyy,mm,mmm(English month abbreviation),mmmm(Full name of the month in English),
118   * dd,ddd(English Week abbreviation),dddd(Full name of the week in English),
119   * HH/hh(24-hour clock/12-hour clock),MM/mm(minute),SS/ss(second).
120   *
121   * @param { string } value
122   * @returns { TextClockAttribute }
123   * @syscap SystemCapability.ArkUI.ArkUI.Full
124   * @since 8
125   */
126  /**
127   * set display time format,such as "yyyy/mm/dd","yyyy-mm-dd".
128   * support time format:yyyy,mm,mmm(English month abbreviation),mmmm(Full name of the month in English),
129   * dd,ddd(English Week abbreviation),dddd(Full name of the week in English),
130   * HH/hh(24-hour clock/12-hour clock),MM/mm(minute),SS/ss(second).
131   *
132   * @param { string } value
133   * @returns { TextClockAttribute }
134   * @syscap SystemCapability.ArkUI.ArkUI.Full
135   * @crossplatform
136   * @since 10
137   */
138  format(value: string): TextClockAttribute;
139  /**
140   * Provides a date change callback.
141   * The callback parameter is Unix Time Stamp,
142   * The number of milliseconds that have elapsed since January 1, 1970 (UTC).
143   * The minimum callback interval for this event is seconds.
144   * You can listen to this callback,
145   * Use the format attribute method to customize data display in the callback.
146   *
147   * @param { function } event - Listening date event callback.
148   * @returns { TextClockAttribute }
149   * @syscap SystemCapability.ArkUI.ArkUI.Full
150   * @since 8
151   */
152  /**
153   * Provides a date change callback.
154   * The callback parameter is Unix Time Stamp,
155   * The number of milliseconds that have elapsed since January 1, 1970 (UTC).
156   * The minimum callback interval for this event is seconds.
157   * You can listen to this callback,
158   * Use the format attribute method to customize data display in the callback.
159   *
160   * @param { function } event - Listening date event callback.
161   * @returns { TextClockAttribute }
162   * @syscap SystemCapability.ArkUI.ArkUI.Full
163   * @crossplatform
164   * @since 10
165   */
166  onDateChange(event: (value: number) => void): TextClockAttribute;
167
168  /**
169   * Called when the value of TextClock fontColor is set
170   *
171   * @param { ResourceColor } value
172   * @returns { TextClockAttribute }
173   * @syscap SystemCapability.ArkUI.ArkUI.Full
174   * @since 8
175   */
176  /**
177   * Called when the value of TextClock fontColor is set
178   *
179   * @param { ResourceColor } value
180   * @returns { TextClockAttribute }
181   * @syscap SystemCapability.ArkUI.ArkUI.Full
182   * @crossplatform
183   * @since 10
184   */
185  fontColor(value: ResourceColor): TextClockAttribute;
186
187  /**
188   * Called when the value of TextClock fontSize is set
189   *
190   * @param { Length } value
191   * @returns { TextClockAttribute }
192   * @syscap SystemCapability.ArkUI.ArkUI.Full
193   * @since 8
194   */
195  /**
196   * Called when the value of TextClock fontSize is set
197   *
198   * @param { Length } value
199   * @returns { TextClockAttribute }
200   * @syscap SystemCapability.ArkUI.ArkUI.Full
201   * @crossplatform
202   * @since 10
203   */
204  fontSize(value: Length): TextClockAttribute;
205
206  /**
207   * Called when the value of TextClock fontStyle is set
208   *
209   * @param { FontStyle } value
210   * @returns { TextClockAttribute }
211   * @syscap SystemCapability.ArkUI.ArkUI.Full
212   * @since 8
213   */
214  /**
215   * Called when the value of TextClock fontStyle is set
216   *
217   * @param { FontStyle } value
218   * @returns { TextClockAttribute }
219   * @syscap SystemCapability.ArkUI.ArkUI.Full
220   * @crossplatform
221   * @since 10
222   */
223  fontStyle(value: FontStyle): TextClockAttribute;
224
225  /**
226   * Called when the value of TextClock fontWeight is set
227   *
228   * @param { number | FontWeight | string } value
229   * @returns { TextClockAttribute }
230   * @syscap SystemCapability.ArkUI.ArkUI.Full
231   * @since 8
232   */
233  /**
234   * Called when the value of TextClock fontWeight is set
235   *
236   * @param { number | FontWeight | string } value
237   * @returns { TextClockAttribute }
238   * @syscap SystemCapability.ArkUI.ArkUI.Full
239   * @crossplatform
240   * @since 10
241   */
242  fontWeight(value: number | FontWeight | string): TextClockAttribute;
243
244  /**
245   * Called when the value of TextClock fontFamily is set
246   *
247   * @param { ResourceStr } value
248   * @returns { TextClockAttribute }
249   * @syscap SystemCapability.ArkUI.ArkUI.Full
250   * @since 8
251   */
252  /**
253   * Called when the value of TextClock fontFamily is set
254   *
255   * @param { ResourceStr } value
256   * @returns { TextClockAttribute }
257   * @syscap SystemCapability.ArkUI.ArkUI.Full
258   * @crossplatform
259   * @since 10
260   */
261  fontFamily(value: ResourceStr): TextClockAttribute;
262}
263
264/**
265 * Defines TextClock Component.
266 *
267 * @syscap SystemCapability.ArkUI.ArkUI.Full
268 * @since 8
269 */
270/**
271 * Defines TextClock Component.
272 *
273 * @syscap SystemCapability.ArkUI.ArkUI.Full
274 * @crossplatform
275 * @since 10
276 */
277declare const TextClock: TextClockInterface;
278
279/**
280 * Defines TextClock Component instance.
281 *
282 * @syscap SystemCapability.ArkUI.ArkUI.Full
283 * @since 8
284 */
285/**
286 * Defines TextClock Component instance.
287 *
288 * @syscap SystemCapability.ArkUI.ArkUI.Full
289 * @crossplatform
290 * @since 10
291 */
292declare const TextClockInstance: TextClockAttribute;
293