• 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/*** if arkts 1.2 */
22import { CommonShapeMethod, CommonMethod } from './common';
23import { Length } from './units';
24/*** endif */
25
26/**
27 * Defines the Shape Point, the first element is the x-axis offset and the second is the y-axis.
28 *
29 * @typedef { [Length, Length] } ShapePoint
30 * @syscap SystemCapability.ArkUI.ArkUI.Full
31 * @crossplatform
32 * @form
33 * @atomicservice
34 * @since 20
35 * @arkts 1.2
36 */
37export type ShapePoint = [Length, Length];
38
39/**
40 * Defines Line constructor options.
41 *
42 * @interface LineOptions
43 * @syscap SystemCapability.ArkUI.ArkUI.Full
44 * @crossplatform
45 * @form
46 * @atomicservice
47 * @since arkts {'1.1':'18','1.2':'20'}
48 * @arkts 1.1&1.2
49 */
50interface LineOptions {
51  /**
52   * Width of the rectangle where the line resides.
53   *
54   * @type { ?(string | number) }
55   * @syscap SystemCapability.ArkUI.ArkUI.Full
56   * @since 7
57   */
58  /**
59   * Width of the rectangle where the line resides.
60   *
61   * @type { ?(string | number) }
62   * @syscap SystemCapability.ArkUI.ArkUI.Full
63   * @form
64   * @since 9
65   */
66  /**
67   * Width of the rectangle where the line resides.
68   *
69   * @type { ?(string | number) }
70   * @syscap SystemCapability.ArkUI.ArkUI.Full
71   * @crossplatform
72   * @form
73   * @since 10
74   */
75  /**
76   * Width of the rectangle where the line resides.
77   *
78   * @type { ?(string | number) }
79   * @syscap SystemCapability.ArkUI.ArkUI.Full
80   * @crossplatform
81   * @form
82   * @atomicservice
83   * @since 11
84   */
85  /**
86   * Width of the rectangle where the line resides.
87   * Anonymous Object Rectification.
88   *
89   * @type { ?(string | number) }
90   * @syscap SystemCapability.ArkUI.ArkUI.Full
91   * @crossplatform
92   * @form
93   * @atomicservice
94   * @since 18
95   */
96  /**
97   * Width of the rectangle where the line resides.
98   *
99   * @type { ?Length }
100   * @syscap SystemCapability.ArkUI.ArkUI.Full
101   * @crossplatform
102   * @form
103   * @atomicservice
104   * @since 20
105   */
106  width?: Length;
107  /**
108   * Width of the rectangle where the line resides.
109   *
110   * @type { ?(string | number) }
111   * @syscap SystemCapability.ArkUI.ArkUI.Full
112   * @crossplatform
113   * @form
114   * @atomicservice
115   * @since 20
116   * @arkts 1.2
117   */
118  width?: string | number;
119
120  /**
121   * Height of the rectangle where the line resides.
122   *
123   * @type { ?(string | number) }
124   * @syscap SystemCapability.ArkUI.ArkUI.Full
125   * @since 7
126   */
127  /**
128   * Height of the rectangle where the line resides.
129   *
130   * @type { ?(string | number) }
131   * @syscap SystemCapability.ArkUI.ArkUI.Full
132   * @form
133   * @since 9
134   */
135  /**
136   * Height of the rectangle where the line resides.
137   *
138   * @type { ?(string | number) }
139   * @syscap SystemCapability.ArkUI.ArkUI.Full
140   * @crossplatform
141   * @form
142   * @since 10
143   */
144  /**
145   * Height of the rectangle where the line resides.
146   *
147   * @type { ?(string | number) }
148   * @syscap SystemCapability.ArkUI.ArkUI.Full
149   * @crossplatform
150   * @form
151   * @atomicservice
152   * @since 11
153   */
154  /**
155   * Height of the rectangle where the line resides.
156   * Anonymous Object Rectification.
157   *
158   * @type { ?(string | number) }
159   * @syscap SystemCapability.ArkUI.ArkUI.Full
160   * @crossplatform
161   * @form
162   * @atomicservice
163   * @since 18
164   */
165  /**
166   * Height of the rectangle where the line resides.
167   *
168   * @type { ?Length }
169   * @syscap SystemCapability.ArkUI.ArkUI.Full
170   * @crossplatform
171   * @form
172   * @atomicservice
173   * @since 20
174   */
175  height?: Length;
176  /**
177   * Height of the rectangle where the line resides.
178   *
179   * @type { ?(string | number) }
180   * @syscap SystemCapability.ArkUI.ArkUI.Full
181   * @crossplatform
182   * @form
183   * @atomicservice
184   * @since 20
185   * @arkts 1.2
186   */
187  height?: string | number;
188}
189
190/**
191 * Line drawing component.
192 *
193 * @interface LineInterface
194 * @syscap SystemCapability.ArkUI.ArkUI.Full
195 * @since 7
196 */
197/**
198 * Line drawing component.
199 *
200 * @interface LineInterface
201 * @syscap SystemCapability.ArkUI.ArkUI.Full
202 * @form
203 * @since 9
204 */
205/**
206 * Line drawing component.
207 *
208 * @interface LineInterface
209 * @syscap SystemCapability.ArkUI.ArkUI.Full
210 * @crossplatform
211 * @form
212 * @since 10
213 */
214/**
215 * Line drawing component.
216 *
217 * @interface LineInterface
218 * @syscap SystemCapability.ArkUI.ArkUI.Full
219 * @crossplatform
220 * @form
221 * @atomicservice
222 * @since 11
223 */
224interface LineInterface {
225  /**
226   * Uses new to create the line.
227   * width: Width of the rectangle where the line resides..
228   * height: Height of the rectangle where the line resides.
229   *
230   * @param { object } value
231   * @returns { LineAttribute }
232   * @syscap SystemCapability.ArkUI.ArkUI.Full
233   * @since 7
234   */
235  /**
236   * Uses new to create the line.
237   * width: Width of the rectangle where the line resides..
238   * height: Height of the rectangle where the line resides.
239   *
240   * @param { object } value
241   * @returns { LineAttribute }
242   * @syscap SystemCapability.ArkUI.ArkUI.Full
243   * @form
244   * @since 9
245   */
246  /**
247   * Uses new to create the line.
248   * width: Width of the rectangle where the line resides..
249   * height: Height of the rectangle where the line resides.
250   *
251   * @param { object } value
252   * @returns { LineAttribute }
253   * @syscap SystemCapability.ArkUI.ArkUI.Full
254   * @crossplatform
255   * @form
256   * @since 10
257   */
258  /**
259   * Uses new to create the line.
260   * width: Width of the rectangle where the line resides..
261   * height: Height of the rectangle where the line resides.
262   *
263   * @param { object } value
264   * @returns { LineAttribute }
265   * @syscap SystemCapability.ArkUI.ArkUI.Full
266   * @crossplatform
267   * @form
268   * @atomicservice
269   * @since 11
270   */
271  /**
272   * Uses new to create the line.
273   * Anonymous Object Rectification.
274   *
275   * @param { LineOptions } [options] - Line options
276   * @returns { LineAttribute }
277   * @syscap SystemCapability.ArkUI.ArkUI.Full
278   * @crossplatform
279   * @form
280   * @atomicservice
281   * @since 18
282   */
283  new (options?: LineOptions): LineAttribute;
284
285  /**
286   * The return value of the parameter is Line.
287   * width: Width of the rectangle where the line resides..
288   * height: Height of the rectangle where the line resides.
289   *
290   * @param { object } value
291   * @returns { LineAttribute }
292   * @syscap SystemCapability.ArkUI.ArkUI.Full
293   * @since 7
294   */
295  /**
296   * The return value of the parameter is Line.
297   * width: Width of the rectangle where the line resides..
298   * height: Height of the rectangle where the line resides.
299   *
300   * @param { object } value
301   * @returns { LineAttribute }
302   * @syscap SystemCapability.ArkUI.ArkUI.Full
303   * @form
304   * @since 9
305   */
306  /**
307   * The return value of the parameter is Line.
308   * width: Width of the rectangle where the line resides..
309   * height: Height of the rectangle where the line resides.
310   *
311   * @param { object } value
312   * @returns { LineAttribute }
313   * @syscap SystemCapability.ArkUI.ArkUI.Full
314   * @crossplatform
315   * @form
316   * @since 10
317   */
318  /**
319   * The return value of the parameter is Line.
320   * width: Width of the rectangle where the line resides..
321   * height: Height of the rectangle where the line resides.
322   *
323   * @param { object } value
324   * @returns { LineAttribute }
325   * @syscap SystemCapability.ArkUI.ArkUI.Full
326   * @crossplatform
327   * @form
328   * @atomicservice
329   * @since 11
330   */
331  /**
332   * The return value of the parameter is Line.
333   * Anonymous Object Rectification.
334   *
335   * @param { LineOptions } [options] - Line options
336   * @returns { LineAttribute }
337   * @syscap SystemCapability.ArkUI.ArkUI.Full
338   * @crossplatform
339   * @form
340   * @atomicservice
341   * @since 18
342   */
343  (options?: LineOptions): LineAttribute;
344}
345
346/**
347 * inheritance CommonShapeMethod.
348 *
349 * @extends CommonShapeMethod<LineAttribute>
350 * @syscap SystemCapability.ArkUI.ArkUI.Full
351 * @since 7
352 */
353/**
354 * inheritance CommonShapeMethod.
355 *
356 * @extends CommonShapeMethod<LineAttribute>
357 * @syscap SystemCapability.ArkUI.ArkUI.Full
358 * @form
359 * @since 9
360 */
361/**
362 * inheritance CommonShapeMethod.
363 *
364 * @extends CommonShapeMethod<LineAttribute>
365 * @syscap SystemCapability.ArkUI.ArkUI.Full
366 * @crossplatform
367 * @form
368 * @since 10
369 */
370/**
371 * inheritance CommonShapeMethod.
372 *
373 * @extends CommonShapeMethod<LineAttribute>
374 * @syscap SystemCapability.ArkUI.ArkUI.Full
375 * @crossplatform
376 * @form
377 * @atomicservice
378 * @since arkts {'1.1':'11','1.2':'20'}
379 * @arkts 1.1&1.2
380 */
381declare class LineAttribute extends CommonShapeMethod<LineAttribute> {
382  /**
383   * Coordinate of the start point of the line (relative coordinate).
384   *
385   * @param { Array<any> } value
386   * @returns { LineAttribute }
387   * @syscap SystemCapability.ArkUI.ArkUI.Full
388   * @since 7
389   */
390  /**
391   * Coordinate of the start point of the line (relative coordinate).
392   *
393   * @param { Array<any> } value
394   * @returns { LineAttribute }
395   * @syscap SystemCapability.ArkUI.ArkUI.Full
396   * @form
397   * @since 9
398   */
399  /**
400   * Coordinate of the start point of the line (relative coordinate).
401   *
402   * @param { Array<any> } value
403   * @returns { LineAttribute }
404   * @syscap SystemCapability.ArkUI.ArkUI.Full
405   * @crossplatform
406   * @form
407   * @since 10
408   */
409  /**
410   * Coordinate of the start point of the line (relative coordinate).
411   *
412   * @param { Array<any> } value
413   * @returns { LineAttribute }
414   * @syscap SystemCapability.ArkUI.ArkUI.Full
415   * @crossplatform
416   * @form
417   * @atomicservice
418   * @since 11
419   */
420  startPoint(value: Array<any>): LineAttribute;
421
422  /**
423   * Coordinate of the start point of the line (relative coordinate).
424   *
425   * @param { ShapePoint } value
426   * @returns { LineAttribute }
427   * @syscap SystemCapability.ArkUI.ArkUI.Full
428   * @crossplatform
429   * @form
430   * @atomicservice
431   * @since 20
432   * @arkts 1.2
433   */
434  startPoint(value: ShapePoint): LineAttribute;
435
436  /**
437   * Line end coordinates (relative coordinates).
438   *
439   * @param { Array<any> } value
440   * @returns { LineAttribute }
441   * @syscap SystemCapability.ArkUI.ArkUI.Full
442   * @since 7
443   */
444  /**
445   * Line end coordinates (relative coordinates).
446   *
447   * @param { Array<any> } value
448   * @returns { LineAttribute }
449   * @syscap SystemCapability.ArkUI.ArkUI.Full
450   * @form
451   * @since 9
452   */
453  /**
454   * Line end coordinates (relative coordinates).
455   *
456   * @param { Array<any> } value
457   * @returns { LineAttribute }
458   * @syscap SystemCapability.ArkUI.ArkUI.Full
459   * @crossplatform
460   * @form
461   * @since 10
462   */
463  /**
464   * Line end coordinates (relative coordinates).
465   *
466   * @param { Array<any> } value
467   * @returns { LineAttribute }
468   * @syscap SystemCapability.ArkUI.ArkUI.Full
469   * @crossplatform
470   * @form
471   * @atomicservice
472   * @since 11
473   */
474  endPoint(value: Array<any>): LineAttribute;
475
476  /**
477   * Line end coordinates (relative coordinates).
478   *
479   * @param { ShapePoint } value
480   * @returns { LineAttribute }
481   * @syscap SystemCapability.ArkUI.ArkUI.Full
482   * @crossplatform
483   * @form
484   * @atomicservice
485   * @since 20
486   * @arkts 1.2
487   */
488  endPoint(value: ShapePoint): LineAttribute;
489}
490
491/**
492 * Defines Line Component.
493 *
494 * @syscap SystemCapability.ArkUI.ArkUI.Full
495 * @since 7
496 */
497/**
498 * Defines Line Component.
499 *
500 * @syscap SystemCapability.ArkUI.ArkUI.Full
501 * @form
502 * @since 9
503 */
504/**
505 * Defines Line Component.
506 *
507 * @syscap SystemCapability.ArkUI.ArkUI.Full
508 * @crossplatform
509 * @form
510 * @since 10
511 */
512/**
513 * Defines Line Component.
514 *
515 * @syscap SystemCapability.ArkUI.ArkUI.Full
516 * @crossplatform
517 * @form
518 * @atomicservice
519 * @since 11
520 */
521declare const Line: LineInterface;
522
523/**
524 * Defines Line Component instance.
525 *
526 * @syscap SystemCapability.ArkUI.ArkUI.Full
527 * @since 7
528 */
529/**
530 * Defines Line Component instance.
531 *
532 * @syscap SystemCapability.ArkUI.ArkUI.Full
533 * @form
534 * @since 9
535 */
536/**
537 * Defines Line Component instance.
538 *
539 * @syscap SystemCapability.ArkUI.ArkUI.Full
540 * @crossplatform
541 * @form
542 * @since 10
543 */
544/**
545 * Defines Line Component instance.
546 *
547 * @syscap SystemCapability.ArkUI.ArkUI.Full
548 * @crossplatform
549 * @form
550 * @atomicservice
551 * @since 11
552 */
553declare const LineInstance: LineAttribute;
554
555/**
556 * Line drawing component.
557 *
558 * @interface LineInterface
559 * @syscap SystemCapability.ArkUI.ArkUI.Full
560 * @crossplatform
561 * @form
562 * @atomicservice
563 * @since 20
564 * @arkts 1.2
565 */
566interface LineInterface {
567  /**
568   * The return value of the parameter is Line.
569   *
570   * @param { LineOptions } [options] - Line options
571   * @returns { LineAttribute }
572   * @syscap SystemCapability.ArkUI.ArkUI.Full
573   * @crossplatform
574   * @form
575   * @atomicservice
576   * @since 20
577   * @arkts 1.2
578   */
579  (options?: LineOptions): LineAttribute;
580}
581