From a952b331003b02d639c32e0cecc4ef0ed880425d Mon Sep 17 00:00:00 2001 From: yaoyuchi Date: Wed, 16 Mar 2022 10:48:43 +0800 Subject: [PATCH] fixed 9be27e6 from https://gitee.com/superFat/interface_sdk-js/pulls/1153 add type and ProgressType Signed-off-by: yaoyuchi --- api/@internal/component/ets/middle_class.d.ts | 2 +- api/@internal/component/ets/progress.d.ts | 74 ++++++++++++++++++- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/api/@internal/component/ets/middle_class.d.ts b/api/@internal/component/ets/middle_class.d.ts index 6470485b21..adad7410a1 100644 --- a/api/@internal/component/ets/middle_class.d.ts +++ b/api/@internal/component/ets/middle_class.d.ts @@ -1247,7 +1247,7 @@ declare class TSProgressAttribute extends CommonMethod { * @systemapi * @since 8 */ - create(object: { value: number; total?: number; style?: ProgressStyle }): ProgressAttribute; + create(options: ProgressOptions): ProgressAttribute; /** * Used for TS compiler. * @ignore diff --git a/api/@internal/component/ets/progress.d.ts b/api/@internal/component/ets/progress.d.ts index a0ba3f6ca0..9f1855b8dd 100644 --- a/api/@internal/component/ets/progress.d.ts +++ b/api/@internal/component/ets/progress.d.ts @@ -13,6 +13,78 @@ * limitations under the License. */ +/** + * Defines the option of Progress. + * @since 7 + */ + declare interface ProgressOptions { + /** + * Sets the value of Progress. + * @since 7 + */ + value: number; + + /** + * Sets the total of Progress. + * @since 7 + */ + total?: number; + + /** + * Sets the style of Progress. + * @since 7 + * @deprecated since 8 + */ + style?: ProgressStyle + + /** + * Sets the type of Progress. + * @since 8 + */ + type?: ProgressType +} + +/** + * Type of progress bar + * @since 8 + */ +declare enum ProgressType { + /** + * Linear progress bar style. + * @devices phone, tablet, car. + * @since 8 + */ + Linear, + + /** + * Ring progress bar. + * @devices phone, tablet, car. + * @since 8 + */ + Ring, + + /** + * Eclipse progress bar. + * @devices phone, tablet, car. + * @since 8 + */ + Eclipse, + + /** + * ScaleRing progress bar. + * @devices phone, tablet, car. + * @since 8 + */ + ScaleRing, + + /** + * Capsule progress bar. + * @devices phone, tablet, car. + * @since 8 + */ + Capsule, +} + /** * Defines style options for progress component. * @since 8 @@ -82,7 +154,7 @@ interface ProgressInterface { * Called when the progress bar is set. * @since 7 */ - (object: { value: number; total?: number; style?: ProgressStyle }): ProgressAttribute; + (options: ProgressOptions): ProgressAttribute; } /** -- Gitee