diff --git a/api/@internal/component/ets/canvas.d.ts b/api/@internal/component/ets/canvas.d.ts index 3dd35a7f9..dcac4558e 100644 --- a/api/@internal/component/ets/canvas.d.ts +++ b/api/@internal/component/ets/canvas.d.ts @@ -18,6 +18,15 @@ * @kit ArkUI */ +/** + * Import the drawing canvas type object for Canvas. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ +declare type DrawingCanvas = import('../api/@ohos.graphics.drawing').default.Canvas; + /** * Filling style algorithm, which determines whether a point is within or outside the path. The following * two configurations are supported: @@ -5493,6 +5502,66 @@ declare class OffscreenCanvas { constructor(width: number, height: number); } +/** + * Size info. + * + * @interface Size + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ +declare interface Size { + /** + * Defines the width property. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + width: number; + + /** + * Defines the height property. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + height: number; +} + +/** + * Defines DrawingRenderingContext. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ +declare class DrawingRenderingContext { + + /** + * Get size of the DrawingRenderingContext. + * + * @returns { Size } The size of the DrawingRenderingContext. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + get size(): Size; + + /** + * Get canvas of the DrawingRenderingContext. + * + * @returns { DrawingCanvas } The canvas of the DrawingRenderingContext. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + get canvas(): DrawingCanvas; +} + /** *TextTimer component, which provides the text timer capability. * @@ -5566,7 +5635,18 @@ interface CanvasInterface { * @since 11 * @form */ - (context?: CanvasRenderingContext2D): CanvasAttribute; + /** + * Construct a canvas component. + * + * @param { CanvasRenderingContext2D | DrawingRenderingContext } context - Canvas context object. + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + * @form + */ + (context?: CanvasRenderingContext2D | DrawingRenderingContext): CanvasAttribute; } /** diff --git a/api/@internal/component/ets/enums.d.ts b/api/@internal/component/ets/enums.d.ts index 60d8411fa..d1fb3480f 100644 --- a/api/@internal/component/ets/enums.d.ts +++ b/api/@internal/component/ets/enums.d.ts @@ -9247,6 +9247,34 @@ declare enum EmbeddedType { EMBEDDED_UI_EXTENSION = 0, } +/** + * Marquee scrolling strategy after text update + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ +declare enum MarqueeUpdateStrategy { + /** + * Reset scroll position and restart scroll. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + DEFAULT = 0, + + /** + * Preserve scroll position, just change to new text + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + PRESERVE_POSITION = 1 +} + declare module 'borderStyle' { module 'borderStyle' { // @ts-ignore diff --git a/api/@internal/component/ets/image_span.d.ts b/api/@internal/component/ets/image_span.d.ts index f261fb8b6..72179b071 100644 --- a/api/@internal/component/ets/image_span.d.ts +++ b/api/@internal/component/ets/image_span.d.ts @@ -117,6 +117,30 @@ declare class ImageSpanAttribute extends BaseSpan { * @since 11 */ objectFit(value: ImageFit): ImageSpanAttribute; + + /** + * Sets a callback which is triggered when the image is successfully loaded. + * The size of the image source that is successfully loaded is returned, in pixels. + * + * @param { ImageCompleteCallback } callback - Triggered when the image is successfully loaded. + * @returns { ImageSpanAttribute } The attribute of the image span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + onComplete(callback: ImageCompleteCallback): ImageSpanAttribute; + + /** + * Sets a callback which is triggered when an exception occurs during image loading. + * The field of "message" returned in the callback carries the detailed information of failed image loading. + * + * @param { ImageErrorCallback } callback - Triggered when an exception occurs during image loading. + * @returns { ImageSpanAttribute } The attribute of the image span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + onError(callback: ImageErrorCallback): ImageSpanAttribute; } /** @@ -152,3 +176,108 @@ declare const ImageSpan: ImageSpanInterface; * @since 11 */ declare const ImageSpanInstance: ImageSpanAttribute; + +/** + * Callback function triggered when the image is successfully loaded. + * + * @typedef { function } ImageCompleteCallback + * @param { ImageLoadResult } result - the information about the successfully loaded image. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ +type ImageCompleteCallback = (result: ImageLoadResult) => void; + +/** + * The information about the successfully loaded image. + * + * @interface ImageLoadResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ +declare interface ImageLoadResult { + /** + * The width of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + width: number; + /** + * The height of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + height: number; + /** + * The width of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + componentWidth: number; + /** + * The height of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + componentHeight: number; + /** + * The value of the status of the image being loaded successfully. + * If the returned status value is 0, the image data is successfully loaded. + * If the returned status value is 1, the image is successfully decoded. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + loadingStatus: number; + /** + * The width of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + contentWidth: number; + /** + * The height of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + contentHeight: number; + /** + * The offset between image content and image component on the X-axis. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + contentOffsetX: number; + /** + * The offset between image content and image component on the Y-axis. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + contentOffsetY: number; +} diff --git a/api/@internal/component/ets/marquee.d.ts b/api/@internal/component/ets/marquee.d.ts index a0479d1f1..a58fa3734 100644 --- a/api/@internal/component/ets/marquee.d.ts +++ b/api/@internal/component/ets/marquee.d.ts @@ -329,6 +329,17 @@ declare class MarqueeAttribute extends CommonMethod { */ fontFamily(value: string | Resource): MarqueeAttribute; + /** + * Marquee scrolling strategy after text update. + * + * @param { MarqueeUpdateStrategy } value - The scrolling strategy after text update. + * @returns { MarqueeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + marqueeUpdateStrategy(value: MarqueeUpdateStrategy): MarqueeAttribute; + /** * Called when scrolling starts. * diff --git a/api/@internal/component/ets/rich_editor.d.ts b/api/@internal/component/ets/rich_editor.d.ts index 3214aea82..0ed33c59c 100644 --- a/api/@internal/component/ets/rich_editor.d.ts +++ b/api/@internal/component/ets/rich_editor.d.ts @@ -1887,7 +1887,7 @@ declare interface RichEditorTextSpanOptions { } /** - * Defines the Keyboard options of RichEditor. + * Defines the custom keyboard options of RichEditor. * * @interface KeyboardOptions * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -1896,7 +1896,7 @@ declare interface RichEditorTextSpanOptions { */ declare interface KeyboardOptions { /** - * Indicates whether to support keyboard avoidance. + * Indicates whether to support custom keyboard avoidance. * * @type { ?boolean } * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -3148,7 +3148,7 @@ declare class RichEditorAttribute extends CommonMethod { * Define custom keyboard. * * @param { CustomBuilder } value - Set up a custom keyboard of RichEditor - * @param { KeyboardOptions } [options] - Indicates the Keyboard options of RichEditor + * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of RichEditor * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform diff --git a/api/@internal/component/ets/search.d.ts b/api/@internal/component/ets/search.d.ts index 5e22bbc84..14fdc29cb 100644 --- a/api/@internal/component/ets/search.d.ts +++ b/api/@internal/component/ets/search.d.ts @@ -277,6 +277,15 @@ declare enum SearchType { * @since 12 */ EMAIL = 5, + + /** + * Number decimal entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + NUMBER_DECIMAL = 12, } /** @@ -1260,7 +1269,7 @@ declare class SearchAttribute extends CommonMethod { * Define custom keyboard. * * @param { CustomBuilder } value - Set up a custom keyboard of Search - * @param { KeyboardOptions } [options] - Indicates the Keyboard options of Search + * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of Search * @returns { SearchAttribute } returns the instance of the SearchAttribute. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform diff --git a/api/@internal/component/ets/swiper.d.ts b/api/@internal/component/ets/swiper.d.ts index 8ad34480e..1646718fa 100644 --- a/api/@internal/component/ets/swiper.d.ts +++ b/api/@internal/component/ets/swiper.d.ts @@ -1882,6 +1882,17 @@ declare class SwiperAttribute extends CommonMethod { * @since 12 */ onContentDidScroll(handler: ContentDidScrollCallback): SwiperAttribute; + + /** + * Setting whether the indicator is interactive. + * + * @param { boolean } value - Whether the indicator is interactive. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + indicatorInteractive(value: boolean): SwiperAttribute; } /** diff --git a/api/@internal/component/ets/text_area.d.ts b/api/@internal/component/ets/text_area.d.ts index 0d626ed95..e222845aa 100644 --- a/api/@internal/component/ets/text_area.d.ts +++ b/api/@internal/component/ets/text_area.d.ts @@ -385,6 +385,15 @@ declare enum TextAreaType { * @since 12 */ EMAIL = 5, + + /** + * Number decimal entry mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 12 + */ + NUMBER_DECIMAL = 12, } /** @@ -1223,7 +1232,7 @@ declare class TextAreaAttribute extends CommonMethod { * Define custom keyboard of the text area. * * @param { CustomBuilder } value - Set up a custom keyboard of TextArea - * @param { KeyboardOptions } [options] - Indicates the Keyboard options of TextArea + * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of TextArea * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform diff --git a/api/@internal/component/ets/text_input.d.ts b/api/@internal/component/ets/text_input.d.ts index 4cc34c45e..d39e005d1 100644 --- a/api/@internal/component/ets/text_input.d.ts +++ b/api/@internal/component/ets/text_input.d.ts @@ -2133,7 +2133,7 @@ declare class TextInputAttribute extends CommonMethod { * Define custom keyboard of the text input. * * @param { CustomBuilder } value - Set up a custom keyboard of TextInput - * @param { KeyboardOptions } [options] - Indicates the Keyboard options of TextInput + * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of TextInput * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index f61e3a215..489631b16 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -13,6 +13,11 @@ * limitations under the License. */ +/** + * @file + * @kit ArkWeb + */ + /** * Provides methods for controlling the web controller. * diff --git a/api/@internal/component/ets/xcomponent.d.ts b/api/@internal/component/ets/xcomponent.d.ts index 201f336ed..7b2696fae 100644 --- a/api/@internal/component/ets/xcomponent.d.ts +++ b/api/@internal/component/ets/xcomponent.d.ts @@ -162,6 +162,27 @@ declare class XComponentController { * @since 12 */ onSurfaceDestroyed(surfaceId: string): void; + + /** + * Start image analyzer. + * + * @param { ImageAnalyzerConfig } config - Image analyzer config. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 110001 - Image analysis feature is unsupported. + * @throws { BusinessError } 110002 - Image analysis is currently being executed. + * @throws { BusinessError } 110003 - Image analysis is stopped. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 12 + */ + startImageAnalyzer(config: ImageAnalyzerConfig): Promise; + + /** + * Stop image analyzer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 12 + */ + stopImageAnalyzer(): void; } /** @@ -220,6 +241,16 @@ declare class XComponentAttribute extends CommonMethod { * @since 8 */ onDestroy(event: () => void): XComponentAttribute; + + /** + * Enable image analyzer for XComponent. + * + * @param { boolean } enable + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 12 + */ + enableAnalyzer(enable: boolean): XComponentAttribute; } /** diff --git a/api/@internal/ets/global.d.ts b/api/@internal/ets/global.d.ts index a8b0dc7b5..7b2280765 100644 --- a/api/@internal/ets/global.d.ts +++ b/api/@internal/ets/global.d.ts @@ -404,6 +404,16 @@ export declare class console { * @since 10 */ static trace(...arguments: Object[]): void; + + /** + * Prints hybrid stack information for the current code location. + * + * @static + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 12 + */ + static traceHybridStack(): void; } /** diff --git a/api/@ohos.app.ability.abilityManager.d.ts b/api/@ohos.app.ability.abilityManager.d.ts index 166551bd3..c05cafa4d 100644 --- a/api/@ohos.app.ability.abilityManager.d.ts +++ b/api/@ohos.app.ability.abilityManager.d.ts @@ -411,7 +411,7 @@ declare namespace abilityManager { * Querying whether to allow embedded startup of atomic service. * * @param { Context } context - The context that initiates the query request. - * @param { string } appId - The ID of the application to which this bundle belongs. + * @param { string } appId - Globally unique identifier of an application, which is allocated by the cloud. * @returns { Promise } Returns the result in the form of callback. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @throws { BusinessError } 16000050 - Internal error. diff --git a/api/@ohos.application.BackupExtensionAbility.d.ts b/api/@ohos.application.BackupExtensionAbility.d.ts index 0b59ac253..887eea71f 100644 --- a/api/@ohos.application.BackupExtensionAbility.d.ts +++ b/api/@ohos.application.BackupExtensionAbility.d.ts @@ -88,4 +88,30 @@ export default class BackupExtensionAbility { * @since 10 */ onRestore(bundleVersion: BundleVersion): void; + + /** + * Callback to be called when the restore procedure is started. + * Developer could override this method to restore. + * + * @param { BundleVersion } bundleVersion Bundle version to be restore. + * @param { string } restoreInfo RestoreInfo to be restore. + * @returns { string } Return restore result. + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @StageModelOnly + * @since 12 + */ + onRestoreEx(bundleVersion: BundleVersion, restoreInfo: string): string; + + /** + * Callback to be called when getting application backupInfo. + * Developer could override this method to provide the backupInfo. + * + * @returns { string } Return the backup application's info. + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @StageModelOnly + * @since 12 + */ + getBackupInfo(): string; } diff --git a/api/@ohos.bluetooth.connection.d.ts b/api/@ohos.bluetooth.connection.d.ts index 71db03edc..73c0b671a 100644 --- a/api/@ohos.bluetooth.connection.d.ts +++ b/api/@ohos.bluetooth.connection.d.ts @@ -654,6 +654,39 @@ declare namespace connection { */ function setRemoteDeviceName(deviceId: string, name: string): Promise; + /** + * Set remote device custom type. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". + * @param { DeviceType } type - Indicates device type. + * @returns { Promise } Returns the promise object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth switch is off. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @systemapi + * @since 12 + */ + function setRemoteDeviceType(deviceId: string, type: DeviceType): Promise; + + /** + * Get remote device custom type. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". + * @returns { Promise } Returns the device type. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth switch is off. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @systemapi + * @since 12 + */ + function getRemoteDeviceType(deviceId: string): Promise; + /** * Subscribe the event reported when a remote Bluetooth device is discovered. * @@ -1085,5 +1118,80 @@ declare namespace connection { */ deviceClass: DeviceClass; } + + /** + * Enum for the custom type of remote device. + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @systemapi + * @since 12 + */ + enum DeviceType { + /** + * Default type, the type is consistent with COD. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @systemapi + * @since 12 + */ + DEVICE_TYPE_DEFAULT = 0, + /** + * Car bluetooth. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @systemapi + * @since 12 + */ + DEVICE_TYPE_CAR = 1, + /** + * Headset bluetooth. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @systemapi + * @since 12 + */ + DEVICE_TYPE_HEADSET = 2, + /** + * Hearing Aid. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @systemapi + * @since 12 + */ + DEVICE_TYPE_HEARING = 3, + /** + * Glasses device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @systemapi + * @since 12 + */ + DEVICE_TYPE_GLASSES = 4, + /** + * Watch device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @systemapi + * @since 12 + */ + DEVICE_TYPE_WATCH = 5, + /** + * Speaker device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @systemapi + * @since 12 + */ + DEVICE_TYPE_SPEAKER = 6, + /** + * Others bluetooth. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @systemapi + * @since 12 + */ + DEVICE_TYPE_OTHERS = 7 + } } export default connection; \ No newline at end of file diff --git a/api/@ohos.bundle.bundleResourceManager.d.ts b/api/@ohos.bundle.bundleResourceManager.d.ts index cb4765368..689678109 100644 --- a/api/@ohos.bundle.bundleResourceManager.d.ts +++ b/api/@ohos.bundle.bundleResourceManager.d.ts @@ -75,7 +75,16 @@ declare namespace bundleResourceManager { * @systemapi * @since 11 */ - GET_RESOURCE_INFO_WITH_SORTED_BY_LABEL = 0x00000008 + GET_RESOURCE_INFO_WITH_SORTED_BY_LABEL = 0x00000008, + + /** + * Used to obtain bundle icon drawable descriptor. + * + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 12 + */ + GET_RESOURCE_INFO_WITH_DRAWABLE_DESCRIPTOR = 0x00000010 } /** diff --git a/api/@ohos.data.preferences.d.ts b/api/@ohos.data.preferences.d.ts index bf8ad3432..a1e353543 100644 --- a/api/@ohos.data.preferences.d.ts +++ b/api/@ohos.data.preferences.d.ts @@ -223,6 +223,7 @@ declare namespace preferences { * @param { AsyncCallback } callback - The {@link Preferences} instance matching the specified * preferences file name. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -258,6 +259,7 @@ declare namespace preferences { * preferences file name. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 15500000 - Inner error. * @throws { BusinessError } 15501001 - Only supported in stage mode. * @throws { BusinessError } 15501002 - The data group id is not valid. * @syscap SystemCapability.DistributedDataManager.Preferences.Core @@ -301,6 +303,7 @@ declare namespace preferences { * @param { string } name - Indicates the preferences file name. * @returns { Promise } The {@link Preferences} instance matching the specified preferences file name. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -334,6 +337,7 @@ declare namespace preferences { * @returns { Promise } The {@link Preferences} instance matching the specified preferences file name. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 15500000 - Inner error. * @throws { BusinessError } 15501001 - Only supported in stage mode. * @throws { BusinessError } 15501002 - The data group id is not valid. * @syscap SystemCapability.DistributedDataManager.Preferences.Core @@ -371,6 +375,7 @@ declare namespace preferences { * @returns { Preferences } The {@link Preferences} instance matching the specified preferences file name. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 15500000 - Inner error. * @throws { BusinessError } 15501001 - Only supported in stage mode. * @throws { BusinessError } 15501002 - The data group id is not valid. * @syscap SystemCapability.DistributedDataManager.Preferences.Core @@ -425,6 +430,7 @@ declare namespace preferences { * @param { string } name - Indicates the preferences file name. * @param { AsyncCallback } callback - Indicates the callback function. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @throws { BusinessError } 15500010 - Failed to delete preferences file. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform @@ -466,6 +472,7 @@ declare namespace preferences { * @param { AsyncCallback } callback - Indicates the callback function. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 15500000 - Inner error. * @throws { BusinessError } 15500010 - Failed to delete preferences file. * @throws { BusinessError } 15501001 - Only supported in stage mode. * @throws { BusinessError } 15501002 - The data group id is not valid. @@ -488,6 +495,7 @@ declare namespace preferences { * @param { string } name - Indicates the preferences file name. * @returns { Promise } A promise object. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @throws { BusinessError } 15500010 - Failed to delete preferences file. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @since 9 @@ -521,6 +529,7 @@ declare namespace preferences { * @param { string } name - Indicates the preferences file name. * @returns { Promise } A promise object. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @throws { BusinessError } 15500010 - Failed to delete preferences file. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform @@ -562,6 +571,7 @@ declare namespace preferences { * @returns { Promise } A promise object. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 15500000 - Inner error. * @throws { BusinessError } 15500010 - Failed to delete preferences file. * @throws { BusinessError } 15501001 - Only supported in stage mode. * @throws { BusinessError } 15501002 - The data group id is not valid. @@ -612,6 +622,7 @@ declare namespace preferences { * @param { string } name - Indicates the preferences file name. * @param { AsyncCallback } callback - Indicates the callback function. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -649,6 +660,7 @@ declare namespace preferences { * @param { AsyncCallback } callback - Indicates the callback function. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 15500000 - Inner error. * @throws { BusinessError } 15501001 - Only supported in stage mode. * @throws { BusinessError } 15501002 - The data group id is not valid. * @syscap SystemCapability.DistributedDataManager.Preferences.Core @@ -698,6 +710,7 @@ declare namespace preferences { * @param { string } name - Indicates the preferences file name. * @returns { Promise } A promise object. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -735,6 +748,7 @@ declare namespace preferences { * @returns { Promise } A promise object. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 15500000 - Inner error. * @throws { BusinessError } 15501001 - Only supported in stage mode. * @throws { BusinessError } 15501002 - The data group id is not valid. * @syscap SystemCapability.DistributedDataManager.Preferences.Core @@ -768,6 +782,7 @@ declare namespace preferences { * @param { Context } context - Indicates the context of application or capability. * @param { string } name - Indicates the preferences file name. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -803,6 +818,7 @@ declare namespace preferences { * @param { Options } options - Indicates the {@link Options} option of preferences file position. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 15500000 - Inner error. * @throws { BusinessError } 15501001 - Only supported in stage mode. * @throws { BusinessError } 15501002 - The data group id is not valid. * @syscap SystemCapability.DistributedDataManager.Preferences.Core @@ -886,6 +902,7 @@ declare namespace preferences { * @param { AsyncCallback } callback - The value matching the specified key if it is found; * returns the default value otherwise. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -930,6 +947,7 @@ declare namespace preferences { * @returns { Promise } The value matching the specified key if it is found; * returns the default value otherwise. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -961,6 +979,7 @@ declare namespace preferences { * @returns { ValueType } The value matching the specified key if it is found; * returns the default value otherwise. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -990,6 +1009,7 @@ declare namespace preferences { * * @param { AsyncCallback } callback - The values and keys in an object. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1019,6 +1039,7 @@ declare namespace preferences { * * @returns { Promise } The values and keys in an object. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1042,6 +1063,7 @@ declare namespace preferences { * * @returns { Object } The values and keys in an object. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1080,6 +1102,7 @@ declare namespace preferences { * @param { AsyncCallback } callback - {@code true} if the {@link Preferences} object contains a preferences * with the specified key;returns {@code false} otherwise. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1118,6 +1141,7 @@ declare namespace preferences { * @returns { Promise } {@code true} if the {@link Preferences} object contains * a preferences with the specified key; returns {@code false} otherwise. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1147,6 +1171,7 @@ declare namespace preferences { * @returns { boolean } {@code true} if the {@link Preferences} object contains * a preferences with the specified key; returns {@code false} otherwise. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1194,6 +1219,7 @@ declare namespace preferences { * MAX_VALUE_LENGTH. * @param { AsyncCallback } callback - Indicates the callback function. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1241,6 +1267,7 @@ declare namespace preferences { * MAX_VALUE_LENGTH. * @returns { Promise } A promise object. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1272,6 +1299,7 @@ declare namespace preferences { * @param { ValueType } value - Indicates the value of the preferences. * MAX_VALUE_LENGTH. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1313,6 +1341,7 @@ declare namespace preferences { * MAX_KEY_LENGTH. * @param { AsyncCallback } callback - Indicates the callback function. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1354,6 +1383,7 @@ declare namespace preferences { * MAX_KEY_LENGTH. * @returns { Promise } A promise object. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1381,6 +1411,7 @@ declare namespace preferences { * @param { string } key - Indicates the key of the preferences to delete. It cannot be {@code null} or empty. * MAX_KEY_LENGTH. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1410,6 +1441,7 @@ declare namespace preferences { *

You can call the {@link #flush} method to save the {@link Preferences} object to the file. * * @param { AsyncCallback } callback - Indicates the callback function. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1439,6 +1471,7 @@ declare namespace preferences { *

You can call the {@link #flush} method to save the {@link Preferences} object to the file. * * @returns { Promise } A promise object. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1484,6 +1517,7 @@ declare namespace preferences { * Asynchronously saves the {@link Preferences} object to the file. * * @param { AsyncCallback } callback - Indicates the callback function. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1510,6 +1544,7 @@ declare namespace preferences { * Asynchronously saves the {@link Preferences} object to the file. * * @returns { Promise } A promise object. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1542,6 +1577,7 @@ declare namespace preferences { * @param { 'change' } type - Indicates the callback when preferences changes. * @param { Callback } callback - Indicates the callback function. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1565,6 +1601,7 @@ declare namespace preferences { * @param { 'multiProcessChange' } type - Indicates the callback when preferences changed in multiple processes. * @param { Callback } callback - Indicates the callback function. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @throws { BusinessError } 15500019 - Failed to obtain subscription service. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @atomicservice @@ -1579,6 +1616,7 @@ declare namespace preferences { * @param { Array } keys - Indicates one or more keys to listen for. * @param { Callback> } callback - Indicates the callback used to return the data change. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @atomicservice * @since 12 @@ -1610,6 +1648,7 @@ declare namespace preferences { * @param { 'change' } type - Indicates the callback when preferences changes. * @param { Callback } callback - Indicates the callback function. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @crossplatform * @atomicservice @@ -1632,6 +1671,7 @@ declare namespace preferences { * @param { 'multiProcessChange' } type - Indicates the callback when preferences changed in multiple processes. * @param { Callback } callback - Indicates the callback function. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @atomicservice * @since 11 @@ -1645,6 +1685,7 @@ declare namespace preferences { * @param { Array } keys - Indicates the data whose changes are not observed. * @param { Callback> } callback - Indicates the callback to unregister. * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 15500000 - Inner error. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @atomicservice * @since 12 diff --git a/api/@ohos.enterprise.securityManager.d.ts b/api/@ohos.enterprise.securityManager.d.ts index 571b9bb6b..6fcdb1a2e 100644 --- a/api/@ohos.enterprise.securityManager.d.ts +++ b/api/@ohos.enterprise.securityManager.d.ts @@ -173,6 +173,78 @@ declare namespace securityManager { * @since 12 */ function uninstallUserCertificate(admin: Want, certUri: string): Promise; + + /** + * Sets the password policy of the device. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_SECURITY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { PasswordPolicy } policy - password policy to be set. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 12 + */ + function setPasswordPolicy(admin: Want, policy: PasswordPolicy): void; + + /** + * Gets the password policy of the device. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_SECURITY + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { PasswordPolicy } policy - the password policy of the device. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 12 + */ + function getPasswordPolicy(admin: Want): PasswordPolicy; + + /** + * Password policy. + * + * @typedef PasswordPolicy + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 12 + */ + export interface PasswordPolicy { + /** + * The regex of complexity + * + * @type { ?string } + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 12 + */ + complexityRegex?: string; + + /** + * Period of validity + * + * @type { ?number } + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 12 + */ + validityPeriod?: number; + + /** + * Other supplementary description + * + * @type { ?string } + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 12 + */ + additionalDescription?: string; + } } export default securityManager; \ No newline at end of file diff --git a/api/@ohos.file.backup.d.ts b/api/@ohos.file.backup.d.ts index 3cac6adfc..e93f96a4e 100644 --- a/api/@ohos.file.backup.d.ts +++ b/api/@ohos.file.backup.d.ts @@ -253,7 +253,22 @@ declare namespace backup { * @since 12 */ function getLocalCapabilities(dataList: Array): Promise; - + + /** + * Get Backup information from bundle. + * + * @permission ohos.permission.BACKUP + * @param { string } bundleToBackup Bundle to backup. + * @returns { string } Return the backup application's info. + * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. + * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 401 - The input parameter is invalid. + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @since 12 + */ + function getBackupInfo(bundleToBackup: string): string; + /** * General callbacks for both backup and restore procedure. * The backup service will notify the client by these callbacks. @@ -372,6 +387,23 @@ declare namespace backup { * @since 10 */ onBackupServiceDied: Callback; + + /** + * Callback called when the backup service return result information. + * The first return string parameter indicates the result of the bundle. + * + * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 401 - The input parameter is invalid. + * @throws { BusinessError } 13600001 - IPC error + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @since 12 + */ + onResultReport: AsyncCallback; } /** @@ -488,7 +520,27 @@ declare namespace backup { * @systemapi * @since 10 */ - appendBundles(remoteCapabilitiesFd: number, bundlesToBackup: string[]): Promise; + /** + * Append new bundles and restoreInfos to be restore up during the restore. + * + * @permission ohos.permission.BACKUP + * @param { number } remoteCapabilitiesFd Opened JSON file that stores remote device capabilities. + * You can use the getLocalCapabilities method to obtain the value. + * @param { string[] } bundlesToBackup Bundles to restore. + * @param { string[] } [infos] infos to restore + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 13600001 - IPC error + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.StorageService.Backup + * @systemapi + * @since 12 + */ + appendBundles(remoteCapabilitiesFd: number, bundlesToBackup: string[], infos?: string[]): Promise; /** * Append new bundles to be restore up during the restore. diff --git a/api/@ohos.file.photoAccessHelper.d.ts b/api/@ohos.file.photoAccessHelper.d.ts index e74afa7c3..353e2e41a 100644 --- a/api/@ohos.file.photoAccessHelper.d.ts +++ b/api/@ohos.file.photoAccessHelper.d.ts @@ -161,7 +161,7 @@ declare namespace photoAccessHelper { */ CLOUD = 1 << 1 } - + /** * Analysis type * @@ -250,7 +250,31 @@ declare namespace photoAccessHelper { * @systemapi * @since 11 */ - ANALYSIS_DETAIL_ADDRESS + ANALYSIS_DETAIL_ADDRESS, + /** + * Analysis of human face tag + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 12 + */ + ANALYSIS_HUMAN_FACE_TAG, + /** + * Analysis of head position + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 12 + */ + ANALYSIS_HEAD_POSITION, + /** + * Analysis of bone pose + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 12 + */ + ANALYSIS_BONE_POSE } /** @@ -1073,7 +1097,7 @@ declare namespace photoAccessHelper { * Request thumbnails of the asset. * * @permission ohos.permission.READ_IMAGEVIDEO - * @param { AsyncCallback } callback - Returns the required pixels + * @param { AsyncCallback } callback - Returns the required pixels * @returns { string } Returns request photo task id. * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. @@ -1089,7 +1113,7 @@ declare namespace photoAccessHelper { * * @permission ohos.permission.READ_IMAGEVIDEO * @param { RequestPhotoOptions } options - Request photo options - * @param { AsyncCallback } callback - Returns the required pixels + * @param { AsyncCallback } callback - Returns the required pixels * @returns { string } Returns request photo task id. * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken. * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. @@ -3034,7 +3058,7 @@ declare namespace photoAccessHelper { /** * The uri for the preselected files. - * + * * @type { ?Array } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index 6f517233f..bba5d8917 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -2972,6 +2972,31 @@ declare namespace audio { * @since 10 */ getSystemVolumeInDbSync(volumeType: AudioVolumeType, volumeLevel: number, device: DeviceType): number; + + /** + * Gets the max amplitude value for a specific input device. + * This method uses a promise to return the result. + * @param { AudioDeviceDescriptor } inputDevice - the target device. + * @returns { Promise } Promise used to return the max amplitude value. + * @throws { BusinessError } 401 - Input parameter type or number mismatch. + * @throws { BusinessError } 6800101 - Invalid parameter error. Return by promise. + * @throws { BusinessError } 6800301 - System error. Return by promise. + * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 12 + */ + getMaxAmplitudeForInputDevice(inputDevice: AudioDeviceDescriptor): Promise; + /** + * Gets the max amplitude value for a specific output device. + * This method uses a promise to return the result. + * @param { AudioDeviceDescriptor } outputDevice - the target device. + * @returns { Promise } Promise used to return the max amplitude value. + * @throws { BusinessError } 401 - Input parameter type or number mismatch. + * @throws { BusinessError } 6800101 - Invalid parameter error. Return by promise. + * @throws { BusinessError } 6800301 - System error. Return by promise. + * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 12 + */ + getMaxAmplitudeForOutputDevice(outputDevice: AudioDeviceDescriptor): Promise; } /** diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index e284a7638..f5a1a4464 100755 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -3999,6 +3999,14 @@ declare namespace media { * @since 11 */ MD_KEY_AUD_SAMPLE_RATE = 'sample_rate', + + /** + * key for audio bit depth, value type is number + * @syscap SystemCapability.Multimedia.Media.Core + * @atomicservice + * @since 12 + */ + MD_KEY_AUD_SAMPLE_DEPTH = 'sample_depth', } /** @@ -4426,6 +4434,14 @@ declare namespace media { * @since 11 */ isHdr?: boolean; + + /** + * Whether to encode the video in temporal scale mode. + * @type { ?boolean } + * @syscap SystemCapability.Multimedia.Media.AVRecorder + * @since 12 + */ + enableTemporalScale?: boolean; } /** diff --git a/api/@ohos.multimodalInput.inputEventClient.d.ts b/api/@ohos.multimodalInput.inputEventClient.d.ts index b69bbb3e8..e27deae61 100644 --- a/api/@ohos.multimodalInput.inputEventClient.d.ts +++ b/api/@ohos.multimodalInput.inputEventClient.d.ts @@ -181,6 +181,18 @@ declare namespace inputEventClient { * @since 11 */ function injectTouchEvent(touchEvent: TouchEventData): void; + + /** + * Permit event injection permission. + * + * @param { boolean } result - Authorization result. + * @throws { BusinessError } 202 - SystemAPI permission error. + * @throws { BusinessError } 401 - Parameter error. + * @syscap SystemCapability.MultimodalInput.Input.InputSimulator + * @systemapi hide for inner use + * @since 12 + */ + function permitInjection(result: boolean): void; } export default inputEventClient; diff --git a/api/@ohos.notificationManager.d.ts b/api/@ohos.notificationManager.d.ts index 99fb3832a..011a2a3c5 100644 --- a/api/@ohos.notificationManager.d.ts +++ b/api/@ohos.notificationManager.d.ts @@ -380,15 +380,14 @@ declare namespace notificationManager { * @param { BundleOption } representativeBundle - bundle option of the representative. * @param { number } id - ID of the notification to cancel, which must be unique in the application. * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application to call the interface. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 1600001 - Internal error. * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. * @throws { BusinessError } 1600003 - Failed to connect service. * @throws { BusinessError } 1600007 - The notification is not exist. - * @throws { BusinessError } 1600008 - The user is not exist. * @throws { BusinessError } 1600012 - No memory space. + * @throws { BusinessError } 1600017 - There is no corresponding agent relationship configuration. * @syscap SystemCapability.Notification.Notification * @systemapi * @since 12 @@ -2178,13 +2177,13 @@ declare namespace notificationManager { * @param { BundleOption } bundle - Use the bundleOption to carry bundleName and uid of the application. * @param { number } badgeNumber - Badge number. * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Not system application to call the interface. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 1600001 - Internal error. * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. * @throws { BusinessError } 1600003 - Failed to connect service. * @throws { BusinessError } 1600012 - No memory space. + * @throws { BusinessError } 1600017 - There is no corresponding agent relationship configuration. * @throws { BusinessError } 17700001 - The specified bundle name was not found. * @syscap SystemCapability.Notification.Notification * @systemapi diff --git a/api/@ohos.security.cryptoFramework.d.ts b/api/@ohos.security.cryptoFramework.d.ts index 0d3afa6f3..bffb84a43 100644 --- a/api/@ohos.security.cryptoFramework.d.ts +++ b/api/@ohos.security.cryptoFramework.d.ts @@ -586,6 +586,20 @@ declare namespace cryptoFramework { * @since 11 */ getAsyKeySpec(itemType: AsyKeySpecItem): bigint | string | number; + + /** + * Encode the private key object to binary data in DER format. + * + * @param { string } format - indicates the encoding format. + * @returns { DataBlob } the binary data of the key object in DER format. + * @throws { BusinessError } 401 - invalid parameters. + * @throws { BusinessError } 17620001 - memory error. + * @throws { BusinessError } 17630001 - crypto operation error. + * @syscap SystemCapability.Security.CryptoFramework + * @crossplatform + * @since 12 + */ + getEncodedDer(format: string): DataBlob; } /** diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index a62ec4bba..0dfb993ac 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -4264,6 +4264,23 @@ declare namespace window { */ setBrightness(brightness: number, callback: AsyncCallback): void; + /** + * Set whether the main window is topmost. + * + * @param { boolean } isTopmost - Main window is topmost if true. + * @returns { Promise } Promise that returns no value. + * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported on this device. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @throws { BusinessError } 1300004 - Unauthorized operation. + * @syscap SystemCapability.Window.SessionManager + * @systemapi + * @since 12 + */ + setTopmost(isTopmost: boolean): Promise; + /** * Sets the brightness of window. * @@ -6185,6 +6202,20 @@ declare namespace window { * @since 9 */ setShowOnLockScreen(showOnLockScreen: boolean): void; + + /** + * Set whether to use default density. + * + * @param { boolean } enabled - Use default density if true, or follow system density change if false + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported on this device. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300005 - This window stage is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @StageModelOnly + * @since 12 + */ + setDefaultDensityEnabled(enabled: boolean): void; } } diff --git a/api/application/UIAbilityContext.d.ts b/api/application/UIAbilityContext.d.ts index ddaf5f24e..fd54ea886 100644 --- a/api/application/UIAbilityContext.d.ts +++ b/api/application/UIAbilityContext.d.ts @@ -2701,7 +2701,7 @@ export default class UIAbilityContext extends Context { /** * Full-screen pop-us startup atomic service. * - * @param { string } appId - The ID of the application to which this bundle belongs. + * @param { string } appId - Globally unique identifier of an application, which is allocated by the cloud. * @param { AtomicServiceOptions } [options] - Indicates the atomic service start options. * @returns { Promise } Returns the result of openAtomicService. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. diff --git a/api/application/UIExtensionContext.d.ts b/api/application/UIExtensionContext.d.ts index f5a5da89b..e71c7a10e 100755 --- a/api/application/UIExtensionContext.d.ts +++ b/api/application/UIExtensionContext.d.ts @@ -373,7 +373,7 @@ export default class UIExtensionContext extends ExtensionContext { /** * Full-screen pop-us startup atomic service. * - * @param { string } appId - The ID of the application to which this bundle belongs. + * @param { string } appId - Globally unique identifier of an application, which is allocated by the cloud. * @param { AtomicServiceOptions } [options] - Indicates the atomic service start options. * @returns { Promise } Returns the result of openAtomicService. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. diff --git a/api/bundleManager/BundleResourceInfo.d.ts b/api/bundleManager/BundleResourceInfo.d.ts index 5cd46a4ae..465bf3038 100644 --- a/api/bundleManager/BundleResourceInfo.d.ts +++ b/api/bundleManager/BundleResourceInfo.d.ts @@ -18,6 +18,8 @@ * @kit AbilityKit */ +import { DrawableDescriptor } from './../@ohos.arkui.drawableDescriptor'; + /** * Obtains resource information about a bundle * @@ -59,4 +61,15 @@ export interface BundleResourceInfo { * @since 11 */ readonly label: string; + + /** + * Indicates the drawable descriptor of this bundle icon + * + * @type { DrawableDescriptor } + * @readonly + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 12 + */ + readonly drawableDescriptor: DrawableDescriptor; } diff --git a/api/bundleManager/LauncherAbilityResourceInfo.d.ts b/api/bundleManager/LauncherAbilityResourceInfo.d.ts index de4196ed0..6502508ab 100644 --- a/api/bundleManager/LauncherAbilityResourceInfo.d.ts +++ b/api/bundleManager/LauncherAbilityResourceInfo.d.ts @@ -18,6 +18,8 @@ * @kit AbilityKit */ +import { DrawableDescriptor } from './../@ohos.arkui.drawableDescriptor'; + /** * Obtains resource information about a launcher ability * @@ -81,4 +83,15 @@ export interface LauncherAbilityResourceInfo { * @since 11 */ readonly label: string; + + /** + * Indicates the drawable descriptor of this ability icon + * + * @type { DrawableDescriptor } + * @readonly + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 12 + */ + readonly drawableDescriptor: DrawableDescriptor; } diff --git a/api/tag/nfctech.d.ts b/api/tag/nfctech.d.ts index 30638bdc9..9c5381e8d 100644 --- a/api/tag/nfctech.d.ts +++ b/api/tag/nfctech.d.ts @@ -315,6 +315,7 @@ export interface IsoDepTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -340,6 +341,7 @@ export interface IsoDepTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -467,6 +469,7 @@ export interface NdefTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -492,6 +495,7 @@ export interface NdefTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -519,6 +523,7 @@ export interface NdefTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -546,6 +551,7 @@ export interface NdefTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -594,6 +600,7 @@ export interface NdefTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -619,6 +626,7 @@ export interface NdefTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -678,7 +686,7 @@ export interface MifareClassicTag extends TagSession { * @since 9 */ /** - * Authenticates a sector with the key.Only successful authentication sector can be operated. + * Authenticates a sector with the key. Only successful authentication sector can be operated. * * @permission ohos.permission.NFC_TAG * @param { number } sectorIndex - Index of sector to authenticate. @@ -688,6 +696,7 @@ export interface MifareClassicTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -709,7 +718,7 @@ export interface MifareClassicTag extends TagSession { * @since 9 */ /** - * Authenticates a sector with the key.Only successful authentication sector can be operated. + * Authenticates a sector with the key. Only successful authentication sector can be operated. * * @permission ohos.permission.NFC_TAG * @param { number } sectorIndex - Index of sector to authenticate. @@ -719,6 +728,7 @@ export interface MifareClassicTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -746,6 +756,7 @@ export interface MifareClassicTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -773,6 +784,7 @@ export interface MifareClassicTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -802,6 +814,7 @@ export interface MifareClassicTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -831,6 +844,7 @@ export interface MifareClassicTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -860,6 +874,7 @@ export interface MifareClassicTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -889,6 +904,7 @@ export interface MifareClassicTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -918,6 +934,7 @@ export interface MifareClassicTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -947,6 +964,7 @@ export interface MifareClassicTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -974,6 +992,7 @@ export interface MifareClassicTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -1001,6 +1020,7 @@ export interface MifareClassicTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -1028,6 +1048,7 @@ export interface MifareClassicTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -1055,6 +1076,7 @@ export interface MifareClassicTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -1230,6 +1252,7 @@ export interface MifareUltralightTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -1257,6 +1280,7 @@ export interface MifareUltralightTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -1286,6 +1310,7 @@ export interface MifareUltralightTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -1315,6 +1340,7 @@ export interface MifareUltralightTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -1376,6 +1402,7 @@ export interface NdefFormatableTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -1403,6 +1430,7 @@ export interface NdefFormatableTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -1430,6 +1458,7 @@ export interface NdefFormatableTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -1457,6 +1486,7 @@ export interface NdefFormatableTag extends TagSession { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 diff --git a/api/tag/tagSession.d.ts b/api/tag/tagSession.d.ts index 67cfc84bb..c744f9e43 100644 --- a/api/tag/tagSession.d.ts +++ b/api/tag/tagSession.d.ts @@ -285,6 +285,7 @@ export interface TagSession { * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 @@ -314,6 +315,7 @@ export interface TagSession { * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. + * @throws { BusinessError } 3100204 - Tag I/O operation failed. * @syscap SystemCapability.Communication.NFC.Tag * @atomicservice * @since 12 diff --git a/arkts/@arkts.collections.d.ets b/arkts/@arkts.collections.d.ets index 51730f0d9..d0a1eb098 100644 --- a/arkts/@arkts.collections.d.ets +++ b/arkts/@arkts.collections.d.ets @@ -64,6 +64,20 @@ declare namespace collections { * @since 12 */ constructor(first: T, ...left: T[]); + /** + * Creates an ArkTS Array with arrayLength elements initialized to initialValue. + * + * @param { number } arrayLength - The length of the array. + * @param { T } initialValue - Element initial value that will be filled into the Array. + * @returns { Array } A new Array instance + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 10200011 - The create method cannot be bound. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + static create(arrayLength: number, initialValue: T): Array; /** * Creates an ArkTS Array from an array-like object. * @@ -79,15 +93,16 @@ declare namespace collections { */ static from(arrayLike: ArrayLike): Array; /** - * Gets or sets the length of the ArkTS array. This is a number one higher than the highest index in the ArkTS array. + * Gets the length of the ArkTS array. This is a number one higher than the highest index in the ArkTS array. * * @type { number } + * @readonly * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 12 */ - length: number; + readonly length: number; /** * Removes the last element from an ArkTS array and returns it. * If the array is empty, undefined is returned and the array is not modified. @@ -394,6 +409,52 @@ declare namespace collections { * @since 12 */ fill(value: T, start?: number, end?: number): Array; + /** + * Shrinks the ArkTS array to the given arrayLength. + * + * @param { number } arrayLength - The new Array length. + * Throws error when arrayLength < 0 or arrayLength > 2^32. + * If arrayLength > array.length, array remains unchanged. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 10200011 - The shrinkTo method cannot be bound. + * @throws { BusinessError } 10200201 - Concurrent modification error. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + shrinkTo(arrayLength: number): void; + /** + * Extends the ArkTS array to the given arrayLength, + * and appends new elements with given initialValue up to the arrayLength. + * + * @param { number } arrayLength - The new Array length. + * Throws error when arrayLength < 0 or arrayLength > 2^32. + * If arrayLength < array.length, array remains unchanged. + * @param { T } initialValue - Element initial value that will be appended to the array. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 10200011 - The extendTo method cannot be bound. + * @throws { BusinessError } 10200201 - Concurrent modification error. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + extendTo(arrayLength: number, initialValue: T): void; + /** + * Returns the item at that index. + * + * @param { number } index - The zero-based index of the desired code unit. + * Throws error if index < 0 or index >= array.length. + * @returns { T } The element in the array matching the given index. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 10200001 - The value of index is out of range. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + [index: number]: T; } /** diff --git a/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt b/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt index bc041ff2c..18c3f5597 100644 --- a/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt +++ b/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt @@ -939,6 +939,7 @@ unmuted unmutes unobserve unperceivable +unpremultiplied unpressed unregistered unregistering @@ -1046,4 +1047,6 @@ beidou qzss glonass sbas -gbk \ No newline at end of file +uncertainty +geofences +gbk diff --git a/build-tools/api_label_detection/src/coreImpl/process_three_type.py b/build-tools/api_label_detection/src/coreImpl/process_three_type.py index 01f06ee30..3dac7e117 100644 --- a/build-tools/api_label_detection/src/coreImpl/process_three_type.py +++ b/build-tools/api_label_detection/src/coreImpl/process_three_type.py @@ -119,9 +119,8 @@ def process_param_or_return(dict_data: dict, key_info: str, parent_info: dict, error_message = message_of_error[1].replace('&', new_label) error_result.setdefault('error_type', error_type) error_result.setdefault('error_message', error_message) - message_obj = get_message_obj(dict_data, error_result, process_data) + message_obj = get_message_obj(dict_data, error_result) missing_tag_message_list.append(message_obj) - break return missing_tag_message_list @@ -130,14 +129,12 @@ def diff_of_param_obj(key, in_out=0): diff_data = { 'typeLocations': '{}#{}'.format(ErrorType.PARAM_NO_TAG.value, ErrorMessage.METHOD_HAVE_INPUT_PARAM_NO.value), - 'objLocations': '{}#{}'.format(ErrorType.PARAM_OBJ_NO_TAG.value, - ErrorMessage.METHOD_HAVE_PARAM_OBJ_NO.value) + 'objLocations': '{}#{}'.format(ErrorType.OBJ_NO_TAG.value, + ErrorMessage.METHOD_HAVE_OBJ_NO.value) } if 1 == in_out: diff_data['typeLocations'] = '{}#{}'.format(ErrorType.RETURN_NO_TAG.value, ErrorMessage.METHOD_HAVE_OUTPUT_PARAM_NO.value) - diff_data['objLocations'] = '{}#{}'.format(ErrorType.RETURN_OBJ_NO_TAG.value, - ErrorMessage.METHOD_HAVE_RETURN_OBJ_NO.value) error_info = '' if key in diff_data: error_info = diff_data[key] @@ -223,14 +220,8 @@ def process_js_info(dict_data: dict, label): return error_result -def get_message_obj(dict_data: dict, error_result: dict, in_or_out=None) -> Output: - if not in_or_out: - defined_text = dict_data['definedText'] - elif in_or_out != dict_data: - defined_text = in_or_out['definedText'] - else: - defined_text = dict_data['definedText'] - message_obj = Output(dict_data['filePath'], error_result['error_type'], defined_text, +def get_message_obj(dict_data: dict, error_result: dict) -> Output: + message_obj = Output(dict_data['filePath'], error_result['error_type'], dict_data['definedText'], get_position_information(dict_data['pos']), error_result['error_message']) return message_obj diff --git a/build-tools/api_label_detection/src/typedef/detection.py b/build-tools/api_label_detection/src/typedef/detection.py index d9de957e3..d20a73b7f 100644 --- a/build-tools/api_label_detection/src/typedef/detection.py +++ b/build-tools/api_label_detection/src/typedef/detection.py @@ -40,8 +40,7 @@ class ErrorMessage(enum.Enum): METHOD_HAVE_PARENT_NO = '[$]does not have [&] label,but the methods below it has [&] label' METHOD_HAVE_INPUT_PARAM_NO = 'functions have [&] label, but the param do not have [&] label' METHOD_HAVE_OUTPUT_PARAM_NO = 'functions have [&] label, but the return value do not have [&] label' - METHOD_HAVE_PARAM_OBJ_NO = 'functions have [&] label, but the argument anonymous object do not have [&] label' - METHOD_HAVE_RETURN_OBJ_NO = 'functions have [&] label, but the return anonymous objects do not have [&] label' + METHOD_HAVE_OBJ_NO = 'functions have [&] label, but anonymous objects do not have [&] label' class ErrorType(enum.Enum): @@ -52,6 +51,5 @@ class ErrorType(enum.Enum): CHILD_NO_TAG = 'method_missing_label' PARAM_NO_TAG = 'param_missing_label' RETURN_NO_TAG = 'return_missing_label' - PARAM_OBJ_NO_TAG = 'param_anonymous_object_missing_label' - RETURN_OBJ_NO_TAG = 'return_anonymous_object_missing_label' + OBJ_NO_TAG = 'anonymous_object_missing_label' diff --git a/build-tools/compare_sdk_files/README_zh.md b/build-tools/compare_sdk_files/README_zh.md new file mode 100644 index 000000000..4ab1e3e39 --- /dev/null +++ b/build-tools/compare_sdk_files/README_zh.md @@ -0,0 +1,42 @@ +# ohos-sdk 两个版本文件比对工具 + +## 简介 +比对两个ohos-sdk版本,将两个版本共同文件以及缺失文件输出到Excel表格中 + +## 目录 + +``` +├─src #存放源码 +└─test #本地运行使用文件 +``` + +## 环境 + +电脑中必须配置有Python环境 + +## 打包 + +1、工具代码clone下来之后,需要在当前工程目录下安装打包依赖,即在 .\build-tools\compare_sdk_files 目录下进入终端,输入命令:pip install pyinstaller + +2、打包依赖安装完成之后,输入打包命令:pyinstaller --onefile .\src\main.py + +3、工具打包完成之后,会在当前工程文件下生成'build'文件夹、'dist'文件夹、main.spec文件,工具包为'dist'文件夹下的'main.exe'文件 + +## 运行 + +在'dist'文件夹下进入终端,运行以下命令即可运行工具 + +``` +main.exe -N compare -P 旧版SDK路径 -M 新版SDK路径 -O 输出文件差异结果Excel表格地址 + +例如:main.exe -N compare -P E:\unzip2\3.2.3.0\ohos-sdk -M E:\unzip2\3.2.6.3\ohos-sdk -O C:\Users\Administrator\Desktop\0325\diff.xlsx +``` + +> **说明:** +> +> 1、需保证参数按照规定顺序输入 +> +> 2、旧版本SDK和新版本SDK路径必须确定在ohos-sdk目录下,且ohos-sdk目录下为linux、windows两个文件夹 +> +> 3、输出地址如果只填写文件路径未指定具体的输出文件名,则会在指定文件目录下输出'diff.xlsx'文件,也可将文件名拼接至输出路径中 +> diff --git a/build-tools/compare_sdk_files/src/bin/config.py b/build-tools/compare_sdk_files/src/bin/config.py new file mode 100644 index 000000000..9ff7c200a --- /dev/null +++ b/build-tools/compare_sdk_files/src/bin/config.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (c) 2024 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 enum +from coreImpl import compare_sdk_file + + +class ToolNameType(enum.Enum): + COMPARE = 'compare' + + +tool_name_type_set = [ + member.value for name_tool, + member in ToolNameType.__members__.items() +] + + +class FormatType(enum.Enum): + JSON = 'json' + EXCEL = 'excel' + + +format_set = [ + member.value for name_format, + member in FormatType.__members__.items() +] + + +def run_tools(options): + tool_name = options.tool_name + if tool_name == ToolNameType["COMPARE"].value: + compare_sdk_file.start_do_diff(options.old_sdk_file_path, options.new_sdk_file_path, options.output_file_path) + + +class Config(object): + name = 'compare' + version = '1.1.0' + description = 'Compare the differences between two SDK version files' + commands = [ + { + "name": "--tool-name", + "abbr": "-N", + "required": True, + "choices": tool_name_type_set, + "type": str, + "default": ToolNameType["COMPARE"], + "help": "工具名称" + }, + { + "name": "--old-sdk-file-path", + "abbr": "-P", + "required": True, + "type": str, + "help": "旧版本SDK路径" + }, + { + "name": "--new-sdk-file-path", + "abbr": "-M", + "required": True, + "type": str, + "help": "新版本SDK路径" + }, + { + "name": "--output-file-path", + "abbr": "-O", + "required": False, + "type": str, + "help": "输出路径" + } + ] + diff --git a/build-tools/compare_sdk_files/src/coreImpl/compare_sdk_file.py b/build-tools/compare_sdk_files/src/coreImpl/compare_sdk_file.py new file mode 100644 index 000000000..1004250ac --- /dev/null +++ b/build-tools/compare_sdk_files/src/coreImpl/compare_sdk_file.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (c) 2024 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 zipfile +import os +import re +import openpyxl as op +from typedef.compare import Output, DoesItExist + + +output_result_list = [] + + +def unzip(folder_path): + # 获取文件夹中所有的 zip 文件 + zip_files = [f for f in os.listdir(folder_path) if f.endswith('.zip')] + + # 遍历每个 zip 文件并解压到目标文件夹 + for zip_file in zip_files: + with zipfile.ZipFile(os.path.join(folder_path, zip_file), 'r') as zip_ref: + zip_ref.extractall(path=folder_path) + + +def generate_excel(output_file_path): + data = [] + for output_result in output_result_list: + info_data = [] + info_data.append(output_result.platform) + info_data.append(output_result.file_path) + info_data.append(output_result.old_is_exist) + info_data.append(output_result.new_is_exist) + data.append(info_data) + wb = op.Workbook() + ws = wb['Sheet'] + ws.append(['序号', '平台', '文件路径', '旧版本是否存在', '新版本是否存在']) + number = 1 + for title in data: + d = number, title[0], title[1], title[2], title[3] + ws.append(d) + number += 1 + wb.save(output_file_path) + + +def do_diff(old_dir, new_dir, system_type): + old_file_list = os.listdir(old_dir) + new_file_list = os.listdir(new_dir) + diff_list(old_file_list, new_file_list, old_dir, new_dir, system_type) + + +def diff_list(old_file_list, new_file_list, old_dir, new_dir, system_type): + all_list = set(old_file_list + new_file_list) + if len(all_list) == 0: + return + for target_file in all_list: + if (target_file in old_file_list + and target_file not in new_file_list): + diff_file_path = os.path.join(old_dir, target_file) + del_old_file(diff_file_path, system_type) + elif (target_file in new_file_list + and target_file not in old_file_list): + diff_file_path = os.path.join(new_dir, target_file) + add_new_file(diff_file_path, system_type) + else: + # 同时存在的文件夹 + if os.path.isdir(os.path.join(new_dir, target_file)): + do_diff(os.path.join(old_dir, target_file), os.path.join(new_dir, target_file), system_type) + # 同时存在的文件 + else: + target_path = extract_file_path(os.path.join(new_dir, target_file)) + out_put = Output(system_type, target_path, DoesItExist.EXIST.value, DoesItExist.EXIST.value) + output_result_list.append(out_put) + + +def add_new_file(diff_file_path, system_type): + if os.path.isdir(diff_file_path): + add_file(diff_file_path, system_type) + else: + target_path = extract_file_path(diff_file_path) + out_put = Output(system_type, target_path, DoesItExist.ABSENT.value, DoesItExist.EXIST.value) + output_result_list.append(out_put) + + +def del_old_file(diff_file_path, system_type): + if os.path.isdir(diff_file_path): + del_file(diff_file_path, system_type) + else: + target_path = extract_file_path(diff_file_path) + out_put = Output(system_type, target_path, DoesItExist.EXIST.value, DoesItExist.ABSENT.value) + output_result_list.append(out_put) + + +def del_file(dir_path, system_type): + file_list = os.listdir(dir_path) + for file in file_list: + file_path = os.path.join(dir_path, file) + if os.path.isdir(file_path): + del_file(file_path, system_type) + else: + target_path = extract_file_path(file_path) + out_put = Output(system_type, target_path, DoesItExist.EXIST.value, DoesItExist.ABSENT.value) + output_result_list.append(out_put) + + +def add_file(dir_path, system_type): + file_list = os.listdir(dir_path) + for file in file_list: + file_path = os.path.join(dir_path, file) + if os.path.isdir(file_path): + add_file(file_path, system_type) + else: + target_path = extract_file_path(file_path) + out_put = Output(system_type, target_path, DoesItExist.ABSENT.value, DoesItExist.EXIST.value) + output_result_list.append(out_put) + + +def extract_file_path(file_path): + if len(file_path) == 0: + return '' + pattern = re.compile("ohos-sdk(.*)") + result = re.search(pattern, file_path).group(0) + return result + + +def start_do_diff(old_file_path, new_file_path, output_file_path): + # 处理linux + old_linux = os.path.join(old_file_path, 'linux') + new_linux = os.path.join(new_file_path, 'linux') + unzip(old_linux) + unzip(new_linux) + do_diff(old_linux, new_linux, 'linux') + # 处理windows + old_windows = os.path.join(old_file_path, 'windows') + new_windows = os.path.join(new_file_path, 'windows') + unzip(old_windows) + unzip(new_windows) + do_diff(old_windows, new_windows, 'windows') + # 输出Excel + if os.path.isdir(output_file_path): + output_file_path = os.path.join(output_file_path, 'diff.xlsx') + generate_excel(output_file_path) diff --git a/build-tools/compare_sdk_files/src/main.py b/build-tools/compare_sdk_files/src/main.py new file mode 100644 index 000000000..a81836b87 --- /dev/null +++ b/build-tools/compare_sdk_files/src/main.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (c) 2024 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 argparse +from bin import config + + +def main_function(): + parser = argparse.ArgumentParser( + prog=config.Config.name, description=config.Config.description) + for command in config.Config.commands: + arg_abbr = command.get("abbr") + arg_name = command.get("name") + arg_choices = command.get("choices") + arg_required = (True if command.get("required") else False) + arg_type = command.get("type") + default = command.get("default") + arg_help = command.get("help") + parser.add_argument(arg_abbr, arg_name, choices=arg_choices, + required=arg_required, type=arg_type, default=default, help=arg_help) + + config.run_tools(parser.parse_args()) + + +if __name__ == '__main__': + main_function() diff --git a/build-tools/compare_sdk_files/src/typedef/compare.py b/build-tools/compare_sdk_files/src/typedef/compare.py new file mode 100644 index 000000000..3b20920d5 --- /dev/null +++ b/build-tools/compare_sdk_files/src/typedef/compare.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (c) 2024 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 enum + + +class Output: + platform = '' + file_path = '' + old_is_exist = '' + new_is_exist = '' + + def __init__(self, platform, file_path, old_is_exist, new_is_exist): + self.platform = platform + self.file_path = file_path + self.old_is_exist = old_is_exist + self.new_is_exist = new_is_exist + + +class DoesItExist(enum.Enum): + EXIST = 'TRUE' + ABSENT = 'FALSE' + +