diff --git a/api/@internal/component/ets/menu.d.ts b/api/@internal/component/ets/menu.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..15910a70b34ebe3507ac9708a47978c27bc8af3f --- /dev/null +++ b/api/@internal/component/ets/menu.d.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) 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. + */ + +/** + * Defines the Menu Component. + * @since 9 + */ + interface MenuInterface { + /** + * Creates the menu component. + * @since 9 + */ + (): MenuAttribute; + } + + /** + * Defines the Menu component attribute functions. + * @since 9 + */ + declare class MenuAttribute extends CommonMethod { + /** + * Set the Menu text size. + * @since 9 + */ + fontSize(value: Length): MenuAttribute; + + } + + declare const Menu: MenuInterface; + declare const MenuInstance: MenuAttribute; + \ No newline at end of file diff --git a/api/@internal/component/ets/menu_item.d.ts b/api/@internal/component/ets/menu_item.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f241ce1bc5365cac4d2bb40be2bc04fb74b7a697 --- /dev/null +++ b/api/@internal/component/ets/menu_item.d.ts @@ -0,0 +1,84 @@ +/* + * Copyright (c) 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. + */ + +/** + * Defines the option of MenuItem. + * @since 9 + */ + declare interface MenuItemOptions { + /** + * Defines the start display image info. + * @since 9 + */ + startIcon?: ResourceStr; + + /** + * Defines the content string display info. + * @since 9 + */ + content?: ResourceStr; + + /** + * Defines the end display image info. + * @since 9 + */ + endIcon?: ResourceStr; + + /** + * Defines the end label info like shortcut. + * @since 9 + */ + labelInfo?: ResourceStr; + + /** + * Create the submenu. + * @since 9 + */ + builder?: CustomBuilder; + } + + /** + * Defines the MenuItem Component. + * @since 9 + */ + interface MenuItemInterface { + /** + * Creates the MenuItem component. + * @since 9 + */ + (value?: MenuItemOptions | CustomBuilder): MenuItemAttribute; + } + + /** + * Defines the MenuItem component attribute functions. + * @since 9 + */ + declare class MenuItemAttribute extends CommonMethod { + /** + * Whether the relevant check icon is displayed when a menu item is selected. + * @since 9 + */ + selectIcon(value: boolean); + + /** + * Triggers a callback when a menu item is selected or unchecked. + * @param callback + */ + onChange(callback: (selected: boolean) => void); + } + + declare const MenuItem: MenuItemInterface; + declare const MenuItemInstance: MenuItemAttribute; + \ No newline at end of file diff --git a/api/@internal/component/ets/menu_item_group.d.ts b/api/@internal/component/ets/menu_item_group.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6599df965b85a240f8dfcf230489ce9c84cfa571 --- /dev/null +++ b/api/@internal/component/ets/menu_item_group.d.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) 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. + */ + +/** + * Defines the option of MenuItemGroup. + * @since 9 + */ + declare interface MenuItemGroupOptions { + /** + * Defines the header display info. + * @since 9 + */ + header?: CustomBuilder; + + /** + * Defines the footer display info. + * @since 9 + */ + footer?: CustomBuilder; + } + + /** + * Defines the MenuItemGroup Component. + * @since 9 + */ + interface MenuItemGroupInterface { + /** + * Creates the MenuItemGroup component. + * @since 9 + */ + (value?: MenuItemGroupOptions): MenuItemGroupAttribute; + } + + /** + * Defines the MenuItemGroup component attribute functions. + * @since 9 + */ + declare class MenuItemGroupAttribute extends CommonMethod {} + + declare const MenuItemGroup: MenuItemGroupInterface; + declare const MenuItemGroupInstance: MenuItemGroupAttribute; + \ No newline at end of file