From 46a8b48d105ff4773c9077dd4e535bf1caa34b39 Mon Sep 17 00:00:00 2001 From: kukixi Date: Thu, 10 Mar 2022 20:06:34 +0800 Subject: [PATCH 1/5] add arkui api review comments Signed-off-by: kukixi --- BUILD.gn | 2 - .../component/ets/alphabet_indexer.d.ts | 19 ++-- api/@internal/component/ets/button.d.ts | 6 +- api/@internal/component/ets/checkbox.d.ts | 4 +- .../component/ets/checkboxgroup.d.ts | 4 +- api/@internal/component/ets/circle.d.ts | 6 +- api/@internal/component/ets/common.d.ts | 15 +-- .../ets/custom_dialog_controller.d.ts | 4 +- api/@internal/component/ets/data_panel.d.ts | 4 +- api/@internal/component/ets/date_picker.d.ts | 62 +----------- api/@internal/component/ets/enums.d.ts | 46 +-------- api/@internal/component/ets/flex.d.ts | 4 +- api/@internal/component/ets/gesture.d.ts | 4 +- .../component/ets/grid_container.d.ts | 4 +- api/@internal/component/ets/index-full.d.ts | 3 +- .../component/ets/lazy_for_each.d.ts | 40 ++++++-- api/@internal/component/ets/list.d.ts | 2 +- api/@internal/component/ets/navigation.d.ts | 10 +- api/@internal/component/ets/radio.d.ts | 4 +- api/@internal/component/ets/scroll_bar.d.ts | 4 +- api/@internal/component/ets/select.d.ts | 2 +- api/@internal/component/ets/sheet.d.ts | 35 ------- api/@internal/component/ets/sidebar.d.ts | 2 +- api/@internal/component/ets/slider.d.ts | 4 +- api/@internal/component/ets/text_area.d.ts | 4 +- api/@internal/component/ets/text_input.d.ts | 13 ++- api/@internal/component/ets/text_picker.d.ts | 4 +- api/@internal/component/ets/text_timer.d.ts | 4 +- .../ets/{piece.d.ts => time_picker.d.ts} | 94 ++++++++++++------- api/@internal/component/ets/units.d.ts | 4 +- api/@internal/component/ets/video.d.ts | 6 +- 31 files changed, 173 insertions(+), 246 deletions(-) delete mode 100644 api/@internal/component/ets/sheet.d.ts rename api/@internal/component/ets/{piece.d.ts => time_picker.d.ts} (33%) diff --git a/BUILD.gn b/BUILD.gn index e1313d198c..694bdc60c7 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -73,7 +73,6 @@ ohos_copy("ets_component") { "api/@internal/component/ets/page_transition.d.ts", "api/@internal/component/ets/panel.d.ts", "api/@internal/component/ets/path.d.ts", - "api/@internal/component/ets/piece.d.ts", "api/@internal/component/ets/polygon.d.ts", "api/@internal/component/ets/polyline.d.ts", "api/@internal/component/ets/progress.d.ts", @@ -90,7 +89,6 @@ ohos_copy("ets_component") { "api/@internal/component/ets/search.d.ts", "api/@internal/component/ets/select.d.ts", "api/@internal/component/ets/shape.d.ts", - "api/@internal/component/ets/sheet.d.ts", "api/@internal/component/ets/sidebar.d.ts", "api/@internal/component/ets/slider.d.ts", "api/@internal/component/ets/span.d.ts", diff --git a/api/@internal/component/ets/alphabet_indexer.d.ts b/api/@internal/component/ets/alphabet_indexer.d.ts index ce3c01431f..42a4b1694a 100644 --- a/api/@internal/component/ets/alphabet_indexer.d.ts +++ b/api/@internal/component/ets/alphabet_indexer.d.ts @@ -52,8 +52,9 @@ declare class AlphabetIndexerAttribute extends CommonMethod void): AlphabetIndexerAttribute; + onSelected(callback: (index: number) => void): AlphabetIndexerAttribute; /** * Definitions color. @@ -121,29 +122,35 @@ declare class AlphabetIndexerAttribute extends CommonMethod void): AlphabetIndexerAttribute; + /** * Index bar selection callback and return the strings which display on pop-up. * @since 8 */ - onRequestPopupData(event: (index: number) => Array): AlphabetIndexerAttribute; + onRequestPopupData(callback: (index: number) => Array): AlphabetIndexerAttribute; /** * Pop-up selection callback. * @since 8 */ - onPopupSelected(event: (index: number) => void): AlphabetIndexerAttribute; + onPopupSelect(callback: (index: number) => void): AlphabetIndexerAttribute; /** - * Select the index. + * Sets the selected index. * @since 8 */ - selectedIndex(index: number): AlphabetIndexerAttribute; + selected(index: number): AlphabetIndexerAttribute; /** * Position of the pop-up windows, relative to the midpoint of the top border of the indexer bar. * @since 8 */ - popupPosition(value: { offsetX: number; offsetY: number }): AlphabetIndexerAttribute; + popupPosition(value: Position): AlphabetIndexerAttribute; } declare const AlphabetIndexer: AlphabetIndexerInterface; diff --git a/api/@internal/component/ets/button.d.ts b/api/@internal/component/ets/button.d.ts index e8e9b7e4ad..3ad3db720f 100644 --- a/api/@internal/component/ets/button.d.ts +++ b/api/@internal/component/ets/button.d.ts @@ -41,7 +41,7 @@ declare enum ButtonType { * Defines the button options. * @since 7 */ -declare interface ButtonOption { +declare interface ButtonOptions { /** * Describes the button style. * @since 7 @@ -70,13 +70,13 @@ interface ButtonInterface { * Create Button with Text child. * @since 7 */ - (options: ButtonOption): ButtonAttribute; + (options: ButtonOptions): ButtonAttribute; /** * Create Button with inner text label. * @since 7 */ - (label: ResourceStr, options?: ButtonOption): ButtonAttribute; + (label: ResourceStr, options?: ButtonOptions): ButtonAttribute; } /** diff --git a/api/@internal/component/ets/checkbox.d.ts b/api/@internal/component/ets/checkbox.d.ts index e96cf31217..87f1763ca7 100644 --- a/api/@internal/component/ets/checkbox.d.ts +++ b/api/@internal/component/ets/checkbox.d.ts @@ -17,7 +17,7 @@ * Defines the option of Checkbox. * @since 8 */ -declare interface CheckboxOption { +declare interface CheckboxOptions { /** * Current name of Checkbox. * @since 8 @@ -41,7 +41,7 @@ interface CheckboxInterface { * Called when the Checkbox component is used. * @since 8 */ - (options?: CheckboxOption): CheckboxAttribute; + (options?: CheckboxOptions): CheckboxAttribute; } /** diff --git a/api/@internal/component/ets/checkboxgroup.d.ts b/api/@internal/component/ets/checkboxgroup.d.ts index ebf1461c38..c94297e216 100644 --- a/api/@internal/component/ets/checkboxgroup.d.ts +++ b/api/@internal/component/ets/checkboxgroup.d.ts @@ -39,7 +39,7 @@ declare enum SelectStatus { * Defines the option of CheckboxGroup. * @since 8 */ -declare interface CheckboxGroupOption { +declare interface CheckboxGroupOptions { /** * Setting the group of CheckboxGroup. * @since 8 @@ -73,7 +73,7 @@ interface CheckboxGroupInterface { * Called when the CheckboxGroup component is used. * @since 8 */ - (options?: CheckboxGroupOption): CheckboxGroupAttribute; + (options?: CheckboxGroupOptions): CheckboxGroupAttribute; } /** diff --git a/api/@internal/component/ets/circle.d.ts b/api/@internal/component/ets/circle.d.ts index 56a14c7e18..360027be95 100644 --- a/api/@internal/component/ets/circle.d.ts +++ b/api/@internal/component/ets/circle.d.ts @@ -17,7 +17,7 @@ * Defines circle option for Circle component. * @since 7 */ -declare interface CircleOption { +declare interface CircleOptions { /** * Defines the width property. * @since 7 @@ -40,13 +40,13 @@ interface CircleInterface { * use new function to set the value. * @since 7 */ - new (value?: CircleOption): CircleAttribute; + new (value?: CircleOptions): CircleAttribute; /** * Set the value.. * @since 7 */ - (value?: CircleOption): CircleAttribute; + (value?: CircleOptions): CircleAttribute; } /** diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 9f4697c2fd..33c99b89de 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -194,7 +194,7 @@ declare function $rawfile(value: string): Resource; /** * global getContentStorage function - * @since 8 + * @since 9 */ declare function getContentStorage(value: any): ContentStorage; @@ -1215,13 +1215,6 @@ declare class CommonMethod { */ onBlur(event: () => void): T; - /** - * Trigger a event when focus move. - * @since 8 - * @systemapi - */ - onFocusMove(event: (direction?: FocusDirection) => void): T; - /** * animation * @since 7 @@ -1383,7 +1376,7 @@ declare class CommonMethod { onDisAppear(event: () => void): T; /** - * This callback is triggered when the size or position of this component has changed. + * This callback is triggered when the size or position of this component change finished. * @param event event callback. * @since 8 */ @@ -1630,7 +1623,7 @@ declare class CommonMethod { * Popup control * @since 7 */ - bindPopup(show: boolean, popup: PopupOption | CustomPopupOption): T; + bindPopup(show: boolean, popup: PopupOptions | CustomPopupOptions): T; /** * Menu control @@ -1648,7 +1641,7 @@ declare class CommonMethod { * Sets styles for component state. * @since 8 */ - stateStyles(value: StateStyels): T; + stateStyles(value: StateStyles): T; /** * id for distrubte identification. diff --git a/api/@internal/component/ets/custom_dialog_controller.d.ts b/api/@internal/component/ets/custom_dialog_controller.d.ts index f208a90578..3fe020c551 100644 --- a/api/@internal/component/ets/custom_dialog_controller.d.ts +++ b/api/@internal/component/ets/custom_dialog_controller.d.ts @@ -18,7 +18,7 @@ * Defines the option of CustomDialogController. * @since 7 */ -declare interface CustomDialogControllerOption { +declare interface CustomDialogControllerOptions { /** * Custom builder function. * @since 7 @@ -71,7 +71,7 @@ declare class CustomDialogController { * The constructor transfers parameter settings. * @since 7 */ - constructor(value: CustomDialogControllerOption); + constructor(value: CustomDialogControllerOptions); /** * Display the content of the customized pop-up window. If the content has been displayed, it does not take effect. diff --git a/api/@internal/component/ets/data_panel.d.ts b/api/@internal/component/ets/data_panel.d.ts index 82d6f4c68b..9388fc4578 100644 --- a/api/@internal/component/ets/data_panel.d.ts +++ b/api/@internal/component/ets/data_panel.d.ts @@ -36,7 +36,7 @@ declare enum DataPanelType { * Defines the option of DataPanel. * @since 7 */ -declare interface DataPanelOption { +declare interface DataPanelOptions { /** * Current data value. the max length is 9. * @since 7 @@ -65,7 +65,7 @@ interface DataPanelInterface { * Return a DataPanel. * @since 7 */ - (options: DataPanelOption): DataPanelAttribute; + (options: DataPanelOptions): DataPanelAttribute; } /** diff --git a/api/@internal/component/ets/date_picker.d.ts b/api/@internal/component/ets/date_picker.d.ts index 13052c0496..6ece71cd14 100644 --- a/api/@internal/component/ets/date_picker.d.ts +++ b/api/@internal/component/ets/date_picker.d.ts @@ -13,24 +13,6 @@ * limitations under the License. */ -/** - * Defines the type of DatePicker. - * @since 8 - */ -declare enum DatePickerType { - /** - * Application hour and second - * @since 8 - */ - Time, - - /** - * Application data - * @since 8 - */ - Date, -} - /** * Defines the struct of DatePickerResult. * @since 8 @@ -53,31 +35,13 @@ declare interface DatePickerResult { * @since 8 */ day?: number; - - /** - * Application hour - * @since 8 - */ - hour?: number; - - /** - * Application minute - * @since 8 - */ - minute?: number; - - /** - * Application second - * @since 8 - */ - second?: number; } /** * Defines the option of DatePicker. * @since 8 */ -declare interface DatePickerOption { +declare interface DatePickerOptions { /** * Specifies the start date of the date selector. * @since 8 @@ -94,12 +58,6 @@ declare interface DatePickerOption { * @since 8 */ selected?: Date; - - /** - * Selector type, including date selector and time selector. By default, the date selector is used. - * @since 8 - */ - type?: DatePickerType; } /** @@ -111,7 +69,7 @@ interface DatePickerInterface { * Defines the DatePicker constructor. * @since 8 */ - (options?: DatePickerOption): DatePickerAttribute; + (options?: DatePickerOptions): DatePickerAttribute; } /** @@ -125,12 +83,6 @@ declare class DatePickerAttribute extends CommonMethod { */ lunar(value: boolean): DatePickerAttribute; - /** - * Time Selector: indicates whether to display the 24-hour clock. - * @since 8 - */ - useMilitaryTime(value: boolean): DatePickerAttribute; - /** * This event is triggered when a DatePicker date or time is selected. * @since 8 @@ -139,20 +91,16 @@ declare class DatePickerAttribute extends CommonMethod { } /** - * Defines the DatePickerDialogOption for Data Picker Dialog. + * Defines the DatePickerDialogOptions for Data Picker Dialog. * @since 8 */ -declare interface DatePickerDialogOption extends DatePickerOption { +declare interface DatePickerDialogOptions extends DatePickerOptions { /** * Date selector: true: displays the lunar calendar. false: The lunar calendar is not displayed. * @since 8 */ lunar?: boolean; - /** - * Time Selector: indicates whether to display the 24-hour clock. - * @since 8 - */ - useMilitaryTime?: boolean; + /** * Called when the OK button in the dialog is clicked. * @since 8 diff --git a/api/@internal/component/ets/enums.d.ts b/api/@internal/component/ets/enums.d.ts index 87d4358433..518e2efabf 100644 --- a/api/@internal/component/ets/enums.d.ts +++ b/api/@internal/component/ets/enums.d.ts @@ -274,13 +274,7 @@ declare enum MouseAction { * Triggered when the mouse is Hovered. * @since 8 */ - Hover, - - /** - * Triggered when the mouse status is None. - * @since 8 - */ - None, + Hover } /** @@ -613,42 +607,6 @@ declare enum Direction { Auto, } -/** - * Sets the horizontal layout of elements. - * @since 8 - */ -declare enum FocusDirection { - /** - * From the key up. - * @since 8 - */ - Up, - - /** - * From the key down. - * @since 8 - */ - Down, - - /** - * From the key left. - * @since 8 - */ - Left, - - /** - * From the key right. - * @since 8 - */ - Right, - - /** - * From the key tab. - * @since 8 - */ - Tab, -} - /** * Used to set the status of the scroll bar. * @since 7 @@ -1395,7 +1353,7 @@ declare enum HoverEffect { * Highlight effect * @since 8 */ - Board, + Highlight, /** * None effect diff --git a/api/@internal/component/ets/flex.d.ts b/api/@internal/component/ets/flex.d.ts index 0e6bb92157..6e4dbfbff2 100644 --- a/api/@internal/component/ets/flex.d.ts +++ b/api/@internal/component/ets/flex.d.ts @@ -17,7 +17,7 @@ * Defines the option of Flex. * @since 7 */ -declare interface FlexOption { +declare interface FlexOptions { /** * Sets the horizontal layout of elements. * @since 7 @@ -58,7 +58,7 @@ interface FlexInterface { * Defines the constructor of Flex. * @since 7 */ - (value?: FlexOption): FlexAttribute; + (value?: FlexOptions): FlexAttribute; } /** diff --git a/api/@internal/component/ets/gesture.d.ts b/api/@internal/component/ets/gesture.d.ts index e5c58dc682..f94b35fb66 100644 --- a/api/@internal/component/ets/gesture.d.ts +++ b/api/@internal/component/ets/gesture.d.ts @@ -320,7 +320,7 @@ interface LongPressGestureInterface { * Defines the PanGesture option. * @since 7 */ -declare class PanGestureOption { +declare class PanGestureOptions { /** * Constructor parameters. * @since 7 @@ -355,7 +355,7 @@ interface PanGestureInterface { * Set the value. * @since 7 */ - (value?: { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOption): PanGestureInterface; + (value?: { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOptions): PanGestureInterface; /** * Pan gesture recognition success callback. diff --git a/api/@internal/component/ets/grid_container.d.ts b/api/@internal/component/ets/grid_container.d.ts index 86cacbe428..03de606863 100644 --- a/api/@internal/component/ets/grid_container.d.ts +++ b/api/@internal/component/ets/grid_container.d.ts @@ -53,7 +53,7 @@ declare enum SizeType { * Defines the option of GridContainer. * @since 7 */ -declare interface GridContainerOption { +declare interface GridContainerOptions { /** * Sets the total number of columns in the current layout. * @since 7 @@ -88,7 +88,7 @@ interface GridContainerInterface { * Defines the constructor of GridContainer. * @since 7 */ - (value?: GridContainerOption): GridContainerAttribute; + (value?: GridContainerOptions): GridContainerAttribute; } /** diff --git a/api/@internal/component/ets/index-full.d.ts b/api/@internal/component/ets/index-full.d.ts index f4427afcf6..8375647981 100644 --- a/api/@internal/component/ets/index-full.d.ts +++ b/api/@internal/component/ets/index-full.d.ts @@ -58,7 +58,6 @@ /// /// /// -/// /// /// /// @@ -76,7 +75,6 @@ /// /// /// -/// /// /// /// @@ -92,6 +90,7 @@ /// /// /// +/// /// /// /// diff --git a/api/@internal/component/ets/lazy_for_each.d.ts b/api/@internal/component/ets/lazy_for_each.d.ts index 65e7c2cdbf..a027eab8af 100644 --- a/api/@internal/component/ets/lazy_for_each.d.ts +++ b/api/@internal/component/ets/lazy_for_each.d.ts @@ -27,53 +27,81 @@ declare interface DataChangeListener { /** * Data added. * @since 7 + * @deprecated since 8 */ onDataAdded(index: number): void; + /** + * Data added. + * @since 8 + */ + onDataAdd(index: number): void; + /** * Data moved. * @since 7 + * @deprecated since 8 */ onDataMoved(from: number, to: number): void; + /** + * Data moved. + * @since 8 + */ + onDataMove(from: number, to: number): void; + /** * Data deleted. * @since 7 + * @deprecated since 8 */ onDataDeleted(index: number): void; /** - * Data changed. + * Data deleted. + * @since 8 + */ + onDataDelete(index: number): void; + + /** + * Call when has data change. * @since 7 + * @deprecated since 8 */ onDataChanged(index: number): void; + + /** + * Call when has data change. + * @since 8 + */ + onDataChange(index: number): void; } /** - * Data changed. + * Developers need to implement this interface to provide data to LazyForEach component. * @since 7 */ declare interface IDataSource { /** - * Total count. + * Total data count. * @since 7 */ totalCount(): number; /** - * get data. + * Return the data of index. * @since 7 */ getData(index: number): any; /** - * register Data Change Listener + * Register data change listener. * @since 7 */ registerDataChangeListener(listener: DataChangeListener): void; /** - * unregister Data Change Listener + * Unregister data change listener. * @since 7 */ unregisterDataChangeListener(listener: DataChangeListener): void; diff --git a/api/@internal/component/ets/list.d.ts b/api/@internal/component/ets/list.d.ts index 322f7fb52c..24845b0924 100644 --- a/api/@internal/component/ets/list.d.ts +++ b/api/@internal/component/ets/list.d.ts @@ -106,7 +106,7 @@ declare class ListAttribute extends CommonMethod { /** * Called when setting whether to enable chain linkage dynamic effect. - * @since 8 + * @since 7 */ chainAnimation(value: boolean): ListAttribute; diff --git a/api/@internal/component/ets/navigation.d.ts b/api/@internal/component/ets/navigation.d.ts index 5130791878..420438d98b 100644 --- a/api/@internal/component/ets/navigation.d.ts +++ b/api/@internal/component/ets/navigation.d.ts @@ -108,12 +108,6 @@ declare class NavigationAttribute extends CommonMethod { */ menus(value: Array | CustomBuilder): NavigationAttribute; - /** - * The amount of the menu in Navigation. - * @since 8 - */ - menuCount(value: number): NavigationAttribute; - /** * Tool bar * @since 8 @@ -127,10 +121,10 @@ declare class NavigationAttribute extends CommonMethod { hideToolBar(value: boolean): NavigationAttribute; /** - * Trigger a titleModeChanged event when title mode changed at free mode. + * Trigger callback when title mode change finished at free mode. * @since 8 */ - onTitleModeChanged(callback: (titleMode: NavigationTitleMode) => void): NavigationAttribute; + onTitleModeChange(callback: (titleMode: NavigationTitleMode) => void): NavigationAttribute; } declare const Navigation: NavigationInterface; diff --git a/api/@internal/component/ets/radio.d.ts b/api/@internal/component/ets/radio.d.ts index 703e003467..3d17928469 100644 --- a/api/@internal/component/ets/radio.d.ts +++ b/api/@internal/component/ets/radio.d.ts @@ -17,7 +17,7 @@ * Input parameter for creating a radio box. * @since 8 */ -declare interface RadioOption { +declare interface RadioOptions { /** * Radio group name. * @since 8 @@ -40,7 +40,7 @@ interface RadioInterface { * Called when a radio box is created. * @since 8 */ - (options: RadioOption): RadioAttribute; + (options: RadioOptions): RadioAttribute; } /** diff --git a/api/@internal/component/ets/scroll_bar.d.ts b/api/@internal/component/ets/scroll_bar.d.ts index afccfd11eb..9a891279a7 100644 --- a/api/@internal/component/ets/scroll_bar.d.ts +++ b/api/@internal/component/ets/scroll_bar.d.ts @@ -35,7 +35,7 @@ declare enum ScrollBarDirection { * Defines the option of ScrollBar. * @since 8 */ -declare interface ScrollBarOption { +declare interface ScrollBarOptions { /** * Sets the scroller of scroll bar. * @since 8 @@ -64,7 +64,7 @@ interface ScrollBarInterface { * Called when a ScrollBar container is set. * @since 8 */ - (value: ScrollBarOption): ScrollBarAttribute; + (value: ScrollBarOptions): ScrollBarAttribute; } /** diff --git a/api/@internal/component/ets/select.d.ts b/api/@internal/component/ets/select.d.ts index 6b186318b0..0c03c35b06 100644 --- a/api/@internal/component/ets/select.d.ts +++ b/api/@internal/component/ets/select.d.ts @@ -112,7 +112,7 @@ declare class SelectAttribute extends CommonMethod { * Callback for selecting an item from the select. * @since 8 */ - onSelected(event: (index: number, value?: string) => void): SelectAttribute; + onSelect(callback: (index: number, value?: string) => void): SelectAttribute; } declare const Select: SelectInterface; diff --git a/api/@internal/component/ets/sheet.d.ts b/api/@internal/component/ets/sheet.d.ts deleted file mode 100644 index 59b190edb3..0000000000 --- a/api/@internal/component/ets/sheet.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ - -/** - * Provides the interface for the sheet attributes. - * @since 8 - */ -interface SheetInterface { - /** - * Create sheet. - * @since 8 - */ - (): SheetAttribute; -} - -/** - * Declares sheet properties. - * @since 8 - */ -declare class SheetAttribute extends CommonMethod {} - -declare const Sheet: SheetInterface; -declare const SheetInstance: SheetAttribute; diff --git a/api/@internal/component/ets/sidebar.d.ts b/api/@internal/component/ets/sidebar.d.ts index e2c77a2d9e..e38f1ad790 100644 --- a/api/@internal/component/ets/sidebar.d.ts +++ b/api/@internal/component/ets/sidebar.d.ts @@ -101,7 +101,7 @@ declare class SideBarContainerAttribute extends CommonMethod void): SideBarContainerAttribute; diff --git a/api/@internal/component/ets/slider.d.ts b/api/@internal/component/ets/slider.d.ts index 9f4817166e..7c1b8278b5 100644 --- a/api/@internal/component/ets/slider.d.ts +++ b/api/@internal/component/ets/slider.d.ts @@ -59,7 +59,7 @@ declare enum SliderChangeMode { * Defines the option of Slider. * @since 7 */ -declare interface SliderOption { +declare interface SliderOptions { /** * Current value of Slider. * @since 7 @@ -112,7 +112,7 @@ interface SliderInterface { * Called when the slider bar component is used. * @since 7 */ - (options?: SliderOption): SliderAttribute; + (options?: SliderOptions): SliderAttribute; } /** diff --git a/api/@internal/component/ets/text_area.d.ts b/api/@internal/component/ets/text_area.d.ts index 978ff49deb..0c863955b7 100644 --- a/api/@internal/component/ets/text_area.d.ts +++ b/api/@internal/component/ets/text_area.d.ts @@ -34,7 +34,7 @@ declare class TextAreaController { * Defines the option of TextArea. * @since 7 */ -declare interface TextAreaOption { +declare interface TextAreaOptions { /** * The place holder text string. * @since 7 @@ -63,7 +63,7 @@ interface TextAreaInterface { * Called when writing multiple lines of text. * @since 7 */ - (value?: TextAreaOption): TextAreaAttribute; + (value?: TextAreaOptions): TextAreaAttribute; } /** diff --git a/api/@internal/component/ets/text_input.d.ts b/api/@internal/component/ets/text_input.d.ts index 88d4ce1cf9..2ab0b0708f 100644 --- a/api/@internal/component/ets/text_input.d.ts +++ b/api/@internal/component/ets/text_input.d.ts @@ -100,7 +100,7 @@ declare class TextInputController { * Defines the option of TextInput. * @since 7 */ -declare interface TextInputOption { +declare interface TextInputOptions { /** * The place holder text string. * @since 7 @@ -129,7 +129,7 @@ interface TextInputInterface { * Called when writing a single line of text. * @since 7 */ - (value?: TextInputOption): TextInputAttribute; + (value?: TextInputOptions): TextInputAttribute; } /** @@ -168,11 +168,18 @@ declare class TextInputAttribute extends CommonMethod { caretColor(value: ResourceColor): TextInputAttribute; /** - * Called when judging whether the text editing has changed. + * Called when judging whether the text editing change finished. * @since 7 + * @deprecated since 8 */ onEditChanged(callback: (isEditing: boolean) => void): TextInputAttribute; + /** + * Called when judging whether the text editing change finished. + * @since 8 + */ + onEditChange(callback: (isEditing: boolean) => void): TextInputAttribute; + /** * Called when submitted. * @since 7 diff --git a/api/@internal/component/ets/text_picker.d.ts b/api/@internal/component/ets/text_picker.d.ts index 8db6d4687d..8120f183f5 100644 --- a/api/@internal/component/ets/text_picker.d.ts +++ b/api/@internal/component/ets/text_picker.d.ts @@ -17,7 +17,7 @@ * Defines the option of TextPicker. * @since 8 */ -declare interface TextPickerOption { +declare interface TextPickerOptions { /** * Specifies the range of the text selector. */ @@ -40,7 +40,7 @@ interface TextPickerInterface { * Defines the TextPicker constructor. * @since 8 */ - (options?: TextPickerOption): TextPickerAttribute; + (options?: TextPickerOptions): TextPickerAttribute; } /** diff --git a/api/@internal/component/ets/text_timer.d.ts b/api/@internal/component/ets/text_timer.d.ts index d43d3e12ae..6f6d0310e4 100644 --- a/api/@internal/component/ets/text_timer.d.ts +++ b/api/@internal/component/ets/text_timer.d.ts @@ -47,7 +47,7 @@ declare class TextTimerController { * Defines the option of TextTimer. * @since 8 */ -interface TextTimerOption { +interface TextTimerOptions { /** * Sets whether to countdown.The default value is false. * @since 8 @@ -77,7 +77,7 @@ interface TextTimerInterface { * Defines the TextTimer constructor. * @since 8 */ - (options?: TextTimerOption): TextTimerAttribute; + (options?: TextTimerOptions): TextTimerAttribute; } /** diff --git a/api/@internal/component/ets/piece.d.ts b/api/@internal/component/ets/time_picker.d.ts similarity index 33% rename from api/@internal/component/ets/piece.d.ts rename to api/@internal/component/ets/time_picker.d.ts index 5e67176d8c..cda51ff9f7 100644 --- a/api/@internal/component/ets/piece.d.ts +++ b/api/@internal/component/ets/time_picker.d.ts @@ -13,83 +13,113 @@ * limitations under the License. */ - /** - * Sets the relative position of icons and text. + * Defines the struct of TimePickerResult. * @since 8 */ -declare enum IconPosition { +declare interface TimePickerResult { /** - * The icon is at the beginning of the text. + * Application hour * @since 8 */ - Start, + hour?: number; /** - * The icon is at the end of the text. + * Application minute * @since 8 */ - End, + minute?: number; } /** - * Provides text and icons for setting block entries. + * Defines the option of TimePicker. * @since 8 */ -interface PieceInterface { +declare interface TimePickerOptions { /** - * Called when setting the position of a block entry. - * @since 8 + * Specifies the start Date of the Time selector. + */ + start?: Date; + + /** + * Specifies the end Date for the Time selector. + */ + end?: Date; + + /** + * Specifies the time selector check time. */ - (options?: { content: string; icon?: string }): PieceAttribute; + selected?: Date; } /** + * Defines the TimePicker Component. * @since 8 */ -declare class PieceAttribute extends CommonMethod { +interface TimePickerInterface { /** - * Called when the relative position of the icon and the text is set. + * Defines the TimePicker constructor. * @since 8 */ - iconPosition(value: IconPosition): PieceAttribute; + (options?: TimePickerOptions): TimePickerAttribute; +} + +/** + * Defines the TimePicker attribute functions. + * @since 8 + */ +declare class TimePickerAttribute extends CommonMethod { /** - * Called when the value of Piece fontColor is set + * Time Selector: indicates whether to display the 24-hour clock. * @since 8 */ - fontColor(value: ResourceColor): PieceAttribute; + useMilitaryTime(value: boolean): TimePickerAttribute; + /** - * Called when the value of Piece fontSize is set + * This event is triggered when a TimePicker time is selected. * @since 8 */ - fontSize(value: Length): PieceAttribute; + onChange(callback: (value: TimePickerResult) => void): TimePickerAttribute; +} + +/** + * Defines the TimePickerDialogOptions for Data Picker Dialog. + * @since 8 + */ +declare interface TimePickerDialogOptions extends TimePickerOptions { /** - * Called when the value of Piece fontStyle is set + * Time Selector: indicates whether to display the 24-hour clock. * @since 8 */ - fontStyle(value: FontStyle): PieceAttribute; + useMilitaryTime?: boolean; /** - * Called when the value of Piece fontWeight is set + * Called when the OK button in the dialog is clicked. * @since 8 */ - fontWeight(value: number | FontWeight | string): PieceAttribute; + onAccept?: (value: TimePickerResult) => void; /** - * Called when the value of Piece fontFamily is set + * Called when the Cancel button in the dialog is clicked. * @since 8 */ - fontFamily(value: ResourceStr): PieceAttribute; + onCancel?: () => void; /** - * Called when the value of Piece showDelete is set + * This event is triggered when a TimePicker Time or time is selected in dialog. * @since 8 */ - showDelete(value: boolean): PieceAttribute; + onChange?: (value: TimePickerResult) => void; +} + +/** + * Defines TimePickerDialog which uses show method to show TimePicker dialog. + * @since 8 + */ +declare class TimePickerDialog { /** - * Default icon is invisible, - * Callback onClose function when icon is clicked + * Invoking method display. * @since 8 */ - onClose(callback: () => void): PieceAttribute; + static show(options?: TimePickerDialogOption); } -declare const Piece: PieceInterface; -declare const PieceInstance: PieceAttribute; +declare const TimePicker: TimePickerInterface; +declare const TimePickerInstance: TimePickerAttribute; diff --git a/api/@internal/component/ets/units.d.ts b/api/@internal/component/ets/units.d.ts index 72c00a5679..ddfe15b072 100644 --- a/api/@internal/component/ets/units.d.ts +++ b/api/@internal/component/ets/units.d.ts @@ -150,13 +150,13 @@ declare interface Area { * Defines the local position. * @since 8 */ - pos: Position; + position: Position; /** * Defines the global position. * @since 8 */ - globalPos: Position; + globalPosition: Position; } /** diff --git a/api/@internal/component/ets/video.d.ts b/api/@internal/component/ets/video.d.ts index 8083acb3fc..b36823a36d 100644 --- a/api/@internal/component/ets/video.d.ts +++ b/api/@internal/component/ets/video.d.ts @@ -83,7 +83,7 @@ declare enum PlaybackSpeed { * Defines the video options. * @since 7 */ -declare interface VideoOption { +declare interface VideoOptions { /** * src of video. * @since 7 @@ -134,7 +134,7 @@ declare class VideoController { /** * Provides an event to stop playback. - * @since 6 + * @since 7 */ stop(); @@ -160,7 +160,7 @@ interface VideoInterface { * Set the value. * @since 7 */ - (value: VideoOption): VideoAttribute; + (value: VideoOptions): VideoAttribute; } /** -- Gitee From b2a9f9a672f472e1d2a4f8db937eeb4615dcc778 Mon Sep 17 00:00:00 2001 From: kukixi Date: Thu, 10 Mar 2022 22:01:51 +0800 Subject: [PATCH 2/5] change option to options Signed-off-by: kukixi --- api/@internal/component/ets/checkbox.d.ts | 2 +- .../component/ets/checkboxgroup.d.ts | 4 +- api/@internal/component/ets/circle.d.ts | 2 +- api/@internal/component/ets/common.d.ts | 48 +++++++++---------- .../ets/custom_dialog_controller.d.ts | 2 +- api/@internal/component/ets/data_panel.d.ts | 2 +- api/@internal/component/ets/date_picker.d.ts | 4 +- api/@internal/component/ets/flex.d.ts | 2 +- api/@internal/component/ets/gesture.d.ts | 2 +- .../component/ets/grid_container.d.ts | 2 +- api/@internal/component/ets/middle_class.d.ts | 36 +++++++------- api/@internal/component/ets/progress.d.ts | 6 +-- api/@internal/component/ets/scroll_bar.d.ts | 2 +- api/@internal/component/ets/select.d.ts | 10 ++-- api/@internal/component/ets/slider.d.ts | 2 +- api/@internal/component/ets/swiper.d.ts | 2 +- api/@internal/component/ets/text_area.d.ts | 2 +- api/@internal/component/ets/text_input.d.ts | 2 +- api/@internal/component/ets/text_picker.d.ts | 8 ++-- api/@internal/component/ets/text_timer.d.ts | 2 +- api/@internal/component/ets/time_picker.d.ts | 4 +- api/@internal/component/ets/units.d.ts | 8 ++-- 22 files changed, 77 insertions(+), 77 deletions(-) diff --git a/api/@internal/component/ets/checkbox.d.ts b/api/@internal/component/ets/checkbox.d.ts index 87f1763ca7..adc255a085 100644 --- a/api/@internal/component/ets/checkbox.d.ts +++ b/api/@internal/component/ets/checkbox.d.ts @@ -14,7 +14,7 @@ */ /** - * Defines the option of Checkbox. + * Defines the options of Checkbox. * @since 8 */ declare interface CheckboxOptions { diff --git a/api/@internal/component/ets/checkboxgroup.d.ts b/api/@internal/component/ets/checkboxgroup.d.ts index c94297e216..16695f09d2 100644 --- a/api/@internal/component/ets/checkboxgroup.d.ts +++ b/api/@internal/component/ets/checkboxgroup.d.ts @@ -36,7 +36,7 @@ declare enum SelectStatus { } /** - * Defines the option of CheckboxGroup. + * Defines the options of CheckboxGroup. * @since 8 */ declare interface CheckboxGroupOptions { @@ -48,7 +48,7 @@ declare interface CheckboxGroupOptions { } /** - * Defines the option of CheckboxGroupResult. + * Defines the options of CheckboxGroupResult. * @since 8 */ declare interface CheckboxGroupResult { diff --git a/api/@internal/component/ets/circle.d.ts b/api/@internal/component/ets/circle.d.ts index 360027be95..3e2936e327 100644 --- a/api/@internal/component/ets/circle.d.ts +++ b/api/@internal/component/ets/circle.d.ts @@ -14,7 +14,7 @@ */ /** - * Defines circle option for Circle component. + * Defines circle options for Circle component. * @since 7 */ declare interface CircleOptions { diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 33c99b89de..58bcc860fc 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -255,10 +255,10 @@ declare interface AnimateParam { } /** - * Defines the motion path option. + * Defines the motion path options. * @since 7 */ -declare interface MotionPathOption { +declare interface MotionPathOptions { /** * The path info. * @since 7 @@ -285,7 +285,7 @@ declare interface MotionPathOption { * Defines the shard transition function params. * @since 7 */ -declare interface sharedTransitionOption { +declare interface sharedTransitionOptions { /** * Animation duration, in ms. * @since 7 @@ -305,7 +305,7 @@ declare interface sharedTransitionOption { * The motion path info. * @since 7 */ - motionPath?: MotionPathOption; + motionPath?: MotionPathOptions; /** * Z index info. * @since 7 @@ -319,10 +319,10 @@ declare interface sharedTransitionOption { } /** - * Defines the option of translate. + * Defines the options of translate. * @since 7 */ -declare interface TranslateOption { +declare interface TranslateOptions { /** * The param of x direction. * @since 7 @@ -341,10 +341,10 @@ declare interface TranslateOption { } /** - * Defines the option of scale. + * Defines the options of scale. * @since 7 */ -declare interface ScaleOption { +declare interface ScaleOptions { /** * The param of x direction. * @since 7 @@ -372,7 +372,7 @@ declare interface ScaleOption { centerY?: number | string; } -declare interface RotateOption { +declare interface RotateOptions { /** * The param of x direction. * @since 7 @@ -409,7 +409,7 @@ declare interface RotateOption { * Defines the param of transition. * @since 7 */ -declare interface TransitionOption { +declare interface TransitionOptions { /** * Defines the param of type. * @since 7 @@ -424,17 +424,17 @@ declare interface TransitionOption { * Defines the param of translate. * @since 7 */ - translate?: TransitionOption; + translate?: TransitionOptions; /** * Defines the param of scale. * @since 7 */ - scale?: ScaleOption; + scale?: ScaleOptions; /** * Defines the param of rotate. * @since 7 */ - rotate?: RotateOption; + rotate?: RotateOptions; } /** @@ -926,7 +926,7 @@ declare interface StateStyels { * Defines the popup options. * @since 7 */ -declare interface PopupOption { +declare interface PopupOptions { /** * Information in the pop-up window. * @since 7 @@ -983,10 +983,10 @@ declare interface PopupOption { } /** - * Defines the custom popup option. + * Defines the custom popup options. * @since 8 */ -declare interface CustomPopupOption { +declare interface CustomPopupOptions { /** * builder of popup * @since 8 @@ -1076,7 +1076,7 @@ declare class CommonMethod { /** * Sets the touchable of the current component - * @since 8 + * @since 7 */ touchable(value: boolean): T; @@ -1135,7 +1135,7 @@ declare class CommonMethod { * width:Border width;color:Border color;radius:Border radius; * @since 7 */ - border(value: BorderOption): T; + border(value: BorderOptions): T; /** * Border style @@ -1225,7 +1225,7 @@ declare class CommonMethod { * Transition parameter * @since 7 */ - transition(value: TransitionOption): T; + transition(value: TransitionOptions): T; /** * Bind gesture recognition. @@ -1329,13 +1329,13 @@ declare class CommonMethod { * When this parameter is set together with slide, slide takes effect by default. * @since 7 */ - translate(value: TranslateOption): T; + translate(value: TranslateOptions): T; /** * Sets the zoom effect during page transition. The value is the start point of entry and end point of exit. * @since 7 */ - scale(value: ScaleOption): T; + scale(value: ScaleOptions): T; /** * Default number of occupied columns, indicating the number of occupied grid columns when the number of columns (span) of the corresponding size is not set in the useSizeType attribute. @@ -1355,7 +1355,7 @@ declare class CommonMethod { * The values are the start point during insertion and the end point during deletion. * @since 7 */ - rotate(value: RotateOption): T; + rotate(value: RotateOptions): T; /** * Sets the transformation matrix for the current component. @@ -1428,7 +1428,7 @@ declare class CommonMethod { * If the components of the two pages are configured with the same ID, the shared element transition is performed during transition. If the parameter is set to an empty string, the shared element transition does not occur. For details about the options parameter, see the options parameter description. * @since 7 */ - sharedTransition(id: string, options?: sharedTransitionOption): T; + sharedTransition(id: string, options?: sharedTransitionOptions): T; /** * Sets the sliding direction. The enumerated value supports logical AND (&) and logical OR (|). @@ -1573,7 +1573,7 @@ declare class CommonMethod { * rotatble:Whether to follow the path for rotation. * @since 7 */ - motionPath(value: MotionPathOption): T; + motionPath(value: MotionPathOptions): T; /** * Add a shadow effect to the current component diff --git a/api/@internal/component/ets/custom_dialog_controller.d.ts b/api/@internal/component/ets/custom_dialog_controller.d.ts index 3fe020c551..c0686ea814 100644 --- a/api/@internal/component/ets/custom_dialog_controller.d.ts +++ b/api/@internal/component/ets/custom_dialog_controller.d.ts @@ -15,7 +15,7 @@ /** - * Defines the option of CustomDialogController. + * Defines the options of CustomDialogController. * @since 7 */ declare interface CustomDialogControllerOptions { diff --git a/api/@internal/component/ets/data_panel.d.ts b/api/@internal/component/ets/data_panel.d.ts index 9388fc4578..9a702b2b2e 100644 --- a/api/@internal/component/ets/data_panel.d.ts +++ b/api/@internal/component/ets/data_panel.d.ts @@ -33,7 +33,7 @@ declare enum DataPanelType { } /** - * Defines the option of DataPanel. + * Defines the options of DataPanel. * @since 7 */ declare interface DataPanelOptions { diff --git a/api/@internal/component/ets/date_picker.d.ts b/api/@internal/component/ets/date_picker.d.ts index 6ece71cd14..02c116589e 100644 --- a/api/@internal/component/ets/date_picker.d.ts +++ b/api/@internal/component/ets/date_picker.d.ts @@ -38,7 +38,7 @@ declare interface DatePickerResult { } /** - * Defines the option of DatePicker. + * Defines the options of DatePicker. * @since 8 */ declare interface DatePickerOptions { @@ -127,7 +127,7 @@ declare class DatePickerDialog { * Invoking method display. * @since 8 */ - static show(options?: DatePickerDialogOption); + static show(options?: DatePickerDialogOptions); } declare const DatePicker: DatePickerInterface; diff --git a/api/@internal/component/ets/flex.d.ts b/api/@internal/component/ets/flex.d.ts index 6e4dbfbff2..a22e7c704c 100644 --- a/api/@internal/component/ets/flex.d.ts +++ b/api/@internal/component/ets/flex.d.ts @@ -14,7 +14,7 @@ */ /** - * Defines the option of Flex. + * Defines the options of Flex. * @since 7 */ declare interface FlexOptions { diff --git a/api/@internal/component/ets/gesture.d.ts b/api/@internal/component/ets/gesture.d.ts index f94b35fb66..0381bdf923 100644 --- a/api/@internal/component/ets/gesture.d.ts +++ b/api/@internal/component/ets/gesture.d.ts @@ -317,7 +317,7 @@ interface LongPressGestureInterface { } /** - * Defines the PanGesture option. + * Defines the PanGesture options. * @since 7 */ declare class PanGestureOptions { diff --git a/api/@internal/component/ets/grid_container.d.ts b/api/@internal/component/ets/grid_container.d.ts index 03de606863..28203fa47f 100644 --- a/api/@internal/component/ets/grid_container.d.ts +++ b/api/@internal/component/ets/grid_container.d.ts @@ -50,7 +50,7 @@ declare enum SizeType { } /** - * Defines the option of GridContainer. + * Defines the options of GridContainer. * @since 7 */ declare interface GridContainerOptions { diff --git a/api/@internal/component/ets/middle_class.d.ts b/api/@internal/component/ets/middle_class.d.ts index aa0c7f2ba6..6470485b21 100644 --- a/api/@internal/component/ets/middle_class.d.ts +++ b/api/@internal/component/ets/middle_class.d.ts @@ -132,14 +132,14 @@ declare class TSButtonAttribute extends CommonMethod { * @systemapi * @since 8 */ - createWithChild(label?: ResourceStr, options?: ButtonOption): ButtonAttribute; + createWithChild(label?: ResourceStr, options?: ButtonOptions): ButtonAttribute; /** * Used for TS compiler. * @ignore * @systemapi * @since 8 */ - createWithLabel(label?: ResourceStr, options?: ButtonOption): ButtonAttribute; + createWithLabel(label?: ResourceStr, options?: ButtonOptions): ButtonAttribute; /** * Used for TS compiler. * @ignore @@ -239,7 +239,7 @@ declare class TSCheckboxAttribute extends CommonMethod { * @systemapi * @since 8 */ - create(options?: CheckboxOption): CheckboxAttribute; + create(options?: CheckboxOptions): CheckboxAttribute; /** * Used for TS compiler. * @ignore @@ -269,7 +269,7 @@ declare class TSCheckboxGroupAttribute extends CommonMethod { * @systemapi * @since 8 */ - create(value?: CircleOption): CircleAttribute; + create(value?: CircleOptions): CircleAttribute; /** * Used for TS compiler. * @ignore @@ -412,7 +412,7 @@ declare class TSDataPanelAttribute extends CommonMethod { * @systemapi * @since 8 */ - create(options: DataPanelOption): DataPanelAttribute; + create(options: DataPanelOptions): DataPanelAttribute; /** * Used for TS compiler. * @ignore @@ -442,7 +442,7 @@ declare class TSDatePickerAttribute extends CommonMethod { * @systemapi * @since 8 */ - create(options?: DatePickerOption): DatePickerAttribute; + create(options?: DatePickerOptions): DatePickerAttribute; /** * Used for TS compiler. * @ignore @@ -518,7 +518,7 @@ declare class TSFlexAttribute extends CommonMethod { * @systemapi * @since 8 */ - create(value?: FlexOption): FlexAttribute; + create(value?: FlexOptions): FlexAttribute; /** * Used for TS compiler. * @ignore @@ -696,7 +696,7 @@ declare class TSGridContainerAttribute extends ColumnAttribute { * @systemapi * @since 8 */ - create(value?: GridContainerOption): GridContainerAttribute; + create(value?: GridContainerOptions): GridContainerAttribute; /** * Used for TS compiler. * @ignore @@ -1300,7 +1300,7 @@ declare class TSRadioAttribute extends CommonMethod { * @systemapi * @since 8 */ - create(options: RadioOption): RadioAttribute; + create(options: RadioOptions): RadioAttribute; /** * Used for TS compiler. * @ignore @@ -1509,7 +1509,7 @@ declare class TSScrollBarAttribute extends CommonMethod { * @systemapi * @since 8 */ - create(value: ScrollBarOption): ScrollBarAttribute; + create(value: ScrollBarOptions): ScrollBarAttribute; /** * Used for TS compiler. * @ignore @@ -1574,7 +1574,7 @@ declare class TSSelectAttribute extends CommonMethod { * @systemapi * @since 8 */ - create(options: Array): SelectAttribute; + create(options: Array): SelectAttribute; /** * Used for TS compiler. * @ignore @@ -1664,7 +1664,7 @@ declare class TSSliderAttribute extends CommonMethod { * @systemapi * @since 8 */ - create(options?: SliderOption): SliderAttribute; + create(options?: SliderOptions): SliderAttribute; /** * Used for TS compiler. * @ignore @@ -1920,7 +1920,7 @@ declare class TSTextAreaAttribute extends CommonMethod { * @systemapi * @since 8 */ - create(value?: TextAreaOption): TextAreaAttribute; + create(value?: TextAreaOptions): TextAreaAttribute; /** * Used for TS compiler. * @ignore @@ -1973,7 +1973,7 @@ declare class TSTextInputAttribute extends CommonMethod { * @systemapi * @since 8 */ - create(value?: TextInputOption): TextInputAttribute; + create(value?: TextInputOptions): TextInputAttribute; /** * Used for TS compiler. * @ignore @@ -1996,7 +1996,7 @@ declare class TSTextPickerAttribute extends CommonMethod { * @systemapi * @since 8 */ - create(options?: TextPickerOption): TextPickerAttribute; + create(options?: TextPickerOptions): TextPickerAttribute; /** * Used for TS compiler. * @ignore @@ -2026,7 +2026,7 @@ declare class TSTextTimerAttribute extends CommonMethod { * @systemapi * @since 8 */ - create(options?: TextTimerOption): TextTimerAttribute; + create(options?: TextTimerOptions): TextTimerAttribute; /** * Used for TS compiler. * @ignore @@ -2247,7 +2247,7 @@ declare class TSPanGestureInterface { direction?: PanDirection; distance?: number; } - | PanGestureOption, + | PanGestureOptions, ): PanGestureInterface; /** * Used for TS compiler. diff --git a/api/@internal/component/ets/progress.d.ts b/api/@internal/component/ets/progress.d.ts index e4fb5939d0..a0ba3f6ca0 100644 --- a/api/@internal/component/ets/progress.d.ts +++ b/api/@internal/component/ets/progress.d.ts @@ -14,10 +14,10 @@ */ /** - * Defines style option for progress component. + * Defines style options for progress component. * @since 8 */ -declare interface ProgressStyleOption { +declare interface ProgressStyleOptions { /** * Defines the strokeWidth property. * @since 8 @@ -106,7 +106,7 @@ declare class ProgressAttribute extends CommonMethod { * Called when the style of progress bar is set. * @since 8 */ - style(value: ProgressStyleOption): ProgressAttribute; + style(value: ProgressStyleOptions): ProgressAttribute; } declare const Progress: ProgressInterface; diff --git a/api/@internal/component/ets/scroll_bar.d.ts b/api/@internal/component/ets/scroll_bar.d.ts index 9a891279a7..d8089e23b4 100644 --- a/api/@internal/component/ets/scroll_bar.d.ts +++ b/api/@internal/component/ets/scroll_bar.d.ts @@ -32,7 +32,7 @@ declare enum ScrollBarDirection { } /** - * Defines the option of ScrollBar. + * Defines the options of ScrollBar. * @since 8 */ declare interface ScrollBarOptions { diff --git a/api/@internal/component/ets/select.d.ts b/api/@internal/component/ets/select.d.ts index 0c03c35b06..5a50746e6d 100644 --- a/api/@internal/component/ets/select.d.ts +++ b/api/@internal/component/ets/select.d.ts @@ -19,13 +19,13 @@ */ declare interface SelectOption { /** - * option string. + * options string. * @since 8 */ value: ResourceStr; /** - * option icon. + * options icon. * @since 8 */ icon?: ResourceStr; @@ -94,19 +94,19 @@ declare class SelectAttribute extends CommonMethod { * Sets the background color of the select item. * @since 8 */ - optionBgColor(value: ResourceColor): SelectAttribute; + optionsBgColor(value: ResourceColor): SelectAttribute; /** * Sets the text style for select items. * @since 8 */ - optionFont(value: Font): SelectAttribute; + optionsFont(value: Font): SelectAttribute; /** * Sets the text color for select items. * @since 8 */ - optionFontColor(value: ResourceColor): SelectAttribute; + optionsFontColor(value: ResourceColor): SelectAttribute; /** * Callback for selecting an item from the select. diff --git a/api/@internal/component/ets/slider.d.ts b/api/@internal/component/ets/slider.d.ts index 7c1b8278b5..e3816c5c82 100644 --- a/api/@internal/component/ets/slider.d.ts +++ b/api/@internal/component/ets/slider.d.ts @@ -56,7 +56,7 @@ declare enum SliderChangeMode { } /** - * Defines the option of Slider. + * Defines the options of Slider. * @since 7 */ declare interface SliderOptions { diff --git a/api/@internal/component/ets/swiper.d.ts b/api/@internal/component/ets/swiper.d.ts index e4664068a3..1a3f7ad21e 100644 --- a/api/@internal/component/ets/swiper.d.ts +++ b/api/@internal/component/ets/swiper.d.ts @@ -38,7 +38,7 @@ declare class SwiperController { /** * Called when need to stop the swiper animation. - * @since 8 + * @since 7 */ finishAnimation(callback?: () => void); } diff --git a/api/@internal/component/ets/text_area.d.ts b/api/@internal/component/ets/text_area.d.ts index 0c863955b7..d5898a5ad8 100644 --- a/api/@internal/component/ets/text_area.d.ts +++ b/api/@internal/component/ets/text_area.d.ts @@ -31,7 +31,7 @@ declare class TextAreaController { } /** - * Defines the option of TextArea. + * Defines the options of TextArea. * @since 7 */ declare interface TextAreaOptions { diff --git a/api/@internal/component/ets/text_input.d.ts b/api/@internal/component/ets/text_input.d.ts index 2ab0b0708f..3d613331f2 100644 --- a/api/@internal/component/ets/text_input.d.ts +++ b/api/@internal/component/ets/text_input.d.ts @@ -97,7 +97,7 @@ declare class TextInputController { } /** - * Defines the option of TextInput. + * Defines the options of TextInput. * @since 7 */ declare interface TextInputOptions { diff --git a/api/@internal/component/ets/text_picker.d.ts b/api/@internal/component/ets/text_picker.d.ts index 8120f183f5..9d91d8cf3e 100644 --- a/api/@internal/component/ets/text_picker.d.ts +++ b/api/@internal/component/ets/text_picker.d.ts @@ -14,7 +14,7 @@ */ /** - * Defines the option of TextPicker. + * Defines the options of TextPicker. * @since 8 */ declare interface TextPickerOptions { @@ -88,10 +88,10 @@ declare interface TextPickerResult { } /** - * Defines the TextPickerDialogOption for Text Picker Dialog. + * Defines the TextPickerDialogOptions for Text Picker Dialog. * @since 8 */ -declare interface TextPickerDialogOption extends TextPickerOption { +declare interface TextPickerDialogOptions extends TextPickerOptions { /** * Called when the default height of the selected element is set. * @since 8 @@ -123,7 +123,7 @@ declare class TextPickerDialog { * Invoking method display. * @since 8 */ - static show(options?: TextPickerDialogOption); + static show(options?: TextPickerDialogOptions); } declare const TextPicker: TextPickerInterface; diff --git a/api/@internal/component/ets/text_timer.d.ts b/api/@internal/component/ets/text_timer.d.ts index 6f6d0310e4..bf49c7c7e0 100644 --- a/api/@internal/component/ets/text_timer.d.ts +++ b/api/@internal/component/ets/text_timer.d.ts @@ -44,7 +44,7 @@ declare class TextTimerController { } /** - * Defines the option of TextTimer. + * Defines the options of TextTimer. * @since 8 */ interface TextTimerOptions { diff --git a/api/@internal/component/ets/time_picker.d.ts b/api/@internal/component/ets/time_picker.d.ts index cda51ff9f7..2fe34a033d 100644 --- a/api/@internal/component/ets/time_picker.d.ts +++ b/api/@internal/component/ets/time_picker.d.ts @@ -32,7 +32,7 @@ declare interface TimePickerResult { } /** - * Defines the option of TimePicker. + * Defines the options of TimePicker. * @since 8 */ declare interface TimePickerOptions { @@ -118,7 +118,7 @@ declare class TimePickerDialog { * Invoking method display. * @since 8 */ - static show(options?: TimePickerDialogOption); + static show(options?: TimePickerDialogOptions); } declare const TimePicker: TimePickerInterface; diff --git a/api/@internal/component/ets/units.d.ts b/api/@internal/component/ets/units.d.ts index ddfe15b072..1eeb8aeadf 100644 --- a/api/@internal/component/ets/units.d.ts +++ b/api/@internal/component/ets/units.d.ts @@ -177,7 +177,7 @@ declare interface Position { } /** - * Defines the constrain size option. + * Defines the constrain size options. * @since 7 */ declare interface ConstraintSizeOptions { @@ -204,7 +204,7 @@ declare interface ConstraintSizeOptions { } /** - * Defines the size option. + * Defines the size options. * @since 7 */ declare interface SizeOptions { @@ -221,10 +221,10 @@ declare interface SizeOptions { } /** - * Defines the option of border. + * Defines the options of border. * @since 7 */ -declare interface BorderOption { +declare interface BorderOptions { /** * Defines the border width. * @since 7 -- Gitee From 9442a0ae8ecd3d9f837c248f9c90ca7fa374613e Mon Sep 17 00:00:00 2001 From: kukixi Date: Thu, 10 Mar 2022 22:09:41 +0800 Subject: [PATCH 3/5] fix errors Signed-off-by: kukixi --- api/@internal/component/ets/common.d.ts | 2 +- api/@internal/component/ets/select.d.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 58bcc860fc..21cce2b5a5 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -890,7 +890,7 @@ declare interface KeyEvent { * Component State Styels. * @since 8 */ -declare interface StateStyels { +declare interface StateStyles { /** * Defines normal state styles. * @since 8 diff --git a/api/@internal/component/ets/select.d.ts b/api/@internal/component/ets/select.d.ts index 5a50746e6d..9101b7f30d 100644 --- a/api/@internal/component/ets/select.d.ts +++ b/api/@internal/component/ets/select.d.ts @@ -19,13 +19,13 @@ */ declare interface SelectOption { /** - * options string. + * option string. * @since 8 */ value: ResourceStr; /** - * options icon. + * option icon. * @since 8 */ icon?: ResourceStr; @@ -100,13 +100,13 @@ declare class SelectAttribute extends CommonMethod { * Sets the text style for select items. * @since 8 */ - optionsFont(value: Font): SelectAttribute; + optionFont(value: Font): SelectAttribute; /** * Sets the text color for select items. * @since 8 */ - optionsFontColor(value: ResourceColor): SelectAttribute; + optionFontColor(value: ResourceColor): SelectAttribute; /** * Callback for selecting an item from the select. -- Gitee From 38e11bdf284035d1fbc14feb4108b44460e5e4c5 Mon Sep 17 00:00:00 2001 From: kukixi Date: Sat, 12 Mar 2022 11:12:05 +0800 Subject: [PATCH 4/5] fix error Signed-off-by: kukixi --- api/@internal/component/ets/select.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@internal/component/ets/select.d.ts b/api/@internal/component/ets/select.d.ts index 9101b7f30d..0c03c35b06 100644 --- a/api/@internal/component/ets/select.d.ts +++ b/api/@internal/component/ets/select.d.ts @@ -94,7 +94,7 @@ declare class SelectAttribute extends CommonMethod { * Sets the background color of the select item. * @since 8 */ - optionsBgColor(value: ResourceColor): SelectAttribute; + optionBgColor(value: ResourceColor): SelectAttribute; /** * Sets the text style for select items. -- Gitee From f5f6ffcbd5ee61261b2b34d60e616d3728b659b9 Mon Sep 17 00:00:00 2001 From: kukixi Date: Sat, 12 Mar 2022 17:07:15 +0800 Subject: [PATCH 5/5] remove time_picker start and end Signed-off-by: kukixi --- BUILD.gn | 1 + api/@internal/component/ets/time_picker.d.ts | 10 ---------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 694bdc60c7..224d9d5957 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -105,6 +105,7 @@ ohos_copy("ets_component") { "api/@internal/component/ets/text_input.d.ts", "api/@internal/component/ets/text_picker.d.ts", "api/@internal/component/ets/text_timer.d.ts", + "api/@internal/component/ets/time_picker.d.ts", "api/@internal/component/ets/toggle.d.ts", "api/@internal/component/ets/units.d.ts", "api/@internal/component/ets/video.d.ts", diff --git a/api/@internal/component/ets/time_picker.d.ts b/api/@internal/component/ets/time_picker.d.ts index 2fe34a033d..4684609296 100644 --- a/api/@internal/component/ets/time_picker.d.ts +++ b/api/@internal/component/ets/time_picker.d.ts @@ -36,16 +36,6 @@ declare interface TimePickerResult { * @since 8 */ declare interface TimePickerOptions { - /** - * Specifies the start Date of the Time selector. - */ - start?: Date; - - /** - * Specifies the end Date for the Time selector. - */ - end?: Date; - /** * Specifies the time selector check time. */ -- Gitee