diff --git a/BUILD.gn b/BUILD.gn index f7d21c2b719f1c13aeff64807f7f9667bf0501ae..8386556495fcb4f056eeea3d6c3d224a64de8cb0 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -82,9 +82,11 @@ ohos_copy("ets_component") { "api/@internal/component/ets/radio.d.ts", "api/@internal/component/ets/rating.d.ts", "api/@internal/component/ets/rect.d.ts", + "api/@internal/component/ets/refresh.d.ts", "api/@internal/component/ets/row.d.ts", "api/@internal/component/ets/row_split.d.ts", "api/@internal/component/ets/scroll.d.ts", + "api/@internal/component/ets/search.d.ts", "api/@internal/component/ets/shape.d.ts", "api/@internal/component/ets/slider.d.ts", "api/@internal/component/ets/span.d.ts", @@ -99,6 +101,7 @@ ohos_copy("ets_component") { "api/@internal/component/ets/textinput.d.ts", "api/@internal/component/ets/toggle.d.ts", "api/@internal/component/ets/video.d.ts", + "api/@internal/component/ets/web.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" diff --git a/api/common/@internal/featureability.d.ts b/api/common/@internal/featureability.d.ts index ea3d073280068e2be87ae27700a1360f42683d09..ef50dbd4279017d74cefe1573086d1c2d6dae3cb 100644 --- a/api/common/@internal/featureability.d.ts +++ b/api/common/@internal/featureability.d.ts @@ -299,7 +299,7 @@ export declare class FeatureAbility { * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. * @devices tv, phone, tablet, wearable */ - static callAbility(param: CallAbilityParam): Promise; + static callAbility(param: CallAbilityParam): Promise; /** * Start FA migration. @@ -318,7 +318,7 @@ export declare class FeatureAbility { static subscribeAbilityEvent( param: SubscribeAbilityEventParam, func: Function - ): Promise; + ): Promise; /** * Unsubscribes from events of an AA. @@ -328,7 +328,7 @@ export declare class FeatureAbility { */ static unsubscribeAbilityEvent( param: SubscribeAbilityEventParam - ): Promise; + ): Promise; /** * Sends messages to the destination device. diff --git a/api/common/@internal/global.d.ts b/api/common/@internal/global.d.ts index 48b7de3015b4f75876c35afa23dd1a22f56e3c23..5bedb79596f770fe7de03dcf7bece3377dc8a25c 100644 --- a/api/common/@internal/global.d.ts +++ b/api/common/@internal/global.d.ts @@ -51,6 +51,16 @@ export declare function clearInterval(intervalID?: number): void; */ export declare function clearTimeout(timeoutID?: number): void; +/** + * Get the java interface instance. The java instance needs to register, otherwise it cannot be obtained. + * After obtaining the instance, you can call the function with the same name on the Java side. + * @param name Java interface name, including package path, such as com.example.test.timeinterfaceimpl. + * @returns A promise object is returned. The resolve callback is the object of PA. The reject callback returns the object containing code and error data + * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @since 3 + */ +export declare function createLocalParticleAbility(name?: string): any; + /** * Sets a vsync after which a function will be executed. * @param handler Indicates the function to be called when the vsync trigger. diff --git a/api/common/@internal/viewmodel.d.ts b/api/common/@internal/viewmodel.d.ts index 42e3a7e5e979d245c5db39b642f5a1955e1fb06e..5c80a95a2c6706ee2f13cb7dfb167f1d942b6e83 100644 --- a/api/common/@internal/viewmodel.d.ts +++ b/api/common/@internal/viewmodel.d.ts @@ -14,6 +14,8 @@ */ import { Image, ImageData } from "./global"; +import { WebGLContextAttributes, WebGLRenderingContext } from "../webgl/webgl"; +import { WebGL2RenderingContext } from "../webgl/webgl2"; /** * @devices tv, phone, tablet, wearable @@ -2185,6 +2187,26 @@ export interface CanvasElement extends Element { */ getContext(type: '2d', options?: ContextAttrOptions): CanvasRenderingContext2D; + /** + * Obtains the context of webgl canvas drawing. + * Only parameters related to webgl canvas drawing are supported. + * The return value is a webgl drawing object that provides specific webgl drawing operations. + * @param type identifier defining the drawing context associated to the canvas. + * @param options use this context attributes to creating rendering context. + * @devices tv, phone, tablet, wearable + */ + getContext(type: "webgl", options?: WebGLContextAttributes): WebGLRenderingContext; + + /** + * Obtains the context of webgl2 canvas drawing. + * Only parameters related to webgl2 canvas drawing are supported. + * The return value is a webgl2 drawing object that provides specific webgl2 drawing operations. + * @param type identifier defining the drawing context associated to the canvas. + * @param options use this context attributes to creating rendering context. + * @devices tv, phone, tablet, wearable + */ + getContext(type: "webgl2", options?: WebGLContextAttributes): WebGL2RenderingContext; + /** * Creates a data URI that contains the image display. * @param type A DOMString indicating the image format. The default type is image/png. diff --git a/api/common/@system.app.d.ts b/api/common/@system.app.d.ts index 9fb44ddfa11bb33de077654d714d45f062c677a7..e27ce0ba5abeee1d73392f82674d28872a4b229e 100644 --- a/api/common/@system.app.d.ts +++ b/api/common/@system.app.d.ts @@ -125,4 +125,28 @@ export default class App { * @devices phone, tablet */ static requestFullWindow(options?: RequestFullWindowOptions): void; + + /** + * Set image cache capacity of decoded image count. + * If not set, the application will not cache any decoded image. + * @param value capacity of decoded image count + * @devices tv, phone, tablet, wearable + */ + static setImageCacheCount(value: number): void; + + /** + * Set image cache capacity of raw image data size in Bytes before decode. + * If not set, the application will not cache any raw image data. + * @param value capacity of raw image data size in Bytes. + * @devices tv, phone, tablet, wearable + */ + static setImageRawDataCacheSize(value: number): void; + + /** + * Set image file cache size in Bytes on disk before decode. + * If not set, the application will not cache 100MB image files on disk. + * @param value capacity of image file size in Bytes. + * @devices tv, phone, tablet, wearable + */ + static setImageFileCacheSize(value: number): void; } diff --git a/api/common/@system.router.d.ts b/api/common/@system.router.d.ts index 30350be898c01d1060ffca3836005bc71f1c13d6..b1ae2255732aa0b1c9b0a42a7e404d5d697ea6a8 100644 --- a/api/common/@system.router.d.ts +++ b/api/common/@system.router.d.ts @@ -39,6 +39,26 @@ export interface RouterOptions { params?: Object; } +/** + * @devices tv, phone, tablet, wearable + */ +export interface BackRouterOptions { + /** + * Returns to the page of the specified path. + * If the page with the specified path does not exist in the page stack, router.back() is called by default. + * @devices tv, phone, tablet, wearable + * @since 7 + */ + uri?: string; + + /** + * Data that needs to be passed to the destination page during navigation. + * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @since 7 + */ + params?: Object; +} + /** * @devices tv, phone, tablet, wearable */ @@ -149,7 +169,7 @@ export default class Router { * @devices tv, phone, tablet, wearable * @since 7 */ - static back(options?: RouterOptions): void; + static back(options?: BackRouterOptions): void; /** * Obtains information about the current page params. diff --git a/api/common/@system.sensor.d.ts b/api/common/@system.sensor.d.ts index 2555167033c73b95495790659809c55364aa40fc..0fad549f00475ed0c46d5b8d898bb32674fbf135 100644 --- a/api/common/@system.sensor.d.ts +++ b/api/common/@system.sensor.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * 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 @@ -14,7 +14,11 @@ */ /** - * @devices phone, tablet, wearable, liteWearable + * @SysCap SystemCapability.Sensors.Sensor + * @devices phone, tablet, wearable + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.ACCELEROMETER + * @since 3 */ export interface AccelerometerResponse { /** @@ -40,7 +44,11 @@ export interface AccelerometerResponse { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.ACCELEROMETER + * @since 3 */ export interface subscribeAccelerometerOptions { /** @@ -71,7 +79,10 @@ export interface subscribeAccelerometerOptions { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @import import sensor from '@system.sensor'; + * @since 3 */ export interface CompassResponse { /** @@ -83,7 +94,10 @@ export interface CompassResponse { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @import import sensor from '@system.sensor'; + * @since 3 */ export interface SubscribeCompassOptions { /** @@ -102,7 +116,10 @@ export interface SubscribeCompassOptions { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet + * @import import sensor from '@system.sensor'; + * @since 3 */ export interface ProximityResponse { /** @@ -114,7 +131,10 @@ export interface ProximityResponse { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet + * @import import sensor from '@system.sensor'; + * @since 3 */ export interface SubscribeProximityOptions { /** @@ -133,7 +153,10 @@ export interface SubscribeProximityOptions { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @import import sensor from '@system.sensor'; + * @since 3 */ export interface LightResponse { /** @@ -145,7 +168,10 @@ export interface LightResponse { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @import import sensor from '@system.sensor'; + * @since 3 */ export interface SubscribeLightOptions { /** @@ -164,7 +190,11 @@ export interface SubscribeLightOptions { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable, liteWearable + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.ACTIVITY_MOTION + * @since 3 */ export interface StepCounterResponse { /** @@ -177,26 +207,33 @@ export interface StepCounterResponse { } /** - * @devices phone, tablet, liteWearable + * @SysCap SystemCapability.Sensors.Sensor + * @devices phone, tablet, wearable, liteWearable + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.ACTIVITY_MOTION + * @since 3 */ export interface SubscribeStepCounterOptions { /** * Called when step counter sensor data changes. - * @devices phone, tablet, liteWearable + * @devices phone, tablet, wearable, liteWearable * @since 3 */ success: (data: StepCounterResponse) => void; /** * Called when the listening fails. - * @devices phone, tablet, liteWearable + * @devices phone, tablet, wearable, liteWearable * @since 3 */ fail?: (data: string, code: number) => void; } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable, liteWearable + * @import import sensor from '@system.sensor'; + * @since 3 */ export interface BarometerResponse { /** @@ -208,7 +245,10 @@ export interface BarometerResponse { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable, liteWearable + * @import import sensor from '@system.sensor'; + * @since 3 */ export interface SubscribeBarometerOptions { /** @@ -227,7 +267,11 @@ export interface SubscribeBarometerOptions { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices wearable, liteWearable + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.READ_HEALTH_DATA + * @since 3 */ export interface HeartRateResponse { /** @@ -240,7 +284,11 @@ export interface HeartRateResponse { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices wearable, liteWearable + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.READ_HEALTH_DATA + * @since 3 */ export interface SubscribeHeartRateOptions { /** @@ -259,64 +307,76 @@ export interface SubscribeHeartRateOptions { } /** - * @devices liteWearable + * @SysCap SystemCapability.Sensors.Sensor + * @devices wearable, liteWearable + * @import import sensor from '@system.sensor'; + * @since 3 */ export interface OnBodyStateResponse { /** * Whether the sensor is worn. - * @devices liteWearable + * @devices wearable, liteWearable * @since 3 */ value: boolean; } /** - * @devices liteWearable + * @SysCap SystemCapability.Sensors.Sensor + * @devices wearable, liteWearable + * @import import sensor from '@system.sensor'; + * @since 3 */ export interface SubscribeOnBodyStateOptions { /** * Called when the wearing status changes. - * @devices liteWearable + * @devices wearable, liteWearable * @since 3 */ success: (data: OnBodyStateResponse) => void; /** * Called when the listening fails. - * @devices liteWearable + * @devices wearable, liteWearable * @since 3 */ fail?: (data: string, code: number) => void; } /** - * @devices liteWearable + * @SysCap SystemCapability.Sensors.Sensor + * @devices wearable, liteWearable + * @import import sensor from '@system.sensor'; + * @since 3 */ export interface GetOnBodyStateOptions { /** * Called when the sensor wearing state is obtained - * @devices liteWearable + * @devices wearable, liteWearable * @since 3 */ success: (data: OnBodyStateResponse) => void; /** * Called when the sensor wearing state fails to be obtained - * @devices liteWearable + * @devices wearable, liteWearable * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed - * @devices liteWearable + * @devices wearable, liteWearable * @since 3 */ complete?: () => void; } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @import import sensor from '@system.sensor'; + * @since 6 */ export interface DeviceOrientationResponse { /** @@ -342,7 +402,10 @@ export interface DeviceOrientationResponse { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @import import sensor from '@system.sensor'; + * @since 6 */ export interface SubscribeDeviceOrientationOptions { /** @@ -373,7 +436,11 @@ export interface SubscribeDeviceOrientationOptions { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.GYROSCOPE + * @since 6 */ export interface GyroscopeResponse { /** @@ -399,7 +466,11 @@ export interface GyroscopeResponse { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.GYROSCOPE + * @since 6 */ export interface SubscribeGyroscopeOptions { /** @@ -430,7 +501,10 @@ export interface SubscribeGyroscopeOptions { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @import import sensor from '@system.sensor'; + * @since 7 */ export interface GravityResponse { /** @@ -456,7 +530,10 @@ export interface GravityResponse { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @import import sensor from '@system.sensor'; + * @since 7 */ export interface SubscribeGravityOptions { /** @@ -487,7 +564,10 @@ export interface SubscribeGravityOptions { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @import import sensor from '@system.sensor'; + * @since 7 */ export interface MagneticResponse { /** @@ -513,7 +593,10 @@ export interface MagneticResponse { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @import import sensor from '@system.sensor'; + * @since 7 */ export interface SubscribeMagneticOptions { /** @@ -544,7 +627,10 @@ export interface SubscribeMagneticOptions { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet + * @import import sensor from '@system.sensor'; + * @since 7 */ export interface HallResponse { /** @@ -556,7 +642,10 @@ export interface HallResponse { } /** + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet + * @import import sensor from '@system.sensor'; + * @since 7 */ export interface SubscribeHallOptions { /** @@ -587,20 +676,29 @@ export interface SubscribeHallOptions { } /** - * @devices phone, tablet, wearable + * @SysCap SystemCapability.Sensors.Sensor + * @devices phone, tablet, wearable, liteWearable + * @import import sensor from '@system.sensor'; + * @since 7 */ export default class Sensor { /** * Listens to acceleration sensor data changes. * If this API is called multiple times, the last call takes effect. * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @permission ohos.permission.ACCELEROMETER + * @since 3 */ static subscribeAccelerometer(options: subscribeAccelerometerOptions): void; /** * Cancels listening to acceleration sensor data. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @permission ohos.permission.ACCELEROMETER + * @since 3 */ static unsubscribeAccelerometer(): void; @@ -608,13 +706,17 @@ export default class Sensor { * Listens to compass sensor data changes. * If this API is called multiple times, the last call takes effect. * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @since 3 */ static subscribeCompass(options: SubscribeCompassOptions): void; /** * Cancels listening to compass sensor data. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @since 3 */ static unsubscribeCompass(): void; @@ -622,14 +724,18 @@ export default class Sensor { * Listens to distance sensor data changes. * If this API is called multiple times, the last call takes effect. * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet + * @since 3 */ static subscribeProximity(options: SubscribeProximityOptions): void; /** * Cancels listening to distance sensor data. * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet + * @since 3 */ static unsubscribeProximity(): void; @@ -637,13 +743,17 @@ export default class Sensor { * Listens to ambient light sensor data changes. * If this API is called multiple times, the last call takes effect. * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @since 3 */ static subscribeLight(options: SubscribeLightOptions): void; /** * Cancels listening to ambient light sensor data. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @since 3 */ static unsubscribeLight(): void; @@ -651,13 +761,19 @@ export default class Sensor { * Listens to step counter sensor data changes. * If this API is called multiple times, the last call takes effect. * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable, liteWearable + * @permission ohos.permission.ACTIVITY_MOTION + * @since 3 */ static subscribeStepCounter(options: SubscribeStepCounterOptions): void; /** * Cancels listening to step counter sensor data. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable, liteWearable + * @permission ohos.permission.ACTIVITY_MOTION + * @since 3 */ static unsubscribeStepCounter(): void; @@ -665,13 +781,17 @@ export default class Sensor { * Listens to barometer sensor data changes. * If this API is called multiple times, the last call takes effect. * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable, liteWearable + * @since 3 */ static subscribeBarometer(options: SubscribeBarometerOptions): void; /** * Cancels listening to barometer sensor data. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable, liteWearable + * @since 3 */ static unsubscribeBarometer(): void; @@ -679,13 +799,19 @@ export default class Sensor { * Listens to changes of heart rate sensor data. * If this API is called multiple times, the last call takes effect. * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor * @devices wearable, liteWearable + * @permission ohos.permission.READ_HEALTH_DATA + * @since 3 */ static subscribeHeartRate(options: SubscribeHeartRateOptions): void; /** * Cancels listening to heart rate sensor data. + * @SysCap SystemCapability.Sensors.Sensor * @devices wearable, liteWearable + * @permission ohos.permission.READ_HEALTH_DATA + * @since 3 */ static unsubscribeHeartRate(): void; @@ -693,27 +819,44 @@ export default class Sensor { * Listens to whether a sensor is worn. * If this API is called multiple times, the last call takes effect. * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor * @devices wearable, liteWearable + * @since 3 */ static subscribeOnBodyState(options: SubscribeOnBodyStateOptions): void; /** * Cancels listening to whether the sensor is worn. + * @SysCap SystemCapability.Sensors.Sensor * @devices wearable, liteWearable + * @since 3 */ static unsubscribeOnBodyState(): void; + /** + * Obtains the sensor wearing state. + * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor + * @devices wearable, liteWearable + * @since 3 + */ + static getOnBodyState(options: GetOnBodyStateOptions): void; + /** * Listens to device orientation sensor data changes. * If this API is called multiple times, the last call takes effect. * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @since 6 */ static subscribeDeviceOrientation(options: SubscribeDeviceOrientationOptions): void; /** * Cancels listening to device orientation sensor data. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @since 6 */ static unsubscribeDeviceOrientation(): void; @@ -721,13 +864,19 @@ export default class Sensor { * Listens to gyroscope sensor data changes. * If this API is called multiple times, the last call takes effect. * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @permission ohos.permission.GYROSCOPE + * @since 6 */ static subscribeGyroscope(options: SubscribeGyroscopeOptions): void; /** * Cancels listening to gyroscope sensor data. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @permission ohos.permission.GYROSCOPE + * @since 6 */ static unsubscribeGyroscope(): void; @@ -735,13 +884,17 @@ export default class Sensor { * Listens to gravity sensor data changes. * If this API is called multiple times, the last call takes effect. * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @since 7 */ static subscribeGravity(options: SubscribeGravityOptions): void; /** * Cancels listening to gravity sensor data. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @since 7 */ static unsubscribeGravity(): void; @@ -749,13 +902,17 @@ export default class Sensor { * Listens to magnetic sensor data changes. * If this API is called multiple times, the last call takes effect. * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @since 7 */ static subscribeMagnetic(options: SubscribeMagneticOptions): void; /** * Cancels listening to magnetic sensor data. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @since 7 */ static unsubscribeMagnetic(): void; @@ -763,20 +920,17 @@ export default class Sensor { * Listens to hall sensor data changes. * If this API is called multiple times, the last call takes effect. * @param options Options. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @since 7 */ static subscribeHall(options: SubscribeHallOptions): void; /** * Cancels listening to hall sensor data. + * @SysCap SystemCapability.Sensors.Sensor * @devices phone, tablet, wearable + * @since 7 */ static unsubscribeHall(): void; - - /** - * Obtains the sensor wearing state. - * @param options Options. - * @devices wearable, liteWearable - */ - static getOnBodyState(options: GetOnBodyStateOptions): void; } diff --git a/api/common/@system.vibrator.d.ts b/api/common/@system.vibrator.d.ts index c7e45c54a3cc9449dc24d74a499347e64d760e09..903806100e6f4d486eb884743c1543075b936d32 100644 --- a/api/common/@system.vibrator.d.ts +++ b/api/common/@system.vibrator.d.ts @@ -14,7 +14,11 @@ */ /** - * @devices phone, tablet, wearable, liteWearable + * @SysCap SystemCapability.Sensors.MiscDevice + * @devices phone, tablet, wearable, liteWearable + * @import import vibrator from '@system.vibrator'; + * @permission ohos.permission.VIBRATE + * @since 3 */ export interface VibrateOptions { /** @@ -27,34 +31,40 @@ export interface VibrateOptions { /** * Called when success to trigger vibration. - * @devices liteWearable + * @devices phone, tablet, wearable, liteWearable * @since 3 */ success: () => void; /** * Called when fail to trigger vibration. - * @devices liteWearable + * @devices phone, tablet, wearable, liteWearable * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices liteWearable + * @devices phone, tablet, wearable, liteWearable * @since 3 */ complete?: () => void; } /** + * @SysCap SystemCapability.Sensors.MiscDevice * @devices phone, tablet, wearable, liteWearable + * @import import vibrator from '@system.vibrator'; + * @permission ohos.permission.VIBRATE + * @since 3 */ export default class Vibrator { /** * Triggers vibration. * @param options Options. * @devices phone, tablet, wearable, liteWearable + * @permission ohos.permission.VIBRATE + * @since 3 */ static vibrate(options?: VibrateOptions): void; } diff --git a/api/config/css/css-json-schema.json b/api/config/css/css-json-schema.json old mode 100755 new mode 100644 diff --git a/api/config/css/cssConfig.json b/api/config/css/cssConfig.json old mode 100755 new mode 100644 index 07f7ae600a13b933d2a5fe3187f08c66895cbb31..ccd2d2b6cc87d4eb98c720e7c191866cfa8659d9 --- a/api/config/css/cssConfig.json +++ b/api/config/css/cssConfig.json @@ -32,368 +32,224 @@ ] }, { - "name": "width", + "name": "fill", + "supportedDevices": [ + "tv", + "phone", + "tablet", + "wearable" + ], "syntax": [ { - "name": " || " + "name": "" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "Component width. If this attribute is not set, the width required for the element content is used", - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": "Component width. If this attribute is not set, default value 0 is used", - "supportedDevices": [ - "liteWearable", - "smartVision" - ] + "name": "Use the shorthand property to set the fill color of the element." } ], "restrictions": [ { "name": [ - "length", - "percentage" + "color" ] } ] }, { - "name": "height", + "name": "fill-opacity", + "supportedDevices": [ + "tv", + "phone", + "tablet", + "wearable" + ], "syntax": [ { - "name": " || " + "name": "" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "Component height. If this attribute is not set, the height required for the element content is used", - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": "Component height. If this attribute is not set, default value 0 is used", - "supportedDevices": [ - "liteWearable", - "smartVision" - ] + "name": "The transparency of the fill color ranges from 0 to 1. 1 is opaque and 0 is completely transparent." } ], "restrictions": [ { "name": [ - "length", - "percentage" + "number" ] } ] }, { - "name": "padding", + "name": "fill-rule", + "supportedDevices": [ + "tv", + "phone", + "tablet", + "wearable" + ], "syntax": [ { - "name": "{1,4} || {1,4}", - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": "", - "supportedDevices": [ - "liteWearable", - "smartVision" - ] + "name": "nonzero | evenodd" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "The attribute can have one to four values: 1. If you set a value, it specifies the padding for four sides; 2. If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding; 3. If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding; 4. If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order)", - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": "Shorthand attribute to set all padding attributes", - "supportedDevices": [ - "liteWearable", - "smartVision" - ] + "name": "Nonzero: non-zero rule; Evenodd: parity rule" } ], "restrictions": [ { "name": [ - "length", - "percentage" - ], - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": [ - "length" - ], - "supportedDevices": [ - "liteWearable", - "smartVision" + "nonzero | evenodd" ] } ] }, { - "name": "padding-left", + "name": "opacity", + "supportedDevices": [ + "tv", + "phone", + "tablet", + "wearable" + ], "syntax": [ { - "name": " || ", - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": "", - "supportedDevices": [ - "liteWearable", - "smartVision" - ] + "name": "number" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "Left padding (in px)" + "name": "The transparency of an element ranges from 0 to 1, where 1 is opaque and 0 is completely transparent." } ], "restrictions": [ { "name": [ - "length", - "percentage" - ], - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": [ - "length" - ], - "supportedDevices": [ - "liteWearable", - "smartVision" + "number" ] } ] }, { - "name": "padding-top", + "name": "stroke-dasharray", + "supportedDevices": [ + "tv", + "phone", + "tablet", + "wearable" + ], "syntax": [ { - "name": " || ", - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": "", - "supportedDevices": [ - "liteWearable", - "smartVision" - ] + "name": "" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "Top padding (in px)" + "name": "Specifies the length of the dash and notch. The format is [length length length], the length of dash and notch is separated by the space between them." } ], "restrictions": [ { "name": [ - "length", - "percentage" - ], - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": [ - "length" - ], - "supportedDevices": [ - "liteWearable", - "smartVision" + "string" ] } ] }, { - "name": "padding-right", + "name": "stroke-dashoffset", + "supportedDevices": [ + "tv", + "phone", + "tablet", + "wearable" + ], "syntax": [ { - "name": " || ", - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": "", - "supportedDevices": [ - "liteWearable", - "smartVision" - ] + "name": "" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "Right padding (in px)" + "name": "Sets the offset of the associative dashed array when rendering." } ], "restrictions": [ - { - "name": [ - "length", - "percentage" - ], - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, { "name": [ "length" - ], - "supportedDevices": [ - "liteWearable", - "smartVision" ] } ] }, { - "name": "padding-bottom", + "name": "stroke-linejoin", + "supportedDevices": [ + "tv", + "phone", + "tablet", + "wearable" + ], "syntax": [ { - "name": " || ", - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": "", - "supportedDevices": [ - "liteWearable", - "smartVision" - ] + "name": "[bevel | miter | round]" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "Bottom padding (in px)" + "name": "The shape used at the corner of the path when you stroke." } ], "restrictions": [ { "name": [ - "length", - "percentage" - ], - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": [ - "length" - ], - "supportedDevices": [ - "liteWearable", - "smartVision" + "bevel | miter | round" ] } ] }, { - "name": "padding-start", + "name": "stroke-linecap", "supportedDevices": [ "tv", "phone", @@ -402,58 +258,29 @@ ], "syntax": [ { - "name": " || ", - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": "", - "supportedDevices": [ - "liteWearable", - "smartVision" - ] + "name": "[butt | round | square]" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "Start padding" + "name": "Shapes used at the end of paths when they are traced" } ], "restrictions": [ { "name": [ - "length", - "percentage" - ], - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": [ - "length" - ], - "supportedDevices": [ - "liteWearable", - "smartVision" + "butt | round | square" ] } ] }, { - "name": "padding-end", + "name": "stroke-miterlimit", "supportedDevices": [ "tv", "phone", @@ -462,123 +289,110 @@ ], "syntax": [ { - "name": " || ", - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": "", - "supportedDevices": [ - "liteWearable", - "smartVision" - ] + "name": "number" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "End padding" + "name": "Sets the limit value for drawing acute angles as bevels." } ], "restrictions": [ { "name": [ - "length", - "percentage" - ], - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, - { - "name": [ - "length" - ], - "supportedDevices": [ - "liteWearable", - "smartVision" + "number" ] } ] }, { - "name": "margin", + "name": "stroke-opacity", + "supportedDevices": [ + "tv", + "phone", + "tablet", + "wearable" + ], "syntax": [ { - "name": "{1,4} || {1,4}" + "name": "number" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "Shorthand attribute to set margins for all sides in a declaration. You can set one to four values: 1. One value: specifies the margin for all the four sides; 2. Two values: The first value is for the top and bottom sides, and the second value is for the left and right sides; 3. Three values: The first value is for the top, the second value for the left and right, and the third value for the bottom; 4. They are margins for top, right, bottom, and left sides, respectively" + "name": "The transparency of contour lines ranges from 0 to 1, where 1 is opaque and 0 is completely transparent." } ], "restrictions": [ { "name": [ - "length", - "percentage" + "number" ] } ] }, { - "name": "margin-left", + "name": "transform", + "supportedDevices": [ + "tv", + "phone", + "tablet", + "wearable" + ], "syntax": [ { - "name": " || " + "name": "" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "Left margin" + "name": "Set the coordinate transformation parameters of components and subcomponents" } ], "restrictions": [ { "name": [ - "length", - "percentage" + "string" ] } ] }, { - "name": "margin-top", + "name": "x", + "supportedDevices": [ + "tv", + "phone", + "tablet", + "wearable" + ], "syntax": [ { - "name": " || " + "name": "|" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "Top margin" + "name": "Set the x-axis coordinate of the current SVG, and the root SVG node is invalid" } ], "restrictions": [ @@ -591,20 +405,26 @@ ] }, { - "name": "margin-right", + "name": "y", + "supportedDevices": [ + "tv", + "phone", + "tablet", + "wearable" + ], "syntax": [ { - "name": " || " + "name": "|" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "Right margin" + "name": "Set the y-axis coordinate of the current SVG, and the root SVG node is invalid" } ], "restrictions": [ @@ -617,33 +437,38 @@ ] }, { - "name": "margin-bottom", + "name": "viewBox", + "supportedDevices": [ + "tv", + "phone", + "tablet", + "wearable" + ], "syntax": [ { - "name": " || " + "name": "string" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "Bottom margin" + "name": "Sets the current SVG's viewport. The supported format is < number >. The four parameters represent min-x, min-y, width and height respectively. If the width and height of viewbox and SVG are inconsistent, they will be scaled by center alignment." } ], "restrictions": [ { "name": [ - "length", - "percentage" + "string" ] } ] }, { - "name": "margin-start", + "name": "rx", "supportedDevices": [ "tv", "phone", @@ -652,17 +477,17 @@ ], "syntax": [ { - "name": " || " + "name": "|" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "Start margin" + "name": "Set the radius of rectangle fillet in X direction. Support attribute animation" } ], "restrictions": [ @@ -675,7 +500,7 @@ ] }, { - "name": "margin-end", + "name": "ry", "supportedDevices": [ "tv", "phone", @@ -684,17 +509,17 @@ ], "syntax": [ { - "name": " || " + "name": "|" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "End margin" + "name": "Set the radius of rectangle fillet in Y direction." } ], "restrictions": [ @@ -707,7 +532,7 @@ ] }, { - "name": "border", + "name": "cx", "supportedDevices": [ "tv", "phone", @@ -716,826 +541,795 @@ ], "syntax": [ { - "name": " || || " + "name": "|" } ], "version": [ { - "name": "v3.0" + "name": "v7.0" } ], "description": [ { - "name": "Shorthand attribute to set all boarders. You can set border-width, border-style, and border-color in sequence. Default values are used for attributes that are not set" + "name": "Sets the x-axis coordinate of the center of the circle." } ], "restrictions": [ { "name": [ "length", - "line-style", - "color" + "percentage" ] } ] }, { - "name": "border-style", + "name": "cy", "supportedDevices": [ "tv", "phone", "tablet", "wearable" ], - "version": [ + "syntax": [ { - "name": "v3.0" + "name": "|" } ], - "description": [ + "version": [ { - "name": "Shorthand attribute to set the style of all borders. The available values are as follows: 1. dotted: Dotted border. The radius of a dot is half of border-width;2. dashed: Dashed border;3. solid: Solid border;" + "name": "v7.0" } ], - "values": [ - { - "name": "dotted" - }, - { - "name": "dashed" - }, + "description": [ { - "name": "solid" + "name": "Sets the y-axis coordinate of the center of the circle." } ], "restrictions": [ { "name": [ - "enum" + "length", + "percentage" ] } ] }, { - "name": "border-left-style", + "name": "r", "supportedDevices": [ "tv", "phone", "tablet", "wearable" ], - "version": [ + "syntax": [ { - "name": "v3.0" + "name": "|" } ], - "description": [ + "version": [ { - "name": "Styles of the left borders. The available values are dotted, dashed, and solid" + "name": "v7.0" } ], - "values": [ - { - "name": "dotted" - }, - { - "name": "dashed" - }, + "description": [ { - "name": "solid" + "name": "Sets the radius of the circle." } ], "restrictions": [ { "name": [ - "enum" + "length", + "percentage" ] } ] }, { - "name": "border-top-style", + "name": "d", "supportedDevices": [ "tv", "phone", "tablet", "wearable" ], - "version": [ + "syntax": [ { - "name": "v3.0" + "name": "string" } ], - "description": [ + "version": [ { - "name": "Styles of the top borders. The available values are dotted, dashed, and solid" + "name": "v7.0" } ], - "values": [ - { - "name": "dotted" - }, - { - "name": "dashed" - }, + "description": [ { - "name": "solid" + "name": "Sets the shape of the path. Contains a set of character instructions, uppercase letters for absolute path, lowercase characters for relative path" } ], "restrictions": [ { "name": [ - "enum" + "string" ] } ] }, { - "name": "border-right-style", + "name": "x1", "supportedDevices": [ "tv", "phone", "tablet", "wearable" ], - "version": [ + "syntax": [ { - "name": "v3.0" + "name": "|" } ], - "description": [ + "version": [ { - "name": "Styles of the right borders. The available values are dotted, dashed, and solid" + "name": "v7.0" } ], - "values": [ - { - "name": "dotted" - }, - { - "name": "dashed" - }, + "description": [ { - "name": "solid" + "name": "Sets the x-axis coordinate of the line start point." } ], "restrictions": [ { "name": [ - "enum" + "length", + "percentage" ] } ] }, { - "name": "border-bottom-style", + "name": "y1", "supportedDevices": [ "tv", "phone", "tablet", "wearable" ], - "version": [ + "syntax": [ { - "name": "v3.0" + "name": "|" } ], - "description": [ + "version": [ { - "name": "Styles of the bottom borders. The available values are dotted, dashed, and solid" + "name": "v7.0" } ], - "values": [ - { - "name": "dotted" - }, - { - "name": "dashed" - }, + "description": [ { - "name": "solid" + "name": "Sets the y-axis coordinate of the line start point." } ], "restrictions": [ { "name": [ - "enum" + "length", + "percentage" ] } ] }, { - "name": "border-left", + "name": "x2", "supportedDevices": [ "tv", "phone", "tablet", "wearable" ], - "version": [ + "syntax": [ { - "name": "v3.0" + "name": "|" } ], - "description": [ + "version": [ { - "name": "Shorthand attribute to set the boarders for every sides respectively. You can set border-width, border-style and border-color in sequence. Default values are used for attributes that are not set" + "name": "v7.0" } ], - "syntax": [ + "description": [ { - "name": " || || " + "name": "Sets the x-axis coordinate of the end of the line." } ], "restrictions": [ { "name": [ "length", - "line-style", - "color" + "percentage" ] } ] }, { - "name": "border-top", + "name": "y2", "supportedDevices": [ "tv", "phone", "tablet", "wearable" ], - "version": [ + "syntax": [ { - "name": "v3.0" + "name": "|" } ], - "description": [ + "version": [ { - "name": "Shorthand attribute to set the boarders for every sides respectively. You can set border-width, border-style and border-color in sequence. Default values are used for attributes that are not set" + "name": "v7.0" } ], - "syntax": [ + "description": [ { - "name": " || || " + "name": "Sets the y-axis coordinate of the end of the line." } ], "restrictions": [ { "name": [ "length", - "line-style", - "color" + "percentage" ] } ] }, { - "name": "border-right", + "name": "points", "supportedDevices": [ "tv", "phone", "tablet", "wearable" ], - "version": [ + "syntax": [ { - "name": "v3.0" + "name": "string" } ], - "description": [ + "version": [ { - "name": "Shorthand attribute to set the boarders for every sides respectively. You can set border-width, border-style and border-color in sequence. Default values are used for attributes that are not set" + "name": "v7.0" } ], - "syntax": [ + "description": [ { - "name": " || || " + "name": "Set multiple coordinate points of the polyline" } ], "restrictions": [ { "name": [ - "length", - "line-style", - "color" + "string" ] } ] }, { - "name": "border-bottom", + "name": "dx", "supportedDevices": [ "tv", "phone", "tablet", "wearable" ], - "version": [ + "syntax": [ { - "name": "v3.0" + "name": "|" } ], - "description": [ + "version": [ { - "name": "Shorthand attribute to set the boarders for every sides respectively. You can set border-width, border-style and border-color in sequence. Default values are used for attributes that are not set" + "name": "v7.0" } ], - "syntax": [ + "description": [ { - "name": " || || " + "name": "Set text X axis offset" } ], "restrictions": [ { "name": [ "length", - "line-style", - "color" + "percentage" ] } ] }, { - "name": "border-width", - "version": [ + "name": "dy", + "supportedDevices": [ + "tv", + "phone", + "tablet", + "wearable" + ], + "syntax": [ { - "name": "v3.0" + "name": "|" } ], - "description": [ + "version": [ { - "name": "Shorthand attribute to set the width of all borders, or separately set the width of each border" + "name": "v7.0" } ], - "syntax": [ - { - "name": "", - "supportedDevices": [ - "tv", - "phone", - "tablet", - "wearable" - ] - }, + "description": [ { - "name": "{1,4}", - "supportedDevices": [ - "liteWearable", - "smartVision" - ] + "name": "Set text Y axis offset" } ], "restrictions": [ { "name": [ - "length" + "length", + "percentage" ] } ] }, { - "name": "border-left-width", + "name": "stroke", "supportedDevices": [ "tv", "phone", "tablet", "wearable" ], - "version": [ + "syntax": [ { - "name": "v3.0" + "name": "" } ], - "description": [ + "version": [ { - "name": "Attribute to set widths of left borders" + "name": "v7.0" } ], - "syntax": [ + "description": [ { - "name": "" + "name": "Draws the font border and specifies the color" } ], "restrictions": [ { "name": [ - "length" + "color" ] } ] }, { - "name": "border-top-width", + "name": "startOffset", "supportedDevices": [ "tv", "phone", "tablet", "wearable" ], - "version": [ + "syntax": [ { - "name": "v3.0" + "name": "|" } ], - "description": [ + "version": [ { - "name": "Attribute to set widths of top borders" + "name": "v7.0" } ], - "syntax": [ + "description": [ { - "name": "" + "name": "Sets the starting offset of the text along the path" } ], "restrictions": [ { "name": [ - "length" + "length", + "percentage" ] } ] }, { - "name": "border-right-width", + "name": "attributeName", "supportedDevices": [ "tv", "phone", "tablet", "wearable" ], - "version": [ + "syntax": [ { - "name": "v3.0" + "name": "string" } ], - "description": [ + "version": [ { - "name": "Attribute to set widths of right borders" + "name": "v7.0" } ], - "syntax": [ + "description": [ { - "name": "" + "name": "Set the name of the property to be active" } ], "restrictions": [ { "name": [ - "length" + "string" ] } ] }, { - "name": "border-bottom-width", + "name": "begin", "supportedDevices": [ "tv", "phone", "tablet", "wearable" ], - "version": [ + "syntax": [ { - "name": "v3.0" + "name": "