• 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 * @file
18 * @kit ArkUI
19 */
20
21/**
22 * Provides a way to control the textclock status.
23 *
24 * @syscap SystemCapability.ArkUI.ArkUI.Full
25 * @since 8
26 */
27/**
28 * Provides a way to control the textclock status.
29 *
30 * @syscap SystemCapability.ArkUI.ArkUI.Full
31 * @crossplatform
32 * @since 10
33 */
34/**
35 * Provides a way to control the textclock status.
36 *
37 * @syscap SystemCapability.ArkUI.ArkUI.Full
38 * @crossplatform
39 * @form
40 * @atomicservice
41 * @since 11
42 */
43declare class TextClockController {
44  /**
45   * constructor.
46   *
47   * @syscap SystemCapability.ArkUI.ArkUI.Full
48   * @since 8
49   */
50  /**
51   * constructor.
52   *
53   * @syscap SystemCapability.ArkUI.ArkUI.Full
54   * @crossplatform
55   * @since 10
56   */
57  /**
58   * constructor.
59   *
60   * @syscap SystemCapability.ArkUI.ArkUI.Full
61   * @crossplatform
62   * @form
63   * @atomicservice
64   * @since 11
65   */
66  constructor();
67  /**
68   * Provides a start event for textclock.
69   *
70   * @syscap SystemCapability.ArkUI.ArkUI.Full
71   * @since 8
72   */
73  /**
74   * Provides a start event for textclock.
75   *
76   * @syscap SystemCapability.ArkUI.ArkUI.Full
77   * @crossplatform
78   * @since 10
79   */
80  /**
81   * Provides a start event for textclock.
82   *
83   * @syscap SystemCapability.ArkUI.ArkUI.Full
84   * @crossplatform
85   * @form
86   * @atomicservice
87   * @since 11
88   */
89  start();
90  /**
91   * Provides a stop event for textclock.
92   *
93   * @syscap SystemCapability.ArkUI.ArkUI.Full
94   * @since 8
95   */
96  /**
97   * Provides a stop event for textclock.
98   *
99   * @syscap SystemCapability.ArkUI.ArkUI.Full
100   * @crossplatform
101   * @since 10
102   */
103  /**
104   * Provides a stop event for textclock.
105   *
106   * @syscap SystemCapability.ArkUI.ArkUI.Full
107   * @crossplatform
108   * @form
109   * @atomicservice
110   * @since 11
111   */
112  stop();
113}
114
115/**
116 * TextClockConfiguration used by text clock content modifier
117 *
118 * @interface TextClockConfiguration
119 * @extends CommonConfiguration<TextClockConfiguration>
120 * @syscap SystemCapability.ArkUI.ArkUI.Full
121 * @crossplatform
122 * @atomicservice
123 * @since 12
124 */
125declare interface TextClockConfiguration extends CommonConfiguration<TextClockConfiguration> {
126  /**
127   * Specifies the current time zone.
128   * The valid value is an integer ranging from - 14 to 12,
129   * Where a negative value indicates the eastern time zone, for example, -8.
130   *
131   * @type { number }
132   * @syscap SystemCapability.ArkUI.ArkUI.Full
133   * @crossplatform
134   * @atomicservice
135   * @since 12
136   */
137  timeZoneOffset: number;
138
139  /**
140   * TextClock is started or not.
141   *
142   * @type { boolean }
143   * @syscap SystemCapability.ArkUI.ArkUI.Full
144   * @crossplatform
145   * @atomicservice
146   * @since 12
147   */
148  started: boolean;
149
150  /**
151   * The time of the TextClock.
152   *
153   * @type { number }
154   * @syscap SystemCapability.ArkUI.ArkUI.Full
155   * @crossplatform
156   * @atomicservice
157   * @since 12
158   */
159  timeValue: number;
160}
161
162/**
163 * TextClock component, which provides the text clock capability.
164 *
165 * @interface TextClockInterface
166 * @syscap SystemCapability.ArkUI.ArkUI.Full
167 * @since 8
168 */
169/**
170 * TextClock component, which provides the text clock capability.
171 *
172 * @interface TextClockInterface
173 * @syscap SystemCapability.ArkUI.ArkUI.Full
174 * @crossplatform
175 * @since 10
176 */
177/**
178 * TextClock component, which provides the text clock capability.
179 *
180 * @interface TextClockInterface
181 * @syscap SystemCapability.ArkUI.ArkUI.Full
182 * @crossplatform
183 * @form
184 * @atomicservice
185 * @since 11
186 */
187interface TextClockInterface {
188  /**
189   * Construct the text clock component.
190   * Specifies the current time zone.
191   * The valid value is an integer ranging from - 14 to 12,
192   * Where a negative value indicates the eastern time zone, for example, -8.
193   *
194   * @param { object } options
195   * @returns { TextClockAttribute }
196   * @syscap SystemCapability.ArkUI.ArkUI.Full
197   * @since 8
198   */
199  /**
200   * Construct the text clock component.
201   * Specifies the current time zone.
202   * The valid value is an integer ranging from - 14 to 12,
203   * Where a negative value indicates the eastern time zone, for example, -8.
204   *
205   * @param { object } options
206   * @returns { TextClockAttribute }
207   * @syscap SystemCapability.ArkUI.ArkUI.Full
208   * @crossplatform
209   * @since 10
210   */
211  /**
212   * Construct the text clock component.
213   * Specifies the current time zone.
214   * The valid value is an integer ranging from - 14 to 12,
215   * Where a negative value indicates the eastern time zone, for example, -8.
216   *
217   * @param { object } options
218   * @returns { TextClockAttribute }
219   * @syscap SystemCapability.ArkUI.ArkUI.Full
220   * @crossplatform
221   * @form
222   * @atomicservice
223   * @since 11
224   */
225  (options?: { timeZoneOffset?: number; controller?: TextClockController }): TextClockAttribute;
226}
227
228/**
229 * Provides attribute for TextClock.
230 *
231 * @extends CommonMethod<TextClockAttribute>
232 * @syscap SystemCapability.ArkUI.ArkUI.Full
233 * @since 8
234 */
235/**
236 * Provides attribute for TextClock.
237 *
238 * @extends CommonMethod<TextClockAttribute>
239 * @syscap SystemCapability.ArkUI.ArkUI.Full
240 * @crossplatform
241 * @since 10
242 */
243/**
244 * Provides attribute for TextClock.
245 *
246 * @extends CommonMethod<TextClockAttribute>
247 * @syscap SystemCapability.ArkUI.ArkUI.Full
248 * @crossplatform
249 * @form
250 * @atomicservice
251 * @since 11
252 */
253declare class TextClockAttribute extends CommonMethod<TextClockAttribute> {
254  /**
255   * set display time format,such as "yyyy/mm/dd","yyyy-mm-dd".
256   * support time format:yyyy,mm,mmm(English month abbreviation),mmmm(Full name of the month in English),
257   * dd,ddd(English Week abbreviation),dddd(Full name of the week in English),
258   * HH/hh(24-hour clock/12-hour clock),MM/mm(minute),SS/ss(second).
259   *
260   * @param { string } value
261   * @returns { TextClockAttribute }
262   * @syscap SystemCapability.ArkUI.ArkUI.Full
263   * @since 8
264   */
265  /**
266   * set display time format,such as "yyyy/mm/dd","yyyy-mm-dd".
267   * support time format:yyyy,mm,mmm(English month abbreviation),mmmm(Full name of the month in English),
268   * dd,ddd(English Week abbreviation),dddd(Full name of the week in English),
269   * HH/hh(24-hour clock/12-hour clock),MM/mm(minute),SS/ss(second).
270   *
271   * @param { string } value
272   * @returns { TextClockAttribute }
273   * @syscap SystemCapability.ArkUI.ArkUI.Full
274   * @crossplatform
275   * @since 10
276   */
277  /**
278   * set display time format,such as "yyyy/mm/dd","yyyy-mm-dd".
279   * support time format:yyyy,mm,mmm(English month abbreviation),mmmm(Full name of the month in English),
280   * dd,ddd(English Week abbreviation),dddd(Full name of the week in English),
281   * HH/hh(24-hour clock/12-hour clock),MM/mm(minute),SS/ss(second).
282   * The default value is "hh:mm:ss" when TextClock is not in a form.
283   * The default value is "hh:mm" when TextClock is in a form.
284   * If the value has second or millisecond, the value will be set to the default value.
285   *
286   * @param { string } value
287   * @returns { TextClockAttribute }
288   * @syscap SystemCapability.ArkUI.ArkUI.Full
289   * @crossplatform
290   * @form
291   * @atomicservice
292   * @since 11
293   */
294  format(value: string): TextClockAttribute;
295
296  /**
297   * Provides a date change callback.
298   * The callback parameter is Unix Time Stamp,
299   * The number of milliseconds that have elapsed since January 1, 1970 (UTC).
300   * The minimum callback interval for this event is seconds.
301   * You can listen to this callback,
302   * Use the format attribute method to customize data display in the callback.
303   *
304   * @param { function } event - Listening date event callback.
305   * @returns { TextClockAttribute }
306   * @syscap SystemCapability.ArkUI.ArkUI.Full
307   * @since 8
308   */
309  /**
310   * Provides a date change callback.
311   * The callback parameter is Unix Time Stamp,
312   * The number of milliseconds that have elapsed since January 1, 1970 (UTC).
313   * The minimum callback interval for this event is seconds.
314   * You can listen to this callback,
315   * Use the format attribute method to customize data display in the callback.
316   *
317   * @param { function } event - Listening date event callback.
318   * @returns { TextClockAttribute }
319   * @syscap SystemCapability.ArkUI.ArkUI.Full
320   * @crossplatform
321   * @since 10
322   */
323  /**
324   * Provides a date change callback.
325   * The callback parameter is Unix Time Stamp,
326   * The number of milliseconds that have elapsed since January 1, 1970 (UTC).
327   * The minimum callback interval for this event default is seconds when TextClock is not in a form.
328   * The minimum callback interval for this event is minutes when TextClock is in a form.
329   * If visibility is Hidden the callback be disabled when TextClock is in a form.
330   * You can listen to this callback,
331   * Use the format attribute method to customize data display in the callback.
332   *
333   * @param { function } event - Listening date event callback.
334   * @returns { TextClockAttribute }
335   * @syscap SystemCapability.ArkUI.ArkUI.Full
336   * @crossplatform
337   * @form
338   * @atomicservice
339   * @since 11
340   */
341  onDateChange(event: (value: number) => void): TextClockAttribute;
342
343  /**
344   * Called when the value of TextClock fontColor is set
345   *
346   * @param { ResourceColor } value
347   * @returns { TextClockAttribute }
348   * @syscap SystemCapability.ArkUI.ArkUI.Full
349   * @since 8
350   */
351  /**
352   * Called when the value of TextClock fontColor is set
353   *
354   * @param { ResourceColor } value
355   * @returns { TextClockAttribute }
356   * @syscap SystemCapability.ArkUI.ArkUI.Full
357   * @crossplatform
358   * @since 10
359   */
360  /**
361   * Called when the value of TextClock fontColor is set
362   *
363   * @param { ResourceColor } value
364   * @returns { TextClockAttribute }
365   * @syscap SystemCapability.ArkUI.ArkUI.Full
366   * @crossplatform
367   * @form
368   * @atomicservice
369   * @since 11
370   */
371  fontColor(value: ResourceColor): TextClockAttribute;
372
373  /**
374   * Called when the value of TextClock fontSize is set
375   *
376   * @param { Length } value
377   * @returns { TextClockAttribute }
378   * @syscap SystemCapability.ArkUI.ArkUI.Full
379   * @since 8
380   */
381  /**
382   * Called when the value of TextClock fontSize is set
383   *
384   * @param { Length } value
385   * @returns { TextClockAttribute }
386   * @syscap SystemCapability.ArkUI.ArkUI.Full
387   * @crossplatform
388   * @since 10
389   */
390  /**
391   * Called when the value of TextClock fontSize is set
392   *
393   * @param { Length } value
394   * @returns { TextClockAttribute }
395   * @syscap SystemCapability.ArkUI.ArkUI.Full
396   * @crossplatform
397   * @form
398   * @atomicservice
399   * @since 11
400   */
401  fontSize(value: Length): TextClockAttribute;
402
403  /**
404   * Called when the value of TextClock fontStyle is set
405   *
406   * @param { FontStyle } value
407   * @returns { TextClockAttribute }
408   * @syscap SystemCapability.ArkUI.ArkUI.Full
409   * @since 8
410   */
411  /**
412   * Called when the value of TextClock fontStyle is set
413   *
414   * @param { FontStyle } value
415   * @returns { TextClockAttribute }
416   * @syscap SystemCapability.ArkUI.ArkUI.Full
417   * @crossplatform
418   * @since 10
419   */
420  /**
421   * Called when the value of TextClock fontStyle is set
422   *
423   * @param { FontStyle } value
424   * @returns { TextClockAttribute }
425   * @syscap SystemCapability.ArkUI.ArkUI.Full
426   * @crossplatform
427   * @form
428   * @atomicservice
429   * @since 11
430   */
431  fontStyle(value: FontStyle): TextClockAttribute;
432
433  /**
434   * Called when the value of TextClock fontWeight is set
435   *
436   * @param { number | FontWeight | string } value
437   * @returns { TextClockAttribute }
438   * @syscap SystemCapability.ArkUI.ArkUI.Full
439   * @since 8
440   */
441  /**
442   * Called when the value of TextClock fontWeight is set
443   *
444   * @param { number | FontWeight | string } value
445   * @returns { TextClockAttribute }
446   * @syscap SystemCapability.ArkUI.ArkUI.Full
447   * @crossplatform
448   * @since 10
449   */
450  /**
451   * Called when the value of TextClock fontWeight is set
452   *
453   * @param { number | FontWeight | string } value
454   * @returns { TextClockAttribute }
455   * @syscap SystemCapability.ArkUI.ArkUI.Full
456   * @crossplatform
457   * @form
458   * @atomicservice
459   * @since 11
460   */
461  fontWeight(value: number | FontWeight | string): TextClockAttribute;
462
463  /**
464   * Called when the value of TextClock fontFamily is set
465   *
466   * @param { ResourceStr } value
467   * @returns { TextClockAttribute }
468   * @syscap SystemCapability.ArkUI.ArkUI.Full
469   * @since 8
470   */
471  /**
472   * Called when the value of TextClock fontFamily is set
473   *
474   * @param { ResourceStr } value
475   * @returns { TextClockAttribute }
476   * @syscap SystemCapability.ArkUI.ArkUI.Full
477   * @crossplatform
478   * @since 10
479   */
480  /**
481   * Called when the value of TextClock fontFamily is set
482   *
483   * @param { ResourceStr } value
484   * @returns { TextClockAttribute }
485   * @syscap SystemCapability.ArkUI.ArkUI.Full
486   * @crossplatform
487   * @form
488   * @atomicservice
489   * @since 11
490   */
491  fontFamily(value: ResourceStr): TextClockAttribute;
492
493  /**
494   * Called when the text shadow is set.
495   *
496   * @param { ShadowOptions | Array<ShadowOptions> } value - The shadow options.
497   * @returns { TextClockAttribute }
498   * @syscap SystemCapability.ArkUI.ArkUI.Full
499   * @crossplatform
500   * @form
501   * @since 11
502   */
503  /**
504   * Called when the text shadow is set.
505   *
506   * @param { ShadowOptions | Array<ShadowOptions> } value - The shadow options.
507   * @returns { TextClockAttribute }
508   * @syscap SystemCapability.ArkUI.ArkUI.Full
509   * @crossplatform
510   * @form
511   * @atomicservice
512   * @since 12
513   */
514  textShadow(value: ShadowOptions | Array<ShadowOptions>): TextClockAttribute;
515
516  /**
517   * Called when the text fontFeature is set.
518   *
519   * @param { string } value - The fontFeature.
520   * normal | <feature-tag-value>,
521   * where <feature-tag-value> = <string> [ <integer> | on | off ], like: "ss01" 0
522   * number of <feature-tag-value> can be single or multiple, and separated by comma ','.
523   * @returns { TextClockAttribute }
524   * @syscap SystemCapability.ArkUI.ArkUI.Full
525   * @crossplatform
526   * @form
527   * @since 11
528   */
529  /**
530   * Called when the text fontFeature is set.
531   *
532   * @param { string } value - The fontFeature.
533   * normal | <feature-tag-value>,
534   * where <feature-tag-value> = <string> [ <integer> | on | off ], like: "ss01" 0
535   * number of <feature-tag-value> can be single or multiple, and separated by comma ','.
536   * @returns { TextClockAttribute }
537   * @syscap SystemCapability.ArkUI.ArkUI.Full
538   * @crossplatform
539   * @form
540   * @atomicservice
541   * @since 12
542   */
543  fontFeature(value: string): TextClockAttribute;
544
545  /**
546   * Set the content modifier of textclock.
547   *
548   * @param { ContentModifier<TextClockConfiguration> } modifier - The content modifier of textclock.
549   * @returns { TextClockAttribute }
550   * @syscap SystemCapability.ArkUI.ArkUI.Full
551   * @crossplatform
552   * @atomicservice
553   * @since 12
554   */
555  contentModifier(modifier: ContentModifier<TextClockConfiguration>): TextClockAttribute;
556
557  /**
558   * Set hour format
559   *
560   * @param { Optional<DateTimeOptions> } dateTimeOptions - Indicates whether a leading 0 is required for the hour.
561   * @returns { TextClockAttribute } the attribute of the text clock
562   * @syscap SystemCapability.ArkUI.ArkUI.Full
563   * @crossplatform
564   * @form
565   * @atomicservice
566   * @since 12
567   */
568  dateTimeOptions(dateTimeOptions: Optional<DateTimeOptions>): TextClockAttribute;
569}
570
571/**
572 * Defines TextClock Component.
573 *
574 * @syscap SystemCapability.ArkUI.ArkUI.Full
575 * @since 8
576 */
577/**
578 * Defines TextClock Component.
579 *
580 * @syscap SystemCapability.ArkUI.ArkUI.Full
581 * @crossplatform
582 * @since 10
583 */
584/**
585 * Defines TextClock Component.
586 *
587 * @syscap SystemCapability.ArkUI.ArkUI.Full
588 * @crossplatform
589 * @form
590 * @atomicservice
591 * @since 11
592 */
593declare const TextClock: TextClockInterface;
594
595/**
596 * Defines TextClock Component instance.
597 *
598 * @syscap SystemCapability.ArkUI.ArkUI.Full
599 * @since 8
600 */
601/**
602 * Defines TextClock Component instance.
603 *
604 * @syscap SystemCapability.ArkUI.ArkUI.Full
605 * @crossplatform
606 * @since 10
607 */
608/**
609 * Defines TextClock Component instance.
610 *
611 * @syscap SystemCapability.ArkUI.ArkUI.Full
612 * @crossplatform
613 * @form
614 * @atomicservice
615 * @since 11
616 */
617declare const TextClockInstance: TextClockAttribute;
618