diff --git a/BUILD.gn b/BUILD.gn index 8386556495fcb4f056eeea3d6c3d224a64de8cb0..a88bb2958bd48a46a59ed52175a1ec828ea0f0fc 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -29,7 +29,6 @@ ohos_copy("ets_internal_api") { ohos_copy("ets_component") { sources = [ "api/@internal/component/ets/ability_component.d.ts", - "api/@internal/component/ets/action_sheet.d.ts", "api/@internal/component/ets/alert_dialog.d.ts", "api/@internal/component/ets/alphabet_indexer.d.ts", "api/@internal/component/ets/animator.d.ts", @@ -37,22 +36,22 @@ ohos_copy("ets_component") { "api/@internal/component/ets/blank.d.ts", "api/@internal/component/ets/button.d.ts", "api/@internal/component/ets/calendar.d.ts", - "api/@internal/component/ets/camera.d.ts", "api/@internal/component/ets/circle.d.ts", "api/@internal/component/ets/column.d.ts", "api/@internal/component/ets/column_split.d.ts", "api/@internal/component/ets/common.d.ts", "api/@internal/component/ets/counter.d.ts", "api/@internal/component/ets/custom_dialog_controller.d.ts", - "api/@internal/component/ets/datapanel.d.ts", - "api/@internal/component/ets/datePicker.d.ts", + "api/@internal/component/ets/data_panel.d.ts", + "api/@internal/component/ets/date_picker.d.ts", "api/@internal/component/ets/divider.d.ts", "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/forEach.d.ts", "api/@internal/component/ets/form_component.d.ts", "api/@internal/component/ets/gauge.d.ts", - "api/@internal/component/ets/geometryView.d.ts", + "api/@internal/component/ets/geometry_view.d.ts", "api/@internal/component/ets/gesture.d.ts", "api/@internal/component/ets/grid.d.ts", "api/@internal/component/ets/gridItem.d.ts", @@ -65,12 +64,10 @@ ohos_copy("ets_component") { "api/@internal/component/ets/line.d.ts", "api/@internal/component/ets/list.d.ts", "api/@internal/component/ets/listItem.d.ts", - "api/@internal/component/ets/loadingProgress.d.ts", + "api/@internal/component/ets/loading_progress.d.ts", "api/@internal/component/ets/marquee.d.ts", - "api/@internal/component/ets/menu.d.ts", + "api/@internal/component/ets/navigation.d.ts", "api/@internal/component/ets/navigator.d.ts", - "api/@internal/component/ets/navigatorView.d.ts", - "api/@internal/component/ets/option.d.ts", "api/@internal/component/ets/pageTransition.d.ts", "api/@internal/component/ets/panel.d.ts", "api/@internal/component/ets/path.d.ts", @@ -96,10 +93,11 @@ ohos_copy("ets_component") { "api/@internal/component/ets/tab_content.d.ts", "api/@internal/component/ets/tabs.d.ts", "api/@internal/component/ets/text.d.ts", - "api/@internal/component/ets/textPicker.d.ts", - "api/@internal/component/ets/textarea.d.ts", - "api/@internal/component/ets/textinput.d.ts", + "api/@internal/component/ets/text_area.d.ts", + "api/@internal/component/ets/text_input.d.ts", + "api/@internal/component/ets/text_picker.d.ts", "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/web.d.ts", ] diff --git a/api/@internal/component/ets/ability_component.d.ts b/api/@internal/component/ets/ability_component.d.ts index 9c5cb73a2855dbafa99ee28534ae686c1ce3c07e..6375574cc39f560f6a56539ff71a1e00758b4385 100644 --- a/api/@internal/component/ets/ability_component.d.ts +++ b/api/@internal/component/ets/ability_component.d.ts @@ -1,119 +1,107 @@ -/* - * 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. - */ - -import {CommonMethod} from "./common"; -import {Want} from "../api/common/ability/want"; - -/** - * controller of ability. - * @devices phone, tablet, car. - * @since 7 - */ -export declare class AbilityController { - /** - * constructor. - * @devices phone, tablet, car. - * @since 7 - */ - constructor(); - - /** - * load the ability in the AbilityComponent. - * Want: Capability description to be loaded - * @devices phone, tablet, car. - * @since 7 - */ - startAbility(value: Want); - - /** - * Perform a return operation inside the AbilityComponent. - * @devices phone, tablet, car. - * @since 7 - */ - performBackPress(); - - /** - * Obtains the number of tasks in the internal task stack of the AbilityComponent. - * @devices phone, tablet, car. - * @since 7 - */ - getStackCount(); -} - -/** - * @devices phone, tablet, car. - * @since 7 - */ -export declare class AbilityComponentExtend extends AbilityComponentAttribute { -} - -/** - * AbilityComponent inheritance abilitycomponentattribute. - * Want: Capability description to be loaded. - * controller: Ability Controller. - * @devices phone, tablet, car. - * @since 7 - */ -interface AbilityComponent extends AbilityComponentAttribute { - (value: { want: Want, controller?: AbilityController }): AbilityComponent; -} - -/** - * The attribute of ability. - * @devices phone, tablet, car. - * @since 7 - */ -declare class AbilityComponentAttribute extends CommonMethod { - /** - * Callback when the abilityComponent environment starts up, after which the abilityController methods can be used. - * @devices phone, tablet, car. - * @since 7 - */ - onReady(event: () => void): T; - - /** - * Callback when the abilityComponent environment is destroyed. - * @devices phone, tablet, car. - * @since 7 - */ - onDestroy(event: () => void): T; - - /** - * This event is triggered when the abilityComponent loads the mobility. Name indicates the Ability name. - * @devices phone, tablet, car. - * @since 7 - */ - onAbilityCreated(event: (name: string) => void): T; - - /** - * Internal to the AbilityComponent, which is triggered when the Ability moves to the foreground. - * @devices phone, tablet, car. - * @since 7 - */ - onAbilityMoveToFront(event: () => void): T; - - /** - * Internal to the AbilityComponent, which is triggered before the Mobility is removed. - * @devices phone, tablet, car. - * @since 7 - */ - onAbilityWillRemove(event: () => void): T; -} - -/** - * @devices phone, tablet, car. - * @since 7 - */ -export declare const AbilityComponentInterface: AbilityComponent; +/* + * 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. + */ + +import { CommonMethod } from "./common"; +import { Want } from "../api/common/ability/want"; + +/** + * controller of ability. + * @since 7 + * @systemapi + */ +export declare class AbilityController { + /** + * constructor. + */ + constructor(); + + /** + * load the ability in the AbilityComponent. + * Want: Capability description to be loaded + */ + startAbility(value: Want); + + /** + * Perform a return operation inside the AbilityComponent. + */ + performBackPress(); + + /** + * Obtains the number of tasks in the internal task stack of the AbilityComponent. + */ + getStackCount(); +} + +/** + * AbilityComponent constructor params. + * @since 7 + * @systemapi + */ +export declare interface AbilityComponentOptions { + /** + * Capability description to be loaded. + */ + want: Want; + + /** + * controller: Ability Controller. + */ + controller?: AbilityController; +} + +/** + * AbilityComponent inheritance abilitycomponentattribute. + * @since 7 + * @systemapi + */ +interface AbilityComponent extends AbilityComponentAttribute { + (value: AbilityComponentOptions): AbilityComponent; +} + +/** + * The attribute of ability. + * @since 7 + * @systemapi + */ +declare class AbilityComponentAttribute extends CommonMethod { + /** + * Callback when the abilityComponent environment starts up, after which the abilityController methods can be used. + */ + onReady(event: () => void): T; + + /** + * Callback when the abilityComponent environment is destroyed. + */ + onDestroy(event: () => void): T; + + /** + * This event is triggered when the abilityComponent loads the mobility. Name indicates the Ability name. + */ + onAbilityCreated(event: (name: string) => void): T; + + /** + * Internal to the AbilityComponent, which is triggered when the Ability moves to the foreground. + */ + onAbilityMoveToFront(event: () => void): T; + + /** + * Internal to the AbilityComponent, which is triggered before the Mobility is removed. + */ + onAbilityWillRemove(event: () => void): T; +} + +// Used for IDE. +export declare class AbilityComponentExtend extends AbilityComponentAttribute {} +export declare const AbilityComponentInterface: AbilityComponent; diff --git a/api/@internal/component/ets/action_sheet.d.ts b/api/@internal/component/ets/action_sheet.d.ts deleted file mode 100644 index cffda349124564c3bbc28f1e150418497b8c4226..0000000000000000000000000000000000000000 --- a/api/@internal/component/ets/action_sheet.d.ts +++ /dev/null @@ -1,93 +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. - */ - -import { DialogAlignment } from "./alert_dialog"; -import {CommonMethod, Resource} from "./common" - -/** - * The information of sheet. - * @devices phone, tablet, car. - * @since 7 - */ -interface SheetInfo { - /** - * Title Properties - * @devices phone, tablet, car. - * @since 7 - */ - title: string | Resource; - - /** - * Icon Properties. - * @devices phone, tablet, car. - * @since 7 - */ - icon?: string | Resource; - - /** - * Callback method after the operation. - * @devices phone, tablet, car. - * @since 7 - */ - action: () => void; -} - -/** - * Callback method after the operation. - * @devices phone, tablet, car. - * @since 7 - */ -export declare class ActionSheetExtend extends ActionSheetAttribute { -} - -/** - * create ActionSheet. - * @devices phone, tablet, car. - * @since 7 - */ -interface ActionSheet extends ActionSheetAttribute { -} - -/** - * @devices phone, tablet, car. - * @since 7 - */ -declare class ActionSheetAttribute extends CommonMethod { - /** - * Invoking method display. - * @devices phone, tablet, car. - * @since 7 - */ - show(value: { - title: string | Resource; - message: string | Resource; - confirm?: { - value: string | Resource; - action: () => void; - }; - cancel?: () => void; - sheets: Array; - autoCancel?: boolean; - alignment?: DialogAlignment; - offset?: { dx: number | string | Resource, dy: number | string | Resource }; - }); -} - -/** - * Definitions ActionSheetInterface. - * @devices phone, tablet, car. - * @since 7 - */ -export declare const ActionSheetInterface: ActionSheet; diff --git a/api/@internal/component/ets/alert_dialog.d.ts b/api/@internal/component/ets/alert_dialog.d.ts index f87e0485b4816e0f0d40d6177156fdda93e47a52..632988ed228461bbdb926bb7990f4400a2e10448 100644 --- a/api/@internal/component/ets/alert_dialog.d.ts +++ b/api/@internal/component/ets/alert_dialog.d.ts @@ -1,219 +1,205 @@ -/* - * 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. - */ - -import {CommonMethod, Resource} from "./common" - -/** - * The alignment of dialog, - * @devices phone, tablet, car. - * @since 7 - */ -export declare enum DialogAlignment { - /** - * Vertical top alignment. - * @devices phone, tablet, car. - * @since 7 - */ - Top, - - /** - * Align vertically to the center. - * @devices phone, tablet, car. - * @since 7 - */ - Center, - - /** - * Vertical bottom alignment. - * @devices phone, tablet, car. - * @since 7 - */ - Bottom, - - /** - * Default alignment. - * @devices phone, tablet, car. - * @since 7 - */ - Default -} - -/** - * @devices phone, tablet, car. - * @since 7 - */ -interface AlertDialog { - /** - * Invoking method display. - * @devices phone, tablet, car. - * @since 7 - */ - show(value: { - /** - * Title Properties - * @devices phone, tablet, car. - * @since 7 - */ - title?: string | Resource; - - /** - * message Properties - * @devices phone, tablet, car. - * @since 7 - */ - message: string | Resource; - - /** - * Allows users to click the mask layer to exit. - * @devices phone, tablet, car. - * @since 7 - */ - autoCancel?: boolean; - - /** - * Invoke the commit function. - * @devices phone, tablet, car. - * @since 7 - */ - confirm?: { - - /** - * Text content of the confirmation button. - * @devices phone, tablet, car. - * @since 7 - */ - value: string | Resource; - - /** - * Method executed by the callback. - * @devices phone, tablet, car. - * @since 7 - */ - action: () => void; - }; - - /** - * Execute Cancel Function. - * @devices phone, tablet, car. - * @since 7 - */ - cancel?: () => void; - - /** - * Alignment in the vertical direction. - * @devices phone, tablet, car. - * @since 7 - */ - alignment?: DialogAlignment; - - /** - * Offset of the pop-up window relative to the alignment position. - * @devices phone, tablet, car. - * @since 7 - */ - offset?: { dx: number | string | Resource, dy: number | string | Resource }; - } | { - - /** - * Title Properties - * @devices phone, tablet, car. - * @since 7 - */ - title?: string | Resource; - - /** - * message Properties - * @devices phone, tablet, car. - * @since 7 - */ - message: string | Resource; - - /** - * Allows users to click the mask layer to exit. - * @devices phone, tablet, car. - * @since 7 - */ - autoCancel?: boolean; - - /** - * First button. - * @devices phone, tablet, car. - * @since 7 - */ - primaryButton: { - /** - * Text content of the confirmation button. - * @devices phone, tablet, car. - * @since 7 - */ - value: string | Resource; - - /** - * Method executed by the callback. - * @devices phone, tablet, car. - * @since 7 - */ - action: () => void; - }; - - /** - * Second button. - * @devices phone, tablet, car. - * @since 7 - */ - secondaryButton: { - /** - * Text content of the confirmation button. - * @devices phone, tablet, car. - * @since 7 - */ - value: string | Resource; - - /** - * Method executed by the callback. - * @devices phone, tablet, car. - * @since 7 - */ - action: () => void; - }; - - /** - * Execute Cancel Function. - * @devices phone, tablet, car. - * @since 7 - */ - cancel?: () => void; - - /** - * Alignment in the vertical direction. - * @devices phone, tablet, car. - * @since 7 - */ - alignment?: DialogAlignment; - - /** - * Offset of the pop-up window relative to the alignment position. - * @devices phone, tablet, car. - * @since 7 - */ - offset?: { dx: number | string | Resource, dy: number | string | Resource }; - }); -} - -/** - * @devices phone, tablet, car. - * @since 7 - */ -export declare const AlertDialogInterface: AlertDialog; +/* + * 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. + */ + +import { ResourceColor } from "."; +import { Offset, ResourceStr } from "./units"; + +/** + * The alignment of dialog, + * @since 7 + */ +export declare enum DialogAlignment { + /** + * Vertical top alignment. + * @since 7 + */ + Top, + + /** + * Align vertically to the center. + * @since 7 + */ + Center, + + /** + * Vertical bottom alignment. + * @since 7 + */ + Bottom, + + /** + * Default alignment. + * @since 7 + */ + Default, +} + +/** + * Base param used for AlertDialog.show method. + * @since 7 + */ +export declare interface AlertDialogParam { + /** + * Title Properties + * @since 7 + */ + title?: ResourceStr; + + /** + * message Properties + * @since 7 + */ + message: ResourceStr; + + /** + * Allows users to click the mask layer to exit. + * @since 7 + */ + autoCancel?: boolean; + + /** + * Execute Cancel Function. + * @since 7 + */ + cancel?: () => void; + + /** + * Alignment in the vertical direction. + * @since 7 + */ + alignment?: DialogAlignment; + + /** + * Offset of the pop-up window relative to the alignment position. + * @since 7 + */ + offset?: Offset; + + /** + * Grid count of dialog. + * @since 7 + */ + gridCount?: number; +} + +/** + * Defines the AlertDialog with confirm button. + * @since 7 + */ +export declare interface AlertDialogParamWithConfirm extends AlertDialogParam { + /** + * Invoke the commit function. + * @since 7 + */ + confirm?: { + /** + * Text content of the confirmation button. + * @since 7 + */ + value: ResourceStr; + + /** + * Text color of the confirmation button. + * @since 7 + */ + fontColor?: ResourceColor; + + /** + * Backgound color of the confirmation button. + * @since 7 + */ + backgroundColor?: ResourceColor; + + /** + * Method executed by the callback. + * @since 7 + */ + action: () => void; + }; +} + +export declare interface AlertDialogParamWithButtons extends AlertDialogParam { + /** + * First button. + * @since 7 + */ + primaryButton: { + /** + * Text content of the confirmation button. + * @since 7 + */ + value: ResourceStr; + + /** + * Text color of the confirmation button. + * @since 7 + */ + fontColor?: ResourceColor; + + /** + * Backgound color of the confirmation button. + * @since 7 + */ + backgroundColor?: ResourceColor; + + /** + * Method executed by the callback. + * @since 7 + */ + action: () => void; + }; + + /** + * Second button. + * @since 7 + */ + secondaryButton: { + /** + * Text content of the confirmation button. + * @since 7 + */ + value: ResourceStr; + + /** + * Text color of the confirmation button. + * @since 7 + */ + fontColor?: ResourceColor; + + /** + * Backgound color of the confirmation button. + * @since 7 + */ + backgroundColor?: ResourceColor; + + /** + * Method executed by the callback. + * @since 7 + */ + action: () => void; + }; +} + +/** + * Defines AlertDialog which uses show method to show alert dialog. + * @since 7 + */ +export declare class AlertDialog { + /** + * Invoking method display. + * @since 7 + */ + static show(value: AlertDialogParamWithConfirm | AlertDialogParamWithButtons); +} diff --git a/api/@internal/component/ets/alphabet_indexer.d.ts b/api/@internal/component/ets/alphabet_indexer.d.ts index 62d06cf8a5a937c1877562cf389d3e60505a79fe..57aa49bc45496317188e5d3510b2ced89af72bb8 100644 --- a/api/@internal/component/ets/alphabet_indexer.d.ts +++ b/api/@internal/component/ets/alphabet_indexer.d.ts @@ -13,144 +13,117 @@ * limitations under the License. */ -import {CommonMethod, Color, Resource} from "./common"; -import {FontWeight, FontStyle} from "./text"; +import { CommonMethod } from "./common"; +import { ResourceColor, Font } from "./units"; /** - * @devices phone, tablet, car. + * indexer align property. * @since 7 */ export declare enum IndexerAlign { /** * A dialog box is displayed on the right of the index bar. - * @devices phone, tablet, car. * @since 7 */ Left, /** * A dialog box is displayed on the left of the index bar. - * @devices phone, tablet, car. * @since 7 */ - Right + Right, } /** * Alphabet index bar. - * @devices phone, tablet, car. - * @since 7 - */ -export declare class AlphabetIndexerExtend extends AlphabetIndexerAttribute { -} - -/** - * Alphabet index bar. - * @devices phone, tablet, car. * @since 7 */ interface AlphabetIndexer extends AlphabetIndexerAttribute { /** * ArrayValue: Alphabetical index string array. * selected: ID of the selected item. - * @devices phone, tablet, car. * @since 7 */ - (value: {ArrayValue : Array, selected : number}): AlphabetIndexer; + (value: { arrayValue: Array; selected: number }): AlphabetIndexer; } /** - * @devices phone, tablet, car. + * Defines the alphabet index bar attribute functions. * @since 7 */ declare class AlphabetIndexerAttribute extends CommonMethod { /** * Index bar selection callback. - * @devices phone, tablet, car. * @since 7 */ onSelected(event: (index: number) => void): T; /** * Definitions color. - * @devices phone, tablet, car. * @since 7 */ - color(value: Color | number | string | Resource): T; + color(value: ResourceColor): T; /** * Select the text color. - * @devices phone, tablet, car. * @since 7 */ - selectedColor(value: Color | number | string | Resource): T; + selectedColor(value: ResourceColor): T; /** * Font color of the pop-up prompt text. - * @devices phone, tablet, car. * @since 7 */ - popupColor(value: Color | number | string | Resource): T; + popupColor(value: ResourceColor): T; /** * Select the text background color. - * @devices phone, tablet, car. * @since 7 */ - selectedBackgroundColor(value: Color | number | string | Resource): T; + selectedBackgroundColor(value: ResourceColor): T; /** * Background color of the pop-up window index. - * @devices phone, tablet, car. * @since 7 */ - popupBackground(value: Color | number | string | Resource): T; + popupBackground(value: ResourceColor): T; /** * Whether to use pop-up index hints. - * @devices phone, tablet, car. * @since 7 */ usingPopup(value: boolean): T; /** * Select the text text style, - * @devices phone, tablet, car. * @since 7 */ - selectedFont(value: { size?: number, weight?: FontWeight, family?: string, style?: FontStyle}): T; + selectedFont(value: Font): T; /** * Select the text background color. - * @devices phone, tablet, car. * @since 7 */ - popupFont(value: { size?: number, weight?: FontWeight, family?: string, style?: FontStyle}): T; + popupFont(value: Font): T; /** * Size of the letter area on the letter index bar. The letter area is a square. Set the length of the square side. - * @devices phone, tablet, car. * @since 7 */ itemSize(value: string | number): T; /** * Definitions fonts. - * @devices phone, tablet, car. * @since 7 */ - font(value: { size?: number, weight?: FontWeight, family?: string, style?: FontStyle}): T; + font(value: Font): T; /** * Alphabet index bar alignment style. The left and right alignment styles are supported, which affects the pop-up position of the pop-up window. - * @devices phone, tablet, car. * @since 7 */ alignStyle(value: IndexerAlign): T; } -/** - * @devices phone, tablet, car. - * @since 7 - */ export declare const AlphabetIndexerInterface: AlphabetIndexer; +export declare class AlphabetIndexerExtend extends AlphabetIndexerAttribute {} diff --git a/api/@internal/component/ets/animator.d.ts b/api/@internal/component/ets/animator.d.ts index 8af79b70894682b05f7137e666f91c0fbca73e21..55c27f5f673644ef8c0e040663572119fc1bdb29 100644 --- a/api/@internal/component/ets/animator.d.ts +++ b/api/@internal/component/ets/animator.d.ts @@ -13,185 +13,183 @@ * limitations under the License. */ -import {CommonMethod, AnimationStatus, Curve, FillMode, PlayMode} from "./common"; +import { CommonMethod } from "./common"; +import { AnimationStatus, Curve, FillMode, PlayMode } from "./enums"; /** * Customize spring properties. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ export declare class SpringProp { /** * Constructor parameters - * @devices object, tablet. * @since 7 + * @systemapi */ constructor(mass: number, stiffness: number, damping: number); } /** * Spring animation model. You can build a spring animation based on the start point, end point, initial speed, and spring attributes. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ export declare class SpringMotion { /** * Constructor parameters - * @devices phone, tablet, car. * @since 7 + * @systemapi */ constructor(start: number, end: number, velocity: number, prop: SpringProp); } /** * Friction animation model. You can build friction animation by friction force, initial position, and initial velocity. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ export declare class FrictionMotion { /** * Constructor parameters - * @devices phone, tablet, car. * @since 7 + * @systemapi */ constructor(friction: number, position: number, velocity: number); } /** * Rolling animation model: You can build rolling animation based on the initial position, initial speed, boundary position, and spring attributes. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ export declare class ScrollMotion { /** * Constructor parameters - * @devices phone, tablet, car. * @since 7 + * @systemapi */ constructor(position: number, velocity: number, min: number, max: number, prop: SpringProp); } /** - * @devices phone, tablet, car. - * @since 7 - */ -export declare class AnimatorExtend extends AnimatorAttribute { -} - -/** - * @devices phone, tablet, car. + * Defines Animtor. * @since 7 + * @systemapi */ interface Animator extends AnimatorAttribute { + /** + * Constructor parameters + * @since 7 + * @systemapi + */ (value: string): Animator; } /** - * @devices phone, tablet, car. + * Defines AnimatorAttribute. * @since 7 + * @systemapi */ declare class AnimatorAttribute extends CommonMethod { /** * Controls the playback status. The default value is the initial state. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ state(value: AnimationStatus): T; /** * Animation duration, in milliseconds. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ duration(value: number): T; /** * Animation curve, default to linear curve - * @devices phone, tablet, car. * @since 7 + * @systemapi */ curve(value: Curve): T; /** * Delayed animation playback duration, in milliseconds. By default, the animation is not delayed. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ delay(value: number): T; /** * Sets the state before and after the animation starts. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ fillMode(value: FillMode): T; /** * The default playback is once. If the value is -1, the playback is unlimited. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ iterations(value: number): T; /** * Sets the animation playback mode. By default, the animation starts to play again after the playback is complete. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ playMode(value: PlayMode): T; /** * Configure the physical animation algorithm. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ motion(value: SpringMotion | FrictionMotion | ScrollMotion): T; /** * Status callback, which is triggered when the animation starts to play. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ onStart(event: () => void): T; /** * Status callback, triggered when the animation pauses. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ onPause(event: () => void): T; /** * Status callback, triggered when the animation is replayed. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ onRepeat(event: () => void): T; /** * Status callback, which is triggered when the animation is canceled. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ onCancel(event: () => void): T; /** * Status callback, which is triggered when the animation playback is complete. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ onFinish(event: () => void): T; /** * The callback input parameter is the interpolation during animation playback. - * @devices phone, tablet, car. * @since 7 + * @systemapi */ onFrame(event: (value: number) => void): T; } -/** - * @devices phone, tablet, car. - * @since 7 - */ -export declare const AnimatorInterface: Animator; \ No newline at end of file +export declare class AnimatorExtend extends AnimatorAttribute {} +export declare const AnimatorInterface: Animator; diff --git a/api/@internal/component/ets/badge.d.ts b/api/@internal/component/ets/badge.d.ts index b29e7a7f32f52fa730619900ead5a8f2838a7b01..8b955feb71a2e526e139d3d2613d493cdc4ec93c 100644 --- a/api/@internal/component/ets/badge.d.ts +++ b/api/@internal/component/ets/badge.d.ts @@ -1,124 +1,152 @@ -/* - * 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. - */ - -import {CommonMethod, Color, Resource} from "./common" - -/** - * @devices phone, tablet, car. - * @since 7 - */ -declare enum BadgePosition { - /** - * The dot is displayed vertically centered on the right. - * @devices phone, tablet, car. - * @since 7 - */ - RightTop, - - /** - * Dots are displayed in the upper right corner. - * @devices phone, tablet, car. - * @since 7 - */ - Right, - - /** - * The dot is displayed in the left vertical center. - * @devices phone, tablet, car. - * @since 7 - */ - Left -} - -/** - * BadgeStyle object - * @devices phone, tablet, car. - * @since 7 - */ -interface BadgeStyle { - /** - * Text Color - * @devices phone, tablet, car. - * @since 7 - */ - color?: Color | number | string | Resource; - - /** - * Text size. - * @devices phone, tablet, car. - * @since 7 - */ - fontSize?: number | string; - - /** - * Size of a badge. - * @devices phone, tablet, car. - * @since 7 - */ - badgeSize: number | string; - - /** - * Color of the badge. - * @devices phone, tablet, car. - * @since 7 - */ - badgeColor: Color | number | string | Resource; -} - -/** - * @devices phone, tablet, car. - * @since 7 - */ -export declare class BadgeExtend extends BadgeAttribute { -} - -/** - * @devices phone, tablet, car. - * @since 7 - */ -interface Badge extends BadgeAttribute { - /** - * position: Set the display position of the prompt point. - * maxCount: Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. - * count: Set the number of reminder messages. - * style: You can set the style of the Badge component, including the text color, size, dot color, and size. - * @devices phone, tablet, car. - * @since 7 - */ - (value: {count: number, position?: BadgePosition, maxCount?: number, style: BadgeStyle}): Badge; - - /** - * value: Text string of the prompt content. - * position: Set the display position of the prompt point. - * maxCount: Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. - * style: You can set the style of the Badge component, including the text color, size, dot color, and size. - * @devices phone, tablet, car. - * @since 7 - */ - (value: {value: string, position?: BadgePosition, maxCount?: number, style: BadgeStyle}): Badge; -} - -/** - * @devices phone, tablet, car. - * @since 7 - */ -declare class BadgeAttribute extends CommonMethod { -} - -/** - * @devices phone, tablet, car. - * @since 7 - */ -export declare const BadgeInterface: Badge \ No newline at end of file +/* + * 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. + */ + +import { CommonMethod } from "./common"; +import { ResourceColor } from "./units"; + +/** + * Defines the badge position property. + * @since 7 + */ +export declare enum BadgePosition { + /** + * The dot is displayed vertically centered on the right. + * @since 7 + */ + RightTop, + + /** + * Dots are displayed in the upper right corner. + * @since 7 + */ + Right, + + /** + * The dot is displayed in the left vertical center. + * @since 7 + */ + Left, +} + +/** + * BadgeStyle object + * @since 7 + */ +export declare interface BadgeStyle { + /** + * Text Color + * @since 7 + */ + color?: ResourceColor; + + /** + * Text size. + * @since 7 + */ + fontSize?: number | string; + + /** + * Size of a badge. + * @since 7 + */ + badgeSize?: number | string; + + /** + * Color of the badge. + * @since 7 + */ + badgeColor?: ResourceColor; +} + +/** + * Defines the base param of badge. + * @since 7 + */ +export declare interface BadgeParam { + /** + * Set the display position of the prompt point. + * @since 7 + */ + position?: BadgePosition; + + /** + * Defines the style of the Badge component, including the text color, size, dot color, and size. + * @since 7 + */ + style: BadgeStyle; +} + +/** + * Defines the badge param with count and maxCount. + * @since 7 + */ +export declare interface BadgeParamWithNumber extends BadgeParam { + /** + * Set the number of reminder messages. + * @since 7 + */ + count: number; + + /** + * Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. + * @since 7 + */ + maxCount?: number; +} + +/** + * Defines the badge param with string value. + * @since 7 + */ +export declare interface BadgeParamWithString extends BadgeParam { + /** + * Text string of the prompt content. + * @since 7 + */ + value: string; +} + +/** + * Defines Badge Componrnt. + * @since 7 + */ +interface Badge extends BadgeAttribute { + /** + * position: Set the display position of the prompt point. + * maxCount: Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. + * count: Set the number of reminder messages. + * style: You can set the style of the Badge component, including the text color, size, dot color, and size. + * @since 7 + */ + (value: BadgeParamWithNumber): Badge; + + /** + * value: Text string of the prompt content. + * position: Set the display position of the prompt point. + * maxCount: Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed. + * style: You can set the style of the Badge component, including the text color, size, dot color, and size. + * @since 7 + */ + (value: BadgeParamWithString): Badge; +} + +/** + * Defines Badge Componrnt attribute. + * @since 7 + */ +declare class BadgeAttribute extends CommonMethod {} + +export declare class BadgeExtend extends BadgeAttribute {} +export declare const BadgeInterface: Badge; diff --git a/api/@internal/component/ets/blank.d.ts b/api/@internal/component/ets/blank.d.ts index 322e46cd5495ce0c5062b4ba540acba43a035ff7..782cf284d358d31b6fe8f024728e09efd3114b4b 100644 --- a/api/@internal/component/ets/blank.d.ts +++ b/api/@internal/component/ets/blank.d.ts @@ -13,45 +13,32 @@ * limitations under the License. */ -import {CommonMethod, Color, Resource} from "./common" +import { CommonMethod } from "./common"; +import { ResourceColor } from "./units"; /** - * @devices phone, tablet, car. - * @since 7 - */ -export declare class BlankExtend extends BlankAttribute { -} - -/** - * Create Blank - * @devices phone, tablet, car. + * Create Blank. * @since 7 */ interface Blank extends BlankAttribute { /** * The minimum size of the blank fill assembly on the container spindle. - * @devices phone, tablet, car. * @since 7 */ (min?: number | string): Blank; } /** - * inheritance CommonMethod Set Styles - * @devices phone, tablet, car. + * Inheritance CommonMethod Set Styles * @since 7 */ declare class BlankAttribute extends CommonMethod { /** * color: set color. - * @devices phone, tablet, car. * @since 7 */ - color(value: Color | number | string | Resource): T; + color(value: ResourceColor): T; } -/** - * @devices phone, tablet, car. - * @since 7 - */ -export declare const BlankInterface: Blank \ No newline at end of file +export declare class BlankExtend extends BlankAttribute {} +export declare const BlankInterface: Blank; diff --git a/api/@internal/component/ets/button.d.ts b/api/@internal/component/ets/button.d.ts index 68404dbb96affa5ea08a94810436aa30ffaed798..8eab0ed01ace07c182085ccdc22b55e3f2c48d3b 100644 --- a/api/@internal/component/ets/button.d.ts +++ b/api/@internal/component/ets/button.d.ts @@ -13,124 +13,111 @@ * limitations under the License. */ -import {CommonMethod, Color, Resource} from "./common" -import {FontWeight} from "./text" +import { CommonMethod } from "./common"; +import { FontWeight } from "./enums"; +import { Length, ResourceColor, ResourceStr } from "./units"; /** * Provides a button component. - * @devices phone, tablet, car. * @since 7 */ export declare enum ButtonType { /** * Capsule button (rounded corners default to half the height). - * @devices phone, tablet, car. * @since 7 */ Capsule, /** * Round buttons. - * @devices phone, tablet, car. * @since 7 */ Circle, - /** - * Arc Button. - * @devices phone, tablet, car. - * @since 7 - */ - Arc, - /** * Common button (no rounded corners by default). - * @devices phone, tablet, car. * @since 7 */ - Normal + Normal, } /** - * @devices phone, tablet, car. + * Defines the button options. * @since 7 */ -export declare class ButtonExtend extends ButtonAttribute { +export declare interface ButtonOption { + /** + * Describes the button style. + * @since 7 + */ + type?: ButtonType; + + /** + * Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled. + * @since 7 + */ + stateEffect?: boolean; } /** - * @devices phone, tablet, car. + * Defines the Button Component. * @since 7 */ interface Button extends ButtonAttribute