• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 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 * The type of alignment between entry and calendar.
18 * @enum {number}
19 * @syscap SystemCapability.ArkUI.ArkUI.Full
20 * @crossplatform
21 * @since 10
22 */
23/**
24 * The type of alignment between entry and calendar.
25 * @enum {number}
26 * @syscap SystemCapability.ArkUI.ArkUI.Full
27 * @crossplatform
28 * @atomicservice
29 * @since 11
30 */
31declare enum CalendarAlign {
32  /**
33   * The value of calendar align type start.
34   * @syscap SystemCapability.ArkUI.ArkUI.Full
35   * @crossplatform
36   * @since 10
37   */
38  /**
39   * The value of calendar align type start.
40   * @syscap SystemCapability.ArkUI.ArkUI.Full
41   * @crossplatform
42   * @atomicservice
43   * @since 11
44   */
45  START = 0,
46  /**
47   * The value of calendar align type center.
48   * @syscap SystemCapability.ArkUI.ArkUI.Full
49   * @crossplatform
50   * @since 10
51   */
52  /**
53   * The value of calendar align type center.
54   * @syscap SystemCapability.ArkUI.ArkUI.Full
55   * @crossplatform
56   * @atomicservice
57   * @since 11
58   */
59  CENTER = 1,
60  /**
61   * The value of calendar align type end.
62   * @syscap SystemCapability.ArkUI.ArkUI.Full
63   * @crossplatform
64   * @since 10
65   */
66  /**
67   * The value of calendar align type end.
68   * @syscap SystemCapability.ArkUI.ArkUI.Full
69   * @crossplatform
70   * @atomicservice
71   * @since 11
72   */
73  END = 2
74}
75
76/**
77 * Defines the options of CalendarPicker.
78 * @interface CalendarOptions
79 * @syscap SystemCapability.ArkUI.ArkUI.Full
80 * @crossplatform
81 * @since 10
82 */
83/**
84 * Defines the options of CalendarPicker.
85 * @interface CalendarOptions
86 * @syscap SystemCapability.ArkUI.ArkUI.Full
87 * @crossplatform
88 * @atomicservice
89 * @since 11
90 */
91declare interface CalendarOptions {
92  /**
93   * Specifies the radius of the background of the day in calendar.
94   * @type { ?(number | Resource) }
95   * @syscap SystemCapability.ArkUI.ArkUI.Full
96   * @crossplatform
97   * @since 10
98   */
99  /**
100   * Specifies the radius of the background of the day in calendar.
101   * @type { ?(number | Resource) }
102   * @syscap SystemCapability.ArkUI.ArkUI.Full
103   * @crossplatform
104   * @atomicservice
105   * @since 11
106   */
107  hintRadius?: number | Resource;
108
109  /**
110   * Specifies the date selector check date.
111   * @type { ?Date }
112   * @syscap SystemCapability.ArkUI.ArkUI.Full
113   * @crossplatform
114   * @since 10
115   */
116  /**
117   * Specifies the date selector check date.
118   * @type { ?Date }
119   * @syscap SystemCapability.ArkUI.ArkUI.Full
120   * @crossplatform
121   * @atomicservice
122   * @since 11
123   */
124  selected?: Date;
125}
126
127/**
128 * Defines the CalendarPicker Component.
129 * @interface CalendarPickerInterface
130 * @syscap SystemCapability.ArkUI.ArkUI.Full
131 * @crossplatform
132 * @since 10
133 */
134/**
135 * Defines the CalendarPicker Component.
136 * @interface CalendarPickerInterface
137 * @syscap SystemCapability.ArkUI.ArkUI.Full
138 * @crossplatform
139 * @atomicservice
140 * @since 11
141 */
142interface CalendarPickerInterface {
143  /**
144   * Defines the CalendarPicker constructor.
145   * @param { CalendarOptions } options - the option of th calendarPicker.
146   * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker.
147   * @syscap SystemCapability.ArkUI.ArkUI.Full
148   * @crossplatform
149   * @since 10
150   */
151  /**
152   * Defines the CalendarPicker constructor.
153   * @param { CalendarOptions } options - the option of th calendarPicker.
154   * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker.
155   * @syscap SystemCapability.ArkUI.ArkUI.Full
156   * @crossplatform
157   * @atomicservice
158   * @since 11
159   */
160  (options?: CalendarOptions): CalendarPickerAttribute;
161}
162
163/**
164 * Defines the CalendarPicker attribute functions.
165 * @extends CommonMethod<CalendarPickerAttribute>
166 * @syscap SystemCapability.ArkUI.ArkUI.Full
167 * @crossplatform
168 * @since 10
169 */
170/**
171 * Defines the CalendarPicker attribute functions.
172 * @extends CommonMethod<CalendarPickerAttribute>
173 * @syscap SystemCapability.ArkUI.ArkUI.Full
174 * @crossplatform
175 * @atomicservice
176 * @since 11
177 */
178declare class CalendarPickerAttribute extends CommonMethod<CalendarPickerAttribute> {
179  /**
180   * Set the alignment between entry and calendar dialog.
181   * @param { CalendarAlign } alignType - The type of alignment between entry and calendar dialog.
182   * @param { Offset } offset - The offset between entry and calendar dialog.
183   * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker.
184   * @syscap SystemCapability.ArkUI.ArkUI.Full
185   * @crossplatform
186   * @since 10
187   */
188  /**
189   * Set the alignment between entry and calendar dialog.
190   * @param { CalendarAlign } alignType - The type of alignment between entry and calendar dialog.
191   * @param { Offset } offset - The offset between entry and calendar dialog.
192   * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker.
193   * @syscap SystemCapability.ArkUI.ArkUI.Full
194   * @crossplatform
195   * @atomicservice
196   * @since 11
197   */
198  edgeAlign(alignType: CalendarAlign, offset?: Offset): CalendarPickerAttribute;
199
200  /**
201   * Sets the text style of entry
202   * @param { PickerTextStyle } value - indicates the text style of entry.
203   * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker.
204   * @syscap SystemCapability.ArkUI.ArkUI.Full
205   * @crossplatform
206   * @since 10
207   */
208  /**
209   * Sets the text style of entry
210   * @param { PickerTextStyle } value - indicates the text style of entry.
211   * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker.
212   * @syscap SystemCapability.ArkUI.ArkUI.Full
213   * @crossplatform
214   * @atomicservice
215   * @since 11
216   */
217  textStyle(value: PickerTextStyle): CalendarPickerAttribute;
218
219  /**
220   * Callback for selected date changed.
221   * @param { function } callback - Callback for selected date changed.
222   * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker.
223   * @syscap SystemCapability.ArkUI.ArkUI.Full
224   * @crossplatform
225   * @since 10
226   */
227  /**
228   * Callback for selected date changed.
229   * @param { function } callback - Callback for selected date changed.
230   * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker.
231   * @syscap SystemCapability.ArkUI.ArkUI.Full
232   * @crossplatform
233   * @atomicservice
234   * @since 11
235   */
236  onChange(callback: (value: Date) => void): CalendarPickerAttribute;
237}
238
239/**
240 * Defines the DatePickerDialogOptions for Calendar Picker Dialog.
241 * @interface CalendarDialogOptions
242 * @syscap SystemCapability.ArkUI.ArkUI.Full
243 * @crossplatform
244 * @since 10
245 */
246/**
247 * Defines the DatePickerDialogOptions for Calendar Picker Dialog.
248 * @interface CalendarDialogOptions
249 * @syscap SystemCapability.ArkUI.ArkUI.Full
250 * @crossplatform
251 * @atomicservice
252 * @since 11
253 */
254declare interface CalendarDialogOptions extends CalendarOptions {
255  /**
256   * Called when the OK button in the dialog is clicked.
257   * @type { ?function }
258   * @syscap SystemCapability.ArkUI.ArkUI.Full
259   * @crossplatform
260   * @since 10
261   */
262  /**
263   * Called when the OK button in the dialog is clicked.
264   * @type { ?function }
265   * @syscap SystemCapability.ArkUI.ArkUI.Full
266   * @crossplatform
267   * @atomicservice
268   * @since 11
269   */
270  onAccept?: (value: Date) => void;
271
272  /**
273   * Called when the Cancel button in the dialog is clicked.
274   * @type { ?function }
275   * @syscap SystemCapability.ArkUI.ArkUI.Full
276   * @crossplatform
277   * @since 10
278   */
279  /**
280   * Called when the Cancel button in the dialog is clicked.
281   * @type { ?function }
282   * @syscap SystemCapability.ArkUI.ArkUI.Full
283   * @crossplatform
284   * @atomicservice
285   * @since 11
286   */
287  onCancel?: () => void;
288
289  /**
290   * This event is triggered when a date is selected in dialog.
291   * @type { ?function }
292   * @syscap SystemCapability.ArkUI.ArkUI.Full
293   * @crossplatform
294   * @since 10
295   */
296  /**
297   * This event is triggered when a date is selected in dialog.
298   * @type { ?function }
299   * @syscap SystemCapability.ArkUI.ArkUI.Full
300   * @crossplatform
301   * @atomicservice
302   * @since 11
303   */
304  onChange?: (value: Date) => void;
305
306  /**
307   * Defines the calendarPickerDialog's background color
308   *
309   * @type { ?ResourceColor }
310   * @default Color.Transparent
311   * @syscap SystemCapability.ArkUI.ArkUI.Full
312   * @crossplatform
313   * @since 11
314   */
315  backgroundColor?: ResourceColor;
316
317  /**
318   * Defines the calendarPickerDialog's background blur Style
319   *
320   * @type { ?BlurStyle }
321   * @default BlurStyle.COMPONENT_ULTRA_THICK
322   * @syscap SystemCapability.ArkUI.ArkUI.Full
323   * @crossplatform
324   * @since 11
325   */
326  backgroundBlurStyle?: BlurStyle;
327}
328
329/**
330 * Defines CalendarPickerDialog which uses show method to show CalendarPicker dialog.
331 * @syscap SystemCapability.ArkUI.ArkUI.Full
332 * @crossplatform
333 * @since 10
334 */
335/**
336 * Defines CalendarPickerDialog which uses show method to show CalendarPicker dialog.
337 * @syscap SystemCapability.ArkUI.ArkUI.Full
338 * @crossplatform
339 * @atomicservice
340 * @since 11
341 */
342declare class CalendarPickerDialog {
343  /**
344   * Invoking method display.
345   * @param { CalendarDialogOptions } options - the option of th calendarPicker.
346   * @syscap SystemCapability.ArkUI.ArkUI.Full
347   * @crossplatform
348   * @since 10
349   */
350  /**
351   * Invoking method display.
352   * @param { CalendarDialogOptions } options - the option of th calendarPicker.
353   * @syscap SystemCapability.ArkUI.ArkUI.Full
354   * @crossplatform
355   * @atomicservice
356   * @since 11
357   */
358  static show(options?: CalendarDialogOptions): void;
359}
360
361/**
362 * Defines CalendarPicker Component.
363 * @syscap SystemCapability.ArkUI.ArkUI.Full
364 * @crossplatform
365 * @since 10
366 */
367/**
368 * Defines CalendarPicker Component.
369 * @syscap SystemCapability.ArkUI.ArkUI.Full
370 * @crossplatform
371 * @atomicservice
372 * @since 11
373 */
374declare const CalendarPicker: CalendarPickerInterface;
375
376/**
377 * Defines CalendarPicker Component instance.
378 * @syscap SystemCapability.ArkUI.ArkUI.Full
379 * @crossplatform
380 * @since 10
381 */
382/**
383 * Defines CalendarPicker Component instance.
384 * @syscap SystemCapability.ArkUI.ArkUI.Full
385 * @crossplatform
386 * @atomicservice
387 * @since 11
388 */
389declare const CalendarPickerInstance: CalendarPickerAttribute;
390