diff --git a/BUILD.gn b/BUILD.gn index f471b043f89b82d0074af068e51dc437704beda3..dd8884a1bf70897cbd195a23620f70e56eaf0625 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -54,6 +54,7 @@ ohos_copy("ets_component") { "api/@internal/component/ets/ellipse.d.ts", "api/@internal/component/ets/enums.d.ts", "api/@internal/component/ets/flex.d.ts", + "api/@internal/component/ets/flow_item.d.ts", "api/@internal/component/ets/for_each.d.ts", "api/@internal/component/ets/form_component.d.ts", "api/@internal/component/ets/gauge.d.ts", @@ -116,6 +117,7 @@ ohos_copy("ets_component") { "api/@internal/component/ets/toggle.d.ts", "api/@internal/component/ets/units.d.ts", "api/@internal/component/ets/video.d.ts", + "api/@internal/component/ets/water_flow.d.ts", "api/@internal/component/ets/web.d.ts", "api/@internal/component/ets/xcomponent.d.ts", ] diff --git a/api/@internal/component/ets/flow_item.d.ts b/api/@internal/component/ets/flow_item.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..de49d0f548e58b0e3f44aadd5f228af96d653c52 --- /dev/null +++ b/api/@internal/component/ets/flow_item.d.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021-2022 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. + */ + +/** + * 瀑布流网格容器中单项内容容器. + * @since 9 + */ +interface FlowItemInterface { + /** + * 返回FlowItem. + * @since 9 + */ + (): FlowItemAttribute; +} + +/** + * FlowItem属性 + * @since 9 + */ +declare class FlowItemAttribute extends CommonMethod { + /** + * FlowItem占用行数. + * @since 9 + */ + rowSpan(value: number): FlowItemAttribute; + + /** + * FlowItem占用列数. + * @since 9 + */ + columnSpan(value: number): FlowItemAttribute; +} + +declare const FlowItem: FlowItemInterface +declare const FlowItemInstance: FlowItemAttribute; diff --git a/api/@internal/component/ets/index-full.d.ts b/api/@internal/component/ets/index-full.d.ts index 49f67636a8d844da42addaa171a020969a9b1fd1..422d29078831938268723cccf797f2d6879d5d24 100644 --- a/api/@internal/component/ets/index-full.d.ts +++ b/api/@internal/component/ets/index-full.d.ts @@ -37,6 +37,7 @@ /// /// /// +/// /// /// /// @@ -96,6 +97,7 @@ /// /// /// +/// /// /// /// diff --git a/api/@internal/component/ets/middle_class.d.ts b/api/@internal/component/ets/middle_class.d.ts index 0b11a3d26c5444c2c66e1e329e113d7a13020bd9..b49fad281c66de22feacc2481439a3a0cefbe283 100644 --- a/api/@internal/component/ets/middle_class.d.ts +++ b/api/@internal/component/ets/middle_class.d.ts @@ -2373,3 +2373,55 @@ declare class TSRemoteWindowAttribute extends CommonMethod { + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 9 + */ + create(style: GridStyle, scroller?: Scroller): WaterFlowAttribute; + + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 9 + */ + pop(): WaterFlowAttribute; + + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 9 + */ + debugLine(value: string): WaterFlowAttribute; +} + +declare class TSFlowItemAttribute extends CommonMethod { + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 9 + */ + create(): FlowItemAttribute; + + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 9 + */ + pop(): FlowItemAttribute; + + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 9 + */ + debugLine(value: string): FlowItemAttribute; +} \ No newline at end of file diff --git a/api/@internal/component/ets/water_flow.d.ts b/api/@internal/component/ets/water_flow.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..12bc63441fe247b51d552f1d7a7aaa57e7295f1a --- /dev/null +++ b/api/@internal/component/ets/water_flow.d.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021-2022 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. + */ + +/** + * 瀑布流样式, 将网格容器划分成"行"和"列", FlowItem元素可以在网格容器内 + * 按照主轴、辅轴方向顺序布局排列。 + * crossSplice:辅轴方向的网格分割份数。 + * mainLength:主轴方向的宫格高度。可选参数,不指定的时候,网格为正方形。 + * @since 9 + */ +declare interface GridStyle { + crossSplice: number; + mainLength?: Length; +} + +/** + * 瀑布流容器, 二维容器, 支持GridStyle样式。 + * @since 9 + */ +interface WaterFlowInterface { + /** + * 返回WaterFlow. + * @since 9 + */ + (style: GridStyle, scroller?: Scroller): WaterFlowAttribute; +} + +/** + * WaterFlow组件属性 + * @since 9 + */ +declare class WaterFlowAttribute extends CommonMethod { + /** + * 用于设置列与列的间距 + * @since 9 + */ + columnsGap(value: Length): WaterFlowAttribute; + + /** + * 用于设置行与行的间距 + * @since 9 + */ + rowsGap(value: Length): WaterFlowAttribute; + + /** + * 控制WaterFlow的布局方向 + * @since 9 + */ + layoutDirection(value: LayoutDirection): WaterFlowAttribute; +} + +declare const WaterFlow: WaterFlowInterface; +declare const WaterFlowInstance: WaterFlowAttribute;