From 8479c04c2f49b6744f8cfedfc43d42c064d938f2 Mon Sep 17 00:00:00 2001 From: lixinnan Date: Sun, 16 Feb 2025 19:05:46 +0800 Subject: [PATCH] fix interface Signed-off-by: lixinnan Change-Id: Ic4299845f8c23eb6e31278b3b1f2274c5c142f65 --- api/@ohos.arkui.component.Blank.d.ets | 210 +++ api/@ohos.arkui.component.Column.d.ets | 320 ++++ api/@ohos.arkui.component.Divider.d.ets | 334 ++++ api/@ohos.arkui.component.Flex.d.ets | 445 ++++++ api/@ohos.arkui.component.Grid.d.ets | 1372 +++++++++++++++++ ...os.arkui.component.RelativeContainer.d.ets | 429 ++++++ api/@ohos.arkui.component.Row.d.ets | 320 ++++ api/@ohos.arkui.component.Stack.d.ets | 260 ++++ 8 files changed, 3690 insertions(+) create mode 100644 api/@ohos.arkui.component.Blank.d.ets create mode 100644 api/@ohos.arkui.component.Column.d.ets create mode 100644 api/@ohos.arkui.component.Divider.d.ets create mode 100644 api/@ohos.arkui.component.Flex.d.ets create mode 100644 api/@ohos.arkui.component.Grid.d.ets create mode 100644 api/@ohos.arkui.component.RelativeContainer.d.ets create mode 100644 api/@ohos.arkui.component.Row.d.ets create mode 100644 api/@ohos.arkui.component.Stack.d.ets diff --git a/api/@ohos.arkui.component.Blank.d.ets b/api/@ohos.arkui.component.Blank.d.ets new file mode 100644 index 0000000000..5297a4edd2 --- /dev/null +++ b/api/@ohos.arkui.component.Blank.d.ets @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + */ + +import { CommonMethod } from './@ohos.arkui.component.Common'; +import { ResourceColor } from './@ohos.arkui.component.Units'; + +/** + * Create Blank. + * + * @interface BlankInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Create Blank. + * + * @interface BlankInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Create Blank. + * + * @interface BlankInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Create Blank. + * + * @interface BlankInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +/** + * Create Blank. + * + * @typedef BlankInterface + * @param { ?number | ?string } min + * @returns { BlankAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +export type BlankInterface = (min?: number | string) => BlankAttribute; + +/** + * Inheritance CommonMethod Set Styles + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Inheritance CommonMethod Set Styles + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Inheritance CommonMethod Set Styles + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Inheritance CommonMethod Set Styles + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare class BlankAttribute extends CommonMethod { + /** + * color: set color. + * + * @param { ResourceColor } value + * @returns { BlankAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * color: set color. + * + * @param { ResourceColor } value + * @returns { BlankAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * color: set color. + * + * @param { ResourceColor } value + * @returns { BlankAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * color: set color. + * + * @param { ResourceColor } value + * @returns { BlankAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color(value: ResourceColor): BlankAttribute; +} + +/** + * Defines Blank Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Blank Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Blank Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Blank Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare const Blank: BlankInterface; + +/** + * Defines Blank Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Blank Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Blank Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Blank Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare const BlankInstance: BlankAttribute; diff --git a/api/@ohos.arkui.component.Column.d.ets b/api/@ohos.arkui.component.Column.d.ets new file mode 100644 index 0000000000..b5256a1664 --- /dev/null +++ b/api/@ohos.arkui.component.Column.d.ets @@ -0,0 +1,320 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + */ + +import { PointLightStyle, CommonMethod, Optional } from './@ohos.arkui.component.Common'; +import { HorizontalAlign, FlexAlign } from './@ohos.arkui.component.Enums'; + +/** + * Column constructor options. + * + * @interface ColumnOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +export interface ColumnOptions { + /** + * Vertical layout element spacing + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Vertical layout element spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Vertical layout element spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Vertical layout element spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + space?: string | number; +} + +/** + * Defines the Column Component. + * + * @interface ColumnInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Column Component. + * + * @interface ColumnInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Column Component. + * + * @interface ColumnInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Column Component. + * + * @interface ColumnInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +/** + * Defines the Column Component. + * + * @typedef { function } ColumnInterface + * @param { ?ColumnOptions } options - column options + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +export type ColumnInterface = (options?: ColumnOptions) => ColumnAttribute; + +/** + * Defines the Column component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Column component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Column component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Column component attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare class ColumnAttribute extends CommonMethod { + /** + * Sets the alignment format of the subassembly in the horizontal direction. + * + * @param { HorizontalAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the alignment format of the subassembly in the horizontal direction. + * + * @param { HorizontalAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the alignment format of the subassembly in the horizontal direction. + * + * @param { HorizontalAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the alignment format of the subassembly in the horizontal direction. + * + * @param { HorizontalAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignItems(value: HorizontalAlign): ColumnAttribute; + + /** + * Sets the alignment format of the subassembly in the vertical direction. + * + * @param { FlexAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the alignment format of the subassembly in the vertical direction. + * + * @param { FlexAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the alignment format of the subassembly in the vertical direction. + * + * @param { FlexAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the alignment format of the subassembly in the vertical direction. + * + * @param { FlexAlign } value + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + justifyContent(value: FlexAlign): ColumnAttribute; + /** + * Defines the PointLight + * + * @param { PointLightStyle } value - The point light style. + * @returns { ColumnAttribute } The attribute of the column. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + pointLight(value: PointLightStyle): ColumnAttribute; + /** + * Called when the Main-Axis's direction is set reversed or not + * + * @param { Optional } isReversed - If the main axis is reversed. + * @returns { ColumnAttribute } The attribute of the column. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + reverse(isReversed: Optional): ColumnAttribute; +} + +/** + * Defines Column Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Column Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Column Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Column Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare const Column: ColumnInterface; + +/** + * Defines Column Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Column Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Column Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Column Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare const ColumnInstance: ColumnAttribute; diff --git a/api/@ohos.arkui.component.Divider.d.ets b/api/@ohos.arkui.component.Divider.d.ets new file mode 100644 index 0000000000..3f1c2ae30b --- /dev/null +++ b/api/@ohos.arkui.component.Divider.d.ets @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + */ + +import { CommonMethod } from './@ohos.arkui.component.Common'; +import { ResourceColor } from './@ohos.arkui.component.Units'; +import { LineCapStyle } from './@ohos.arkui.component.Enums'; + +/** + * Provides a divider component to separate different content blocks/content elements. + * + * @interface DividerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides a divider component to separate different content blocks/content elements. + * + * @interface DividerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides a divider component to separate different content blocks/content elements. + * + * @interface DividerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides a divider component to separate different content blocks/content elements. + * + * @interface DividerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +/** + * Provides a divider component to separate different content blocks/content elements. + * + * @typedef { function } DividerInterface + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +export type DividerInterface = () => DividerAttribute; + +/** + * Defines the Divider attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Divider attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Divider attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Divider attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare class DividerAttribute extends CommonMethod { + /** + * Indicates whether to use a horizontal splitter or a vertical splitter. + * The options are as follows: false: horizontal splitter; true: vertical splitter. + * + * @param { boolean } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicates whether to use a horizontal splitter or a vertical splitter. + * The options are as follows: false: horizontal splitter; true: vertical splitter. + * + * @param { boolean } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicates whether to use a horizontal splitter or a vertical splitter. + * The options are as follows: false: horizontal splitter; true: vertical splitter. + * + * @param { boolean } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicates whether to use a horizontal splitter or a vertical splitter. + * The options are as follows: false: horizontal splitter; true: vertical splitter. + * + * @param { boolean } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + vertical(value: boolean): DividerAttribute; + + /** + * Sets the color of the divider line. + * + * @param { ResourceColor } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the color of the divider line. + * + * @param { ResourceColor } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the color of the divider line. + * + * @param { ResourceColor } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the color of the divider line. + * + * @param { ResourceColor } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color(value: ResourceColor): DividerAttribute; + + /** + * Sets the width of the dividing line. + * + * @param { number | string } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the width of the dividing line. + * + * @param { number | string } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the width of the dividing line. + * + * @param { number | string } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the width of the dividing line. + * + * @param { number | string } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeWidth(value: number | string): DividerAttribute; + + /** + * Sets the end style of the split line. The default value is Butt. + * + * @param { LineCapStyle } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the end style of the split line. The default value is Butt. + * + * @param { LineCapStyle } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the end style of the split line. The default value is Butt. + * + * @param { LineCapStyle } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the end style of the split line. The default value is Butt. + * + * @param { LineCapStyle } value + * @returns { DividerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + lineCap(value: LineCapStyle): DividerAttribute; +} + +/** + * Defines Divider Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Divider Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Divider Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Divider Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare const Divider: DividerInterface; + +/** + * Defines Divider Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Divider Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Divider Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Divider Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare const DividerInstance: DividerAttribute; diff --git a/api/@ohos.arkui.component.Flex.d.ets b/api/@ohos.arkui.component.Flex.d.ets new file mode 100644 index 0000000000..a25fc49427 --- /dev/null +++ b/api/@ohos.arkui.component.Flex.d.ets @@ -0,0 +1,445 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + */ + +import { CommonMethod, PointLightStyle } from './@ohos.arkui.component.Common'; +import { FlexDirection, FlexWrap, FlexAlign } from './@ohos.arkui.component.Enums'; +import { LengthMetrics } from './@ohos.arkui.component.Units'; + +/** + * Defines the options of Flex. + * + * @interface FlexOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the options of Flex. + * + * @interface FlexOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the options of Flex. + * + * @interface FlexOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the options of Flex. + * + * @interface FlexOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export interface FlexOptions { + /** + * Sets the horizontal layout of elements. + * + * @type { ?FlexDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the horizontal layout of elements. + * + * @type { ?FlexDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the horizontal layout of elements. + * + * @type { ?FlexDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the horizontal layout of elements. + * + * @type { ?FlexDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + direction?: FlexDirection; + + /** + * Whether the Flex container is a single row/column arrangement or a multi-row/column arrangement. + * + * @type { ?FlexWrap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Whether the Flex container is a single row/column arrangement or a multi-row/column arrangement. + * + * @type { ?FlexWrap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Whether the Flex container is a single row/column arrangement or a multi-row/column arrangement. + * + * @type { ?FlexWrap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Whether the Flex container is a single row/column arrangement or a multi-row/column arrangement. + * + * @type { ?FlexWrap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + wrap?: FlexWrap; + + /** + * The alignment format of the subassembly on the Flex container spindle. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The alignment format of the subassembly on the Flex container spindle. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The alignment format of the subassembly on the Flex container spindle. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The alignment format of the subassembly on the Flex container spindle. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + justifyContent?: FlexAlign; + + /** + * Alignment Format for Subassembly on Flex Container Cross Axis. + * + * @type { ?ItemAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Alignment Format for Subassembly on Flex Container Cross Axis. + * + * @type { ?ItemAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Alignment Format for Subassembly on Flex Container Cross Axis. + * + * @type { ?ItemAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Alignment Format for Subassembly on Flex Container Cross Axis. + * + * @type { ?ItemAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignItems?: ItemAlign; + + /** + * The alignment of multiple lines of content when there is extra space in the cross axis. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The alignment of multiple lines of content when there is extra space in the cross axis. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * The alignment of multiple lines of content when there is extra space in the cross axis. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * The alignment of multiple lines of content when there is extra space in the cross axis. + * + * @type { ?FlexAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignContent?: FlexAlign; + + /** + * The space to be inserted, either horizontally or vertically, + * between two adjacent components in the Flex container. + * + * @type { ?FlexSpaceOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + space?: FlexSpaceOptions; +} + +/** + * The space to be inserted, either horizontally or vertically, + * between two adjacent components in the Flex container. + * + * @interface FlexSpaceOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + +export interface FlexSpaceOptions { + /** + * Defines the main space property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + main?: LengthMetrics; + + /** + * Defines the cross space property. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + cross?: LengthMetrics; +} + +/** + * Provides a monthly view component to display information such as date, shift break, and schedule. + * + * @interface FlexInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides a monthly view component to display information such as date, shift break, and schedule. + * + * @interface FlexInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides a monthly view component to display information such as date, shift break, and schedule. + * + * @interface FlexInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides a monthly view component to display information such as date, shift break, and schedule. + * + * @interface FlexInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +/** + * Provides a monthly view component to display information such as date, shift break, and schedule. + * + * @typedef { function } FlexInterface + * @param { ?FlexOptions } value + * @returns { FlexAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +export type FlexInterface = (value?: FlexOptions) => FlexAttribute; + +/** + * Defines the Flex attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the Flex attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the Flex attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the Flex attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare class FlexAttribute extends CommonMethod { + /** + * Defines the PointLight + * + * @param { PointLightStyle } value - The point light style. + * @returns { FlexAttribute } The attribute of the flex. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + pointLight(value: PointLightStyle): FlexAttribute; +} + +/** + * Defines Flex Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Flex Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Flex Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Flex Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare const Flex: FlexInterface; + +/** + * Defines Flex Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Flex Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Flex Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Flex Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare const FlexInstance: FlexAttribute; diff --git a/api/@ohos.arkui.component.Grid.d.ets b/api/@ohos.arkui.component.Grid.d.ets new file mode 100644 index 0000000000..0ccb303070 --- /dev/null +++ b/api/@ohos.arkui.component.Grid.d.ets @@ -0,0 +1,1372 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + */ + +import { ScrollableCommonMethod, EdgeEffectOptions, NestedScrollOptions, ItemDragInfo, Optional } from './@ohos.arkui.component.Common'; +import { Length, Resource } from './@ohos.arkui.component.Units'; +import { Scroller } from './@ohos.arkui.component.Scroll'; +import { Color, BarState, EdgeEffect, ScrollState } from './@ohos.arkui.component.Enums'; + +/** + * The options to help grid layout + * + * @interface GridLayoutOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The options to help grid layout + * + * @interface GridLayoutOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +export interface GridLayoutOptions { + /** + * The size of most grid items, in [rows, columns], generally [1, 1] + * + * @type { [number, number] } regularSize + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The size of most grid items, in [rows, columns], generally [1, 1] + * + * @type { [number, number] } regularSize + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + regularSize: [number, number]; + + /** + * The indexes of grid items with irregular size. + * + * @type { ?number[] } irregularIndexes + * @default number[] no irregular grid item + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The indexes of grid items with irregular size. + * + * @type { ?number[] } irregularIndexes + * @default number[] no irregular grid item + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + irregularIndexes?: number[]; + + /** + * Called to return the size of the irregular grid items with the specified index in [rows, columns]. + * + * @type { ?function } onGetIrregularSizeByIndex, + * all irregular grid items will occupy an entire line if not set + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called to return the size of the irregular grid items with the specified index in [rows, columns]. + * + * @type { ?function } onGetIrregularSizeByIndex, + * all irregular grid items will occupy an entire line if not set + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onGetIrregularSizeByIndex?: (index: number) => [number, number] + + /** + * Called to return the size of the grid items with the specified index in + * [rowStart, columnStart, rowSpan, columnSpan]. + * + * @type { ?function } onGetRectByIndex + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Called to return the size of the grid items with the specified index in + * [rowStart, columnStart, rowSpan, columnSpan]. + * + * @type { ?function } onGetRectByIndex + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + onGetRectByIndex?: (index: number) => [number, number, number, number] +} + +/** + * Defines the grid interface. + * + * @interface GridInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the grid interface. + * + * @interface GridInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the grid interface. + * + * @interface GridInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +/** + * Defines the grid interface. + * + * @typedef { function } GridInterface + * @param { ?Scroller } scroller - Controller bound to the grid + * @param { ?GridLayoutOptions } layoutOptions - The options to help grid layout + * @returns { GridAttribute } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ +export type GridInterface = (scroller?: Scroller, layoutOptions?: GridLayoutOptions) => GridAttribute; + +/** + * The enum of property layoutDirection + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +/** + * The enum of property layoutDirection + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The enum of property layoutDirection + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +export declare enum GridDirection { + /** + * The row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Row, + + /** + * The column direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The column direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The column direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + Column, + + /** + * The row reverse direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The row reverse direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The row reverse direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + RowReverse, + + /** + * The column reverse direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The column reverse direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The column reverse direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + ColumnReverse, +} + +/** + * Declare grid item alignment status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +export declare enum GridItemAlignment { + + /** + * Use the default alignment of the Grid. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + DEFAULT = 0, + + /** + * The height of the tallest grid item in the current line + * will be used as the height for the other items in the same line + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + STRETCH = 1, +} + +/** + * The attribute of scrollbar to compute scrollbar position and height. + * + * @interface ComputedBarAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * The attribute of scrollbar to compute scrollbar position and height. + * + * @interface ComputedBarAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +export interface ComputedBarAttribute { + /** + * The offset of the grid. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The offset of the grid. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + totalOffset: number; + + /** + * The range of the grid. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The range of the grid. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + totalLength: number; +} + +/** + * Defines the grid attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the grid attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines the grid attribute functions. + * + * @extends ScrollableCommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +export declare class GridAttribute extends ScrollableCommonMethod { + /** + * This parameter specifies the number of columns in the current grid layout. + * + * @param { string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * This parameter specifies the number of columns in the current grid layout. + * + * @param { string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This parameter specifies the number of columns in the current grid layout. + * + * @param { string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + columnsTemplate(value: string): GridAttribute; + + /** + * Lets you set the number of rows in the current grid layout, + * + * @param { string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Lets you set the number of rows in the current grid layout, + * + * @param { string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Lets you set the number of rows in the current grid layout, + * + * @param { string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + rowsTemplate(value: string): GridAttribute; + + /** + * Allows you to set the spacing between columns. + * + * @param { Length } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Allows you to set the spacing between columns. + * + * @param { Length } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Allows you to set the spacing between columns. + * + * @param { Length } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + columnsGap(value: Length): GridAttribute; + + /** + * Lets you set the spacing between rows. + * + * @param { Length } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Lets you set the spacing between rows. + * + * @param { Length } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Lets you set the spacing between rows. + * + * @param { Length } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + rowsGap(value: Length): GridAttribute; + + /** + * This parameter specifies the width of the scroll bar. + * + * @param { number | string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * This parameter specifies the width of the scroll bar. + * + * @param { number | string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * This parameter specifies the width of the scroll bar. + * + * @param { number | string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBarWidth(value: number | string): GridAttribute; + + /** + * Sets the color of the scroll bar. + * + * @param { Color | number | string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the color of the scroll bar. + * + * @param { Color | number | string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Sets the color of the scroll bar. + * + * @param { Color | number | string } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBarColor(value: Color | number | string): GridAttribute; + + /** + * Lets you set the spacing between rows. + * + * @param { BarState } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Lets you set the spacing between rows. + * + * @param { BarState } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Lets you set the spacing between rows. + * + * @param { BarState } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + scrollBar(value: BarState): GridAttribute; + + /** + * Set scrollbar position. + * + * @param { function } event - callback of grid scroll, + * index is the current first displayed item, offset is the grid offset, + * return ComputedBarAttribute to update scrollbar position and height. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Set scrollbar position. + * + * @param { function } event - callback of grid scroll, + * index is the current first displayed item, offset is the grid offset, + * return ComputedBarAttribute to update scrollbar position and height. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollBarUpdate(event: (index: number, offset: number) => ComputedBarAttribute): GridAttribute; + + /** + * Called when the first item displayed in the grid changes. + * + * @param { function } event - of grid scroll, + * first is the index of the first item of the grid. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the first or last item displayed in the grid changes. + * + * @param { function } event - of grid scroll, + * first is the index of the first item displayed in the grid, + * last is the index of the last item displayed in the grid. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the first or last item displayed in the grid changes. + * + * @param { function } event - of grid scroll, + * first is the index of the first item displayed in the grid, + * last is the index of the last item displayed in the grid. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollIndex(event: (first: number, last: number) => void): GridAttribute; + + /** + * cached Count + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * cached Count + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * cached Count + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + cachedCount(value: number): GridAttribute; + + /** + * Called to set number of GridItems to be preloaded (cached) in LazyForEach / Repeat. + * @param { number } count - number of GridItems to be preloaded (cached). + * @param { boolean } show - if true, cached items are displayed when clip is disabled. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + cachedCount(count: number, show: boolean): GridAttribute; + + /** + * editMode + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * editMode + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * editMode + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + editMode(value: boolean): GridAttribute; + + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + multiSelectable(value: boolean): GridAttribute; + + /** + * maxCount + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * maxCount + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * maxCount + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + maxCount(value: number): GridAttribute; + + /** + * minCount + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * minCount + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * minCount + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + minCount(value: number): GridAttribute; + + /** + * cellLength + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * cellLength + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * cellLength + * + * @param { number } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + cellLength(value: number): GridAttribute; + + /** + * Control GridDirection of the grid. + * + * @param { GridDirection } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Control GridDirection of the grid. + * + * @param { GridDirection } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Control GridDirection of the grid. + * + * @param { GridDirection } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + layoutDirection(value: GridDirection): GridAttribute; + + /** + * Control if the grid supports animation. + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Control if the grid supports animation. + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Control if the grid supports animation. + * + * @param { boolean } value + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + supportAnimation(value: boolean): GridAttribute; + + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragStart(event: onItemDragStartOptions): GridAttribute; + + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragEnter(event: (event: ItemDragInfo) => void): GridAttribute; + + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragMove(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number) => void): GridAttribute; + + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDragLeave(event: (event: ItemDragInfo, itemIndex: number) => void): GridAttribute; + + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onItemDrop( + event: (event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void, + ): GridAttribute; + + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } value - Scroll effect. For details, see EdgeEffect. + * @returns { GridAttribute } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect } value + * @param { EdgeEffectOptions } options + * @returns { GridAttribute } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + edgeEffect(value: EdgeEffect, options?: EdgeEffectOptions): GridAttribute; + + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { GridAttribute } the attribute of the grid. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions } value - options for nested scrolling. + * @returns { GridAttribute } the attribute of the grid. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + nestedScroll(value: NestedScrollOptions): GridAttribute; + + /** + * Called when setting whether to enable scroll by gesture or mouse. + * + * @param { boolean } value + * @returns { GridAttribute } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when setting whether to enable scroll by gesture or mouse. + * + * @param { boolean } value + * @returns { GridAttribute } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enableScrollInteraction(value: boolean): GridAttribute; + + /** + * Called to setting the friction. + * + * @param { number | Resource } value - options for scrolling friction. + * @returns { GridAttribute } the attribute of the grid. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called to setting the friction. + * + * @param { number | Resource } value - options for scrolling friction. + * @returns { GridAttribute } the attribute of the grid. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + friction(value: number | Resource): GridAttribute; + + /** + * Set the alignment of grid items. + * + * @param { Optional } alignment - Items alignment + * @returns { GridAttribute } The attribute of the grid. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + alignItems(alignment: Optional): GridAttribute; + + /** + * Called When sliding the grid. + * + * @param { function } event - callback of grid scroll, + * scrollOffset is offset per frame scrolling, ScrollState is current sliding state. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called When sliding the grid. + * + * @param { function } event - callback of grid scroll, + * scrollOffset is offset per frame scrolling, ScrollState is current sliding state. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @deprecated since 12 + * @useinstead common.ScrollableCommonMethod#onDidScroll + */ + onScroll(event: (scrollOffset: number, scrollState: ScrollState) => void): GridAttribute; + + /** + * Called when the grid begins to arrive. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the grid begins to arrive. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onReachStart(event: () => void): GridAttribute; + + /** + * Called when the grid reaches the end. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the grid reaches the end. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onReachEnd(event: () => void): GridAttribute; + + /** + * Called when the slider start. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the slider start. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollStart(event: () => void): GridAttribute; + + /** + * Called when the slider stops. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when the slider stops. + * + * @param { function } event + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollStop(event: () => void): GridAttribute; + + /** + * Called when scrolling begin each frame. + * + * @param { function } event - callback of grid scroll, + * offset is the amount of sliding that is about to occur, state is current sliding state, + * return number to actual sliding offset. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Called when scrolling begin each frame. + * + * @param { function } event - callback of grid scroll, + * offset is the amount of sliding that is about to occur, state is current sliding state, + * return number to actual sliding offset. + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + onScrollFrameBegin(event: onScrollFrameBeginOptions): GridAttribute; +} + +/** + * onItemDragStart param. + * + * @typedef { function } onItemDragStartOptions + * @param { ItemDragInfo } event + * @param { number } itemIndex + * @returns { (() => any) | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ +export type onItemDragStartOptions = (event: ItemDragInfo, itemIndex: number) => (() => any) | undefined; + +/** + * onScrollFrameBegin param. + * + * @typedef { function } onScrollFrameBeginOptions + * @param { number } offset + * @param { ScrollState } state + * @returns { onScrollFrameBeginOffsetRemain } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ +export type onScrollFrameBeginOptions = (offset: number, state: ScrollState) => onScrollFrameBeginOffsetRemain; + +/** + * onScrollFrameBegin param. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 16 + */ +export class onScrollFrameBeginOffsetRemain { + static offsetRemain: number; +} + +/** + * Defines Grid Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Grid Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Grid Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +export declare const Grid: GridInterface; + +/** + * Defines Grid Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Grid Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Defines Grid Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +export declare const GridInstance: GridAttribute; diff --git a/api/@ohos.arkui.component.RelativeContainer.d.ets b/api/@ohos.arkui.component.RelativeContainer.d.ets new file mode 100644 index 0000000000..dc5e68f119 --- /dev/null +++ b/api/@ohos.arkui.component.RelativeContainer.d.ets @@ -0,0 +1,429 @@ +/* + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + */ + +import { CommonMethod } from './@ohos.arkui.component.Common'; +import { Dimension } from './@ohos.arkui.component.Units'; +import { Axis } from './@ohos.arkui.component.Enums'; + +/** + * Provides ports for relative containers. + * + * @interface RelativeContainerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides ports for relative containers. + * + * @interface RelativeContainerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides ports for relative containers. + * + * @interface RelativeContainerInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +/** + * Provides ports for relative containers. + * + * @typedef { function } RelativeContainerInterface + * @returns { RelativeContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +export type RelativeContainerInterface = () => RelativeContainerAttribute; + +/** + * Specifies the position of guideLine + * + * @interface GuideLinePosition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +export interface GuideLinePosition { + /** + * Specifies the distance to start of container + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + start? : Dimension; + + /** + * Specifies the distance to end of container + * + * @type { ?Dimension } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + end? : Dimension; +} + +/** + * Specifies the GuideLineStyle of relative container + * + * @interface GuideLineStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +export interface GuideLineStyle { + /** + * Specifies the id of guideLine + * + * @type {string} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + id : string; + + /** + * Specifies the direction of guideLine + * + * @type {Axis} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + direction : Axis; + + /** + * Specifies the position of guideLine + * + * @type {GuideLinePosition} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + position : GuideLinePosition; +} + +/** + * Specifies the direction value of Barrier. + * + * @enum {number} + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 12 + */ +export declare enum BarrierDirection { + /** + * Barrier will be positioned to the far left of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + LEFT, + + /** + * Barrier will be positioned to the far right of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + RIGHT, + + /** + * Barrier will be positioned to the top of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TOP, + + /** + * Barrier will be positioned to the bottom of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BOTTOM, +} + +/** + * Specifies the localized direction value of Barrier. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +export declare enum LocalizedBarrierDirection { + /** + * Localized barrier will be positioned to the far start of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + START = 0, + + /** + * Localized barrier will be positioned to the far end of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + END = 1, + + /** + * Localized barrier will be positioned to the top of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TOP = 2, + + /** + * Localized barrier will be positioned to the bottom of all referenced components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BOTTOM = 3, +} + +/** + * Specifies the BarrierStyle of relative container + * + * @interface BarrierStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +export interface BarrierStyle { + /** + * Specifies the id of barrier + * + * @type {string} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + id : string; + + /** + * Specifies the direction of barrier + * + * @type {BarrierDirection} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + direction : BarrierDirection; + + /** + * Specifies the referencedId of barrier + * + * @type {Array} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + referencedId : Array; +} + +/** + * Specifies the Localized BarrierStyle of relative container + * + * @interface LocalizedBarrierStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +export interface LocalizedBarrierStyle { + /** + * Specifies the id of localized barrier + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + id : string; + + /** + * Specifies the localized barrier direction of barrier + * + * @type { LocalizedBarrierDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + localizedDirection : LocalizedBarrierDirection; + + /** + * Specifies the referencedId of localized barrier + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + referencedId : Array; +} + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare class RelativeContainerAttribute extends CommonMethod { + /** + * Specifies guideLines of relativeContainer + * + * @param { Array } value + * @returns { RelativeContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + guideLine(value: Array): RelativeContainerAttribute; + + /** + * Specifies barriers of relativeContainer + * + * @param { Array } barrierStyle + * @returns { RelativeContainerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + barrier(barrierStyleOrValue: Array | Array): RelativeContainerAttribute; +} + +/** + * RelativeContainer + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * RelativeContainer + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * RelativeContainer + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare const RelativeContainer: RelativeContainerInterface; + +/** + * RelativeContainerInstance + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * RelativeContainerInstance + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * RelativeContainerInstance + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare const RelativeContainerInstance: RelativeContainerAttribute; diff --git a/api/@ohos.arkui.component.Row.d.ets b/api/@ohos.arkui.component.Row.d.ets new file mode 100644 index 0000000000..591b538b48 --- /dev/null +++ b/api/@ohos.arkui.component.Row.d.ets @@ -0,0 +1,320 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + */ + +import { CommonMethod, SpaceType, PointLightStyle, Optional } from './@ohos.arkui.component.Common'; +import { VerticalAlign, FlexAlign } from './@ohos.arkui.component.Enums'; + +/** + * Define options used to construct a row. + * + * @interface RowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +export interface RowOptions { + /** + * Row spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Row spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Row spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Row spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + space?: string | number; +} + +/** + * The components are laid out horizontally + * + * @interface RowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * The components are laid out horizontally + * + * @interface RowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * The components are laid out horizontally + * + * @interface RowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * The components are laid out horizontally + * + * @interface RowInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +/** + * The components are laid out horizontally + * + * @typedef { function } RowInterface + * @param { ?RowOptions } options - row options + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +export type RowInterface = (options?: RowOptions) => RowAttribute; + +/** + * Defines the row attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines the row attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines the row attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines the row attribute functions. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare class RowAttribute extends CommonMethod { + /** + * Called when the vertical alignment is set. + * + * @param { VerticalAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the vertical alignment is set. + * + * @param { VerticalAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the vertical alignment is set. + * + * @param { VerticalAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the vertical alignment is set. + * + * @param { VerticalAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignItems(value: VerticalAlign): RowAttribute; + + /** + * Called when the horizontal alignment is set. + * + * @param { FlexAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Called when the horizontal alignment is set. + * + * @param { FlexAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the horizontal alignment is set. + * + * @param { FlexAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the horizontal alignment is set. + * + * @param { FlexAlign } value + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + justifyContent(value: FlexAlign): RowAttribute; + /** + * Defines the PointLight + * + * @param { PointLightStyle } value - The point light style. + * @returns { RowAttribute } The attribute of the row. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + pointLight(value: PointLightStyle): RowAttribute; + /** + * Called when the Main-Axis's direction is set reversed or not + * + * @param { Optional } isReversed - If the main axis is reversed. + * @returns { RowAttribute } The attribute of the row. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + reverse(isReversed: Optional): RowAttribute; +} + +/** + * Defines Row Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Row Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Row Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Row Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare const Row: RowInterface; + +/** + * Defines Row Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Row Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Row Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Row Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare const RowInstance: RowAttribute; diff --git a/api/@ohos.arkui.component.Stack.d.ets b/api/@ohos.arkui.component.Stack.d.ets new file mode 100644 index 0000000000..58944824e2 --- /dev/null +++ b/api/@ohos.arkui.component.Stack.d.ets @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + */ + +import { CommonMethod, PointLightStyle } from './@ohos.arkui.component.Common'; +import { Alignment } from './@ohos.arkui.component.Enums'; + +/** + * Options used to construct the stack. + * + * @interface StackOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +export interface StackOptions { + /** + * Set the alignment of sub components within the container. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the alignment of sub components within the container. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the alignment of sub components within the container. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the alignment of sub components within the container. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignContent?: Alignment; +} + +/** + * Provides ports for stacking containers. + * + * @interface StackInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Provides ports for stacking containers. + * + * @interface StackInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Provides ports for stacking containers. + * + * @interface StackInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Provides ports for stacking containers. + * + * @interface StackInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +/** + * Provides ports for stacking containers. + * + * @typedef { function } StackInterface + * @param { ?StackOptions } options - stack options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 16 + */ +export type StackInterface = (options?: StackOptions) => StackAttribute; + +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare class StackAttribute extends CommonMethod { + /** + * Called when the occupancy of items in the container is set. + * + * @param { Alignment } value + * @returns { StackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Called when the occupancy of items in the container is set. + * + * @param { Alignment } value + * @returns { StackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Called when the occupancy of items in the container is set. + * + * @param { Alignment } value + * @returns { StackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Called when the occupancy of items in the container is set. + * + * @param { Alignment } value + * @returns { StackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignContent(value: Alignment): StackAttribute; + + /** + * Defines the PointLight + * + * @param { PointLightStyle } value - The point light style. + * @returns { StackAttribute } The attribute of the stack. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + pointLight(value: PointLightStyle): StackAttribute; +} + +/** + * Defines Stack Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Stack Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Stack Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Stack Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare const Stack: StackInterface; + +/** + * Defines Stack Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ +/** + * Defines Stack Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ +/** + * Defines Stack Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ +/** + * Defines Stack Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ +export declare const StackInstance: StackAttribute; -- Gitee