diff --git a/BUILD.gn b/BUILD.gn index e1313d198c90a92af6c117b1fa0c2d8633ce60b9..a29eb996c7e3333620c40dabbe1e4196353cee5c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -14,12 +14,15 @@ import("//build/ohos.gni") import("//build/ohos/notice/notice.gni") import("//build/templates/metadata/module_info.gni") +import("interface_config.gni") ohos_copy("ets_internal_api") { sources = [ "api/@internal/ets/index.d.ts", "api/@internal/ets/lifecycle.d.ts", "api/@internal/global.d.ts", + "api/common/full/canvaspattern.d.ts", + "api/common/full/featureability.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" @@ -59,6 +62,7 @@ ohos_copy("ets_component") { "api/@internal/component/ets/grid.d.ts", "api/@internal/component/ets/gridItem.d.ts", "api/@internal/component/ets/grid_container.d.ts", + "api/@internal/component/ets/hyperlink.d.ts", "api/@internal/component/ets/image.d.ts", "api/@internal/component/ets/image_animator.d.ts", "api/@internal/component/ets/index-full.d.ts", @@ -73,7 +77,6 @@ ohos_copy("ets_component") { "api/@internal/component/ets/page_transition.d.ts", "api/@internal/component/ets/panel.d.ts", "api/@internal/component/ets/path.d.ts", - "api/@internal/component/ets/piece.d.ts", "api/@internal/component/ets/polygon.d.ts", "api/@internal/component/ets/polyline.d.ts", "api/@internal/component/ets/progress.d.ts", @@ -90,7 +93,6 @@ ohos_copy("ets_component") { "api/@internal/component/ets/search.d.ts", "api/@internal/component/ets/select.d.ts", "api/@internal/component/ets/shape.d.ts", - "api/@internal/component/ets/sheet.d.ts", "api/@internal/component/ets/sidebar.d.ts", "api/@internal/component/ets/slider.d.ts", "api/@internal/component/ets/span.d.ts", @@ -107,6 +109,7 @@ ohos_copy("ets_component") { "api/@internal/component/ets/text_input.d.ts", "api/@internal/component/ets/text_picker.d.ts", "api/@internal/component/ets/text_timer.d.ts", + "api/@internal/component/ets/time_picker.d.ts", "api/@internal/component/ets/toggle.d.ts", "api/@internal/component/ets/units.d.ts", "api/@internal/component/ets/video.d.ts", @@ -119,15 +122,7 @@ ohos_copy("ets_component") { } ohos_copy("common_api") { - sources = [ - "api/@ohos.wifi.d.ts", - "api/common/@system.app.d.ts", - "api/common/@system.configuration.d.ts", - "api/common/@system.file.d.ts", - "api/common/@system.mediaquery.d.ts", - "api/common/@system.prompt.d.ts", - "api/common/@system.router.d.ts", - ] + sources = common_api_src outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" module_install_name = "" @@ -144,7 +139,7 @@ template("ohos_declaration_template") { forward_variables_from(invoker, "*") action_with_pydeps(target_name) { script = "//interface/sdk-js/remove_internal.py" - outputs = [ root_out_dir + "/$target_name/" ] + outputs = [ root_out_dir + "/ohos_declaration/$target_name" ] args = [ "--input", rebase_path("//interface/sdk-js/api", root_build_dir), @@ -171,10 +166,13 @@ ohos_declaration_template("ohos_declaration_common") { ohos_copy("internal_full") { sources = [ - "api/common/@internal/console.d.ts", - "api/common/@internal/global.d.ts", - "api/common/@internal/index.d.ts", - "api/common/@internal/viewmodel.d.ts", + "api/common/full/canvaspattern.d.ts", + "api/common/full/console.d.ts", + "api/common/full/dom.d.ts", + "api/common/full/featureability.d.ts", + "api/common/full/global.d.ts", + "api/common/full/index.d.ts", + "api/common/full/viewmodel.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" @@ -183,10 +181,11 @@ ohos_copy("internal_full") { ohos_copy("internal_lite") { sources = [ - "api/liteWearable/@internal/console.d.ts", - "api/liteWearable/@internal/global.d.ts", - "api/liteWearable/@internal/index.d.ts", - "api/liteWearable/@internal/viewmodel.d.ts", + "api/common/lite/console.d.ts", + "api/common/lite/featureability.d.ts", + "api/common/lite/global.d.ts", + "api/common/lite/index.d.ts", + "api/common/lite/viewmodel.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" @@ -202,13 +201,13 @@ ohos_copy("syscap_check") { ohos_copy("system_api") { sources = [ - "api/common/@system.app.d.ts", - "api/common/@system.cipher.d.ts", - "api/common/@system.configuration.d.ts", - "api/common/@system.file.d.ts", - "api/common/@system.mediaquery.d.ts", - "api/common/@system.prompt.d.ts", - "api/common/@system.router.d.ts", + "api/@system.app.d.ts", + "api/@system.cipher.d.ts", + "api/@system.configuration.d.ts", + "api/@system.file.d.ts", + "api/@system.mediaquery.d.ts", + "api/@system.prompt.d.ts", + "api/@system.router.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" diff --git a/api/@internal/component/ets/alert_dialog.d.ts b/api/@internal/component/ets/alert_dialog.d.ts index e88783f82c4ab887efb0e3a43da1694c3e8d59b6..56f25ee6597851a4b30fd03e152a70bc925bda60 100644 --- a/api/@internal/component/ets/alert_dialog.d.ts +++ b/api/@internal/component/ets/alert_dialog.d.ts @@ -163,6 +163,10 @@ declare interface AlertDialogParamWithConfirm extends AlertDialogParam { }; } +/** + * Defines the dialog param with buttons. + * @since 7 + */ declare interface AlertDialogParamWithButtons extends AlertDialogParam { /** * First button. diff --git a/api/@internal/component/ets/alphabet_indexer.d.ts b/api/@internal/component/ets/alphabet_indexer.d.ts index a902431b34a4e76c5560ef87c6984665e4d08e17..42a4b1694a04863d01bae5fc71a2ace9462f4fe4 100644 --- a/api/@internal/component/ets/alphabet_indexer.d.ts +++ b/api/@internal/component/ets/alphabet_indexer.d.ts @@ -52,8 +52,9 @@ declare class AlphabetIndexerAttribute extends CommonMethod void): AlphabetIndexerAttribute; + onSelected(callback: (index: number) => void): AlphabetIndexerAttribute; /** * Definitions color. @@ -121,29 +122,35 @@ declare class AlphabetIndexerAttribute extends CommonMethod void): AlphabetIndexerAttribute; + /** * Index bar selection callback and return the strings which display on pop-up. * @since 8 */ - onRequestPopupData(event: (index: number) => Array): AlphabetIndexerAttribute; + onRequestPopupData(callback: (index: number) => Array): AlphabetIndexerAttribute; /** * Pop-up selection callback. * @since 8 */ - onPopupSelected(event: (index: number) => void): AlphabetIndexerAttribute; + onPopupSelect(callback: (index: number) => void): AlphabetIndexerAttribute; /** - * Select the index. + * Sets the selected index. * @since 8 */ - selectedIndex(index: number): AlphabetIndexerAttribute; + selected(index: number): AlphabetIndexerAttribute; /** * Position of the pop-up windows, relative to the midpoint of the top border of the indexer bar. * @since 8 */ - popupPosition(value: {offsetX: number, offsetY: number}): AlphabetIndexerAttribute; + popupPosition(value: Position): AlphabetIndexerAttribute; } declare const AlphabetIndexer: AlphabetIndexerInterface; diff --git a/api/@internal/component/ets/badge.d.ts b/api/@internal/component/ets/badge.d.ts index 5c7d354ea01658a414f44247bf54db64ed339079..6c6ef7b5936c4e46a99a4a1cd8780479c6f19028 100644 --- a/api/@internal/component/ets/badge.d.ts +++ b/api/@internal/component/ets/badge.d.ts @@ -145,5 +145,5 @@ interface BadgeInterface { */ declare class BadgeAttribute extends CommonMethod {} -declare const Badge: BadgeInterface +declare const Badge: BadgeInterface; declare const BadgeInstance: BadgeAttribute; diff --git a/api/@internal/component/ets/blank.d.ts b/api/@internal/component/ets/blank.d.ts index 4415acc8a0c39bede5a52cdd867183ef5e7d49dc..327a53ef07df5b396233d579af5981d57c9008cd 100644 --- a/api/@internal/component/ets/blank.d.ts +++ b/api/@internal/component/ets/blank.d.ts @@ -1,4 +1,4 @@ - /* +/* * 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. diff --git a/api/@internal/component/ets/button.d.ts b/api/@internal/component/ets/button.d.ts index 68f472819de0d9dea9b66e90fbf43ca6ecc76193..3ad3db720fe0169a43cd945cc9f01a02d853fcac 100644 --- a/api/@internal/component/ets/button.d.ts +++ b/api/@internal/component/ets/button.d.ts @@ -41,7 +41,7 @@ declare enum ButtonType { * Defines the button options. * @since 7 */ -declare interface ButtonOption { +declare interface ButtonOptions { /** * Describes the button style. * @since 7 @@ -70,13 +70,13 @@ interface ButtonInterface { * Create Button with Text child. * @since 7 */ - (options: ButtonOption): ButtonAttribute; + (options: ButtonOptions): ButtonAttribute; /** * Create Button with inner text label. * @since 7 */ - (label: ResourceStr, options?: ButtonOption): ButtonAttribute; + (label: ResourceStr, options?: ButtonOptions): ButtonAttribute; } /** @@ -127,5 +127,5 @@ declare class ButtonAttribute extends CommonMethod { fontFamily(value: string | Resource): ButtonAttribute; } -declare const Button: ButtonInterface +declare const Button: ButtonInterface; declare const ButtonInstance: ButtonAttribute; diff --git a/api/@internal/component/ets/calendar.d.ts b/api/@internal/component/ets/calendar.d.ts index 73af8ae5278a07e8f00f740823dda9548dc519f5..63569d81073600b4718ce87c33e435a764bbde85 100644 --- a/api/@internal/component/ets/calendar.d.ts +++ b/api/@internal/component/ets/calendar.d.ts @@ -102,7 +102,7 @@ interface CalendarDay { } /** - * Date object. + * Date object. * @since 7 * @systemapi */ diff --git a/api/@internal/component/ets/canvas.d.ts b/api/@internal/component/ets/canvas.d.ts index 37f1a30ba622a0e6caa02b7c87e23e65554b358e..6c1072d53d60e138496276dd73f7fefc32273059 100644 --- a/api/@internal/component/ets/canvas.d.ts +++ b/api/@internal/component/ets/canvas.d.ts @@ -252,14 +252,7 @@ declare class Path2D extends CanvasPath { * Describes an opaque object of a template, which is created using the createPattern() method. * @since 8 */ -declare interface CanvasPattern { - /** - * Adds the matrix transformation effect to the current template. - * @param transform transformation matrix - * @since 8 - */ - setTransform(transform?: Matrix2D): void; -} +declare type CanvasPattern = import('../api/@internal/full/canvaspattern').CanvasPattern; /** * Size information of the text @@ -1061,7 +1054,7 @@ declare class OffscreenCanvasRenderingContext2D extends CanvasRenderer { * @param settings Drawing attribute. For details, see {@link RenderingContextSettings}. * @since 8 */ - constructor(width: number, height: number,settings?: RenderingContextSettings); + constructor(width: number, height: number, settings?: RenderingContextSettings); } /** @@ -1116,5 +1109,6 @@ declare class CanvasAttribute extends CommonMethod { */ onReady(event: () => void): CanvasAttribute; } + declare const Canvas: CanvasInterface; declare const CanvasInstance: CanvasAttribute; diff --git a/api/@internal/component/ets/checkbox.d.ts b/api/@internal/component/ets/checkbox.d.ts index c66216a3398fc46911be175a9dc2eae4f8f4b4f0..adc255a0850ab69a12da8a844eed1e29690c0aeb 100644 --- a/api/@internal/component/ets/checkbox.d.ts +++ b/api/@internal/component/ets/checkbox.d.ts @@ -14,21 +14,21 @@ */ /** - * Defines the option of Checkbox. + * Defines the options of Checkbox. * @since 8 */ -declare interface CheckboxOption { +declare interface CheckboxOptions { /** * Current name of Checkbox. * @since 8 */ - name?: string; + name?: string; /** * Sets the group of Checkbox. * @since 8 */ - group?: string; + group?: string; } /** @@ -41,7 +41,7 @@ interface CheckboxInterface { * Called when the Checkbox component is used. * @since 8 */ - (options?: CheckboxOption): CheckboxAttribute; + (options?: CheckboxOptions): CheckboxAttribute; } /** @@ -53,13 +53,13 @@ declare class CheckboxAttribute extends CommonMethod { * setting whether checkbox is selected. * @since 8 */ - select(value: boolean): CheckboxAttribute; + select(value: boolean): CheckboxAttribute; /** * setting the display color of checkbox. * @since 8 */ - selectedColor(value: ResourceColor): CheckboxAttribute; + selectedColor(value: ResourceColor): CheckboxAttribute; /** * Called when the selection status changes. diff --git a/api/@internal/component/ets/checkboxgroup.d.ts b/api/@internal/component/ets/checkboxgroup.d.ts index 3fee2e97cd34e1d47790488a54af2448f3f52161..16695f09d2ee68c454c758613e1fe8726dfe006c 100644 --- a/api/@internal/component/ets/checkboxgroup.d.ts +++ b/api/@internal/component/ets/checkboxgroup.d.ts @@ -36,19 +36,19 @@ declare enum SelectStatus { } /** - * Defines the option of CheckboxGroup. + * Defines the options of CheckboxGroup. * @since 8 */ -declare interface CheckboxGroupOption { +declare interface CheckboxGroupOptions { /** * Setting the group of CheckboxGroup. * @since 8 */ - group?: string; + group?: string; } /** - * Defines the option of CheckboxGroupResult. + * Defines the options of CheckboxGroupResult. * @since 8 */ declare interface CheckboxGroupResult { @@ -56,12 +56,12 @@ declare interface CheckboxGroupResult { * Checkbox name. * @since 8 */ - name: Array; + name: Array; /** * Set the group of status. * @since 8 */ - status: SelectStatus; + status: SelectStatus; } /** @@ -73,7 +73,7 @@ interface CheckboxGroupInterface { * Called when the CheckboxGroup component is used. * @since 8 */ - (options?: CheckboxGroupOption): CheckboxGroupAttribute; + (options?: CheckboxGroupOptions): CheckboxGroupAttribute; } /** @@ -85,13 +85,13 @@ declare class CheckboxGroupAttribute extends CommonMethod PropertyDecorator; */ declare const Watch: (value: string) => PropertyDecorator; - /** * Defining Builder MethodDecorator * @since 7 @@ -141,34 +140,29 @@ declare interface Configuration { /** * Defines the data type of the interface restriction. - * @devices phone, tablet, car * @since 8 */ declare interface Rectangle { /** * x:Horizontal coordinate - * @devices phone, tablet, car * @since 8 */ x?: Length; /** * y:Vertical axis coordinate. - * @devices phone, tablet, car * @since 8 */ y?: Length; /** * Sets the width of the current touchRect. - * @devices phone, tablet, car * @since 8 */ width?: Length; /** * Sets the height of the current touchRect. - * @devices phone, tablet, car * @since 8 */ height?: Length; @@ -177,6 +171,7 @@ declare interface Rectangle { /** * Defining isSystemplugin Constants. * @since 7 + * @systemapi */ declare const isSystemplugin: (...args: string[]) => any; @@ -193,42 +188,290 @@ declare function $r(value: string, ...params: any[]): Resource; declare function $rawfile(value: string): Resource; /** - * global getContentStorage function - * @since 8 - */ -declare function getContentStorage(value: any): ContentStorage; - -declare type Context = any; - -/** - * global getContext function - * @since 8 + * Defines the animate function params. + * @since 7 */ -declare function getContext(value: any): Context; - -interface AnimateToParam { +declare interface AnimateParam { + /** + * Animation duration, in ms. + * @since 7 + */ duration?: number; + /** + * Animation playback speed. A larger value indicates faster animation playback, and a smaller value indicates slower + * animation playback. The value 0 means that there is no animation. + * @since 7 + */ tempo?: number; + /** + * Animation curve. + * @since 7 + */ curve?: Curve | string; + /** + * Animation playback mode. By default, the animation is played from the beginning after the playback is complete. + * @since 7 + */ delay?: number; + /** + * Animation playback mode. By default, the animation is played from the beginning after the playback is complete. + * @since 7 + */ iterations?: number; + /** + * Animation playback mode. By default, the animation is played from the beginning after the playback is complete. + * @since 7 + */ playMode?: PlayMode; + /** + * Callback invoked when the animation playback is complete. + * @since 7 + */ onFinish?: () => void; } +/** + * Defines the motion path options. + * @since 7 + */ +declare interface MotionPathOptions { + /** + * The path info. + * @since 7 + */ + path: string; + /** + * The origin point info. + * @since 7 + */ + from?: number; + /** + * The distance point info. + * @since 7 + */ + to?: number; + /** + * The rotate info. + * @since 7 + */ + rotatable?: boolean; +} + +/** + * Defines the shard transition function params. + * @since 7 + */ +declare interface sharedTransitionOptions { + /** + * Animation duration, in ms. + * @since 7 + */ + duration?: number; + /** + * Animation duration, in ms. + * @since 7 + */ + curve?: Curve | string; + /** + * Animation playback mode. By default, the animation is played from the beginning after the playback is complete. + * @since 7 + */ + delay?: number; + /** + * The motion path info. + * @since 7 + */ + motionPath?: MotionPathOptions; + /** + * Z index info. + * @since 7 + */ + zIndex?: number; + /** + * the animate type. + * @since 7 + */ + type?: SharedTransitionEffectType; +} + +/** + * Defines the options of translate. + * @since 7 + */ +declare interface TranslateOptions { + /** + * The param of x direction. + * @since 7 + */ + x?: number | string; + /** + * The param of y direction. + * @since 7 + */ + y?: number | string; + /** + * The param of z direction. + * @since 7 + */ + z?: number | string; +} + +/** + * Defines the options of scale. + * @since 7 + */ +declare interface ScaleOptions { + /** + * The param of x direction. + * @since 7 + */ + x?: number; + /** + * The param of y direction. + * @since 7 + */ + y?: number; + /** + * The param of z direction. + * @since 7 + */ + z?: number; + /** + * The param of center point of x. + * @since 7 + */ + centerX?: number | string; + /** + * The param of center point of y. + * @since 7 + */ + centerY?: number | string; +} + +declare interface RotateOptions { + /** + * The param of x direction. + * @since 7 + */ + x?: number; + /** + * The param of y direction. + * @since 7 + */ + y?: number; + /** + * The param of z direction. + * @since 7 + */ + z?: number; + /** + * The param of center point of x. + * @since 7 + */ + centerX?: number | string; + /** + * The param of center point of y. + * @since 7 + */ + centerY?: number | string; + /** + * The param of angle. + * @since 7 + */ + angle: number | string; +} + +/** + * Defines the param of transition. + * @since 7 + */ +declare interface TransitionOptions { + /** + * Defines the param of type. + * @since 7 + */ + type?: TransitionType; + /** + * Defines the param of opacity. + * @since 7 + */ + opacity?: number; + /** + * Defines the param of translate. + * @since 7 + */ + translate?: TranslateOptions; + /** + * Defines the param of scale. + * @since 7 + */ + scale?: ScaleOptions; + /** + * Defines the param of rotate. + * @since 7 + */ + rotate?: RotateOptions; +} + /** * Define Preview property * @since 8 + * @systemapi */ interface PreviewParams { + /** + * Define Preview title + * @since 8 + * @systemapi + */ title?: string; + /** + * Define Preview width + * @since 8 + * @systemapi + */ width?: number; + /** + * Define Preview height + * @since 8 + * @systemapi + */ height?: number; + /** + * Define Preview locale + * @since 8 + * @systemapi + */ locale?: string; + /** + * Define Preview colorMode + * @since 8 + * @systemapi + */ colorMode?: string; + /** + * Define Preview deviceType + * @since 8 + * @systemapi + */ deviceType?: string; + /** + * Define Preview dpi + * @since 8 + * @systemapi + */ dpi?: number; + /** + * Define Preview orientation + * @since 8 + * @systemapi + */ orientation?: string; + /** + * Define Preview roundScreen + * @since 8 + * @systemapi + */ roundScreen?: boolean; } @@ -236,7 +479,7 @@ interface PreviewParams { * ItemDragInfo object description * @since 8 */ -interface ItemDragInfo { +declare interface ItemDragInfo { /** * Obtains the X coordinate of the drag window, in vp. * @since 8 @@ -254,7 +497,7 @@ interface ItemDragInfo { * DragItemInfo object description * @since 8 */ -interface DragItemInfo { +declare interface DragItemInfo { /** * Uses the pixelMap object for drawing. * @since 8 @@ -274,17 +517,11 @@ interface DragItemInfo { extraInfo?: string; } -/** - * Defining syscap function. - * @since 8 - */ -declare function canIUse(syscap: string): boolean; - /** * Defining animation function. * @since 7 */ -declare function animateTo(value: AnimateToParam, event: () => void): void; +declare function animateTo(value: AnimateParam, event: () => void): void; /** * Converts a value in vp units to a value in px. @@ -326,7 +563,7 @@ declare function px2lpx(value: number): number; * Defines the event target. * @since 8 */ -interface EventTarget { +declare interface EventTarget { /** * Area of current target. * @since 8 @@ -362,7 +599,7 @@ declare enum SourceType { * Defines the base event. * @since 8 */ -interface BaseEvent { +declare interface BaseEvent { /** * Defines the current target which fires this event. * @since 8 @@ -386,7 +623,7 @@ interface BaseEvent { * The tap action triggers this method invocation. * @since 7 */ -interface ClickEvent extends BaseEvent { +declare interface ClickEvent extends BaseEvent { /** * X coordinate of the click point relative to the left edge of the device screen. * @since 7 @@ -416,7 +653,7 @@ interface ClickEvent extends BaseEvent { * The mouse click action triggers this method invocation. * @since 8 */ -interface MouseEvent extends BaseEvent { +declare interface MouseEvent extends BaseEvent { /** * Mouse button of the click event. * @since 8 @@ -464,7 +701,7 @@ interface MouseEvent extends BaseEvent { * Type of the touch event. * @since 7 */ -interface TouchObject { +declare interface TouchObject { /** * Type of the touch event. * @since 7 @@ -506,7 +743,7 @@ interface TouchObject { * Touch Action Function Parameters * @since 7 */ -interface TouchEvent extends BaseEvent { +declare interface TouchEvent extends BaseEvent { /** * Type of the touch event. * @since 7 @@ -532,13 +769,21 @@ interface TouchEvent extends BaseEvent { stopPropagation?: () => void; } +/** + * Defines the PixelMap type object for ui component. + * @since 7 + */ +declare type PixelMap = PixelMapMock; + /** * pixelmap object with release function. + * @systemapi * @since 7 */ -declare class PixelMap { +declare interface PixelMapMock { /** * release function. + * @systemapi * @since 7 */ release(): void; @@ -548,7 +793,7 @@ declare class PixelMap { * DragEvent object description * @since 7 */ -interface DragEvent { +declare interface DragEvent { /** * Obtains the X coordinate of the drag window, in vp. * @since 7 @@ -566,7 +811,7 @@ interface DragEvent { * KeyEvent object description: * @since 7 */ -interface KeyEvent { +declare interface KeyEvent { /** * Type of a key. * @since 7 @@ -621,7 +866,7 @@ interface KeyEvent { * Component State Styels. * @since 8 */ -interface StateStyels { +declare interface StateStyles { /** * Defines normal state styles. * @since 8 @@ -653,7 +898,11 @@ interface StateStyels { clicked?: any; } -interface PopupOption { +/** + * Defines the popup options. + * @since 7 + */ +declare interface PopupOptions { /** * Information in the pop-up window. * @since 7 @@ -709,7 +958,11 @@ interface PopupOption { onStateChange?: (event: { isVisible: boolean }) => void; } -interface CustomPopupOption { +/** + * Defines the custom popup options. + * @since 8 + */ +declare interface CustomPopupOptions { /** * builder of popup * @since 8 @@ -754,13 +1007,15 @@ interface CustomPopupOption { } /** - * CommonMethod + * CommonMethod. * @since 7 */ declare class CommonMethod { /** * constructor. + * @systemapi * @since 7 + * @ignore */ constructor(); @@ -778,7 +1033,6 @@ declare class CommonMethod { /** * Sets the response region of the current component. - * @devices phone, tablet, car * @since 8 */ responseRegion(value: Array | Rectangle): T; @@ -787,42 +1041,35 @@ declare class CommonMethod { * The size of the current component. * @since 7 */ - size(value: { width?: Length; height?: Length }): T; + size(value: SizeOptions): T; /** * constraint Size: * minWidth:minimum Width,maxWidth:maximum Width,minHeight:minimum Height ,maxHeight:maximum Height, * @since 7 */ - constraintSize(value: { - minWidth?: number | string | Resource; - maxWidth?: number | string | Resource; - minHeight?: number | string | Resource; - maxHeight?: number | string | Resource; - }): T; + constraintSize(value: ConstraintSizeOptions): T; /** * Sets the touchable of the current component - * @devices phone, tablet, car - * @since 8 + * @since 7 */ touchable(value: boolean): T; /** * layout Weight - * @devices phone, tablet, car. * @since 7 */ layoutWeight(value: number | string): T; /** - * Inner margin + * Inner margin. * @since 7 */ padding(value: Padding | Length): T; /** - * Outer Margin + * Outer Margin. * @since 7 */ margin(value: Margin | Length): T; @@ -831,32 +1078,27 @@ declare class CommonMethod { * Background color * @since 7 */ - backgroundColor(value: Color | number | string | Resource): T; + backgroundColor(value: ResourceColor): T; /** * Background image * src: Image address url * @since 7 */ - backgroundImage(src: string | Resource, repeat?: ImageRepeat): T; + backgroundImage(src: ResourceStr, repeat?: ImageRepeat): T; /** * Background image size * @since 7 */ - backgroundImageSize( - value: { - width?: number | string | Resource; - height?: number | string | Resource - } | ImageSize - ): T; + backgroundImageSize(value: SizeOptions | ImageSize): T; /** * Background image position * x:Horizontal coordinate;y:Vertical axis coordinate. * @since 7 */ - backgroundImagePosition(value: { x?: number | string | Resource; y?: number | string | Resource } | Alignment): T; + backgroundImagePosition(value: Position | Alignment): T; /** * Opacity @@ -869,12 +1111,7 @@ declare class CommonMethod { * width:Border width;color:Border color;radius:Border radius; * @since 7 */ - border(value: { - width?: number | string | Resource; - color?: Color | number | string | Resource; - radius?: number | string | Resource; - style?: BorderStyle; - }): T; + border(value: BorderOptions): T; /** * Border style @@ -886,19 +1123,19 @@ declare class CommonMethod { * Border width * @since 7 */ - borderWidth(value: number | string | Resource): T; + borderWidth(value: Length): T; /** * Border color * @since 7 */ - borderColor(value: Color | number | string | Resource): T; + borderColor(value: ResourceColor): T; /** * Border radius * @since 7 */ - borderRadius(value: number | string | Resource): T; + borderRadius(value: Length): T; /** * Trigger a click event when a click is clicked. @@ -940,68 +1177,31 @@ declare class CommonMethod { * Set focusable. * @since 8 */ - focusable(value: boolean): T; + focusable(value: boolean): T; /** * Trigger a event when got focus. * @since 8 */ - onFocus(event: () => void): T; + onFocus(event: () => void): T; /** * Trigger a event when lose focus. * @since 8 */ - onBlur(event: () => void): T; - - /** - * Trigger a event when focus move. - * @since 8 - */ - onFocusMove(event: (direction?: FocusDirection) => void): T; + onBlur(event: () => void): T; /** * animation * @since 7 */ - animation(value: { - duration?: number; - tempo?: number; - curve?: Curve | string; - delay?: number; - iterations?: number; - playMode?: PlayMode; - onFinish?: () => void; - }): T; + animation(value: AnimateParam): T; /** * Transition parameter * @since 7 */ - transition(value: { - type?: TransitionType; - opacity?: number; - translate?: { - x?: number | string; - y?: number | string; - z?: number | string; - }; - scale?: { - x?: number; - y?: number; - z?: number; - centerX?: number | string; - centerY?: number | string; - }; - rotate?: { - x?: number; - y?: number; - z?: number; - centerX?: number | string; - centerY?: number | string; - angle: number | string; - }; - }): T; + transition(value: TransitionOptions): T; /** * Bind gesture recognition. @@ -1105,13 +1305,13 @@ declare class CommonMethod { * When this parameter is set together with slide, slide takes effect by default. * @since 7 */ - translate(value: { x?: number | string; y?: number | string; z?: number | string }): T; + translate(value: TranslateOptions): T; /** * Sets the zoom effect during page transition. The value is the start point of entry and end point of exit. * @since 7 */ - scale(value: { x?: number; y?: number; z?: number; centerX?: number | string; centerY?: number | string }): T; + scale(value: ScaleOptions): T; /** * Default number of occupied columns, indicating the number of occupied grid columns when the number of columns (span) of the corresponding size is not set in the useSizeType attribute. @@ -1131,14 +1331,7 @@ declare class CommonMethod { * The values are the start point during insertion and the end point during deletion. * @since 7 */ - rotate(value: { - x?: number; - y?: number; - z?: number; - centerX?: number | string; - centerY?: number | string; - angle: number | string; - }): T; + rotate(value: RotateOptions): T; /** * Sets the transformation matrix for the current component. @@ -1159,7 +1352,7 @@ declare class CommonMethod { onDisAppear(event: () => void): T; /** - * This callback is triggered when the size or position of this component has changed. + * This callback is triggered when the size or position of this component change finished. * @param event event callback. * @since 8 */ @@ -1211,22 +1404,7 @@ declare class CommonMethod { * If the components of the two pages are configured with the same ID, the shared element transition is performed during transition. If the parameter is set to an empty string, the shared element transition does not occur. For details about the options parameter, see the options parameter description. * @since 7 */ - sharedTransition( - id: string, - options?: { - duration?: number; - curve?: Curve | string; - delay?: number; - motionPath?: { - path: string; - from?: number; - to?: number; - rotatable?: boolean; - }; - zIndex?: number; - type?: SharedTransitionEffectType; - }, - ): T; + sharedTransition(id: string, options?: sharedTransitionOptions): T; /** * Sets the sliding direction. The enumerated value supports logical AND (&) and logical OR (|). @@ -1244,20 +1422,20 @@ declare class CommonMethod { * position * @since 7 */ - position(value: { x?: number | string | Resource; y?: number | string | Resource }): T; + position(value: Position): T; /** * Sets the anchor point of the element when it is positioned. The base point is offset from the top start point of the element. * @since 7 */ - markAnchor(value: { x?: number | string | Resource; y?: number | string | Resource }): T; + markAnchor(value: Position): T; /** * Coordinate offset relative to the layout completion position. * Setting this attribute does not affect the layout of the parent container. The position is adjusted only during drawing. * @since 7 */ - offset(value: { x?: number | string | Resource; y?: number | string | Resource }): T; + offset(value: Position): T; /** * If the value is true, the component is available and can respond to operations such as clicking. @@ -1371,7 +1549,7 @@ declare class CommonMethod { * rotatble:Whether to follow the path for rotation. * @since 7 */ - motionPath(value: { path: string; from?: number; to?: number; rotatable?: boolean }): T; + motionPath(value: MotionPathOptions): T; /** * Add a shadow effect to the current component @@ -1400,6 +1578,8 @@ declare class CommonMethod { /** * Key. User can set an key to the component to identify it. * @since 8 + * @systemapi + * @test */ key(value: string): T; @@ -1419,7 +1599,7 @@ declare class CommonMethod { * Popup control * @since 7 */ - bindPopup(show: boolean, popup: PopupOption | CustomPopupOption): T; + bindPopup(show: boolean, popup: PopupOptions | CustomPopupOptions): T; /** * Menu control @@ -1431,13 +1611,13 @@ declare class CommonMethod { * ContextMenu control * @since 8 */ - bindContextMenu(content: CustomBuilder, responseType : ResponseType): T; + bindContextMenu(content: CustomBuilder, responseType: ResponseType): T; /** * Sets styles for component state. * @since 8 */ - stateStyles(value: StateStyels): T; + stateStyles(value: StateStyles): T; /** * id for distrubte identification. @@ -1447,13 +1627,13 @@ declare class CommonMethod { } /** - * CommonAttribute + * CommonAttribute for ide. * @since 7 */ declare class CommonAttribute extends CommonMethod {} /** - * CommonInterface + * CommonInterface for ide. * @since 7 */ interface CommonInterface { @@ -1461,13 +1641,13 @@ interface CommonInterface { } /** - * CommonInstance + * CommonInstance for ide. * @since 7 */ declare const CommonInstance: CommonAttribute; /** - * Common + * Common for ide. * @since 7 */ declare const Common: CommonInterface; @@ -1486,6 +1666,7 @@ declare class CommonShapeMethod extends CommonMethod { /** * constructor. * @since 7 + * @syetemapi */ constructor(); @@ -1493,13 +1674,13 @@ declare class CommonShapeMethod extends CommonMethod { * border Color * @since 7 */ - stroke(value: Color | number | string | Resource): T; + stroke(value: ResourceColor): T; /** * Fill color. * @since 7 */ - fill(value: Color | number | string | Resource): T; + fill(value: ResourceColor): T; /** * Offset from the start point of the border drawing. @@ -1541,7 +1722,7 @@ declare class CommonShapeMethod extends CommonMethod { * Sets the width of the dividing line. * @since 7 */ - strokeWidth(value: number | string | Resource): T; + strokeWidth(value: Length): T; /** * Indicates whether to enable anti-aliasing @@ -1578,16 +1759,45 @@ declare class CustomComponent { * @since 7 */ aboutToDisappear?(): void; + + /** + * onPageShow Method + * @since 7 + */ + onPageShow?(): void; + + /** + * onPageHide Method + * @since 7 + */ + onPageHide?(): void; + + /** + * onBackPress Method + * @since 7 + */ + onBackPress?(): void; } /** * View * @ignore ide should ignore this class + * @systemapi + * @since 7 */ declare class View { /** * Just use for generate tsbundle * @ignore ide should ignore this arrtibute + * @systemapi + * @since 7 */ create(value: any): any; } + +declare module "SpecialEvent" { + module "SpecialEvent" { + // @ts-ignore + export { TouchObject, KeyEvent, MouseEvent }; + } +} diff --git a/api/@internal/component/ets/custom_dialog_controller.d.ts b/api/@internal/component/ets/custom_dialog_controller.d.ts index f208a905785be27f76a992eedab3d378025097ff..c0686ea814e4b35b9b29656c644f81941aa2951e 100644 --- a/api/@internal/component/ets/custom_dialog_controller.d.ts +++ b/api/@internal/component/ets/custom_dialog_controller.d.ts @@ -15,10 +15,10 @@ /** - * Defines the option of CustomDialogController. + * Defines the options of CustomDialogController. * @since 7 */ -declare interface CustomDialogControllerOption { +declare interface CustomDialogControllerOptions { /** * Custom builder function. * @since 7 @@ -71,7 +71,7 @@ declare class CustomDialogController { * The constructor transfers parameter settings. * @since 7 */ - constructor(value: CustomDialogControllerOption); + constructor(value: CustomDialogControllerOptions); /** * Display the content of the customized pop-up window. If the content has been displayed, it does not take effect. diff --git a/api/@internal/component/ets/data_panel.d.ts b/api/@internal/component/ets/data_panel.d.ts index 82d6f4c68b00d7197d82962285509577acdf8e30..9a702b2b2ef3e159ad7ae81d09314f1afc86098e 100644 --- a/api/@internal/component/ets/data_panel.d.ts +++ b/api/@internal/component/ets/data_panel.d.ts @@ -33,10 +33,10 @@ declare enum DataPanelType { } /** - * Defines the option of DataPanel. + * Defines the options of DataPanel. * @since 7 */ -declare interface DataPanelOption { +declare interface DataPanelOptions { /** * Current data value. the max length is 9. * @since 7 @@ -65,7 +65,7 @@ interface DataPanelInterface { * Return a DataPanel. * @since 7 */ - (options: DataPanelOption): DataPanelAttribute; + (options: DataPanelOptions): DataPanelAttribute; } /** diff --git a/api/@internal/component/ets/date_picker.d.ts b/api/@internal/component/ets/date_picker.d.ts index d5c55b20326d52915413b59f6e530182066a9787..02c116589efa4388800628ddaedbebd30913fed4 100644 --- a/api/@internal/component/ets/date_picker.d.ts +++ b/api/@internal/component/ets/date_picker.d.ts @@ -13,24 +13,6 @@ * limitations under the License. */ -/** - * Defines the type of DatePicker. - * @since 8 - */ -declare enum DatePickerType { - /** - * Application hour and second - * @since 8 - */ - Time, - - /** - * Application data - * @since 8 - */ - Date, -} - /** * Defines the struct of DatePickerResult. * @since 8 @@ -53,49 +35,29 @@ declare interface DatePickerResult { * @since 8 */ day?: number; - - /** - * Application hour - * @since 8 - */ - hour?: number; - - /** - * Application minute - * @since 8 - */ - minute?: number; - - /** - * Application second - * @since 8 - */ - second?: number; } /** - * Defines the option of DatePicker. + * Defines the options of DatePicker. * @since 8 */ -declare interface DatePickerOption { +declare interface DatePickerOptions { /** * Specifies the start date of the date selector. + * @since 8 */ start?: Date; /** * Specifies the end date for the date selector. + * @since 8 */ end?: Date; /** * Specifies the date selector check date or time selector check time. + * @since 8 */ selected?: Date; - - /** - * Selector type, including date selector and time selector. By default, the date selector is used. - */ - type?: DatePickerType; } /** @@ -107,7 +69,7 @@ interface DatePickerInterface { * Defines the DatePicker constructor. * @since 8 */ - (options?: DatePickerOption): DatePickerAttribute; + (options?: DatePickerOptions): DatePickerAttribute; } /** @@ -121,12 +83,6 @@ declare class DatePickerAttribute extends CommonMethod { */ lunar(value: boolean): DatePickerAttribute; - /** - * Time Selector: indicates whether to display the 24-hour clock. - * @since 8 - */ - useMilitaryTime(value: boolean): DatePickerAttribute; - /** * This event is triggered when a DatePicker date or time is selected. * @since 8 @@ -135,20 +91,16 @@ declare class DatePickerAttribute extends CommonMethod { } /** - * Defines the DatePickerDialogOption for Data Picker Dialog. + * Defines the DatePickerDialogOptions for Data Picker Dialog. * @since 8 */ -declare interface DatePickerDialogOption extends DatePickerOption { +declare interface DatePickerDialogOptions extends DatePickerOptions { /** * Date selector: true: displays the lunar calendar. false: The lunar calendar is not displayed. * @since 8 */ lunar?: boolean; - /** - * Time Selector: indicates whether to display the 24-hour clock. - * @since 8 - */ - useMilitaryTime?: boolean; + /** * Called when the OK button in the dialog is clicked. * @since 8 @@ -175,7 +127,7 @@ declare class DatePickerDialog { * Invoking method display. * @since 8 */ - static show(options?: DatePickerDialogOption); + static show(options?: DatePickerDialogOptions); } declare const DatePicker: DatePickerInterface; diff --git a/api/@internal/component/ets/divider.d.ts b/api/@internal/component/ets/divider.d.ts index 4ee88aa42e24c44c25e9f4d0d61aa9e2edad3633..67ce98ac5debfff200f3423a798fb40e20f2e37f 100644 --- a/api/@internal/component/ets/divider.d.ts +++ b/api/@internal/component/ets/divider.d.ts @@ -13,7 +13,6 @@ * limitations under the License. */ - /** * Provides a divider component to separate different content blocks/content elements. * @since 7 @@ -57,5 +56,5 @@ declare class DividerAttribute extends CommonMethod { lineCap(value: LineCapStyle): DividerAttribute; } -declare const Divider: DividerInterface +declare const Divider: DividerInterface; declare const DividerInstance: DividerAttribute; diff --git a/api/@internal/component/ets/ellipse.d.ts b/api/@internal/component/ets/ellipse.d.ts index 2ba7cdbbba6274970b5ec0f5cdd74d899db71117..2b207f95085f3a4537fb8b0170f068ea2349999d 100644 --- a/api/@internal/component/ets/ellipse.d.ts +++ b/api/@internal/component/ets/ellipse.d.ts @@ -13,7 +13,6 @@ * limitations under the License. */ - /** * Ellipse drawing. * @since 7 diff --git a/api/@internal/component/ets/enums.d.ts b/api/@internal/component/ets/enums.d.ts index bf60ad002433926b4f6e0c48cd52646d85a7f623..518e2efabf457a584b22d6b2321ea1a507f7b164 100644 --- a/api/@internal/component/ets/enums.d.ts +++ b/api/@internal/component/ets/enums.d.ts @@ -274,13 +274,7 @@ declare enum MouseAction { * Triggered when the mouse is Hovered. * @since 8 */ - Hover, - - /** - * Triggered when the mouse status is None. - * @since 8 - */ - None, + Hover } /** @@ -457,60 +451,6 @@ declare enum PlayMode { AlternateReverse, } -/** - * This style allows you to set the window blurring degree and blurring style of the current component layout range, - * @since 7 - */ -declare enum BlurStyle { - /** - * Small range glow effect. - * @since 7 - */ - SmallLight, - - /** - * Medium range glow effect. - * @since 7 - */ - MediumLight, - - /** - * Wide range of luminous effects. - * @since 7 - */ - LargeLight, - - /** - * Super-range luminous effect. - * @since 7 - */ - XlargeLight, - - /** - * Small range of dark effects. - * @since 7 - */ - SmallDark, - - /** - * Medium range dark effect. - * @since 7 - */ - MediumDark, - - /** - * Wide range of dark effects. - * @since 7 - */ - LargeDark, - - /** - * Extra large range of dark effects. - * @since 7 - */ - XlargeDark, -} - /** * Type of a key. * @since 7 @@ -667,42 +607,6 @@ declare enum Direction { Auto, } -/** - * Sets the horizontal layout of elements. - * @since 8 - */ -declare enum FocusDirection { - /** - * From the key up. - * @since 8 - */ - Up, - - /** - * From the key down. - * @since 8 - */ - Down, - - /** - * From the key left. - * @since 8 - */ - Left, - - /** - * From the key right. - * @since 8 - */ - Right, - - /** - * From the key tab. - * @since 8 - */ - Tab, -} - /** * Used to set the status of the scroll bar. * @since 7 @@ -1449,7 +1353,7 @@ declare enum HoverEffect { * Highlight effect * @since 8 */ - Board, + Highlight, /** * None effect diff --git a/api/@internal/component/ets/flex.d.ts b/api/@internal/component/ets/flex.d.ts index 0e6bb92157dfb4a59f4214380a00e2bcea6ae5b2..a22e7c704c5c2801c0c660a4c5038bea99bdddb7 100644 --- a/api/@internal/component/ets/flex.d.ts +++ b/api/@internal/component/ets/flex.d.ts @@ -14,10 +14,10 @@ */ /** - * Defines the option of Flex. + * Defines the options of Flex. * @since 7 */ -declare interface FlexOption { +declare interface FlexOptions { /** * Sets the horizontal layout of elements. * @since 7 @@ -58,7 +58,7 @@ interface FlexInterface { * Defines the constructor of Flex. * @since 7 */ - (value?: FlexOption): FlexAttribute; + (value?: FlexOptions): FlexAttribute; } /** diff --git a/api/@internal/component/ets/for_each.d.ts b/api/@internal/component/ets/for_each.d.ts index d1e8c71767b13b0655f5eabebe878514378aa4b4..f6bf97cf24a4e5719cf5c22849edf0b8fdabfe8f 100644 --- a/api/@internal/component/ets/for_each.d.ts +++ b/api/@internal/component/ets/for_each.d.ts @@ -14,7 +14,7 @@ */ /** - * looping + * looping function. * @since 7 */ interface ForEachInterface { @@ -29,8 +29,4 @@ interface ForEachInterface { ): ForEachInterface; } -/** - * @devices phone, tablet, car - * @since 7 - */ declare const ForEach: ForEachInterface; diff --git a/api/@internal/component/ets/form_component.d.ts b/api/@internal/component/ets/form_component.d.ts index 1d3fa7dfdd56e0ff2605ab27801d6f5ecee3ff10..e94054f90fc62702d70c57a1d4e7993ddf680d4c 100644 --- a/api/@internal/component/ets/form_component.d.ts +++ b/api/@internal/component/ets/form_component.d.ts @@ -13,7 +13,6 @@ * limitations under the License. */ - /** * Defines the FormDimension enum. * @since 7 @@ -132,6 +131,13 @@ declare class FormComponentAttribute extends CommonMethod void): FormComponentAttribute; + + /** + * Uninstall Card. + * @since 7 + * @systemapi + */ + onUninstall(callback: (info: { id: number }) => void): FormComponentAttribute; } declare const FormComponent: FormComponentInterface; diff --git a/api/@internal/component/ets/gauge.d.ts b/api/@internal/component/ets/gauge.d.ts index 6002fadf1e2c2b76349bb05cdfe4bb2a0adb9e89..cee7e983f4156cfe868dd554d96a19802c195cd0 100644 --- a/api/@internal/component/ets/gauge.d.ts +++ b/api/@internal/component/ets/gauge.d.ts @@ -59,8 +59,8 @@ declare class GaugeAttribute extends CommonMethod { * Sets the thickness of the ring chart. * @since 8 */ - strokeWidth(length: number): GaugeAttribute; + strokeWidth(length: Length): GaugeAttribute; } -declare const Gauge: GaugeInterface +declare const Gauge: GaugeInterface; declare const GaugeInstance: GaugeAttribute; diff --git a/api/@internal/component/ets/gesture.d.ts b/api/@internal/component/ets/gesture.d.ts index a91f87a8593303880f2d89e5434ca595ff355c55..7f98ed77b28c3bcbd35b82fa14e0bcabb4d122f2 100644 --- a/api/@internal/component/ets/gesture.d.ts +++ b/api/@internal/component/ets/gesture.d.ts @@ -13,30 +13,6 @@ * limitations under the License. */ -/** - * Creating an Object - * @since 7 - */ -declare enum GestureDirection { - /** - * Sliding in all directions. - * @since 7 - */ - All, - - /** - * Sliding horizontally. - * @since 7 - */ - Horizontal, - - /** - * Sliding Vertical - * @since 7 - */ - Vertical, -} - /** * Creating an Object * @since 7 @@ -204,7 +180,7 @@ interface FingerInfo { * @since 7 */ declare type GestureType = - | TapGestureInterface + TapGestureInterface | LongPressGestureInterface | PanGestureInterface | PinchGestureInterface @@ -341,10 +317,10 @@ interface LongPressGestureInterface { } /** - * Defines the PanGesture option. + * Defines the PanGesture options. * @since 7 */ -declare class PanGestureOption { +declare class PanGestureOptions { /** * Constructor parameters. * @since 7 @@ -379,7 +355,7 @@ interface PanGestureInterface { * Set the value. * @since 7 */ - (value?: { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOption): PanGestureInterface; + (value?: { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOptions): PanGestureInterface; /** * Pan gesture recognition success callback. diff --git a/api/@internal/component/ets/grid.d.ts b/api/@internal/component/ets/grid.d.ts index fb54634f35b985a9b9bedea76e1134248687a435..e58a4765bcee9799274ca04d52c879227b7de0d0 100644 --- a/api/@internal/component/ets/grid.d.ts +++ b/api/@internal/component/ets/grid.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ - /** + * Defines the grid interface. * @since 7 */ interface GridInterface { @@ -30,13 +30,30 @@ interface GridInterface { * @since 8 */ declare enum GridDirection { + /** + * The row direction. + * @since 8 + */ Row, + /** + * The column direction. + * @since 8 + */ Column, + /** + * The row reverse direction. + * @since 8 + */ RowReverse, - ColumnReverse + /** + * The column reverse direction. + * @since 8 + */ + ColumnReverse, } /** + * Defines the grid attibute functions. * @since 7 */ declare class GridAttribute extends CommonMethod { @@ -112,10 +129,10 @@ declare class GridAttribute extends CommonMethod { */ maxCount(value: number): GridAttribute; - /** - * minCount - * @since 8 - */ + /** + * minCount + * @since 8 + */ minCount(value: number): GridAttribute; /** @@ -166,8 +183,9 @@ declare class GridAttribute extends CommonMethod { * This callback is triggered when the drag behavior is stopped within the scope of the component. * @since 8 */ - onItemDrop(event: - (event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void): GridAttribute; + onItemDrop( + event: (event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void, + ): GridAttribute; } declare const Grid: GridInterface; diff --git a/api/@internal/component/ets/grid_container.d.ts b/api/@internal/component/ets/grid_container.d.ts index 86cacbe4285c3633a39b2a676310922122340997..28203fa47f53365ea30a523ac957abe7864e6577 100644 --- a/api/@internal/component/ets/grid_container.d.ts +++ b/api/@internal/component/ets/grid_container.d.ts @@ -50,10 +50,10 @@ declare enum SizeType { } /** - * Defines the option of GridContainer. + * Defines the options of GridContainer. * @since 7 */ -declare interface GridContainerOption { +declare interface GridContainerOptions { /** * Sets the total number of columns in the current layout. * @since 7 @@ -88,7 +88,7 @@ interface GridContainerInterface { * Defines the constructor of GridContainer. * @since 7 */ - (value?: GridContainerOption): GridContainerAttribute; + (value?: GridContainerOptions): GridContainerAttribute; } /** diff --git a/api/ability/continueAbilityOptions.d.ts b/api/@internal/component/ets/hyperlink.d.ts old mode 100755 new mode 100644 similarity index 51% rename from api/ability/continueAbilityOptions.d.ts rename to api/@internal/component/ets/hyperlink.d.ts index 32c09d141425de7df7c76477511658ea6505d8c6..40751b2d28b0228f41b5266b250b72122e8cc0e6 --- a/api/ability/continueAbilityOptions.d.ts +++ b/api/@internal/component/ets/hyperlink.d.ts @@ -13,30 +13,31 @@ * limitations under the License. */ - /** +/** + * Defines the hyperlink interface. * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A */ -export interface ContinueAbilityOptions { +interface HyperlinkInterface { /** - * Indicates the ID of the target device where this ability will be migrated to. - * - * @default - + * Return to get Hyperlink. + * adress: Web page redirected by the hyperlink component. + * content: Hyperlinks in the hyperlink component display text. * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly */ - deviceId: string; + (address: string | Resource, content?: string | Resource): HyperlinkAttribute; +} +/** + * Defines the hyperlink attibute functions + * @since 7 + */ +declare class HyperlinkAttribute extends CommonMethod { /** - * Indicates whether the ability to be migrated back to the local device through - * This is a reserved field. - * - * @default - + * Set Color * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly */ - reversible?: boolean; -} \ No newline at end of file + color(value: Color | number | string | Resource): HyperlinkAttribute; +} + +declare const Hyperlink: HyperlinkInterface; +declare const HyperlinkInterface: HyperlinkAttribute; diff --git a/api/@internal/component/ets/image.d.ts b/api/@internal/component/ets/image.d.ts index 9474d5f7c62c2a75fe1ad39ad96b25cd967a8456..49465ff58cc663a6fa2f7d492f834889229dd104 100644 --- a/api/@internal/component/ets/image.d.ts +++ b/api/@internal/component/ets/image.d.ts @@ -171,12 +171,5 @@ declare class ImageAttribute extends CommonMethod { onFinish(event: () => void): ImageAttribute; } -/** - * @devices phone, tablet, car - * @since 7 - */ declare const Image: ImageInterface; -/** - * @since 7 - */ declare const ImageInstance: ImageAttribute; diff --git a/api/@internal/component/ets/image_animator.d.ts b/api/@internal/component/ets/image_animator.d.ts index c30d4db7291408156145ee3ef344ba6d1000dab7..aa269104fdb4ab6f8372db7265413d7b459cf3b4 100644 --- a/api/@internal/component/ets/image_animator.d.ts +++ b/api/@internal/component/ets/image_animator.d.ts @@ -14,6 +14,7 @@ */ /** + * Defines the ImageAnimator Interface. * @since 7 */ interface ImageAnimatorInterface { diff --git a/api/@internal/component/ets/index-full.d.ts b/api/@internal/component/ets/index-full.d.ts index f4427afcf654483824da3b49ebf35ca180bd7101..25e737704ec1431e8d9a54197941dfc40709c9f0 100644 --- a/api/@internal/component/ets/index-full.d.ts +++ b/api/@internal/component/ets/index-full.d.ts @@ -44,6 +44,7 @@ /// /// /// +/// /// /// /// @@ -58,7 +59,6 @@ /// /// /// -/// /// /// /// @@ -76,7 +76,6 @@ /// /// /// -/// /// /// /// @@ -92,6 +91,7 @@ /// /// /// +/// /// /// /// diff --git a/api/@internal/component/ets/inspector.d.ts b/api/@internal/component/ets/inspector.d.ts index 7dc106a2babd474a9523768f66be526a935ef3bb..c62f3802cf6cfc69b9c8ea99829073ebc6e02145 100644 --- a/api/@internal/component/ets/inspector.d.ts +++ b/api/@internal/component/ets/inspector.d.ts @@ -29,54 +29,6 @@ declare function getInspectorNodes(): object; */ declare function getInspectorNodeById(id: number): object; -/** - * Get inspector info by key. - * @since 8 - * @systemapi - * @test - */ -declare function getInspectorByKey(id: string): string; - -/** - * Get inspector tree. - * @since 8 - * @systemapi - * @test - */ -declare function getInspectorTree(): string; - -/** - * Send event to inspector by key. Return false if no inspector with key is found. - * @since 8 - * @systemapi - * @test - */ -declare function sendEventByKey(id: string, action: number, params: string): boolean; - -/** - * Send touch event. - * @since 8 - * @systemapi - * @test - */ -declare function sendTouchEvent(event: TouchObject): boolean; - -/** - * Send key event. - * @since 8 - * @systemapi - * @test - */ -declare function sendKeyEvent(event: KeyEvent): boolean; - -/** - * Send mouse event. - * @since 8 - * @systemapi - * @test - */ -declare function sendMouseEvent(event: MouseEvent): boolean; - /** * Profiler tools for inspectors. * @since 8 diff --git a/api/@internal/component/ets/lazy_for_each.d.ts b/api/@internal/component/ets/lazy_for_each.d.ts index 8498b93cb12817ebde6a80faffd21d5c1d44aea3..a027eab8aff3963214cdccde22447144c5a0ea07 100644 --- a/api/@internal/component/ets/lazy_for_each.d.ts +++ b/api/@internal/component/ets/lazy_for_each.d.ts @@ -27,53 +27,81 @@ declare interface DataChangeListener { /** * Data added. * @since 7 + * @deprecated since 8 */ onDataAdded(index: number): void; + /** + * Data added. + * @since 8 + */ + onDataAdd(index: number): void; + /** * Data moved. * @since 7 + * @deprecated since 8 */ onDataMoved(from: number, to: number): void; + /** + * Data moved. + * @since 8 + */ + onDataMove(from: number, to: number): void; + /** * Data deleted. * @since 7 + * @deprecated since 8 */ onDataDeleted(index: number): void; /** - * Data changed. + * Data deleted. + * @since 8 + */ + onDataDelete(index: number): void; + + /** + * Call when has data change. * @since 7 + * @deprecated since 8 */ onDataChanged(index: number): void; + + /** + * Call when has data change. + * @since 8 + */ + onDataChange(index: number): void; } /** - * Data changed. + * Developers need to implement this interface to provide data to LazyForEach component. * @since 7 */ declare interface IDataSource { /** - * Total count. + * Total data count. * @since 7 */ totalCount(): number; /** - * get data. + * Return the data of index. * @since 7 */ getData(index: number): any; /** - * register Data Change Listener + * Register data change listener. * @since 7 */ registerDataChangeListener(listener: DataChangeListener): void; /** - * unregister Data Change Listener + * Unregister data change listener. * @since 7 */ unregisterDataChangeListener(listener: DataChangeListener): void; @@ -95,7 +123,4 @@ interface LazyForEachInterface { ): LazyForEachInterface; } -/** - * @since 7 - */ declare const LazyForEach: LazyForEachInterface; diff --git a/api/@internal/component/ets/list.d.ts b/api/@internal/component/ets/list.d.ts index 8470f64a9b3a7f0d177c389ee4c49af0cba0d9e2..24845b0924b93892776455ee849c167a66825335 100644 --- a/api/@internal/component/ets/list.d.ts +++ b/api/@internal/component/ets/list.d.ts @@ -106,7 +106,7 @@ declare class ListAttribute extends CommonMethod { /** * Called when setting whether to enable chain linkage dynamic effect. - * @since 8 + * @since 7 */ chainAnimation(value: boolean): ListAttribute; @@ -185,8 +185,5 @@ declare class ListAttribute extends CommonMethod { onItemDrop(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void): ListAttribute; } -/** - * @since 7 - */ declare const List: ListInterface; declare const ListInstance: ListAttribute; diff --git a/api/@internal/component/ets/list_item.d.ts b/api/@internal/component/ets/list_item.d.ts index 96b1afa40ca04b93d1eaad56538f3b031a10ec81..70e2a9195dc7c0811ce743e467bc73d28795f37f 100644 --- a/api/@internal/component/ets/list_item.d.ts +++ b/api/@internal/component/ets/list_item.d.ts @@ -40,7 +40,6 @@ declare enum Sticky { /** * Declare whether the ListItem element is editable. - * @devices phone, tablet * @since 7 */ declare enum EditMode { @@ -113,4 +112,3 @@ declare class ListItemAttribute extends CommonMethod { */ declare const ListItemInstance: ListItemAttribute; declare const ListItem: ListItemInterface; - diff --git a/api/@internal/component/ets/loading_progress.d.ts b/api/@internal/component/ets/loading_progress.d.ts index 5bc3c49fd9143fc0c25ddbf99ba3344164968342..2d1ad14dfd53951a27783b7839fd3317c5ac59ba 100644 --- a/api/@internal/component/ets/loading_progress.d.ts +++ b/api/@internal/component/ets/loading_progress.d.ts @@ -37,8 +37,6 @@ declare enum LoadingProgressStyle { Orbital, } - - /** * Provides an interface for extending the loading progress. * @since 8 @@ -71,4 +69,4 @@ declare const LoadingProgress: LoadingProgressInterface; * Loading Progress Extensions on Declarative Classes * @since 8 */ - declare const LoadingProgressInstance: LoadingProgressAttribute \ No newline at end of file +declare const LoadingProgressInstance: LoadingProgressAttribute; diff --git a/api/@internal/component/ets/matrix2d.d.ts b/api/@internal/component/ets/matrix2d.d.ts index 982eb954c091e3ee5a77c3efa8e48000d43108f3..67ffd751c8a678a1e2e5ba522841305c6d1944d3 100644 --- a/api/@internal/component/ets/matrix2d.d.ts +++ b/api/@internal/component/ets/matrix2d.d.ts @@ -17,92 +17,4 @@ * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis * @since 8 */ -declare class Matrix2D { - /** - * Horizontal Zoom - * @since 8 - */ - scaleX?: number; - - /** - * Vertical Tilt - * @since 8 - */ - rotateY?: number; - - /** - * Horizontal Tilt - * @since 8 - */ - rotateX?: number; - - /** - * Vertical Zoom - * @since 8 - */ - scaleY?: number; - - /** - * Horizontal movement - * @since 8 - */ - translateX?: number; - - /** - * Vertical movement - * @since 8 - */ - translateY?: number; - - /** - * Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational - * translation scaling effect) - * @since 8 - */ - identity(): Matrix2D; - - /** - * Transform the current 2D matrix into an inverse matrix (that is, the transformation effect - * is the opposite effect of the original) - * @since 8 - */ - invert(): Matrix2D; - - /** - * The matrix is superimposed in right multiplication mode. When the input parameter is empty, - * the matrix is superimposed. - * @param other Matrix to be superimposed - * @since 8 - */ - multiply(other?: Matrix2D): Matrix2D; - - /** - * Adds the rotation effect of the X and Y axes to the current matrix. - * @param rx Rotation effect of the X axis - * @param ry Rotation effect of the Y-axis - * @since 8 - */ - rotate(rx?: number, ry?: number): Matrix2D; - - /** - * Adds the translation effect of the X and Y axes to the current matrix. - * @param tx X-axis translation effect - * @param ty Y-axis translation effect - * @since 8 - */ - translate(tx?: number, ty?: number): Matrix2D; - - /** - * Adds the scaling effect of the X and Y axes to the current matrix. - * @param sx X-axis scaling effect - * @param sy Y-axis scaling effect - * @since 8 - */ - scale(sx?: number, sy?: number): Matrix2D; - - /** - * Constructs a 2D change matrix object. The default value is the unit matrix. - * @since 8 - */ - constructor(); -} +declare type Matrix2D = import('../api/@internal/full/canvaspattern').Matrix2D diff --git a/api/@internal/component/ets/middle_class.d.ts b/api/@internal/component/ets/middle_class.d.ts index 05aaf273f822dd40c45e45467b007806db124d2d..adad7410a1fd41cc46380f309ee2a7f55e65b15a 100644 --- a/api/@internal/component/ets/middle_class.d.ts +++ b/api/@internal/component/ets/middle_class.d.ts @@ -1,623 +1,2351 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSAlphabetIndexerAttribute extends CommonMethod { - pop(): AlphabetIndexerAttribute; - debugLine(value: string): AlphabetIndexerAttribute; - create(value: { - arrayValue: Array; - selected: number; - }): AlphabetIndexerAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): AlphabetIndexerAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): AlphabetIndexerAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: { arrayValue: Array; selected: number }): AlphabetIndexerAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSAnimatorAttribute extends CommonMethod { - create(value: string): AnimatorAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: string): AnimatorAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSBadgeAttribute extends CommonMethod { - pop(): BadgeAttribute; - debugLine(value: string): BadgeAttribute; - create(value: BadgeParamWithNumber | BadgeParamWithString): BadgeAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): BadgeAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): BadgeAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: BadgeParamWithNumber | BadgeParamWithString): BadgeAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSBlankAttribute extends CommonMethod { - create(min?: number | string): BlankAttribute; - pop(): BlankAttribute; - debugLine(value: string): BlankAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(min?: number | string): BlankAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): BlankAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): BlankAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSButtonAttribute extends CommonMethod { - createWithChild(label?: ResourceStr, options?: ButtonOption): ButtonAttribute; - createWithLabel(label?: ResourceStr, options?: ButtonOption): ButtonAttribute; - pop(): ButtonAttribute; - debugLine(value: string): ButtonAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + createWithChild(label?: ResourceStr, options?: ButtonOptions): ButtonAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + createWithLabel(label?: ResourceStr, options?: ButtonOptions): ButtonAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): ButtonAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): ButtonAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSCalendarAttribute { - create(value: { - date: { - year: number; - month: number; - day: number; - }; - currentData: MonthData; - preData: MonthData; - nextData: MonthData; - controller?: CalendarController; - }): CalendarAttribute; - pop(): CalendarAttribute; - debugLine(value: string): CalendarAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: { + date: { + year: number; + month: number; + day: number; + }; + currentData: MonthData; + preData: MonthData; + nextData: MonthData; + controller?: CalendarController; + }): CalendarAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): CalendarAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): CalendarAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSCanvasAttribute extends CommonMethod { - create(context?: CanvasRenderingContext2D): CanvasAttribute; - pop(): CanvasAttribute; - debugLine(value: string): CanvasAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(context?: CanvasRenderingContext2D): CanvasAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): CanvasAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): CanvasAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSCheckboxAttribute extends CommonMethod { - create(options?: CheckboxOption): CheckboxAttribute; - pop(): CheckboxAttribute; - debugLine(value: string): CheckboxAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options?: CheckboxOptions): CheckboxAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): CheckboxAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): CheckboxAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSCheckboxGroupAttribute extends CommonMethod { - create(options?: CheckboxGroupOption): CheckboxGroupAttribute; - pop(): CheckboxGroupAttribute; - debugLine(value: string): CheckboxGroupAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options?: CheckboxGroupOptions): CheckboxGroupAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): CheckboxGroupAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): CheckboxGroupAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSCircleAttribute extends CommonShapeMethod { - create(value?: CircleOption): CircleAttribute; - debugLine(value: string): CircleAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: CircleOptions): CircleAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): CircleAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSColumnAttribute extends CommonMethod { - create(value?: { - space?: string | number; - }): ColumnAttribute; - pop(): ColumnAttribute; - debugLine(value: string): ColumnAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { space?: string | number }): ColumnAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): ColumnAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): ColumnAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSColumnSplitAttribute extends CommonMethod { - create(): ColumnSplitAttribute; - pop(): ColumnSplitAttribute; - debugLine(value: string): ColumnSplitAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(): ColumnSplitAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): ColumnSplitAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): ColumnSplitAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSCounterAttribute extends CommonMethod { - create(): CounterAttribute; - pop(): CounterAttribute; - debugLine(value: string): CounterAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(): CounterAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): CounterAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): CounterAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSDataPanelAttribute extends CommonMethod { - create(options: DataPanelOption): DataPanelAttribute; - pop(): DataPanelAttribute; - debugLine(value: string): DataPanelAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options: DataPanelOptions): DataPanelAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): DataPanelAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): DataPanelAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSDatePickerAttribute extends CommonMethod { - create(options?: DatePickerOption): DatePickerAttribute; - pop(): DatePickerAttribute; - debugLine(value: string): DatePickerAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options?: DatePickerOptions): DatePickerAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): DatePickerAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): DatePickerAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSDividerAttribute extends CommonMethod { - create(): DividerAttribute; - debugLine(value: string): DividerAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(): DividerAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): DividerAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSEllipseAttribute extends CommonShapeMethod { - create(value?: { - width?: string | number; - height?: string | number; - }): EllipseAttribute; - debugLine(value: string): EllipseAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { width?: string | number; height?: string | number }): EllipseAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): EllipseAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSFlexAttribute extends CommonMethod { - create(value?: FlexOption): FlexAttribute; - pop(): FlexAttribute; - debugLine(value: string): FlexAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: FlexOptions): FlexAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): FlexAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): FlexAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSForEachInterface { - create(arr: Array, itemGenerator: (item: any, index?: number) => void, keyGenerator?: (item: any, index?: number) => string): ForEachInterface; - pop(): ForEachInterface; - debugLine(value: string): ForEachInterface; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create( + arr: Array, + itemGenerator: (item: any, index?: number) => void, + keyGenerator?: (item: any, index?: number) => string, + ): ForEachInterface; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): ForEachInterface; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): ForEachInterface; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSFormComponentAttribute extends CommonMethod { - create(value: { - id: number; - name: string; - bundle: string; - ability: string; - module: string; - dimension?: FormDimension; - temporary?: boolean; - }): FormComponentAttribute; - debugLine(value: string): FormComponentAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: { + id: number; + name: string; + bundle: string; + ability: string; + module: string; + dimension?: FormDimension; + temporary?: boolean; + }): FormComponentAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): FormComponentAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSGaugeAttribute extends CommonMethod { - create(options: { - value: number; - min?: number; - max?: number; - }): GaugeAttribute; - debugLine(value: string): GaugeAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options: { value: number; min?: number; max?: number }): GaugeAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): GaugeAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSGridAttribute extends CommonMethod { - create(scroller?: Scroller): GridAttribute; - pop(): GridAttribute; - debugLine(value: string): GridAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(scroller?: Scroller): GridAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): GridAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): GridAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSGridItemAttribute extends CommonMethod { - create(): GridItemAttribute; - pop(): GridItemAttribute; - debugLine(value: string): GridItemAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(): GridItemAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): GridItemAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): GridItemAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSGridContainerAttribute extends ColumnAttribute { - create(value?: GridContainerOption): GridContainerAttribute; - pop(): GridContainerAttribute; - debugLine(value: string): GridContainerAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: GridContainerOptions): GridContainerAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): GridContainerAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): GridContainerAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSImageAttribute extends CommonMethod { - create(src: string | PixelMap | Resource): ImageAttribute; - debugLine(value: string): ImageAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(src: string | PixelMap | Resource): ImageAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): ImageAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSImageAnimatorAttribute extends CommonMethod { - create(): ImageAnimatorAttribute; - debugLine(value: string): ImageAnimatorAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(): ImageAnimatorAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): ImageAnimatorAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSLazyForEachInterface { - create(dataSource: IDataSource, itemGenerator: (item: any, index?: number) => void, keyGenerator?: (item: any, index?: number) => string): LazyForEachInterface; - pop(): LazyForEachInterface; - debugLine(value: string): LazyForEachInterface; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create( + dataSource: IDataSource, + itemGenerator: (item: any, index?: number) => void, + keyGenerator?: (item: any, index?: number) => string, + ): LazyForEachInterface; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): LazyForEachInterface; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): LazyForEachInterface; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSLineAttribute extends CommonShapeMethod { - create(value?: { - width?: string | number; - height?: string | number; - }): LineAttribute; - debugLine(value: string): LineAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { width?: string | number; height?: string | number }): LineAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): LineAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSListAttribute extends CommonMethod { - create(value?: { - initialIndex?: number; - space?: number | string; - scroller?: Scroller; - }): ListAttribute; - pop(): ListAttribute; - debugLine(value: string): ListAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { initialIndex?: number; space?: number | string; scroller?: Scroller }): ListAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): ListAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): ListAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSListItemAttribute extends CommonMethod { - create(value?: string): ListItemAttribute; - pop(): ListItemAttribute; - debugLine(value: string): ListItemAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: string): ListItemAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): ListItemAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): ListItemAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSLoadingProgressAttribute extends CommonMethod { - create(): LoadingProgressAttribute; - debugLine(value: string): LoadingProgressAttribute; - color(value: ResourceColor): LoadingProgressAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(): LoadingProgressAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): LoadingProgressAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + color(value: ResourceColor): LoadingProgressAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSMarqueeAttribute extends CommonMethod { - create(value: { - start: boolean; - step?: number; - loop?: number; - fromStart?: boolean; - src: string; - }): MarqueeAttribute; - pop(): MarqueeAttribute; - debugLine(value: string): MarqueeAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: { start: boolean; step?: number; loop?: number; fromStart?: boolean; src: string }): MarqueeAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): MarqueeAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): MarqueeAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSNavigationAttribute extends CommonMethod { - create(): NavigationAttribute; - pop(): NavigationAttribute; - debugLine(value: string): NavigationAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(): NavigationAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): NavigationAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): NavigationAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSNavigatorAttribute extends CommonMethod { - create(value?: { - target: string; - type?: NavigationType; - }): NavigatorAttribute; - pop(): NavigatorAttribute; - debugLine(value: string): NavigatorAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { target: string; type?: NavigationType }): NavigatorAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): NavigatorAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): NavigatorAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSPageTransitionEnterInterface extends CommonTransition { - create(value: { - type?: RouteType; - duration?: number; - curve?: Curve | string; - delay?: number; - }): PageTransitionEnterInterface; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: { + type?: RouteType; + duration?: number; + curve?: Curve | string; + delay?: number; + }): PageTransitionEnterInterface; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSPageTransitionExitInterface extends CommonTransition { - create(value: { - type?: RouteType; - duration?: number; - curve?: Curve | string; - delay?: number; - }): PageTransitionExitInterface; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: { + type?: RouteType; + duration?: number; + curve?: Curve | string; + delay?: number; + }): PageTransitionExitInterface; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSPanelAttribute extends CommonMethod { - create(show: boolean): PanelAttribute; - pop(): PanelAttribute; - debugLine(value: string): PanelAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(show: boolean): PanelAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): PanelAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): PanelAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSPathAttribute extends CommonShapeMethod { - create(value?: { - width?: number | string; - height?: number | string; - commands?: string; - }): PathAttribute; - pop(): PathAttribute; - debugLine(value: string): PathAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { width?: number | string; height?: number | string; commands?: string }): PathAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): PathAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): PathAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSPatternLockAttribute extends CommonMethod { - create(controller?: PatternLockController): TSPatternLockAttribute; - pop(): TSPatternLockAttribute; - debugLine(value: string): TSPatternLockAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(controller?: PatternLockController): TSPatternLockAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): TSPatternLockAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): TSPatternLockAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSPieceAttribute extends CommonMethod { - create(options?: { - content: string; - icon?: string; - }): PieceAttribute; - pop(): PieceAttribute; - debugLine(value: string): PieceAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options?: { content: string; icon?: string }): PieceAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): PieceAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): PieceAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSPluginComponentAttribute extends CommonMethod { - create(value: { - template: PluginComponentTemplate; - data: any; - }): PluginComponentAttribute; - pop(): PluginComponentAttribute; - debugLine(value: string): PluginComponentAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): PluginComponentAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): PluginComponentAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSPolygonAttribute extends CommonShapeMethod { - create(value?: { - width?: string | number; - height?: string | number; - }): PolygonAttribute; - debugLine(value: string): PolygonAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { width?: string | number; height?: string | number }): PolygonAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): PolygonAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSPolylineAttribute extends CommonShapeMethod { - create(value?: { - width?: string | number; - height?: string | number; - }): PolylineAttribute; - debugLine(value: string): PolylineAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { width?: string | number; height?: string | number }): PolylineAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): PolylineAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSProgressAttribute extends CommonMethod { - create(object: { - value: number; - total?: number; - style?: ProgressStyle; - }): ProgressAttribute; - debugLine(value: string): ProgressAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options: ProgressOptions): ProgressAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): ProgressAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSQRCodeAttribute extends CommonMethod { - create(value: string): QRCodeAttribute; - pop(): QRCodeAttribute; - debugLine(value: string): QRCodeAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: string): QRCodeAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): QRCodeAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): QRCodeAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSRadioAttribute extends CommonMethod { - create(options: RadioOption): RadioAttribute; - debugLine(value: string): RadioAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options: RadioOptions): RadioAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): RadioAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSRatingAttribute extends CommonMethod { - create(options?: { - rating: number; - indicator?: boolean; - }): RatingAttribute; - pop(): RatingAttribute; - debugLine(value: string): RatingAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options?: { rating: number; indicator?: boolean }): RatingAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): RatingAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): RatingAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSRectAttribute extends CommonShapeMethod { - create(value?: { - width?: number | string; - height?: number | string; - radius?: number | string | Array; - } | { - width?: number | string; - height?: number | string; - radiusWidth?: number | string; - radiusHeight?: number | string; - }): RectAttribute; - debugLine(value: string): RectAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create( + value?: + | { + width?: number | string; + height?: number | string; + radius?: number | string | Array; + } + | { + width?: number | string; + height?: number | string; + radiusWidth?: number | string; + radiusHeight?: number | string; + }, + ): RectAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): RectAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSRefreshAttribute extends CommonMethod { - create(value: { - refreshing: boolean; - offset?: number | string; - friction?: number | string; - }): RefreshAttribute; - pop(): RefreshAttribute; - debugLine(value: string): RefreshAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: { refreshing: boolean; offset?: number | string; friction?: number | string }): RefreshAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): RefreshAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): RefreshAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSRowAttribute extends CommonMethod { - create(value?: { - space?: string | number; - }): RowAttribute; - pop(): RowAttribute; - debugLine(value: string): RowAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { space?: string | number }): RowAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): RowAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): RowAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSRowSplitAttribute extends CommonMethod { - create(): RowSplitAttribute; - pop(): RowSplitAttribute; - debugLine(value: string): RowSplitAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(): RowSplitAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): RowSplitAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): RowSplitAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSScrollAttribute extends CommonMethod { - create(scroller?: Scroller): ScrollAttribute; - pop(): ScrollAttribute; - debugLine(value: string): ScrollAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(scroller?: Scroller): ScrollAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): ScrollAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): ScrollAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSScrollBarAttribute extends CommonMethod { - create(value: ScrollBarOption): ScrollBarAttribute; - pop(): ScrollBarAttribute; - debugLine(value: string): ScrollBarAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: ScrollBarOptions): ScrollBarAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): ScrollBarAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): ScrollBarAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSSearchAttribute extends CommonMethod { - create(options?: { - value?: string; - placeholder?: string; - icon?: string; - controller?: SearchController; - }): SearchAttribute; - pop(): SearchAttribute; - debugLine(value: string): SearchAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options?: { + value?: string; + placeholder?: string; + icon?: string; + controller?: SearchController; + }): SearchAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): SearchAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): SearchAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSSelectAttribute extends CommonMethod { - create(options: Array): SelectAttribute; - pop(): SelectAttribute; - debugLine(value: string): SelectAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options: Array): SelectAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): SelectAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): SelectAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSShapeAttribute extends CommonMethod { - create(value?: PixelMap): ShapeAttribute; - pop(): ShapeAttribute; - debugLine(value: string): ShapeAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: PixelMap): ShapeAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): ShapeAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): ShapeAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSSheetAttribute extends CommonMethod { - create(): SheetAttribute; - pop(): SheetAttribute; - debugLine(value: string): SheetAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(): SheetAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): SheetAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): SheetAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSSliderAttribute extends CommonMethod { - create(options?: SliderOption): SliderAttribute; - debugLine(value: string): SliderAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options?: SliderOptions): SliderAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): SliderAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSSpanAttribute extends CommonMethod { - create(value: string | Resource): SpanAttribute; - debugLine(value: string): SpanAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: string | Resource): SpanAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): SpanAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSStackAttribute extends CommonMethod { - create(value?: { - alignContent?: Alignment; - }): StackAttribute; - pop(): StackAttribute; - debugLine(value: string): StackAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { alignContent?: Alignment }): StackAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): StackAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): StackAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSStepperAttribute extends CommonMethod { - create(value?: { - index?: number; - }): StepperAttribute; - pop(): StepperAttribute; - debugLine(value: string): StepperAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { index?: number }): StepperAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): StepperAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): StepperAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSStepperItemAttribute extends CommonMethod { - create(): StepperItemAttribute; - pop(): StepperItemAttribute; - debugLine(value: string): StepperItemAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(): StepperItemAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): StepperItemAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): StepperItemAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSSwiperAttribute extends CommonMethod { - create(controller?: SwiperController): SwiperAttribute; - pop(): SwiperAttribute; - debugLine(value: string): SwiperAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(controller?: SwiperController): SwiperAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): SwiperAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): SwiperAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSTabContentAttribute extends CommonMethod { - create(): TabContentAttribute; - pop(): TabContentAttribute; - debugLine(value: string): TabContentAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(): TabContentAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): TabContentAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): TabContentAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSTabsAttribute extends CommonMethod { - create(value?: { - barPosition?: BarPosition; - index?: number; - controller?: TabsController; - }): TabsAttribute; - pop(): TabsAttribute; - debugLine(value: string): TabsAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { barPosition?: BarPosition; index?: number; controller?: TabsController }): TabsAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): TabsAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): TabsAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSTextAttribute extends CommonMethod { - create(content?: string | Resource): TextAttribute; - pop(): TextAttribute; - debugLine(value: string): TextAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(content?: string | Resource): TextAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): TextAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): TextAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSTextAreaAttribute extends CommonMethod { - create(value?: TextAreaOption): TextAreaAttribute; - debugLine(value: string): TextAreaAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: TextAreaOptions): TextAreaAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): TextAreaAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSTextClockAttribute extends CommonMethod { - create(options?: { - timeZoneOffset?: number; - controller?: TextClockController; - }): TextClockAttribute; - pop(): TextClockAttribute; - debugLine(value: string): TextClockAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options?: { timeZoneOffset?: number; controller?: TextClockController }): TextClockAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): TextClockAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): TextClockAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSTextInputAttribute extends CommonMethod { - create(value?: TextInputOption): TextInputAttribute; - debugLine(value: string): TextInputAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: TextInputOptions): TextInputAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): TextInputAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSTextPickerAttribute extends CommonMethod { - create(options?: TextPickerOption): TextPickerAttribute; - pop(): TextPickerAttribute; - debugLine(value: string): TextPickerAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options?: TextPickerOptions): TextPickerAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): TextPickerAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): TextPickerAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSTextTimerAttribute extends CommonMethod { - create(options?: TextTimerOption): TextTimerAttribute; - pop(): TextTimerAttribute; - debugLine(value: string): TextTimerAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options?: TextTimerOptions): TextTimerAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): TextTimerAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): TextTimerAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSToggleAttribute extends CommonMethod { - create(options: { - type: ToggleType; - isOn?: boolean; - }): ToggleAttribute; - pop(): ToggleAttribute; - debugLine(value: string): ToggleAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(options: { type: ToggleType; isOn?: boolean }): ToggleAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): ToggleAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): ToggleAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSVideoAttribute extends CommonMethod { - create(value: { - src?: string | Resource; - previewUri?: string | PixelMap | Resource; - controller?: VideoController; - }): VideoAttribute; - debugLine(value: string): VideoAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: { + src?: string | Resource; + previewUri?: string | PixelMap | Resource; + controller?: VideoController; + }): VideoAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): VideoAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSWebAttribute extends CommonMethod { - create(value: WebOptions): WebAttribute; - debugLine(value: string): WebAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: WebOptions): WebAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): WebAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSXComponentAttribute extends CommonMethod { - create(value: { - id: string; - type: string; - libraryname?: string; - controller?: XComponentController; - }): XComponentAttribute; - debugLine(value: string): XComponentAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value: { + id: string; + type: string; + libraryname?: string; + controller?: XComponentController; + }): XComponentAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): XComponentAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSRichTextAttribute { - create(content: string): RichTextAttribute; - pop(): RichTextAttribute; - debugLine(value: string): RichTextAttribute; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(content: string): RichTextAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): RichTextAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + debugLine(value: string): RichTextAttribute; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSTapGestureInterface { - create(value?: { - count?: number; - fingers?: number; - }): TapGestureInterface; - pop(): TapGestureInterface; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { count?: number; fingers?: number }): TapGestureInterface; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): TapGestureInterface; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSLongPressGestureInterface { - create(value?: { - fingers?: number; - repeat?: boolean; - duration?: number; - }): LongPressGestureInterface; - pop(): LongPressGestureInterface; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { fingers?: number; repeat?: boolean; duration?: number }): LongPressGestureInterface; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): LongPressGestureInterface; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSPanGestureInterface { - create(value?: { - fingers?: number; - direction?: PanDirection; - distance?: number; - } | PanGestureOption): PanGestureInterface; - pop(): PanGestureInterface; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create( + value?: + | { + fingers?: number; + direction?: PanDirection; + distance?: number; + } + | PanGestureOptions, + ): PanGestureInterface; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): PanGestureInterface; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSSwipeGestureInterface { - create(value?: { - fingers?: number; - direction?: SwipeDirection; - speed?: number; - }): SwipeGestureInterface; - pop(): SwipeGestureInterface; -} - -declare class PinchGestureInterface { - create(value?: { - fingers?: number; - distance?: number; - }): PinchGestureInterface; - pop(): PinchGestureInterface; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { fingers?: number; direction?: SwipeDirection; speed?: number }): SwipeGestureInterface; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): SwipeGestureInterface; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ +declare class TSPinchGestureInterface { + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { fingers?: number; distance?: number }): PinchGestureInterface; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): PinchGestureInterface; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSRotationGestureInterface { - create(value?: { - fingers?: number; - angle?: number; - }): RotationGestureInterface; - pop(): RotationGestureInterface; -} - + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(value?: { fingers?: number; angle?: number }): RotationGestureInterface; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): RotationGestureInterface; +} + +/** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ declare class TSGestureGroupInterface { - create(mode: GestureMode, ...gesture: GestureType[]): GestureGroupInterface; - pop(): GestureGroupInterface; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + create(mode: GestureMode, ...gesture: GestureType[]): GestureGroupInterface; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + pop(): GestureGroupInterface; } diff --git a/api/@internal/component/ets/navigation.d.ts b/api/@internal/component/ets/navigation.d.ts index 5130791878169fc2b6cfd20c07717d0fbbebf6ed..420438d98b3d5d30151a4370cf261094f0572fd4 100644 --- a/api/@internal/component/ets/navigation.d.ts +++ b/api/@internal/component/ets/navigation.d.ts @@ -108,12 +108,6 @@ declare class NavigationAttribute extends CommonMethod { */ menus(value: Array | CustomBuilder): NavigationAttribute; - /** - * The amount of the menu in Navigation. - * @since 8 - */ - menuCount(value: number): NavigationAttribute; - /** * Tool bar * @since 8 @@ -127,10 +121,10 @@ declare class NavigationAttribute extends CommonMethod { hideToolBar(value: boolean): NavigationAttribute; /** - * Trigger a titleModeChanged event when title mode changed at free mode. + * Trigger callback when title mode change finished at free mode. * @since 8 */ - onTitleModeChanged(callback: (titleMode: NavigationTitleMode) => void): NavigationAttribute; + onTitleModeChange(callback: (titleMode: NavigationTitleMode) => void): NavigationAttribute; } declare const Navigation: NavigationInterface; diff --git a/api/@internal/component/ets/plugin_component.d.ts b/api/@internal/component/ets/plugin_component.d.ts index 99339284866b4290bd6f4bbee92236d7e1e83c89..47300deaa7180ff98c64873b247e881d45a013a2 100644 --- a/api/@internal/component/ets/plugin_component.d.ts +++ b/api/@internal/component/ets/plugin_component.d.ts @@ -18,7 +18,15 @@ * @since 8 */ interface PluginComponentTemplate { + /** + * Defines the plugin source name. + * @since 8 + */ source: string; + /** + * Defines the ability name. + * @since 8 + */ ability: string; } @@ -35,6 +43,7 @@ interface PluginComponentInterface { } /** + * Defines the plugin component attibute functions. * @since 8 */ declare class PluginComponentAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/progress.d.ts b/api/@internal/component/ets/progress.d.ts index 80a73a7da0072c02941a2d75bac9c207d707d251..76faf8e8a693123a150fb6c18bea118ee30144ba 100644 --- a/api/@internal/component/ets/progress.d.ts +++ b/api/@internal/component/ets/progress.d.ts @@ -13,6 +13,97 @@ * limitations under the License. */ +/** + * Defines the option of Progress. + * @since 7 + */ + declare interface ProgressOptions { + /** + * Sets the value of Progress. + * @since 7 + */ + value: number; + + /** + * Sets the total of Progress. + * @since 7 + */ + total?: number; + + /** + * Sets the style of Progress. + * @since 7 + * @deprecated since 8 + */ + style?: ProgressStyle + + /** + * Sets the type of Progress. + * @since 8 + */ + type?: ProgressType +} + +/** + * Type of progress bar + * @since 8 + */ +declare enum ProgressType { + /** + * Linear progress bar style. + * @since 8 + */ + Linear, + + /** + * Ring progress bar. + * @since 8 + */ + Ring, + + /** + * Eclipse progress bar. + * @since 8 + */ + Eclipse, + + /** + * ScaleRing progress bar. + * @since 8 + */ + ScaleRing, + + /** + * Capsule progress bar. + * @since 8 + */ + Capsule, +} + +/** + * Defines style options for progress component. + * @since 8 + */ +declare interface ProgressStyleOptions { + /** + * Defines the strokeWidth property. + * @since 8 + */ + strokeWidth?: Length; + + /** + * Defines the scaleCoun property. + * @since 8 + */ + scaleCount?: number; + + /** + * Defines the scaleWidth property. + * @since 8 + */ + scaleWidth?: Length; +} + /** * Type of progress bar * @since 7 @@ -20,35 +111,30 @@ declare enum ProgressStyle { /** * Linear progress bar style. - * @devices phone, tablet, car. * @since 7 */ Linear, /** * Ring progress bar. - * @devices phone, tablet, car. * @since 8 */ Ring, /** * Eclipse progress bar. - * @devices phone, tablet, car. * @since 7 */ Eclipse, /** * ScaleRing progress bar. - * @devices phone, tablet, car. * @since 8 */ ScaleRing, /** * Capsule progress bar. - * @devices phone, tablet, car. * @since 8 */ Capsule, @@ -63,10 +149,11 @@ interface ProgressInterface { * Called when the progress bar is set. * @since 7 */ - (object: { value: number; total?: number; style?: ProgressStyle }): ProgressAttribute; + (options: ProgressOptions): ProgressAttribute; } /** + * Defines the progress attibute functions. * @since 7 */ declare class ProgressAttribute extends CommonMethod { @@ -83,17 +170,10 @@ declare class ProgressAttribute extends CommonMethod { color(value: ResourceColor): ProgressAttribute; /** - * Called when the style of the circular progress bar is set. - * @since 7 - */ - circularStyle(value: { strokeWidth?: Length; scaleCount?: number; scaleWidth?: Length }): ProgressAttribute; - - /** - * Called when the style of the cricular progress bar is set. - * @since 7 - * @deprecated since 7 + * Called when the style of progress bar is set. + * @since 8 */ - cricularStyle(value: { strokeWidth?: Length; scaleCount?: number; scaleWidth?: Length }): ProgressAttribute; + style(value: ProgressStyleOptions): ProgressAttribute; } declare const Progress: ProgressInterface; diff --git a/api/@internal/component/ets/qrcode.d.ts b/api/@internal/component/ets/qrcode.d.ts index 61eefc5700dbf0eb1e319b6cb2a7da8f53782371..ecae91dc558eae0032bdb9fcbeb1284cf5dcfbb8 100644 --- a/api/@internal/component/ets/qrcode.d.ts +++ b/api/@internal/component/ets/qrcode.d.ts @@ -26,6 +26,7 @@ interface QRCodeInterface { } /** + * Defines the qrcode attibute functions. * @since 7 */ declare class QRCodeAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/radio.d.ts b/api/@internal/component/ets/radio.d.ts index d3d749404ce749014ed1822b78bc4bb0544b6469..f67db1784428e4013f334d4f51461db8464a8b1d 100644 --- a/api/@internal/component/ets/radio.d.ts +++ b/api/@internal/component/ets/radio.d.ts @@ -15,20 +15,17 @@ /** * Input parameter for creating a radio box. - * @devices phone, tablet, car * @since 8 */ -declare interface RadioOption { +declare interface RadioOptions { /** * Radio group name. - * @devices phone, tablet, car * @since 8 */ group: string; /** * Radio name. - * @devices phone, tablet, car * @since 8 */ value: string; @@ -36,33 +33,28 @@ declare interface RadioOption { /** * Provides an interface for creating a radio box. - * @devices phone, tablet, car * @since 8 */ interface RadioInterface { /** * Called when a radio box is created. - * @devices phone, tablet, car * @since 8 */ - (options: RadioOption): RadioAttribute; + (options: RadioOptions): RadioAttribute; } /** - * @devices phone, tablet, car * @since 8 */ declare class RadioAttribute extends CommonMethod { /** * Called when the radio box is selected. - * @devices phone, tablet, car * @since 8 */ checked(value: boolean): RadioAttribute; /** * Called when the radio box selection status changes. - * @devices phone, tablet, car * @since 8 */ onChange(callback: (isChecked: boolean) => void): RadioAttribute; diff --git a/api/@internal/component/ets/rating.d.ts b/api/@internal/component/ets/rating.d.ts index 09f6740ec75c2a715de42f4595028888695ebe74..7dc8bac49645fcf78bcf7f39fad4be33bcf5fff7 100644 --- a/api/@internal/component/ets/rating.d.ts +++ b/api/@internal/component/ets/rating.d.ts @@ -26,6 +26,7 @@ interface RatingInterface { } /** + * Defines the rating attibute functions. * @since 7 */ declare class RatingAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/rect.d.ts b/api/@internal/component/ets/rect.d.ts index 7ca9aa72fac29aa43129c2a22a796b93113732ea..3bc5bdab97d8d3629a058ed6d2aa7fcde94cb5aa 100644 --- a/api/@internal/component/ets/rect.d.ts +++ b/api/@internal/component/ets/rect.d.ts @@ -13,7 +13,6 @@ * limitations under the License. */ - /** * Provides an interface for drawing rectangles. * @since 7 @@ -25,11 +24,11 @@ interface RectInterface { */ new ( value?: - | { - width?: number | string; - height?: number | string; - radius?: number | string | Array; - } + { + width?: number | string; + height?: number | string; + radius?: number | string | Array; + } | { width?: number | string; height?: number | string; @@ -44,11 +43,11 @@ interface RectInterface { */ ( value?: - | { - width?: number | string; - height?: number | string; - radius?: number | string | Array; - } + { + width?: number | string; + height?: number | string; + radius?: number | string | Array; + } | { width?: number | string; height?: number | string; diff --git a/api/@internal/component/ets/refresh.d.ts b/api/@internal/component/ets/refresh.d.ts index 648528bb7d179112856255d00e3e20e8aa3610f6..2475dc5518269b153f000bc91d96f73b576f7316 100644 --- a/api/@internal/component/ets/refresh.d.ts +++ b/api/@internal/component/ets/refresh.d.ts @@ -62,6 +62,7 @@ interface RefreshInterface { } /** + * Defines the refresh attibute functions. * @since 8 */ declare class RefreshAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/row.d.ts b/api/@internal/component/ets/row.d.ts index 6d723e4b8baf61b87857b95aced6fc55cc2b89ae..f33801c37657346f16fd1c841a354bcf1e3d2136 100644 --- a/api/@internal/component/ets/row.d.ts +++ b/api/@internal/component/ets/row.d.ts @@ -26,6 +26,7 @@ interface RowInterface { } /** + * Defines the row attribute functions. * @since 7 */ declare class RowAttribute extends CommonMethod { @@ -39,7 +40,7 @@ declare class RowAttribute extends CommonMethod { * Called when the horizontal alignment is set. * @since 8 */ - justifyContent(value: FlexAlign): RowAttribute; + justifyContent(value: FlexAlign): RowAttribute; } declare const Row: RowInterface; diff --git a/api/@internal/component/ets/scroll.d.ts b/api/@internal/component/ets/scroll.d.ts index 7ea65ec436f8a53a0badd006ea19a777c2aff4c0..4779b3593c9b5022bc09238a5b8ebe6f9244be4b 100644 --- a/api/@internal/component/ets/scroll.d.ts +++ b/api/@internal/component/ets/scroll.d.ts @@ -101,6 +101,7 @@ interface ScrollInterface { } /** + * Defines the scroll attibute functions. * @since 7 */ declare class ScrollAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/scroll_bar.d.ts b/api/@internal/component/ets/scroll_bar.d.ts index 0a722fca3961cb71eb90b318ef2530f62c8964a3..d8089e23b40238ad29c651a0e52c65f13cfd184e 100644 --- a/api/@internal/component/ets/scroll_bar.d.ts +++ b/api/@internal/component/ets/scroll_bar.d.ts @@ -32,10 +32,10 @@ declare enum ScrollBarDirection { } /** - * Defines the option of ScrollBar. + * Defines the options of ScrollBar. * @since 8 */ -declare interface ScrollBarOption { +declare interface ScrollBarOptions { /** * Sets the scroller of scroll bar. * @since 8 @@ -64,12 +64,14 @@ interface ScrollBarInterface { * Called when a ScrollBar container is set. * @since 8 */ - (value: ScrollBarOption): ScrollBarAttribute; + (value: ScrollBarOptions): ScrollBarAttribute; } /** + * Defines the scrollbar attibute functions. * @since 8 */ declare class ScrollBarAttribute extends CommonMethod {} + declare const ScrollBar: ScrollBarInterface; declare const ScrollBarInstance: ScrollBarAttribute; diff --git a/api/@internal/component/ets/select.d.ts b/api/@internal/component/ets/select.d.ts index 6b186318b05634f816572e5c863fd64a5a0c6bd4..0c03c35b06461598cfb0e71970cdb808bfd1108e 100644 --- a/api/@internal/component/ets/select.d.ts +++ b/api/@internal/component/ets/select.d.ts @@ -112,7 +112,7 @@ declare class SelectAttribute extends CommonMethod { * Callback for selecting an item from the select. * @since 8 */ - onSelected(event: (index: number, value?: string) => void): SelectAttribute; + onSelect(callback: (index: number, value?: string) => void): SelectAttribute; } declare const Select: SelectInterface; diff --git a/api/@internal/component/ets/sidebar.d.ts b/api/@internal/component/ets/sidebar.d.ts index 083b948e47a5591ec05453c67190cad015912084..e38f1ad790401262cc06ccf9b87e908c06708fcc 100644 --- a/api/@internal/component/ets/sidebar.d.ts +++ b/api/@internal/component/ets/sidebar.d.ts @@ -1,33 +1,33 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /** * Sets the sidebar style of showing * @since 8 */ -declare enum SideBarContainerStyle { - /** - * The sidebar invisible - * @since 8 - */ - Embed, - /** - * The sidebar visible - * @since 8 - */ - Overlay +declare enum SideBarContainerType { + /** + * The sidebar invisible + * @since 8 + */ + Embed, + /** + * The sidebar visible + * @since 8 + */ + Overlay, } /** @@ -35,33 +35,37 @@ declare enum SideBarContainerStyle { * @since 8 */ declare interface ButtonStyle { - /** - * Set the left of control button - * @since 8 - */ - left?: number; - /** - * Set the top of control button - * @since 8 - */ - top?: number; - /** - * Set the width of control button - * @since 8 - */ - width?: number; + /** + * Set the left of control button + * @since 8 + */ + left?: number; + /** + * Set the top of control button + * @since 8 + */ + top?: number; + /** + * Set the width of control button + * @since 8 + */ + width?: number; - /** - * Set the heigth of control button - * @since 8 - */ - height?: number; + /** + * Set the heigth of control button + * @since 8 + */ + height?: number; - /** - * Set the button icon when sidebar status has changed - * @since 8 - */ - icons?: {shown:string | PixelMap | Resource, hidden: string | PixelMap | Resource, switching?: string | PixelMap | Resource} + /** + * Set the button icon when sidebar status has changed + * @since 8 + */ + icons?: { + shown: string | PixelMap | Resource; + hidden: string | PixelMap | Resource; + switching?: string | PixelMap | Resource; + }; } /** @@ -69,28 +73,35 @@ declare interface ButtonStyle { * @since 8 */ interface SideBarContainerInterface { - /** - * Called when showing the sidebar of a block entry. - * @since 8 - */ - (options?: { showSideBarContainer?: boolean, - style?: SideBarContainerStyle, - buttonAttr?: ButtonStyle}): SideBarContainerAttribute; + /** + * Called when showing the sidebar of a block entry. + * @since 8 + */ + (type?: SideBarContainerType): SideBarContainerAttribute; } /** * The attribute function of sidebar * @since 8 */ - declare class SideBarContainerAttribute extends CommonMethod { + /** + * Callback showControlButton function when setting the status of sidebar + * @since 8 + */ + showSideBar(value: boolean): SideBarContainerAttribute; + /** + * Callback controlButton function when setting the style of button + * @since 8 + */ + controlButton(value: ButtonStyle): SideBarContainerAttribute; /** * Callback showControlButton function when setting the status of button * @since 8 */ showControlButton(value: boolean): SideBarContainerAttribute; /** - * Callback onChange function when sidebar style of showing has changed + * Trigger callback when sidebar style of showing change finished. * @since 8 */ onChange(callback: (value: boolean) => void): SideBarContainerAttribute; @@ -114,4 +125,4 @@ declare class SideBarContainerAttribute extends CommonMethod { /** * Called when setting whether to display step size. - * @devices phone, tablet, car * @since 7 */ showSteps(value: boolean): SliderAttribute; /** * Called when the percentage of bubble prompt is set when sliding. - * @devices phone, tablet, car * @since 7 */ showTips(value: boolean): SliderAttribute; /** * Called when the thickness of track is set. - * @devices phone, tablet, car * @since 8 */ trackThickness(value: Length): SliderAttribute; /** * Called when the selection value changes. - * @devices phone, tablet, car * @since 7 */ onChange(callback: (value: number, mode: SliderChangeMode) => void): SliderAttribute; diff --git a/api/@internal/component/ets/state_management.d.ts b/api/@internal/component/ets/state_management.d.ts index 0e11d0e5e965ced4eda340ab6ae8f661ab100238..310e1ad62b0872b0dfbe070d478c686ef60e4ac0 100644 --- a/api/@internal/component/ets/state_management.d.ts +++ b/api/@internal/component/ets/state_management.d.ts @@ -16,220 +16,268 @@ /** * Provides an interface for attribute subscribers. * @since 7 + * @systemapi */ interface IPropertySubscriber { /** * Called when the ID of the property subscriber is queried. * @since 7 + * @systemapi */ id(): number; /** * Provides a single attribute change user interface. * @since 7 + * @systemapi */ aboutToBeDeleted(owningView?: IPropertySubscriber): void; } /** + * Defines the subscriber. * @since 7 + * @systemapi */ interface ISinglePropertyChangeSubscriber extends IPropertySubscriber { /** * Provides a single attribute change user interface. * @since 7 + * @systemapi */ hasChanged(newValue: T): void; } /** + * Defines the subscribed abstract property. * @since 7 + * @systemapi */ declare abstract class SubscribedAbstractProperty { /** * Setting Subscribers. * @since 7 + * @systemapi */ protected subscribers_: Set; /** * Private user ID. * @since 7 + * @systemapi */ private id_; /** * Private user information. * @since 7 + * @systemapi */ private info_?; /** * @since 7 + * @systemapi */ constructor( /** - * Subscriber Information. + * Subscriber IPropertySubscriber. * @since 7 + * @systemapi */ subscribeMe?: IPropertySubscriber, + /** + * Subscriber info. + * @since 7 + * @systemapi + */ info?: string, ); /** * Called when the subscriber ID is entered. * @since 7 + * @systemapi */ id(): number; /** * Called when a subscriber information description is entered. * @since 7 + * @systemapi */ info(): string; /** * Called when data is obtained. * @since 7 + * @systemapi */ abstract get(): T; /** * Called when data is created. * @since 7 + * @systemapi */ abstract set(newValue: T): void; /** * Called when a two-way synchronization is created. * @since 7 + * @systemapi */ createTwoWaySync(subscribeMe?: IPropertySubscriber, info?: string): SyncedPropertyTwoWay; /** * Called when a one-way synchronization is created. * @since 7 + * @systemapi */ createOneWaySync(subscribeMe?: IPropertySubscriber, info?: string): SyncedPropertyOneWay; /** * Called when the subscriber is unlinked. * @since 7 + * @systemapi */ unlinkSuscriber(subscriberId: number): void; /** * Called when the notification has changed. * @since 7 + * @systemapi */ protected notifyHasChanged(newValue: T): void; /** * Called when the notification property is read. * @since 7 + * @systemapi */ protected notifyPropertyRead(): void; /** * Called when the number of users is queried. * @since 7 + * @systemapi */ numberOfSubscrbers(): number; } /** + * Defines the state value. * @since 7 + * @systemapi */ declare class SyncedPropertyTwoWay extends SubscribedAbstractProperty - implements ISinglePropertyChangeSubscriber { + implements ISinglePropertyChangeSubscriber +{ /** * Sources of synchronization attributes bidirectionally. * @since 7 + * @systemapi */ private source_; /** * constructor parameters. * @since 7 + * @systemapi */ constructor(source: SubscribedAbstractProperty, subscribeMe?: IPropertySubscriber, info?: string); /** * Called when processing information about to be deleted. * @since 7 + * @systemapi */ aboutToBeDeleted(unsubscribeMe?: IPropertySubscriber): void; /** * Information Changed. * @since 7 + * @systemapi */ hasChanged(newValue: T): void; /** * Called when data is obtained. * @since 7 + * @systemapi */ get(): T; /** * Called when data is created. * @since 7 + * @systemapi */ set(newValue: T): void; } /** + * Defines the prop state value. * @since 7 + * @systemapi */ declare class SyncedPropertyOneWay extends SubscribedAbstractProperty - implements ISinglePropertyChangeSubscriber { + implements ISinglePropertyChangeSubscriber +{ /** * Pack value for single-item binding. * @since 7 + * @systemapi */ private wrappedValue_; /** * Sources of synchronization attributes bidirectionally. * @since 7 + * @systemapi */ private source_; /** * Constructor parameters. * @since 7 + * @systemapi */ constructor(source: SubscribedAbstractProperty, subscribeMe?: IPropertySubscriber, info?: string); /** * Called when processing information about to be deleted. * @since 7 + * @systemapi */ aboutToBeDeleted(unsubscribeMe?: IPropertySubscriber): void; /** * Information Changed. * @since 7 + * @systemapi */ hasChanged(newValue: T): void; /** * Called when data is obtained. * @since 7 + * @systemapi */ get(): T; /** * Called when data is created. * @since 7 + * @systemapi */ set(newValue: T): void; } /** + * Defines the AppStorage interface. * @since 7 */ declare class AppStorage { @@ -313,12 +361,15 @@ declare class AppStorage { } /** + * Defines the Environment interface. * @since 7 */ declare class Environment { /** * Constructor. * @since 7 + * @systemapi + * @hide */ constructor(); @@ -347,23 +398,25 @@ declare class Environment { } /** + * Defines the ColorMode of device. * @since 7 */ declare enum ColorMode { /** - * Bright color. + * Light mode. * @since 7 */ LIGHT = 0, /** - * Dark. + * Dark mode. * @since 7 */ DARK, } /** + * Defines the LayoutDirection of device. * @since 7 */ declare enum LayoutDirection { @@ -371,7 +424,7 @@ declare enum LayoutDirection { * Elements are laid out from left to right. * @since 7 */ - LTR = 0, + LTR, /** * Elements are laid out from right to left. @@ -383,16 +436,19 @@ declare enum LayoutDirection { * Elements are laid out from auto. * @since 8 */ - Auto + Auto, } /** + * Defines the PersistentStorage interface. * @since 7 */ declare class PersistentStorage { /** * Constructor parameters. * @since 7 + * @systemapi + * @hide */ constructor(appStorage: AppStorage, storage: Storage); @@ -427,179 +483,112 @@ declare class PersistentStorage { } /** + * Defines the base class of storage. * @since 7 + * @systemapi */ declare class Storage { /** * Constructor parameters. * @since 7 + * @systemapi + * @hide */ constructor(needCrossThread?: boolean, file?: string); /** * Called when data is obtained. * @since 7 + * @systemapi + * @hide */ get(key: string): string | undefined; /** * Called when setting. * @since 7 + * @systemapi + * @hide */ set(key: string, val: any): void; /** * Called when data is cleared. * @since 7 + * @systemapi + * @hide */ clear(): void; /** * Called when data is deleted. * @since 7 + * @systemapi + * @hide */ delete(key: string): void; } /** + * Defines the Subscribale base class. * @since 7 + * @systemapi + * @hide */ declare abstract class SubscribaleAbstract { /** * Returns the ownership attribute set by the. * @since 7 + * @systemapi + * @hide */ private owningProperties_: Set; /** * Constructor. * @since 7 + * @systemapi + * @hide */ constructor(); /** * Called when the notification property has changed. * @since 7 + * @systemapi + * @hide */ protected notifyPropertyHasChanged(propName: string, newValue: any): void; /** * Called when adding an already owned property. * @since 7 + * @systemapi + * @hide */ public addOwningProperty(subscriber: IPropertySubscriber): void; /** * Called when an already owned property is deleted. * @since 7 + * @systemapi + * @hide */ public removeOwningProperty(property: IPropertySubscriber): void; /** * Called when an already owned property is deleted by ID * @since 7 + * @systemapi + * @hide */ public removeOwningPropertyById(subscriberId: number): void; } /** - * @since 9 - * @StageModelOnly - */ - declare class ContentStorage { - /** - * Called when a link is set. - * @since 9 - * @StageModelOnly - */ - link(propName: string): any; - - /** - * Called when a hyperlink is set. - * @since 9 - * @StageModelOnly - */ - setAndLink(propName: string, defaultValue: T): SubscribedAbstractProperty; - - /** - * Called when a property is set. - * @since 9 - * @StageModelOnly - */ - prop(propName: string): any; - - /** - * Called when dynamic properties are set. - * @since 9 - * @StageModelOnly - */ - setAndProp(propName: string, defaultValue: S): SubscribedAbstractProperty; - - /** - * Called when owning or not. - * @since 9 - * @StageModelOnly - */ - has(propName: string): boolean; - - /** - * Called when data is obtained. - * @since 9 - * @StageModelOnly - */ - get(propName: string): T | undefined; - - /** - * Called when setting. - * @since 9 - * @StageModelOnly - */ - set(propName: string, newValue: T): boolean; - - /** - * Called when setting or creating. - * @since 9 - * @StageModelOnly - */ - setOrCreate(propName: string, newValue: T): void; - - /** - * Called when a deletion is made. - * @since 9 - * @StageModelOnly - */ - delete(propName: string): boolean; - - /** - * Called when a dictionary is sorted. - * @since 9 - * @StageModelOnly - */ - keys(): IterableIterator; - - /** - * Called when a cleanup occurs. - * @since 9 - * @StageModelOnly - */ - clear(): boolean; - - /** - * Called when the data can be changed. - * @since 9 - * @StageModelOnly - */ - isMutable(propName: string): boolean; - - /** - * Called when you check how much data is stored. - * @since 9 - * @StageModelOnly - */ - size(): number; -} - -/** + * Used for ide. * @since 7 + * @systemapi + * @hide */ declare const appStorage: AppStorage; diff --git a/api/@internal/component/ets/stepper.d.ts b/api/@internal/component/ets/stepper.d.ts index 71338678597a559cd06a3b6ed8c7d736bd953b25..168d6d284137dc5f9de36532b19c3c44584b93b2 100644 --- a/api/@internal/component/ets/stepper.d.ts +++ b/api/@internal/component/ets/stepper.d.ts @@ -15,13 +15,11 @@ /** * Declare the stepper. - * @since 8 */ interface StepperInterface { /** * Called when the stepper component is used. - * @since 8 */ (value?: { index?: number }): StepperAttribute; @@ -34,35 +32,30 @@ interface StepperInterface { declare class StepperAttribute extends CommonMethod { /** * Callback when the finish label is clicked. - * @since 8 */ onFinish(callback: () => void): StepperAttribute; /** * Callback when the skip label is clicked. - * @since 8 */ onSkip(callback: () => void): StepperAttribute; /** * Callback when the change label is clicked. - * @since 8 */ onChange(callback: (prevIndex?: number, index?: number) => void): StepperAttribute; /** * Callback when the next label is clicked. - * @since 8 */ onNext(callback: (index?: number, pendingIndex?: number) => void): StepperAttribute; /** * Callback when the previous label is clicked. - * @since 8 */ onPrevious(callback: (index?: number, pendingIndex?: number) => void): StepperAttribute; diff --git a/api/@internal/component/ets/stepper_item.d.ts b/api/@internal/component/ets/stepper_item.d.ts index 042417cf4c0c916adb3fb8713aec2995e6d24a15..c7e0976f37ad4b64da3ca52491c2b25d1f359978 100644 --- a/api/@internal/component/ets/stepper_item.d.ts +++ b/api/@internal/component/ets/stepper_item.d.ts @@ -15,34 +15,29 @@ /** * ItemState - * @devices phone, tablet, car * @since 8 */ declare enum ItemState { /** * Default State - * @devices phone, tablet, car * @since 8 */ Normal, /** * Disabled State - * @devices phone, tablet, car * @since 8 */ Disabled, /** * Waiting State - * @devices phone, tablet, car * @since 8 */ Waiting, /** * Skip State - * @devices phone, tablet, car * @since 8 */ Skip, @@ -50,53 +45,39 @@ declare enum ItemState { /** * Provides an interface for switching the stepperItem view on stepper container. - * @devices phone, tablet, car * @since 8 */ interface StepperItemInterface { /** * Called when the stepperItem component is used. - * @devices phone, tablet, car * @since 8 */ (): StepperItemAttribute; } /** - * @devices phone, tablet, car + * Defines the stepper item attrbute functions. * @since 8 */ declare class StepperItemAttribute extends CommonMethod { /** * Called when the value of stepperItem prevLabel is set - * @devices phone, tablet, car * @since 8 */ prevLabel(value: string): StepperItemAttribute; /** * Called when the value of stepperItem nextLabel is set - * @devices phone, tablet, car * @since 8 */ nextLabel(value: string): StepperItemAttribute; /** * Called when the value of stepperItem status is set - * @devices phone, tablet, car * @since 8 */ status(value?: ItemState): StepperItemAttribute; } -/** - * @devices phone, tablet, car - * @since 8 - */ declare const StepperItemInstance: StepperItemAttribute; - -/** - * @devices phone, tablet, car - * @since 8 - */ declare const StepperItem: StepperItemInterface; diff --git a/api/@internal/component/ets/swiper.d.ts b/api/@internal/component/ets/swiper.d.ts index 217295dd78a4a6df9dadf92fa98ba442b8ca901e..1a3f7ad21e13266ac548d3837f5493a408c2b669 100644 --- a/api/@internal/component/ets/swiper.d.ts +++ b/api/@internal/component/ets/swiper.d.ts @@ -38,7 +38,7 @@ declare class SwiperController { /** * Called when need to stop the swiper animation. - * @since 8 + * @since 7 */ finishAnimation(callback?: () => void); } @@ -128,6 +128,7 @@ declare interface IndicatorStyle { } /** + * Defines the swiper attibute functions. * @since 7 */ declare class SwiperAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/tabs.d.ts b/api/@internal/component/ets/tabs.d.ts index 93b8933721bf9616710a4bb80e117f7a56152652..509d578ff2c4dfef3bf4bc344923f42932ad0be0 100644 --- a/api/@internal/component/ets/tabs.d.ts +++ b/api/@internal/component/ets/tabs.d.ts @@ -79,6 +79,7 @@ interface TabsInterface { } /** + * Defines the tabs attribute functions. * @since 7 */ declare class TabsAttribute extends CommonMethod { @@ -102,24 +103,14 @@ declare class TabsAttribute extends CommonMethod { /** * Called when the width of the bar graph is set. - * @since 7 - */ - barWidth(value: number): TabsAttribute; - - /** - * Called when the height of the bar graph is set. - * @since 7 - */ - barHeight(value: number): TabsAttribute; - - /** - * Called when the width of the bar graph is set. + * Notice: barWidth only supports Number type on 7, supports Length type since 8. * @since 8 */ barWidth(value: Length): TabsAttribute; /** * Called when the height of the bar graph is set. + * Notice: barHeight only supports Number type on 7, supports Length type since 8. * @since 8 */ barHeight(value: Length): TabsAttribute; diff --git a/api/@internal/component/ets/text.d.ts b/api/@internal/component/ets/text.d.ts index cdd575d2eba1f0b6bfc7f62042e04ea25c61cdc9..aa258e5c47a9c5179bc2d31f33ed1a4bbad793a2 100644 --- a/api/@internal/component/ets/text.d.ts +++ b/api/@internal/component/ets/text.d.ts @@ -13,7 +13,6 @@ * limitations under the License. */ - /** * Provides an interface for writing texts. * @since 7 @@ -121,11 +120,5 @@ declare class TextAttribute extends CommonMethod { baselineOffset(value: number | string): TextAttribute; } -/** - * @since 7 - */ declare const TextInstance: TextAttribute; -/** - * @since 7 - */ -declare const Text: TextInterface; \ No newline at end of file +declare const Text: TextInterface; diff --git a/api/@internal/component/ets/text_area.d.ts b/api/@internal/component/ets/text_area.d.ts index 0bd8669c821a44c3924129fea575ea9758e2ecf0..d5898a5ad82cd590cc3f7512fb67c2c3b1868c34 100644 --- a/api/@internal/component/ets/text_area.d.ts +++ b/api/@internal/component/ets/text_area.d.ts @@ -13,7 +13,6 @@ * limitations under the License. */ - /** * Provides the method of switching the cursor position. * @since 8 @@ -32,10 +31,10 @@ declare class TextAreaController { } /** - * Defines the option of TextArea. + * Defines the options of TextArea. * @since 7 */ -declare interface TextAreaOption { +declare interface TextAreaOptions { /** * The place holder text string. * @since 7 @@ -64,7 +63,7 @@ interface TextAreaInterface { * Called when writing multiple lines of text. * @since 7 */ - (value?: TextAreaOption): TextAreaAttribute; + (value?: TextAreaOptions): TextAreaAttribute; } /** @@ -134,7 +133,6 @@ declare class TextAreaAttribute extends CommonMethod { /** * Called when the input changes. - * @devices phone, tablet, car. * @since 7 */ onChange(callback: (value: string) => void): TextAreaAttribute; diff --git a/api/@internal/component/ets/text_clock.d.ts b/api/@internal/component/ets/text_clock.d.ts index 4d2fb2af1938c15ad8e4de17989be4b422ac12f6..a522bb3cc73cdec68cb760fc66414b84576a06d3 100644 --- a/api/@internal/component/ets/text_clock.d.ts +++ b/api/@internal/component/ets/text_clock.d.ts @@ -29,8 +29,8 @@ declare class TextClockController { */ start(); /** - * Provides a stop event for textclock. - * @since 8 + * Provides a stop event for textclock. + * @since 8 */ stop(); } @@ -47,7 +47,7 @@ interface TextClockInterface { * Where a negative value indicates the eastern time zone, for example, -8. * @since 8 */ - (options?: {timeZoneOffset?: number, controller?: TextClockController}): TextClockAttribute; + (options?: { timeZoneOffset?: number; controller?: TextClockController }): TextClockAttribute; } declare class TextClockAttribute extends CommonMethod { @@ -98,5 +98,4 @@ declare class TextClockAttribute extends CommonMethod { } declare const TextClock: TextClockInterface; - declare const TextClockInstance: TextClockAttribute; diff --git a/api/@internal/component/ets/text_input.d.ts b/api/@internal/component/ets/text_input.d.ts index 8ad8b036d2a55cb38120462ae1c69c43cd0b9d11..3d613331f2f1b28fd9dc58fff8211382b6851b00 100644 --- a/api/@internal/component/ets/text_input.d.ts +++ b/api/@internal/component/ets/text_input.d.ts @@ -13,7 +13,6 @@ * limitations under the License. */ - /** * Declare the type of input box * @since 7 @@ -98,10 +97,10 @@ declare class TextInputController { } /** - * Defines the option of TextInput. + * Defines the options of TextInput. * @since 7 */ -declare interface TextInputOption { +declare interface TextInputOptions { /** * The place holder text string. * @since 7 @@ -130,10 +129,11 @@ interface TextInputInterface { * Called when writing a single line of text. * @since 7 */ - (value?: TextInputOption): TextInputAttribute; + (value?: TextInputOptions): TextInputAttribute; } /** + * Defines the TextInput attribute functions. * @since 7 */ declare class TextInputAttribute extends CommonMethod { @@ -168,11 +168,18 @@ declare class TextInputAttribute extends CommonMethod { caretColor(value: ResourceColor): TextInputAttribute; /** - * Called when judging whether the text editing has changed. + * Called when judging whether the text editing change finished. * @since 7 + * @deprecated since 8 */ onEditChanged(callback: (isEditing: boolean) => void): TextInputAttribute; + /** + * Called when judging whether the text editing change finished. + * @since 8 + */ + onEditChange(callback: (isEditing: boolean) => void): TextInputAttribute; + /** * Called when submitted. * @since 7 diff --git a/api/@internal/component/ets/text_picker.d.ts b/api/@internal/component/ets/text_picker.d.ts index 8db6d4687d45dba790fed2ec386002c311ea08b8..9d91d8cf3e05453744de6d4d21efe3dc3df42d1e 100644 --- a/api/@internal/component/ets/text_picker.d.ts +++ b/api/@internal/component/ets/text_picker.d.ts @@ -14,10 +14,10 @@ */ /** - * Defines the option of TextPicker. + * Defines the options of TextPicker. * @since 8 */ -declare interface TextPickerOption { +declare interface TextPickerOptions { /** * Specifies the range of the text selector. */ @@ -40,7 +40,7 @@ interface TextPickerInterface { * Defines the TextPicker constructor. * @since 8 */ - (options?: TextPickerOption): TextPickerAttribute; + (options?: TextPickerOptions): TextPickerAttribute; } /** @@ -88,10 +88,10 @@ declare interface TextPickerResult { } /** - * Defines the TextPickerDialogOption for Text Picker Dialog. + * Defines the TextPickerDialogOptions for Text Picker Dialog. * @since 8 */ -declare interface TextPickerDialogOption extends TextPickerOption { +declare interface TextPickerDialogOptions extends TextPickerOptions { /** * Called when the default height of the selected element is set. * @since 8 @@ -123,7 +123,7 @@ declare class TextPickerDialog { * Invoking method display. * @since 8 */ - static show(options?: TextPickerDialogOption); + static show(options?: TextPickerDialogOptions); } declare const TextPicker: TextPickerInterface; diff --git a/api/@internal/component/ets/text_timer.d.ts b/api/@internal/component/ets/text_timer.d.ts index 3001ddf1eede63b200a8507c59d17d9c7352385a..bf49c7c7e087bd74c73a9881bf31fc8df78be87a 100644 --- a/api/@internal/component/ets/text_timer.d.ts +++ b/api/@internal/component/ets/text_timer.d.ts @@ -44,10 +44,10 @@ declare class TextTimerController { } /** - * Defines the option of TextTimer. + * Defines the options of TextTimer. * @since 8 */ -interface TextTimerOption { +interface TextTimerOptions { /** * Sets whether to countdown.The default value is false. * @since 8 @@ -77,7 +77,7 @@ interface TextTimerInterface { * Defines the TextTimer constructor. * @since 8 */ - (options?: TextTimerOption): TextTimerAttribute; + (options?: TextTimerOptions): TextTimerAttribute; } /** @@ -91,10 +91,10 @@ declare class TextTimerAttribute extends CommonMethod { * @since 8 */ format(value: string): TextTimerAttribute; - /** - * Called when the font color is set. - * @since 8 - */ + /** + * Called when the font color is set. + * @since 8 + */ fontColor(value: ResourceColor): TextTimerAttribute; /** * Called when the font size is set. @@ -106,15 +106,15 @@ declare class TextTimerAttribute extends CommonMethod { * @since 8 */ fontStyle(value: FontStyle): TextTimerAttribute; - /** - * Called when the fontWeight is set - * @since 8 - */ + /** + * Called when the fontWeight is set + * @since 8 + */ fontWeight(value: number | FontWeight | string): TextTimerAttribute; - /** - * Called when the fontFamily is set - * @since 8 - */ + /** + * Called when the fontFamily is set + * @since 8 + */ fontFamily(value: ResourceStr): TextTimerAttribute; /** * Called when the timer value is returned. diff --git a/api/@internal/component/ets/piece.d.ts b/api/@internal/component/ets/time_picker.d.ts similarity index 34% rename from api/@internal/component/ets/piece.d.ts rename to api/@internal/component/ets/time_picker.d.ts index 5e67176d8caf32f99dde768ddbc23051dcef3f3b..46846092967dc22bed93895c964682f08610a96c 100644 --- a/api/@internal/component/ets/piece.d.ts +++ b/api/@internal/component/ets/time_picker.d.ts @@ -13,83 +13,103 @@ * limitations under the License. */ - /** - * Sets the relative position of icons and text. + * Defines the struct of TimePickerResult. * @since 8 */ -declare enum IconPosition { +declare interface TimePickerResult { /** - * The icon is at the beginning of the text. + * Application hour * @since 8 */ - Start, + hour?: number; /** - * The icon is at the end of the text. + * Application minute * @since 8 */ - End, + minute?: number; } /** - * Provides text and icons for setting block entries. + * Defines the options of TimePicker. * @since 8 */ -interface PieceInterface { +declare interface TimePickerOptions { /** - * Called when setting the position of a block entry. - * @since 8 + * Specifies the time selector check time. */ - (options?: { content: string; icon?: string }): PieceAttribute; + selected?: Date; } /** + * Defines the TimePicker Component. * @since 8 */ -declare class PieceAttribute extends CommonMethod { +interface TimePickerInterface { /** - * Called when the relative position of the icon and the text is set. + * Defines the TimePicker constructor. * @since 8 */ - iconPosition(value: IconPosition): PieceAttribute; + (options?: TimePickerOptions): TimePickerAttribute; +} + +/** + * Defines the TimePicker attribute functions. + * @since 8 + */ +declare class TimePickerAttribute extends CommonMethod { /** - * Called when the value of Piece fontColor is set + * Time Selector: indicates whether to display the 24-hour clock. * @since 8 */ - fontColor(value: ResourceColor): PieceAttribute; + useMilitaryTime(value: boolean): TimePickerAttribute; + /** - * Called when the value of Piece fontSize is set + * This event is triggered when a TimePicker time is selected. * @since 8 */ - fontSize(value: Length): PieceAttribute; + onChange(callback: (value: TimePickerResult) => void): TimePickerAttribute; +} + +/** + * Defines the TimePickerDialogOptions for Data Picker Dialog. + * @since 8 + */ +declare interface TimePickerDialogOptions extends TimePickerOptions { /** - * Called when the value of Piece fontStyle is set + * Time Selector: indicates whether to display the 24-hour clock. * @since 8 */ - fontStyle(value: FontStyle): PieceAttribute; + useMilitaryTime?: boolean; /** - * Called when the value of Piece fontWeight is set + * Called when the OK button in the dialog is clicked. * @since 8 */ - fontWeight(value: number | FontWeight | string): PieceAttribute; + onAccept?: (value: TimePickerResult) => void; /** - * Called when the value of Piece fontFamily is set + * Called when the Cancel button in the dialog is clicked. * @since 8 */ - fontFamily(value: ResourceStr): PieceAttribute; + onCancel?: () => void; /** - * Called when the value of Piece showDelete is set + * This event is triggered when a TimePicker Time or time is selected in dialog. * @since 8 */ - showDelete(value: boolean): PieceAttribute; + onChange?: (value: TimePickerResult) => void; +} + +/** + * Defines TimePickerDialog which uses show method to show TimePicker dialog. + * @since 8 + */ +declare class TimePickerDialog { /** - * Default icon is invisible, - * Callback onClose function when icon is clicked + * Invoking method display. * @since 8 */ - onClose(callback: () => void): PieceAttribute; + static show(options?: TimePickerDialogOptions); } -declare const Piece: PieceInterface; -declare const PieceInstance: PieceAttribute; +declare const TimePicker: TimePickerInterface; +declare const TimePickerInstance: TimePickerAttribute; diff --git a/api/@internal/component/ets/toggle.d.ts b/api/@internal/component/ets/toggle.d.ts index bb8562b1a7898c4afdc86130e52e39b90270b609..b51b5b490ee4ce8f25d7959d29425192be4fb33c 100644 --- a/api/@internal/component/ets/toggle.d.ts +++ b/api/@internal/component/ets/toggle.d.ts @@ -38,6 +38,7 @@ declare enum ToggleType { } /** + * Defines the toggle interface. * @since 8 */ interface ToggleInterface { @@ -49,6 +50,7 @@ interface ToggleInterface { } /** + * Defines the toggle attibute functions * @since 8 */ declare class ToggleAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/units.d.ts b/api/@internal/component/ets/units.d.ts index 0d9d5ba26b6f4f8c3ba12c1f6f61e86e47d8d245..1eeb8aeadfd7701427cffe2babd034041c6f3e2d 100644 --- a/api/@internal/component/ets/units.d.ts +++ b/api/@internal/component/ets/units.d.ts @@ -150,28 +150,99 @@ declare interface Area { * Defines the local position. * @since 8 */ - pos: Position; + position: Position; /** * Defines the global position. * @since 8 */ - globalPos: Position; + globalPosition: Position; } /** * Defines the position. - * @since 8 + * @since 7 */ declare interface Position { /** * Coordinate x of the Position. - * @since 8 + * @since 7 */ - x: Length; + x?: Length; /** * Coordinate y of the Position. - * @since 8 + * @since 7 + */ + y?: Length; +} + +/** + * Defines the constrain size options. + * @since 7 + */ +declare interface ConstraintSizeOptions { + /** + * Defines the min width. + * @since 7 + */ + minWidth?: Length; + /** + * Defines the max width. + * @since 7 + */ + maxWidth?: Length; + /** + * Defines the min height. + * @since 7 + */ + minHeight?: Length; + /** + * Defines the max height. + * @since 7 + */ + maxHeight?: Length; +} + +/** + * Defines the size options. + * @since 7 + */ +declare interface SizeOptions { + /** + * Defines the width. + * @since 7 + */ + width?: Length; + /** + * Defines the height. + * @since 7 + */ + height?: Length; +} + +/** + * Defines the options of border. + * @since 7 + */ +declare interface BorderOptions { + /** + * Defines the border width. + * @since 7 + */ + width?: Length; + /** + * Defines the border color. + * @since 7 + */ + color?: ResourceColor; + /** + * Defines the border radius. + * @since 7 + */ + radius?: Length; + /** + * Defines the border style. + * @since 7 */ - y: Length; + style?: BorderStyle; } diff --git a/api/@internal/component/ets/video.d.ts b/api/@internal/component/ets/video.d.ts index d80052caf7abe2400a29a624f146b22819f4e770..1672760d4bdd348513d46b9c2fcacd842593e3e0 100644 --- a/api/@internal/component/ets/video.d.ts +++ b/api/@internal/component/ets/video.d.ts @@ -36,7 +36,7 @@ declare enum SeekMode { */ ClosestKeyframe, - /** + /** * Seek to frames closest the time point. * @since 8 */ @@ -48,67 +48,69 @@ declare enum SeekMode { * @since 8 */ declare enum PlaybackSpeed { - /** - * 0.75x speed playback. - * @since 8 - */ - Speed_Forward_0_75_X, - - /** - * 1.00x speed playback. - * @since 8 - */ - Speed_Forward_1_00_X, - - /** - * 1.25x speed playback. - * @since 8 - */ - Speed_Forward_1_25_X, - - /** - * 1.75x speed playback. - * @since 8 - */ - Speed_Forward_1_75_X, - - /** - * 2.00x speed playback. - * @since 8 - */ - Speed_Forward_2_00_X, - } - - /** - * @since 7 - */ - interface VideoOption { - /** - * src of video. - * @since 7 - */ - src?: string | Resource; - - /** - * playback rate of video. - * @since 7 - */ - currentProgressRate?: number | string | PlaybackSpeed; - - /** - * preview uri of video. - * @since 8 - */ - previewUri?: string | PixelMap | Resource; - - /** - * controller of video. - * @since 7 - */ - controller?: VideoController; - } + /** + * 0.75x speed playback. + * @since 8 + */ + Speed_Forward_0_75_X, + + /** + * 1.00x speed playback. + * @since 8 + */ + Speed_Forward_1_00_X, + + /** + * 1.25x speed playback. + * @since 8 + */ + Speed_Forward_1_25_X, + + /** + * 1.75x speed playback. + * @since 8 + */ + Speed_Forward_1_75_X, + + /** + * 2.00x speed playback. + * @since 8 + */ + Speed_Forward_2_00_X, +} + +/** + * Defines the video options. + * @since 7 + */ +declare interface VideoOptions { + /** + * src of video. + * @since 7 + */ + src?: string | Resource; + + /** + * playback rate of video. + * @since 7 + */ + currentProgressRate?: number | string | PlaybackSpeed; + + /** + * preview uri of video. + * @since 7 + */ + previewUri?: string | PixelMap | Resource; + + /** + * controller of video. + * @since 7 + */ + controller?: VideoController; +} /** + * Defines the video controller. * @since 7 */ declare class VideoController { @@ -132,7 +134,7 @@ declare class VideoController { /** * Provides an event to stop playback. - * @since 6 + * @since 7 */ stop(); @@ -142,6 +144,18 @@ declare class VideoController { */ setCurrentTime(value: number); + /** + * Provides a full screen playback method. + * @since 7 + */ + requestFullscreen(value: boolean); + + /** + * Provides a method to exit full screen playback. + * @since 7 + */ + exitFullscreen(); + /** * Provide the progress method of video playback. * @since 8 @@ -150,6 +164,7 @@ declare class VideoController { } /** + * Defines the video interface. * @since 7 */ interface VideoInterface { @@ -157,10 +172,11 @@ interface VideoInterface { * Set the value. * @since 7 */ - (value: VideoOption): VideoAttribute; + (value: VideoOptions): VideoAttribute; } /** + * Defines the video attribute functions. * @since 7 */ declare class VideoAttribute extends CommonMethod { @@ -212,6 +228,11 @@ declare class VideoAttribute extends CommonMethod { */ onFinish(event: () => void): VideoAttribute; + /** + * Called when the video enters and exits the full screen. + * @since 7 + */ + onFullscreenChange(callback: (event?: { fullscreen: boolean }) => void): VideoAttribute; /** * Called when the video preparation is complete. * @since 7 diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index 6c34f1228cdd79bbb2cafafe49153075d5de5968..b98ca50d6beae32a333b759c35c1c6ee6c4e5177 100755 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -1,3 +1,22 @@ +/* + * Copyright (c) 2021-2022 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. + */ + +/** + * Enum type supplied to {@link getMessageLevel} for receiving the console log level of JavaScript. + * @since 8 + */ declare enum MessageLevel { /** * Debug level. @@ -27,35 +46,43 @@ declare enum MessageLevel { * Warn level. * @since 8 */ - Warn + Warn, } -declare enum MixedModeContent { +/** + * The Web's behavior to load from HTTP or HTTPS. Defaults to MixedMode.None. + * @since 8 + */ +declare enum MixedMode { /** - * MIXED_CONTENT_ALWAYS_ALLOW level. + * Allows all sources. * @since 8 */ - MIXED_CONTENT_ALWAYS_ALLOW, + All, /** - * MIXED_CONTENT_NEVER_ALLOW level. + * Allows sources Compatibly. * @since 8 */ - MIXED_CONTENT_NEVER_ALLOW, + Compatible, /** - * MIXED_CONTENT_COMPATIBILITY_MODE level. + * Don't allow unsecure sources from a secure origin. * @since 8 */ - MIXED_CONTENT_COMPATIBILITY_MODE, + None, } +/** + * Enum type supplied to {@link getHitTest} for indicating the cursor node HitTest. + * @since 8 + */ declare enum HitTestType { /** * The edit text. * @since 8 */ - Edit, + EditText, /** * The email address. @@ -67,13 +94,13 @@ declare enum HitTestType { * The HTML::a tag with src=http. * @since 8 */ - Http, + HttpAnchor, /** * The HTML::a tag with src=http + HTML::img. * @since 8 */ - HttpImg, + HttpAnchorImg, /** * The HTML::img tag. @@ -94,29 +121,40 @@ declare enum HitTestType { Phone, /** - * Other unknown hit test. + * Other unknown HitTest. * @since 8 */ - Unknown + Unknown, } +/** + * Enum type supplied to {@link cacheMode} for setting the Web cache mode. + * @since 8 + */ declare enum CacheMode { /** * load online and not cache. + * @since 8 */ None, /** * Load cache first, then online. + * @since 8 */ Online, /** * load cache and not online. + * @since 8 */ - Only + Only, } +/** + * Defines the js result. + * @since 8 + */ declare class JsResult { /** * Constructor. @@ -137,46 +175,59 @@ declare class JsResult { handleConfirm(): void; } +/** + * Encompassed message information as parameters to {@link onConsole} method. + * @since 8 + */ declare class ConsoleMessage { /** * Constructor. + * @param message The console message. + * @param sourceId The Web source file's path and name. + * @param lineNumber The line number of the console message. + * @param messageLevel The console log level. + * * @since 8 */ constructor(message: string, sourceId: string, lineNumber: number, messageLevel: MessageLevel); /** - * Get the message of a console message. - * + * Gets the message of a console message. * @return Return the message of a console message. + * * @since 8 */ getMessage(): string; /** - * Get the source id of a console message. + * Gets the Web source file's path and name of a console message. + * @return Return the Web source file's path and name of a console message. * - * @return Return the source id of a console message. * @since 8 */ getSourceId(): string; /** - * Get the line number of a console message. - * + * Gets the line number of a console message. * @return Return the line number of a console message. + * * @since 8 */ getLineNumber(): number; /** - * Get the message level of a console message. - * + * Gets the message level of a console message. * @return Return the message level of a console message, which can be {@link MessageLevel}. + * * @since 8 */ getMessageLevel(): MessageLevel; } +/** + * Defines the Web resource request. + * @since 8 + */ declare class WebResourceRequest { /** * Constructor. @@ -185,46 +236,128 @@ declare class WebResourceRequest { constructor(); /** - * Get request headers. + * Gets request headers. + * @return Return the request headers * - * @return Return a map of the request headers * @since 8 */ - getRequestHeader(): Map; + getRequestHeader(): Array
; /** - * Get the request url. + * Gets the request URL. + * @return Return the request URL. * - * @return Return the request url. * @since 8 */ getRequestUrl(): string; /** * Check whether the request is associated with gesture. - * * @return Return {@code true} if the request is associated with gesture;return {@code false} otherwise. + * * @since 8 */ isRequestGesture(): boolean; /** * Check whether the request is for getting the main frame. + * @return Return {@code true} if the request is associated with gesture for getting the main frame; return {@code false} otherwise. * - * @return Return {@code true} if the request is associated with gesturefor getting the main frame; return {@code false} otherwise. * @since 8 */ isMainFrame(): boolean; /** * Check whether the request redirects. - * * @return Return {@code true} if the request redirects; return {@code false} otherwise. + * * @since 8 */ isRedirect(): boolean; } +/** + * Defines the Web resource response. + * @since 8 + */ + declare class WebResourceResponse { + /** + * Constructor. + * @since 8 + */ + constructor(); + + /** + * Gets the response data. + * @return Return the response data. + * + * @since 8 + */ + getResponseData(): string; + + /** + * Gets the response encoding. + * @return Return the response encoding. + * + * @since 8 + */ + getResponseEncoding(): string; + + /** + * Gets the response MIME type. + * @return Return the response MIME type. + * + * @since 8 + */ + getResponseMimeType(): string; + + /** + * Gets the reason message. + * @return Return the reason message. + * + * @since 8 + */ + getReasonMessage(): string; + + /** + * Gets the response headers. + * @return Return the response headers. + * + * @since 8 + */ + getResponseHeader() : Array
; + + /** + * Gets the response code. + * @return Return the response code. + * + * @since 8 + */ + getResponseCode(): number; +} + +/** + * Defines the Web's request/response header. + * @since 8 + */ +declare interface Header { + /** + * Gets the key of the request/response header. + * @since 8 + */ + headerKey: string; + + /** + * Gets the value of the request/response header. + * @since 8 + */ + headerValue: string; +} + +/** + * Defines the Web resource error. + * @since 8 + */ declare class WebResourceError { /** * Constructor. @@ -233,22 +366,26 @@ declare class WebResourceError { constructor(); /** - * Get the info of the web resource error. + * Gets the info of the Web resource error. + * @return Return the info of the Web resource error. * - * @return Return the info of the web resource error. * @since 8 */ getErrorInfo(): string; /** - * Get the code of the web resource error. + * Gets the code of the Web resource error. + * @return Return the code of the Web resource error. * - * @return Return the code of the web resource error. * @since 8 */ getErrorCode(): number; } +/** + * Defines the js geolocation request. + * @since 8 + */ declare class JsGeolocation { /** * Constructor. @@ -258,15 +395,19 @@ declare class JsGeolocation { /** * Report the geolocation permission status from users. - * * @param origin The origin that ask for the geolocation permission. * @param allow The geolocation permission status. * @param retain Whether to allow the geolocation permission status to be saved to the system. + * * @since 8 */ invoke(origin: string, allow: boolean, retain: boolean): void; } +/** + * Defines the Web cookie. + * @since 8 + */ declare class WebCookie { /** * Constructor. @@ -287,7 +428,11 @@ declare class WebCookie { saveCookie(); } -declare class WebController { +/** + * Defines the Web controller. + * @since 8 + */ + declare class WebController { /** * Constructor. * @since 8 @@ -307,28 +452,42 @@ declare class WebController { onActive(): void; /** - * Clear the history in the Web. + * Let the Web zoom by. + * @param factor The zoom factor. + * + * @since 8 + */ + zoom(factor: number): void; + + /** + * Clears the history in the Web. * @since 8 */ clearHistory(): void; /** - * Means to load a piece of code and execute JS code in the context of the currently displayed page + * Loads a piece of code and execute JS code in the context of the currently displayed page. + * @param options The options with a piece of code and a callback. + * * @since 8 */ - runJavaScript(jscode: string, callback?: (result: string) => void); + runJavaScript(options: { script: string, callback?: (result: string) => void }); /** - * Indicates that a piece of code is loaded + * Loads the data or URL. + * @param options The options with the data or URL and other information. + * * @since 8 */ - loadData(value: { data: string, mimeType: string, encoding: string, baseUrl?: string, historyUrl?: string }); + loadData(options: { data: string, mimeType: string, encoding: string, baseUrl?: string, historyUrl?: string }); /** - * Load the given URL + * Loads the given URL. + * @param options The options with the URL and other information. + * * @since 8 */ - loadUrl(url: string, additionalHttpHeaders?: Array<{ key: string, value: string }>); + loadUrl(options: { url: string | Resource, headers?: Array
}); /** * refreshes the current URL. @@ -344,142 +503,183 @@ declare class WebController { /** * Registers the JavaScript object and method list. + * @param options The option with the JavaScript object and method list. + * * @since 8 */ - registerJavaScriptProxy(value: { obj: object, name: string, methodList: Array }); + registerJavaScriptProxy(options: { object: object, name: string, methodList: Array }); /** * Deletes a registered JavaScript object with given name. + * @param name The name of a registered JavaScript object to be deleted. + * * @since 8 */ - deleteJavaScriptProxy(value: { name: string }); + deleteJavaScriptRegister(name: string); /** - * Get the type of hit test. + * Gets the type of HitTest. * @since 8 */ getHitTest(): HitTestType; /** - * Get the request focus. + * Gets the request focus. * @since 8 */ requestFocus(); /** - * Check whether the web page can go back - * @since 8 - */ + * Checks whether the web page can go back. + * @since 8 + */ accessBackward(): boolean; /** - * Check whether the web page can go forward - * @since 8 - */ + * Checks whether the web page can go forward. + * @since 8 + */ accessForward(): boolean; /** - * Check whether the web page can go back or forward the given number of steps - * @since 8 - */ + * Checks whether the web page can go back or forward the given number of steps. + * @param step The number of steps. + * + * @since 8 + */ accessStep(step: number): boolean; /** - * Go back in the history of the web - * @since 8 - */ + * Goes back in the history of the web page. + * @since 8 + */ backward(); /** - * Go forward in the history of the web - * @since 8 - */ + * Goes forward in the history of the web page. + * @since 8 + */ forward(); - } +/** + * Defines the Web options. + * @since 8 + */ declare interface WebOptions { /** - * Set the address of the web page to be displayed + * Sets the address of the web page to be displayed. * @since 8 */ src: string | Resource; + /** + * Sets the controller of the Web. + * @since 8 + */ controller: WebController; } +/** + * Defines the Web interface. + * @since 8 + */ interface WebInterface { /** - * Set Value. + * Sets Value. * @since 8 */ (value: WebOptions): WebAttribute; } +/** + * Defines the Web attribute functions. + * @since 8 + */ declare class WebAttribute extends CommonMethod { /** - * Set whether WebView allows JavaScript scripts to execute + * Sets whether the Web allows JavaScript scripts to execute. + * @param javaScriptAccess {@code true} means the Web can allows JavaScript scripts to execute; {@code false} otherwise. + * * @since 8 */ javaScriptAccess(javaScriptAccess: boolean): WebAttribute; /** - * Enable or disable local file system access in WebView + * Sets whether enable local file system access in Web. + * @param fileAccess {@code true} means enable local file system access in Web; {@code false} otherwise. + * * @since 8 */ fileAccess(fileAccess: boolean): WebAttribute; /** - * Whether to allow image resources to be loaded from the network + * Sets whether to allow image resources to be loaded from the network. + * @param onlineImageAccess {@code true} means the Web can allow image resources to be loaded from the network; + * {@code false} otherwise. + * * @since 8 */ onlineImageAccess(onlineImageAccess: boolean): WebAttribute; /** - * Setting Whether to Enable the DOM Storage API Permission + * Sets whether to enable the DOM Storage API permission. + * @param domStorageAccess {@code true} means enable the DOM Storage API permission in Web; {@code false} otherwise. + * * @since 8 */ domStorageAccess(domStorageAccess: boolean): WebAttribute; /** - * Set whether WebView should automatically load image resources + * Sets whether the Web can automatically load image resources. + * @param imageAccess {@code true} means the Web can automatically load image resources; {@code false} otherwise. + * * @since 8 */ imageAccess(imageAccess: boolean): WebAttribute; /** - * Whether to load HTTP and HTTPS content + * Sets how to load HTTP and HTTPS content. + * @param mixedMode The mixed mode, which can be {@link MixedMode}. + * * @since 8 */ - mixedMode(mixedMode: MixedModeContent): WebAttribute; + mixedMode(mixedMode: MixedMode): WebAttribute; /** - * Sets whether the WebView supports zooming using on-screen controls or gestures + * Sets whether the Web supports zooming using gestures. + * @param zoomAccess {@code true} means the Web supports zooming using gestures; {@code false} otherwise. + * * @since 8 */ zoomAccess(zoomAccess: boolean): WebAttribute; /** - * Indicates whether to allow access to geographical locations + * Sets whether to allow access to geographical locations. + * @param geolocationAccess {@code true} means the Web allows access to geographical locations; {@code false} otherwise. + * * @since 8 */ geolocationAccess(geolocationAccess: boolean): WebAttribute; /** - * Inject the arkUI JS object into H5 and invoke the function of the object in H5. + * Injects the JavaScript object into window and invoke the function in window. + * @param javaScriptProxy The JavaScript object to be injected. + * * @since 8 */ - javaScriptProxy(javaScriptProxy: { obj: object, name: string, methodList: Array }): WebAttribute; + javaScriptProxy(javaScriptProxy: { object: object, name: string, methodList: Array, + controller: WebController }): WebAttribute; - /* + /** * Sets whether the Web should save the password. - * @param password {@code ture} means the Web can save the password; {@code false} otherwise. + * @param password {@code true} means the Web can save the password; {@code false} otherwise. * * @since 8 */ password(password: boolean): WebAttribute; /** - * Sets the mode of cache in the Web. + * Sets the mode of cache in Web. * @param cacheMode The cache mode, which can be {@link CacheMode}. * * @since 8 @@ -488,7 +688,7 @@ declare class WebAttribute extends CommonMethod { /** * Sets whether the Web should save the table data. - * @param tableData {@code ture} means the Web can save the table data; {@code false} otherwise. + * @param tableData {@code true} means the Web can save the table data; {@code false} otherwise. * * @since 8 */ @@ -496,7 +696,7 @@ declare class WebAttribute extends CommonMethod { /** * Sets whether the Web access meta 'viewport' in HTML. - * @param wideViewModeAccess {@code ture} means the Web access meta 'viewport' in HTML; {@code false} otherwise. + * @param wideViewModeAccess {@code true} means the Web access meta 'viewport' in HTML; {@code false} otherwise. * * @since 8 */ @@ -504,7 +704,7 @@ declare class WebAttribute extends CommonMethod { /** * Sets whether the Web access overview mode. - * @param overviewModeAccess {@code ture} means the Web access overview mode; {@code false} otherwise. + * @param overviewModeAccess {@code true} means the Web access overview mode; {@code false} otherwise. * * @since 8 */ @@ -520,110 +720,133 @@ declare class WebAttribute extends CommonMethod { /** * Sets whether the Web access the database. - * @param databaseAccess {@code ture} means the Web access the database; {@code false} otherwise. + * @param databaseAccess {@code true} means the Web access the database; {@code false} otherwise. * * @since 8 */ databaseAccess(databaseAccess: boolean): WebAttribute; /** - * Triggered at the end of web page loading + * Sets the Web's user agent. + * @param userAgent The Web's user agent. + * + * @since 8 + */ + userAgent(userAgent: string): WebAttribute; + + /** + * Triggered at the end of web page loading. + * @param callback The triggered function at the end of web page loading. + * * @since 8 */ onPageEnd(callback: (event?: { url: string }) => void): WebAttribute; /** - * Triggered at the begin of web page loading + * Triggered at the begin of web page loading. + * @param callback The triggered function at the begin of web page loading. + * * @since 8 */ onPageBegin(callback: (event?: { url: string }) => void): WebAttribute; /** - * Triggered when the page loading progress changes + * Triggered when the page loading progress changes. + * @param callback The triggered function when the page loading progress changes. + * * @since 8 */ onProgressChange(callback: (event?: { newProgress: number }) => void): WebAttribute; /** - * Triggered when the title of the main application document changes + * Triggered when the title of the main application document changes. + * @param callback The triggered function when the title of the main application document changes. + * * @since 8 */ onTitleReceive(callback: (event?: { title: string }) => void): WebAttribute; /** - * Hide prompt to ask for the geolocation permission. + * Triggered when requesting to hide the geolocation. + * @param callback The triggered function when requesting to hide the geolocation permission. + * * @since 8 */ onGeolocationHide(callback: () => void): WebAttribute; /** - * Show prompt to ask for the geolocation permission. - * - * @param origin the origin of the resource to get geolocation. - * @param geolocation callback to report geolocation. + * Triggered when requesting to show the geolocation permission. + * @param callback The triggered function when requesting to show the geolocation permission. + * * @since 8 */ onGeolocationShow(callback: (event?: { origin: string, geolocation: JsGeolocation }) => void): WebAttribute; /** - * Get WebView focus callback event + * Triggered when the Web gets the focus. + * @param callback The triggered function when the Web gets the focus. + * * @since 8 */ - onRequestSelected(event: () => void): WebAttribute; + onRequestSelected(callback: () => void): WebAttribute; /** - * Triggered when the web page wants to display a JavaScript alert() dialog. - * + * Triggered when the Web wants to display a JavaScript alert() dialog. * @param callback The triggered function when the web page wants to display a JavaScript alert() dialog. + * * @since 8 */ onAlert(callback: (event?: { url: string, message: string, result: JsResult }) => boolean): WebAttribute; /** - * Triggered when the web page wants to confirm navigation from JavaScript onbeforeunload. - * + * Triggered when the Web wants to confirm navigation from JavaScript onbeforeunload. * @param callback The triggered function when the web page wants to confirm navigation from JavaScript onbeforeunload. + * * @since 8 */ - onBeforeUnload(callback: (event?: { message: string, result: JsResult }) => boolean): WebAttribute; + onBeforeUnload(callback: (event?: { url: string, message: string, result: JsResult }) => boolean): WebAttribute; /** * Triggered when the web page wants to display a JavaScript confirm() dialog. - * * @param callback The Triggered function when the web page wants to display a JavaScript confirm() dialog. + * * @since 8 */ - onConfirm(callback: (event?: {url: string, message: string, result: JsResult }) => boolean): WebAttribute; + onConfirm(callback: (event?: { url: string, message: string, result: JsResult }) => boolean): WebAttribute; /** * Triggered when the web page receives a JavaScript console message. - * * @param callback The triggered function when the web page receives a JavaScript console message. + * * @since 8 */ - onConsole(callback: (event?: {message: ConsoleMessage}) => boolean): WebAttribute; + onConsole(callback: (event?: { message: ConsoleMessage }) => boolean): WebAttribute; /** * Triggered when the web page receives a web resource loading error. - * * @param callback The triggered function when the web page receives a web resource loading error. + * * @since 8 */ - onErrorReceive(callback: (event?: {request: WebResourceRequest, error: WebResourceError}) => void): WebAttribute; + onErrorReceive(callback: (event?: { request: WebResourceRequest, error: WebResourceError }) => void): WebAttribute; /** * Triggered when the web page receives a web resource loading HTTP error. - * * @param callback The triggered function when the web page receives a web resource loading HTTP error. + * * @since 8 */ - onHttpErrorReceive(callback: (event?: {request: WebResourceRequest, error: WebResourceError}) => void): WebAttribute; + onHttpErrorReceive(callback: (event?: { request: WebResourceRequest, + response: WebResourceResponse }) => void): WebAttribute; /** - * Triggered when download start + * Triggered when starting to download. + * @param callback The triggered function when starting to download. + * * @since 8 */ - onDownloadStart(callback: (event?: {url: string, userAgent: string, contentDisposition: string, mimetype: string, contentLength: number}) => void): WebAttribute; + onDownloadStart(callback: (event?: { url: string, userAgent: string, contentDisposition: string, mimetype: string, + contentLength: number }) => void): WebAttribute; /** * Triggered when the Web page refreshes accessed history. @@ -634,26 +857,24 @@ declare class WebAttribute extends CommonMethod { onRefreshAccessedHistory(callback: (event?: { url: string, refreshed: boolean }) => void): WebAttribute; /** - * Triggered when the url is about to be loaded. - * @param callback The triggered callback when the url is about to be loaded. - * @return Returns {@code ture} to let the load stop; return {@code false} to let the load continue. + * Triggered when the URL loading is intercepted. + * @param callback The triggered callback when the URL loading is intercepted. * * @since 8 */ onUrlLoadIntercept(callback: (event?: { data: string | WebResourceRequest }) => boolean): WebAttribute; /** - * Triggered when the Web page receives the ssl Error. - * @param callback The triggered callback when the Web page receives the ssl Error. + * Triggered when the Web page receives an ssl Error. + * @param callback The triggered callback when the Web page receives an ssl Error. * * @since 8 */ onSslErrorReceive(callback: (event?: { handler: Function, error: object }) => void): WebAttribute; /** - * Triggered when the render process is exited. - * @param callback The triggered when the render process is exited. - * @return Returns {@code ture} to handle the situation; return {@code false} to kill the render process. + * Triggered when the render process exits. + * @param callback The triggered when the render process exits. * * @since 8 */ @@ -662,7 +883,6 @@ declare class WebAttribute extends CommonMethod { /** * Triggered when the file selector shows. * @param callback The triggered when the file selector shows. - * @return Returns {@code ture} to handle the situation; return {@code false} to use default handling. * * @since 8 */ @@ -670,4 +890,4 @@ declare class WebAttribute extends CommonMethod { } declare const Web: WebInterface; -declare const WebInstance: WebAttribute; +declare const WebInstance: WebAttribute; \ No newline at end of file diff --git a/api/@internal/component/ets/xcomponent.d.ts b/api/@internal/component/ets/xcomponent.d.ts index 9cbc7cb1cd9c0f6264ff0072422e178da1e6d947..119d2f59edf883c81f9596c2150e92593eeaea10 100644 --- a/api/@internal/component/ets/xcomponent.d.ts +++ b/api/@internal/component/ets/xcomponent.d.ts @@ -16,13 +16,11 @@ /** * Defines XComponentController * @since 8 - * @systemapi */ declare class XComponentController { /** * constructor. * @since 8 - * @systemapi */ constructor(); @@ -32,46 +30,52 @@ declare class XComponentController { * @systemapi */ getXComponentSurfaceId(); + + /** + * get the context of native XComponent. + * @since 8 + */ + getXComponentContext(); + + /** + * set the surface size created by XComponent. + * @since 8 + * @systemapi + */ + setXComponentSurfaceSize(value: { + surfaceWidth: number; + surfaceHeight: number; + }); } /** * Defines XComponent. * @since 8 - * @systemapi */ interface XComponentInterface { /** * Constructor parameters * @since 8 - * @systemapi */ - (value: { - id: string; - type: string; - libraryname?: string; - controller?: XComponentController; - }): XComponentAttribute; + (value: { id: string; type: string; libraryname?: string; controller?: XComponentController }): XComponentAttribute; } /** * Defines XComponentAttribute. * @since 8 - * @systemapi */ declare class XComponentAttribute extends CommonMethod { /** * Called when judging whether the xcomponent surface is created. * @since 8 - * @systemapi */ - onLoad(callback: (event?: object) => void): XComponentAttribute; + onLoad(callback: (event?: object) => void): XComponentAttribute; /** * Called when judging whether the xcomponent is destroyed. * @since 8 - * @systemapi */ - onDestroy(event: () => void): XComponentAttribute; + onDestroy(event: () => void): XComponentAttribute; } declare const XComponent: XComponentInterface; diff --git a/api/@internal/ets/index.d.ts b/api/@internal/ets/index.d.ts index 4a9e2b6b33809e76eb91f12c8ba4779d2bb51a1b..6199f456664bd425babb063bc9eabf0c99663b13 100644 --- a/api/@internal/ets/index.d.ts +++ b/api/@internal/ets/index.d.ts @@ -13,5 +13,6 @@ * limitations under the License. */ +export * from './featureability'; export * from './global'; export * from './lifecycle'; diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index e93c7b285fe44b2b8e654613baf2e5b8786cfe96..2c2520a6c47221f04f9dcfebc97e390c523b0668 100644 --- a/api/@internal/ets/lifecycle.d.ts +++ b/api/@internal/ets/lifecycle.d.ts @@ -13,37 +13,38 @@ * limitations under the License. */ -import { Want } from "../ability/want"; -import { ResultSet } from "../data/rdb/resultSet"; -import { AbilityInfo } from "../bundle/abilityInfo"; -import { DataAbilityResult } from "../ability/dataAbilityResult"; -import { DataAbilityOperation } from "../ability/dataAbilityOperation"; -import dataAbility from "../@ohos.data.dataAbility"; -import formBindingData from "../@ohos.ability.formBindingData"; -import formManager from "../@ohos.ability.formManager"; -import rdb from "../@ohos.data.rdb"; -import rpc from "../@ohos.rpc"; -import resourceManager from "../@ohos.resourceManager"; -import { PacMap } from "../ability/dataAbilityHelper"; +import { Want } from "../../ability/want"; +import { ResultSet } from "../../data/rdb/resultSet"; +import { AbilityInfo } from "../../bundle/abilityInfo"; +import { DataAbilityResult } from "../../ability/dataAbilityResult"; +import { DataAbilityOperation } from "../../ability/dataAbilityOperation"; +import dataAbility from "../../@ohos.data.dataAbility"; +import formBindingData from "../../@ohos.application.formBindingData"; +import formInfo from "../../@ohos.application.formInfo"; +import rdb from "../../@ohos.data.rdb"; +import rpc from "../../@ohos.rpc"; +import resourceManager from "../../@ohos.resourceManager"; +import { PacMap } from "../../ability/dataAbilityHelper"; +import { AsyncCallback } from "../../basic"; /** * interface of form lifecycle. * * @name LifecycleForm * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ export declare interface LifecycleForm { /** * Called to return a {@link formBindingData.FormBindingData} object. * - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param want Indicates the detailed information for creating a {@link formBindingData#FormBindingData}. * The {@code Want} object must include the form ID, form name, and grid style of the form, - * which can be obtained from {@link formManager#FormParam#IDENTITY_KEY}, - * {@link formManager#FormParam#NAME_KEY}, and {@link formManager#FormParam#DIMENSION_KEY}, + * which can be obtained from {@link formInfo#FormParam#IDENTITY_KEY}, + * {@link formInfo#FormParam#NAME_KEY}, and {@link formInfo#FormParam#DIMENSION_KEY}, * respectively. Such form information must be managed as persistent data for further form * acquisition, update, and deletion. * @return Returns the created {@link formBindingData#FormBindingData} object. @@ -54,19 +55,19 @@ export declare interface LifecycleForm { /** * Called when the form provider is notified that a temporary form is successfully converted to a normal form. * - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param formId Indicates the ID of the form. * @return - * @FAModelOnly */ - onCastTempToNormal?(formId: string): void; + onCastToNormal?(formId: string): void; /** * Called to notify the form provider to update a specified form. * - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param formId Indicates the ID of the form to update. * @return - * @FAModelOnly @@ -76,24 +77,24 @@ export declare interface LifecycleForm { /** * Called when the form provider receives form events from the system. * - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param newStatus Indicates the form events occurred. The key in the {@code Map} object indicates the form ID, - * and the value indicates the event type, which can be either {@link formManager#VisibilityType#FORM_VISIBLE} - * or {@link formManager#VisibilityType#FORM_INVISIBLE}. {@link formManager#VisibilityType#FORM_VISIBLE} - * means that the form becomes visible, and {@link formManager#VisibilityType#FORM_INVISIBLE} + * and the value indicates the event type, which can be either {@link formInfo#VisibilityType#FORM_VISIBLE} + * or {@link formInfo#VisibilityType#FORM_INVISIBLE}. {@link formInfo#VisibilityType#FORM_VISIBLE} + * means that the form becomes visible, and {@link formInfo#VisibilityType#FORM_INVISIBLE} * means that the form becomes invisible. * @return - * @FAModelOnly */ - onVisibilityChanged?(newStatus: { [key: string]: number }): void; + onVisibilityChange?(newStatus: { [key: string]: number }): void; /** * Called when a specified message event defined by the form provider is triggered. This method is valid only for * JS forms. * - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param formId Indicates the ID of the form on which the message event is triggered, which is provided by * the client to the form provider. * @param message Indicates the value of the {@code params} field of the message event. This parameter is @@ -101,19 +102,19 @@ export declare interface LifecycleForm { * @return - * @FAModelOnly */ - onTriggerEvent?(formId: string, message: string): void; + onEvent?(formId: string, message: string): void; /** * Called to notify the form provider that a specified form has been deleted. Override this method if * you want your application, as the form provider, to be notified of form deletion. * - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param formId Indicates the ID of the deleted form. * @return - * @FAModelOnly */ - onDelete?(formId: string): void; + onDestroy?(formId: string): void; /** * Called to return a {@link FormState} object. @@ -121,14 +122,14 @@ export declare interface LifecycleForm { *

You must override this callback if you want this ability to return the actual form state. Otherwise, * this method returns {@link FormState#DEFAULT} by default.

* - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel - * @param want Indicates the description of the form for which the {@link formManager#FormState} is obtained. + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param want Indicates the description of the form for which the {@link formInfo#FormState} is obtained. * The description covers the bundle name, ability name, module name, form name, and form dimensions. - * @return Returns the {@link formManager#FormState} object. + * @return Returns the {@link formInfo#FormState} object. * @FAModelOnly */ - onAcquireFormState?(want: Want): formManager.FormState; + onAcquireFormState?(want: Want): formInfo.FormState; } /** @@ -136,7 +137,7 @@ export declare interface LifecycleForm { * * @name LifecycleApp * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAMode + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ export declare interface LifecycleApp { @@ -144,7 +145,7 @@ export declare interface LifecycleApp { * Called back when the state of an ability changes from BACKGROUND to INACTIVE. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -154,7 +155,7 @@ export declare interface LifecycleApp { * Called back when an ability enters the BACKGROUND state. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -164,7 +165,7 @@ export declare interface LifecycleApp { * Called back before an ability is destroyed. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -174,7 +175,7 @@ export declare interface LifecycleApp { * Called back when an ability is started for initialization. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -185,7 +186,7 @@ export declare interface LifecycleApp { * to multi-window mode or from multi-window mode to fullscreen mode. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param isShownInMultiWindow Specifies whether this ability is currently in multi-window mode. * The value {@code true} indicates the multi-window mode, and {@code false} indicates another mode. * @param newConfig Indicates the new configuration information about this Page ability. @@ -199,7 +200,7 @@ export declare interface LifecycleApp { * Asks a user whether to start the migration. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @return Returns {@code true} if the user allows the migration; returns {@code false} otherwise. * @FAModelOnly */ @@ -211,7 +212,7 @@ export declare interface LifecycleApp { * Scheduler Service requests data from the local ability. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param data Indicates the user data to save. * @return Returns {@code true} if the data is successfully saved; returns {@code false} otherwise. * @FAModelOnly @@ -225,7 +226,7 @@ export declare interface LifecycleApp { * notify the user of the successful migration and then exit the local ability.

* * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param result Indicates the migration result code. The value {@code 0} indicates that the migration is * successful, and {@code -1} indicates that the migration fails. * @return - @@ -239,7 +240,7 @@ export declare interface LifecycleApp { * is restored. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param data Indicates the user data to restore. * @return - * @FAModelOnly @@ -251,7 +252,7 @@ export declare interface LifecycleApp { * migration is performed for the ability from the local device to the remote device. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -263,7 +264,7 @@ export declare interface LifecycleApp { * this method is used only to save temporary states. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param outState Indicates the {@code PacMap} object used for storing user data and states. This * parameter cannot be null. * @return - @@ -277,7 +278,7 @@ export declare interface LifecycleApp { * states. Generally, this method is called after the {@link #onStart(Want)} method. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param inState Indicates the {@code PacMap} object used for storing data and states. This * parameter can not be null. * @return - @@ -290,7 +291,7 @@ export declare interface LifecycleApp { * change to the BACKGROUND or ACTIVE state). * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -300,7 +301,7 @@ export declare interface LifecycleApp { * Called back when an ability enters the ACTIVE state. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -310,7 +311,7 @@ export declare interface LifecycleApp { * Called when the launch mode of an ability is set to singleton. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param want Indicates the new {@code want} containing information about the ability. * @return - * @FAModelOnly @@ -322,7 +323,7 @@ export declare interface LifecycleApp { * background and there is no enough memory for running as many background processes as possible. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param level Indicates the memory trim level, which shows the current memory usage status. * @return - * @FAModelOnly @@ -335,7 +336,7 @@ export declare interface LifecycleApp { * * @name LifecycleService * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAMode + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ export declare interface LifecycleService { @@ -344,7 +345,7 @@ export declare interface LifecycleService { * an ability). * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -354,7 +355,7 @@ export declare interface LifecycleService { * Called back when Service is started. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param want Indicates the want of Service to start. * @param startId Indicates the number of times the Service ability has been started. The {@code startId} is * incremented by 1 every time the ability is started. For example, if the ability has been started @@ -368,7 +369,7 @@ export declare interface LifecycleService { * Called back before an ability is destroyed. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -378,7 +379,7 @@ export declare interface LifecycleService { * Called back when a Service ability is first connected to an ability. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param want Indicates connection information about the Service ability. * @return Returns the proxy of the Service ability. * @FAModelOnly @@ -389,7 +390,7 @@ export declare interface LifecycleService { * Called back when all abilities connected to a Service ability are disconnected. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param want Indicates disconnection information about the Service ability. * @return - * @FAModelOnly @@ -404,7 +405,7 @@ export declare interface LifecycleService { * called but {@link #terminateSelf} has not.

* * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param want Indicates the want of the Service ability being connected. * @return - * @FAModelOnly @@ -417,7 +418,7 @@ export declare interface LifecycleService { * * @name LifecycleData * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAMode + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ export declare interface LifecycleData { @@ -425,7 +426,7 @@ export declare interface LifecycleData { * Updates one or more data records in the database. This method should be implemented by a Data ability. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the database table storing the data to update. * @param valueBucket Indicates the data to update. This parameter can be null. * @param predicates Indicates filter criteria. If this parameter is null, all data records will be updated by @@ -441,7 +442,7 @@ export declare interface LifecycleData { * Queries one or more data records in the database. This method should be implemented by a Data ability. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the database table storing the data to query. * @param columns Indicates the columns to be queried, in array, for example, {"name","age"}. You should define * the processing logic when this parameter is null. @@ -458,7 +459,7 @@ export declare interface LifecycleData { * Deletes one or more data records. This method should be implemented by a Data ability. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the database table storing the data to delete. * @param predicates Indicates filter criteria. If this parameter is null, all data records will be deleted by * default. @@ -475,7 +476,7 @@ export declare interface LifecycleData { * even if the context has changed. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the uri to normalize. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. @@ -488,7 +489,7 @@ export declare interface LifecycleData { * Inserts multiple data records into the database. This method should be implemented by a Data ability. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the position where the data is to insert. * @param valueBuckets Indicates the data to insert. * @param callback function specified by framework to receive the result, developer should call this function to @@ -503,7 +504,7 @@ export declare interface LifecycleData { * The default implementation of this method returns the original uri passed to it. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the uri to denormalize. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. @@ -516,7 +517,7 @@ export declare interface LifecycleData { * Inserts a data record into the database. This method should be implemented by a Data ability. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the position where the data is to insert. * @param valueBucket Indicates the data to insert. * @param callback function specified by framework to receive the result, developer should call this function to @@ -530,7 +531,7 @@ export declare interface LifecycleData { * Opens a file. This method should be implemented by a Data ability. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of the file to open. * @param mode Indicates the open mode, which can be "r" for read-only access, "w" for write-only access (erasing * whatever data is currently in the file), "wt" for write access that truncates any existing file, @@ -547,7 +548,7 @@ export declare interface LifecycleData { * Obtains the MIME type of files. This method should be implemented by a Data ability. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of the files to obtain. * @param mimeTypeFilter Indicates the MIME type of the files to obtain. This parameter cannot be set to {@code * null}. @@ -565,7 +566,7 @@ export declare interface LifecycleData { * Called to carry {@code AbilityInfo} to this ability after the ability is initialized. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param info Indicates the {@code AbilityInfo} object containing information about this ability. * @return - * @FAModelOnly @@ -579,12 +580,40 @@ export declare interface LifecycleData { *

Data abilities supports general data types, including text, HTML, and JPEG.

* * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the uri of the data. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. * @return - * @FAModelOnly */ - getType?(uri: string, callback: AsyncCallback): void; + getType?(uri: string, callback: AsyncCallback): void; + + /** + * Performs batch operations on the database. This method should be implemented by a Data ability. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param ops Indicates the data operation list, which can contain multiple operations on the database. + * @param callback function specified by framework to receive the result, developer should call this function to + * return the result to framework. + * @return - + * @FAModelOnly + */ + executeBatch?(ops: Array, callback: AsyncCallback>): void; + + /** + * Defines a method in this Data ability (implementation depending on child classes). + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param method Indicates the method name. + * @param arg Indicates the parameter transferred by the method. + * @param extras Indicates the parameter transferred by the method. + * @param callback function specified by framework to receive the result, developer should call this function to + * return the result to framework. + * @return - + * @FAModelOnly + */ + call?(method: string, arg: string, extras: PacMap, callback: AsyncCallback): void; } diff --git a/api/@internal/global.d.ts b/api/@internal/global.d.ts index 03bc8cc2bc561c9b8c8cc51c0f1fff31acdb9a0e..7a0ea78e3f47a74af869afde8a1a7e1db2cadba4 100644 --- a/api/@internal/global.d.ts +++ b/api/@internal/global.d.ts @@ -13,66 +13,148 @@ * limitations under the License. */ +/// + +import { TouchObject, KeyEvent, MouseEvent } from 'SpecialEvent'; + +/** + * Defines the console info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ export declare class console { + /** + * Prints "debug" logs. + * @param message Text to print. + * @since 7 + */ static debug(message: string, ...arguments: any[]): void; + + /** + * Prints "log" logs. + * @param message Text to print. + * @since 7 + */ static log(message: string, ...arguments: any[]): void; + + /** + * Prints "info" logs. + * @param message Text to print. + * @since 7 + */ static info(message: string, ...arguments: any[]): void; + + /** + * Prints "warn" logs. + * @param message Text to print. + * @since 7 + */ static warn(message: string, ...arguments: any[]): void; + + /** + * Prints "error" logs. + * @param message Text to print. + * @since 7 + */ static error(message: string, ...arguments: any[]): void; } -export interface Result { - code: number; - data: object; -} -export interface SubscribeMessageResponse { - deviceId: string; - bundleName: string; - abilityName: string; - message: string; -} -export interface CallAbilityParam { - bundleName: string; - abilityName: string; - messageCode: number; - abilityType: number; - data?: object; - syncOption?: number; -} -export interface SubscribeAbilityEventParam { - bundleName: string; - abilityName: string; - messageCode: number; - abilityType: number; - syncOption?: number; -} -export interface SendMessageOptions { - deviceId: string; - bundleName: string; - abilityName: string; - message?: string; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface SubscribeMessageOptions { - success?: (data: SubscribeMessageResponse) => void; - fail?: (data: string, code: number) => void; -} -export declare class FeatureAbility { - static callAbility(param: CallAbilityParam): Promise; - static subscribeAbilityEvent( - param: SubscribeAbilityEventParam, - func: Function - ): Promise; - static unsubscribeAbilityEvent( - param: SubscribeAbilityEventParam - ): Promise; - static sendMsg(options: SendMessageOptions): void; - static subscribeMsg(options: SubscribeMessageOptions): void; - static unsubscribeMsg(): void; -} + +/** + * Sets the interval for repeatedly calling a function. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param handler Indicates the function to be called after the timer goes off. For devices of "tv", "phone, tablet", and "wearable" types, this parameter can be a function or string. For devices of "lite wearable" and "smartVision" types, this parameter must be a function. + * @param delay Indicates the interval between each two calls, in milliseconds. The function will be called after this delay. + * @param arguments Indicates additional arguments to pass to "handler" when the timer goes off. + * @returns Returns the timer ID. + * @since 7 + */ export declare function setInterval(handler: Function | string, delay: number, ...arguments: any[]): number; + +/** + * Sets a timer after which a function will be executed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param handler Indicates the function to be called after the timer goes off. For devices of "tv", "phone, tablet", and "wearable" types, this parameter can be a function or string. For devices of "lite wearable" and "smartVision" types, this parameter must be a function. + * @param delay Indicates the delay (in milliseconds) after which the function will be called. If this parameter is left empty, default value "0" will be used, which means that the function will be called immediately or as soon as possible. + * @param arguments Indicates additional arguments to pass to "handler" when the timer goes off. + * @returns Returns the timer ID. + * @since 7 + */ export declare function setTimeout(handler: Function | string, delay?: number, ...arguments: any[]): number; + +/** + * Cancels the interval set by " setInterval()". + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param intervalID Indicates the timer ID returned by "setInterval()". + * @since 7 + */ export declare function clearInterval(intervalID?: number): void; + +/** + * Cancels the timer set by "setTimeout()". + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param timeoutID Indicates the timer ID returned by "setTimeout()". + * @since 7 + */ export declare function clearTimeout(timeoutID?: number): void; -export declare function createLocalParticleAbility(timeoutID?: number): any; + +/** + * Defining syscap function. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +export declare function canIUse(syscap: string): boolean; + +/** + * Obtains all attributes of the component with the specified ID. + * @param id ID of the component whose attributes are to be obtained. + * @since 8 + * @systemapi + * @test + */ +export declare function getInspectorByKey(id: string): string; + + /** + * Get components tree. + * @since 8 + * @systemapi + * @test + */ +export declare function getInspectorTree(): string; + + /** + * Sends an event to the component with the specified ID. + * @param id ID of the component for which the event is to be sent. + * @param action Type of the event to be sent. The options are as follows: Click event: 10 LongClick: 11. + * @param params Event parameters. If there is no parameter, pass an empty string "". + * @since 8 + * @systemapi + * @test + */ +export declare function sendEventByKey(id: string, action: number, params: string): boolean; + + /** + * Send touch event. + * @param event TouchObject to be sent. + * @since 8 + * @systemapi + * @test + */ +export declare function sendTouchEvent(event: TouchObject): boolean; + + /** + * Send key event. + * @param event KeyEvent to be sent. + * @since 8 + * @systemapi + * @test + */ +export declare function sendKeyEvent(event: KeyEvent): boolean; + + /** + * Send mouse event. + * @param event MouseEvent to be sent. + * @since 8 + * @systemapi + * @test + */ +export declare function sendMouseEvent(event: MouseEvent): boolean; diff --git a/api/@ohos.ability.dataUriUtils.d.ts b/api/@ohos.ability.dataUriUtils.d.ts index 3b978c07dd07085802a6f2f46ad3ebc2f4ba35c6..af7b6805001a1b4a9e70bf5b40afc7b81447ba2e 100644 --- a/api/@ohos.ability.dataUriUtils.d.ts +++ b/api/@ohos.ability.dataUriUtils.d.ts @@ -25,7 +25,7 @@ declare namespace dataUriUtils { * Obtains the ID attached to the end of the path component of the given uri. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param uri Indicates the uri object from which the ID is to be obtained. * @return Returns the ID attached to the end of the path component; */ @@ -35,7 +35,7 @@ declare namespace dataUriUtils { * Attaches the given ID to the end of the path component of the given uri. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param uri Indicates the uri string from which the ID is to be obtained. * @param id Indicates the ID to attach. * @return Returns the uri object with the given ID attached. @@ -46,7 +46,7 @@ declare namespace dataUriUtils { * Deletes the ID from the end of the path component of the given uri. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param uri Indicates the uri object from which the ID is to be deleted. * @return Returns the uri object with the ID deleted. */ @@ -56,7 +56,7 @@ declare namespace dataUriUtils { * Updates the ID in the specified uri * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param uri Indicates the uri object to be updated. * @param id Indicates the new ID. * @return Returns the updated uri object. diff --git a/api/liteWearable/@system.configuration.d.ts b/api/@ohos.ability.errorCode.d.ts similarity index 46% rename from api/liteWearable/@system.configuration.d.ts rename to api/@ohos.ability.errorCode.d.ts index 1d774e43b2d3560328038a2fc7183458ac8cdace..155f039766c9f43e869df44ef695970b524b57f8 100644 --- a/api/liteWearable/@system.configuration.d.ts +++ b/api/@ohos.ability.errorCode.d.ts @@ -1,46 +1,49 @@ -/* - * Copyright (c) 2020 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. - */ - -export interface LocaleResponse { - /** - * Current language of the application. Example: zh. - * @since 3 - */ - language: string; - - /** - * Country or region. Example: CN - * @since 3 - */ - countryOrRegion: string; - - /** - * Text layout direction. Available values are as follows: - * 1. ltr: The text direction is from left to right. - * 2. rtl: The text direction is from right to left. - * @since 3 - */ - dir: "ltr" | "rtl"; -} - -/** - * @Syscap SysCap.ACE.UIEngineLite - */ -export default class Configuration { - /** - * Obtains the current locale of the application, which is the same as the system locale. - */ - static getLocale(): LocaleResponse; -} +/* + * Copyright (c) 2022 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. + */ + + /** + * Defines error codes used when starting an ability, for example, featureAbility.ErrorCode.NO_ERROR. + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ +export enum ErrorCode { + /** + * Permission denied. + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + PERMISSION_DENY = -3, + + /** + * Ability not found. + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + ABILITY_NOT_FOUND = -2, + + /** + * Invalid parameter. + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + INVALID_PARAMETER = -1, + + /** + * No error. + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + NO_ERROR = 0 +} diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index 20b110239b55fe400e17329733f831436d8af0b6..cff1e71e38cf847f3e8f11c7cbcbadebd8675666 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -13,19 +13,20 @@ * limitations under the License. */ import { AsyncCallback } from './basic'; +import { Callback } from './basic'; import { Want } from './ability/want'; import { StartAbilityParameter } from './ability/startAbilityParameter'; import { AbilityResult } from './ability/abilityResult'; import { Context } from './app/context'; import { DataAbilityHelper } from './ability/dataAbilityHelper'; import { ConnectOptions } from './ability/connectOptions'; -import { ContinueAbilityOptions } from './ability/continueAbilityOptions'; +import window from './@ohos.window'; /** * A Feature Ability represents an ability with a UI and is designed to interact with users. * @name featureAbility * @since 6 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @permission N/A * @FAModelOnly */ @@ -34,7 +35,7 @@ declare namespace featureAbility { * Obtain the want sended from the source ability. * * @since 6 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param parameter Indicates the ability to start. * @return - * @FAModelOnly @@ -46,7 +47,7 @@ declare namespace featureAbility { * Starts a new ability. * * @since 6 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param parameter Indicates the ability to start. * @return - * @FAModelOnly @@ -57,7 +58,7 @@ declare namespace featureAbility { /** * Obtains the application context. * - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @return Returns the application context. * @since 6 * @FAModelOnly @@ -68,7 +69,7 @@ declare namespace featureAbility { * Starts an ability and returns the execution result when the ability is destroyed. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param parameter Indicates the ability to start. * @return Returns the {@link AbilityResult}. * @FAModelOnly @@ -81,7 +82,7 @@ declare namespace featureAbility { * and destroys this Page ability. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param parameter Indicates the result to return. * @return - * @FAModelOnly @@ -93,7 +94,7 @@ declare namespace featureAbility { * Destroys this Page ability. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -104,7 +105,7 @@ declare namespace featureAbility { * Obtains the dataAbilityHelper. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of the file to open. * @return Returns the dataAbilityHelper. * @FAModelOnly @@ -115,7 +116,7 @@ declare namespace featureAbility { * Checks whether the main window of this ability has window focus. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @return Returns {@code true} if this ability currently has window focus; returns {@code false} otherwise. * @FAModelOnly */ @@ -126,7 +127,7 @@ declare namespace featureAbility { * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. * @default - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param request The element name of the service ability * @param options The remote object instance * @return Returns the number code of the ability connected @@ -138,7 +139,7 @@ declare namespace featureAbility { * The callback interface was connect successfully. * @default - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param connection The number code of the ability connected * @FAModelOnly */ @@ -146,16 +147,23 @@ declare namespace featureAbility { function disconnectAbility(connection: number): Promise; /** - * Migrates this ability to the given device on the same distributed network. - * @default - + * Obtains the window corresponding to the current ability. + * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel - * @return - + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @return Returns the window corresponding to the current ability. * @FAModelOnly */ - function continueAbility(options: ContinueAbilityOptions, callback: AsyncCallback): void; - function continueAbility(options: ContinueAbilityOptions): Promise; + function getWindow(callback: AsyncCallback): void; + function getWindow(): Promise; + /** + * Obtain the window configuration. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ export enum AbilityWindowConfiguration { WINDOW_MODE_UNDEFINED = 0, WINDOW_MODE_FULLSCREEN = 1, @@ -164,12 +172,26 @@ declare namespace featureAbility { WINDOW_MODE_FLOATING = 102 } + /** + * Obtain the window properties. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ export enum AbilityStartSetting { BOUNDS_KEY = "abilityBounds", WINDOW_MODE_KEY = "windowMode", DISPLAY_ID_KEY = "displayId" } + /** + * Obtain the errorCode. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ export enum ErrorCode { NO_ERROR = 0, INVALID_PARAMETER = -1, @@ -177,6 +199,13 @@ declare namespace featureAbility { PERMISSION_DENY = -3 } + /** + * Indicates the operation type of data. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ export enum DataAbilityOperationType { TYPE_INSERT = 1, TYPE_UPDATE = 2, diff --git a/api/@ohos.ability.particleAbility.d.ts b/api/@ohos.ability.particleAbility.d.ts index fc367272ac775fa8a3e00bb24b67072e7b85b86e..1b9a85b641c88372412a9b9334e160a2b21b568d 100644 --- a/api/@ohos.ability.particleAbility.d.ts +++ b/api/@ohos.ability.particleAbility.d.ts @@ -17,12 +17,14 @@ import { AsyncCallback } from './basic'; import { StartAbilityParameter } from './ability/startAbilityParameter'; import { DataAbilityHelper } from './ability/dataAbilityHelper'; import { NotificationRequest } from './notification/notificationRequest'; +import { ConnectOptions } from './ability/connectOptions'; +import { Want } from './ability/want'; /** * A Particle Ability represents an ability with service. * @name particleAbility * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @permission N/A * @FAModelOnly */ @@ -31,7 +33,7 @@ declare namespace particleAbility { * Service ability uses this method to start a specific ability. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param parameter Indicates the ability to start. * @return - * @FAModelOnly @@ -43,7 +45,7 @@ declare namespace particleAbility { * Destroys this service ability. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -54,7 +56,7 @@ declare namespace particleAbility { * Obtains the dataAbilityHelper. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of the file to open. * @return Returns the dataAbilityHelper. * @FAModelOnly @@ -85,5 +87,38 @@ declare namespace particleAbility { */ function cancelBackgroundRunning(callback: AsyncCallback): void; function cancelBackgroundRunning(): Promise; + + /** + * Connects an ability to a Service ability. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param request Indicates the Service ability to connect. + * @param options Callback object for the client. If this parameter is null, an exception is thrown. + * @return unique identifier of the connection between the client and the service side. + * @FAModelOnly + */ + function connectAbility(request: Want, options:ConnectOptions): number; + + /** + * Disconnects ability to a Service ability. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param connection the connection id returned from connectAbility api. + * @FAModelOnly + */ + function disconnectAbility(connection: number, callback:AsyncCallback): void; + function disconnectAbility(connection: number): Promise; + + /** + * Obtain the errorCode. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ + export enum ErrorCode { + INVALID_PARAMETER = -1 + } } export default particleAbility; diff --git a/api/@ohos.ability.wantConstant.d.ts b/api/@ohos.ability.wantConstant.d.ts index a0483c0095fcfbf5e8e4f9234deda55e593836a7..c571dbe255c2b868adb3d6762b81be8748782882 100644 --- a/api/@ohos.ability.wantConstant.d.ts +++ b/api/@ohos.ability.wantConstant.d.ts @@ -17,7 +17,7 @@ * the constant for action and entity in the want * @name wantConstant * @since 6 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @permission N/A */ declare namespace wantConstant { @@ -25,14 +25,14 @@ declare namespace wantConstant { * the constant for action of the want * @name Action * @since 6 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @permission N/A */ export enum Action { /** * Indicates the action of backing home. * - * @since 1 + * @since 6 */ ACTION_HOME = "ohos.want.action.home", @@ -221,7 +221,7 @@ declare namespace wantConstant { * the constant for Entity of the want * @name Action * @since 6 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @permission N/A */ export enum Entity { @@ -293,14 +293,14 @@ declare namespace wantConstant { /** * Indicates the grant for possible persisting on the URI. * - * @hide + * @systemapi Hide this for inner system use. */ FLAG_AUTH_PERSISTABLE_URI_PERMISSION = 0x00000040, /** * Returns the result to the source ability slice. * - * @hide + * @systemapi Hide this for inner system use. */ FLAG_AUTH_PREFIX_URI_PERMISSION = 0x00000080, @@ -318,7 +318,7 @@ declare namespace wantConstant { /** * Indicates the continuation is reversible. * - * @hide + * @systemapi Hide this for inner system use. */ FLAG_ABILITY_CONTINUATION_REVERSIBLE = 0x00000400, diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index 687c3262004ee7f363ca1507301db69c1541b76d..a7e2c44790375f5978fe8ae1ac1621d3f6c7463a 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -45,7 +45,7 @@ import { AsyncCallback } from "./basic"; * @param tokenID The tokenId of specified application. * @param permissionName The permission name to be granted. * @param permissionFlag Flag of permission state. - * @oermission ohos.permission.GRANT_SENSITIVE_PERMISSIONS. + * @permission ohos.permission.GRANT_SENSITIVE_PERMISSIONS. * @systemapi hid this for inner system use * @since 8 */ @@ -57,7 +57,7 @@ import { AsyncCallback } from "./basic"; * @param tokenID The tokenId of specified application. * @param permissionName The permission name to be revoked. * @param permissionFlag Flag of permission state. - * @oermission ohos.permission.REVOKE_SENSITIVE_PERMISSIONS. + * @permission ohos.permission.REVOKE_SENSITIVE_PERMISSIONS. * @systemapi hid this for inner system use * @since 8 */ @@ -69,7 +69,7 @@ import { AsyncCallback } from "./basic"; * @param tokenID The tokenId of specified application. * @param permissionName The permission name to be granted. * @return Return permission flag. - * @oermission ohos.permission.GET_SENSITIVE_PERMISSIONS/ohos.permission.GRANT_SENSITIVE_PERMISSIONS/ohos.permission.REVOKE_SENSITIVE_PERMISSIONS. + * @permission ohos.permission.GET_SENSITIVE_PERMISSIONS or ohos.permission.GRANT_SENSITIVE_PERMISSIONS or ohos.permission.REVOKE_SENSITIVE_PERMISSIONS. * @systemapi hid this for inner system use * @since 8 */ diff --git a/api/@ohos.accessibility.d.ts b/api/@ohos.accessibility.d.ts index b834ba05db6f92839c5d7bd559302b63988f8284..40faa01613bfa210110ca4338d4fa38168c9a222 100644 --- a/api/@ohos.accessibility.d.ts +++ b/api/@ohos.accessibility.d.ts @@ -15,27 +15,26 @@ import { AsyncCallback } from './basic'; import { Callback } from './basic'; -import { AbilityInfo } from './bundle/abilityInfo'; /** * Accessibility * @name Accessibility * @since 7 - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @import basic,abilityInfo */ declare namespace accessibility { /** * The type of the Ability app. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type AbilityType = 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual'; /** * The action that the ability can execute. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type Action = 'accessibilityFocus' | 'clearAccessibilityFocus' | 'focus' | 'clearFocus' | 'clearSelection' | @@ -50,7 +49,7 @@ declare namespace accessibility { * @note announcement * @note notificationChange * @note textTraversedAtMove - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type EventType = 'accessibilityFocus' | 'accessibilityFocusClear' | @@ -60,14 +59,14 @@ declare namespace accessibility { /** * The change type of the windowsChange event. * @note It's used when received the {@code windowsChange} event. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type WindowUpdateType = 'add' | 'remove' | 'bounds' | 'active' | 'focus'; /** * The type of the ability state. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type AbilityState = 'enable' | 'disable' | 'install'; @@ -80,7 +79,7 @@ declare namespace accessibility { * windowContent: Describes the capability to search for the content of the active window. * filterKeyEvents: Describes the capability to request to filter key events. * fingerprintGesture: Describes the capability to request to fingerprint gesture. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type Capability = 'retrieve' | 'touchGuide' | 'keyEventObserver' | 'zoom' | 'gesture'; @@ -88,7 +87,7 @@ declare namespace accessibility { /** * The granularity of text move. * @note The granularity of text move. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type TextMoveUnit = 'char' | 'word' | 'line' | 'page' | 'paragraph'; @@ -97,7 +96,7 @@ declare namespace accessibility { * Checks whether accessibility ability is enabled. * @since 7 * @param callback Asynchronous callback interface. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise. */ function isOpenAccessibility(callback: AsyncCallback): void; @@ -107,7 +106,7 @@ declare namespace accessibility { * Checks touch browser ability (which is used by talkback) is enabled. * @since 7 * @param callback Asynchronous callback interface. - * @syscap SystemCapability.Barrierfree.Accessibility.Vision + * @syscap SystemCapability.BarrierFree.Accessibility.Vision * @return Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise. */ function isOpenTouchGuide(callback: AsyncCallback): void; @@ -118,7 +117,7 @@ declare namespace accessibility { * @since 7 * @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken * @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns the list of abilityInfos. */ function getAbilityLists(abilityType: AbilityType, stateType: AbilityState, @@ -131,7 +130,7 @@ declare namespace accessibility { * @since 7 * @param event The object of the accessibility {@code EventInfo} . * @param callback Asynchronous callback interface. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if success ; returns {@code false} otherwise. */ function sendEvent(event: EventInfo, callback: AsyncCallback): void; @@ -142,7 +141,7 @@ declare namespace accessibility { * @since 7 * @param type state event type. * @param callback Asynchronous callback interface. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. */ function on(type: 'accessibilityStateChange', callback: Callback): void; @@ -152,7 +151,7 @@ declare namespace accessibility { * @since 7 * @param type state event type. * @param callback Asynchronous callback interface. - * @syscap SystemCapability.Barrierfree.Accessibility.Vision + * @syscap SystemCapability.BarrierFree.Accessibility.Vision * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. */ function on(type: 'touchGuideStateChange', callback: Callback): void; @@ -162,7 +161,7 @@ declare namespace accessibility { * @since 7 * @param type state event type * @param callback Asynchronous callback interface. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. */ function off(type: 'accessibilityStateChange', callback?: Callback): void; @@ -178,7 +177,7 @@ declare namespace accessibility { /** * Get the captions manager. - * @syscap SystemCapability.Barrierfree.Accessibility.Hearing + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing * @since 8 * @return Returns the captions manager. */ @@ -186,7 +185,7 @@ declare namespace accessibility { /** * Indicates the captions manager. - * @syscap SystemCapability.Barrierfree.Accessibility.Hearing + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing * @since 8 */ interface CaptionsManager { @@ -219,20 +218,20 @@ declare namespace accessibility { /** * Indicates the edge type of the captions font. - * @syscap SystemCapability.Barrierfree.Accessibility.Hearing + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing * @since 8 */ type CaptionsFontEdgeType = 'none' | 'raised' | 'depressed' | 'uniform' | 'dropShadow'; /** * Indicates the font family of captions. - * @syscap SystemCapability.Barrierfree.Accessibility.Hearing + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing * @since 8 */ type CaptionsFontFamily = 'default' | 'monospacedSerif' | 'serif' | 'monospacedSansSerif' | 'sansSerif' | 'casual' | 'cursive' | 'smallCapitals'; /** * Indicates the style of captions. - * @syscap SystemCapability.Barrierfree.Accessibility.Hearing + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing * @since 8 */ interface CaptionsStyle { @@ -264,7 +263,7 @@ declare namespace accessibility { /** * Indicates the info of accessibility. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ interface AccessibilityAbilityInfo { @@ -312,7 +311,7 @@ declare namespace accessibility { /** * Indicates the info of events. - * @syscap SystemCapability.Barrierfree.Accessibility.Core + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ class EventInfo { diff --git a/api/@ohos.account.appAccount.d.ts b/api/@ohos.account.appAccount.d.ts index a08f33eac576ebfa78272b0e913b12dacecb679f..e06cb620e2b4dacc6da6c95eef31dba1c8b7206c 100644 --- a/api/@ohos.account.appAccount.d.ts +++ b/api/@ohos.account.appAccount.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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 @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback} from "./basic"; +import {AsyncCallback, Callback} from "./basic"; import {Want} from "./ability/want"; /** @@ -194,7 +194,7 @@ declare namespace appAccount { * * @since 7 * @return Returns a list of application accounts. - * @permission ohos.permission.GET_ACCOUNTS_PRIVILEGED. + * @permission ohos.permission.GET_ALL_APP_ACCOUNTS. */ getAllAccessibleAccounts(callback: AsyncCallback>): void; getAllAccessibleAccounts(): Promise>; @@ -212,7 +212,7 @@ declare namespace appAccount { * @since 7 * @param owner Indicates the account owner of your application or third-party applications. * @return Returns a list of application accounts. - * @permission ohos.permission.GET_ACCOUNTS_PRIVILEGED. + * @permission ohos.permission.GET_ALL_APP_ACCOUNTS. */ getAllAccounts(owner: string, callback: AsyncCallback>): void; getAllAccounts(owner: string): Promise>; @@ -269,7 +269,7 @@ declare namespace appAccount { * @since 7 * @return void */ - off(type: 'change', callback?: Callback): void; + off(type: 'change', callback?: Callback>): void; /** * Authenticates an application account to get an oauth token. @@ -326,7 +326,7 @@ declare namespace appAccount { deleteOAuthToken(name: string, owner: string, authType: string, token: string): Promise; /** - * Sets the oauth token visibility of the specifed authentication type to a third-party application. + * Sets the oauth token visibility of the specified authentication type to a third-party application. *

* Only the owner of the application account has the permission to call this method. * @@ -341,7 +341,7 @@ declare namespace appAccount { setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean): Promise; /** - * Checks the oauth token visibility of the specifed authentication type for a third-party application. + * Checks the oauth token visibility of the specified authentication type for a third-party application. *

* Only the owner of the application account has the permission to call this method. * diff --git a/api/@ohos.account.distributedAccount.d.ts b/api/@ohos.account.distributedAccount.d.ts index 33ba7f02e20789e9f61c298cf7834330eba5caef..ae809f7f65391286b6b70347c0f596fe43235370 100644 --- a/api/@ohos.account.distributedAccount.d.ts +++ b/api/@ohos.account.distributedAccount.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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 @@ -45,7 +45,7 @@ declare namespace distributedAccount { * * @since 7 * @return The distributed information of the current OS account. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.DISTRIBUTED_DATASYNC */ queryOsAccountDistributedInfo(callback: AsyncCallback): void; queryOsAccountDistributedInfo(): Promise; diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 9229e35f59653bda9ede893ff9f339062254852a..a69c788d46cb80c7cf8d3ac7d4fa054ceb658125 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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,7 @@ */ import distributedAccount from './@ohos.account.distributedAccount' -import {AsyncCallback} from "./basic"; +import {AsyncCallback, Callback} from "./basic"; /** * This module provides the capability to manage os accounts. @@ -64,12 +64,12 @@ declare namespace osAccount { isMultiOsAccountEnable(): Promise; /** - * Checks whether an OS account is actived based on its local ID. + * Checks whether an OS account is activated based on its local ID. * * @since 7 * @param localId Indicates the local ID of the OS account. - * @return Returns {@code true} if the OS account is actived; returns {@code false} otherwise. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS/ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @return Returns {@code true} if the OS account is activated; returns {@code false} otherwise. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS */ isOsAccountActived(localId: number, callback: AsyncCallback): void; isOsAccountActived(localId: number): Promise; @@ -121,7 +121,7 @@ declare namespace osAccount { * @param localId Indicates the local ID of the OS account. * @return Returns {@code true} if the OS account has been verified successfully; * returns {@code false} otherwise. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS/ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. */ isOsAccountVerified(localId: number, callback: AsyncCallback): void; isOsAccountVerified(localId?: number): Promise; @@ -169,6 +169,7 @@ declare namespace osAccount { * @param localId Indicates the local ID of the OS account. * @param localName Indicates the local name to set for the OS account. * @return void. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. * @systemapi Hide this for inner system use. */ setOsAccountName(localId: number, localName: string, callback: AsyncCallback): void; @@ -241,6 +242,7 @@ declare namespace osAccount { * @since 7 * @return Returns a list of OS accounts. * @systemapi Hide this for inner system use. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. */ queryAllCreatedOsAccounts(callback: AsyncCallback>): void; queryAllCreatedOsAccounts(): Promise>; @@ -298,7 +300,7 @@ declare namespace osAccount { * @since 7 * @param localId Indicates the local ID of the OS account. * @return Returns the OS account information; returns {@code null} if the query fails. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS/ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION. * @systemapi Hide this for inner system use. */ queryOsAccountById(localId: number, callback: AsyncCallback): void; @@ -325,7 +327,7 @@ declare namespace osAccount { * * @since 7 * @return Returns the DVID if obtained; returns an empty string if no OHOS account has logged in. - * @permission ohos.permission.DISTRIBUTED_DATASYNC. + * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS */ getDistributedVirtualDeviceId(callback: AsyncCallback): void; getDistributedVirtualDeviceId(): Promise; @@ -466,7 +468,7 @@ declare namespace osAccount { serialNumber: number; /** - * Os account is actived or not. + * Os account is activated or not. * @since 8 */ isActived: boolean; diff --git a/api/@ohos.animator.d.ts b/api/@ohos.animator.d.ts index 2f306abcc6f27540380af20e75ef2238c5f37250..3f4360181c446781c2a3284436bcfc7dc5f5265a 100644 --- a/api/@ohos.animator.d.ts +++ b/api/@ohos.animator.d.ts @@ -14,14 +14,14 @@ */ /** - * @devices phone, tablet, wearable, tv, car + * Defines the animator options. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ export interface AnimatorOptions { /** * Duration of the animation, in milliseconds. * The default value is 0. - * @devices phone, tablet, wearable, tv, car * @since 6 */ duration: number; @@ -44,7 +44,6 @@ export interface AnimatorOptions { * cubic-bezier(x1, y1, x2, y2) You can customize an animation speed curve in the cubic-bezier() function. The x and y values of each input parameter must be between 0 and 1. * Step curve. The number must be set and only an integer is supported, step-position is optional. It can be set to start or end. The default value is end. * The default value is ease. - * @devices phone, tablet, wearable, tv, car * @since 6 */ easing: string; @@ -52,7 +51,6 @@ export interface AnimatorOptions { /** * Delay for the animation start. The default value indicates no delay. * The default value is 0. - * @devices phone, tablet, wearable, tv, car * @since 6 */ delay: number; @@ -61,7 +59,6 @@ export interface AnimatorOptions { * Whether to resume to the initial state after the animation is executed. * none: The initial state is restored after the animation is executed. * forwards: The state at the end of the animation (defined in the last key frame) is retained after the animation is executed. - * @devices phone, tablet, wearable, tv, car * @since 6 */ fill: "none" | "forwards" | "backwards" | "both"; @@ -69,7 +66,6 @@ export interface AnimatorOptions { /** * The animation playback mode. * The default value is "normal". - * @devices phone, tablet, wearable, tv, car * @since 6 */ direction: "normal" | "reverse" | "alternate" | "alternate-reverse"; @@ -77,7 +73,6 @@ export interface AnimatorOptions { /** * Number of times the animation will be played. number indicates a fixed number of playback operations, and -1 an unlimited number of playback operations. * The default value is 1. - * @devices phone, tablet, wearable, tv, car * @since 6 */ iterations: number; @@ -85,7 +80,6 @@ export interface AnimatorOptions { /** * Starting point of animator interpolation. * The default value is 0. - * @devices phone, tablet, wearable, tv, car * @since 6 */ begin: number; @@ -93,77 +87,74 @@ export interface AnimatorOptions { /** * Ending point of Dynamic Interpolation * The default value is 1. - * @devices phone, tablet, wearable, tv, car * @since 6 */ end: number; } +/** + * Defines the Animator result interface. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 6 + */ export interface AnimatorResult { /** * Update the options for current animator. * @param options Options. + * @since 6 */ update(options: AnimatorOptions): void; /** * Starts the animation. - * @devices phone, tablet, wearable, tv, car * @since 6 */ play(): void; /** * Ends the animation. - * @devices phone, tablet, wearable, tv, car * @since 6 */ finish(): void; /** * Pauses the animation. - * @devices phone, tablet, wearable, tv, car * @since 6 */ pause(): void; /** * Cancels the animation. - * @devices phone, tablet, wearable, tv, car * @since 6 */ cancel(): void; /** * Plays the animation in reverse direction. - * @devices phone, tablet, wearable, tv, car * @since 6 */ reverse(): void; /** * Trigger when vsync callback. * @param progress The current progress of animtion - * @devices phone, tablet, wearable, tv, car * @since 6 */ onframe: (progress: number) => void; /** * The animation is finished. - * @devices phone, tablet, wearable, tv, car * @since 6 */ onfinish: () => void; /** * The animation is canceled. - * @devices phone, tablet, wearable, tv, car * @since 6 */ oncancel: () => void; /** * The animation is repeated. - * @devices phone, tablet, wearable, tv, car * @since 6 */ onrepeat: () => void; } /** - * @devices phone, tablet, wearable, tv, car + * Defines the Animator class. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 * @import prompt from '@ohos.animator'; */ @@ -171,7 +162,6 @@ export default class Animator { /** * Create an animator object for custum animation. * @param options Options. - * @devices phone, tablet, wearable, tv, car * @since 6 */ static createAnimator(options: AnimatorOptions): AnimatorResult; diff --git a/api/@ohos.app.abilityManager.d.ts b/api/@ohos.app.abilityManager.d.ts deleted file mode 100644 index 9b430de3ca7765df86929782bae19ee36ffc4cc4..0000000000000000000000000000000000000000 --- a/api/@ohos.app.abilityManager.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { AsyncCallback } from './basic'; -import { AbilityMissionInfo } from './app/abilityMissionInfo'; -import { ActiveProcessInfo } from './app/activeProcessInfo'; -import { MissionSnapshot } from './app/missionSnapshot'; - -/** - * This module provides the capability to manage abilities and obtaining system task information. - * - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core - * @import import abilityManager from '@ohos.app.abilityManager' - * @permission N/A - */ -declare namespace abilityManager { - - enum ProcessErrCode { - NO_ERROR = 0, - CRASHED, - NO_RESPONSE, - } - - - /** - * Get information about running processes - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core - * @return a list of ActiveProcessInfo records describing each process. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION - * @systemapi hide this for inner system use - */ - function getActiveProcessInfos(): Promise>; - function getActiveProcessInfos(callback: AsyncCallback>): void; - - /** - * Get information about the running ability missions - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core - * @param upperLimit The maximum number of mission infos to return in the array. - * @return an array of AbilityMissionInfo records describing each active mission. - * @permission ohos.permission.ACCESS_MISSIONS - * @systemapi hide this for inner system use - */ - function getActiveAbilityMissionInfos(upperLimit: number): Promise>; - function getActiveAbilityMissionInfos(upperLimit: number, callback: AsyncCallback>): void; - - /** - * Get information about recently run missions - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core - * @param upperLimit The maximum number of previous mission infos to return in the array. - * @return an array of AbilityMissionInfo records describing each of the previous mission. - * @permission ohos.permission.ACCESS_MISSIONS_EXTRA - * @systemapi hide this for inner system use - */ - function getPreviousAbilityMissionInfos(upperLimit: number): Promise>; - function getPreviousAbilityMissionInfos(upperLimit: number, callback: AsyncCallback>): void; - - /** - * Delete the specified missions - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core - * @param missionIds An array of missions, representing the missions that need to be deleted. - * @permission ohos.permission.DELETE_MISSIONS - * @systemapi hide this for inner system use - */ - function deleteMissions(missionIds: Array): Promise; - function deleteMissions(missionIds: Array, callback: AsyncCallback): void; -} - -export default abilityManager; diff --git a/api/@ohos.application.Ability.d.ts b/api/@ohos.application.Ability.d.ts deleted file mode 100755 index 65963be527b5e0901076ed6d413728e4407f4a79..0000000000000000000000000000000000000000 --- a/api/@ohos.application.Ability.d.ts +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (c) 2021-2022 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 AbilityConstant from "./@ohos.application.AbilityConstant"; -import AbilityContext from "./application/AbilityContext"; -import Want from './@ohos.application.Want'; -import window from './@ohos.window'; -import { Configuration } from './@ohos.application.Configuration'; -import rpc from '/@ohos.rpc'; - -/** - * The interface of a Caller. - * - * @since 9 - * @sysCap AAFwk - * @devices phone, tablet, tv, wearable, car - * @permission N/A - * @StageModelOnly - */ - interface Caller { - /** - * Notify the server of Sequenceable type data. - * - * @since 9 - * @sysCap AAFwk - * @StageModelOnly - */ - call(method: string, data: rpc.Sequenceable): Promise; - - /** - * Notify the server of Sequenceable type data and return the notification result. - * - * @since 9 - * @sysCap AAFwk - * return Sequenceable data - * @StageModelOnly - */ - callWithResult(method: string, data: rpc.Sequenceable): Promise; - - /** - * Clear service records. - * - * @since 9 - * @sysCap AAFwk - * return Sequenceable data - * @StageModelOnly - */ - release(): void; - - /** - * Register death listener notification callback. - * - * @since 9 - * @sysCap AAFwk - * return Sequenceable data - * @StageModelOnly - */ - onRelease(callback: function): void; - } - - /** - * The interface of a Callee. - * - * @since 9 - * @sysCap AAFwk - * @devices phone, tablet, tv, wearable, car - * @permission N/A - * @StageModelOnly - */ - interface Callee { - - /** - * Register data listener callback. - * - * @since 9 - * @sysCap AAFwk - * @StageModelOnly - */ - on(method: string, callback: function): void; - - /** - * Unregister data listener callback. - * - * @since 9 - * @sysCap AAFwk - * @StageModelOnly - */ - off(method: string): void; - } - -/** - * The class of an ability. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @permission N/A - * @StageModelOnly - */ -export default class Ability { - /** - * Indicates configuration information about an ability context. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @StageModelOnly - */ - context: AbilityContext; - - /** - * Indicates ability launch want. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @StageModelOnly - */ - launchWant: Want; - - /** - * Indicates ability last request want. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @StageModelOnly - */ - lastRequestWant: Want; - - /** - * Call Service Stub Object. - * - * @since 9 - * @sysCap AAFwk - * @StageModelOnly - */ - callee: Callee; - - /** - * Called back when an ability is started for initialization. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @return - - * @StageModelOnly - */ - onCreate(want: Want, param: AbilityConstant.LaunchParam): void; - - /** - * Called back when an ability window stage is created. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @return - - * @StageModelOnly - */ - onWindowStageCreate(windowStage: window.WindowStage): void; - - /** - * Called back when an ability window stage is destroyed. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @return - - * @StageModelOnly - */ - onWindowStageDestroy(): void; - - /** - * Called back before an ability is destroyed. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @return - - * @StageModelOnly - */ - onDestroy(): void; - - /** - * Called back when the state of an ability changes to foreground. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @return - - * @StageModelOnly - */ - onForeground(): void; - - /** - * Called back when the state of an ability changes to background. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @return - - * @StageModelOnly - */ - onBackground(): void; - - /** - * Called back when an ability prepares to migrate. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @return true if ability agrees to migrate and saves data successfully, otherwise false. - * @StageModelOnly - */ - onContinue(wantParam : {[key: string]: any}): boolean; - - /** - * Called when the launch mode of an ability is set to singleton. - * This happens when you re-launch an ability that has been at the top of the ability stack. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @return - - * @StageModelOnly - */ - onNewWant(want: Want): void; - - /** - * Called when the system configuration is updated. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @return - - * @StageModelOnly - */ - onConfigurationUpdated(config: Configuration): void; -} diff --git a/api/@ohos.application.Configuration.d.ts b/api/@ohos.application.Configuration.d.ts index 9acbda4fa5ba669522f1ead499705f9fb036064e..9dc13b7bc51b97d59101237d591185e332ac126f 100644 --- a/api/@ohos.application.Configuration.d.ts +++ b/api/@ohos.application.Configuration.d.ts @@ -30,7 +30,7 @@ export interface Configuration { * @since 8 * @syscap SystemCapability.Ability.AbilityBase */ - language: string; + language?: string; /** * Indicates the current colorMode of the application. @@ -38,29 +38,5 @@ export interface Configuration { * @since 8 * @syscap SystemCapability.Ability.AbilityBase */ - colorMode: ConfigurationConstant.ColorMode; - - /** - * Indicates the screen direction of the current device. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityBase - */ - direction: ConfigurationConstant.Direction; - - /** - * Indicates the screen density of the current device. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityBase - */ - screenDensity: ConfigurationConstant.ScreenDensity; - - /** - * Indicates the displayId of the current device. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityBase - */ - displayId: number; + colorMode?: ConfigurationConstant.ColorMode; } diff --git a/api/@ohos.application.ConfigurationConstant.d.ts b/api/@ohos.application.ConfigurationConstant.d.ts index b9ed5f3e19e620af0b740b26577a639825afa721..617e00c3b004f89146cee819350f5f42e0168a26 100644 --- a/api/@ohos.application.ConfigurationConstant.d.ts +++ b/api/@ohos.application.ConfigurationConstant.d.ts @@ -32,34 +32,6 @@ COLOR_MODE_DARK = 0, COLOR_MODE_LIGHT = 1, } - - /** - * @name Direction - * @since 8 - * @syscap SystemCapability.Ability.AbilityBase - * @permission N/A - */ - export enum Direction { - DIRECTION_NOT_SET = -1, - DIRECTION_VERTICAL = 0, - DIRECTION_HORIZONTAL = 1, - } - - /** - * @name ScreenDensity - * @since 8 - * @syscap SystemCapability.Ability.AbilityBase - * @permission N/A - */ - export enum ScreenDensity { - SCREEN_DENSITY_NOT_SET = 0, - SCREEN_DENSITY_SDPI = 120, - SCREEN_DENSITY_MDPI = 160, - SCREEN_DENSITY_LDPI = 240, - SCREEN_DENSITY_XLDPI = 320, - SCREEN_DENSITY_XXLDPI = 480, - SCREEN_DENSITY_XXXLDPI = 640, - } } export default ConfigurationConstant diff --git a/api/@ohos.application.DataShareExtensionAbility.d.ts b/api/@ohos.application.DataShareExtensionAbility.d.ts deleted file mode 100644 index dce6c206a8ff9926c35894233dfb8fa8da70de1d..0000000000000000000000000000000000000000 --- a/api/@ohos.application.DataShareExtensionAbility.d.ts +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) 2022 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 { AsyncCallback } from "./basic"; -import { ResultSet } from './data/rdb/resultSet'; -import ExtensionContext from "./application/ExtensionContext"; -import Want from './@ohos.application.Want'; -import dataAbility from './@ohos.data.dataAbility'; -import rdb from './@ohos.data.rdb'; - -/** - * class of datashare extension ability. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @systemapi Hide this for inner system use. - */ -export default class DataShareExtensionAbility { - /** - * Indicates datashare extension ability context. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @systemapi Hide this for inner system use. - */ - context?: ExtensionContext; - - /** - * Called back when a datashare extension ability is started for initialization. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @param want Indicates connection information about the datashare extension ability. - * @systemapi Hide this for inner system use. - * @return - - */ - onCreate?(want: Want): void; - - /** - * Obtains the MIME type of files. This method should be implemented by a data share. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @param uri Indicates the path of the files to obtain. - * @param mimeTypeFilter Indicates the MIME type of the files to obtain. This parameter cannot be set to {@code - * null}. - *

1. "*/*": Obtains all types supported by a data share. - *

2. "image/*": Obtains files whose main type is image of any subtype. - *

3. "*/jpg": Obtains files whose subtype is JPG of any main type. - * @systemapi Hide this for inner system use. - * @return Returns the MIME type of the matched files; returns null if there is no type that matches the Data - */ - getFileTypes?(uri: string, mimeTypeFilter: string): Array; - - /** - * Inserts a data record into the database. This method should be implemented by a data share. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @param uri Indicates the position where the data is to insert. - * @param valueBucket Indicates the data to insert. - * @systemapi Hide this for inner system use. - * @return Returns the index of the newly inserted data record. - */ - insert?(uri: string, valueBucket: rdb.ValuesBucket): number; - - /** - * Updates one or more data records in the database. This method should be implemented by a data share. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @param uri Indicates the database table storing the data to update. - * @param valueBucket Indicates the data to update. This parameter can be null. - * @param predicates Indicates filter criteria. If this parameter is null, all data records will be updated by - * default. - * @systemapi Hide this for inner system use. - * @return Returns the number of data records updated. - */ - update?(uri: string, valueBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates): number; - - /** - * Deletes one or more data records. This method should be implemented by a data share. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @param uri Indicates the database table storing the data to delete. - * @param predicates Indicates filter criteria. If this parameter is null, all data records will be deleted by - * default. - * @systemapi Hide this for inner system use. - * @return Returns the number of data records deleted. - */ - delete?(uri: string, predicates: dataAbility.DataAbilityPredicates): number; - - /** - * Queries one or more data records in the database. This method should be implemented by a data share. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @param uri Indicates the database table storing the data to query. - * @param columns Indicates the columns to be queried, in array, for example, {"name","age"}. You should define - * the processing logic when this parameter is null. - * @param predicates Indicates filter criteria. If this parameter is null, all data records will be queried by - * default. - * @systemapi Hide this for inner system use. - * @return Returns the queried data. - */ - query?(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates): ResultSet; - - /** - * Obtains the MIME type matching the data specified by the URI of the data share. This method should be - * implemented by a data share. - * - *

Data abilities supports general data types, including text, HTML, and JPEG.

- * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @param uri Indicates the uri of the data. - * @systemapi Hide this for inner system use. - * @return Returns the MIME type that matches the data specified by {@code uri}. - */ - getType?(uri: string): string; - - /** - * Inserts multiple data records into the database. This method should be implemented by a data share. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @param uri Indicates the position where the data is to insert. - * @param valueBuckets Indicates the data to insert. - * @systemapi Hide this for inner system use. - * @return Returns the number of data records inserted. - */ - batchInsert?(uri: string, valueBuckets: Array): number; - - /** - * Converts the given {@code uri} that refer to the data share into a normalized URI. A normalized URI can be - * used across devices, persisted, backed up, and restored. It can refer to the same item in the data share - * even if the context has changed. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @param uri Indicates the uri to normalize. - * @systemapi Hide this for inner system use. - * @return Returns the normalized uri if the data share supports URI normalization; - */ - normalizeUri?(uri: string): string; - - /** - * Converts the given normalized {@code uri} generated by {@link #normalizeUri(uri)} into a denormalized one. - * The default implementation of this method returns the original uri passed to it. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Provider - * @param uri Indicates the uri to denormalize. - * @systemapi Hide this for inner system use. - * @return Returns the denormalized {@code uri} object if the denormalization is successful; returns the original - * {@code uri} passed to this method if there is nothing to do; returns {@code null} if the data identified by - * the original {@code uri} cannot be found in the current environment. - */ - denormalizeUri?(uri: string): string; -} \ No newline at end of file diff --git a/api/@ohos.application.FormExtension.d.ts b/api/@ohos.application.FormExtension.d.ts deleted file mode 100644 index 63862c0c221b5e3524fc49735c6fe848bad82b3f..0000000000000000000000000000000000000000 --- a/api/@ohos.application.FormExtension.d.ts +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2021-2022 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 formBindingData from './@ohos.application.formBindingData'; -import FormExtensionContext from "./application/FormExtensionContext"; -import Want from './@ohos.application.Want'; -import { Configuration } from './@ohos.application.Configuration'; - -/** - * class of form extension. - * - * @since 9 - * @syscap SystemCapability.Ability.Form - * @StageModelOnly - */ -export default class FormExtension { - /** - * Indicates form extension context. - * - * @since 9 - * @syscap SystemCapability.Ability.Form - * @StageModelOnly - */ - context: FormExtensionContext; - - /** - * Called to return a {@link formBindingData#FormBindingData} object. - * - * @since 9 - * @syscap SystemCapability.Ability.Form - * @param want Indicates the detailed information for creating a {@link formBindingData#FormBindingData}. - * The {@code Want} object must include the form ID, form name, and grid style of the form. - * Such form information must be managed as persistent data for further form - * acquisition, update, and deletion. - * @return Returns the created {@link formBindingData#FormBindingData} object. - * @StageModelOnly - */ - onCreate(want: Want): formBindingData.FormBindingData; - - /** - * Called when the form provider is notified that a temporary form is successfully converted to a normal form. - * - * @since 9 - * @syscap SystemCapability.Ability.Form - * @param formId Indicates the ID of the form. - * @return - - * @StageModelOnly - */ - onCastToNormal(formId: string): void; - - /** - * Called to notify the form provider to update a specified form. - * - * @since 9 - * @syscap SystemCapability.Ability.Form - * @param formId Indicates the ID of the form to update. - * @return - - * @StageModelOnly - */ - onUpdate(formId: string): void; - - /** - * Called when the form provider receives form events from the system. - * - * @since 9 - * @syscap SystemCapability.Ability.Form - * @param newStatus Indicates the form events occurred. The key in the {@code Map} object indicates the form ID, - * and the value indicates the event type, which can be either {@link formManager#VisibilityType#FORM_VISIBLE} - * or {@link formManager#VisibilityType#FORM_INVISIBLE}. {@link formManager#VisibilityType#FORM_VISIBLE} - * means that the form becomes visible, and {@link formManager#VisibilityType#FORM_INVISIBLE} - * means that the form becomes invisible. - * @return - - * @StageModelOnly - */ - onVisibilityChange(newStatus: { [key: string]: number }): void; - - /** - * Called when a specified message event defined by the form provider is triggered. This method is valid only for - * JS forms. - * - * @since 9 - * @syscap SystemCapability.Ability.Form - * @param formId Indicates the ID of the form on which the message event is triggered, which is provided by - * the client to the form provider. - * @param message Indicates the value of the {@code params} field of the message event. This parameter is - * used to identify the specific component on which the event is triggered. - * @return - - * @StageModelOnly - */ - onEvent(formId: string, message: string): void; - - /** - * Called to notify the form provider that a specified form has been destroyed. Override this method if - * you want your application, as the form provider, to be notified of form deletion. - * - * @since 9 - * @syscap SystemCapability.Ability.Form - * @param formId Indicates the ID of the destroyed form. - * @return - - * @StageModelOnly - */ - onDestroy(formId: string): void; - - /** - * Called when the system configuration is updated. - * - * @since 9 - * @syscap SystemCapability.Ability.Form - * @return - - * @StageModelOnly - */ - onConfigurationUpdated(config: Configuration): void; -} \ No newline at end of file diff --git a/api/@ohos.application.ServiceExtAbility.d.ts b/api/@ohos.application.ServiceExtAbility.d.ts deleted file mode 100644 index 57a549082fc195e6c9f0ce9c98d039428b4dfdab..0000000000000000000000000000000000000000 --- a/api/@ohos.application.ServiceExtAbility.d.ts +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import rpc from "./@ohos.rpc"; -import ServiceExtAbilityContext from "./application/ServiceExtAbilityContext"; -import Want from './@ohos.application.Want'; - -/** - * class of service extension ability. - * - * @since 9 - * @sysCap AAFwk - * @devices phone, tablet, tv, wearable, car - * @systemapi hide for inner use. - * @StageModelOnly - */ -export default class ServiceExtAbility { - /** - * Indicates service extension ability context. - * - * @since 9 - * @sysCap AAFwk - * @systemapi hide for inner use. - * @StageModelOnly - */ - context: ServiceExtAbilityContext; - - /** - * Called back when a service extension is started for initialization. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - onCreate(want: Want): void; - - /** - * Called back before a service extension is destroyed. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - onDestroy(): void; - - /** - * Called back when a service extension is started. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @param want Indicates the want of service extension to start. - * @param startId Indicates the number of times the service extension has been started. The {@code startId} is - * incremented by 1 every time the service extension is started. For example, if the service extension - * has been started for six times. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - onRequest(want: Want, startId: number): void; - - /** - * Called back when a service extension is first connected to an ability. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @param want Indicates connection information about the Service ability. - * @systemapi hide for inner use. - * @return Returns the proxy of the Service ability. - * @StageModelOnly - */ - onConnect(want: Want): rpc.RemoteObject; - - /** - * Called back when all abilities connected to a service extension are disconnected. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @param want Indicates disconnection information about the service extension. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - onDisconnect(want: Want): void; - - /** - * Called when a new client attempts to connect to a service extension after all previous client connections to it - * are disconnected. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @param want Indicates the want of the service extension being connected. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - onReconnect(want: Want): void; -} - diff --git a/api/@ohos.application.ServiceExtension.d.ts b/api/@ohos.application.ServiceExtension.d.ts deleted file mode 100644 index 002684069a63fda834df098140a46b339d008254..0000000000000000000000000000000000000000 --- a/api/@ohos.application.ServiceExtension.d.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2021-2022 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 rpc from "./@ohos.rpc"; -import ServiceExtensionContext from "./application/ServiceExtensionContext"; -import Want from './@ohos.application.Want'; -import { Configuration } from './@ohos.application.Configuration'; - -/** - * class of service extension. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @StageModelOnly - */ -export default class ServiceExtension { - /** - * Indicates service extension context. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @StageModelOnly - */ - context: ServiceExtensionContext; - - /** - * Called back when a service extension is started for initialization. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - onCreate(want: Want): void; - - /** - * Called back before a service extension is destroyed. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - onDestroy(): void; - - /** - * Called back when a service extension is started. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want of service extension to start. - * @param startId Indicates the number of times the service extension has been started. The {@code startId} is - * incremented by 1 every time the service extension is started. For example, if the service extension - * has been started for six times. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - onRequest(want: Want, startId: number): void; - - /** - * Called back when a service extension is first connected to an ability. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates connection information about the Service ability. - * @systemapi hide for inner use. - * @return Returns the proxy of the Service ability. - * @StageModelOnly - */ - onConnect(want: Want): rpc.RemoteObject; - - /** - * Called back when all abilities connected to a service extension are disconnected. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates disconnection information about the service extension. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - onDisconnect(want: Want): void; - - /** - * Called when a new client attempts to connect to a service extension after all previous client connections to it - * are disconnected. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want of the service extension being connected. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - onReconnect(want: Want): void; - - /** - * Called when the system configuration is updated. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return - - * @StageModelOnly - */ - onConfigurationUpdated(config: Configuration): void; -} - diff --git a/api/@ohos.application.StartOptions.d.ts b/api/@ohos.application.StartOptions.d.ts deleted file mode 100644 index 5c0b9e7d041e9e27f562824297483e010cc21b6e..0000000000000000000000000000000000000000 --- a/api/@ohos.application.StartOptions.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * StartOptions is the basic communication component of the system. - * - * @name StartOptions - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly - */ -export default class StartOptions { - /** - * windowMode - * @default - - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - windowMode?: number; - - /** - * displayId - * @default - - * @devices phone, tablet - * @since 9 - * @sysCap AAFwk - * @StageModelOnly - */ - displayId?: number; -} \ No newline at end of file diff --git a/api/@ohos.application.Want.d.ts b/api/@ohos.application.Want.d.ts index 337e376ae1577c1a1cedb04d5fed5b48fc7d4f4e..6b2c2b0ae671dc0d0f36a7f79506d7801fa7e39d 100644 --- a/api/@ohos.application.Want.d.ts +++ b/api/@ohos.application.Want.d.ts @@ -18,7 +18,7 @@ * * @name Want * @since 8 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @permission N/A */ export default class Want { @@ -26,7 +26,7 @@ export default class Want { * device id * @default - * @since 8 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase */ deviceId?: string; @@ -34,7 +34,7 @@ export default class Want { * bundle name * @default - * @since 8 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase */ bundleName?: string; @@ -42,14 +42,14 @@ export default class Want { * ability name * @default - * @since 8 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase */ abilityName?: string; /** * The description of a URI in a Want. * @since 8 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @default - */ uri?: string; @@ -57,7 +57,7 @@ export default class Want { /** * The description of the type in this Want. * @since 8 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @default - */ type?: string; @@ -65,7 +65,7 @@ export default class Want { /** * The options of the flags in this Want. * @since 8 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @default - */ flags?: number; @@ -73,7 +73,7 @@ export default class Want { /** * The description of an action in an want. * @since 8 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @default - */ action?: string; @@ -81,7 +81,7 @@ export default class Want { /** * The description of the WantParams object in an Want * @since 8 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @default - */ parameters?: {[key: string]: any}; @@ -89,7 +89,7 @@ export default class Want { /** * The description of a entities in a Want. * @since 8 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @default - */ entities?: Array; diff --git a/api/@ohos.application.abilityDelegatorRegistry.d.ts b/api/@ohos.application.abilityDelegatorRegistry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c2fa8b68e6bd28f59065e8c2208ac58e34295bf9 --- /dev/null +++ b/api/@ohos.application.abilityDelegatorRegistry.d.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AbilityDelegator } from './application/abilityDelegator' +import { AbilityDelegatorArgs } from './application/abilityDelegatorArgs' + +/** + * A global register used to store the AbilityDelegator and AbilityDelegatorArgs objects registered + * during application startup. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + * @permission N/A + */ +declare namespace abilityDelegatorRegistry { + /** + * Get the AbilityDelegator object of the application. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return the AbilityDelegator object initialized when the application is started. + */ + function getAbilityDelegator(): AbilityDelegator; + + /** + * Get unit test parameters stored in the AbilityDelegatorArgs object. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return the previously registered AbilityDelegatorArgs object. + */ + function getArguments(): AbilityDelegatorArgs; + + /** + * Describes all lifecycle states of an ability. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + export enum AbilityLifecycleState { + UNINITIALIZED, + CREATE, + FOREGROUND, + BACKGROUND, + DESTROY, + } +} + +export default abilityDelegatorRegistry; \ No newline at end of file diff --git a/api/@ohos.application.abilityManager.d.ts b/api/@ohos.application.abilityManager.d.ts index ff2426a5e7bc9e4598d977d2e6bd62e604fb6fba..b71565531c83b74ad8f3abed829d5e3ac9baf090 100644 --- a/api/@ohos.application.abilityManager.d.ts +++ b/api/@ohos.application.abilityManager.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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 @@ -22,7 +22,7 @@ import { ExtensionRunningInfo } from './application/ExtensionRunningInfo'; * The class of an ability manager. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A */ declare namespace abilityManager { @@ -30,7 +30,8 @@ declare namespace abilityManager { /** * @name AbilityState * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi Hide this for inner system use. * @permission N/A */ export enum AbilityState { @@ -45,10 +46,11 @@ declare namespace abilityManager { * Updates the configuration by modifying the configuration. * * @since 8 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param config Indicates the new configuration. * @systemapi Hide this for inner system use. * @return - + * @permission ohos.permission.UPDATE_CONFIGURATION */ function updateConfiguration(config: Configuration, callback: AsyncCallback): void; function updateConfiguration(config: Configuration): Promise; @@ -57,24 +59,13 @@ declare namespace abilityManager { * Get information about running abilitys * * @since 8 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi Hide this for inner system use. - * @return - + * @return Returns the array of {@link AbilityRunningInfo}. + * @permission ohos.permission.GET_RUNNING_INFO */ function getAbilityRunningInfos(): Promise>; function getAbilityRunningInfos(callback: AsyncCallback>): void; - - /** - * Get information about running extensions - * - * @since 9 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core - * @param upperLimit Get the maximum limit of the number of messages - * @systemapi Hide this for inner system use. - * @return - - */ - function getExtensionRunningInfos(upperLimit: number): Promise>; - function getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback>): void; } export default abilityManager; \ No newline at end of file diff --git a/api/@ohos.application.appManager.d.ts b/api/@ohos.application.appManager.d.ts index dcb6dca86ab862ac726dd65add9cc4c67820639f..a116e01990c216652bfb601333d4d062b628654b 100644 --- a/api/@ohos.application.appManager.d.ts +++ b/api/@ohos.application.appManager.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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 @@ -22,7 +22,7 @@ import { ProcessRunningInfo } from './application/ProcessRunningInfo'; * This module provides the function of app manager service. * * @since 8 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @import import appManager from '@ohos.application.appManager' * @permission N/A */ @@ -32,10 +32,11 @@ declare namespace appManager { * * @default - * @since 8 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param observer The application state observer. * @systemapi hide this for inner system use * @return Returns the number code of the observer. + * @permission ohos.permission.RUNNING_STATE_OBSERVER */ function registerApplicationStateObserver(observer: ApplicationStateObserver): number; @@ -43,10 +44,11 @@ declare namespace appManager { * Unregister application state observer. * * @since 8 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param observerId Indicates the number code of the observer. * @systemapi hide this for inner system use * @return - + * @permission ohos.permission.RUNNING_STATE_OBSERVER */ function unregisterApplicationStateObserver(observerId: number, callback: AsyncCallback): void; function unregisterApplicationStateObserver(observerId: number): Promise; @@ -55,9 +57,10 @@ declare namespace appManager { * getForegroundApplications. * * @since 8 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide this for inner system use * @return Returns the list of AppStateData. + * @permission ohos.permission.GET_RUNNING_INFO */ function getForegroundApplications(callback: AsyncCallback>): void; function getForegroundApplications(): Promise>; @@ -66,11 +69,12 @@ declare namespace appManager { * Kill process with account. * * @since 8 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param bundleName The process bundle name. * @param accountId The account id. * @systemapi hide this for inner system use * @return - + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES */ function killProcessWithAccount(bundleName: string, accountId: number): Promise; function killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback): void; @@ -79,7 +83,7 @@ declare namespace appManager { * Is user running in stability test. * * @since 8 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @return Returns true if user is running stability test. */ function isRunningInStabilityTest(callback: AsyncCallback): void; @@ -89,9 +93,9 @@ declare namespace appManager { * Get information about running processes * * @since 8 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi Hide this for inner system use. - * @return - + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return Returns the array of {@link ProcessRunningInfo}. + * @permission ohos.permission.GET_RUNNING_INFO */ function getProcessRunningInfos(): Promise>; function getProcessRunningInfos(callback: AsyncCallback>): void; @@ -99,11 +103,10 @@ declare namespace appManager { /** * Kill processes by bundle name * @since 8 - * @SysCap SystemCapability.Appexecfwk - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param bundleName bundle name. - * @permission ohos.permission.DELETE_MISSIONS * @systemapi hide this for inner system use + * @permission ohos.permission.CLEAN_BACKGROUND_PROCESSES */ function killProcessesByBundleName(bundleName: string): Promise; function killProcessesByBundleName(bundleName: string, callback: AsyncCallback); @@ -111,14 +114,31 @@ declare namespace appManager { /** * Clear up application data by bundle name * @since 8 - * @SysCap SystemCapability.Appexecfwk - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param bundleName bundle name. - * @permission ohos.permission.DELETE_MISSIONS * @systemapi hide this for inner system use + * @permission ohos.permission.CLEAN_APPLICATION_DATA */ function clearUpApplicationData(bundleName: string): Promise; function clearUpApplicationData(bundleName: string, callback: AsyncCallback); + + /** + * Is it a ram-constrained device + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return whether a ram-constrained device. + */ + function isRamConstrainedDevice(): Promise; + function isRamConstrainedDevice(callback: AsyncCallback): void; + + /** + * Get the memory size of the application + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return application memory size. + */ + function getAppMemorySize(): Promise; + function getAppMemorySize(callback: AsyncCallback): void; } export default appManager; diff --git a/api/@ohos.application.formBindingData.d.ts b/api/@ohos.application.formBindingData.d.ts index ad398765917917ecc7774d2e0ff1cda7225c41e0..f961244748da0e4ed4a16aaff2012a08081f3737 100644 --- a/api/@ohos.application.formBindingData.d.ts +++ b/api/@ohos.application.formBindingData.d.ts @@ -18,19 +18,24 @@ * * @name formBindingData * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.Form */ declare namespace formBindingData { /** * Create an FormBindingData instance. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.Form * @param obj Indicates the FormBindingData instance data. * @return Returns the {@link FormBindingData} instance. */ function createFormBindingData(obj?: Object | string): FormBindingData; + /** + * Defines the createFormBindingData result interface. + * @syscap SystemCapability.Ability.Form + * @since 8 + */ interface FormBindingData { data: Object } diff --git a/api/@ohos.application.formError.d.ts b/api/@ohos.application.formError.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..97ecc6768b5b2bed444e0cc5e3683d60d0ed43b0 --- /dev/null +++ b/api/@ohos.application.formError.d.ts @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2022 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. + */ + +/** + * interface of formError. + * + * @name formError + * @since 8 + * @syscap SystemCapability.Ability.Form + */ +declare namespace formError { + /** + * Error of form. + * + * @name FormError + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + enum FormError { + /** + * A common internal error occurs during form processing. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_COMMON = 1, + + /** + * The application does not have permission to use forms. + * Ensure that the application is granted with the ohos.permission.REQUIRE_FORM + * and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED permissions. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_PERMISSION_DENY = 2, + + /** + * Failed to obtain the configuration information about the form specified by the + * request parameters. Ensure that the parameters of the form to be added are + * consistent with those provided by the form provider. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_GET_INFO_FAILED = 4, + + /** + * Failed to obtain the bundle to which the form belongs based on the request parameters. + * Ensure that the bundle to which the form to be added belongs is available. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_GET_BUNDLE_FAILED = 5, + + /** + * Failed to initialize the form layout based on the request parameters. + * Ensure that the grid style of the form is supported by the form provider. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_GET_LAYOUT_FAILED = 6, + + /** + * Invalid input parameter during form operation. Ensure that all input + * parameters are valid. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_ADD_INVALID_PARAM = 7, + + /** + * The form configuration to be obtained using an existing form ID is + * different from that obtained for the first time. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_CFG_NOT_MATCH_ID = 8, + + /** + * The ID of the form to be operated does not exist in the Form Manager Service. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_NOT_EXIST_ID = 9, + + /** + * Failed to bind the Form Manager Service to the provider service. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_BIND_PROVIDER_FAILED = 10, + + /** + * The total number of added forms exceeds the maximum allowed by the system. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_MAX_SYSTEM_FORMS = 11, + + /** + * The number of form instances generated using the same form configuration + * exceeds the maximum allowed by the system. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_MAX_INSTANCES_PER_FORM = 12, + + /** + * The form being requested was added by other applications and cannot be + * operated by the current application. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_OPERATION_FORM_NOT_SELF = 13, + + /** + * The Form Manager Service failed to instruct the form provider to delete the form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_PROVIDER_DEL_FAIL = 14, + + /** + * The total number of added forms exceeds the maximum per client. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_MAX_FORMS_PER_CLIENT = 15, + + /** + * The total number of added temp forms exceeds the maximum in system. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_MAX_SYSTEM_TEMP_FORMS = 16, + + /** + * The module can not be find in system. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_FORM_NO_SUCH_MODULE = 17, + + /** + * The ability can not be find in system. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_FORM_NO_SUCH_ABILITY = 18, + + /** + * The dimension is not exist in the form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_FORM_NO_SUCH_DIMENSION = 19, + + /** + * The ability is not installed. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_FORM_FA_NOT_INSTALLED = 20, + + /** + * Failed to obtain the RPC object of the Form Manager Service because + * the service is not started.Please try again after the service is started. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_SYSTEM_RESPONSES_FAILED = 30, + + /** + * Failed to obtain the form requested by the client because another form + * with the same form ID is in use. Forms in use cannot have the same ID. + * To obtain and display a form that has the same configuration as an in-use + * form in the same application, you are advised to set the form ID to 0 in + * the request parameters. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_FORM_DUPLICATE_ADDED = 31, + + /** + * The form is being restored. Perform operations on the form only after + * the restoration is complete. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + ERR_IN_RECOVERY = 36 + } +} +export default formError; \ No newline at end of file diff --git a/api/@ohos.application.formHost.d.ts b/api/@ohos.application.formHost.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..382bbde363befbc8d40540f4f7edcbd43824722a --- /dev/null +++ b/api/@ohos.application.formHost.d.ts @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2022 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 { AsyncCallback } from "./basic"; +import { Callback } from "./basic"; +import Want from './@ohos.application.Want'; +import formInfo from './@ohos.application.formInfo' + +/** + * interface of formHost. + * + * @name formHost + * @since 8 + * @syscap SystemCapability.Ability.Form + * @systemapi hide for inner use. + */ +declare namespace formHost { + /** + * Deletes an obtained form by its ID. + * + *

After this method is called, the form won't be available for use by the application and the Form Manager + * Service no longer keeps the cache information about the form.

+ * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param formId Indicates the form ID + * @return - + * @permission ohos.permission.REQUIRE_FORM + */ + function deleteForm(formId: string, callback: AsyncCallback): void; + function deleteForm(formId: string): Promise; + + /** + * Releases an obtained form by its ID. + * + *

After this method is called, the form won't be available for use by the application, but the Form Manager + * Service still keeps the cache information about the form, so that the application can quickly obtain it based on + * the {@code formId}.

+ * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param formId Indicates the form ID + * @param isReleaseCache Indicates whether or not release cache + * @return - + * @permission ohos.permission.REQUIRE_FORM + */ + function releaseForm(formId: string, callback: AsyncCallback): void; + function releaseForm(formId: string, isReleaseCache: boolean, callback: AsyncCallback): void; + function releaseForm(formId: string, isReleaseCache?: boolean): Promise; + + /** + * Requests for form update. + * + *

This method must be called when the application has detected that a system setting item (such as the language, + * resolution, or screen orientation) being listened for has changed. Upon receiving the update request, the form + * provider automatically updates the form data (if there is any update) through the form framework, with the update + * process being unperceivable by the application.

+ * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param formId Indicates the ID of the form to update. + * @return - + * @permission ohos.permission.REQUIRE_FORM + */ + function requestForm(formId: string, callback: AsyncCallback): void; + function requestForm(formId: string): Promise; + + /** + * Converts a specified temporary form that has been obtained by the application into a normal form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param formId Indicates the ID of the temporary form to convert. + * @return - + * @permission ohos.permission.REQUIRE_FORM + */ + function castTempForm(formId: string, callback: AsyncCallback): void; + function castTempForm(formId: string): Promise; + + /** + * Sends a notification to the form framework to make the specified forms visible. + * + *

After this method is successfully called, onVisibilityChange will be called to notify the form provider of + * the form visibility change event.

+ * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param formIds Indicates the IDs of the forms to be made visible. + * @return - + * @permission ohos.permission.REQUIRE_FORM + */ + function notifyVisibleForms(formIds: Array, callback: AsyncCallback): void; + function notifyVisibleForms(formIds: Array): Promise; + + /** + * Sends a notification to the form framework to make the specified forms invisible. + * + *

After this method is successfully called, onVisibilityChange will be called to notify the form provider of + * the form visibility change event.

+ * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param formIds Indicates the IDs of the forms to be made invisible. + * @return - + * @permission ohos.permission.REQUIRE_FORM + */ + function notifyInvisibleForms(formIds: Array, callback: AsyncCallback): void; + function notifyInvisibleForms(formIds: Array): Promise; + + /** + * Notify the form framework to make the specified forms updatable. + * + *

You can use this method to set form refresh state to true, the form can receive new + * update from service.

+ * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param formIds Indicates the IDs of the forms to be made invisible. + * @return - + * @permission ohos.permission.REQUIRE_FORM + */ + function enableFormsUpdate(formIds: Array, callback: AsyncCallback): void; + function enableFormsUpdate(formIds: Array): Promise; + + /** + * Notifys the form framework to make the specified forms non updatable. + * + *

You can use this method to set form refresh state to false, the form do not receive + * new update from service.

+ * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param formIds Indicates the IDs of the forms to be made invisible. + * @return - + * @permission ohos.permission.REQUIRE_FORM + */ + function disableFormsUpdate(formIds: Array, callback: AsyncCallback): void; + function disableFormsUpdate(formIds: Array): Promise; + + /** + * Checks whether the system is ready. + * + *

You can use this method to obtain the system is ready.

+ * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @return - + */ + function isSystemReady(callback: AsyncCallback): void; + function isSystemReady(): Promise; + + /** + * Obtains the FormInfo objects provided by all applications on the device. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @return Returns the {@link FormInfo} + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + */ + function getAllFormsInfo(callback: AsyncCallback>): void; + function getAllFormsInfo(): Promise>; + + /** + * Obtains the FormInfo objects provided by a specified application on the device. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param bundleName Indicates the bundle name of the application. + * @param moduleName Indicates the module name of the application. + * @return Returns the {@link FormInfo} + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + */ + function getFormsInfo(bundleName: string, callback: AsyncCallback>): void; + function getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback>): void; + function getFormsInfo(bundleName: string, moduleName?: string): Promise>; + + /** + * Deletes invalid forms of the application in the Form Manager Service based on the list of. + * + *

You can use this method to delete invalid forms of the application.

+ * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param formIds Indicates the specify form id. + * @return Returns the number of invalid forms deleted by the Form Manager Service + * @permission ohos.permission.REQUIRE_FORM. + */ + function deleteInvalidForms(formIds: Array, callback: AsyncCallback): void; + function deleteInvalidForms(formIds: Array): Promise; + + /** + * Obtains the Form state. + * + *

You can use this method to obtains the form state.

+ * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param want Indicates want of the form. + * @return Returns form state {@link FormStateInfo} + * @permission ohos.permission.GET_BUNDLE_INFO and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED. + */ + function acquireFormState(want: Want, callback: AsyncCallback): void; + function acquireFormState(want: Want): Promise; + + /** + * Listens to the event of uninstall form. + * + *

You can use this method to listen to the event of uninstall form.

+ * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param type Indicates event type. + * @return - + */ + function on(type: "formUninstall", callback: Callback): void; + + /** + * Cancels listening to the event of uninstall form. + * + *

You can use this method to cancel listening to the event of uninstall form.

+ * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param type Indicates event type. + * @return - + */ + function off(type: "formUninstall", callback?: Callback): void; + + /** + * notify form is Visible + * + *

You can use this method to notify form visible state.

+ * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param formIds Indicates the specify form id. + * @param isVisible Indicates whether visible. + * @return - + * @permission ohos.permission.REQUIRE_FORM. + */ + function notifyFormsVisible(formIds: Array, isVisible: boolean, callback: AsyncCallback): void; + function notifyFormsVisible(formIds: Array, isVisible: boolean): Promise; + + /** + * notify form enable update state. + * + *

You can use this method to notify form enable update state.

+ * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param formIds Indicates the specify form id. + * @param isEnableUpdate Indicates whether enable update. + * @return - + * @permission ohos.permission.REQUIRE_FORM. + */ + function notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean, callback: AsyncCallback): void; + function notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean): Promise; +} +export default formHost; \ No newline at end of file diff --git a/api/@ohos.application.formInfo.d.ts b/api/@ohos.application.formInfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cbb57460639b6a9364c1b1af8590e07dd087408c --- /dev/null +++ b/api/@ohos.application.formInfo.d.ts @@ -0,0 +1,390 @@ +/* + * Copyright (c) 2022 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 Want from './@ohos.application.Want'; + +/** + * interface of formInfo. + * + * @name formInfo + * @since 8 + * @syscap SystemCapability.Ability.Form + */ +declare namespace formInfo { + /** + * Provides information about a form. + * + * @name FormInfo + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + interface FormInfo { + /** + * Obtains the bundle name of the application to which this form belongs. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + bundleName: string; + + /** + * Obtains the name of the application module to which this form belongs. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + moduleName: string; + + /** + * Obtains the class name of the ability to which this form belongs. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + abilityName: string; + + /** + * Obtains the name of this form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + name: string; + + /** + * Obtains the name of this form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + description: string; + + /** + * Obtains the type of this form. Currently, JS forms are supported. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + type: FormType; + + /** + * Obtains the JS component name of this JS form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + jsComponentName: string; + + /** + * Obtains the color mode of this form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + colorMode: ColorMode; + + /** + * Checks whether this form is a default form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + isDefault: boolean; + + /** + * Obtains the updateEnabled. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + updateEnabled: boolean; + + /** + * Obtains whether notify visible of this form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + formVisibleNotify: boolean; + + /** + * Obtains the bundle relatedBundleName of the application to which this form belongs. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + relatedBundleName: string; + + /** + * Obtains the scheduledUpdateTime. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + scheduledUpdateTime: string; + + /** + * Obtains the form config ability about this form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + formConfigAbility: string; + + /** + * Obtains the updateDuration. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + updateDuration: number; + + /** + * Obtains the default grid style of this form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + defaultDimension: number; + + /** + * Obtains the grid styles supported by this form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + supportDimensions: Array; + + /** + * Obtains the custom data defined in this form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + customizeData: {[key: string]: [value: string]}; + } + + /** + * Type of form. + * + * @name FormType + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + enum FormType { + /** + * JS form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + JS = 1 + } + + /** + * Color mode. + * + * @name ColorMode + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + enum ColorMode { + /** + * Automatic mode. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + MODE_AUTO = -1, + + /** + * Dark mode. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + MODE_DARK = 0, + + /** + * Light mode. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + MODE_LIGHT = 1 + } + + /** + * Provides state information about a form. + * + * @name FormStateInfo + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + interface FormStateInfo { + /** + * Obtains the form state. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + formState: FormState; + + /** + * Obtains the want form . + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + want: Want; + } + + /** + * Provides state about a form. + * + * @name FormState + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + enum FormState { + /** + * Indicates that the form status is unknown due to an internal error. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + UNKNOWN = -1, + + /** + * Indicates that the form is in the default state. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + DEFAULT = 0, + + /** + * Indicates that the form is ready. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + READY = 1, + } + + /** + * Parameter of form. + * + * @name FormParam + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + enum FormParam { + /** + * Indicates the key specifying the ID of the form to be obtained, which is represented as + * want: { + * "parameters": { + * IDENTITY_KEY: 1L + * } + * }. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @systemapi hide for inner use. + */ + IDENTITY_KEY = "ohos.extra.param.key.form_identity", + + /** + * Indicates the key specifying the grid style of the form to be obtained, which is represented as + * want: { + * "parameters": { + * DIMENSION_KEY: 1 + * } + * }. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + DIMENSION_KEY = "ohos.extra.param.key.form_dimension", + + /** + * Indicates the key specifying the name of the form to be obtained, which is represented as + * want: { + * "parameters": { + * NAME_KEY: "formName" + * } + * }. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + NAME_KEY = "ohos.extra.param.key.form_name", + + /** + * Indicates the key specifying the name of the module to which the form to be obtained belongs, which is + * represented as + * want: { + * "parameters": { + * MODULE_NAME_KEY: "formEntry" + * } + * } + * This constant is mandatory. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + MODULE_NAME_KEY = "ohos.extra.param.key.module_name", + + /** + * Indicates the key specifying the width of the form to be obtained, which is represented as + * want: { + * "parameters": { + * WIDTH_KEY: 800 + * } + * } + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + WIDTH_KEY = "ohos.extra.param.key.form_width", + + /** + * Indicates the key specifying the height of the form to be obtained, which is represented as + * want: { + * "parameters": { + * HEIGHT_KEY: 400 + * } + * } + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + HEIGHT_KEY = "ohos.extra.param.key.form_height", + + /** + * Indicates the key specifying whether a form is temporary, which is represented as + * want: { + * "parameters": { + * TEMPORARY_KEY: true + * } + * } + * + * @since 8 + * @syscap SystemCapability.Ability.Form + */ + TEMPORARY_KEY = "ohos.extra.param.key.form_temporary" + } +} +export default formInfo; \ No newline at end of file diff --git a/api/application/PermissionRequestResult.d.ts b/api/@ohos.application.formProvider.d.ts old mode 100755 new mode 100644 similarity index 35% rename from api/application/PermissionRequestResult.d.ts rename to api/@ohos.application.formProvider.d.ts index 6c44ea461f8be4c4a7c03b20ed9c48c9540ec04f..7075d9ad1df2ee5e6356b2fc2315c17f62bbd962 --- a/api/application/PermissionRequestResult.d.ts +++ b/api/@ohos.application.formProvider.d.ts @@ -1,43 +1,54 @@ -/* - * Copyright (c) 2022 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. - */ - -/** - * The result of requestPermissionsFromUser with asynchronous callback. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission - * @permission N/A - * @StageModelOnly - */ -export default class PermissionRequestResult { - /** - * The permissions passed in by the user. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission - * @StageModelOnly - */ - permissions: Array; - - /** - * The results for the corresponding request permissions. The value 0 indicates that a - * permission is granted, and the value -1 indicates not. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission - * @StageModelOnly - */ - authResults: Array; -} \ No newline at end of file +/* + * Copyright (c) 2022 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 { AsyncCallback } from "./basic"; +import formBindingData from "./@ohos.application.formBindingData"; + +/** + * interface of formProvider. + * + * @name formProvider + * @since 8 + * @syscap SystemCapability.Ability.Form + */ +declare namespace formProvider { + /** + * Set next update time for a specified form. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param formId Indicates the form ID. + * @param minute Indicates duration minute before next update. + * @return - + */ + function setFormNextRefreshTime(formId: string, minute: number, callback: AsyncCallback): void; + function setFormNextRefreshTime(formId: string, minute: number): Promise; + + /** + * Update a specified form. + * + * Client to communication with FormManagerService. + * + * @since 8 + * @syscap SystemCapability.Ability.Form + * @param formId Indicates the form ID + * @param FormBindingData Indicates the form data + * @return - + */ + function updateForm(formId: string, formBindingData: formBindingData.FormBindingData, + callback: AsyncCallback): void; + function updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise; +} +export default formProvider; \ No newline at end of file diff --git a/api/@ohos.application.missionManager.d.ts b/api/@ohos.application.missionManager.d.ts index 94f172f8e5fc096eaf834b759b95bc4de2195a7c..dc6a871c31938cc604ca2c107fa0cf98cf7731fd 100644 --- a/api/@ohos.application.missionManager.d.ts +++ b/api/@ohos.application.missionManager.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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 @@ -24,8 +24,8 @@ import StartOptions from "./@ohos.application.StartOptions"; * * @name missionManager * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission - * @permission N/A + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @permission ohos.permission.MANAGE_MISSIONS * @systemapi hide for inner use. */ declare namespace missionManager { @@ -33,7 +33,8 @@ declare namespace missionManager { * Register the missionListener to ams. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param listener Indicates the MissionListener to be registered. * @return The index number of the MissionListener. */ function registerMissionListener(listener: MissionListener): number; @@ -42,7 +43,8 @@ declare namespace missionManager { * Unrgister the missionListener to ams. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param listenerId Indicates the listener id to be unregistered. * @return - */ function unregisterMissionListener(listenerId: number, callback: AsyncCallback): void; @@ -52,7 +54,9 @@ declare namespace missionManager { * Get the missionInfo with the given missionId. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param deviceId Indicates the device to be queried. + * @param missionId Indicates mission id to be queried. * @return the {@link MissionInfo} of the given id. */ function getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback): void; @@ -62,7 +66,9 @@ declare namespace missionManager { * Get the missionInfo with the given missionId. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param deviceId Indicates the device to be queried. + * @param numMax Indicates the maximum number of returned missions. * @return The array of the {@link MissionInfo}. */ function getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback>): void; @@ -72,7 +78,9 @@ declare namespace missionManager { * Get the mission snapshot with the given missionId. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param deviceId Indicates the device to be queried. + * @param missionId Indicates mission id to be queried. * @return The {@link MissionSnapshot} of the given id. */ function getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void; @@ -82,7 +90,8 @@ declare namespace missionManager { * Lock the mission. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param missionId Indicates mission id to be locked. * @return - */ function lockMission(missionId: number, callback: AsyncCallback): void; @@ -92,7 +101,8 @@ declare namespace missionManager { * Unlock the mission. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param missionId Indicates mission id to be unlocked. * @return - */ function unlockMission(missionId: number, callback: AsyncCallback): void; @@ -102,7 +112,8 @@ declare namespace missionManager { * Clear the given mission in the ability manager service. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param missionId Indicates mission id to be cleared. * @return - */ function clearMission(missionId: number, callback: AsyncCallback): void; @@ -112,7 +123,7 @@ declare namespace missionManager { * Clear all missions in the ability manager service. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @return - */ function clearAllMissions(callback: AsyncCallback): void; @@ -122,7 +133,9 @@ declare namespace missionManager { * Schedule the given mission to foreground. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param missionId Indicates mission id to be moved to foreground. + * @param options Indicates the start options. * @return - */ function moveMissionToFront(missionId: number, callback: AsyncCallback): void; diff --git a/api/application/ExtensionContext.d.ts b/api/@ohos.application.testRunner.d.ts similarity index 56% rename from api/application/ExtensionContext.d.ts rename to api/@ohos.application.testRunner.d.ts index b08fcc76a38603b5a28acc7e064682ac5c2d4345..dc8e559d3f4cde6916a2d229946f69e6a9d74a49 100644 --- a/api/application/ExtensionContext.d.ts +++ b/api/@ohos.application.testRunner.d.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), + * 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 * @@ -13,35 +13,31 @@ * limitations under the License. */ -import { HapModuleInfo } from "../bundle/hapModuleInfo"; -import { Configuration } from '../@ohos.application.Configuration'; -import Context from "./Context"; - /** - * The context of an extension. It allows access to extension-specific resources. + * Base class for the test framework. + * If you want to implement your own unit test framework, you must inherit this class and overrides all its methods. * - * @since 9 + * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import TestRunner from '@ohos.application.testRunner' * @permission N/A - * @StageModelOnly */ -export default class ExtensionContext extends Context { - +export interface TestRunner { /** - * Indicates configuration information about an module. + * Prepare the unit testing environment for running test cases. * - * @since 9 + * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly */ - currentHapModuleInfo: HapModuleInfo; + onPrepare(): void; /** - * Indicates configuration information. + * Run all test cases. * - * @since 9 + * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly */ - config: Configuration; -} \ No newline at end of file + onRun(): void; +} + +export default TestRunner; \ No newline at end of file diff --git a/api/@ohos.batteryinfo.d.ts b/api/@ohos.batteryInfo.d.ts similarity index 93% rename from api/@ohos.batteryinfo.d.ts rename to api/@ohos.batteryInfo.d.ts index a139929f6d85cb3fb8640a99e1fc7d45eabf1762..05b49542cab99d5f5d03e94aee99683880b67428 100644 --- a/api/@ohos.batteryinfo.d.ts +++ b/api/@ohos.batteryInfo.d.ts @@ -19,7 +19,7 @@ *

Battery information includes the remaining battery power, * voltage, temperature, model, and charger type. * - * @sysCap SystemCapability.PowerManager.BatteryManage.Core + * @syscap SystemCapability.PowerManager.BatteryManager.Core * @since 6 */ declare namespace batteryInfo { @@ -74,7 +74,7 @@ declare namespace batteryInfo { /** * Indicates the charger type of a device. * - * @sysCap SystemCapability.PowerManager.BatteryManage.Core + * @syscap SystemCapability.PowerManager.BatteryManager.Core * @since 6 */ export enum BatteryPluggedType { @@ -103,7 +103,7 @@ declare namespace batteryInfo { /** * Indicates the battery charging status of a device. * - * @sysCap SystemCapability.PowerManager.BatteryManage.Core + * @syscap SystemCapability.PowerManager.BatteryManager.Core * @since 6 */ export enum BatteryChargeState { @@ -132,7 +132,7 @@ declare namespace batteryInfo { /** * Indicates the battery health status of a device. * - * @sysCap SystemCapability.PowerManager.BatteryManage.Core + * @syscap SystemCapability.PowerManager.BatteryManager.Core * @since 6 */ export enum BatteryHealthState { diff --git a/api/@ohos.bluetooth.d.ts b/api/@ohos.bluetooth.d.ts index 155520f1577dba21ce71d391fa7fe83da1f8805c..38e7044b419687b8c9cff20d0c70fc809787a041 100644 --- a/api/@ohos.bluetooth.d.ts +++ b/api/@ohos.bluetooth.d.ts @@ -18,19 +18,20 @@ import { AsyncCallback, Callback } from "./basic"; /** * Provides methods to operate or manage Bluetooth. * @since 7 + * @import import bluetooth frome '@ohos.bluetooth'; * @syscap SystemCapability.Communication.Bluetooth.Core */ declare namespace bluetooth { - /** - * Obtains the Bluetooth status of a device. - * - * @return Returns the Bluetooth status, which can be {@link BluetoothState#STATE_OFF}, - * {@link BluetoothState#STATE_TURNING_ON}, {@link BluetoothState#STATE_ON}, {@link BluetoothState#STATE_TURNING_OFF}, - * {@link BluetoothState#STATE_BLE_TURNING_ON}, {@link BluetoothState#STATE_BLE_ON}, - * or {@link BluetoothState#STATE_BLE_TURNING_OFF}. - * @since 7 - * @permission ohos.permission.USE_BLUETOOTH - */ + /** + * Obtains the Bluetooth status of a device. + * + * @return Returns the Bluetooth status, which can be {@link BluetoothState#STATE_OFF}, + * {@link BluetoothState#STATE_TURNING_ON}, {@link BluetoothState#STATE_ON}, {@link BluetoothState#STATE_TURNING_OFF}, + * {@link BluetoothState#STATE_BLE_TURNING_ON}, {@link BluetoothState#STATE_BLE_ON}, + * or {@link BluetoothState#STATE_BLE_TURNING_OFF}. + * @since 7 + * @permission ohos.permission.USE_BLUETOOTH + */ function getState(): BluetoothState; /** @@ -121,6 +122,16 @@ declare namespace bluetooth { */ function getPairedDevices(): Array; + /** + * Obtains the connection state of profile. + * + * @param profileId The profile id. + * @return Returns the connection state. + * @since 8 + * @permission ohos.permission.USE_BLUETOOTH + */ + function getProfileConnState(profileId: ProfileId): ProfileConnectionState; + /** * Sets the confirmation of pairing with a certain device. * @@ -336,6 +347,134 @@ declare namespace bluetooth { */ function off(type: "sppRead", clientSocket: number, callback?: Callback): void; + /** + * Obtains the instance of profile. + * + * @param profileId The profile id.. + * @return Returns instance of profile. + * @since 8 + */ + function getProfile(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile; + + /** + * Base interface of profile. + */ + interface BaseProfile { + /** + * Obtains the connected devices list of profile. + * + * @return Returns the address of connected devices list. + * @since 8 + * @permission ohos.permission.USE_BLUETOOTH + */ + getConnectionDevices(): Array; + + /** + * Obtains the profile state of device. + * + * @param device The address of bluetooth device. + * @return Returns {@link ProfileConnectionState} of device. + * @since 8 + * @permission ohos.permission.USE_BLUETOOTH + */ + getDeviceState(device: string): ProfileConnectionState; + } + + /** + * Manager a2dp source profile. + */ + interface A2dpSourceProfile extends BaseProfile { + /** + * Connect to device with a2dp. + * + * @param device The address of the remote device to connect. + * @return Returns {@code true} if the connect is in process; returns {@code false} otherwise. + * @since 8 + * @permission permission ohos.permission.DISCOVER_BLUETOOTH + */ + connect(device: string): boolean; + + /** + * Disconnect to device with a2dp. + * + * @param device The address of the remote device to disconnect. + * @return Returns {@code true} if the disconnect is in process; returns {@code false} otherwise. + * @since 8 + * @permission permission ohos.permission.DISCOVER_BLUETOOTH + */ + disconnect(device: string): boolean; + + /** + * Subscribe the event reported when the profile connection state changes . + * + * @param type Type of the profile connection state changes event to listen for . + * @param callback Callback used to listen for event. + * @since 8 + */ + on(type: "connectionStateChange", callback: Callback): void; + + /** + * Unsubscribe the event reported when the profile connection state changes . + * + * @param type Type of the profile connection state changes event to listen for . + * @param callback Callback used to listen for event. + * @since 8 + */ + off(type: "connectionStateChange", callback?: Callback): void; + + /** + * Obtains the playing state of device. + * + * @param device The address of the remote device. + * @return Returns {@link PlayingState} of the remote device. + * + */ + getPlayingState(device: string): PlayingState; + } + + /** + * Manager handsfree AG profile. + */ + interface HandsFreeAudioGatewayProfile extends BaseProfile { + /** + * Connect to device with hfp. + * + * @param device The address of the remote device to connect. + * @return Returns {@code true} if the connect is in process; returns {@code false} otherwise. + * @since 8 + * @permission permission ohos.permission.DISCOVER_BLUETOOTH + */ + connect(device: string): boolean; + + /** + * Disconnect to device with hfp. + * + * @param device The address of the remote device to disconnect. + * @return Returns {@code true} if the disconnect is in process; returns {@code false} otherwise. + * @since 8 + * @permission permission ohos.permission.DISCOVER_BLUETOOTH + */ + disconnect(device: string): boolean; + + /** + * Subscribe the event reported when the profile connection state changes . + * + * @param type Type of the profile connection state changes event to listen for . + * @param callback Callback used to listen for event. + * @since 8 + */ + on(type: "connectionStateChange", callback: Callback): void; + + /** + * Unsubscribe the event reported when the profile connection state changes . + * + * @param type Type of the profile connection state changes event to listen for . + * @param callback Callback used to listen for event. + * @since 8 + */ + off(type: "connectionStateChange", callback?: Callback): void; + } + namespace BLE { /** * create a JavaScript Gatt server instance. @@ -411,7 +550,6 @@ declare namespace bluetooth { * Manages GATT server. Before calling an Gatt server method, you must use {@link createGattServer} to create an GattServer instance. */ interface GattServer { - /** * Starts BLE advertising. * @@ -781,9 +919,9 @@ declare namespace bluetooth { /** The UUID of the {@link GattService} instance to which the characteristic belongs */ serviceUuid: string; /** The UUID of a BLECharacteristic instance */ - characteristicUuid: string; + characteristicUuid: string; /** The value of a BLECharacteristic instance */ - characteristicValue: ArrayBuffer; + characteristicValue: ArrayBuffer; /** The list of {@link BLEDescriptor} contained in the characteristic */ descriptors: Array; } @@ -1306,6 +1444,39 @@ declare namespace bluetooth { HEALTH_GENERIC_HEALTH_MANAGER = 0x0938, HEALTH_PERSONAL_MOBILITY_DEVICE = 0x093C, } + + /** + * Profile state change parameters. + * + * @since 8 + */ + interface StateChangeParam { + /** The address of device */ + deviceId: string; + + /** Profile state value */ + state: ProfileConnectionState; + } + + /** + * The enum of a2dp playing state. + * + * @since 8 + */ + enum PlayingState { + STATE_NOT_PLAYING, + STATE_PLAYING, + } + + /** + * The enum of profile id. + * + * @since 8 + */ + enum ProfileId { + PROFILE_A2DP_SOURCE = 1, + PROFILE_HANDS_FREE_AUDIO_GATEWAY = 4, + } } export default bluetooth; diff --git a/api/@ohos.brightness.d.ts b/api/@ohos.brightness.d.ts index f12bc7a706745b47aa73eda3fb6a1c0ad3745153..bb8b0988049e37d66b524897ad8c45d672ee5326 100644 --- a/api/@ohos.brightness.d.ts +++ b/api/@ohos.brightness.d.ts @@ -18,7 +18,7 @@ import { AsyncCallback } from './basic'; /** * Provides interfaces to control the power of display. * - * @sysCap SystemCapability.PowerManager.DisplayPowerManager + * @syscap SystemCapability.PowerManager.DisplayPowerManager * @since 7 */ declare namespace brightness { @@ -26,7 +26,6 @@ declare namespace brightness { * Sets the screen brightness. * * @param value Brightness value, ranging from 0 to 255. - * @sysCap SystemCapability.PowerManager.DisplayPowerManager * @systemapi * @since 7 */ diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 8d2be229f4907e7bfdafb13592a25f9d9f47a9b2..2f5505fb2b98127a064950d940b7b25912832322 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -17,12 +17,10 @@ import { AsyncCallback, Callback } from './basic'; import { ApplicationInfo } from './bundle/applicationInfo'; import { BundleInfo } from './bundle/bundleInfo'; import { AbilityInfo } from './bundle/abilityInfo'; -import { ExtensionAbilityInfo } from './bundle/extensionAbilityInfo'; import { Want } from './ability/want'; import { BundleInstaller } from './bundle/bundleInstaller'; -import { ShortcutInfo } from './bundle/shortcutInfo'; -import { ModuleUsageRecord } from './bundle/moduleUsageRecord'; import { PermissionDef } from './bundle/PermissionDef'; +import image from './@ohos.multimedia.image'; /** * bundle. @@ -52,10 +50,6 @@ declare namespace bundle { * @since 8 */ GET_ABILITY_INFO_WITH_METADATA = 0x00000020, - /** - * @since 9 - */ - GET_BUNDLE_WITH_EXTENSION_ABILITY = 0x00000020, /** * @since 8 */ @@ -74,20 +68,6 @@ declare namespace bundle { GET_APPLICATION_INFO_WITH_DISABLE = 0x00000200, } -/** - * @name ExtensionFlag - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @import NA - * @permission NA - */ - enum ExtensionFlag { - GET_EXTENSION_INFO_DEFAULT = 0x00000000, - GET_EXTENSION_INFO_WITH_PERMISSION = 0x00000002, - GET_EXTENSION_INFO_WITH_APPLICATION = 0x00000004, - GET_EXTENSION_INFO_WITH_METADATA = 0x00000020, - } - /** * @name ColorMode * @since 7 @@ -222,76 +202,6 @@ declare namespace bundle { STANDARD = 1, } - /** - * @name ExtensionAbilityType - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @import NA - * @permission NA - */ - export enum ExtensionAbilityType { - /** - * @default Indicates extension info with type of form - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - FORM = 0, - /** - * @default Indicates extension info with type of work schedule - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - WORK_SCHEDULER = 1, - /** - * @default Indicates extension info with type of input method - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - INPUT_METHOD = 2, - /** - * @default Indicates extension info with type of service - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - SERVICE = 3, - /** - * @default Indicates extension info with type of accessibility - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - ACCESSIBILITY = 4, - /** - * @default Indicates extension info with type of datashare - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - DATA_SHARE = 5, - /** - * @default Indicates extension info with type of fileshare - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - FILE_SHARE = 6, - /** - * @default Indicates extension info with type of staticsubscriber - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - STATIC_SUBSCRIBER = 7, - /** - * @default Indicates extension info with type of wallpaper - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - WALLPAPER = 8, - /** - * @default Indicates extension info with type of unspecified - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - UNSPECIFIED = 9, - } - /** * @name BundleOptions * @since 7 @@ -368,7 +278,7 @@ declare namespace bundle { * @param bundleFlags Indicates the application bundle flags to be queried. * @param options Indicates the bundle options object. * @return Returns the BundleInfo object. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED,ohos.permission.GET_BUNDLE_INFO + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO */ function getBundleInfo(bundleName: string, bundleFlags: number, options: BundleOptions, callback: AsyncCallback): void; function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback): void; @@ -381,9 +291,23 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @return Returns the IBundleInstaller interface. * @permission ohos.permission.INSTALL_BUNDLE + * @systemapi Hide this for inner system use */ function getBundleInstaller(callback: AsyncCallback): void; function getBundleInstaller(): Promise; + + /** + * Obtains information about the current ability. + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @param bundleName Indicates the application bundle name to be queried. + * @param abilityName Indicates the ability name. + * @return Returns the AbilityInfo object for the current ability. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + */ + function getAbilityInfo(bundleName: string, abilityName: string, callback: AsyncCallback): void; + function getAbilityInfo(bundleName: string, abilityName: string): Promise; /** * Obtains based on a given bundle name. @@ -393,12 +317,13 @@ declare namespace bundle { * @param bundleName Indicates the application bundle name to be queried. * @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo object * that will be returned. - * @param userId Indicates the user ID. + * @param userId Indicates the user ID or do not pass user ID. * @return Returns the ApplicationInfo object. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO */ function getApplicationInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback) : void; - function getApplicationInfo(bundleName: string, bundleFlags: number, userId: number) : Promise; + function getApplicationInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback) : void; + function getApplicationInfo(bundleName: string, bundleFlags: number, userId?: number) : Promise; /** * Query the AbilityInfo by the given Want. @@ -411,7 +336,7 @@ declare namespace bundle { * will be returned. * @param userId Indicates the user ID. * @return Returns a list of AbilityInfo objects. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO */ function queryAbilityByWant(want: Want, bundleFlags: number, userId: number, callback: AsyncCallback>): void; function queryAbilityByWant(want: Want, bundleFlags: number, callback: AsyncCallback>): void; @@ -422,15 +347,15 @@ declare namespace bundle { * * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundlelFlag Indicates the flag used to specify information contained in the BundleInfo that will be + * @param bundleFlag Indicates the flag used to specify information contained in the BundleInfo that will be * returned. * @param userId Indicates the user id. * @return Returns a list of BundleInfo objects. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED */ - function getAllBundleInfo(bundlelFlag: BundleFlag, userId: number, callback: AsyncCallback>) : void; - function getAllBundleInfo(bundlelFlag: BundleFlag, callback: AsyncCallback>) : void; - function getAllBundleInfo(bundlelFlag: BundleFlag, userId?: number) : Promise>; + function getAllBundleInfo(bundleFlag: BundleFlag, userId: number, callback: AsyncCallback>) : void; + function getAllBundleInfo(bundleFlag: BundleFlag, callback: AsyncCallback>) : void; + function getAllBundleInfo(bundleFlag: BundleFlag, userId?: number) : Promise>; /** * Obtains information about all installed applications of a specified user. @@ -439,12 +364,13 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo objects * that will be returned. - * @param userId Indicates the user ID. + * @param userId Indicates the user ID or do not pass user ID. * @return Returns a list of ApplicationInfo objects. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED */ function getAllApplicationInfo(bundleFlags: number, userId: number, callback: AsyncCallback>) : void; - function getAllApplicationInfo(bundleFlags: number, userId: number) : Promise>; + function getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback>) : void; + function getAllApplicationInfo(bundleFlags: number, userId?: number) : Promise>; /** * Obtains bundle name by the given uid. @@ -471,8 +397,6 @@ declare namespace bundle { function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback) : void function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number) : Promise; - /** - /** * Obtains the Want for starting the main ability of an application based on the * given bundle name. The main ability of an application is the ability that has the @@ -489,30 +413,6 @@ declare namespace bundle { function getLaunchWantForBundle(bundleName: string, callback: AsyncCallback): void; function getLaunchWantForBundle(bundleName: string): Promise; - /** - * Obtains information about the shortcuts of the application. - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the bundle name of the application. - * @return Returns a list of ShortcutInfo objects containing shortcut information about the application. - * @permission ohos.permission.MANAGE_SHORTCUTS - */ - function getAllShortcutInfo(bundleName: string, callback: AsyncCallback>): void; - function getAllShortcutInfo(bundleName: string): Promise>; - - /** - * get module usage record list in descending order of lastLaunchTime. - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param maxNum the return size of the records, must be in range of 1 to 1000. - * @return Returns ability usage record list. - * @systemapi hide this for inner system use - */ - function getModuleUsageRecords(maxNum: number, callback: AsyncCallback>): void; - function getModuleUsageRecords(maxNum: number): Promise>; - /** * Clears cache data of a specified application. * @@ -554,22 +454,6 @@ declare namespace bundle { function setAbilityEnabled(info: AbilityInfo, isEnable: boolean, callback: AsyncCallback): void; function setAbilityEnabled(info: AbilityInfo, isEnable: boolean): Promise; - /** - * Query extension info of by utilizing a Want. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param want Indicates the Want containing the application bundle name to be queried. - * @param extensionFlags Indicates the flag used to specify information contained in the ExtensionInfo objects that - * will be returned. - * @param userId Indicates the user ID. - * @return Returns a list of ExtensionInfo objects. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO - */ - function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId: number, callback: AsyncCallback>): void; - function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, callback: AsyncCallback>): void; - function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId?: number): Promise>; - /** * Get the permission details by permissionName. * @@ -582,6 +466,54 @@ declare namespace bundle { */ function getPermissionDef(permissionName: string, callback: AsyncCallback): void; function getPermissionDef(permissionName: string): Promise; + + /** + * Obtains the label of a specified ability. + * + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + * @param bundleName Indicates the bundle name of the application to which the ability belongs. + * @param abilityName Indicates the ability name. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @return Returns the label representing the label of the specified ability. + */ + function getAbilityLabel(bundleName: string, abilityName: string, callback: AsyncCallback): void; + function getAbilityLabel(bundleName: string, abilityName: string): Promise; + + /** + * Obtains the icon of a specified ability. + * + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + * @param bundleName Indicates the bundle name of the application to which the ability belongs. + * @param abilityName Indicates the ability name. + * @return Returns the PixelMap object representing the icon of the specified ability. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + */ + function getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback): void; + function getAbilityIcon(bundleName: string, abilityName: string): Promise; + + /** + * Checks whether a specified ability is enabled. + * + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + * @param info Indicates information about the ability to check. + * @returns Returns true if the ability is enabled; returns false otherwise. + */ + function isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback): void; + function isAbilityEnabled(info: AbilityInfo): Promise; + + /** + * Checks whether a specified application is enabled. + * + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + * @param bundleName Indicates the bundle name of the application. + * @returns Returns true if the application is enabled; returns false otherwise. + */ + function isApplicationEnabled(bundleName: string, callback: AsyncCallback): void; + function isApplicationEnabled(bundleName: string): Promise; } export default bundle; diff --git a/api/@ohos.bundleState.d.ts b/api/@ohos.bundleState.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0734372b77c45a6e0346c9da414c196ed23e4d51 --- /dev/null +++ b/api/@ohos.bundleState.d.ts @@ -0,0 +1,249 @@ +/* + * Copyright (c) 2022 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 { AsyncCallback } from './basic'; + +/** + * Provides methods for managing bundle usage statistics, + * including the methods for querying bundle usage information and state data. + * + *

You can use the methods defined in this class to query + * the usage history and states of bundles in a specified period. + * The system stores the query result in a {@link BundleStateInfo} or {@link BundleActiveState} instance and + * then returns it to you. + * + * @since 7 + */ +declare namespace bundleState { + + /** + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + */ + interface BundleStateInfo { + /** + * the identifier of BundleStateInfo. + */ + id: number; + /** + * the total duration, in milliseconds. + */ + abilityInFgTotalTime?: number; + /** + * the last time when the application was accessed, in milliseconds. + */ + abilityPrevAccessTime?: number; + /** + * the last time when the application was visible in the foreground, in milliseconds. + */ + abilityPrevSeenTime?: number; + /** + * the total duration, in milliseconds. + */ + abilitySeenTotalTime?: number; + /** + * the bundle name of the application. + */ + bundleName?: string; + /** + * the total duration, in milliseconds. + */ + fgAbilityAccessTotalTime?: number; + /** + * the last time when the foreground application was accessed, in milliseconds. + */ + fgAbilityPrevAccessTime?: number; + /** + * the time of the first bundle usage record in this {@code BundleActiveInfo} object, + * in milliseconds. + */ + infosBeginTime?: number; + /** + * the time of the last bundle usage record in this {@code BundleActiveInfo} object, + * in milliseconds. + */ + infosEndTime?: number; + + /** + * Merges a specified {@link BundleActiveInfo} object with this {@link BundleActiveInfo} object. + * The bundle name of both objects must be the same. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @param toMerge Indicates the {@link BundleActiveInfo} object to merge. + * if the bundle names of the two {@link BundleActiveInfo} objects are different. + */ + merge(toMerge: BundleStateInfo): void; + } + + /** + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + */ + interface BundleActiveState { + /** + * the usage priority group of the application. + */ + appUsagePriorityGroup?: number; + /** + * the bundle name. + */ + bundleName?: string; + /** + * the shortcut ID. + */ + indexOfLink?: string; + /** + * the class name. + */ + nameOfClass?: string; + /** + * the time when this state occurred, in milliseconds. + */ + stateOccurredTime?: number; + /** + * the state type. + */ + stateType?: number; + } + + /** + * Checks whether the application with a specified bundle name is in the idle state. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @param bundleName Indicates the bundle name of the application to query. + * @return Returns {@code true} if the application is idle in a particular period; + * returns {@code false} otherwise. The time range of the particular period is defined by the system, + * which may be hours or days. + */ + function isIdleState(bundleName: string, callback: AsyncCallback): void; + function isIdleState(bundleName: string): Promise; + + /** + * Queries the usage priority group of the calling application. + * + *

The priority defined in a priority group restricts the resource usage of an application, + * for example, restricting the running of background tasks.

+ * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @return Returns the usage priority group of the calling application. + */ + function queryAppUsagePriorityGroup(callback: AsyncCallback): void; + function queryAppUsagePriorityGroup(): Promise; + + /** + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + */ + interface BundleActiveInfoResponse { + [key: string]: BundleStateInfo; + } + + /** + * Queries usage information about each bundle within a specified period. + * + *

This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.

+ * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param begin Indicates the start time of the query period, in milliseconds. + * @param end Indicates the end time of the query period, in milliseconds. + * @return Returns the {@link BundleActiveInfoResponse} objects containing the usage information about each bundle. + */ + function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void; + function queryBundleStateInfos(begin: number, end: number): Promise; + + /** + * Declares interval type. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + */ + export enum IntervalType { + /** + * Indicates the interval type that will determine the optimal interval based on the start and end time. + */ + BY_OPTIMIZED = 0, + + /** + * Indicates the daily interval. + */ + BY_DAILY = 1, + + /** + * Indicates the weekly interval. + */ + BY_WEEKLY = 2, + + /** + * Indicates the monthly interval. + */ + BY_MONTHLY = 3, + + /** + * Indicates the annually interval. + */ + BY_ANNUALLY = 4 + } + + /** + * Queries usage information about each bundle within a specified period at a specified interval. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param byInterval Indicates the interval at which the usage statistics are queried. + * The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY}, + * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}. + * @param begin Indicates the start time of the query period, in milliseconds. + * @param end Indicates the end time of the query period, in milliseconds. + * @return Returns the list of {@link BundleStateInfo} objects containing the usage information about each bundle. + */ + function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; + function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; + + /** + * Queries state data of all bundles within a specified period identified by the start and end time. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param begin Indicates the start time of the query period, in milliseconds. + * @param end Indicates the end time of the query period, in milliseconds. + * @return Returns the list of {@link BundleActiveState} objects containing the state data of all bundles. + */ + function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; + function queryBundleActiveStates(begin: number, end: number): Promise>; + + /** + * Queries state data of the current bundle within a specified period. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @param begin Indicates the start time of the query period, in milliseconds. + * @param end Indicates the end time of the query period, in milliseconds. + * @return Returns the {@link BundleActiveState} object Array containing the state data of the current bundle. + */ + function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; + function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; +} + +export default bundleState; \ No newline at end of file diff --git a/api/@ohos.bytrace.d.ts b/api/@ohos.bytrace.d.ts index 81b8ffbfadfe0fd6be975ecd42fcd0ead5dd7529..e1b5a1ccad9e88567a91a9438207dc6e36b2620f 100644 --- a/api/@ohos.bytrace.d.ts +++ b/api/@ohos.bytrace.d.ts @@ -36,7 +36,7 @@ * * @deprecated * @since 7 - * @syscap SystemCapability.Developtools.Bytrace + * @syscap SystemCapability.HiviewDFX.HiTrace */ declare namespace bytrace { /** @@ -49,7 +49,7 @@ declare namespace bytrace { * * @deprecated * @since 7 - * @syscap SystemCapability.Developtools.Bytrace + * @syscap SystemCapability.HiviewDFX.HiTrace * @param name Indicates the task name. * @param taskId The unique id used to distinguish the tasks and match with the id in follow finishTrace. * @param expectedTime Indicates the expected time required for completing the task, in milliseconds. @@ -64,7 +64,7 @@ declare namespace bytrace { * * @deprecated * @since 7 - * @syscap SystemCapability.Developtools.Bytrace + * @syscap SystemCapability.HiviewDFX.HiTrace * @param name Indicates the task name. It must be the same whith the {@code name} of startTrace. * @param taskId The unique id used to distinguish the tasks and must be the same whith the . * {@code taskId} of startTrace. @@ -76,7 +76,7 @@ declare namespace bytrace { * * @deprecated * @since 7 - * @syscap SystemCapability.Developtools.Bytrace + * @syscap SystemCapability.HiviewDFX.HiTrace * @param name Indicates the name used to identify the count. * @param count Indicates the number of the count. */ diff --git a/api/@ohos.commonEvent.d.ts b/api/@ohos.commonEvent.d.ts index e9b04424dc98e1dddef6814796df654253435606..a017a91324da3c2d37a5d5a20be24a46fa9c589b 100644 --- a/api/@ohos.commonEvent.d.ts +++ b/api/@ohos.commonEvent.d.ts @@ -170,6 +170,12 @@ declare namespace commonEvent { */ COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON", + /** + * this commonEvent means when the thermal state level change + * @since 8 + */ + COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED", + /** * this commonEvent means when the user is present after the device waked up. */ @@ -887,41 +893,6 @@ declare namespace commonEvent { */ COMMON_EVENT_DISK_EJECT = "usual.event.data.DISK_EJECT", - /** - * The external storage was removed. - * This is a protected common event that can only be sent by system. - * @since 8 - */ - COMMON_EVENT_VOLUME_REMOVED = "usual.event.data.VOLUME_REMOVED", - - /** - * The external storage was unmounted. - * This is a protected common event that can only be sent by system. - * @since 8 - */ - COMMON_EVENT_VOLUME_UNMOUNTED = "usual.event.data.VOLUME_UNMOUNTED", - - /** - * The external storage was mounted. - * This is a protected common event that can only be sent by system. - * @since 8 - */ - COMMON_EVENT_VOLUME_MOUNTED = "usual.event.data.VOLUME_MOUNTED", - - /** - * The external storage was bad removal. - * This is a protected common event that can only be sent by system. - * @since 8 - */ - COMMON_EVENT_VOLUME_BAD_REMOVAL = "usual.event.data.VOLUME_BAD_REMOVAL", - - /** - * The external storage was eject. - * This is a protected common event that can only be sent by system. - * @since 8 - */ - COMMON_EVENT_VOLUME_EJECT = "usual.event.data.VOLUME_EJECT", - /** * The visible of account was updated. * This is a protected common event that can only be sent by system. diff --git a/api/@ohos.configPolicy.d.ts b/api/@ohos.configPolicy.d.ts index 32ef672ca08824e798623f0eccb68857b4f4b5f3..d12690c30faca84069c5fedcbef457ed789f20f1 100644 --- a/api/@ohos.configPolicy.d.ts +++ b/api/@ohos.configPolicy.d.ts @@ -19,7 +19,7 @@ import {AsyncCallback} from "./basic"; * Provides file path related APIS. * * @since 8 - * @sysCap SystemCapability.Customization.ConfigPolicy + * @syscap SystemCapability.Customization.ConfigPolicy */ declare namespace configPolicy { /** @@ -27,7 +27,7 @@ declare namespace configPolicy { * * @since 8 * @systemapi Hide this for inner system use. - * @sysCap SystemCapability.Customization.ConfigPolicy + * @syscap SystemCapability.Customization.ConfigPolicy * @param relPath the relative path of the config file. * @return Returns the path of the highest priority config file. */ @@ -39,7 +39,7 @@ declare namespace configPolicy { * * @since 8 * @systemapi Hide this for inner system use. - * @sysCap SystemCapability.Customization.ConfigPolicy + * @syscap SystemCapability.Customization.ConfigPolicy * @param relPath the relative path of the config file. * @return Returns paths of config files. */ @@ -51,7 +51,7 @@ declare namespace configPolicy { * * @since 8 * @systemapi Hide this for inner system use. - * @sysCap SystemCapability.Customization.ConfigPolicy + * @syscap SystemCapability.Customization.ConfigPolicy * @return Returns paths of config directories. */ function getCfgDirList(callback: AsyncCallback>); diff --git a/api/@ohos.connectedTag.d.ts b/api/@ohos.connectedTag.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..bdaffa2a5d9c3584fb47e0e443f23fa109b19f88 --- /dev/null +++ b/api/@ohos.connectedTag.d.ts @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2022 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 { AsyncCallback, Callback } from './basic'; + +/** + * Provides methods to operate or manage Connected Tag. + * + * @since 8 + * @syscap SystemCapability.Communication.ConnectedTag + * @import import connectedTag from '@ohos.connectedTag'; + */ +declare namespace connectedTag { + /** + * Initializes Connected Tag. + * + * @return Returns true or false. + * @permissions ohos.permission.NFC_TAG + * + * @since 8 + */ + function init(): boolean; + + /** + * UnInitializes Connected Tag. + * + * @return Returns true or false. + * @permissions ohos.permission.NFC_TAG + * + * @since 8 + */ + function uninit(): boolean; + + /** + * Reads the NDEF Data. + * + * @return Returns the NDEF Data. + * @permissions ohos.permission.NFC_TAG + * + * @since 8 + */ + function readNdefTag(): Promise; + function readNdefTag(callback: AsyncCallback): void; + + /** + * Writes the NDEF Data. + * + * @param data The Data to write. + * @return Returns true or false. + * @permissions ohos.permission.NFC_TAG + * + * @since 8 + */ + function writeNdefTag(data: string): Promise; + function writeNdefTag(data: string, callback: AsyncCallback): void; + + /** + * Subscribes NFC RF status change events. + * + * @type The callback type. + * @param callback The callback function to be registered. + * @return Returns NFC_RF_LEAVE or NFC_RF_ENTER + * @permissions ohos.permission.NFC_TAG + * + * @since 8 + */ + function on(type: "notify", callback: Callback): void; + + /** + * Unsubscribes NFC RF status change events. + * + *

All callback functions will be deregistered If there is no specific callback parameter.

+ * + * @type The callback type. + * @param callback The callback function to be unregistered. + * @permissions ohos.permission.NFC_TAG + * + * @since 8 + */ + function off(type: "notify", callback?:Callback): void; + + /** + * Describes the NFC RF type. + * + * @since 8 + */ + enum NfcRfType { + /** NFC RF LEAVE */ + NFC_RF_LEAVE = 0; + + /** NFC RF ENTER */ + NFC_RF_ENTER = 1; + } +} + +export default connectedTag; \ No newline at end of file diff --git a/api/ohos.contact.d.ts b/api/@ohos.contact.d.ts similarity index 94% rename from api/ohos.contact.d.ts rename to api/@ohos.contact.d.ts index 8242ea2aa908223940061fe16f7ff3421e38f5e7..17d1ce7ad0c40fbb4d88207d1f132705bbd52ad4 100644 --- a/api/ohos.contact.d.ts +++ b/api/@ohos.contact.d.ts @@ -26,22 +26,31 @@ declare namespace contact { /** * Creates a contact. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param contact Indicates the contact information. * @return Returns the contact ID (which can be obtained by {@link Contact#getId()}) if the creation is successful; * returns {@link Contact#INVALID_CONTACT_ID} if the creation fails. + * @permision ohos.permission.WRITE_CONTACTS */ function addContact(contact: Contact, callback: AsyncCallback): void; function addContact(contact: Contact): Promise; /** - * Deletes a specified contact. + * Select contact. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} + * @return Returns the contact list which user select; + * returns empty contact list if user not select. + * @syscap SystemCapability.Applications.ContactsData, SystemCapability.Applications.Contacts + * @permission ohos.permission.READ_CONTACTS + */ + function selectContact(callback: AsyncCallback>): void; + function selectContact(): Promise>; + + /** + * Deletes a specified contact. * * @param key Indicates the unique query key of a contact to delete. * @return Returns {@code true} if the contact is deleted; returns {@code false} otherwise. + * @permision ohos.permission.WRITE_CONTACTS */ function deleteContact(key: string, callback: AsyncCallback): void; function deleteContact(key: string): Promise; @@ -49,12 +58,11 @@ declare namespace contact { /** * Queries a specified contact of specified attributes. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param key Indicates the unique query key of a contact. * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @param attrs Indicates the contact attributes. If this parameter is null, all attributes are used for matching. * @return Returns the specified contact. + * @permission ohos.permission.READ_CONTACTS */ function queryContact(key: string, callback: AsyncCallback): void; function queryContact(key: string, holder: Holder, callback: AsyncCallback): void; @@ -65,11 +73,10 @@ declare namespace contact { /** * Queries contacts with query conditions. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @param attrs Indicates the contact attributes. If this parameter is null, all attributes are used for matching. * @return Returns the {@code Contact} list object. + * @permission ohos.permission.READ_CONTACTS */ function queryContacts(callback: AsyncCallback>): void; function queryContacts(holder: Holder, callback: AsyncCallback>): void; @@ -80,12 +87,11 @@ declare namespace contact { /** * Queries contacts by a specified email address, contact holder, and contact attributes. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param email Indicates the email address. * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @param attrs Indicates the contact attributes. If this parameter is null, all attributes are used for matching. * @return Returns a {@code Contact} list object. + * @permission ohos.permission.READ_CONTACTS */ function queryContactsByEmail(email: string, callback: AsyncCallback>): void; function queryContactsByEmail(email: string, holder: Holder, callback: AsyncCallback>): void; @@ -96,13 +102,12 @@ declare namespace contact { /** * Queries contacts by a phone number, holder, and contact attribute. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS}. - * * @param phoneNumber Indicates the phone number. Only full match is supported, and wildcards are not supported. * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @param attrs Indicates the contact attribute. If this parameter is null, * all attributes will be used for matching. * @return Returns the {@code Contact} list object. + * @permission ohos.permission.READ_CONTACTS */ function queryContactsByPhoneNumber(phoneNumber: string, callback: AsyncCallback>): void; function queryContactsByPhoneNumber(phoneNumber: string, holder: Holder, callback: AsyncCallback>): void; @@ -113,10 +118,9 @@ declare namespace contact { /** * Queries contact groups. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @return Returns the contact group list. + * @permission ohos.permission.READ_CONTACTS */ function queryGroups(callback: AsyncCallback>): void; function queryGroups(holder: Holder, callback: AsyncCallback>): void; @@ -125,9 +129,8 @@ declare namespace contact { /** * Queries contact holders. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @return Returns the {@code Holder} list object. + * @permission ohos.permission.READ_CONTACTS */ function queryHolders(callback: AsyncCallback>): void; function queryHolders(): Promise>; @@ -135,11 +138,10 @@ declare namespace contact { /** * Obtains the query key of a contact based on a specified ID and holder. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param id Indicates the contact ID. * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @return Returns the query key of the contact. + * @permission ohos.permission.READ_CONTACTS */ function queryKey(id: number, callback: AsyncCallback): void; function queryKey(id: number, holder: Holder, callback: AsyncCallback): void; @@ -148,10 +150,9 @@ declare namespace contact { /** * Queries information about "my card". * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param attrs Indicates the contact attributes. If this parameter is null, all attributes are used for matching. * @return Returns information about "my card". + * @permission ohos.permission.READ_CONTACTS */ function queryMyCard(callback: AsyncCallback): void; function queryMyCard(attrs: ContactAttributes, callback: AsyncCallback): void; @@ -160,12 +161,11 @@ declare namespace contact { /** * Updates specified attributes of a contact. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param contact Indicates the contact whose information is to update. * @param attrs Indicates the contact attributes to update. If this parameter is null, * all available attributes will be updated. * @return Returns {@code true} if the update is successful; returns {@code false} otherwise. + * @permision ohos.permission.WRITE_CONTACTS */ function updateContact(contact: Contact, callback: AsyncCallback): void; function updateContact(contact: Contact, attrs: ContactAttributes, callback: AsyncCallback): void; @@ -174,10 +174,9 @@ declare namespace contact { /** * Checks whether the contact ID is in the local phone book. * - *

Permissions required: {@code ohos.permission.READ_CONTACTS} and {@code ohos.permission.WRITE_CONTACTS} - * * @param id Indicates the contact ID. * @return Returns {@code true} if the contact ID is in the local phone book; returns {@code false} otherwise. + * @permission ohos.permission.READ_CONTACTS */ function isLocalContact(id: number, callback: AsyncCallback): void; function isLocalContact(id: number): Promise; @@ -187,6 +186,7 @@ declare namespace contact { * * @param id Indicates the contact ID. * @return Returns {@code true} if the contact ID is of "my card"; returns {@code false} otherwise. + * @permission ohos.permission.READ_CONTACTS */ function isMyCard(id: number, callback: AsyncCallback): void; function isMyCard(id: number): Promise; diff --git a/api/@ohos.continuation.continuationManager.d.ts b/api/@ohos.continuation.continuationManager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2c9244e8d3a708b77b28424ac83e82e66e37bd9e --- /dev/null +++ b/api/@ohos.continuation.continuationManager.d.ts @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2022 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 { Callback } from './basic'; +import { AsyncCallback } from './basic'; +import { ContinuationResult } from './continuation/continuationResult' +import { ContinuationExtraParams } from './continuation/continuationExtraParams' + +/** + * Provides methods for interacting with the continuation manager servcie, including methods for registering and + * unregistering the ability to hop, updating the device connection state, and showing the list of devices + * that can be selected for hopping. + * @name continuationManager + * @since 8 + * @syscap SystemCapability.Ability.DistributedAbilityManager + * @permission N/A + */ +declare namespace continuationManager { + /** + * Called when the user selects a device from the candidate device list. + * You can implement your own processing logic in this callback to initiate the hop process. + * + * @since 8 + * @syscap SystemCapability.Ability.DistributedAbilityManager + * @param type deviceConnect. + * @return callback Indicates the information about the selected device. + */ + function on(type: "deviceConnect", callback: Callback): void; + function off(type: "deviceConnect", callback?: Callback): void; + + /** + * Called when a device is disconnected from the continuation manager servcie. + * You can implement your own processing logic in this callback, such as notifying the user of the disconnection. + * + * @since 8 + * @syscap SystemCapability.Ability.DistributedAbilityManager + * @param type deviceDisconnect. + * @return callback Indicates the ID of the disconnected device. + */ + function on(type: "deviceDisconnect", callback: Callback): void; + function off(type: "deviceDisconnect", callback?: Callback): void; + + /** + * Registers an ability to be hopped with the continuation manager servcie and obtains the registration token + * assigned to the ability. + * + * @since 8 + * @syscap SystemCapability.Ability.DistributedAbilityManager + * @param options Indicates the {@link ExtraParams} object containing the extra parameters used to filter + * the list of available devices. + * @return callback Indicates the callback to be invoked when the continuation manager servcie is connected. + */ + function register(callback: AsyncCallback): void; + function register(options: ContinuationExtraParams, callback: AsyncCallback): void; + function register(options?: ContinuationExtraParams): Promise; + + /** + * Unregisters a specified ability from the continuation manager servcie based on the token obtained during ability + * registration. + * + * @since 8 + * @syscap SystemCapability.Ability.DistributedAbilityManager + * @param token Indicates the registration token of the ability. + * @return callback Indicates the callback to be invoked when the continuation manager servcie is connected. + */ + function unregister(token: number, callback: AsyncCallback): void; + function unregister(token: number): Promise; + + /** + * Updates the connection state of the device where the specified ability is successfully hopped. + * + * @since 8 + * @syscap SystemCapability.Ability.DistributedAbilityManager + * @param token Indicates the registration token of the ability. + * @param deviceId Indicates the ID of the device whose connection state is to be updated. + * @param status Indicates the connection state to update. + * @return callback Indicates the callback to be invoked when the continuation manager servcie is connected. + */ + function updateConnectStatus(token: number, deviceId: string, status: DeviceConnectState, callback: AsyncCallback): void; + function updateConnectStatus(token: number, deviceId: string, status: DeviceConnectState): Promise; + + /** + * Start to manage the devices that can be selected for continuation on the distributed network. + * + * @since 8 + * @syscap SystemCapability.Ability.DistributedAbilityManager + * @param token Indicates the registration token of the ability. + * @param options Indicates the extraParams object containing the extra parameters used to filter + * the list of available devices. This parameter can be null. + * @return callback Indicates the callback to be invoked when the continuation manager servcie is connected. + */ + function startDeviceManager(token: number, callback: AsyncCallback): void; + function startDeviceManager(token: number, options: ContinuationExtraParams, callback: AsyncCallback): void; + function startDeviceManager(token: number, options?: ContinuationExtraParams): Promise; + + /** + * Device connection status data structure. + * + * @since 8 + * @syscap SystemCapability.Ability.DistributedAbilityManager + */ + export enum DeviceConnectState { + IDLE = 0, + CONNECTING = 1, + CONNECTED = 2, + DISCONNECTING = 3 + } + + /** + * Indicates the description of additional parameters for continuation. + * + * @since 8 + * @syscap SystemCapability.Ability.DistributedAbilityManager + */ + export enum ContinuationMode { + + /** + * Collaboration with a single device. + */ + COLLABORATION_SINGLE = 0, + + /** + * Collaboration with multiple devices. + */ + COLLABORATION_MULTIPLE = 1, + } + +} +export default continuationManager; \ No newline at end of file diff --git a/api/@ohos.convertxml.d.ts b/api/@ohos.convertxml.d.ts index 58cebdd392b8df97c2a92cd80f1e9db3c8e3af15..c4f7dfc141008641bac72b0e0e90451e55cbff0b 100644 --- a/api/@ohos.convertxml.d.ts +++ b/api/@ohos.convertxml.d.ts @@ -17,7 +17,6 @@ * The convertxml module provides utilities for converting XML text to Javascript object. * @since 8 * @syscap SystemCapability.Utils.Lang - * @devices phone, tablet * @import import convertXml from '@ohos.convertxml'; * @permission N/A */ @@ -143,7 +142,7 @@ declare namespace xml { /** * To convert XML text to JavaScript object. * @since 8 - * @syscap SystemCapability.Utils.Lang. + * @syscap SystemCapability.Utils.Lang * @param xml The xml text to be converted. * @param option Option Inputted by user to set. * @return Returns a JavaScript object converting from XML text. diff --git a/api/@ohos.curves.d.ts b/api/@ohos.curves.d.ts index 1ffd9819ad5008827d0a5ed60c7d78f796165608..e3a377d6cea5acb289960fa17e9223cf55a1d2f8 100644 --- a/api/@ohos.curves.d.ts +++ b/api/@ohos.curves.d.ts @@ -16,13 +16,12 @@ /** * Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves. * @import import Curves from '@ohos.curves' - * @devices phone, tablet, tv, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ declare namespace curves { /** * enum Curve. - * @devices phone, tablet, tv, wearable * @since 7 */ enum Curve { @@ -43,28 +42,24 @@ declare namespace curves { /** * Initializes the interpolator curve when called. - * @devices phone, tablet, tv, wearable * @since 7 */ function init(curve?: Curve): string; /** * Constructs a step curve when called. - * @devices phone, tablet, tv, wearable * @since 7 */ function steps(count: number, end: boolean): string; /** * Constructs a third-order Bezier curve when called. - * @devices phone, tablet, tv, wearable * @since 7 */ function cubicBezier(x1: number, y1: number, x2: number, y2: number): string; /** * Constructs a spring curve when called. - * @devices phone, tablet, tv, wearable * @since 7 */ function spring(velocity: number, mass: number, stiffness: number, damping: number): string; diff --git a/api/@ohos.data.dataAbility.d.ts b/api/@ohos.data.dataAbility.d.ts index 260afab40448515ba8bd6fb5015602281f31317f..c595719777cf6c9dff46cd515c9fba8c0e1a2d9b 100644 --- a/api/@ohos.data.dataAbility.d.ts +++ b/api/@ohos.data.dataAbility.d.ts @@ -21,7 +21,6 @@ import rdb from './@ohos.data.rdb'; * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @import import data_dataAbility from '@ohos.data.dataAbility'; - * @permission N/A */ declare namespace dataAbility { /** @@ -42,7 +41,6 @@ declare namespace dataAbility { * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @import import data_dataAbility from '@ohos.data.dataAbility'; - * @permission N/A */ class DataAbilityPredicates { /** @@ -385,7 +383,6 @@ declare namespace dataAbility { * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @import import data_rdb from '@ohos.data.rdb'; - * @permission N/A */ type ValueType = number | string | boolean; } diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts deleted file mode 100644 index ee6279552e3f6dd3a70e4b8aaef3d665b72b4443..0000000000000000000000000000000000000000 --- a/api/@ohos.data.dataShare.d.ts +++ /dev/null @@ -1,205 +0,0 @@ -/* -* Copyright (c) 2022 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 { AsyncCallback } from './basic'; -import { Want } from './ability/want'; -import { ResultSet } from './data/rdb/resultSet'; -import Context from './application/Context'; -import dataAbility from './@ohos.data.dataAbility'; -import rdb from './@ohos.data.rdb'; - -declare namespace dataShare { - /** - * Obtains the dataShareHelper. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param context Indicates the application context. - * @param want Indicates The element parameter of the service ability. - * @param uri Indicates the path of the file to open. - * @return Returns the dataShareHelper. - * @systemapi Hide this for inner system use. - */ - function createDataShareHelper(context: Context, want: Want, uri: string): DataShareHelper; - - /** - * DataShareHelper - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi Hide this for inner system use. - */ - interface DataShareHelper { - /** - * Registers an observer to observe data specified by the given uri. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param type dataChange. - * @param uri Indicates the path of the data to operate. - * @param callback Indicates the callback when dataChange. - * @return - - * @systemapi Hide this for inner system use. - */ - on(type: 'dataChange', uri: string, callback: AsyncCallback): void; - - /** - * Deregisters an observer used for monitoring data specified by the given uri. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param type dataChange. - * @param uri Indicates the path of the data to operate. - * @param callback Indicates the registered callback. - * @return - - * @systemapi Hide this for inner system use. - */ - off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; - - /** - * Inserts a single data record into the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param uri Indicates the path of the data to operate. - * @param value Indicates the data record to insert. If this parameter is null, a blank row will be inserted. - * @return Returns the index of the inserted data record. - * @systemapi Hide this for inner system use. - */ - insert(uri: string, value: rdb.ValuesBucket, callback: AsyncCallback): void; - insert(uri: string, value: rdb.ValuesBucket): Promise; - - /** - * Deletes one or more data records from the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param uri Indicates the path of the data to operate. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @return Returns the number of data records deleted. - * @systemapi Hide this for inner system use. - */ - delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - delete(uri: string, predicates: dataAbility.DataAbilityPredicates): Promise; - - - /** - * Queries data in the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param uri Indicates the path of data to query. - * @param columns Indicates the columns to query. If this parameter is null, all columns are queried. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @return Returns the query result. - * @systemapi Hide this for inner system use. - */ - query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates): Promise; - - /** - * Updates data records in the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param uri Indicates the path of data to update. - * @param value Indicates the data to update. This parameter can be null. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @return Returns the number of data records updated. - * @systemapi Hide this for inner system use. - */ - update(uri: string, value: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - update(uri: string, value: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates): Promise; - - - /** - * Inserts multiple data records into the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param uri Indicates the path of the data to operate. - * @param values Indicates the data records to insert. - * @return Returns the number of data records inserted. - * @systemapi Hide this for inner system use. - */ - batchInsert(uri: string, values: Array, callback: AsyncCallback): void; - batchInsert(uri: string, values: Array): Promise; - - /** - * Obtains the MIME type of the date specified by the given uri. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param uri Indicates the path of the data to operate. - * @return Returns the MIME type that matches the data specified by uri. - * @systemapi Hide this for inner system use. - */ - getType(uri: string, callback: AsyncCallback): void; - getType(uri: string): Promise; - - /** - * Obtains the MIME types of files supported. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param uri Indicates the path of the files to obtain. - * @param mimeTypeFilter Indicates the MIME types of the files to obtain. This parameter cannot be null. - *

1. "*/*": Obtains all types supported by Data abilities. - *

2. "image/*": Obtains files whose main type is image of any subtype. - *

3. "*/jpg": Obtains files whose subtype is JPG of any main type. - * @return Returns the matched MIME types. If there is no match, {@code null} is returned. - * @systemapi Hide this for inner system use. - */ - getFileTypes(uri: string, mimeTypeFilter:string, callback: AsyncCallback>): void; - getFileTypes(uri: string, mimeTypeFilter: string): Promise>; - - /** - * Converts the given {@code uri} that refers to the Data ability into a normalized {@link ohos.utils.net.Uri}. - * A normalized uri can be used across devices, persisted, backed up, and restored. - *

To transfer a normalized uri from another environment to the current environment, you should call this - * method again to re-normalize the uri for the current environment or call {@link #denormalizeUri(Uri)} - * to convert it to a denormalized uri that can be used only in the current environment. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param uri Indicates the {@link ohos.utils.net.Uri} object to normalize. - * @return Returns the normalized {@code Uri} object if the Data ability supports uri normalization; - * returns {@code null} otherwise. - * @throws DataShareRemoteException Throws this exception if the remote process exits. - * @throws NullPointerException Throws this exception if {@code uri} is null. - * @see #denormalizeUri - * @systemapi Hide this for inner system use. - */ - normalizeUri(uri: string, callback: AsyncCallback): void; - normalizeUri(uri: string): Promise; - - /** - * Converts the given normalized {@code uri} generated by {@link #normalizeUri(Uri)} into a denormalized one. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param uri Indicates the {@link ohos.utils.net.Uri} object to denormalize. - * @return Returns the denormalized {@code Uri} object if the denormalization is successful; returns the - * original {@code Uri} passed to this method if there is nothing to do; returns {@code null} if the data - * identified by the normalized {@code Uri} cannot be found in the current environment. - * @throws DataShareRemoteException Throws this exception if the remote process exits. - * @throws NullPointerException Throws this exception if {@code uri} is null. - * @see #normalizeUri - * @systemapi Hide this for inner system use. - */ - denormalizeUri(uri: string, callback: AsyncCallback): void; - denormalizeUri(uri: string): Promise; - - /** - * Notifies the registered observers of a change to the data resource specified by Uri. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @param uri Indicates the {@link ohos.utils.net.Uri} object to notifyChange. - * @return - - * @systemapi Hide this for inner system use. - */ - notifyChange(uri: string, callback: AsyncCallback): void; - notifyChange(uri: string): Promise; - } -} - -export default dataShare; diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index 806d1c6f64ae1020800971de30c30436621907f4..d34bb2d687e4e094744bef607e6cbaf933fe87ee 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -19,7 +19,6 @@ import { AsyncCallback, Callback } from './basic'; * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @permission N/A */ declare namespace distributedData { @@ -29,7 +28,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ interface KVManagerConfig { /** @@ -37,7 +35,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ userInfo: UserInfo; @@ -46,7 +43,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ bundleName: string; } @@ -60,7 +56,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ interface UserInfo { /** @@ -68,7 +63,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ userId?: string; @@ -77,7 +71,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ userType?: UserType; } @@ -88,7 +81,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ enum UserType { /** @@ -96,7 +88,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ SAME_USER_ID = 0 } @@ -106,7 +97,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ namespace Constants { /** @@ -114,7 +104,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ const MAX_KEY_LENGTH = 1024; @@ -123,7 +112,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ const MAX_VALUE_LENGTH = 4194303; @@ -132,7 +120,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ const MAX_KEY_LENGTH_DEVICE = 896; @@ -141,7 +128,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ const MAX_STORE_ID_LENGTH = 128; @@ -150,7 +136,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ const MAX_QUERY_LENGTH = 512000; @@ -159,7 +144,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ const MAX_BATCH_SIZE = 128; } @@ -172,7 +156,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ enum ValueType { /** @@ -180,7 +163,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ STRING = 0, @@ -189,7 +171,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ INTEGER = 1, @@ -198,7 +179,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ FLOAT = 2, @@ -207,7 +187,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A * */ BYTE_ARRAY = 3, @@ -216,7 +195,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A * */ BOOLEAN = 4, @@ -225,7 +203,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ DOUBLE = 5 } @@ -236,7 +213,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ interface Value { /** @@ -244,7 +220,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A * @see ValueType * @type {number} * @memberof Value @@ -255,7 +230,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ value: Uint8Array | string | number | boolean; } @@ -266,7 +240,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ interface Entry { /** @@ -274,7 +247,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ key: string; /** @@ -282,7 +254,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ value: Value; } @@ -296,7 +267,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ interface ChangeNotification { /** @@ -304,7 +274,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ insertEntries: Entry[]; /** @@ -312,7 +281,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ updateEntries: Entry[]; /** @@ -320,7 +288,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ deleteEntries: Entry[]; /** @@ -328,7 +295,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ deviceId: string; } @@ -339,7 +305,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ enum SyncMode { /** @@ -347,7 +312,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ PULL_ONLY = 0, /** @@ -355,7 +319,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ PUSH_ONLY = 1, /** @@ -363,7 +326,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ PUSH_PULL = 2 } @@ -374,7 +336,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ enum SubscribeType { /** @@ -382,7 +343,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ SUBSCRIBE_TYPE_LOCAL = 0, @@ -391,7 +351,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ SUBSCRIBE_TYPE_REMOTE = 1, @@ -400,7 +359,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ SUBSCRIBE_TYPE_ALL = 2, } @@ -411,7 +369,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ enum KVStoreType { /** @@ -419,7 +376,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @permission N/A */ DEVICE_COLLABORATION = 0, @@ -428,7 +384,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ SINGLE_VERSION = 1, @@ -437,7 +392,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @permission N/A */ MULTI_VERSION = 2, } @@ -448,7 +402,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ enum SecurityLevel { /** @@ -457,7 +410,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @permission N/A */ NO_LEVEL = 0, @@ -468,7 +420,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ S0 = 1, @@ -479,7 +430,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ S1 = 2, @@ -490,7 +440,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ S2 = 3, @@ -501,7 +450,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ S3 = 5, @@ -512,7 +460,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ S4 = 6, } @@ -526,7 +473,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ interface Options { /** @@ -534,7 +480,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ createIfMissing?: boolean; /** @@ -542,7 +487,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ encrypt?: boolean; /** @@ -550,15 +494,14 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ backup?: boolean; /** * Indicates setting whether database files are automatically synchronized * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @import N/A - * @permission N/A */ autoSync?: boolean; /** @@ -566,7 +509,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ kvStoreType?: KVStoreType; /** @@ -574,15 +516,13 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ securityLevel?: SecurityLevel; /** * Indicates schema object - * @since 9 + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @permission N/A */ schema?: Schema; } @@ -595,7 +535,6 @@ declare namespace distributedData { * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @permission N/A */ class Schema { /** @@ -610,7 +549,7 @@ declare namespace distributedData { * Indicates the root json object. * * @note N/A - * @since 9 + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ root: FieldNode; @@ -618,7 +557,7 @@ declare namespace distributedData { * Indicates the string array of json. * * @note N/A - * @since 9 + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ indexes: Array; @@ -626,7 +565,7 @@ declare namespace distributedData { * Indicates the mode of schema. * * @note N/A - * @since 9 + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ mode: number; @@ -634,7 +573,7 @@ declare namespace distributedData { * Indicates the skipsize of schema. * * @note N/A - * @since 9 + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ skip: number; @@ -652,7 +591,6 @@ declare namespace distributedData { * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @permission N/A */ class FieldNode { /** @@ -680,7 +618,7 @@ declare namespace distributedData { * Indicates the default value of fieldnode. * * @note N/A - * @since 9 + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ default: string; @@ -688,7 +626,7 @@ declare namespace distributedData { * Indicates the nullable of database field. * * @note N/A - * @since 9 + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ nullable: boolean; @@ -696,7 +634,7 @@ declare namespace distributedData { * Indicates the type of value. * * @note N/A - * @since 9 + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ type: number; @@ -711,7 +649,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ interface KvStoreResultSet { /** @@ -851,7 +788,6 @@ declare namespace distributedData { * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A */ class Query { /** @@ -1175,7 +1111,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A * @version 1 */ interface KVStore { @@ -1354,7 +1289,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A * @version 1 */ interface SingleKVStore extends KVStore { @@ -1475,7 +1409,8 @@ declare namespace distributedData { * @param deviceIdList Indicates the list of devices to which to synchronize the database. * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. * @param allowedDelayMs Indicates the delay allowed for the synchronization, in milliseconds. - * @throws Throws this exception if any of the following errors + * @throws Throws this exception if any of the following errors + * @permission ohos.permission.DISTRIBUTED_DATASYNC * occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. */ @@ -1541,7 +1476,6 @@ declare namespace distributedData { * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @permission N/A */ interface DeviceKVStore extends KVStore { /** @@ -1714,6 +1648,7 @@ declare namespace distributedData { * {@code DeviceKVStore} databases are to be synchronized. * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or * {@code PUSH_PULL}. + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws Throws this exception if no DeviceKVStore database is available. */ sync(deviceIdList: string[], mode: SyncMode, allowedDelayMs?: number): void; @@ -1763,7 +1698,6 @@ declare namespace distributedData { * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @permission N/A * @version 1 */ interface KVManager { diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 4ddeecdf177a887cb10cf35f5aa131096f819ea4..09437e77cfa2136ccebb88a86b4ca7c3f95cd34c 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -22,7 +22,6 @@ import Context from "./application/Context"; * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; - * @permission N/A */ declare namespace rdb { /** @@ -32,7 +31,7 @@ declare namespace rdb { * to obtain a rdb store. * * @note N/A - * @since 8 + * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @param context Indicates the context of application or capability. * @param config Indicates the configuration of the database related to this RDB store. The configurations include @@ -47,7 +46,7 @@ declare namespace rdb { * Deletes the database with a specified name. * * @note N/A - * @since 8 + * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @param context Indicates the context of application or capability. * @param name Indicates the database name. @@ -62,7 +61,6 @@ declare namespace rdb { * @since 8 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import N/A - * @permission N/A */ enum SyncMode { /** @@ -71,7 +69,6 @@ declare namespace rdb { * @since 8 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import N/A - * @permission N/A */ SYNC_MODE_PUSH = 0, @@ -81,7 +78,6 @@ declare namespace rdb { * @since 8 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import N/A - * @permission N/A */ SYNC_MODE_PULL = 1, } @@ -92,7 +88,6 @@ declare namespace rdb { * @since 8 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import N/A - * @permission N/A */ enum SubscribeType { /** @@ -100,7 +95,6 @@ declare namespace rdb { * @since 8 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import N/A - * @permission N/A */ SUBSCRIBE_TYPE_REMOTE = 0, } @@ -113,7 +107,6 @@ declare namespace rdb { * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; - * @permission N/A */ interface RdbStore { /** @@ -240,7 +233,7 @@ declare namespace rdb { * @param device Indicates the remote device. * @param table Indicates the local table name. * @return the distributed table name. - + */ obtainDistributedTableName(device: string, table: string, callback: AsyncCallback): void; obtainDistributedTableName(device: string, table: string): Promise; @@ -254,7 +247,7 @@ declare namespace rdb { * @param mode Indicates the synchronization mode. The value can be PUSH, PULL. * @param predicates Constraint synchronized data and devices. * @param callback Indicates the callback used to send the synchronization result to the caller. - + */ sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback>): void; sync(mode: SyncMode, predicates: RdbPredicates): Promise>; @@ -289,7 +282,6 @@ declare namespace rdb { * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; - * @permission N/A */ type ValueType = number | string | boolean; @@ -299,7 +291,6 @@ declare namespace rdb { * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; - * @permission N/A */ type ValuesBucket = { [key: string]: ValueType | Uint8Array | null; @@ -311,7 +302,6 @@ declare namespace rdb { * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; - * @permission N/A */ interface StoreConfig { name: string; @@ -323,7 +313,6 @@ declare namespace rdb { * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; - * @permission N/A */ class RdbPredicates { /** diff --git a/api/@ohos.data.storage.d.ts b/api/@ohos.data.storage.d.ts index 10190d3808fe2cdc1d4ab1e511c6181f537527a5..37f2a0432e39801084f936f622dfa3a6dbe07b26 100644 --- a/api/@ohos.data.storage.d.ts +++ b/api/@ohos.data.storage.d.ts @@ -18,9 +18,9 @@ import { AsyncCallback, Callback } from './basic'; * Provides interfaces to obtain and modify storage data. * * @name storage - * @since 5 + * @since 6 * @syscap SystemCapability.DistributedDataManager.Preferences.Core - * + * */ declare namespace storage { /** @@ -32,8 +32,9 @@ declare namespace storage { * @param path Indicates the path of storage file stored. * @return Returns the {@link Storage} instance matching the specified storage file name. * @throws BusinessError if invoked failed - * @since 5 + * @since 6 */ + function getStorageSync(path: string): Storage; function getStorage(path: string, callback: AsyncCallback): void; function getStorage(path: string): Promise; @@ -49,7 +50,7 @@ declare namespace storage { * * @param path Indicates the path of storage file * @throws BusinessError if invoked failed - * @since 5 + * @since 6 */ function deleteStorageSync(path: string): void; function deleteStorage(path: string, callback: AsyncCallback): void; @@ -65,7 +66,7 @@ declare namespace storage { * * @param path Indicates the path of storage file. * @throws BusinessError if invoked failed - * @since 5 + * @since 6 */ function removeStorageFromCacheSync(path: string): void; function removeStorageFromCache(path: string, callback: AsyncCallback): void; @@ -80,8 +81,8 @@ declare namespace storage { * to remove the {@link Storage} instance from the memory. * * @syscap SystemCapability.DistributedDataManager.Preferences.Core - * - * @since 5 + * + * @since 6 */ interface Storage { /** @@ -93,7 +94,7 @@ declare namespace storage { * @param defValue Indicates the default value to return. * @return Returns the value matching the specified key if it is found; returns the default value otherwise. * @throws BusinessError if invoked failed - * @since 5 + * @since 6 */ getSync(key: string, defValue: ValueType): ValueType; get(key: string, defValue: ValueType, callback: AsyncCallback): void; @@ -106,7 +107,7 @@ declare namespace storage { * @return Returns {@code true} if the {@link Storage} object contains a storage with the specified key; * returns {@code false} otherwise. * @throws BusinessError if invoked failed - * @since 5 + * @since 6 */ hasSync(key: string): boolean; has(key: string, callback: AsyncCallback): boolean; @@ -122,7 +123,7 @@ declare namespace storage { * @param value Indicates the value of the storage. * MAX_KEY_LENGTH. * @throws BusinessError if invoked failed - * @since 5 + * @since 6 */ putSync(key: string, value: ValueType): void; put(key: string, value: ValueType, callback: AsyncCallback): void; @@ -137,7 +138,7 @@ declare namespace storage { * @param key Indicates the key of the storage to delete. It cannot be {@code null} or empty. * MAX_KEY_LENGTH. * @throws BusinessError if invoked failed - * @since 5 + * @since 6 */ deleteSync(key: string): void; delete(key: string, callback: AsyncCallback): void; @@ -150,7 +151,7 @@ declare namespace storage { * file. * * @throws BusinessError if invoked failed - * @since 5 + * @since 6 */ clearSync(): void; clear(callback: AsyncCallback): void; @@ -160,7 +161,7 @@ declare namespace storage { * Asynchronously saves the {@link Storage} object to the file. * * @throws BusinessError if invoked failed - * @since 5 + * @since 6 */ flushSync(): void; flush(callback: AsyncCallback): void; @@ -171,7 +172,7 @@ declare namespace storage { * * @param callback Indicates the callback when storage changes. * @throws BusinessError if invoked failed - * @since 5 + * @since 6 */ on(type: 'change', callback: Callback): void; @@ -180,7 +181,7 @@ declare namespace storage { * * @param callback Indicates the registered callback. * @throws BusinessError if invoked failed - * @since 5 + * @since 6 */ off(type: 'change', callback: Callback): void; } @@ -194,8 +195,8 @@ declare namespace storage { * Define the change data information object. * * @syscap SystemCapability.DistributedDataManager.Preferences.Core - * - * @since 5 + * + * @since 6 */ interface StorageObserver { /** @@ -215,4 +216,4 @@ declare namespace storage { const MAX_VALUE_LENGTH: 8192; } -export default storage; \ No newline at end of file +export default storage; diff --git a/api/@ohos.deviceInfo.d.ts b/api/@ohos.deviceInfo.d.ts index 18cca631741489f9a1ba67241cfafc5ef11ecdc4..6c1f0bea3249026502df6f6a3eee34055c4463dc 100644 --- a/api/@ohos.deviceInfo.d.ts +++ b/api/@ohos.deviceInfo.d.ts @@ -17,112 +17,112 @@ * A static class pertaining to the product information. * * @since 6 - * @Syscap SystemCapability.Startup.SysInfo + * @syscap SystemCapability.Startup.SystemInfo */ declare namespace deviceInfo { /** * Obtains the device type represented by a string, * which can be {@code phone} (or {@code default} for phones), {@code wearable}, {@code liteWearable}, * {@code tablet}, {@code tv}, {@code car}, or {@code smartVision}. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const deviceType: string; /** * Obtains the device manufacturer represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const manufacture: string; /** * Obtains the device brand represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const brand: string; /** * Obtains the external product series represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const marketName: string; /** * Obtains the product series represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const productSeries: string; /** * Obtains the product model represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const productModel: string; /** * Obtains the software model represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const softwareModel: string; /** * Obtains the hardware model represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const hardwareModel: string; /** * Obtains the hardware profile represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const hardwareProfile: string; /** * Obtains the device serial number represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const serial: string; /** * Obtains the bootloader version number represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const bootloaderVersion: string; /** * Obtains the application binary interface (Abi) list represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const abiList: string; /** * Obtains the security patch level represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const securityPatchTag: string; /** * Obtains the product version represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const displayVersion: string; /** * Obtains the incremental version represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const incrementalVersion: string; @@ -132,14 +132,14 @@ declare namespace deviceInfo { * *

The OS release category can be {@code Release}, {@code Beta}, or {@code Canary}. * The specific release type may be {@code Release}, {@code Beta1}, or others alike. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const osReleaseType: string; /** * Obtains the OS version represented by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const osFullName: string; @@ -147,7 +147,7 @@ declare namespace deviceInfo { /** * Obtains the major (M) version number, which increases with any updates to the overall architecture. *

The M version number monotonically increases from 1 to 99. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const majorVersion: number; @@ -156,7 +156,7 @@ declare namespace deviceInfo { * Obtains the senior (S) version number, which increases with any updates to the partial * architecture or major features. *

The S version number monotonically increases from 0 to 99. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const seniorVersion: number; @@ -164,7 +164,7 @@ declare namespace deviceInfo { /** * Obtains the feature (F) version number, which increases with any planned new features. *

The F version number monotonically increases from 0 or 1 to 99. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const featureVersion: number; @@ -172,69 +172,69 @@ declare namespace deviceInfo { /** * Obtains the build (B) version number, which increases with each new development build. *

The B version number monotonically increases from 0 or 1 to 999. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const buildVersion: number; /** * Obtains the SDK API version number. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const sdkApiVersion: number; /** * Obtains the first API version number. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const firstApiVersion: number; /** * Obtains the version ID by a string. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const versionId: string; /** * Obtains the build types of the same baseline code. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const buildType: string; /** * Obtains the different build user of the same baseline code. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const buildUser: string; /** * Obtains the different build host of the same baseline code. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const buildHost: string; /** * Obtains the build time. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const buildTime: string; /** * Obtains the version hash. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ const buildRootHash: string; /** * Obtains the device udid. - * + * @syscap SystemCapability.Startup.SystemInfo * @since 7 */ const udid: string; diff --git a/api/@ohos.display.d.ts b/api/@ohos.display.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..024a10daef116b2e7106cb3ebb8439430354318b --- /dev/null +++ b/api/@ohos.display.d.ts @@ -0,0 +1,171 @@ +/* +* Copyright (c) 2021 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import { AsyncCallback, Callback } from './basic'; + +/** + * interface of display manager + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 + */ +declare namespace display { + /** + * get the default display + * @since 7 + */ + function getDefaultDisplay(callback: AsyncCallback): void; + + /** + * get the default display + * @since 7 + */ + function getDefaultDisplay(): Promise; + + /** + * get all displays + * @since 7 + */ + function getAllDisplay(callback: AsyncCallback>): void; + + /** + * get all displays + * @since 7 + */ + function getAllDisplay(): Promise>; + + /** + * register the callback of display change + * @param type: type of callback + * @since 7 + */ + function on(type: 'add' | 'remove' | 'change', callback: Callback): void; + + /** + * unregister the callback of display change + * @param type: type of callback + * @since 7 + */ + function off(type: 'add' | 'remove' | 'change', callback?: Callback): void; + + /** + * the state of display + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 + */ + enum DisplayState { + /** + * unknown + */ + STATE_UNKNOWN = 0, + /** + * screen off + */ + STATE_OFF, + /** + * screen on + */ + STATE_ON, + /** + * doze, but it will update for some important system messages + */ + STATE_DOZE, + /** + * doze and not update + */ + STATE_DOZE_SUSPEND, + /** + * VR node + */ + STATE_VR, + /** + * screen on and not update + */ + STATE_ON_SUSPEND, + } + + /** + * Properties of display, it couldn't update automatically + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 + */ + interface Display { + /** + * display id + */ + id: number; + + /** + * display name + */ + name: string; + + /** + * the display is alive + */ + alive: boolean; + + /** + * the state of display + */ + state: DisplayState; + + /** + * refresh rate, unit: Hz + */ + refreshRate: number; + + /** + * the rotation degrees of the display + */ + rotation: number; + + /** + * the width of display, unit: pixel + */ + width: number; + + /** + * the height of display, unit: pixel + */ + height: number; + + /** + * indicates the display resolution. + */ + densityDPI: number; + + /** + * indicates the display density in pixels. The value of a low-resolution display is 1.0 + */ + densityPixels: number; + + /** + * indicates the text scale density of a display. + */ + scaledDensity: number; + + /** + * the DPI on X-axis. + */ + xDPI: number; + + /** + * the DPI on Y-axis. + */ + yDPI: number; + } +} + +export default display; \ No newline at end of file diff --git a/api/@ohos.distributedBundle.d.ts b/api/@ohos.distributedBundle.d.ts index 90aef0113a27acab1b229dbcdb05bfc4fa8bf73a..e9fea81850f660acc8f9a24d55b3d5006c313f54 100644 --- a/api/@ohos.distributedBundle.d.ts +++ b/api/@ohos.distributedBundle.d.ts @@ -23,6 +23,7 @@ import { RemoteAbilityInfo } from './bundle/remoteAbilityInfo'; * @since 8 * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @permission NA + * @systemapi Hide this for inner system use */ declare namespace distributedBundle { /** @@ -32,7 +33,7 @@ import { RemoteAbilityInfo } from './bundle/remoteAbilityInfo'; * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @param elementName Indicates the elementName. * @return Returns the ability info of the remote device. - * @permission ohos.permission.GET_REMOTE_ABILITY_INFO_PRIVILEGED + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi */ function getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback): void; @@ -45,7 +46,7 @@ import { RemoteAbilityInfo } from './bundle/remoteAbilityInfo'; * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @param elementNames Indicates the elementNames, Maximum array length ten. * @return Returns the ability infos of the remote device. - * @permission ohos.permission.GET_REMOTE_ABILITY_INFO_PRIVILEGED + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi */ function getRemoteAbilityInfos(elementNames: Array, callback: AsyncCallback>): void; diff --git a/api/app/activeProcessInfo.d.ts b/api/@ohos.document.d.ts similarity index 31% rename from api/app/activeProcessInfo.d.ts rename to api/@ohos.document.d.ts index 68571a2d497043434fef4f91c793ef7b937b3ec9..78cacf90f2cfb6d6e6c6b58161ae3c432611ac61 100644 --- a/api/app/activeProcessInfo.d.ts +++ b/api/@ohos.document.d.ts @@ -12,40 +12,52 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { AsyncCallback } from './basic' + +export default document; /** - * @name This class saves process information about an application - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core - * @import import app from 'app/activeProcessInfo' + * document + * @syscap SystemCapability.FileManagement.UserFileService + * @since 6 + * @import import document from '@ohos.document'; * @permission N/A */ -export interface ActiveProcessInfo { - /** - * @default process id - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core - */ - pid: number; - - /** - * @default user id - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core - */ - uid: number; +declare namespace document { + export { choose }; + export { show }; +} - /** - * @default the name of the process - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core - */ - processName: string; +/** + * choose. + * + * @note N/A + * @syscap SystemCapability.FileManagement.UserFileService + * @since 6 + * @permission N/A + * @function choose + * @param {string} type - type. + * @param {AsyncCallback} [callback] - callback. + * @returns {void | Promise} no callback return Promise otherwise return void + * @throws {TypedError} Parameter check failed + */ +declare function choose(types?: string[]): Promise; +declare function choose(callback: AsyncCallback): void; +declare function choose(types: string[], callback: AsyncCallback): void; - /** - * @default an array of the bundleNames running in the process - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core - */ - bundleNames: Array; -} +/** + * show. + * + * @note N/A + * @syscap SystemCapability.FileManagement.UserFileService + * @since 6 + * @permission N/A + * @function show + * @param {string} uri - uri. + * @param {string} type - type. + * @param {AsyncCallback} [callback] - callback. + * @returns {void | Promise} no callback return Promise otherwise return void + * @throws {TypedError} Parameter check failed + */ +declare function show(uri: string, type: string): Promise; +declare function show(uri: string, type: string, callback: AsyncCallback): void; diff --git a/api/@ohos.environment.d.ts b/api/@ohos.environment.d.ts index 0d29e0241bc85cce3ce6a5e3bd41b867c074896c..b6d84144b3d59698c3d1d7e13a1bd34126799b59 100644 --- a/api/@ohos.environment.d.ts +++ b/api/@ohos.environment.d.ts @@ -20,12 +20,14 @@ import {AsyncCallback, Callback} from "./basic"; * * @since 8 * @syscap SystemCapability.FileManagement.File.Environment + * @systemapi */ declare namespace Environment { /** * Get the user data path. * * @since 8 + * @systemapi */ function getStorageDataDir(callback: AsyncCallback): void; function getStorageDataDir(): Promise; @@ -33,6 +35,7 @@ declare namespace Environment { * Get the User storage path. * * @since 8 + * @systemapi */ function getUserDataDir(callback: AsyncCallback): void; function getUserDataDir(): Promise; diff --git a/api/@ohos.fileManager.d.ts b/api/@ohos.fileManager.d.ts deleted file mode 100644 index f6df405e7ed3a6456173db27dc557aa37e8ff197..0000000000000000000000000000000000000000 --- a/api/@ohos.fileManager.d.ts +++ /dev/null @@ -1,137 +0,0 @@ - /* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { AsyncCallback } from './basic' - -export default filemanager; - -declare namespace filemanager { - export { listFile }; - export { getRoot }; - export { createFile }; - export { FileInfo }; - export { DevInfo }; -} - -/** - * listFile. - * - * @note N/A - * @syscap SystemCapability.FileManagement.FileManagerService - * @since 8 - * @permission N/A - * @function listFile - * @param {string} path - path. - * @param {string} type - type. - * @param {Object} options - options - * @param {DevInfo} [options.dev = {name: "local"}] - dev name. - * @param {number} [options.offset = 0] - offset. - * @param {number} [options.count = 0] - count. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws {TypedError} Parameter check failed - */ -declare function listFile(path: string, type: string, options?: {dev?: DevInfo, offset?: number, count?: number}): Promise; -declare function listFile(path: string, type: string, options?: {dev?: DevInfo, offset?: number, count?: number}, AsyncCallback): void; - -/** - * getRoot. - * - * @note N/A - * @syscap SystemCapability.FileManagement.FileManagerService - * @since 8 - * @permission N/A - * @function getRoot - * @param {Object} options - options - * @param {DevInfo} [options.dev = {name: "local"}] - dev name. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws {TypedError} Parameter check failed - */ -declare function getRoot(options?: {dev?: DevInfo}): Promise; -declare function getRoot(options?: {dev?: DevInfo}, callback: AsyncCallback): void; - -/** - * createFile. - * - * @note N/A - * @syscap SystemCapability.FileManagement.FileManagerService - * @since 8 - * @permission N/A - * @function createFile - * @param {string} path - album uri. - * @param {string} filename- file name. - * @param {Object} options - options - * @param {DevInfo} [options.dev = {name: "local"}] - dev name. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws {TypedError} Parameter check failed - */ -declare function createFile(path: string, filename: string, options?: {dev?: DevInfo}): Promise; -declare function createFile(path: string, filename: string, options?: {dev?: DevInfo}, callback: AsyncCallback): void; - -/** - * FileInfo - * @note N/A - * @syscap SystemCapability.FileManagement.FileManagerService - * @since 8 - * @permission N/A - */ -declare interface FileInfo { - /** - * @type {string} - * @readonly - */ - name: string; - /** - * @type {string} - * @readonly - */ - path: string; - /** - * @type {string} - * @readonly - */ - type: string; - /** - * @type {string} - * @readonly - */ - size: number; - /** - * @type {string} - * @readonly - */ - addedTime: number; - /** - * @type {string} - * @readonly - */ - modifiedTime: number; -} - -/** - * DevInfo - * @note N/A - * @syscap SystemCapability.FileManagement.FileManagerService - * @since 8 - * @permission N/A - */ - declare interface DevInfo { - /** - * @type {string} - */ - name: string; - } diff --git a/api/@ohos.geolocation.d.ts b/api/@ohos.geolocation.d.ts index ab24bda4c1ab7280efc24dab72d40430644ead96..527f7e909e12fcc9bdbe444176081cf7487a812d 100644 --- a/api/@ohos.geolocation.d.ts +++ b/api/@ohos.geolocation.d.ts @@ -12,15 +12,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AsyncCallback, Callback } from './basic.d.ts'; -import WantAgent from '@ohos.wantAgent'; +import { AsyncCallback, Callback } from './basic'; +import { WantAgent } from './@ohos.wantAgent'; /** * Provides interfaces for initiating location requests, ending the location service, * and obtaining the location result cached by the system. * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @import import geolocation from '@ohos.geolocation' * @permission ohos.permission.LOCATION */ @@ -29,7 +29,7 @@ declare namespace geolocation { * subscribe location changed * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param request Indicates the location request parameters. * @param callback Indicates the callback for reporting the location result. @@ -40,7 +40,7 @@ declare namespace geolocation { * unsubscribe location changed * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the location result. */ @@ -50,7 +50,7 @@ declare namespace geolocation { * subscribe location switch changed * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the location result. */ @@ -60,7 +60,7 @@ declare namespace geolocation { * unsubscribe location switch changed * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the location result. */ @@ -70,18 +70,18 @@ declare namespace geolocation { * subscribe to cache GNSS locations update messages * * @since 8 - * @SysCap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param request Indicates the cached GNSS locations request parameters. * @param callback Indicates the callback for reporting the cached GNSS locations. */ - function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLoactionsRequest, callback: Callback>) : void; + function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback>) : void; /** * unsubscribe to cache GNSS locations update messages * * @since 8 - * @SysCap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the cached gnss locations. */ @@ -91,7 +91,7 @@ declare namespace geolocation { * subscribe gnss status changed * * @since 8 - * @SysCap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the gnss status change. */ @@ -101,7 +101,7 @@ declare namespace geolocation { * unsubscribe gnss status changed * * @since 8 - * @SysCap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the gnss status change. */ @@ -111,7 +111,7 @@ declare namespace geolocation { * subscribe nmea message changed * * @since 8 - * @SysCap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the nmea message. */ @@ -121,7 +121,7 @@ declare namespace geolocation { * unsubscribe nmea message changed * * @since 8 - * @SysCap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the nmea message. */ @@ -131,7 +131,7 @@ declare namespace geolocation { * add a geofence and subscribe geo fence status changed * * @since 8 - * @SysCap SystemCapability.Location.Location.Geofence + * @syscap SystemCapability.Location.Location.Geofence * @permission ohos.permission.LOCATION * @param request Indicates the Geo-fence configuration parameters. * @param callback Indicates the callback for reporting the fence status. @@ -142,7 +142,7 @@ declare namespace geolocation { * remove a geofence and unsubscribe geo fence status changed * * @since 8 - * @SysCap SystemCapability.Location.Location.Geofence + * @syscap SystemCapability.Location.Location.Geofence * @permission ohos.permission.LOCATION * @param request Indicates the Geo-fence configuration parameters. * @param callback Indicates the callback for reporting the remove fence result. @@ -153,7 +153,7 @@ declare namespace geolocation { * obtain current location * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the location result. */ @@ -165,7 +165,7 @@ declare namespace geolocation { * obtain last known location * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the location result. */ @@ -176,7 +176,7 @@ declare namespace geolocation { * obtain current location switch status * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the location switch result. */ @@ -187,7 +187,7 @@ declare namespace geolocation { * request enable location * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the location switch status. */ @@ -198,9 +198,9 @@ declare namespace geolocation { * enable location switch * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @systemapi - * @permission ohos.permission.LOCATION + * @permission ohos.permission.MANAGE_SECURE_SETTINGS * @param callback Indicates the callback for reporting the location switch result. */ function enableLocation(callback: AsyncCallback) : void; @@ -210,9 +210,9 @@ declare namespace geolocation { * disable location switch * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @systemapi - * @permission ohos.permission.LOCATION + * @permission ohos.permission.MANAGE_SECURE_SETTINGS * @param callback Indicates the callback for reporting the location switch result. */ function disableLocation(callback: AsyncCallback) : void; @@ -222,7 +222,7 @@ declare namespace geolocation { * obtain address info from location * * @since 7 - * @SysCap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the address info. */ @@ -233,7 +233,7 @@ declare namespace geolocation { * obtain latitude and longitude info from location address * * @since 7 - * @SysCap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the latitude and longitude result. */ @@ -244,7 +244,7 @@ declare namespace geolocation { * obtain geocode service status * * @since 7 - * @SysCap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the geocode service status. */ @@ -255,7 +255,7 @@ declare namespace geolocation { * obtain the number of cached GNSS locations reported at a time * * @since 8 - * @SysCap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the cached GNSS locations size. */ @@ -267,7 +267,7 @@ declare namespace geolocation { * and the bottom-layer buffer is cleared. * * @since 8 - * @SysCap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the result. */ @@ -278,9 +278,9 @@ declare namespace geolocation { * send extended commands to location subsystem. * * @since 8 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION - * @param command Indicates the extended Command Message Body,it is a JSON string. + * @param command Indicates the extended Command Message Body. * @param callback Indicates the callback for reporting the send command result. */ function sendCommand(command: LocationCommand, callback: AsyncCallback) : void; @@ -290,14 +290,14 @@ declare namespace geolocation { * satellite status information * * @since 8 - * @SysCap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION */ export interface SatelliteStatusInfo { satellitesNumber: number; satelliteIds: Array; carrierToNoiseDensitys: Array; - altitude: Array; + altitudes: Array; azimuths: Array; carrierFrequencies: Array; } @@ -306,10 +306,10 @@ declare namespace geolocation { * parameters for requesting to report cache location information * * @since 8 - * @SysCap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION */ - export interface CachedGnssLoactionsRequest { + export interface CachedGnssLocationsRequest { reportingPeriodSec: number; wakeUpCacheQueueFull: boolean; } @@ -318,7 +318,7 @@ declare namespace geolocation { * configuring parameters in geo fence requests * * @since 8 - * @SysCap SystemCapability.Location.Location.Geofence + * @syscap SystemCapability.Location.Location.Geofence * @permission ohos.permission.LOCATION */ export interface GeofenceRequest { @@ -331,7 +331,7 @@ declare namespace geolocation { * configuring parameters in geo fence requests * * @since 8 - * @SysCap SystemCapability.Location.Location.Geofence + * @syscap SystemCapability.Location.Location.Geofence * @permission ohos.permission.LOCATION */ export interface Geofence { @@ -346,7 +346,7 @@ declare namespace geolocation { * * @since 8 * @systemapi - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param type indicates location privacy protocol type. * @param callback indicates the callback for reporting the location privacy protocol confirmation status. @@ -359,7 +359,7 @@ declare namespace geolocation { * * @since 8 * @systemapi - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param type indicates location privacy protocol type. * @param isConfirmed indicates whether the location privacy protocol has been confirmed. @@ -372,7 +372,7 @@ declare namespace geolocation { * configuring parameters in reverse geocode requests * * @since 7 - * @SysCap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @permission ohos.permission.LOCATION */ export interface ReverseGeoCodeRequest { @@ -386,7 +386,7 @@ declare namespace geolocation { * configuring parameters in geocode requests * * @since 7 - * @SysCap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @permission ohos.permission.LOCATION */ export interface GeoCodeRequest { @@ -403,7 +403,7 @@ declare namespace geolocation { * data struct describes geographic locations. * * @since 7 - * @SysCap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @permission ohos.permission.LOCATION */ export interface GeoAddress { @@ -431,7 +431,7 @@ declare namespace geolocation { * configuring parameters in location requests * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION */ export interface LocationRequest { @@ -446,7 +446,7 @@ declare namespace geolocation { * configuring parameters in current location requests * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION */ export interface CurrentLocationRequest { @@ -460,7 +460,7 @@ declare namespace geolocation { * provides information about geographic locations * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION */ export interface Location { @@ -480,7 +480,7 @@ declare namespace geolocation { * enum for location priority * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION */ export enum LocationRequestPriority { @@ -494,7 +494,7 @@ declare namespace geolocation { * enum for location scenario * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION */ export enum LocationRequestScenario { @@ -510,7 +510,7 @@ declare namespace geolocation { * enum for error code * * @since 7 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION */ export enum GeoLocationErrorCode { @@ -527,7 +527,7 @@ declare namespace geolocation { * enum for location privacy type * * @since 8 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION */ export enum LocationPrivacyType { @@ -540,7 +540,7 @@ declare namespace geolocation { * Location subsystem command structure * * @since 8 - * @SysCap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION */ export interface LocationCommand { diff --git a/api/@ohos.hiTraceChain.d.ts b/api/@ohos.hiTraceChain.d.ts index 1fd2fd00265c6ddde08b4fec3c4f2704d30a14db..30d805b3722e70615b6c334b1dac219e46fe969e 100644 --- a/api/@ohos.hiTraceChain.d.ts +++ b/api/@ohos.hiTraceChain.d.ts @@ -154,7 +154,7 @@ declare namespace hiTraceChain { * @param {number} flags Trace function flag. * @return {HiTraceId} Valid if first call, otherwise invalid. */ - function begin(name: string, flags: number = HiTraceFlag.DEFAULT): HiTraceId; + function begin(name: string, flags?: number): HiTraceId; /** * Stop process tracing and clear trace id of current thread if the given trace diff --git a/api/@ohos.hichecker.d.ts b/api/@ohos.hichecker.d.ts index 4aa9b254c0305a7e302a6e0ba8e1231cc06247a5..678b3b6a3645f2e4c37ca65e617bced415280e8e 100644 --- a/api/@ohos.hichecker.d.ts +++ b/api/@ohos.hichecker.d.ts @@ -44,13 +44,6 @@ declare namespace hichecker { */ const RULE_THREAD_CHECK_SLOW_PROCESS: 1n; - /** - * The process rule check slow event. - * @since 8 - * @syscap SystemCapability.HiviewDFX.HiChecker - */ - const RULE_CHECK_SLOW_EVENT: 4294967296n; // 1 << 32 - /** * The process rule check ability connection leak. * @since 8 diff --git a/api/@ohos.i18n.d.ts b/api/@ohos.i18n.d.ts index cec604281101c1f0c31084b969968bd8370d1153..cbb30227566527f1e735cc0c533bcdc01eed78a4 100644 --- a/api/@ohos.i18n.d.ts +++ b/api/@ohos.i18n.d.ts @@ -16,14 +16,14 @@ /** * Provides international settings related APIs. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 7 */ declare namespace i18n { /** * Obtains the country or region name localized for display on a given locale. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param country The locale whose country or region name will be displayed. * @param locale The locale used to display the country or region. * @param sentenceCase Specifies whether the country or region name is displayed in sentence case. @@ -35,7 +35,7 @@ export function getDisplayCountry(country: string, locale: string, sentenceCase? /** * Obtains the language name localized for display on a given locale. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param language The locale whose language name will be displayed. * @param locale The locale used to display the language. * @param sentenceCase Specifies whether the language name is displayed in sentence case. @@ -47,7 +47,7 @@ export function getDisplayLanguage(language: string, locale: string, sentenceCas /** * Obtain all languages supported by the system. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns all languages supported by the system. * @since 7 * @systemapi Hide this for inner system use. @@ -57,7 +57,7 @@ export function getSystemLanguages(): Array; /** * Obtain all regions supported by the system in the language. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param language The language used to get the list of regions. * @return Returns all regions supported by the system in the language. * @since 7 @@ -68,7 +68,7 @@ export function getSystemCountries(language: string): Array; /** * Determine whether the current language or region is recommended. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param language The language code. * @param region The region code. * @return Returns whether the current language or region is recommended. @@ -80,7 +80,7 @@ export function isSuggested(language: string, region?: string): boolean; /** * Obtain the language currently used by the system. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns the language currently used by the system. * @since 7 */ @@ -89,7 +89,8 @@ export function getSystemLanguage(): string; /** * Set the language currently used by the system. * - * @sysCap SystemCapability.Global.I18n + * @permission ohos.permission.UPDATE_CONFIGURATION + * @syscap SystemCapability.Global.I18n * @param language The language to be used. * @since 7 * @systemapi Hide this for inner system use. @@ -99,7 +100,7 @@ export function setSystemLanguage(language: string): boolean; /** * Obtain the region currently used by the system. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns the region currently used by the system. * @since 7 */ @@ -108,7 +109,8 @@ export function getSystemRegion(): string; /** * Set the region currently used by the system. * - * @sysCap SystemCapability.Global.I18n + * @permission ohos.permission.UPDATE_CONFIGURATION + * @syscap SystemCapability.Global.I18n * @param region The region to be used. * @since 7 * @systemapi Hide this for inner system use. @@ -118,7 +120,7 @@ export function setSystemRegion(region: string): boolean; /** * Obtain the locale currently used by the system. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns the locale currently used by the system. * @since 7 */ @@ -127,7 +129,8 @@ export function getSystemLocale(): string; /** * Set the locale currently used by the system. * - * @sysCap SystemCapability.Global.I18n + * @permission ohos.permission.UPDATE_CONFIGURATION + * @syscap SystemCapability.Global.I18n * @param locale The locale to be used. * @since 7 * @systemapi Hide this for inner system use. @@ -137,14 +140,14 @@ export function setSystemLocale(locale: string): boolean; /** * Provides util functions. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export interface Util { /** * Convert from unit to to unit and format according to the locale. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param fromUnit Information of the unit to be converted. * @param toUnit Information about the unit to be converted to. * @param value Indicates the number to be formatted. @@ -158,7 +161,7 @@ export interface Util { /** * Provides the options of unit. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export interface UnitInfo { @@ -176,7 +179,7 @@ export interface UnitInfo { /** * Provides the options of PhoneNumberFormat. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export interface PhoneNumberFormatOptions { @@ -189,14 +192,14 @@ export interface PhoneNumberFormatOptions { /** * Provides the API for formatting phone number strings * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export class PhoneNumberFormat { /** * A constructor used to create a PhoneNumberFormat object. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param country Indicates a character string containing the country information for the PhoneNumberFormat object. * @param type Indicates the type used to format the phone number, includes: "E164", "RFC3966", "INTERNATIONAL", "NATIONAL". * @since 8 @@ -206,7 +209,7 @@ export class PhoneNumberFormat { /** * Judges whether phone number is valid. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param number Indicates the input phone number to be judged. * @return Returns a boolean indicates whether the input phone number is valid. * @since 8 @@ -216,7 +219,7 @@ export class PhoneNumberFormat { /** * Obtains the formatted phone number strings of number. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param number Indicates the input phone number to be formatted. * @return Returns the formatted phone number. * @since 8 @@ -227,7 +230,7 @@ export class PhoneNumberFormat { /** * Get a Calendar instance specified by locale and type. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param locale The locale used to get calendar. * @param type If type is not specified, get locale's default Calendar, else get the specified type of Calendar. * such as buddhist, chinese, coptic, ethiopic, hebrew, gregory, indian, islamic_civil, islamic_tbla, islamic_umalqura, @@ -240,25 +243,25 @@ export class Calendar { /** * set the date. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param date Date object used to set the time and date. * @since 8 */ - setTime(date: Date); + setTime(date: Date): void; /** * set the time. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param time Indicates the elapsed milliseconds from 1970.1.1 00:00:00 GMT. * @since 8 */ - setTime(time: number); + setTime(time: number): void; /** * Set the time * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param year The year field of the calendar, ranges from 0 to 9999. * @param month The month field of the calendar, ranges from 0 to 11. * @param date The day field of the calendar, ranges from 1 to 31. @@ -267,21 +270,21 @@ export class Calendar { * @param second the second field of the calendar, ranges from 0 to 59. * @since 8 */ - set(year: number, month: number, date:number, hour?: number, minute?: number, second?: number); + set(year: number, month: number, date:number, hour?: number, minute?: number, second?: number): void; /** * Set the timezone of this calendar. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param timezone The id of a timezone. * @since 8 */ - setTimeZone(timezone: string); + setTimeZone(timezone: string): void; /** * Get the timezone id of this calendar instance. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns the timezone id of this calendar. * @since 8 */ @@ -290,7 +293,7 @@ export class Calendar { /** * Get the start day of a week. 1 indicates Sunday, 7 indicates Saturday. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns start day of a week. * @since 8 */ @@ -299,16 +302,16 @@ export class Calendar { /** * Set the start day of a week. 1 indicates Sunday, 7 indicates Saturday. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param value Indicates the start day of a week. 1 indicates Sunday, 7 indicates Saturday. * @since 8 */ - setFirstDayOfWeek(value: number); + setFirstDayOfWeek(value: number): void; /** * Get the minimal days of a week, which is needed for the first day of a year. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns the minimal days of a week. * @since 8 */ @@ -317,16 +320,16 @@ export class Calendar { /** * Set the minimal days of a week, which is needed for the first week of a year. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param value The value to be set. * @since 8 */ - setMinimalDaysInFirstWeek(value: number); + setMinimalDaysInFirstWeek(value: number): void; /** * Get the associated value with the field. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param field Field values such as era, year, month, week_of_year, week_of_month, date, day_of_year, day_of_week * day_of_week_in_month, hour, hour_of_day, minute, second, millisecond, zone_offset, dst_offset, year_woy, * dow_local, extended_year, julian_day, milliseconds_in_day, is_leap_month. @@ -338,7 +341,7 @@ export class Calendar { /** * Get calendar's name localized for display in the given locale. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param locale Locale used to get the localized name for this calendar. * @return Returns the localized name of this calendar. * @since 8 @@ -349,7 +352,7 @@ export class Calendar { * Returns true if the given date is a weekend day. If the date is not given, * the date object of this calendar is used. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param date Date object whose attribute is desired. * @return Returns whether the date is a weekend day. * @since 8 @@ -360,18 +363,18 @@ export class Calendar { /** * Judge whether the locale is RTL locale. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param locale The locale to be used. * @return Returns true representing the locale is an RTL locale * - * @since 8 + * @since 7 */ export function isRTL(locale: string): boolean; /** * Obtains a BreakIterator object for finding the location of break point in text. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param locale the returned BreakIterator will adapt the rule, specified by the locale, to break text. * @return Returns a newly constructed BreakIterator object. * @since 8 @@ -381,14 +384,14 @@ export function isRTL(locale: string): boolean; /** * The BreakIterator class is used for finding the location of break point in text. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export class BreakIterator { /** * Obtains the current position of the BreakIterator instance. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns the current position of the BreakIterator instance. * @since 8 */ @@ -398,7 +401,7 @@ export class BreakIterator { * Set the BreakIterator's position to the first break point, the first break point is always the beginning of the * processed text. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns the index of the first break point. * @since 8 */ @@ -408,7 +411,7 @@ export class BreakIterator { * Set the BreakIterator's position to the last break point. the last break point is always the index beyond the * last character of the processed text. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns the index of the last break point. * @since 8 */ @@ -417,7 +420,7 @@ export class BreakIterator { /** * Set the BreakItertor's position to the nth break point from the current break point. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param index indicates the number of break points to advance. If index is not given, n is treated as 1. * @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1. * @since 8 @@ -427,7 +430,7 @@ export class BreakIterator { /** * Set the BreakItertor's position to the break point preceding the current break point. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1. * @since 8 */ @@ -436,7 +439,7 @@ export class BreakIterator { /** * Set the text to be processed. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param text Indicates the text to be processed by the BreakIterator. * @since 8 */ @@ -445,7 +448,7 @@ export class BreakIterator { /** * Set the BreakIterator's position to the first break point following the specified offset. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1. * @since 8 */ @@ -454,7 +457,7 @@ export class BreakIterator { /** * Obtains the text being processed. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns the text that is processed by the BreakIterator. * @since 8 */ @@ -465,7 +468,7 @@ export class BreakIterator { * position will be set to the position indicated by the offset if it returns true, otherwise the BreakIterator * will be moved to the break point following the offset. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param offset The offset to be checked. * @return Returns true if the offset is a break point. * @since 8 @@ -473,29 +476,29 @@ export class BreakIterator { isBoundary(offset: number): boolean; } +/** + * Get IndexUtil object. + * + * @syscap SystemCapability.Global.I18n + * @param locale Indicates a character string containing the locale information, including + * the language and optionally the script and region, for the NumberFormat object. + * @return Returns IndexUtil object. + * @since 8 + */ +export function getInstance(locale?:string): IndexUtil; + /** * Sequence text can be grouped under the specified area, * and grouping index with different lengths can be specified. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export class IndexUtil { - /** - * Get IndexUtil object. - * - * @sysCap SystemCapability.Global.I18n - * @param locale Indicates a character string containing the locale information, including - * the language and optionally the script and region, for the NumberFormat object. - * @return Returns IndexUtil object. - * @since 8 - */ - getInstance(locale?:string): IndexUtil; - /** * Get a list of labels for use as a UI index * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns a list of labels * @since 8 */ @@ -504,16 +507,16 @@ export class IndexUtil { /** * Add the index characters from a Locale to the index. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param locale The locale whose index characters are to be added. * @since 8 */ - addLocale(locale: string); + addLocale(locale: string): void; /** * Get corresponding index of the input text. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param text input text * @since 8 */ @@ -523,14 +526,14 @@ export class IndexUtil { /** * Provides the API for accessing unicode character properties, sunch as whether a character is a digit. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export class Character { /** * Determines whether the specified code point is a digit character * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param char the character to be tested * @return Returns true if the character is a digit character */ @@ -539,7 +542,7 @@ export class Character { /** * Determines if the specified character is a space character or not. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param char the character to be tested * @return Returns true if the character is a space character */ @@ -548,7 +551,7 @@ export class Character { /** * Determines if the specified character is a whitespace character * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param char the character to be tested * @return Returns true if the character is a whitespace character */ @@ -557,7 +560,7 @@ export class Character { /** * Determines if the specified character is a RTL character or not. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param char the character to be tested * @return Returns true if the character is a RTL character */ @@ -566,7 +569,7 @@ export class Character { /** * Determines if the specified character is a Ideographic character or not. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param char the character to be tested * @return Returns true if the character is a Ideographic character */ @@ -575,7 +578,7 @@ export class Character { /** * Determines if the specified character is a Letter or not. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param char the character to be tested * @return Returns true if the character is a Letter */ @@ -584,7 +587,7 @@ export class Character { /** * Determines if the specified character is a LowerCase character or not. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param char the character to be tested * @return Returns true if the character is a LowerCase character */ @@ -593,7 +596,7 @@ export class Character { /** * Determines if the specified character is a UpperCase character or not. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param char the character to be tested * @return Returns true if the character is a UpperCase character */ @@ -602,7 +605,7 @@ export class Character { /** * Get the general category value of the specified character. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param char the character to be tested * @return Returns the general category of the specified character. */ @@ -612,26 +615,28 @@ export class Character { /** * check out whether system is 24-hour system. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns a boolean represent whether system is 24-hour system. - * @since 8 + * @since 7 */ export function is24HourClock(): boolean; /** * set 24-hour system. * - * @sysCap SystemCapability.Global.I18n + * @permission ohos.permission.UPDATE_CONFIGURATION + * @syscap SystemCapability.Global.I18n * @param option represent the boolean to be set. * @return Returns a boolean represent whether setting 24-hour system success. - * @since 8 + * @since 7 */ export function set24HourClock(option: boolean): boolean; /** * Add one language to preferred language List. * - * @sysCap SystemCapability.Global.I18n + * @permission ohos.permission.UPDATE_CONFIGURATION + * @syscap SystemCapability.Global.I18n * @param language the language to be added. * @param index the position of preferred language list to be inserted. * @return Returns a boolean represent whether language added success. @@ -642,7 +647,8 @@ export function addPreferredLanguage(language: string, index?: number): boolean; /** * Remove one language from preferred language list. * - * @sysCap SystemCapability.Global.I18n + * @permission ohos.permission.UPDATE_CONFIGURATION + * @syscap SystemCapability.Global.I18n * @param index the position of removed language in preferred language list. * @return Returns a boolean represent whether removed success. * @since 8 @@ -652,7 +658,7 @@ export function removePreferredLanguage(index: number): boolean; /** * Access the system preferred language list. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns a string Array represent the preferred language list. * @since 8 */ @@ -661,9 +667,67 @@ export function getPreferredLanguageList(): Array; /** * Get the first preferred language of system. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns a string represent the first preferred language of system. * @since 8 */ export function getFirstPreferredLanguage(): string; -} \ No newline at end of file + +/** + * Get the default TimeZone object or the TimeZone object corresponds to zoneID. + * + * @syscap SystemCapability.Global.I18n + * @param zoneID TimeZone ID used to create TimeZone Object. + * @return Returns a TimeZone object corresponds to zoneID. + * @since 7 + */ +export function getTimeZone(zoneID?: string): TimeZone; + +/** + * Provides the API for accessing TimeZone name, rawOffset and offset information. + * + * @syscap SystemCapability.Global.I18n + * @since 7 + */ +export class TimeZone { + /** + * Get the id of the TimeZone object. + * + * @syscap SystemCapability.Global.I18n + * @return Returns a string represents the timezone id. + * @since 7 + */ + getID(): string; + + /** + * Get the displayName of the TimeZone Object under the locale. + * + * @syscap SystemCapability.Global.I18n + * @param locale the locale tag use to display timezone object's name. + * @param isDST wether conside daylight saving time when display timezone object's name. + * @return Returns a string represents the display name. + * @since 7 + */ + getDisplayName(locale?: string, isDST?: boolean): string; + + /** + * Get the raw offset of the TimeZone object. + * + * @syscap SystemCapability.Global.I18n + * @return Returns a number represents the raw offset. + * @since 7 + */ + getRawOffset(): number; + + /** + * Get the offset of the TimeZone object. + * + * @syscap SystemCapability.Global.I18n + * @date Indicates a date use to compute offset. + * @return Returns a number represents the offset with date. + * @since 7 + */ + getOffset(date?: number): number; +} +} +export default i18n; \ No newline at end of file diff --git a/api/@ohos.inputmethod.d.ts b/api/@ohos.inputmethod.d.ts index 21a0439b5f4d0758007ca00c5c643fa09f4d72ea..2ec69c2eeb4b37a92c26744b2e753eb227fa02a3 100644 --- a/api/@ohos.inputmethod.d.ts +++ b/api/@ohos.inputmethod.d.ts @@ -18,8 +18,8 @@ import {AsyncCallback} from './basic'; /** * inputmethod * - * @since 8 - * @syscap SystemCapability.MiscServices.InputMethod + * @since 6 + * @syscap SystemCapability.MiscServices.InputMethodFramework */ declare namespace inputMethod { const MAX_TYPE_NUM: number diff --git a/api/@ohos.inputmethodengine.d.ts b/api/@ohos.inputmethodengine.d.ts index 39b3b83bae1009fb04d71f19440ee9293b4711ef..332c396c47aef608d08cf72af2d690f25c9a0d08 100644 --- a/api/@ohos.inputmethodengine.d.ts +++ b/api/@ohos.inputmethodengine.d.ts @@ -19,7 +19,7 @@ import {AsyncCallback} from './basic'; * inputmethodengine * * @since 8 - * @syscap SystemCapability.MiscServices.InputMethodEngine + * @syscap SystemCapability.MiscServices.InputMethodFramework */ declare namespace inputMethodEngine { const ENTER_KEY_TYPE_UNSPECIFIED: number; @@ -58,7 +58,7 @@ declare namespace inputMethodEngine { function createKeyboardDelegate(): KeyboardDelegate; interface KeyboardController { - hideKeyboard(callbakc: AsyncCallback): void; + hideKeyboard(callback: AsyncCallback): void; hideKeyboard(): Promise; } @@ -68,13 +68,9 @@ declare namespace inputMethodEngine { off(type: 'inputStart', callback?: (kbController: KeyboardController, textInputClient: TextInputClient) => void): void; - on(type: 'keyboardShow', callback: () => void): void; + on(type: 'keyboardShow'|'keyboardHide', callback: () => void): void; - off(type: 'keyboardShow', callback: () => void): void; - - on(type: 'keyboardHide', callback: () => void): void; - - off(type: 'keyboardHide', callback: () => void): void; + off(type: 'keyboardShow'|'keyboardHide', callback?: () => void): void; } interface TextInputClient { @@ -90,35 +86,35 @@ declare namespace inputMethodEngine { deleteBackward(length: number): Promise; - InsertText(text: string, callback: AsyncCallback): void; + insertText(text: string, callback: AsyncCallback): void; - InsertText(text: string): Promise; + insertText(text: string): Promise; getForward(length: number, callback: AsyncCallback): void; getForward(length: number): Promise; - getEditorAttribute(lcallback: AsyncCallback): void; + getBackward(length: number, callback: AsyncCallback): void; + + getBackward(length: number): Promise; + + getEditorAttribute(callback: AsyncCallback): void; getEditorAttribute(): Promise; } interface KeyboardDelegate { - on(type: 'keyDown', callback: (event: KeyEvent) => boolean): void; + on(type: 'keyDown'|'keyUp', callback: (event: KeyEvent) => boolean): void; - off(type: 'keyDown', callback?: (event: KeyEvent) => boolean): void; - - on(type: 'keyUp', callback: (event: KeyEvent) => boolean): void; - - off(type: 'keyUp', callback?: (event: KeyEvent) => boolean): void; + off(type: 'keyDown'|'keyUp', callback?: (event: KeyEvent) => boolean): void; on(type: 'cursorContextChange', callback: (x: number, y: number, height: number) => void): void; off(type: 'cursorContextChange', callback?: (x: number, y: number, height: number) => void): void; - on(type: 'selectionChange', callback: (oldBegine: number, oldEnd: number, newBegine: number, newEnd: number) => void): void; + on(type: 'selectionChange', callback: (oldBegin: number, oldEnd: number, newBegin: number, newEnd: number) => void): void; - off(type: 'selectionChange', callback?: (oldBegine: number, oldEnd: number, newBegine: number, newEnd: number) => void): void; + off(type: 'selectionChange', callback?: (oldBegin: number, oldEnd: number, newBegin: number, newEnd: number) => void): void; on(type: 'textChange', callback: (text: string) => void): void; @@ -129,6 +125,11 @@ declare namespace inputMethodEngine { readonly inputPattern: number; readonly enterKeyType: number; } + + interface KeyEvent { + readonly keyCode: number; + readonly keyAction: number; + } } export default inputMethodEngine; diff --git a/api/@ohos.intl.d.ts b/api/@ohos.intl.d.ts index 2a1bcdda7275691cb16a09c5fef05809dce04de5..560b67b29855d63010e232b401e8f8bb278c06d5 100755 --- a/api/@ohos.intl.d.ts +++ b/api/@ohos.intl.d.ts @@ -16,56 +16,56 @@ /** * Provides internationalization related APIs. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 6 */ declare namespace intl { /** * Provides the options of Locale. * - * @since 8 - * @sysCap SystemCapability.Global.I18n + * @since 6 + * @syscap SystemCapability.Global.I18n */ export interface LocaleOptions { /** * Indicates the calendar. * - * @since 8 + * @since 6 */ calendar: string; /** * Indicates the collation. * - * @since 8 + * @since 6 */ collation: string; /** * Indicates the hourCycle. * - * @since 8 + * @since 6 */ hourCycle: string; /** * Indicates the numberingSystem. * - * @since 8 + * @since 6 */ numberingSystem: string; /** * Indicates the numeric. * - * @since 8 + * @since 6 */ numeric: boolean; /** * Indicates the caseFirst. * - * @since 8 + * @since 6 */ caseFirst: string; } @@ -73,24 +73,33 @@ export interface LocaleOptions { /** * Provides APIs for obtaining locale information. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 6 */ export class Locale { /** * A constructor used to create a Locale object. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n + * @since 8 + */ + constructor(); + + /** + * A constructor used to create a Locale object. + * + * @syscap SystemCapability.Global.I18n * @param locale Indicates a character string containing the locale information, including * the language and optionally the script and region. + * @param options Indicates Locale option object use to initialize the Locale object. * @since 6 */ - constructor(locale?: string, options?: LocaleOptions); + constructor(locale: string, options?: LocaleOptions); /** * Indicates the language of the locale. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 6 */ language: string @@ -98,7 +107,7 @@ export class Locale { /** * Indicates the script of the locale. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 6 */ script: string @@ -106,7 +115,7 @@ export class Locale { /** * Indicates the region of the locale. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 6 */ region: string @@ -115,62 +124,83 @@ export class Locale { * Indicates the basic locale information, which is returned as a substring of * a complete locale string. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 6 */ baseName: string /** * Indicates the case first style of the locale. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ caseFirst: string /** * Indicates the calendar. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ calendar: string /** * Indicates the collation. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ collation: string /** * Indicates the hour cycle. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ hourCycle: string /** * Indicates the numbering system. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ numberingSystem: string /** * Indicates whether it is numeric. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ numeric: boolean /** * Convert the locale information to string. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns locale information in string form. + * @since 6 */ toString(): string; /** * Maximize the locale's base information. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns maximized locale. + * @since 6 */ maximize(): Locale; /** * Minimize the locale's base information. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns minimized locale. + * @since 6 */ minimize(): Locale; } @@ -178,101 +208,158 @@ export class Locale { /** * Provides the options of date time format. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n + * @since 6 */ export interface DateTimeOptions { /** * Indicates the locale. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ locale: string /** * Indicates the date style. + * @syscap SystemCapability.Global.I18n + * @since 6 */ dateStyle: string /** * Indicates the time style. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ timeStyle: string /** * Indicates the hour cycle. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ hourCycle: string /** * Indicates the timezone. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ timeZone: string /** * Indicates the numbering system. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ numberingSystem: string /** * Indicates whether is 12 hour or not. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ hour12: boolean /** * Indicates the weekday style. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ weekday: string /** * Indicates the era style. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ era: string /** * Indicates the year style. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ year: string /** * Indicates the month style. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ month: string /** * Indicates the day style. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ day: string /** * Indicates the hour style. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ hour: string /** * Indicates the minute style. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ minute: string /** * Indicates the second style. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ second: string /** * Indicates the timezone name. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ timeZoneName: string /** * Indicates the day period format. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ dayPeriod: string /** * Indicates the locale matching algorithm. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ localeMatcher: string /** * Indicates the format matching algorithm. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ formatMatcher: string } @@ -280,14 +367,14 @@ export interface DateTimeOptions { /** * Provides the API for formatting date strings. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 6 */ export class DateTimeFormat { /** * A constructor used to create a DateTimeFormat object. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ constructor(); @@ -295,7 +382,7 @@ export class DateTimeFormat { /** * A constructor used to create a DateTimeFormat object. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param locale Indicates character string containing the locale information, including * the language and optionally the script and region, for the DateTimeFormat object. * @param options Indicates the options used to format the date. @@ -306,7 +393,7 @@ export class DateTimeFormat { /** * Obtains the formatted date strings. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param date Indicates the Date object to be formatted. * @return Returns a date string formatted based on the specified locale. * @since 6 @@ -316,7 +403,7 @@ export class DateTimeFormat { /** * Obtains the formatted date strings of a date range. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param startDate Indicates the start date of the date range. * @param endDate Indicates the end date of the date range. * @return Returns a date string formatted based on the specified locale. @@ -327,7 +414,7 @@ export class DateTimeFormat { /** * Obtains the options of the DateTimeFormat object. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns the options of the DateTimeFormat object. * @since 6 */ @@ -337,101 +424,159 @@ export class DateTimeFormat { /** * Provides the options of number format. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n + * @since 6 */ export interface NumberOptions { /** * Indicates the locale. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ locale: string /** * Indicates the currency. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ currency: string /** * Indicates the currency sign. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ currencySign: string /** * Indicates the currency display format. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ currencyDisplay: string /** * Indicates the unit. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ unit: string /** * Indicates the unit display format. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ unitDisplay: string /** * Indicates the unit display format. + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ unitUsage: string /** * Indicates the sign display format. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ signDisplay: string /** * Indicates the compact display format. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ compactDisplay: string /** * Indicates the notation. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ notation: string /** * Indicates the locale matching algorithm. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ localeMatcher: string /** * Indicates the style. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ style: string /** * Indicates the numbering system. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ numberingSystem: string /** * Indicates whether using grouping or not. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ useGrouping: boolean /** * Indicates the minimum integer digits. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ minimumIntegerDigits: number /** * Indicates the minimum fraction digits. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ minimumFractionDigits: number /** * Indicates the maximum fraction digits. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ maximumFractionDigits: number /** * Indicates the minimum significant digits. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ minimumSignificantDigits: number /** * Indicates the maximum significant digits. + * + * @syscap SystemCapability.Global.I18n + * @since 6 */ maximumSignificantDigits: number } @@ -439,13 +584,14 @@ export interface NumberOptions { /** * Provides the API for formatting number strings. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n + * @since 6 */ export class NumberFormat { /** * A constructor used to create a NumberFormat object. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ constructor(); @@ -453,7 +599,7 @@ export class NumberFormat { /** * A constructor used to create a NumberFormat object. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param locale Indicates a character string containing the locale information, including * the language and optionally the script and region, for the NumberFormat object. * @param options Indicates the options used to format the number. @@ -464,7 +610,7 @@ export class NumberFormat { /** * Obtains the formatted number string. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param number Indicates the number to be formatted. * @return Returns a number string formatted based on the specified locale. * @since 6 @@ -474,7 +620,7 @@ export class NumberFormat { /** * Obtains the options of the NumberFormat object. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns the options of the NumberFormat object. * @since 6 */ @@ -484,48 +630,69 @@ export class NumberFormat { /** * Provides the options of Collator * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export interface CollatorOptions { /** * The locale matching algorithm to use. * Possible values are "lookup" and "best fit"; the default is "best fit". + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ localeMatcher: string; /** * Whether the comparison is for sorting or for searching for matching strings. * Possible values are "sort" and "search"; the default is "sort". + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ usage: string; /** * Which differences in the strings should lead to non-zero result values. * Possible values are "base", "accent", "case", "variant". + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ sensitivity: string; /** * Whether punctuation should be ignored. * Possible values are true and false; the default is false. + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ ignorePunctuation: boolean; /** * Variant collations for certain locales. + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ collation: string; /** * Whether numeric collation should be used. * Possible values are true and false; the default is false. + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ numeric: boolean; /** * Whether upper case or lower case should sort first. * Possible values are "upper", "lower", or "false" (use the locale's default). + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ caseFirst: string; } @@ -533,21 +700,21 @@ export interface CollatorOptions { /** * Enable language-sensitive string comparison. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export class Collator { /** * A constructor used to create Collator object. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ constructor(); /** * A constructor used to create Collator Object; * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param locale Indicates a character string containing the locale information, including * the language and optionally the script and region, for the Collator object. * @param options Indicates the options used to initialize Collator object. @@ -558,7 +725,7 @@ export class Collator { /** * compares two strings according to the sort order of this Collator object * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param first The first string to compare. * @param second The second string to compare. * @return Returns a number indicating how first compare to second: @@ -573,7 +740,7 @@ export class Collator { * Returns a new object with properties reflecting the locale and collation options computed * during initialization of the object. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns a CollatorOptions object reflecting the properties of this object. * @since 8 */ @@ -583,30 +750,42 @@ export class Collator { /** * Provides the options of PluralRules * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export interface PluralRulesOptions { /** * The locale matching algorithm to use. * Possible values are "lookup" and "best fit"; the default is "best fit". + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ localeMatcher: string; /** * The type to use. Possible values are: "cardinal", "ordinal" + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ type: string; /** * The minimum number of integer digits to use. * Possible values are from 1 to 21; the default is 1. + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ minimumIntegerDigits: number; /** * The minimum number of fraction digits to use. * Possible values are from 0 to 20; the default for plain number and percent formatting is 0; + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ minimumFractionDigits: number; @@ -614,18 +793,27 @@ export interface PluralRulesOptions { * The maximum number of fraction digits to use. * Possible values are from 0 to 20; * the default for plain number formatting is the larger of minimumFractionDigits and 3; + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ maximumFractionDigits: number; /** * The minimum number of significant digits to use. * Possible values are from 1 to 21; the default is 1. + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ minimumSignificantDigits: number; /** * The maximum number of significant digits to use. * Possible values are from 1 to 21; the default is 21. + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ maximumSignificantDigits: number; } @@ -633,14 +821,14 @@ export interface PluralRulesOptions { /** * Enables plural-sensitive formatting and plural-related language rules. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export class PluralRules { /** * A constructor used to create PluralRules object. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ constructor(); @@ -648,7 +836,7 @@ export class PluralRules { /** * A constructor used to create PluralRules object. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param locale Indicates a character string containing the locale information, including * the language and optionally the script and region, for the PluralRules object. * @param options Indicates the options used to initialize PluralRules object. @@ -659,7 +847,7 @@ export class PluralRules { /** * Returns a string indicating which plural rule to use for locale-aware formatting. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param n The number to get a plural rule for. * @return A string representing the pluralization category of the number, * can be one of zero, one, two, few, many or other. @@ -671,25 +859,34 @@ export class PluralRules { /** * Provides the input options of RelativeTimeFormat. * - * @sysCap SystemCapability.Intl + * @syscap SystemCapability.Global.I18n * @since 8 */ export interface RelativeTimeFormatInputOptions { /** * The locale matching algorithm to use. * Possible values are: lookup, best fit + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ localeMatcher: string; /** * The format of output message. * Possible values are: always, auto + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ numeric: string; /** * The length of the internationalized message. * Possible values are: long, short, narrow + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ style: string; } @@ -697,29 +894,41 @@ export class PluralRules { /** * Provides the resolved options of RelativeTimeFormat. * - * @sysCap SystemCapability.Intl + * @syscap SystemCapability.Global.I18n * @since 8 */ export interface RelativeTimeFormatResolvedOptions { /** * The BCP 47 language tag for the locale actually used. + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ locale: string; /** * The length of the internationalized message. * Possible values are: long, short, narrow + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ style: string; /** * The format of output message. * Possible values are: always, auto + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ numeric: string; /** * The value requested using the Unicode extension key "nu" or filled in as a default. + * + * @syscap SystemCapability.Global.I18n + * @since 8 */ numberingSystem: string; } @@ -728,14 +937,14 @@ export interface RelativeTimeFormatResolvedOptions { * Given a Time period length value and a unit, RelativeTimeFormat object enables * language-sensitive relative time formatting. * - * @sysCap SystemCapability.Intl + * @syscap SystemCapability.Global.I18n * @since 8 */ export class RelativeTimeFormat { /** * A constructor used to create RelativeTimeFormat object. * - * @sysCap SystemCapability.Intl + * @syscap SystemCapability.Global.I18n * @since 8 */ constructor(); @@ -743,7 +952,7 @@ export class RelativeTimeFormat { /** * A constructor used to create RelativeTimeFormat object. * - * @sysCap SystemCapability.Intl + * @syscap SystemCapability.Global.I18n * @param locale Indicates a character string containing the locale information, including * the language and optionally the script and region, for the RelativeTimeFormat object. * @param options Indicates the options used to initialize RelativeTimeFormat object. @@ -754,7 +963,7 @@ export class RelativeTimeFormat { /** * formats a value and unit according to the locale and formatting options of this object. * - * @sysCap SystemCapability.Intl + * @syscap SystemCapability.Global.I18n * @param value Numeric value to use in the internationalized relative time message. * @param unit Unit to use in the relative time internationalized message. * Possible values are: year, quarter, month, week, day, hour, minute, second. @@ -767,7 +976,7 @@ export class RelativeTimeFormat { * returns an Array of objects representing the relative time format in parts that can be used for * custom locale-aware formatting * - * @sysCap SystemCapability.Intl + * @syscap SystemCapability.Global.I18n * @param value Numeric value to use in the internationalized relative time message. * @param unit to use in the relative time internationalized message. * Possible values are: year, quarter, month, week, day, hour, minute, second. @@ -780,7 +989,7 @@ export class RelativeTimeFormat { * Returns a new object with properties reflecting the locale and formatting options computed during * initialization of the object. * - * @sysCap SystemCapability.Intl + * @syscap SystemCapability.Global.I18n * @returns RelativeTimeFormatOptions which reflecting the locale and formatting options of the object. * @since 8 */ diff --git a/api/@ohos.matrix4.d.ts b/api/@ohos.matrix4.d.ts index 635a260179ca9879324b6c25558f6dd2759501a0..9f779cf3176abbfee0cd1df1608f02d20541aef6 100644 --- a/api/@ohos.matrix4.d.ts +++ b/api/@ohos.matrix4.d.ts @@ -16,33 +16,29 @@ /** * Used to do matrix operations * @import import Matrix4 from '@ohos.matrix4' - * @devices phone, tablet, tv, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ declare namespace matrix4 { /** * Set translation parameters - * @devices phone, tablet, tv, wearable * @since 7 */ interface TranslateOption { /** * Indicates the translation distance of the x-axis, in px. - * @devices phone, tablet, tv, wearable * @since 7 */ x?: number; /** * Indicates the translation distance of the y-axis, in px. - * @devices phone, tablet, tv, wearable * @since 7 */ y?: number; /** * Indicates the translation distance of the z-axis, in px. - * @devices phone, tablet, tv, wearable * @since 7 */ z?: number; @@ -50,41 +46,35 @@ declare namespace matrix4 { /** * Set scaling parameters - * @devices phone, tablet, tv, wearable * @since 7 */ interface ScaleOption { /** * Zoom factor of the x-axis. - * @devices phone, tablet, tv, wearable * @since 7 */ x?: number; /** * Zoom factor of the y-axis. - * @devices phone, tablet, tv, wearable * @since 7 */ y?: number; /** * Zoom factor of the z-axis. - * @devices phone, tablet, tv, wearable * @since 7 */ z?: number; /** * Transform the x-axis coordinate of the center point. - * @devices phone, tablet, tv, wearable * @since 7 */ centerX?: number; /** * Transform the y-axis coordinate of the center point. - * @devices phone, tablet, tv, wearable * @since 7 */ centerY?: number; @@ -92,48 +82,41 @@ declare namespace matrix4 { /** * Set Rotation Parameters. - * @devices phone, tablet, tv, wearable * @since 7 */ interface RotateOption { /** * Axis of rotation vector x coordinate. - * @devices phone, tablet, tv, wearable * @since 7 */ x?: number; /** * Axis of rotation vector y coordinate. - * @devices phone, tablet, tv, wearable * @since 7 */ y?: number; /** * Axis of rotation vector z coordinate. - * @devices phone, tablet, tv, wearable * @since 7 */ z?: number; /** * Transform the x-axis coordinate of the center point. - * @devices phone, tablet, tv, wearable * @since 7 */ centerX?: number; /** * Transform the y-axis coordinate of the center point. - * @devices phone, tablet, tv, wearable * @since 7 */ centerY?: number; /** * Rotation angle. - * @devices phone, tablet, tv, wearable * @since 7 */ angle?: number; @@ -141,14 +124,12 @@ declare namespace matrix4 { /** * Matrix4Transit. - * @devices phone, tablet, tv, wearable * @since 7 */ interface Matrix4Transit { /** * Copy function of Matrix, which can copy a copy of the current matrix object. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ copy(): Matrix4Transit; @@ -156,7 +137,6 @@ declare namespace matrix4 { /** * The inverse function of Matrix returns an inverse matrix of the current matrix object, that is, the effect is exactly the opposite. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ invert(): Matrix4Transit; @@ -164,55 +144,68 @@ declare namespace matrix4 { /** * Matrix superposition function, which can superpose the effects of two matrices to generate a new matrix object. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ - combine(options:Matrix4Transit): Matrix4Transit; + combine(options: Matrix4Transit): Matrix4Transit; /** * Matrix translation function, which can add the x-axis, Y-axis, or Z-axis translation effect to the current matrix. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ - translate(options:TranslateOption): Matrix4Transit; + translate(options: TranslateOption): Matrix4Transit; /** * Scaling function of the Matrix, which can add the x-axis, Y-axis, or Z-axis scaling effect to the current matrix. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ - scale(options:ScaleOption): Matrix4Transit; + scale(options: ScaleOption): Matrix4Transit; - /* Rotation function of the Matrix. You can add the x-axis, Y-axis, or Z-axis rotation effect to the current matrix. + /** + * Rotation function of the Matrix. You can add the x-axis, Y-axis, or Z-axis rotation effect to the current matrix. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ - rotate(options:RotateOption): Matrix4Transit; + rotate(options: RotateOption): Matrix4Transit; /** * Matrix coordinate point conversion function, which can apply the current transformation effect to a coordinate point. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ - transformPoint(options:[number,number]): [number,number]; + transformPoint(options: [number, number]): [number, number]; } /** * Constructor of Matrix, which can create a fourth-order matrix based on the input parameters. The matrix is column-first. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ - function init(options: [number,number,number,number,number,number,number,number,number,number,number,number,number,number,number,number]): Matrix4Transit; + function init( + options: [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + ], + ): Matrix4Transit; /** * Matrix initialization function, which can return an identity matrix object. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ function identity(): Matrix4Transit; @@ -220,7 +213,6 @@ declare namespace matrix4 { /** * Copy function of Matrix, which can copy a copy of the current matrix object. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ function copy(): Matrix4Transit; @@ -228,7 +220,6 @@ declare namespace matrix4 { /** * The inverse function of Matrix returns an inverse matrix of the current matrix object, that is, the effect is exactly the opposite. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ function invert(): Matrix4Transit; @@ -236,42 +227,37 @@ declare namespace matrix4 { /** * Matrix superposition function, which can superpose the effects of two matrices to generate a new matrix object. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ - function combine(options:Matrix4Transit): Matrix4Transit; + function combine(options: Matrix4Transit): Matrix4Transit; /** * Matrix translation function, which can add the x-axis, Y-axis, or Z-axis translation effect to the current matrix. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ - function translate(options:TranslateOption): Matrix4Transit; + function translate(options: TranslateOption): Matrix4Transit; /** * Scaling function of the Matrix, which can add the x-axis, Y-axis, or Z-axis scaling effect to the current matrix. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ - function scale(options:ScaleOption): Matrix4Transit; + function scale(options: ScaleOption): Matrix4Transit; /** * Rotation function of the Matrix. You can add the x-axis, Y-axis, or Z-axis rotation effect to the current matrix. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ - function rotate(options:RotateOption): Matrix4Transit; + function rotate(options: RotateOption): Matrix4Transit; /** * Matrix coordinate point conversion function, which can apply the current transformation effect to a coordinate point. * @since 7 - * @devices phone, tablet, tv, wearable * @return Return to Matrix4Transit */ - function transformPoint(options:[number,number]): [number,number]; + function transformPoint(options: [number, number]): [number, number]; } -export default matrix4; \ No newline at end of file +export default matrix4; diff --git a/api/@ohos.mediaquery.d.ts b/api/@ohos.mediaquery.d.ts index fe889218bf4c2fbc32eb5beb197e38dc4c4db719..475e5974cd70a91d1ae956835138c4bf9b61e2c9 100644 --- a/api/@ohos.mediaquery.d.ts +++ b/api/@ohos.mediaquery.d.ts @@ -15,6 +15,12 @@ import {Callback} from './basic'; +/** + * Used to do mediaquery operations. + * @import import mediaquery from '@ohos.mediaquery' + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ declare namespace mediaquery { interface MediaQueryResult { @@ -22,14 +28,14 @@ declare namespace mediaquery { /** * Whether the match condition is met. * This parameter is read-only. - * @since 8 + * @since 7 */ readonly matches: boolean; /** * Matching condition of a media event. * This parameter is read-only. - * @since 8 + * @since 7 */ readonly media: string; } @@ -39,21 +45,21 @@ declare namespace mediaquery { /** * Registers a callback with the corresponding query condition by using the handle. * This callback is triggered when the media attributes change. - * @since 8 + * @since 7 */ on(type: 'change', callback: Callback): void; /** * Deregisters a callback with the corresponding query condition by using the handle. * This callback is not triggered when the media attributes chang. - * @since 8 + * @since 7 */ off(type: 'change', callback?: Callback): void; } /** * Sets the media query criteria and returns the corresponding listening handle - * @since 8 + * @since 7 */ function matchMediaSync(condition: string): MediaQueryListener; } diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index 9970a64dabd8d1d6632dcfc0ce5793c0aacf190f..b3df5858f0f1e862e642ecd5925ebc445904e7da 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -24,33 +24,50 @@ declare namespace audio { /** * Obtains an AudioManager instance. + * @return AudioManager object. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core */ function getAudioManager(): AudioManager; /** - * Creates a AudioCapturer instance. - * @param options All options used for audio capturer. - * @return AudioCapturer instance. + * Obtains an AudioCapturer instance. This method uses an asynchronous callback to return the capturer instance. + * @param options Capturer configurations. + * @param callback Callback used to return the audio capturer instance. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ function createAudioCapturer(options: AudioCapturerOptions, callback: AsyncCallback): void; + + /** + * Obtains an AudioCapturer instance. This method uses a promise to return the capturer instance. + * @param options Capturer configurations. + * @return Promise used to return the audio capturer instance. + * @since 8 + * @syscap SystemCapability.Multimedia.Audio.Capturer + */ function createAudioCapturer(options: AudioCapturerOptions): Promise; /** - * Creates a AudioRenderer instance. - * @param options All options used for audio renderer. - * @return AudioRenderer instance. + * Obtains an AudioRenderer instance. This method uses an asynchronous callback to return the renderer instance. + * @param options Renderer configurations. + * @param callback Callback used to return the audio renderer instance. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ function createAudioRenderer(options: AudioRendererOptions, callback: AsyncCallback): void; + + /** + * Obtains an AudioRenderer instance. This method uses a promise to return the renderer instance. + * @param options Renderer configurations. + * @return Promise used to return the audio renderer instance. + * @since 8 + * @syscap SystemCapability.Multimedia.Audio.Renderer + */ function createAudioRenderer(options: AudioRendererOptions): Promise; /** - * Enumerates the rendering states of the current device. + * Enumerates the audio states. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ @@ -62,7 +79,7 @@ declare namespace audio { */ STATE_INVALID = -1, /** - * Create New instance state. + * Create new instance state. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ @@ -106,25 +123,25 @@ declare namespace audio { */ enum AudioVolumeType { /** - * Audio streams for voice calls + * Audio streams for voice calls. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Volume */ VOICE_CALL = 0, /** - * Audio streams for ring tones + * Audio streams for ringtones. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume */ RINGTONE = 2, /** - * Audio streams for media purpose + * Audio streams for media purpose. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume */ MEDIA = 3, /** - * Audio stream for voice assistant + * Audio stream for voice assistant. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Volume */ @@ -138,19 +155,19 @@ declare namespace audio { */ enum DeviceFlag { /** - * Output devices + * Output devices. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ OUTPUT_DEVICES_FLAG = 1, /** - * Input devices + * Input devices. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ INPUT_DEVICES_FLAG = 2, /** - * All devices + * All devices. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ @@ -164,13 +181,13 @@ declare namespace audio { */ enum DeviceRole { /** - * Input role + * Input role. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ INPUT_DEVICE = 1, /** - * Output role + * Output role. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ @@ -184,13 +201,13 @@ declare namespace audio { */ enum DeviceType { /** - * Invalid device + * Invalid device. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ INVALID = 0, /** - * A pair of built-in earpieces. + * Built-in earpiece. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ @@ -214,19 +231,19 @@ declare namespace audio { */ WIRED_HEADPHONES = 4, /** - * Bluetooth device using the synchronous connection oriented link (SCO) + * Bluetooth device using the synchronous connection oriented link (SCO). * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ BLUETOOTH_SCO = 7, /** - * Bluetooth device using advanced audio distribution profile (A2DP) + * Bluetooth device using advanced audio distribution profile (A2DP). * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ BLUETOOTH_A2DP = 8, /** - * Built-in microphone + * Built-in microphone. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ @@ -240,19 +257,19 @@ declare namespace audio { } /** - * Enumerates Active device types. + * Enumerates the active device types. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ enum ActiveDeviceType { /** - * Speaker + * Speaker. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ SPEAKER = 2, /** - * Bluetooth device using the synchronous connection oriented link (SCO) + * Bluetooth device using the SCO link. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ @@ -260,33 +277,33 @@ declare namespace audio { } /** - * Enumerates Audio Ringer modes + * Enumerates ringer modes. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication */ enum AudioRingMode { /** - * Silent mode + * Silent mode. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication */ RINGER_MODE_SILENT = 0, /** - * Vibration mode + * Vibration mode. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication */ - RINGER_MODE_VIBRATE, + RINGER_MODE_VIBRATE = 1, /** - * Normal mode + * Normal mode. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication */ - RINGER_MODE_NORMAL, + RINGER_MODE_NORMAL = 2, } /** - * Enumerates the sample format. + * Enumerates the audio sample formats. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ @@ -304,19 +321,19 @@ declare namespace audio { */ SAMPLE_FORMAT_U8 = 0, /** - * Signed 16 low-end format. + * Signed 16 bit integer, little endian. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ SAMPLE_FORMAT_S16LE = 1, /** - * Signed 24 low-end format. + * Signed 24 bit integer, little endian. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ SAMPLE_FORMAT_S24LE = 2, /** - * Signed 32 low-end format. + * Signed 32 bit integer, little endian. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ @@ -330,13 +347,13 @@ declare namespace audio { */ enum AudioChannel { /** - * First channel. + * Channel 1. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ CHANNEL_1 = 0x1 << 0, /** - * Second channel. + * Channel 2. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ @@ -430,7 +447,7 @@ declare namespace audio { */ ENCODING_TYPE_INVALID = -1, /** - * Raw pcm type. + * PCM encoding. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ @@ -510,35 +527,35 @@ declare namespace audio { * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core */ - STREAM_USAGE_NOTIFICATION_RINGTONE = 3 + STREAM_USAGE_NOTIFICATION_RINGTONE = 6 } /** - * Interface for audio stream info + * Describes audio stream information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ interface AudioStreamInfo { /** - * Audio sampling rate + * Sampling rate. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ samplingRate: AudioSamplingRate; /** - * Audio channels + * Audio channels. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ channels: AudioChannel; /** - * Audio sample format + * Audio sample format. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ sampleFormat: AudioSampleFormat; /** - * Audio encoding type + * Audio encoding type. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ @@ -546,25 +563,25 @@ declare namespace audio { } /** - * Interface for audio renderer info + * Describes audio renderer information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ interface AudioRendererInfo { /** - * Audio content type + * Content type. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ content: ContentType; /** - * Audio stream usage + * Stream usage. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ usage: StreamUsage; /** - * Audio renderer flags + * Audio renderer flags. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ @@ -572,19 +589,19 @@ declare namespace audio { } /** - * Interface for audio renderer options + * Describes audio renderer configuration options. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ interface AudioRendererOptions { /** - * Audio stream info + * Stream information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ streamInfo: AudioStreamInfo; /** - * Audio renderer info + * Renderer information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ @@ -592,25 +609,25 @@ declare namespace audio { } /** - * Enum for audio renderer rate + * Enumerates the audio renderer rates. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ enum AudioRendererRate { /** - * Normal rate + * Normal rate. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ RENDER_RATE_NORMAL = 0, /** - * Double rate + * Double rate. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ RENDER_RATE_DOUBLE = 1, /** - * Half rate + * Half rate. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ @@ -618,20 +635,20 @@ declare namespace audio { } /** - * Enumerates audio interruption event types. + * Enumerates the interrupt types. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer */ enum InterruptType { /** - * An audio interruption event starts. + * Audio playback interruption started. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer */ INTERRUPT_TYPE_BEGIN = 1, /** - * An audio interruption event ends. + * Audio playback interruption ended. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer */ @@ -639,102 +656,53 @@ declare namespace audio { } /** - * Enumerates the types of hints for audio interruption. + * Enumerates the interrupt hints. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer */ enum InterruptHint { /** - * Audio no interrupt. + * None. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ INTERRUPT_HINT_NONE = 0, /** - * Audio resumed. + * Resume the playback. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer */ INTERRUPT_HINT_RESUME = 1, /** - * Audio paused. + * Paused/Pause the playback. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer */ INTERRUPT_HINT_PAUSE = 2, /** - * Audio stopped. + * Stopped/Stop the playback. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer */ INTERRUPT_HINT_STOP = 3, /** - * Audio ducking. (In ducking, the audio volume is reduced, but not silenced.) + * Ducked the playback. (In ducking, the audio volume is reduced, but not silenced.) * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer */ INTERRUPT_HINT_DUCK = 4, /** - * Audio unducking. + * Unducked the playback. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ INTERRUPT_HINT_UNDUCK = 5, } - /** - * Interrupt force type. - * @since 8 - * @syscap SystemCapability.Multimedia.Audio.Renderer - */ - enum InterruptForceType { - /** - * Force type, system change audio state. - * @since 8 - * @syscap SystemCapability.Multimedia.Audio.Renderer - */ - INTERRUPT_FORCE = 0, - /** - * Share type, application change audio state. - * @since 8 - * @syscap SystemCapability.Multimedia.Audio.Renderer - */ - INTERRUPT_SHARE - } - - /** - * Interrupt events - * @since 8 - * @syscap SystemCapability.Multimedia.Audio.Renderer - */ - interface InterruptEvent { - /** - * Interrupt event type, begin or end - * @since 8 - * @syscap SystemCapability.Multimedia.Audio.Renderer - */ - eventType: InterruptType; - - /** - * Interrupt force type, force or share - * @since 8 - * @syscap SystemCapability.Multimedia.Audio.Renderer - */ - forceType: InterruptForceType; - - /** - * Interrupt hint type. In force type, the audio state already changed, - * but in share mode, only provide a hint for application to decide. - * @since 8 - * @syscap SystemCapability.Multimedia.Audio.Renderer - */ - hintType: InterruptHint; - } - /** * Enumerates interrupt action types. * @since 7 @@ -782,7 +750,7 @@ declare namespace audio { * Enumerates audio scenes. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Communication - */ + */ enum AudioScene { /** * Default audio scene @@ -813,268 +781,373 @@ declare namespace audio { } /** - * Manages audio volume and audio device information. + * Implements audio volume and audio device management. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core */ interface AudioManager { /** - * Sets volume for a stream. This method uses an asynchronous callback to return the execution result. + * Sets the volume for a stream. This method uses an asynchronous callback to return the result. + * @param volumeType Audio stream type. + * @param volume Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume. + * @param callback Callback used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY */ - setVolume(audioType: AudioVolumeType, volume: number, callback: AsyncCallback): void; + setVolume(volumeType: AudioVolumeType, volume: number, callback: AsyncCallback): void; /** - * Sets volume for a stream. This method uses a promise to return the execution result. + * Sets the volume for a stream. This method uses a promise to return the result. + * @param volumeType Audio stream type. + * @param volume Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume. + * @return Promise used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY */ - setVolume(audioType: AudioVolumeType, volume: number): Promise; + setVolume(volumeType: AudioVolumeType, volume: number): Promise; /** - * Obtains volume of a stream. This method uses an asynchronous callback to return the execution result. + * Obtains the volume of a stream. This method uses an asynchronous callback to return the query result. + * @param volumeType Audio stream type. + * @param callback Callback used to return the volume. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume */ - getVolume(audioType: AudioVolumeType, callback: AsyncCallback): void; + getVolume(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** - * Obtains the volume of a stream. This method uses a promise to return the execution result. + * Obtains the volume of a stream. This method uses a promise to return the query result. + * @param volumeType Audio stream type. + * @return Promise used to return the volume. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume */ - getVolume(audioType: AudioVolumeType): Promise; + getVolume(volumeType: AudioVolumeType): Promise; /** - * Obtains the minimum volume allowed for a stream. This method uses an asynchronous callback to return the execution result. + * Obtains the minimum volume allowed for a stream. This method uses an asynchronous callback to return the query result. + * @param volumeType Audio stream type. + * @param callback Callback used to return the minimum volume. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume */ - getMinVolume(audioType: AudioVolumeType, callback: AsyncCallback): void; + getMinVolume(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** - * Obtains the minimum volume allowed for a stream. This method uses a promise to return the execution result. + * Obtains the minimum volume allowed for a stream. This method uses a promise to return the query result. + * @param volumeType Audio stream type. + * @return Promise used to return the minimum volume. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume */ - getMinVolume(audioType: AudioVolumeType): Promise; + getMinVolume(volumeType: AudioVolumeType): Promise; /** - * Obtains the maximum volume allowed for a stream. This method uses an asynchronous callback to return the execution result. + * Obtains the maximum volume allowed for a stream. This method uses an asynchronous callback to return the query result. + * @param volumeType Audio stream type. + * @param callback Callback used to return the maximum volume. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume */ - getMaxVolume(audioType: AudioVolumeType, callback: AsyncCallback): void; + getMaxVolume(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** - * Obtains the maximum volume allowed for a stream. This method uses a promise to return the execution result. + * Obtains the maximum volume allowed for a stream. This method uses a promise to return the query result. + * @param volumeType Audio stream type. + * @return Promise used to return the maximum volume. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume */ - getMaxVolume(audioType: AudioVolumeType): Promise; + getMaxVolume(volumeType: AudioVolumeType): Promise; /** - * Obtains the audio devices of a specified flag. This method uses an asynchronous callback to return the execution result. + * Obtains the audio devices with a specific flag. This method uses an asynchronous callback to return the query result. + * @param deviceFlag Audio device flag. + * @param callback Callback used to return the device list. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ getDevices(deviceFlag: DeviceFlag, callback: AsyncCallback): void; /** - * Obtains the audio devices with a specified flag. This method uses a promise to return the execution result. + * Obtains the audio devices with a specific flag. This method uses a promise to return the query result. + * @param deviceFlag Audio device flag. + * @return Promise used to return the device list. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ getDevices(deviceFlag: DeviceFlag): Promise; /** - * Sets the stream to mute. This method uses an asynchronous callback to return the execution result. + * Mutes a stream. This method uses an asynchronous callback to return the result. + * @param volumeType Audio stream type. + * @param mute Mute status to set. The value true means to mute the stream, and false means the opposite. + * @param callback Callback used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume */ - mute(audioType: AudioVolumeType, mute: boolean, callback: AsyncCallback): void; + mute(volumeType: AudioVolumeType, mute: boolean, callback: AsyncCallback): void; /** - * Sets the stream to mute. This method uses a promise to return the execution result. + * Mutes a stream. This method uses a promise to return the result. + * @param volumeType Audio stream type. + * @param mute Mute status to set. The value true means to mute the stream, and false means the opposite. + * @return Promise used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume */ - mute(audioType: AudioVolumeType, mute: boolean): Promise; + mute(volumeType: AudioVolumeType, mute: boolean): Promise; /** - * Checks whether the stream is muted. This method uses an asynchronous callback to return the execution result. + * Checks whether a stream is muted. This method uses an asynchronous callback to return the query result. + * @param volumeType Audio stream type. + * @param callback Callback used to return the mute status of the stream. The value true means that the stream is + * muted, and false means the opposite. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume */ - isMute(audioType: AudioVolumeType, callback: AsyncCallback): void; + isMute(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** - * Checks whether the stream is muted. This method uses a promise to return the execution result. + * Checks whether a stream is muted. This method uses a promise to return the result. + * @param volumeType Audio stream type. + * @return Promise used to return the mute status of the stream. The value true means that the stream is muted, + * and false means the opposite. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume */ - isMute(audioType: AudioVolumeType): Promise; + isMute(volumeType: AudioVolumeType): Promise; /** - * Checks whether the stream is active. This method uses an asynchronous callback to return the execution result. + * Checks whether a stream is active. This method uses an asynchronous callback to return the query result. + * @param volumeType Audio stream type. + * @param callback Callback used to return the active status of the stream. The value true means that the stream is + * active, and false means the opposite. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume */ - isActive(audioType: AudioVolumeType, callback: AsyncCallback): void; + isActive(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** - * Checks whether the stream is active. This method uses a promise to return the execution result. + * Checks whether a stream is active. This method uses a promise to return the query result. + * @param volumeType Audio stream type. + * @return Promise used to return the active status of the stream. The value true means that the stream is active, + * and false means the opposite. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume */ - isActive(audioType: AudioVolumeType): Promise; + isActive(volumeType: AudioVolumeType): Promise; /** - * Mute/Unmutes the microphone. This method uses an asynchronous callback to return the execution result. + * Mutes or unmutes the microphone. This method uses an asynchronous callback to return the result. + * @param mute Mute status to set. The value true means to mute the microphone, and false means the opposite. + * @param callback Callback used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @permission ohos.permission.MICROPHONE */ setMicrophoneMute(mute: boolean, callback: AsyncCallback): void; /** - * Mute/Unmutes the microphone. This method uses a promise to return the execution result. + * Mutes or unmutes the microphone. This method uses a promise to return the result. + * @param mute Mute status to set. The value true means to mute the microphone, and false means the opposite. + * @return Promise used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @permission ohos.permission.MICROPHONE */ setMicrophoneMute(mute: boolean): Promise; /** - * Checks whether the microphone is muted. This method uses an asynchronous callback to return the execution result. + * Checks whether the microphone is muted. This method uses an asynchronous callback to return the query result. + * @param Callback used to return the mute status of the microphone. The value true means that the microphone is + * muted, and false means the opposite. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @permission ohos.permission.MICROPHONE */ isMicrophoneMute(callback: AsyncCallback): void; /** - * Checks whether the microphone is muted. This method uses a promise to return the execution result. + * Checks whether the microphone is muted. This method uses a promise to return the query result. + * @return Promise used to return the mute status of the microphone. The value true means that the microphone is + * muted, and false means the opposite. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @permission ohos.permission.MICROPHONE */ isMicrophoneMute(): Promise; /** - * Sets the ringer mode. This method uses an asynchronous callback to return the execution result. + * Sets the ringer mode. This method uses an asynchronous callback to return the result. + * @param mode Ringer mode. + * @param callback Callback used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication + * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY */ setRingerMode(mode: AudioRingMode, callback: AsyncCallback): void; /** - * Sets the ringer mode. This method uses a promise to return the execution result. + * Sets the ringer mode. This method uses a promise to return the result. + * @param mode Ringer mode. + * @return Promise used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication + * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY */ setRingerMode(mode: AudioRingMode): Promise; /** - * Gets the ringer mode. This method uses an asynchronous callback to return the execution result. + * Obtains the ringer mode. This method uses an asynchronous callback to return the query result. + * @param callback Callback used to return the ringer mode. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication */ getRingerMode(callback: AsyncCallback): void; /** - * Gets the ringer mode. This method uses a promise to return the execution result. + * Obtains the ringer mode. This method uses a promise to return the query result. + * @return Promise used to return the ringer mode. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication */ getRingerMode(): Promise; /** - * Sets the audio parameter. This method uses an asynchronous callback to return the execution result. + * Sets an audio parameter. This method uses an asynchronous callback to return the result. + * @param key Key of the audio parameter to set. + * @param value Value of the audio parameter to set. + * @param callback Callback used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core + * @permission ohos.permission.MODIFY_AUDIO_SETTINGS */ setAudioParameter(key: string, value: string, callback: AsyncCallback): void; /** - * Sets the audio parameter. This method uses a promise to return the execution result. + * Sets an audio parameter. This method uses a promise to return the result. + * @param key Key of the audio parameter to set. + * @param value Value of the audio parameter to set. + * @return Promise used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core + * @permission ohos.permission.MODIFY_AUDIO_SETTINGS */ setAudioParameter(key: string, value: string): Promise; /** - * Gets the audio parameter. This method uses an asynchronous callback to return the execution result. + * Obtains the value of an audio parameter. This method uses an asynchronous callback to return the query result. + * @param key Key of the audio parameter whose value is to be obtained. + * @param callback Callback used to return the value of the audio parameter. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core */ getAudioParameter(key: string, callback: AsyncCallback): void; /** - * Gets the audio parameter. This method uses a promise to return the execution result. + * Obtains the value of an audio parameter. This method uses a promise to return the query result. + * @param key Key of the audio parameter whose value is to be obtained. + * @return Promise used to return the value of the audio parameter. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core */ getAudioParameter(key: string): Promise; /** - * Activates the device. This method uses an asynchronous callback to return the execution result. + * Sets a device to the active state. This method uses an asynchronous callback to return the result. + * @param deviceType Audio device type. + * @param active Active status to set. The value true means to set the device to the active status, and false + * means the opposite. + * @param callback Callback used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ setDeviceActive(deviceType: ActiveDeviceType, active: boolean, callback: AsyncCallback): void; /** - * Activates the device. This method uses a promise to return the execution result. + * Sets a device to the active state. This method uses a promise to return the result. + * @param deviceType Audio device type. + * @param active Active status to set. The value true means to set the device to the active status, and false + * means the opposite. + * @return Promise used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ setDeviceActive(deviceType: ActiveDeviceType, active: boolean): Promise; /** - * Checks whether the device is active. This method uses an asynchronous callback to return the execution result. + * Checks whether a device is active. This method uses an asynchronous callback to return the query result. + * @param deviceType Audio device type. + * @param callback Callback used to return the active status of the device. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ isDeviceActive(deviceType: ActiveDeviceType, callback: AsyncCallback): void; /** - * Checks whether the device is active. This method uses a promise to return the execution result. + * Checks whether a device is active. This method uses a promise to return the query result. + * @param deviceType Audio device type. + * @return Promise used to return the active status of the device. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ isDeviceActive(deviceType: ActiveDeviceType): Promise; /** - * Subscribes volume change event callback, only for system - * @return VolumeEvent callback. + * Listens for system volume change events. This method uses a callback to get volume change events. + * @param callback Callback used to get the system volume change event. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi */ on(type: 'volumeChange', callback: Callback): void; /** - * Monitors ringer mode change + * Listens for ringer mode change events. This method uses a callback to get ringer mode changes. + * @param callback Callback used to get the updated ringer mode. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Communication * @systemapi */ on(type: 'ringerModeChange', callback: Callback): void; /** - * Sets the audio scene mode to change audio strategy. - * This method uses an asynchronous callback to return the execution result. + * Sets the audio scene mode to change audio strategies. This method uses an asynchronous callback to return the + * result. + * @param scene Audio scene mode. + * @param callback Callback used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Communication + * @systemapi */ setAudioScene(scene: AudioScene, callback: AsyncCallback ): void; /** - * Sets the audio scene mode to change audio strategy. This method uses a promise to return the execution result. + * Sets the audio scene mode to change audio strategies. This method uses a promise to return the result. + * @param scene Audio scene mode. + * @return Promise used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Communication + * @systemapi */ setAudioScene(scene: AudioScene): Promise; /** - * Obtains the system audio scene mode. This method uses an asynchronous callback to return the execution result. + * Obtains the audio scene mode. This method uses an asynchronous callback to return the query result. + * @param callback Callback used to return the audio scene mode. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Communication */ - getAudioScene(callback: AsyncCallback ): void; + getAudioScene(callback: AsyncCallback): void; /** - * Obtains the system audio scene mode. This method uses a promise to return the execution result. + * Obtains the audio scene mode. This method uses a promise to return the query result. + * @return Promise used to return the audio scene mode. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Communication */ getAudioScene(): Promise; /** - * Monitors device changes - * @since 7 - * @syscap SystemCapability.Multimedia.Audio.Device - */ + * Subscribes to device change events. When a device is connected/disconnected, registered clients will receive + * the callback. + * @param callback Callback used to obtain the device update details. + * @since 7 + * @syscap SystemCapability.Multimedia.Audio.Device + */ on(type: 'deviceChange', callback: Callback): void; + /** + * UnSubscribes to device change events. + * @param callback Callback used to obtain the device update details. + * @since 7 + * @syscap SystemCapability.Multimedia.Audio.Device + */ + off(type: 'deviceChange', callback?: Callback): void; + /** * Listens for audio interruption events. When the audio of an application is interrupted by another application, * the callback is invoked to notify the former application. - * @since 7 - * @syscap SystemCapability.Multimedia.Audio.Renderer * @param type Type of the event to listen for. Only the interrupt event is supported. * @param interrupt Parameters of the audio interruption event type. * @param callback Callback invoked for the audio interruption event. + * @since 7 + * @syscap SystemCapability.Multimedia.Audio.Renderer */ on(type: 'interrupt', interrupt: AudioInterrupt, callback: Callback): void; /** * Cancels the listening of audio interruption events. - * @since 7 - * @syscap SystemCapability.Multimedia.Audio.Renderer * @param type Type of the event to listen for. Only the interrupt event is supported. * @param interrupt Input parameters of the audio interruption event. * @param callback Callback invoked for the audio interruption event. + * @since 7 + * @syscap SystemCapability.Multimedia.Audio.Renderer */ off(type: 'interrupt', interrupt: AudioInterrupt, callback?: Callback): void; } @@ -1086,13 +1159,13 @@ declare namespace audio { */ interface AudioDeviceDescriptor { /** - * Audio device role + * Audio device role. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ readonly deviceRole: DeviceRole; /** - * Audio device type + * Audio device type. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ @@ -1100,33 +1173,33 @@ declare namespace audio { } /** - * A queue of AudioDeviceDescriptor, which is read-only. + * Array of AudioDeviceDescriptors, which is read-only. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device */ type AudioDeviceDescriptors = Array>; /** - * Audio volume event + * Describes the volume event received by the app when the volume is changed. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi */ interface VolumeEvent { /** - * volumeType of current stream + * Volume type of the current stream. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Volume */ volumeType: AudioVolumeType; /** - * volume level + * Volume level. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Volume */ volume: number; /** - * updateUi show volume change in Ui + * Whether to show the volume change in UI. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Volume */ @@ -1224,223 +1297,236 @@ declare namespace audio { } /** - * Provides functions for applications for audio playback. + * Provides audio playback APIs. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ interface AudioRenderer { /** - * Gets audio state. + * Defines the current render state. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ readonly state: AudioState; /** - * Gets audio renderer info. - * @return AudioRendererInfo value + * Obtains the renderer information provided while creating a renderer instance. This method uses an asynchronous + * callback to return the result. + * @param callback Callback used to return the renderer information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ getRendererInfo(callback: AsyncCallback): void; /** - * Gets audio renderer info. - * @return AudioRendererInfo value + * Obtains the renderer information provided while creating a renderer instance. This method uses a promise to + * return the result. + * @return Promise used to return the renderer information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ getRendererInfo(): Promise; /** - * Gets audio stream info. - * @return AudioStreamInfo value + * Obtains the renderer stream information. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the stream information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ getStreamInfo(callback: AsyncCallback): void; /** - * Gets audio stream info. - * @return AudioStreamInfo value + * Obtains the renderer stream information. This method uses a promise to return the result. + * @return Promise used to return the stream information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ getStreamInfo(): Promise; /** - * Starts audio rendering. This method uses an asynchronous callback to return the execution result. + * Starts the renderer. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ start(callback: AsyncCallback): void; /** - * Starts audio rendering. This method uses a promise to return the execution result. + * Starts the renderer. This method uses a promise to return the result. + * @return Promise used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ start(): Promise; /** - * Render audio data. This method uses an asynchronous callback to return the execution result. + * Writes the buffer. This method uses an asynchronous callback to return the result. + * @param buffer Buffer to be written. + * @param callback Returns the number of bytes written if the operation is successful; returns an error code + * otherwise. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ write(buffer: ArrayBuffer, callback: AsyncCallback): void; /** - * Render audio data. This method uses a promise to return the execution result. + * Writes the buffer. This method uses a promise to return the result. + * @param buffer Buffer to be written. + * @return Returns the number of bytes written if the operation is successful; returns an error code otherwise. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ write(buffer: ArrayBuffer): Promise; /** - * Obtains the current timestamp. This method uses an asynchronous callback to return the execution result. + * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses an + * asynchronous callback to return the result. + * @param callback Callback used to return the timestamp. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ getAudioTime(callback: AsyncCallback): void; /** - * Obtains the current timestamp. This method uses a promise to return the execution result. + * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses a + * promise to return the result. + * @return Promise used to return the timestamp. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ getAudioTime(): Promise; /** - * Drain renderer buffer. This method uses an asynchronous callback to return the execution result. + * Drains the playback buffer. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ drain(callback: AsyncCallback): void; /** - * Drain renderer buffer. This method uses a promise to return the execution result. + * Drains the playback buffer. This method uses a promise to return the result. + * @return Promise used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ drain(): Promise; /** - * Pauses audio rendering. This method uses an asynchronous callback to return the execution result. + * Pauses rendering. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ pause(callback: AsyncCallback): void; /** - * Pauses audio rendering. This method uses a promise to return the execution result. + * Pauses rendering. This method uses a promise to return the result. + * @return Promise used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ pause(): Promise; /** - * Stops audio rendering. This method uses an asynchronous callback to return the execution result. + * Stops rendering. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ stop(callback: AsyncCallback): void; /** - * Stops audio rendering. This method uses a promise to return the execution result. + * Stops rendering. This method uses a promise to return the result. + * @return Promise used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ stop(): Promise; /** - * Releases resources. This method uses an asynchronous callback to return the execution result. + * Releases the renderer. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ release(callback: AsyncCallback): void; /** - * Releases resources. This method uses a promise to return the execution result. + * Releases the renderer. This method uses a promise to return the result. + * @return Promise used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ release(): Promise; /** - * Obtains a reasonable minimum buffer size for renderer, however, the renderer can - * accept other read sizes as well. This method uses an asynchronous callback to return the execution result. + * Obtains a reasonable minimum buffer size in bytes for rendering. This method uses an asynchronous callback to + * return the result. + * @param callback Callback used to return the buffer size. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ getBufferSize(callback: AsyncCallback): void; /** - * Obtains a reasonable minimum buffer size for renderer, however, the renderer can - * accept other read sizes as well. This method uses a promise to return the execution result. + * Obtains a reasonable minimum buffer size in bytes for rendering. This method uses a promise to return the result. + * @return Promise used to return the buffer size. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ getBufferSize(): Promise; /** - * Set the render rate. This method uses an asynchronous callback to return the execution result. + * Sets the render rate. This method uses an asynchronous callback to return the result. + * @param rate Audio render rate. + * @param callback Callback used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ setRenderRate(rate: AudioRendererRate, callback: AsyncCallback): void; /** - * Set the render rate. This method uses a promise to return the execution result. + * Sets the render rate. This method uses a promise to return the result. + * @param rate Audio render rate. + * @return Promise used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ setRenderRate(rate: AudioRendererRate): Promise; /** - * Obtains the current render rate. This method uses an asynchronous callback to return the execution result. + * Obtains the current render rate. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the audio render rate. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ getRenderRate(callback: AsyncCallback): void; /** - * Obtains the current render rate. This method uses a promise to return the execution result. + * Obtains the current render rate. This method uses a promise to return the result. + * @return Promise used to return the audio render rate. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ getRenderRate(): Promise; /** - * Subscribes for audio interrupt event callback. - * @param type Event type. - * @return InterruptEvent callback. + * Subscribes to mark reached events. When the number of frames rendered reaches the value of the frame parameter, + * the callback is invoked. + * @param frame Number of frames to trigger the event. The value must be greater than 0. + * @param callback Callback invoked when the event is triggered. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer */ - on(type: 'interrupt', callback: Callback): void; - /** - * Subscribes mark reach event callback. - * @param type Event type. - * @param frame Mark reach frame count. - * @return Mark reach event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Audio.Renderer - * @initial - */ on(type: "markReach", frame: number, callback: (position: number) => {}): void; /** - * Unsubscribes mark reach event callback. + * Unsubscribes from mark reached events. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer - * @initial */ off(type: "markReach"): void; /** - * Subscribes period reach event callback. - * @param type Event type. - * @param frame Period reach frame count. - * @return Period reach event callback. + * Subscribes to period reached events. When the period of frame rendering reaches the value of frame parameter, + * the callback is invoked. + * @param frame Period during which frame rendering is listened. The value must be greater than 0. + * @param callback Callback invoked when the event is triggered. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer - * @initial */ on(type: "periodReach", frame: number, callback: (position: number) => {}): void; /** - * Unsubscribes period reach event callback. + * Unsubscribes from period reached events. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer - * @initial */ off(type: "periodReach"): void; /** * Subscribes audio state change event callback. - * @param type Event type. - * @param callback Callback used to listen for the audio state change event - * @return AudioState + * @param callback Callback invoked when state change. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer - * @initial */ on(type: "stateChange", callback: Callback): void; } /** - * Enum for source type. + * Enumerates source types. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ @@ -1456,23 +1542,29 @@ declare namespace audio { * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ - SOURCE_TYPE_MIC + SOURCE_TYPE_MIC = 0, + /** + * Voice communication source type. + * @since 8 + * @syscap SystemCapability.Multimedia.Audio.Core + */ + SOURCE_TYPE_VOICE_COMMUNICATION = 7 } /** - * Interface for audio capturer info. + * Describes audio capturer information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ interface AudioCapturerInfo { /** - * Audio source type + * Audio source type. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ source: SourceType; /** - * Audio capturer flags + * Audio capturer flags. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ @@ -1480,19 +1572,19 @@ declare namespace audio { } /** - * Interface for audio capturer options. + * Describes audio capturer configuration options. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ interface AudioCapturerOptions { /** - * Audio stream info. + * Stream information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ streamInfo: AudioStreamInfo; /** - * Audio capturer info. + * Capturer information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ @@ -1500,171 +1592,183 @@ declare namespace audio { } /** - * Provides functions for applications to manage audio capturing. + * Provides APIs for audio recording. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ interface AudioCapturer { /** - * Gets capture state. + * Defines the current capture state. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ readonly state: AudioState; /** - * Gets audio capturer info. - * @return AudioCapturerInfo value + * Obtains the capturer information provided while creating a capturer instance. This method uses an asynchronous + * callback to return the result. + * @param callback Callback used to return the capturer information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ getCapturerInfo(callback: AsyncCallback): void; /** - * Gets audio capturer info. - * @return AudioCapturerInfo value + * Obtains the capturer information provided while creating a capturer instance. This method uses a promise to + * return the result. + * @return Promise used to return the capturer information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ getCapturerInfo(): Promise; /** - * Gets audio stream info. - * @return AudioStreamInfo value + * Obtains the capturer stream information. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the stream information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ getStreamInfo(callback: AsyncCallback): void; /** - * Gets audio stream info. - * @return AudioStreamInfo value + * Obtains the capturer stream information. This method uses a promise to return the result. + * @return Promise used to return the stream information. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ getStreamInfo(): Promise; /** - * Starts audio capturing. This method uses an asynchronous callback to return the execution result. + * Starts capturing. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ start(callback: AsyncCallback): void; /** - * Starts audio capturing. This method uses a promise to return the execution result. + * Starts capturing. This method uses a promise to return the result. + * @return Promise used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ start(): Promise; /** - * Capture audio data. This method uses an asynchronous callback to return the execution result. + * Reads the buffer from the audio capturer. This method uses an asynchronous callback to return the result. + * @param size Number of bytes to read. + * @param isBlockingRead Whether the read operation should be blocked. + * @param callback Callback used to return the buffer. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ read(size: number, isBlockingRead: boolean, callback: AsyncCallback): void; /** - * Capture audio data. This method uses a promise to return the execution result. + * Reads the buffer from the audio capturer. This method uses a promise to return the result. + * @param size Number of bytes to read. + * @param isBlockingRead Whether the read operation should be blocked. + * @return Returns the buffer data read if the operation is successful; returns an error code otherwise. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ read(size: number, isBlockingRead: boolean): Promise; /** - * Obtains the current timestamp. This method uses an asynchronous callback to return the execution result. + * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses an + * asynchronous callback to return the result. + * @param callback Callback used to return the timestamp. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ getAudioTime(callback: AsyncCallback): void; /** - * Obtains the current timestamp. This method uses a promise to return the execution result. + * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses a + * promise to return the result. + * @return Promise used to return the timestamp. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ getAudioTime(): Promise; /** - * Stops audio capturing. This method uses an asynchronous callback to return the execution result. + * Stops capturing. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ stop(callback: AsyncCallback): void; /** - * Stops audio capturing. This method uses a promise to return the execution result. + * Stops capturing. This method uses a promise to return the result. + * @return Promise used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ stop(): Promise; /** - * Releases a capture resources. This method uses an asynchronous callback to return the execution result. + * Releases the capturer. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ release(callback: AsyncCallback): void; /** - * Releases a capture resources. This method uses a promise to return the execution result. + * Releases the capturer. This method uses a promise to return the result. + * @return Promise used to return the result. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ release(): Promise; /** - * Obtains a reasonable minimum buffer size for capturer, however, the capturer can - * accept other read sizes as well. This method uses an asynchronous callback to return the execution result. + * Obtains a reasonable minimum buffer size in bytes for capturing. This method uses an asynchronous callback to + * return the result. + * @param callback Callback used to return the buffer size. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ getBufferSize(callback: AsyncCallback): void; /** - * Obtains a reasonable minimum buffer size for capturer, however, the capturer can - * accept other read sizes as well. This method uses a promise to return the execution result. + * Obtains a reasonable minimum buffer size in bytes for capturing. This method uses a promise to return the result. + * @return Promise used to return the buffer size. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer */ getBufferSize(): Promise; /** - * Subscribes mark reach event callback. - * @param type Event type. - * @param frame Mark reach frame count. - * @return Mark reach event callback. + * Subscribes to mark reached events. When the number of frames captured reaches the value of the frame parameter, + * the callback is invoked. + * @param frame Number of frames to trigger the event. The value must be greater than 0. + * @param callback Callback invoked when the event is triggered. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer - * @initial */ on(type: "markReach", frame: number, callback: (position: number) => {}): void; /** - * Unsubscribes mark reach event callback. + * Unsubscribes from the mark reached events. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer - * @initial */ off(type: "markReach"): void; /** - * Subscribes period reach event callback. - * @param type Event type. - * @param frame Period reach frame count. - * @return Period reach event callback. + * Subscribes to period reached events. When the period of frame capturing reaches the value of frame parameter, + * the callback is invoked. + * @param frame Period during which frame capturing is listened. The value must be greater than 0. + * @param callback Callback invoked when the event is triggered. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer - * @initial */ on(type: "periodReach", frame: number, callback: (position: number) => {}): void; /** - * Unsubscribes period reach event callback. + * Unsubscribes from period reached events. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer - * @initial */ off(type: "periodReach"): void; /** * Subscribes audio state change event callback. - * @param type Event type. - * @param callback Callback used to listen for the audio state change event - * @return AudioState + * @param callback Callback used to listen for the audio state change event. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer - * @initial */ on(type: "stateChange", callback: Callback): void; } diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts deleted file mode 100644 index 001206f1315d16ad23193752b9de4b00418a1a71..0000000000000000000000000000000000000000 --- a/api/@ohos.multimedia.camera.d.ts +++ /dev/null @@ -1,1079 +0,0 @@ -/* - * Copyright (C) 2022 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 {ErrorCallback, AsyncCallback} from './basic'; -import Context from './@ohos.ability'; - -/** - * @name camera - * @syscap SystemCapability.Multimedia.Camera.Core - * @import import camera from '@ohos.multimedia.camera'; - * @since 8 - * @systemapi - */ -declare namespace camera { - - /** - * Creates a CameraManager instance. - * @param context Current application context. - * @return CameraManager instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - function getCameraManager(context: Context, callback: AsyncCallback): void; - function getCameraManager(context: Context): Promise; - - /** - * Enum for camera status. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum CameraStatus { - /** - * Appear status. - * @since 8 - */ - CAMERA_STATUS_APPEAR = 0, - /** - * Disappear status. - * @since 8 - */ - CAMERA_STATUS_DISAPPEAR, - /** - * Available status. - * @since 8 - */ - CAMERA_STATUS_AVAILABLE, - /** - * Unavailable status. - * @since 8 - */ - CAMERA_STATUS_UNAVAILABLE - } - - /** - * Camera manager object. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CameraManager { - /** - * Gets all camera descriptions. - * @return All camera descriptions. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getCameras(callback: AsyncCallback>): void; - getCameras(): Promise>; - - /** - * Creates a CameraInput instance by camera id. - * @param cameraId Target camera id. - * @return CameraInput instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createCameraInput(cameraId: string, callback: AsyncCallback): void; - createCameraInput(cameraId: string): Promise; - - /** - * Creates a CameraInput instance by camera position and type. - * @param position Target camera position. - * @param type Target camera type. - * @return CameraInput instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void; - createCameraInput(position: CameraPosition, type: CameraType): Promise; - - /** - * Subscribes camera status change event callback. - * @param type Event type. - * @return CameraStatusInfo event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - on(type: "cameraStatus", callback: AsyncCallback): void; - } - - /** - * Camera status info. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CameraStatusInfo { - /** - * Camera instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - camera: Camera; - /** - * Current camera status. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - status: CameraStatus; - } - - /** - * Enum for camera position. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum CameraPosition { - /** - * Unspecified position. - * @since 8 - */ - CAMERA_POSITION_UNSPECIFIED = 0, - /** - * Back position. - * @since 8 - */ - CAMERA_POSITION_BACK, - /** - * Front position. - * @since 8 - */ - CAMERA_POSITION_FRONT - } - - /** - * Enum for camera type. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum CameraType { - /** - * Unspecified camera type - * @since 8 - */ - CAMERA_TYPE_UNSPECIFIED = 0, - - /** - * Wide camera - * @since 8 - */ - CAMERA_TYPE_WIDE_ANGLE, - - /** - * Ultra wide camera - * @since 8 - */ - CAMERA_TYPE_ULTRA_WIDE, - - /** - * Telephoto camera - * @since 8 - */ - CAMERA_TYPE_TELEPHOTO, - - /** - * True depth camera - * @since 8 - */ - CAMERA_TYPE_TRUE_DEPTH - } - - /** - * Enum for camera connection type. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum ConnectionType { - /** - * Built-in camera. - * @since 8 - */ - CAMERA_CONNECTION_BUILT_IN = 0, - - /** - * Camera connected using USB - * @since 8 - */ - CAMERA_CONNECTION_USB_PLUGIN, - - /** - * Remote camera - * @since 8 - */ - CAMERA_CONNECTION_REMOTE - } - - /** - * Camera object. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface Camera { - /** - * Camera id attribute. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly cameraId: string; - /** - * Camera position attribute. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly cameraPosition: CameraPosition; - /** - * Camera type attribute. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly cameraType: CameraType; - /** - * Camera connection type attribute. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - readonly connectionType: ConnectionType; - } - - /** - * Size parameter. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface Size { - /** - * Height. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - height: number; - /** - * Width. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - width: number; - } - - /** - * Enum for camera data format. Align to pixel format and image format value. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum CameraFormat { - /** - * YCRCb 420 SP format. - * @since 8 - */ - CAMERA_FORMAT_YCRCb_420_SP = 1003, - - /** - * JPEG format. - * @since 8 - */ - CAMERA_FORMAT_JPEG = 2000, - } - - /** - * Camera input object. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CameraInput { - /** - * Gets camera id. - * @return Camera id. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getCameraId(callback: AsyncCallback): void; - getCameraId(): Promise; - - /** - * Gets all supported sizes for current camera input. - * @return Supported size array. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getSupportedSizes(format: CameraFormat, callback: AsyncCallback>): void; - getSupportedSizes(format: CameraFormat): Promise>; - - /** - * Gets all supported formats for current camera input. - * @return Supported format array. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getSupportedPreviewFormats(callback: AsyncCallback>): void; - getSupportedPreviewFormats(): Promise>; - getSupportedPhotoFormats(callback: AsyncCallback>): void; - getSupportedPhotoFormats(): Promise>; - getSupportedVideoFormats(callback: AsyncCallback>): void; - getSupportedVideoFormats(): Promise>; - - /** - * Check if device has flash light. - * @return Flash light has or not. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - hasFlash(callback: AsyncCallback): void; - hasFlash(): Promise; - - /** - * Gets all supported flash modes for current camera input. - * @return Supported flash mode array. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void; - isFlashModeSupported(flashMode: FlashMode): Promise; - - /** - * Gets current flash mode. - * @return Current flash mode. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFlashMode(callback: AsyncCallback): void; - getFlashMode(): Promise; - - /** - * Sets flash mode. - * @param flashMode Target flash mode. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void; - setFlashMode(flashMode: FlashMode): Promise; - - /** - * Gets all supported focus modes for current camera input. - * @return Supported focus mode array. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void; - isFocusModeSupported(afMode: FocusMode): Promise; - - /** - * Gets current focus mode. - * @return Current focus mode. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getFocusMode(callback: AsyncCallback): void; - getFocusMode(): Promise; - - /** - * Sets focus mode. - * @param afMode Target focus mode. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setFocusMode(afMode: FocusMode, callback: AsyncCallback): void; - setFocusMode(afMode: FocusMode): Promise; - - /** - * Gets all supported zoom ratio range. - * @param afMode Target focus mode. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getZoomRatioRange(callback: AsyncCallback>): void; - getZoomRatioRange(): Promise>; - - /** - * Gets zoom ratio. - * @return Current zoom ratio. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - getZoomRatio(callback: AsyncCallback): void; - getZoomRatio(): Promise; - - /** - * Sets zoom ratio. - * @param zoomRatio Target zoom ratio. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - setZoomRatio(zoomRatio: number, callback: AsyncCallback): void; - setZoomRatio(zoomRatio: number): Promise; - - /** - * Releases instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - release(callback: AsyncCallback): void; - release(): Promise; - - /** - * Subscribes focus status change event callback. - * @param type Event type. - * @return FocusState event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: "focusStateChange", callback: AsyncCallback): void; - - /** - * Subscribes error event callback. - * @param type Event type. - * @return Error event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - on(type: "error", callback: ErrorCallback): void; - } - - /** - * Enum for CameraInput error code. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum CameraInputErrorCode { - /** - * Unknown error. - * @since 8 - */ - ERROR_UNKNOWN = -1 - } - - /** - * Camera input error object. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CameraInputError extends Error { - code: CameraInputErrorCode; - } - - /** - * Enum for flash mode. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum FlashMode { - /** - * Close mode. - * @since 8 - */ - FLASH_MODE_CLOSE = 0, - /** - * Open mode. - * @since 8 - */ - FLASH_MODE_OPEN, - /** - * Auto mode. - * @since 8 - */ - FLASH_MODE_AUTO, - /** - * Always open mode. - * @since 8 - */ - FLASH_MODE_ALWAYS_OPEN - } - - /** - * Enum for focus mode. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum FocusMode { - /** - * Manual mode. - * @since 8 - */ - FOCUS_MODE_MANUAL = 0, - /** - * Continuous auto mode. - * @since 8 - */ - FOCUS_MODE_CONTINUOUS_AUTO, - /** - * Auto mode. - * @since 8 - */ - FOCUS_MODE_AUTO, - /** - * Locked mode. - * @since 8 - */ - FOCUS_MODE_LOCKED - } - - /** - * Enum for focus state. - * @since 8 - */ - enum FocusState { - /** - * Scan state. - * @since 8 - */ - FOCUS_STATE_SCAN = 0, - /** - * Focused state. - * @since 8 - */ - FOCUS_STATE_FOCUSED, - /** - * Unfocused state. - * @since 8 - */ - FOCUS_STATE_UNFOCUSED - } - - /** - * Gets a CaptureSession instance. - * @param context Current application context. - * @return CaptureSession instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - function createCaptureSession(context: Context, callback: AsyncCallback): void; - function createCaptureSession(context: Context): Promise; - - /** - * Capture session object. - * @since 8 - */ - interface CaptureSession { - /** - * Begin capture session config. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - beginConfig(callback: AsyncCallback): void; - beginConfig(): Promise; - - /** - * Commit capture session config. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - commitConfig(callback: AsyncCallback): void; - commitConfig(): Promise; - - /** - * Adds a camera input. - * @param cameraInput Target camera input to add. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - addInput(cameraInput: CameraInput, callback: AsyncCallback): void; - addInput(cameraInput: CameraInput): Promise; - - /** - * Adds a camera preview output. - * @param previewOutput Target camera preview output to add. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - addOutput(previewOutput: PreviewOutput, callback: AsyncCallback): void; - addOutput(previewOutput: PreviewOutput): Promise; - - /** - * Adds a camera photo output. - * @param photoOutput Target camera photo output to add. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - addOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void; - addOutput(photoOutput: PhotoOutput): Promise; - - /** - * Adds a camera video output. - * @param videoOutput Target camera video output to add. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - addOutput(videoOutput: VideoOutput, callback: AsyncCallback): void; - addOutput(videoOutput: VideoOutput): Promise; - - /** - * Removes a camera input. - * @param cameraInput Target camera input to remove. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - removeInput(cameraInput: CameraInput, callback: AsyncCallback): void; - removeInput(cameraInput: CameraInput): Promise; - - /** - * Removes a camera preview output. - * @param previewOutput Target camera preview output to remove. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - removeOutput(previewOutput: PreviewOutput, callback: AsyncCallback): void; - removeOutput(previewOutput: PreviewOutput): Promise; - - /** - * Removes a camera photo output. - * @param photoOutput Target camera photo output to remove. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void; - removeOutput(photoOutput: PhotoOutput): Promise; - - /** - * Removes a camera video output. - * @param videoOutput Target camera video output to remove. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - removeOutput(videoOutput: VideoOutput, callback: AsyncCallback): void; - removeOutput(videoOutput: VideoOutput): Promise; - - /** - * Starts capture session. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - start(callback: AsyncCallback): void; - start(): Promise; - - /** - * Stops capture session. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - stop(callback: AsyncCallback): void; - stop(): Promise; - - /** - * Release capture session instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - release(callback: AsyncCallback): void; - release(): Promise; - - /** - * Subscribes error event callback. - * @param type Event type. - * @return Error event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - on(type: "error", callback: ErrorCallback): void; - } - - /** - * Enum for CaptureSession error code. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - enum CaptureSessionErrorCode { - ERROR_UNKNOWN = -1 - } - - /** - * Capture session error object. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - interface CaptureSessionError extends Error { - code: CaptureSessionErrorCode; - } - - /** - * Creates a PreviewOutput instance. - * @param surfaceId Surface object id used in camera preview output. - * @return PreviewOutput instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - function createPreviewOutput(surfaceId: string, callback: AsyncCallback): void; - function createPreviewOutput(surfaceId: string): Promise; - - /** - * Preview output object. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface PreviewOutput { - /** - * Release output instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - release(callback: AsyncCallback): void; - release(): Promise; - - /** - * Subscribes frame start event callback. - * @param type Event type. - * @return Frame start event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: "frameStart", callback: AsyncCallback): void; - - /** - * Subscribes frame end event callback. - * @param type Event type. - * @return Frame end event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: "frameEnd", callback: AsyncCallback): void; - - /** - * Subscribes error event callback. - * @param type Event type. - * @return Error event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - on(type: "error", callback: ErrorCallback): void; - } - - /** - * Enum for preview output error code. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - enum PreviewOutputErrorCode { - ERROR_UNKNOWN = -1 - } - - /** - * Preview output error object. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - interface PreviewOutputError extends Error { - code: PreviewOutputErrorCode; - } - - /** - * Creates a PhotoOutput instance. - * @param surfaceId Surface object id used in camera photo output. - * @return PhotoOutput instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - function createPhotoOutput(surfaceId: string, callback: AsyncCallback): void; - function createPhotoOutput(surfaceId: string): Promise; - - /** - * Enumerates the image rotation angles. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum ImageRotation { - /** - * The capture image rotates 0 degrees. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - ROTATION_0 = 0, - - /** - * The capture image rotates 90 degrees. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - ROTATION_90 = 90, - - /** - * The capture image rotates 180 degrees. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - ROTATION_180 = 180, - - /** - * The capture image rotates 270 degrees. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - ROTATION_270 = 270 - } - - /** - * Enumerates the image quality levels. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum QualityLevel { - /** - * High image quality. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - QUALITY_LEVEL_HIGH = 0, - - /** - * Medium image quality. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - QUALITY_LEVEL_MEDIUM, - - /** - * Low image quality. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - QUALITY_LEVEL_LOW - } - - /** - * Photo capture options to set. - * @since 8 - */ - interface PhotoCaptureSetting { - /** - * Photo image quality. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - quality?: QualityLevel; - /** - * Photo rotation. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - rotation?: ImageRotation; - } - - /** - * Photo output object. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface PhotoOutput { - /** - * Start capture output. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - capture(callback: AsyncCallback): void; - capture(setting: PhotoCaptureSetting, callback: AsyncCallback): void; - capture(setting?: PhotoCaptureSetting): Promise; - - /** - * Release output instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - release(callback: AsyncCallback): void; - release(): Promise; - - /** - * Subscribes capture start event callback. - * @param type Event type. - * @return Capture start event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: "captureStart", callback: AsyncCallback): void; - - /** - * Subscribes frame shutter event callback. - * @param type Event type. - * @return Frame shutter event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - on(type: "frameShutter", callback: AsyncCallback): void; - - /** - * Subscribes capture end event callback. - * @param type Event type. - * @return Capture end event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: "captureEnd", callback: AsyncCallback): void; - - /** - * Subscribes error event callback. - * @param type Event type. - * @return Error event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - on(type: "error", callback: ErrorCallback): void; - } - - /** - * Frame shutter callback info. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface FrameShutterInfo { - /** - * Capture id. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - captureId: number; - /** - * Timestamp for frame. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - timestamp: number; - } - - /** - * Capture end info. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CaptureEndInfo { - /** - * Capture id. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - captureId: number; - /** - * Frame count. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - frameCount: number; - } - - /** - * Enum for photo output error code. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - enum PhotoOutputErrorCode { - ERROR_UNKNOWN = -1 - } - - /** - * Photo output error object. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - interface PhotoOutputError extends Error { - code: PhotoOutputErrorCode; - } - - /** - * Creates a VideoOutput instance. - * @param surfaceId Surface object id used in camera video output. - * @return VideoOutput instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - function createVideoOutput(surfaceId: string, callback: AsyncCallback): void; - function createVideoOutput(surfaceId: string): Promise; - - /** - * Video output object. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface VideoOutput { - /** - * Start video output. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - start(callback: AsyncCallback): void; - start(): Promise; - - /** - * Stop video output. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - stop(callback: AsyncCallback): void; - stop(): Promise; - - /** - * Release output instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - release(callback: AsyncCallback): void; - release(): Promise; - - /** - * Subscribes frame start event callback. - * @param type Event type. - * @return Frame start event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: "frameStart", callback: AsyncCallback): void; - - /** - * Subscribes frame end event callback. - * @param type Event type. - * @return Frame end event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - on(type: "frameEnd", callback: AsyncCallback): void; - - /** - * Subscribes error event callback. - * @param type Event type. - * @return Error event callback. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - on(type: "error", callback: ErrorCallback): void; - } - - /** - * Enum for video output error code. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - enum VideoOutputErrorCode { - ERROR_UNKNOWN = -1 - } - - /** - * Video output error object. - * @since 8 - * @syscap SystemCapability.Multimedia.Camera.Core - * @initial - */ - interface VideoOutputError extends Error { - code: VideoOutputErrorCode; - } -} - -export default camera; \ No newline at end of file diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index da3700eec7a52597c2696687190e670e9e4f6825..e2aac7409ccfff6391071c2be8d5b629a1333329 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -137,62 +137,6 @@ declare namespace image { GPS_LONGITUDE_REF = "GPSLongitudeRef" } - /** - * Enum for image formats. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - */ - enum ImageFormat { - /** - * YCBCR422 semi-planar format. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - */ - YCBCR_422_SP = 1000, - - /** - * JPEG encoding format. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - */ - JPEG = 2000 - } - - /** - * The componet type of image. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - */ - enum ComponentType { - /** - * Luma info. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - */ - YUV_Y = 1, - - /** - * Chrominance info. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - */ - YUV_U = 2, - - /** - * Chroma info. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - */ - YUV_V = 3, - - /** - * Jpeg type. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - */ - JPEG = 4, - } - /** * Describes region information. * @since 8 @@ -264,7 +208,7 @@ declare namespace image { interface ImageInfo { /** * Indicates image dimensions specified by a {@link Size} interface. - * @since 7 + * @since 6 * @syscap SystemCapability.Multimedia.Image.Core */ size: Size; @@ -370,41 +314,6 @@ declare namespace image { desiredPixelFormat?: PixelMapFormat; } - /** - * Describes image color components. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - */ - interface Component { - /** - * Component type. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - */ - readonly componentType: ComponentType; - - /** - * Row stride. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - */ - readonly rowStride: number; - - /** - * Pixel stride. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - */ - readonly pixelStride: number; - - /** - * Component buffer. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - */ - readonly byteBuffer: ArrayBuffer; - } - /** * Initialization options for pixelmap. * @since 8 @@ -473,19 +382,6 @@ declare namespace image { */ function createImagePacker(): ImagePacker; - /** - * Creates an ImageReceiver instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - * @param width The default width in pixels of the Images that this receiver will produce. - * @param height The default height in pixels of the Images that this receiver will produce. - * @param format The format of the Image that this receiver will produce. This must be one of the - * {@link ImageFormat} constants. Note that not all formats are supported, like ImageFormat.NV21. - * @param capacity The maximum number of images the user will want to access simultaneously. - * @return Returns the ImageReceiver instance if the operation is successful; returns null otherwise. - */ - function createImageReceiver(width: number, height: number, format: number, capacity: number): ImageReceiver; - /** * PixelMap instance. * @since 7 @@ -812,171 +708,6 @@ declare namespace image { */ readonly supportedFormats: Array; } - - /** - * Provides basic image operations, including obtaining image information, and reading and writing image data. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - */ - interface Image { - /** - * Sets or gets the image area to crop, default is size. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - */ - clipRect: Region; - - /** - * Image size. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - */ - readonly size: Size; - - /** - * Image format. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - */ - readonly format: number; - - /** - * Get component buffer from image and uses a callback to return the result. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - * @param componentType The componet type of image. - * @param callback Callback used to return the component buffer. - */ - getComponent(componentType: ComponentType, callback: AsyncCallback): void; - - /** - * Get component buffer from image and uses a promise to return the result. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - * @param componentType The componet type of image. - * @return A Promise instance used to return the component buffer. - */ - getComponent(componentType: ComponentType): Promise; - - /** - * Release current image to receive another and uses a callback to return the result. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - * @param callback Callback to return the operation result. - */ - release(callback: AsyncCallback): void; - - /** - * Release current image to receive another and uses a promise to return the result. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.Core - * @return A Promise instance used to return the operation result. - */ - release(): Promise; - } - - /** - * Image receiver object. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - */ - interface ImageReceiver { - /** - * Image size. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - */ - readonly size: Size; - - /** - * Image capacity. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - */ - readonly capacity: number; - - /** - * Image format. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - */ - readonly format: ImageFormat; - - /** - * get an id which indicates a surface and can be used to set to Camera or other component can receive a surface - * and uses a callback to return the result. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - * @param callback Callback used to return the surface id. - */ - getReceivingSurfaceId(callback: AsyncCallback): void; - - /** - * get an id which indicates a surface and can be used to set to Camera or other component can receive a surface - * and uses a promise to return the result. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - * @return A Promise instance used to return the surface id. - */ - getReceivingSurfaceId(): Promise; - - /** - * Get lasted image from receiver and uses a callback to return the result. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - * @param callback Callback used to return the latest image. - */ - readLatestImage(callback: AsyncCallback): void; - - /** - * Get lasted image from receiver and uses a promise to return the result. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - * @return A Promise instance used to return the latest image. - */ - readLatestImage(): Promise; - - /** - * Get next image from receiver and uses a callback to return the result. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - * @param callback Callback used to return the next image. - */ - readNextImage(callback: AsyncCallback): void; - - /** - * Get next image from receiver and uses a promise to return the result. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - * @return A Promise instance used to return the next image. - */ - readNextImage(): Promise; - - /** - * Subscribe callback when receiving an image - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - * @param type Callback used to return the next image. - * @param callback Callback used to return image. - */ - on(type: 'imageArrival', callback: AsyncCallback): void; - - /** - * Release image receiver instance and uses a callback to return the result. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - * @param callback Callback to return the operation result. - */ - release(callback: AsyncCallback): void; - - /** - * Release image receiver instance and uses a promise to return the result. - * @since 8 - * @syscap SystemCapability.Multimedia.Image.ImageReceiver - * @return A Promise instance used to return the operation result. - */ - release(): Promise; - } } export default image; \ No newline at end of file diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts old mode 100755 new mode 100644 index c33f70bef3721965f684172ae32d90933aa3329b..26f15626378821122bfd1c88a857418ed92b2737 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -56,23 +56,6 @@ declare namespace media { */ function createVideoPlayer() : Promise; - /** - * Creates an VideoRecorder instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @import import media from '@ohos.multimedia.media' - * @param callback Callback used to return AudioPlayer instance if the operation is successful; returns null otherwise. - */ - function createVideoRecorder(callback: AsyncCallback): void; - /** - * Creates an VideoRecorder instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @import import media from '@ohos.multimedia.media' - * @return A Promise instance used to return VideoRecorder instance if the operation is successful; returns null otherwise. - */ - function createVideoRecorder(): Promise; - /** * Enumerates ErrorCode types, return in BusinessError::code * @since 8 @@ -282,6 +265,7 @@ declare namespace media { * local:fd://XXX, file://XXX. network:http://xxx * @since 6 * @syscap SystemCapability.Multimedia.Media.AudioPlayer + * @permission ohos.permission.READ_MEDIA, ohos.permission.INTERNET */ src: string; @@ -349,12 +333,40 @@ declare namespace media { * @deprecated since 8 */ enum AudioEncoder { + /** + * Default audio encoding format, which is AMR-NB. + * @since 6 + * @syscap SystemCapability.Multimedia.Media.AudioRecorder + */ + DEFAULT = 0, + + /** + * Indicates the AMR-NB audio encoding format. + * @since 6 + * @syscap SystemCapability.Multimedia.Media.AudioRecorder + */ + AMR_NB = 1, + + /** + * Indicates the AMR-WB audio encoding format. + * @since 6 + * @syscap SystemCapability.Multimedia.Media.AudioRecorder + */ + AMR_WB = 2, + /** * Advanced Audio Coding Low Complexity (AAC-LC). * @since 6 * @syscap SystemCapability.Multimedia.Media.AudioRecorder */ AAC_LC = 3, + + /** + * High-Efficiency Advanced Audio Coding (HE-AAC). + * @since 6 + * @syscap SystemCapability.Multimedia.Media.AudioRecorder + */ + HE_AAC = 4 } /** @@ -365,6 +377,13 @@ declare namespace media { * @deprecated since 8 */ enum AudioOutputFormat { + /** + * Default audio output format, which is Moving Pictures Expert Group 4 (MPEG-4). + * @since 6 + * @syscap SystemCapability.Multimedia.Media.AudioRecorder + */ + DEFAULT = 0, + /** * Indicates the Moving Picture Experts Group-4 (MPEG4) media format. * @since 6 @@ -372,6 +391,20 @@ declare namespace media { */ MPEG_4 = 2, + /** + * Indicates the Adaptive Multi-Rate Narrowband (AMR-NB) media format. + * @since 6 + * @syscap SystemCapability.Multimedia.Media.AudioRecorder + */ + AMR_NB = 3, + + /** + * Indicates the Adaptive Multi-Rate Wideband (AMR-WB) media format. + * @since 6 + * @syscap SystemCapability.Multimedia.Media.AudioRecorder + */ + AMR_WB = 4, + /** * Audio Data Transport Stream (ADTS), a transmission stream format of Advanced Audio Coding (AAC) audio. * @since 6 @@ -489,6 +522,7 @@ declare namespace media { * @since 6 * @syscap SystemCapability.Multimedia.Media.AudioRecorder * @param config Recording parameters. + * @permission ohos.permission.MICROPHONE */ prepare(config: AudioRecorderConfig): void; @@ -555,155 +589,6 @@ declare namespace media { on(type: 'error', callback: ErrorCallback): void; } - /** - * Describes video recorder states. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - type VideoRecordState = 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error'; - - /** - * Manages and record video. Before calling an VideoRecorder method, you must use createVideoRecorder() - * to create an VideoRecorder instance. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - interface VideoRecorder { - /** - * Prepares for recording. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @param config Recording parameters. - * @param callback A callback instance used to return when prepare completed. - */ - prepare(config: VideoRecorderConfig, callback: AsyncCallback): void; - /** - * Prepares for recording. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @param config Recording parameters. - * @return A Promise instance used to return when prepare completed. - */ - prepare(config: VideoRecorderConfig): Promise; - /** - * get input surface.it must be called between prepare completed and start. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @param callback Callback used to return the input surface id in string. - */ - getInputSurface(callback: AsyncCallback): void; - /** - * get input surface. it must be called between prepare completed and start. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @return A Promise instance used to return the input surface id in string. - */ - getInputSurface(): Promise; - /** - * Starts video recording. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @param callback A callback instance used to return when start completed. - */ - start(callback: AsyncCallback): void; - /** - * Starts video recording. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @return A Promise instance used to return when start completed. - */ - start(): Promise; - /** - * Pauses video recording. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @param callback A callback instance used to return when pause completed. - */ - pause(callback: AsyncCallback): void; - /** - * Pauses video recording. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @return A Promise instance used to return when pause completed. - */ - pause(): Promise; - /** - * Resumes video recording. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @param callback A callback instance used to return when resume completed. - */ - resume(callback: AsyncCallback): void; - /** - * Resumes video recording. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @return A Promise instance used to return when resume completed. - */ - resume(): Promise; - /** - * Stops video recording. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @param callback A callback instance used to return when stop completed. - */ - stop(callback: AsyncCallback): void; - /** - * Stops video recording. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @return A Promise instance used to return when stop completed. - */ - stop(): Promise; - /** - * Releases resources used for video recording. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @param callback A callback instance used to return when release completed. - */ - release(callback: AsyncCallback): void; - /** - * Releases resources used for video recording. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @return A Promise instance used to return when release completed. - */ - release(): Promise; - /** - * Resets video recording. - * Before resetting video recording, you must call stop() to stop recording. After video recording is reset, - * you must call prepare() to set the recording configurations for another recording. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @param callback A callback instance used to return when reset completed. - */ - reset(callback: AsyncCallback): void; - /** - * Resets video recording. - * Before resetting video recording, you must call stop() to stop recording. After video recording is reset, - * you must call prepare() to set the recording configurations for another recording. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @return A Promise instance used to return when reset completed. - */ - reset(): Promise; - /** - * Listens for video recording error events. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @param type Type of the video recording error event to listen for. - * @param callback Callback used to listen for the video recording error event. - */ - on(type: 'error', callback: ErrorCallback): void; - - /** - * video recorder state. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - readonly state: VideoRecordState; - } - /** * Describes video playback states. * @since 8 @@ -778,6 +663,7 @@ declare namespace media { * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer * @param callback A callback instance used to return when prepare completed. + * @permission ohos.permission.MICROPHONE */ prepare(callback: AsyncCallback): void; /** @@ -785,6 +671,7 @@ declare namespace media { * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer * @return A Promise instance used to return when prepare completed. + * @permission ohos.permission.MICROPHONE */ prepare(): Promise; /** @@ -1154,173 +1041,6 @@ declare namespace media { MD_KEY_AUD_SAMPLE_RATE = "sample_rate", } - /** - * Provides the video recorder profile definitions. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - interface VideoRecorderProfile { - /** - * Indicates the audio bit rate. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - readonly audioBitrate: number; - - /** - * Indicates the number of audio channels. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - readonly audioChannels: number; - - /** - * Indicates the audio encoding format. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - readonly audioCodec: CodecMimeType; - - /** - * Indicates the audio sampling rate. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - readonly audioSampleRate: number; - - /** - * Indicates the output file format. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - readonly fileFormat: ContainerFormatType; - - /** - * Indicates the video bit rate. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - readonly videoBitrate: number; - - /** - * Indicates the video encoding format. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - readonly videoCodec: CodecMimeType; - - /** - * Indicates the video width. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - readonly videoFrameWidth: number; - - /** - * Indicates the video height. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - readonly videoFrameHeight: number; - - /** - * Indicates the video frame rate. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - readonly videoFrameRate: number; - } - - /** - * Enumerates audio source type for recorder. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @import import media from '@ohos.multimedia.media' - */ - enum AudioSourceType { - /** - * default audio source type. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - AUDIO_SOURCE_TYPE_DEFAULT = 0, - /** - * source type mic. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - AUDIO_SOURCE_TYPE_MIC = 1, - } - - /** - * Enumerates video source type for recorder. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @import import media from '@ohos.multimedia.media' - */ - enum VideoSourceType { - /** - * surface raw data. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - VIDEO_SOURCE_TYPE_SURFACE_YUV = 0, - /** - * surface ES data. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - VIDEO_SOURCE_TYPE_SURFACE_ES = 1, - } - - /** - * Provides the video recorder configuration definitions. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - interface VideoRecorderConfig { - /** - * audio source type, details see @AudioSourceType . - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - audioSourceType: AudioSourceType; - /** - * video source type, details see @VideoSourceType . - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - videoSourceType: VideoSourceType; - /** - * video recorder profile, can get by "getVideoRecorderProfile", details see @VideoRecorderProfile . - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - profile:VideoRecorderProfile; - /** - * video output uri.support two kind of uri now. - * format like: scheme + "://" + "context". - * file: file://path - * fd: fd://fd - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - url: string; - /** - * Sets the video rotation angle in output file, and for the file to playback. mp4 support. - * the range of rotation angle should be {0, 90, 180, 270}, default is 0. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - rotation?: number; - /** - * geographical location information. - * @since 8 - * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ - location?: Location; - } - /** * Provides the container definition for media description key-value pairs. * @since 8 diff --git a/api/@ohos.multimedia.mediaLibrary.d.ts b/api/@ohos.multimedia.mediaLibrary.d.ts index 32b8fd0b1add3e489963b3b240982c1344889f00..05dfaaf88ee11dfda500b9dfa9c2e716fc354f2a 100644 --- a/api/@ohos.multimedia.mediaLibrary.d.ts +++ b/api/@ohos.multimedia.mediaLibrary.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; -import Context from './@ohos.ability'; +import { AsyncCallback, Callback } from './basic'; +import Context from './application/Context'; import image from './@ohos.multimedia.image'; /** @@ -38,7 +38,7 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @StageModelOnly - * @param Hap context information + * @param context hap context information * @return Instance of MediaLibrary */ function getMediaLibrary(context: Context): MediaLibrary; @@ -125,26 +125,26 @@ declare namespace mediaLibrary { /** * Provides methods to encapsulate file attributes. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @import import mediaLibrary from '@ohos.multimedia.mediaLibrary' */ interface FileAsset { /** * File ID. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ readonly id: number; /** * URI of the file. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ readonly uri: string; /** * MIME type, for example, video/mp4, audio/mp4, or audio/amr-wb. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ readonly mimeType: string; @@ -156,13 +156,13 @@ declare namespace mediaLibrary { readonly mediaType: MediaType; /** * Display name (with a file name extension) of the file. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ displayName: string; /** * File name title (without the file name extension). - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ title: string; @@ -180,25 +180,25 @@ declare namespace mediaLibrary { readonly parent: number; /** * Data size of the file. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ readonly size: number; /** * Date (timestamp) when the file was added. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ readonly dateAdded: number; /** * Date (timestamp) when the file was modified. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ readonly dateModified: number; /** * Date (timestamp) when the file was taken. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ readonly dateTaken: number; @@ -216,20 +216,20 @@ declare namespace mediaLibrary { readonly audioAlbum: string; /** * Display width of the file. This is valid only for videos and images. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ readonly width: number; /** * Display height of the file. This is valid only for videos and images. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ readonly height: number; /** * Rotation angle of the file, in degrees. * The rotation angle can be 0, 90, 180, or 270 degrees. This is valid only for videos. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ orientation: number; @@ -241,7 +241,7 @@ declare namespace mediaLibrary { readonly duration: number; /** * ID of the album where the file is located. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ readonly albumId: number; @@ -253,7 +253,7 @@ declare namespace mediaLibrary { readonly albumUri: string; /** * Name of the album where the file is located. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ readonly albumName: string; @@ -262,62 +262,71 @@ declare namespace mediaLibrary { * If it is a directory where the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param callback, Callback return the result of isDerectory. + * @permission ohos.permission.READ_MEDIA + * @param callback Callback return the result of isDerectory. */ isDirectory(callback: AsyncCallback): void; /** * If it is a directory where the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA */ isDirectory():Promise; /** * Modify meta data where the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param callback, no value will be returned. + * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA + * @param callback no value will be returned. */ commitModify(callback: AsyncCallback): void; /** * Modify meta data where the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA */ commitModify(): Promise; /** * Open the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param mode, mode for open, for example: rw, r, w. - * @param callback, Callback return the fd of the file. + * @permission ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA + * @param mode mode for open, for example: rw, r, w. + * @param callback Callback return the fd of the file. */ open(mode: string, callback: AsyncCallback): void; /** * Open the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param mode, mode for open, for example: rw, r, w. + * @permission ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA + * @param mode mode for open, for example: rw, r, w. */ open(mode: string): Promise; /** * Close the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param fd, fd of the file which had been opened - * @param callback, no value will be returned. + * @permission ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA + * @param fd fd of the file which had been opened + * @param callback no value will be returned. */ close(fd: number, callback: AsyncCallback): void; /** * Close the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param fd, fd of the file which had been opened + * @permission ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA + * @param fd fd of the file which had been opened */ close(fd: number): Promise; /** * Get thumbnail of the file when the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA * @param callback Callback used to return the thumbnail's pixelmap. */ getThumbnail(callback: AsyncCallback): void; @@ -325,7 +334,8 @@ declare namespace mediaLibrary { * Get thumbnail of the file when the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param size, thumbnail's size + * @permission ohos.permission.READ_MEDIA + * @param size thumbnail's size * @param callback Callback used to return the thumbnail's pixelmap. */ getThumbnail(size: Size, callback: AsyncCallback): void; @@ -333,13 +343,15 @@ declare namespace mediaLibrary { * Get thumbnail of the file when the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param size, thumbnail's size + * @permission ohos.permission.READ_MEDIA + * @param size thumbnail's size */ getThumbnail(size?: Size): Promise; /** * Set favorite for the file when the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA * @param isFavorite ture is favorite file, false is not favorite file * @param callback Callback used to return, No value is returned. */ @@ -348,6 +360,7 @@ declare namespace mediaLibrary { * Set favorite for the file when the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA * @param isFavorite ture is favorite file, false is not favorite file */ favorite(isFavorite: boolean): Promise; @@ -355,6 +368,7 @@ declare namespace mediaLibrary { * If the file is favorite when the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA * @param callback Callback used to return true or false. */ isFavorite(callback: AsyncCallback): void; @@ -362,27 +376,31 @@ declare namespace mediaLibrary { * If the file is favorite when the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA */ isFavorite():Promise; /** * Set trash for the file when the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA * @param isTrash true is trashed file, false is not trashed file - * @param callback Callback used to return, No value is returned. + * @param callback Callback used to return, No value is returned. */ trash(isTrash: boolean, callback: AsyncCallback): void; /** * Set trash for the file when the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA * @param isTrash true is trashed file, false is not trashed file */ - trash(isTrash: boolean,): Promise; + trash(isTrash: boolean): Promise; /** * If the file is in trash when the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA * @param callback Callback used to return true or false. */ isTrash(callback: AsyncCallback): void; @@ -390,6 +408,7 @@ declare namespace mediaLibrary { * If the file is in trash when the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA */ isTrash():Promise; } @@ -518,25 +537,25 @@ declare namespace mediaLibrary { /** * Fetch parameters applicable on images, videos, audios, albums and other media - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ interface MediaFetchOptions { /** * Fields to retrieve, for example, selections: "media_type =? OR media_type =?". - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ selections: string; /** * Conditions for retrieval, for example, selectionArgs: [IMAGE, VIDEO]. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ selectionArgs: Array; /** - * Sorting criterion of the retrieval results, for example, order: "datetaken DESC,_display_name DESC, _id DESC". - * @since 8 + * Sorting criterion of the retrieval results, for example, order: "datetaken DESC,display_name DESC, file_id DESC". + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ order?: string; @@ -562,21 +581,21 @@ declare namespace mediaLibrary { /** * Implements file retrieval. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @import import mediaLibrary from '@ohos.multimedia.mediaLibrary' */ interface FetchFileResult { /** * Obtains the total number of files in the file retrieval result. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @return Total number of files. */ getCount(): number; /** * Checks whether the result set points to the last row. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @return Whether the file is the last one. * You need to check whether the file is the last one before calling getNextObject, @@ -585,20 +604,20 @@ declare namespace mediaLibrary { isAfterLast(): boolean; /** * Releases the FetchFileResult instance and invalidates it. Other methods cannot be called. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ close(): void; /** * Obtains the first FileAsset in the file retrieval result. This method uses a callback to return the file. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param callback Callback used to return the file in the format of a FileAsset instance. */ getFirstObject(callback: AsyncCallback): void; /** * Obtains the first FileAsset in the file retrieval result. This method uses a promise to return the file. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @return A Promise instance used to return the file in the format of a FileAsset instance. */ @@ -608,7 +627,7 @@ declare namespace mediaLibrary { * This method uses a callback to return the file. * Before calling this method, you must use isAfterLast() to check whether the result set points to the last row. * This method returns the next file only when True is returned for isAfterLast(). - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param callback Callback used to return the file in the format of a FileAsset instance. */ @@ -618,21 +637,21 @@ declare namespace mediaLibrary { * This method uses a promise to return the file. * Before calling this method, you must use isAfterLast() to check whether the result set points to the last row. * This method returns the next file only when True is returned for isAfterLast(). - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @return A Promise instance used to return the file in the format of a FileAsset instance. */ getNextObject(): Promise; /** * Obtains the last FileAsset in the file retrieval result. This method uses a callback to return the file. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param callback Callback used to return the file in the format of a FileAsset instance. */ getLastObject(callback: AsyncCallback): void; /** * Obtains the last FileAsset in the file retrieval result. This method uses a promise to return the file. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @return A Promise instance used to return the file in the format of a FileAsset instance. */ @@ -640,7 +659,7 @@ declare namespace mediaLibrary { /** * Obtains the FileAsset with the specified index in the file retrieval result. * This method uses a callback to return the file. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param index Index of the file to obtain. * @param callback Callback used to return the file in the format of a FileAsset instance. @@ -649,7 +668,7 @@ declare namespace mediaLibrary { /** * Obtains the FileAsset with the specified index in the file retrieval result. * This method uses a promise to return the file. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param index Index of the file to obtain. * @return A Promise instance used to return the file in the format of a FileAsset instance. @@ -660,7 +679,7 @@ declare namespace mediaLibrary { * This method uses a callback to return the result. After this method is called, * close() is automatically called to release the FetchFileResult instance and invalidate it. * In this case, other methods cannot be called. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param callback Callback used to return a FileAsset array. */ @@ -670,7 +689,7 @@ declare namespace mediaLibrary { * This method uses a promise to return the result. that store the selected media resources. * close() is automatically called to release the FetchFileResult instance and invalidate it. * In this case, other methods cannot be called. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @return A Promise instance used to return a FileAsset array. */ @@ -681,18 +700,18 @@ declare namespace mediaLibrary { * Defines the album. * * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @since 8 + * @since 7 */ interface Album { /** * Album ID. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ readonly albumId: number; /** * Album name. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ albumName: string; @@ -704,7 +723,7 @@ declare namespace mediaLibrary { readonly albumUri: string; /** * Date (timestamp) when the album was last modified. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ readonly dateModified: number; @@ -731,6 +750,7 @@ declare namespace mediaLibrary { * Modify the meta data for the album * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA * @param callback, no value will be returned. */ commitModify(callback: AsyncCallback): void; @@ -738,27 +758,31 @@ declare namespace mediaLibrary { * Modify the meta data for the album * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA */ commitModify(): Promise; /** * SObtains files in an album. This method uses an asynchronous callback to return the files. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA * @param callback Callback used to return the files in the format of a FetchFileResult instance. */ getFileAssets(callback: AsyncCallback): void; /** * SObtains files in an album. This method uses an asynchronous callback to return the files. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA * @param option Media retrieval options. * @param callback Callback used to return the files in the format of a FetchFileResult instance. */ getFileAssets(options: MediaFetchOptions, callback: AsyncCallback): void; /** * Obtains files in an album. This method uses a promise to return the files. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA * @param option Media retrieval options. * @return A Promise instance used to return the files in the format of a FetchFileResult instance. */ @@ -821,22 +845,23 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param type, public directory predefined in DirectoryType. - * @param callback, Callback return the FetchFileResult. + * @param callback Callback return the FetchFileResult. */ getPublicDirectory(type: DirectoryType, callback: AsyncCallback): void; /** * get system predefined root dir, use to create file asset by relative path * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param type, public directory predefined in DirectoryType. - * @param return A promise instance used to return the public directory in the format of string + * @param type public directory predefined in DirectoryType. + * @return A promise instance used to return the public directory in the format of string */ getPublicDirectory(type: DirectoryType): Promise; /** * query all assets just for count & first cover * if need all data, getAllObject from FetchFileResult - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA * @param options, Media retrieval options. * @param callback, Callback return the FetchFileResult. */ @@ -844,35 +869,37 @@ declare namespace mediaLibrary { /** * query all assets just for count & first cover * if need all data, getAllObject from FetchFileResult - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param options, Media retrieval options. + * @permission ohos.permission.READ_MEDIA + * @param options Media retrieval options. * @return A promise instance used to return the files in the format of a FetchFileResult instance */ getFileAssets(options: MediaFetchOptions): Promise; /** - * Trun on mornitor the data changes by media type + * Turn on mornitor the data changes by media type * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param type, mediaType + * @param type one of 'deviceChange','albumChange','imageChange','audioChange','videoChange','fileChange','remoteFileChange' * @param callback no value returned */ - on(type: 'Device'|'Album'|'Image'|'Audio'|'Video'|'File'| 'Remote file', callback: () => {}): void; + on(type: 'deviceChange'|'albumChange'|'imageChange'|'audioChange'|'videoChange'|'fileChange'|'remoteFileChange', callback: Callback): void; /** - * Trun off Mornitor the data changes by media type + * Turn off mornitor the data changes by media type * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param type, mediaType + * @param type one of 'deviceChange','albumChange','imageChange','audioChange','videoChange','fileChange','remoteFileChange' * @param callback no value returned */ - off(type: 'Device'|'Album'|'Image'|'Audio'|'Video'|'File'| 'Remote file', callback?: () => {}): void; + off(type: 'deviceChange'|'albumChange'|'imageChange'|'audioChange'|'videoChange'|'fileChange'|'remoteFileChange', callback?: Callback): void; /** * Create File Asset * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param mediaType, mediaType for example:IMAGE, VIDEO, AUDIO, FILE - * @param displayName, file name - * @param relativePath, relative path + * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA + * @param mediaType mediaType for example:IMAGE, VIDEO, AUDIO, FILE + * @param displayName file name + * @param relativePath relative path * @param callback Callback used to return the FileAsset */ createAsset(mediaType: MediaType, displayName: string, relativePath: string, callback: AsyncCallback): void; @@ -880,9 +907,10 @@ declare namespace mediaLibrary { * Create File Asset * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param mediaType, mediaType for example:IMAGE, VIDEO, AUDIO, FILE - * @param displayName, file name - * @param relativePath, relative path + * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA + * @param mediaType mediaType for example:IMAGE, VIDEO, AUDIO, FILE + * @param displayName file name + * @param relativePath relative path * @return A Promise instance used to return the FileAsset */ createAsset(mediaType: MediaType, displayName: string, relativePath: string): Promise; @@ -890,30 +918,36 @@ declare namespace mediaLibrary { * Delete File Asset * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param uri, FileAsset's URI + * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA + * @param uri FileAsset's URI * @param callback no value returned + * @systemapi */ deleteAsset(uri: string, callback: AsyncCallback): void; /** * Delete File Asset * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA * @param uri, FileAsset's URI * @return A Promise instance, no value returned + * @systemapi */ deleteAsset(uri: string): Promise; /** * Obtains albums based on the media retrieval options. This method uses an asynchronous callback to return. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA * @param option Media retrieval options. * @param callback Callback used to return an album array. */ getAlbums(options: MediaFetchOptions, callback: AsyncCallback>): void; /** * Obtains albums based on the media retrieval options. This method uses a promise to return the albums. - * @since 8 + * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core + * @permission ohos.permission.READ_MEDIA * @param option Media retrieval options. * @return A Promise instance used to return an album array. */ @@ -985,6 +1019,7 @@ declare namespace mediaLibrary { * Get Active Peer device information * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore + * @permission ohos.permission.READ_MEDIA * @systemapi * @param callback, Callback return the list of the active peer devices' information */ @@ -993,6 +1028,7 @@ declare namespace mediaLibrary { * Get Active Peer device information * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore + * @permission ohos.permission.READ_MEDIA * @systemapi * @return Promise used to return the list of the active peer devices' information */ @@ -1001,14 +1037,16 @@ declare namespace mediaLibrary { * Get all the peer devices' information * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore + * @permission ohos.permission.READ_MEDIA * @systemapi - * @param callback, Callback return the list of the all the peer devices' information + * @param callback Callback return the list of the all the peer devices' information */ getAllPeers(callback: AsyncCallback>): void; /** * Get all the peer devices' information * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore + * @permission ohos.permission.READ_MEDIA * @systemapi * @return Promise used to return the list of the all the peer devices' information */ @@ -1017,7 +1055,7 @@ declare namespace mediaLibrary { * Release MediaLibrary instance * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @param callback, no value returned + * @param callback no value returned */ release(callback: AsyncCallback): void; /** diff --git a/api/@ohos.multimodalInput.inputConsumer.d.ts b/api/@ohos.multimodalInput.inputConsumer.d.ts old mode 100755 new mode 100644 index 389f62a0139347e7ba83d2f08cc101962ecbab8f..973a4404e3223cd6e27c57f4daf67ba5dd11ac46 --- a/api/@ohos.multimodalInput.inputConsumer.d.ts +++ b/api/@ohos.multimodalInput.inputConsumer.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { Callback } from './basic'; /** * The event of key input management module is configured to subscribe and unsubscribe system keys. @@ -21,7 +21,7 @@ import { AsyncCallback } from './basic'; * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputConsumer * @import import inputConsumer from '@ohos.multimodalInput.inputConsumer'; - * @permission N/A + * @systemapi hide for inner use */ declare namespace inputConsumer { @@ -29,6 +29,7 @@ declare namespace inputConsumer { * Defines event of key that user want to subscribe or unsubscribe. * * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @systemapi hide for inner use * @param preKeys The pre-keys that want to subscribe or unsubscribe. * @param finalKey The post position key that want to subscribe or unsubscribe. * @param isFinalKeyDown The final key press down or up. @@ -46,24 +47,24 @@ declare namespace inputConsumer { * * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputConsumer - * @permission N/A - * @param type type of the keyevent about input which is to be subscribed. + * @systemapi hide for inner use + * @param type type of the inputevent about input which is to be subscribed. * @param keyOption the key events about input which is to be subscribed. * @param callback callback function, receive reported data. */ - function on(type: string, keyOption: KeyOptions, callback: AsyncCallback): void; + function on(type: "key", keyOptions: KeyOptions, callback: Callback): void; /** * Subscribe system keys. * * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputConsumer - * @permission N/A - * @param type type of the keyevent about input which is to be subscribed. + * @systemapi hide for inner use + * @param type type of the inputevent about input which is to be subscribed. * @param keyOption the key events about input which is to be subscribed. * @param callback callback function, receive reported data. */ - function off(type: string, keyOption: KeyOptions, callback: AsyncCallback): void; + function off(type: "key", keyOptions: KeyOptions, callback?: Callback): void; } export default inputConsumer; \ No newline at end of file diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts old mode 100755 new mode 100644 index 6b9100a8755475d9548bcd312860797708366012..8823d8574ef80dbe1081bb981aec62000879d8c2 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -21,7 +21,6 @@ import { AsyncCallback } from './basic'; * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @import import inputDevice from '@ohos.multimodalInput.inputDevice'; - * @permission N/A */ declare namespace inputDevice { @@ -66,7 +65,6 @@ declare namespace inputDevice { * * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @permission N/A * @param callback callback function, receive reported data */ function getDeviceIds(callback: AsyncCallback>): void; @@ -77,7 +75,6 @@ declare namespace inputDevice { * * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @permission N/A * @param deviceId ID of the input device whose information is to be obtained. * @param callback callback function, receive reported data */ diff --git a/api/@ohos.volumeManager.d.ts b/api/@ohos.multimodalInput.inputEventClient.d.ts similarity index 33% rename from api/@ohos.volumeManager.d.ts rename to api/@ohos.multimodalInput.inputEventClient.d.ts index 0aa1f212770084f558eb0e7db56542c78ded51af..d6c8a7c8c1e1f8faa1e1d145193270a9e7873459 100644 --- a/api/@ohos.volumeManager.d.ts +++ b/api/@ohos.multimodalInput.inputEventClient.d.ts @@ -4,7 +4,7 @@ * 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 +* 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, @@ -13,49 +13,42 @@ * limitations under the License. */ -import {AsyncCallback, Callback} from "./basic"; - -/** - * Provides volumemanager statistics APIs + /** + * Global Key Event Injection * * @since 8 - * @syscap SystemCapability.FileManagement.StorageService.Volume + * @syscap SystemCapability.MultimodalInput.Input.InputSimulator + * @import import inputEventClient from '@ohos.multimodalInput.inputEventClient'; + * @systemapi hide for inner use */ -declare namespace volumeManager { - -/** - * Get All Volumes - * - * @since 8 - */ - export interface Volume { - id: number; - uuid: string; - description: string; - removeAble: boolean; - state: number; - path: string; -} -function getAllVolumes(callback: AsyncCallback>): void; -function getAllVolumes(): Promise>; - - - /** - * Mount - * - * @since 8 - */ -function mount(volumeId: string, callback: AsyncCallback): void; -function mount(volumeId: string): Promise; - -/** - * UnMount - * - * @since 8 - */ -function unmount(volumeId: string, callback: AsyncCallback): void; -function unmount(volumeId: string): Promise; +declare namespace inputEventClient { + /** + * Defines event of key that user want to inject. + * + * @syscap SystemCapability.MultimodalInput.Input.InputSimulator + * @systemapi hide for inner use + * @param isPressed The status of key. + * @param keyCode The keyCode value of key. + * @param keyDownDuration Key hold duration. + * @param isIntercepted Whether the key is blocked. + */ + interface KeyEvent { + isPressed: boolean, + keyCode: number; + keyDownDuration: number; + isIntercepted: boolean; + } + + /** + * Inject system keys. + * + * @since 8 + * @syscap SystemCapability.MultimodalInput.Input.InputSimulator + * @systemapi hide for inner use + * @param KeyEvent the key event to be injected. + */ + function injectEvent({KeyEvent: KeyEvent}): void; } -export default volumeManager; +export default inputEventClient; diff --git a/api/@ohos.net.connection.d.ts b/api/@ohos.net.connection.d.ts index 3ff974a7558c559153b9f2c6c1ff02df4843297e..ad31470548326a71072f5f033a80691786475118 100644 --- a/api/@ohos.net.connection.d.ts +++ b/api/@ohos.net.connection.d.ts @@ -40,8 +40,6 @@ declare namespace connection { /** * Obtains the data network that is activated by default. * - *

To call this method, you must have the {@code ohos.permission.GET_NETWORK_INFO} permission. - * * @param callback Returns the {@link NetHandle} object; * returns {@code null} if the default network is not activated. * @permission ohos.permission.GET_NETWORK_INFO @@ -52,8 +50,6 @@ declare namespace connection { /** * Obtains the list of data networks that are activated. * - *

To invoke this method, you must have the {@code ohos.permission.GET_NETWORK_INFO} permission. - * * @param callback Returns the {@link NetHandle} object; returns {@code null} if no network is activated. * @permission ohos.permission.GET_NETWORK_INFO */ @@ -63,8 +59,6 @@ declare namespace connection { /** * Queries the connection properties of a network. * - *

This method requires the {@code ohos.permission.GET_NETWORK_INFO} permission. - * * @param netHandle Indicates the network to be queried. * @param callback Returns the {@link ConnectionProperties} object. * @permission ohos.permission.GET_NETWORK_INFO @@ -75,8 +69,6 @@ declare namespace connection { /** * Obtains {@link NetCapabilities} of a {@link NetHandle} object. * - *

To invoke this method, you must have the {@code ohos.permission.GET_NETWORK_INFO} permission. - * * @param netHandle Indicates the handle. See {@link NetHandle}. * @param callback Returns {@link NetCapabilities}; returns {@code null} if {@code handle} is invalid. * @permission ohos.permission.GET_NETWORK_INFO @@ -170,21 +162,12 @@ declare namespace connection { export interface NetHandle { netId: number; - /** - * Binds a TCPSocket or UDPSocket to the current network. All data flows from - * the socket will use this network, without being subject to {@link setAppNet}. - * Before using this method, ensure that the socket is disconnected. - * - * @param socketParam Indicates the TCPSocket or UDPSocket object. - */ - bindSocket(socketParam: TCPSocket | UDPSocket, callback: AsyncCallback): void; - bindSocket(socketParam: TCPSocket | UDPSocket): Promise; - /** * Resolves a host name to obtain all IP addresses based on the specified NetHandle. * * @param host Indicates the host name or the domain. * @param callback Returns the NetAddress list. + * @permission ohos.permission.GET_NETWORK_INFO */ getAddressesByName(host: string, callback: AsyncCallback>): void; getAddressesByName(host: string): Promise>; @@ -194,6 +177,7 @@ declare namespace connection { * * @param host Indicates the host name or the domain. * @return Returns the first NetAddress. + * @permission ohos.permission.GET_NETWORK_INFO */ getAddressByName(host: string, callback: AsyncCallback): void; getAddressByName(host: string): Promise; @@ -272,9 +256,6 @@ declare namespace connection { prefixLength: number; } - /** - * @since 7 - */ export interface NetAddress { address: string; family?: number; // IPv4 = 1; IPv6 = 2, default is IPv4 diff --git a/api/@ohos.net.http.d.ts b/api/@ohos.net.http.d.ts index 9d555afdde77c8873a33342ed88cf9752506fed7..b6ecab57c160bc35a91f068d04def36f56c23288 100644 --- a/api/@ohos.net.http.d.ts +++ b/api/@ohos.net.http.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 2021-2022 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 @@ -71,13 +71,38 @@ declare namespace http { /** * Registers an observer for HTTP Response Header events. + * + * @deprecated use on_headersReceive instead since 8. */ on(type: "headerReceive", callback: AsyncCallback): void; /** * Unregisters the observer for HTTP Response Header events. + * + * @deprecated use off_headersReceive instead since 8. */ off(type: "headerReceive", callback?: AsyncCallback): void; + + /** + * Registers an observer for HTTP Response Header events. + * + * @since 8 + */ + on(type: "headersReceive", callback: Callback): void; + + /** + * Unregisters the observer for HTTP Response Header events. + * + * @since 8 + */ + off(type: "headersReceive", callback?: Callback): void; + + /** + * Registers a one-time observer for HTTP Response Header events. + * + * @since 8 + */ + once(type: "headersReceive", callback: Callback): void; } export enum RequestMethod { @@ -131,7 +156,7 @@ declare namespace http { export interface HttpResponse { /** - * result can be a string or an Object (API 6) or an ArrayBuffer(API 8). + * result can be a string (API 6) or an ArrayBuffer(API 8). Object is deprecated from API 8. */ result: string | Object | ArrayBuffer; /** diff --git a/api/@ohos.net.socket.d.ts b/api/@ohos.net.socket.d.ts index ccabf9041a3e6fed0a43eb75f8b84bf296ec5dc8..fb88669e14f1127a0b3b1a7d1f2b7df8e3341610 100644 --- a/api/@ohos.net.socket.d.ts +++ b/api/@ohos.net.socket.d.ts @@ -1,17 +1,17 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (C) 2021-2022 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 {AsyncCallback, Callback, ErrorCallback} from "./basic"; import connection from "./@ohos.net.connection"; diff --git a/api/@ohos.net.statistics.d.ts b/api/@ohos.net.statistics.d.ts deleted file mode 100644 index 9f1446839dabd36a14b78a7e5fd01baea7dbc620..0000000000000000000000000000000000000000 --- a/api/@ohos.net.statistics.d.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (C) 2022 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 {AsyncCallback, Callback} from "./basic"; - -/** - * Obtains traffic statistics. - * - * @since 8 - * @syscap SystemCapability.Communication.NetManager.Core - */ -declare namespace statistics { - /** - * Queries the data traffic (including all TCP and UDP data packets) received through a specified NIC. - * - * @param nic Indicates the NIC name. - * @param callback Returns the data traffic received through the specified NIC. - */ - function getIfaceRxBytes(nic: string, callback: AsyncCallback): void; - function getIfaceRxBytes(nic: string): Promise; - - /** - * Queries the data traffic (including all TCP and UDP data packets) sent through a specified NIC. - * - * @param nic Indicates the NIC name. - * @param callback Returns the data traffic sent through the specified NIC. - */ - function getIfaceTxBytes(nic: string, callback: AsyncCallback): void; - function getIfaceTxBytes(nic: string): Promise; - - /** - * Queries the data traffic (including all TCP and UDP data packets) received through the cellular network. - * - * @param callback Returns the data traffic received through the cellular network. - */ - function getCellularRxBytes(callback: AsyncCallback): void; - function getCellularRxBytes(): Promise; - - /** - * Queries the data traffic (including all TCP and UDP data packets) sent through the cellular network. - * - * @param callback Returns the data traffic sent through the cellular network. - */ - function getCellularTxBytes(callback: AsyncCallback): void; - function getCellularTxBytes(): Promise; - - /** - * Queries the data traffic (including all TCP and UDP data packets) sent through all NICs. - * - * @param callback Returns the data traffic sent through all NICs. - */ - function getAllTxBytes(callback: AsyncCallback): void; - function getAllTxBytes(): Promise; - - /** - * Queries the data traffic (including all TCP and UDP data packets) received through all NICs. - * - * @param callback Returns the data traffic received through all NICs. - */ - function getAllRxBytes(callback: AsyncCallback): void; - function getAllRxBytes(): Promise; - - /** - * Queries the data traffic (including all TCP and UDP data packets) received by a specified application. - * This method applies only to system applications and your own applications. - * - * @param uid Indicates the process ID of the application. - * @param callback Returns the data traffic received by the specified application. - */ - function getUidRxBytes(uid: number, callback: AsyncCallback): void; - function getUidRxBytes(uid: number): Promise; - - /** - * Queries the data traffic (including all TCP and UDP data packets) sent by a specified application. - * This method applies only to system applications and your own applications. - * - * @param uid Indicates the process ID of the application. - * @param callback Returns the data traffic sent by the specified application. - */ - function getUidTxBytes(uid: number, callback: AsyncCallback): void; - function getUidTxBytes(uid: number): Promise; - - /** - * Register notifications of network traffic updates, restrictions, and warnings. - * - * @permission ohos.permission.GET_NETSTATS_SUMMARY - * @systemapi Hide this for inner system use. - */ - function on(type: 'netStatsChange', callback: Callback<{ iface: string, uid?: number }>): void; - - /** - * @systemapi Hide this for inner system use. - */ - function off(type: 'netStatsChange', callback?: Callback<{ iface: string, uid?: number }>): void; - - /** - * Get the traffic usage details of the network interface in the specified time period. - * - * @param IfaceInfo Indicates the handle. See {@link IfaceInfo}. - * @permission ohos.permission.GET_NETSTATS_SUMMARY - * @systemapi Hide this for inner system use. - */ - function getIfaceStats(ifaceInfo: IfaceInfo, callback: AsyncCallback): void; - function getIfaceStats(ifaceInfo: IfaceInfo): Promise; - - /** - * Get the traffic usage details of the specified time period of the application. - * - * @param UidStatsInfo Indicates the handle. See {@link UidStatsInfo}. - * @permission ohos.permission.GET_NETSTATS_SUMMARY - * @systemapi Hide this for inner system use. - */ - function getIfaceUidStats(uidStatsInfo: UidStatsInfo, callback: AsyncCallback): void; - function getIfaceUidStats(uidStatsInfo: UidStatsInfo): Promise; - - /** - * @systemapi Hide this for inner system use. - */ - export interface IfaceInfo { - iface: string; - startTime: number; - endTime: number; - } - - /** - * @systemapi Hide this for inner system use. - */ - export interface UidStatsInfo { - /*See {@link IfaceInfo}*/ - ifaceInfo: IfaceInfo; - uid: number; - } - - /** - * @systemapi Hide this for inner system use. - */ - export interface NetStatsInfo { - rxBytes: number; - txBytes: number; - rxPackets: number; - txPackets: number; - } -} - -export default statistics; \ No newline at end of file diff --git a/api/@ohos.net.webSocket.d.ts b/api/@ohos.net.webSocket.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cbb967bee4a57a447048c9ab4d135df7a8da7385 --- /dev/null +++ b/api/@ohos.net.webSocket.d.ts @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2022 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 {AsyncCallback, ErrorCallback} from "./basic"; + +/** + * Provides WebSocket APIs. + * + * @since 6 + * @syscap SystemCapability.Communication.NetStack + */ +declare namespace webSocket { + /** + * Creates a web socket connection. + */ + function createWebSocket(): WebSocket; + + export interface WebSocketRequestOptions { + /** + * HTTP request header. + */ + header?: Object; + } + + export interface WebSocketCloseOptions { + /** + * Error code. + */ + code?: number; + /** + * Error cause. + */ + reason?: string; + } + + export interface WebSocket { + /** + * Initiates a WebSocket request to establish a WebSocket connection to a given URL. + * + * @param url URL for establishing a WebSocket connection. + * @param options Optional parameters {@link WebSocketRequestOptions}. + * @param callback Returns callback used to return the execution result. + * @permission ohos.permission.INTERNET + */ + connect(url: string, callback: AsyncCallback): void; + connect(url: string, options: WebSocketRequestOptions, callback: AsyncCallback): void; + connect(url: string, options?: WebSocketRequestOptions): Promise; + + /** + * Sends data through a WebSocket connection. + * + * @param data Data to send. It can be a string(API 6) or an ArrayBuffer(API 8). + * @param callback Returns callback used to return the execution result. + * @permission ohos.permission.INTERNET + */ + send(data: string | ArrayBuffer, callback: AsyncCallback): void; + send(data: string | ArrayBuffer): Promise; + + /** + * Closes a WebSocket connection. + * + * @param options Optional parameters {@link WebSocketCloseOptions}. + * @param callback Returns callback used to return the execution result. + * @permission ohos.permission.INTERNET + */ + close(callback: AsyncCallback): void; + close(options: WebSocketCloseOptions, callback: AsyncCallback): void; + close(options?: WebSocketCloseOptions): Promise; + + /** + * Enables listening for the open events of a WebSocket connection. + */ + on(type: 'open', callback: AsyncCallback): void; + + /** + * Cancels listening for the open events of a WebSocket connection. + */ + off(type: 'open', callback?: AsyncCallback): void; + + /** + * Enables listening for the message events of a WebSocket connection. + * data in AsyncCallback can be a string(API 6) or an ArrayBuffer(API 8). + */ + on(type: 'message', callback: AsyncCallback): void; + + /** + * Cancels listening for the message events of a WebSocket connection. + * data in AsyncCallback can be a string(API 6) or an ArrayBuffer(API 8). + */ + off(type: 'message', callback?: AsyncCallback): void; + + /** + * Enables listening for the close events of a WebSocket connection. + */ + on(type: 'close', callback: AsyncCallback<{ code: number, reason: string }>): void; + + /** + * Cancels listening for the close events of a WebSocket connection. + */ + off(type: 'close', callback?: AsyncCallback<{ code: number, reason: string }>): void; + + /** + * Enables listening for the error events of a WebSocket connection. + */ + on(type: 'error', callback: ErrorCallback): void; + + /** + * Cancels listening for the error events of a WebSocket connection. + */ + off(type: 'error', callback?: ErrorCallback): void; + } +} + +export default webSocket; \ No newline at end of file diff --git a/api/@ohos.nfc.cardEmulation.d.ts b/api/@ohos.nfc.cardEmulation.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..dbf97d6257528fc8ee1871a4c6f6eae68962d6bf --- /dev/null +++ b/api/@ohos.nfc.cardEmulation.d.ts @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Provides methods to operate or manage NFC card emulation. + * + * @import import cardEmulation from '@ohos.nfc.cardEmulation'; + * + * @since 6 + * @syscap SystemCapability.Communication.NFC.Core + */ +declare namespace cardEmulation { + enum FeatureType { + /** This constant is used to check whether HCE card emulation is supported. */ + HCE = 0, + + /** This constant is used to check whether SIM card emulation is supported. */ + UICC = 1, + + /** This constant is used to check whether eSE card emulation is supported. */ + ESE = 2, + } + + /** + * Checks whether a specified type of card emulation is supported. + * + *

This method is used to check Whether the host or secure element supports card emulation. + * + * @param feature Indicates the card emulation type, {@code HCE}, {@code UICC}, or {@code ESE}. + * @return Returns {@code true} if the specified type of card emulation is supported; returns + * {@code false} otherwise. + * + * @since 6 + */ + function isSupported(feature: number): boolean; + + /** + * A class for NFC host application. + * + *

The NFC host application use this class, then Nfc service can access the application + * installation information and connect to services of the application. + * + * @since 8 + * @syscap SystemCapability.Communication.NFC.Core + */ + export class HceService { + /** + * start HCE + * + * @return Returns {@code true} if HCE is enabled or has been enabled; returns {@code false} otherwise. + * @permission ohos.permission.NFC_CARD_EMULATION + * + * @since 8 + */ + startHCE(aidList: string[]): boolean; + + /** + * stop HCE + * + * @return Returns {@code true} if HCE is disabled or has been disabled; returns {@code false} otherwise. + * @permission ohos.permission.NFC_CARD_EMULATION + * + * @since 8 + */ + stopHCE(): boolean; + + + /** + * register HCE event to receive the APDU data. + * + * @param type the type to register. + * @param callback Callback used to listen for HCE data device received. + * @permission ohos.permission.NFC_CARD_EMULATION + * + * @since 8 + */ + + on(type: "hceCmd", callback: AsyncCallback): void; + + /** + * Sends a response APDU to the remote device. + * + *

This method is used by a host application when swiping card. + * + * @param responseApdu Indicates the response, which is a byte array. + * @permission ohos.permission.NFC_CARD_EMULATION + * + * @since 8 + */ + sendResponse(responseApdu: number[]): void; + } +} +export default cardEmulation; diff --git a/api/@ohos.nfc.controller.d.ts b/api/@ohos.nfc.controller.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..c0fd42b065a28fc59df5585791caa86a01b8b868 --- /dev/null +++ b/api/@ohos.nfc.controller.d.ts @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2021-2022 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 { Callback } from './basic'; + +/** + * Provides methods to operate or manage NFC. + * + * @import import controller from '@ohos.nfc.controller'; + * + * @since 7 + * @syscap SystemCapability.Communication.NFC.Core + */ +declare namespace nfcController { + enum NfcState { + /** Indicates that NFC is disabled. */ + STATE_OFF = 1, + + /** Indicates that NFC is being enabled. */ + STATE_TURNING_ON = 2, + + /** Indicates that NFC is enabled. */ + STATE_ON = 3, + + /** Indicates that NFC is being disabled. */ + STATE_TURNING_OFF = 4, + } + + /** + * Checks whether a device supports NFC. + * + * @return Returns {@code true} if the device supports NFC; returns {@code false} otherwise. + * + * @since 7 + */ + function isNfcAvailable(): boolean + + /** + * register nfc state changed event. + * + * @param type the type to register. + * @param callback Callback used to listen for the nfc state changed event. + * + * @since 7 + */ + + function on(type: "nfcStateChange", callback: Callback): void + + /** + * unregister nfc state changed event. + * + * @param type the type to unregister. + * @param callback Callback used to listen for the nfc state changed event. + * + * @since 7 + */ + + function off(type: "nfcStateChange", callback?: Callback): void + + /** + * Enables NFC. + * + * @return Returns {@code true} if NFC is enabled or has been enabled; returns {@code false} otherwise. + * @permission ohos.permission.MANAGE_SECURE_SETTINGS + * + * @since 7 + */ + function openNfc(): boolean + + /** + * Disables NFC. + * + * @return Returns {@code true} if NFC is disabled or has been disabled; returns {@code false} otherwise. + * @permission ohos.permission.MANAGE_SECURE_SETTINGS + * + * @since 7 + */ + function closeNfc(): boolean + + /** + * Checks whether NFC is enabled. + * + * @return Returns {@code true} if NFC is enabled; returns {@code false} otherwise. + * + * @since 7 + */ + function isNfcOpen(): boolean + + /** + * Obtains the NFC status. + * + *

The NFC status can be any of the following:

  • {@link #STATE_OFF}: Indicates that NFC + * is disabled.
  • {@link #STATE_TURNING_ON}: Indicates that NFC is being enabled. + *
  • {@link #STATE_ON}: Indicates that NFC is enabled.
  • {@link #STATE_TURNING_OFF}: Indicates + * that NFC is being disabled.
+ * + * @return Returns the NFC status. + * + * @since 7 + */ + function getNfcState(): NfcState +} + +export default nfcController; diff --git a/api/@ohos.nfc.tag.d.ts b/api/@ohos.nfc.tag.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..d98f18c716c6d04cd8b4c16242b2bbd55ce6c5b7 --- /dev/null +++ b/api/@ohos.nfc.tag.d.ts @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2021-2022 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 { NfcATag, NfcBTag, NfcFTag, NfcVTag } from './tag/nfctech'; + +/** + * Provides methods to operate or manage NFC tag. + * + * @import import tag from '@ohos.nfc.tag'; + * + * @since 7 + * @syscap SystemCapability.Communication.NFC.Core + */ +declare namespace tag { + /** Indicates an NFC-A tag. */ + const NFC_A = 1; + + /** Indicates an NFC-B tag. */ + const NFC_B = 2; + + /** Indicates an ISO-DEP tag. */ + const ISO_DEP = 3; + + /** Indicates an NFC-F tag. */ + const NFC_F = 4; + + /** Indicates an NFC-V tag. */ + const NFC_V = 5; + + /** Indicated an NDEF tag. */ + const NDEF = 6; + + /** Indicates a MifareClassic tag. */ + const MIFARE_CLASSIC = 8; + + /** Indicates a MifareUltralight tag. */ + const MIFARE_ULTRALIGHT = 9; + + /** + * Obtains an {@code NfcATag} object based on the tag information. + * + *

During tag reading, if the tag supports the NFC-A technology, an {@code NfcATag} object + * will be created based on the tag information. + * + * @param tagInfo Indicates the tag information. + * @permission ohos.permission.NFC_TAG + * + * @since 7 + */ + function getNfcATag(tagInfo: TagInfo): NfcATag + + /** + * Obtains an {@code NfcBTag} object based on the tag information. + * + *

During tag reading, if the tag supports the NFC-B technology, an {@code NfcBTag} object + * will be created based on the tag information. + * + * @param tagInfo Indicates the tag information. + * @permission ohos.permission.NFC_TAG + * + * @since 7 + */ + function getNfcBTag(tagInfo: TagInfo): NfcBTag + + /** + * Obtains an {@code NfcFTag} object based on the tag information. + * + *

During tag reading, if the tag supports the NFC-F technology, an {@code NfcFTag} object + * will be created based on the tag information. + * + * @param tagInfo Indicates the tag information. + * @permission ohos.permission.NFC_TAG + * + * @since 7 + */ + function getNfcFTag(tagInfo: TagInfo): NfcFTag + + /** + * Obtains an {@code NfcVTag} object based on the tag information. + * + *

During tag reading, if the tag supports the NFC-V technology, an {@code NfcVTag} object + * will be created based on the tag information. + * + * @param tagInfo Indicates the tag information. + * @permission ohos.permission.NFC_TAG + * + * @since 7 + */ + function getNfcVTag(tagInfo: TagInfo): NfcVTag + + + /** + * Provides tag information. + * + *

This class provides the technology a tag supports, for example, NFC-A. Applications can create + * different tags based on the supported technology. + * + * @since 7 + * @syscap SystemCapability.Communication.NFC.Core + * @permission ohos.permission.NFC_TAG + */ + export interface TagInfo { + supportedProfiles: number[]; + } +} +export default tag; \ No newline at end of file diff --git a/api/@ohos.notification.d.ts b/api/@ohos.notification.d.ts index 4bee96a6281c82105770c76312fc3190a9855c69..b93b0ba93a7869bbc205b75d2230524c3661c3c4 100644 --- a/api/@ohos.notification.d.ts +++ b/api/@ohos.notification.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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 @@ -55,7 +55,9 @@ declare namespace notification { * @since 8 * @param Publishes a notification. * @param userId of subscriber receiving the notification - * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * */ function publish(request: NotificationRequest, userId: number, callback: AsyncCallback): void; function publish(request: NotificationRequest, userId: number): Promise; @@ -91,6 +93,7 @@ declare namespace notification { * This parameter must be specified. * @param callback callback function * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ function addSlot(slot: NotificationSlot, callback: AsyncCallback): void; @@ -101,6 +104,7 @@ declare namespace notification { * This parameter must be specified. * * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ function addSlot(slot: NotificationSlot): Promise; @@ -120,6 +124,7 @@ declare namespace notification { * This parameter must be specified. * @param callback callback function * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ function addSlots(slots: Array, callback: AsyncCallback): void; @@ -130,6 +135,7 @@ declare namespace notification { * This parameter must be specified. * * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ function addSlots(slots: Array): Promise; @@ -325,6 +331,7 @@ declare namespace notification { * isNotificationEnabled * * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ function isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback): void; @@ -332,6 +339,7 @@ declare namespace notification { * isNotificationEnabled * * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ function isNotificationEnabled(bundle: BundleOption): Promise; @@ -339,29 +347,33 @@ declare namespace notification { * isNotificationEnabled * * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ function isNotificationEnabled(callback: AsyncCallback): void; /** - * Checks whether this application has permission to publish notifications under the user. + * isNotificationEnabled * - * since 8 * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ - function isNotificationEnabled(userId: number, callback: AsyncCallback): void; - function isNotificationEnabled(userId: number): Promise; + function isNotificationEnabled(): Promise; /** - * isNotificationEnabled + * Checks whether this application has permission to publish notifications under the user. * + * since 8 * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ - function isNotificationEnabled(): Promise; + function isNotificationEnabled(userId: number, callback: AsyncCallback): void; + function isNotificationEnabled(userId: number): Promise; /** * displayBadge * * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ function displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback): void; @@ -369,6 +381,7 @@ declare namespace notification { * displayBadge * * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ function displayBadge(bundle: BundleOption, enable: boolean): Promise; @@ -376,6 +389,7 @@ declare namespace notification { * isBadgeDisplayed * * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ function isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback): void; @@ -383,6 +397,7 @@ declare namespace notification { * isBadgeDisplayed * * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ function isBadgeDisplayed(bundle: BundleOption): Promise; @@ -422,6 +437,7 @@ declare namespace notification { * getSlotNumByBundle * * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ function getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback): void; @@ -429,6 +445,7 @@ declare namespace notification { * getSlotNumByBundle * * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ function getSlotNumByBundle(bundle: BundleOption): Promise; @@ -601,25 +618,66 @@ declare namespace notification { * * @since 8 * @param templateName Name of template to be Obtained + * @param callback callback function */ function isSupportTemplate(templateName: string, callback: AsyncCallback): void; function isSupportTemplate(templateName: string): Promise; /** - * Query notification sending permission. + * Request permission to send notification. + * + * @since 8 + */ + function requestEnableNotification(callback: AsyncCallback): void; + function requestEnableNotification(): Promise; + + /** + * Sets whether the device supports distributed notification. * * @since 8 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ - function isNotificationEnabledSelf(callback: AsyncCallback): void; - function isNotificationEnabledSelf(): Promise; + function enableDistributed(enable: boolean, callback: AsyncCallback): void; + function enableDistributed(enable: boolean): Promise; /** - * Request permission to send notification. + * Obtains whether the device supports distributed notification. * * @since 8 */ - function requestEnableNotification(callback: AsyncCallback): void; - function requestEnableNotification(): Promise; + function isDistributedEnabled(callback: AsyncCallback): void; + function isDistributedEnabled(): Promise; + + /** + * Sets whether an application supports distributed notification. + * + * @since 8 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + */ + function enableDistributedByBundle(bundle: BundleOption, enable: boolean, callback: AsyncCallback): void; + function enableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise; + + /** + * Obtains whether an application supports distributed notification. + * + * @since 8 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + */ + function isDistributedEnabledByBundle(bundle: BundleOption, callback: AsyncCallback): void; + function isDistributedEnabledByBundle(bundle: BundleOption): Promise; + + /** + * Obtains the remind modes of the notification. + * + * @since 8 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + */ + function getDeviceRemindType(callback: AsyncCallback): void; + function getDeviceRemindType(): Promise; /** * Describes a BundleOption. @@ -638,34 +696,59 @@ declare namespace notification { } /** - * DisturbMode + * The type of the Do Not Disturb. * + * @since 8 * @systemapi Hide this for inner system use. */ - export enum DoNotDisturbMode { - ALLOW_UNKNOWN, + export enum DoNotDisturbType { + /** + * Non do not disturb type notification + */ + TYPE_NONE = 0, /** - * Indicates that all notifications are allowed to interrupt the user in Do Not Disturb mode. + * Execute do not disturb once in the set time period (only watch hours and minutes) */ - ALLOW_ALL, + TYPE_ONCE = 1, /** - * Indicates that only notifications meeting the specified priority criteria are allowed to interrupt - * the user in Do Not Disturb mode. + * Execute do not disturb every day with a set time period (only watch hours and minutes) + */ + TYPE_DAILY = 2, + + /** + * Execute in the set time period (specify the time, month, day and hour) + */ + TYPE_CLEARLY = 3, + } + + /** + * Describes a DoNotDisturbDate instance. + * + * @systemapi Hide this for inner system use. + */ + export interface DoNotDisturbDate { + /** + * the type of the Do Not Disturb. + * + * @since 8 */ - ALLOW_PRIORITY, + type: DoNotDisturbType; /** - * Indicates that no notifications are allowed to interrupt the user in Do Not Disturb mode. + * the start time of the Do Not Disturb. + * + * @since 8 */ - ALLOW_NONE, + begin: Date; /** - * Indicates that only notifications of the {@link NotificationRequest#CLASSIFICATION_ALARM} category - * are allowed to interrupt the user in Do Not Disturb mode. + * the end time of the Do Not Disturb. + * + * @since 8 */ - ALLOW_ALARMS + end: Date; } /** @@ -724,6 +807,34 @@ declare namespace notification { end: Date; } + /** + * The remind type of the nofication. + * + * @since 8 + * @systemapi Hide this for inner system use. + */ + export enum DeviceRemindType { + /** + * The device is not in use, no reminder + */ + IDLE_DONOT_REMIND = 0, + + /** + * The device is not in use, remind + */ + IDLE_REMIND = 1, + + /** + * The device is in use, no reminder + */ + ACTIVE_DONOT_REMIND = 2, + + /** + * The device is in use, reminder + */ + ACTIVE_REMIND = 3, + } + /** * Notification source type * @@ -734,17 +845,17 @@ declare namespace notification { /** * General notification */ - TYPE_NORMAL = 0x00000000, + TYPE_NORMAL = 0, /** * Continuous notification */ - TYPE_CONTINUOUS = 0x00000001, + TYPE_CONTINUOUS = 1, /** * Scheduled notification */ - TYPE_TIMER = 0x00000002, + TYPE_TIMER = 2, } } diff --git a/api/@ohos.pasteboard.d.ts b/api/@ohos.pasteboard.d.ts index facf37ba9e9c95a0364d2dfd745615445eae1977..55e2d57161c90615134251d277fb3e19d01d3d83 100644 --- a/api/@ohos.pasteboard.d.ts +++ b/api/@ohos.pasteboard.d.ts @@ -17,8 +17,7 @@ import { Want } from './ability/want'; /** * systemPasteboard - * @sysCap SystemCapability.Miscservices.Pasteboard - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.MiscServices.Pasteboard * @import import pasteboard from '@ohos.pasteboard'; */ declare namespace pasteboard { diff --git a/api/@ohos.pluginComponent.d.ts b/api/@ohos.pluginComponent.d.ts index c73c4d73425768829d2d391d37ddd2bbc5533979..4e54e395009ae6df1089ed92e84abe6f36c10e8a 100644 --- a/api/@ohos.pluginComponent.d.ts +++ b/api/@ohos.pluginComponent.d.ts @@ -18,6 +18,7 @@ import { Want } from './ability/want'; /** * Plugin component template property. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ interface PluginComponentTemplate { @@ -27,6 +28,7 @@ interface PluginComponentTemplate { /** * Plugin component manager interface. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ declare namespace pluginComponentManager { diff --git a/api/@ohos.power.d.ts b/api/@ohos.power.d.ts index 90da7f50996ed0b348cd8d0ba52b0e04b8760bf0..3b7db0d372d0086ee9a1aaafdb2ad92fc3cb5b55 100644 --- a/api/@ohos.power.d.ts +++ b/api/@ohos.power.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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 @@ -18,16 +18,17 @@ import {AsyncCallback} from './basic'; /** * Provides interfaces to manage power. * - * @sysCap SystemCapability.PowerManager.PowerManager.Core + * @syscap SystemCapability.PowerManager.PowerManager.Core * @since 7 */ declare namespace power { /** * Shuts down the system. * - *

This method requires the ohos.permission.SHUTDOWN permission. + *

This method requires the ohos.permission.REBOOT permission. * * @param reason Indicates the shutdown reason. + * @permission ohos.permission.REBOOT * @systemapi * @since 7 */ @@ -40,6 +41,7 @@ declare namespace power { * * @param reason Indicates the restart reason. For example, "updater" indicates entering the updater mode * after the restart. If the parameter is not specified, the system enters the normal mode after the restart. + * @permission ohos.permission.REBOOT * @since 7 */ function rebootDevice(reason: string): void; diff --git a/api/@ohos.prompt.d.ts b/api/@ohos.prompt.d.ts index 40dc9faa4b18c9c75cb416bbd43d2c7e4e301150..9d8afef0be55336a9409fccc55d6bd2a9a00a1a8 100644 --- a/api/@ohos.prompt.d.ts +++ b/api/@ohos.prompt.d.ts @@ -16,6 +16,7 @@ import {AsyncCallback} from './basic'; /** + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 * @import prompt from '@ohos.prompt'; */ @@ -112,7 +113,6 @@ declare namespace prompt { } /** - * @devices tv, phone, tablet, wearable * @since 8 */ interface ActionMenuOptions { diff --git a/api/@ohos.reminderAgent.d.ts b/api/@ohos.reminderAgent.d.ts index 67c0841c9b1ebc62b1d0901820b766c0385c4edf..7c60303d03e7145ea27006bc34951d78497c401e 100644 --- a/api/@ohos.reminderAgent.d.ts +++ b/api/@ohos.reminderAgent.d.ts @@ -188,6 +188,28 @@ declare namespace reminderAgent { abilityName: string; } + /** + * Max screen want agent information. + * + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + interface MaxScreenWantAgent { + /** + * Name of the package that is automatically started when the reminder arrives and the device is not in use. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + pkgName: string; + + /** + * Name of the ability that is automatically started when the reminder arrives and the device is not in use. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + abilityName: string; + } + /** * Reminder Common information. * @@ -217,6 +239,35 @@ declare namespace reminderAgent { */ wantAgent?: WantAgent; + /** + * Information about the ability that is automatically started when the reminder arrives. + * If the device is in use, a notification will be displayed. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + maxScreenWantAgent?: MaxScreenWantAgent; + + /** + * Ringing duration. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + ringDuration?: number; + + /** + * Number of reminder snooze times. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + snoozeTimes?: number; + + /** + * Reminder snooze interval. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + timeInterval?: number; + /** * Reminder title. * @since 7 @@ -232,12 +283,19 @@ declare namespace reminderAgent { content?: string; /** - * Content to be displayed when the reminder is snoozing. + * Content to be displayed when the reminder is expired. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent */ expiredContent?: string; + /** + * Content to be displayed when the reminder is snoozing. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + snoozeContent?: string; + /** * notification id. If there are reminders with the same ID, the later one will overwrite the earlier one. * @since 7 @@ -253,6 +311,29 @@ declare namespace reminderAgent { slotType?: notification.SlotType; } + interface ReminderRequestCalendar extends ReminderRequest { + /** + * Reminder time. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + dateTime: LocalDateTime; + + /** + * Month in which the reminder repeats. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + repeatMonths?: Array; + + /** + * Date on which the reminder repeats. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + repeatDays?: Array; + } + /** * Alarm reminder information. * @@ -291,5 +372,49 @@ declare namespace reminderAgent { interface ReminderRequestTimer extends ReminderRequest { triggerTimeInSeconds: number; } + + interface LocalDateTime { + /** + * value of year. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + year: number; + + /** + * value of month. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + month: number; + + /** + * value of day. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + day: number; + + /** + * value of hour. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + hour: number; + + /** + * value of minute. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + minute: number; + + /** + * value of second. + * @since 7 + * @syscap SystemCapability.Notification.ReminderAgent + */ + second?: number; + } } -export default reminderAgent; \ No newline at end of file +export default reminderAgent; diff --git a/api/@ohos.request.d.ts b/api/@ohos.request.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..38ddc06e5f6f586caea9ec4d8814223feeac62c6 --- /dev/null +++ b/api/@ohos.request.d.ts @@ -0,0 +1,740 @@ +/* + * Copyright (c) 2022 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 { AsyncCallback } from './basic'; + +/** + * upload and download + * + * @import request from '@ohos.request'; + * @permission ohos.permission.INTERNET + */ +declare namespace request { + + /** + * Bit flag indicating download is allowed when using the cellular network. + * @syscap SystemCapability.MiscServices.Download + * @since 6 + * @permission ohos.permission.INTERNET + */ + const NETWORK_MOBILE: number; + + /** + * Bit flag indicating download is allowed when using the WLAN. + * @syscap SystemCapability.MiscServices.Download + * @since 6 + * @permission ohos.permission.INTERNET + */ + const NETWORK_WIFI: number; + + /** + * Indicates that the download cannot be resumed for some temporary errors. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const ERROR_CANNOT_RESUME: number; + + /** + * Indicates that no storage device, such as an SD card, is found. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const ERROR_DEVICE_NOT_FOUND: number; + + /** + * Indicates that files to be downloaded already exist, and that the download session cannot overwrite the existing files. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const ERROR_FILE_ALREADY_EXISTS: number; + + /** + * Indicates that a file operation fails. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const ERROR_FILE_ERROR: number; + + /** + * Indicates that the HTTP transmission fails. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const ERROR_HTTP_DATA_ERROR: number; + + /** + * Indicates insufficient storage space. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const ERROR_INSUFFICIENT_SPACE: number; + + /** + * Indicates an error caused by too many network redirections. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const ERROR_TOO_MANY_REDIRECTS: number; + + /** + * Indicates an HTTP code that cannot be identified. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const ERROR_UNHANDLED_HTTP_CODE: number; + + /** + * Indicates an undefined error. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const ERROR_UNKNOWN: number; + + /** + * Indicates that the download is paused and waiting for a WLAN connection, because the file size exceeds the maximum allowed for a session using the cellular network. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const PAUSED_QUEUED_FOR_WIFI: number; + + /** + * Indicates that the download is paused for some reasons. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const PAUSED_UNKNOWN: number; + + /** + * Indicates that the download is paused due to a network problem, for example, network disconnection. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const PAUSED_WAITING_FOR_NETWORK: number; + + /** + * Indicates that a network error occurs, and the download session will be retried. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const PAUSED_WAITING_TO_RETRY: number; + + /** + * Indicates that the download session has failed and will not be retried. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const SESSION_FAILED: number; + + /** + * Indicates that the download session has been paused. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const SESSION_PAUSED: number; + + /** + * Indicates that the download session is being scheduled. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const SESSION_PENDING: number; + + /** + * Indicates that the download session is in progress. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const SESSION_RUNNING: number; + + /** + * Indicates that the download session is completed. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + const SESSION_SUCCESSFUL: number; + + /** + * Starts a download session. + * @syscap SystemCapability.MiscServices.Download + * @since 6 + * @param config download config + * @param callback Indicate the callback function to receive DownloadTask. + * @permission ohos.permission.INTERNET + * @return - + */ + function download(config: DownloadConfig, callback: AsyncCallback): void; + + /** + * Starts a download session. + * @syscap SystemCapability.MiscServices.Download + * @since 6 + * @param config download config + * @permission ohos.permission.INTERNET + * @return - + */ + function download(config: DownloadConfig): Promise; + + /** + * Starts a upload session. + * @syscap SystemCapability.MiscServices.Upload + * @since 6 + * @param config upload config + * @param callback Indicate the callback function to receive UploadTask. + * @permission ohos.permission.INTERNET + * @return - + */ + function upload(config: UploadConfig, callback: AsyncCallback): void; + + /** + * Starts a upload session. + * @syscap SystemCapability.MiscServices.Upload + * @since 6 + * @param config upload config + * @permission ohos.permission.INTERNET + * @return - + */ + function upload(config: UploadConfig): Promise; + + /** + * DownloadConfig data Structure + * + * @name DownloadConfig + * @since 6 + * @syscap SystemCapability.MiscServices.Download + * @permission ohos.permission.INTERNET + */ + interface DownloadConfig { + /** + * Resource address. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + url: string; + /** + * Adds an HTTP or HTTPS header to be included with the download request. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + header?: Object; + /** + * Allows download under a metered connection. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + enableMetered?: boolean; + /** + * Allows download in a roaming network. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + enableRoaming?: boolean; + /** + * Sets the description of a download session. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + description?: string; + /** + * Sets the network type allowed for download. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + networkType?: number; + /** + * Sets the path for downloads. + * + * @since 7 + * @permission ohos.permission.INTERNET + */ + filePath?: string; + /** + * Sets a download session title. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + title?: string; + } + + /** + * DownloadInfo data Structure + * + * @name DownloadInfo + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + */ + interface DownloadInfo { + /** + * the description of a file to be downloaded. + * + * @since 7 + * @permission ohos.permission.INTERNET + */ + description: string; + /** + * the real-time downloads size (in bytes). + * + * @since 7 + * @permission ohos.permission.INTERNET + */ + downloadedBytes: number; + /** + * the ID of a file to be downloaded. + * + * @since 7 + * @permission ohos.permission.INTERNET + */ + downloadId: number; + /** + * a download failure cause, which can be any DownloadSession.ERROR_* constant. + * + * @since 7 + * @permission ohos.permission.INTERNET + */ + failedReason: number; + /** + * the name of a file to be downloaded. + * + * @since 7 + * @permission ohos.permission.INTERNET + */ + fileName: string; + /** + * the URI of a stored file. + * + * @since 7 + * @permission ohos.permission.INTERNET + */ + filePath: string; + /** + * the reason why a session is paused, which can be any DownloadSession.PAUSED_* constant. + * + * @since 7 + * @permission ohos.permission.INTERNET + */ + pausedReason: number; + /** + * the download status code, which can be any DownloadSession.SESSION_* constant. + * + * @since 7 + * @permission ohos.permission.INTERNET + */ + status: number; + /** + * the URI of files to be downloaded. + * + * @since 7 + * @permission ohos.permission.INTERNET + */ + targetURI: string; + /** + * the title of a file to be downloaded. + * + * @since 7 + * @permission ohos.permission.INTERNET + */ + downloadTitle: string; + /** + * the total size of files to be downloaded (in bytes). + * + * @since 7 + * @permission ohos.permission.INTERNET + */ + downloadTotalBytes: number; + } + + interface DownloadTask { + /** + * Called when the current download session is in process. + * @syscap SystemCapability.MiscServices.Download + * @since 6 + * @param type progress Indicates the download task progress. + * @param callback The callback function for the download progress change event + * receivedSize the length of downloaded data, in bytes + * totalSize he length of data expected to be downloaded, in bytes. + * @permission ohos.permission.INTERNET + * @return - + */ + on(type: 'progress', callback: (receivedSize: number, totalSize: number) => void): void; + + /** + * Called when the current download session is in process. + * @syscap SystemCapability.MiscServices.Download + * @since 6 + * @param type progress Indicates the download task progress. + * @param callback The callback function for the download progress change event + * receivedSize the length of downloaded data, in bytes + * totalSize he length of data expected to be downloaded, in bytes. + * @permission ohos.permission.INTERNET + * @return - + */ + off(type: 'progress', callback?: (receivedSize: number, totalSize: number) => void): void; + + /** + * Called when the current download session complete、pause or remove. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @param type Indicates the download session event type + * complete: download task completed, + * pause: download task stopped, + * remove: download task deleted. + * @param callback The callback function for the download complete、pause or remove change event. + * @permission ohos.permission.INTERNET + * @return - + */ + on(type: 'complete' | 'pause' | 'remove', callback: () => void): void; + + /** + * Called when the current download session complete、pause or remove. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @param type Indicates the download session event type + * complete: download task completed, + * pause: download task stopped, + * remove: download task deleted. + * @param callback The callback function for the download complete、pause or remove change event. + * @permission ohos.permission.INTERNET + * @return - + */ + off(type: 'complete' | 'pause' | 'remove', callback?: () => void): void; + + /** + * Called when the current download session fails. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @param type Indicates the download session type, fail: download task has failed. + * @param callback The callback function for the download fail change event + * err The error code for download task. + * @permission ohos.permission.INTERNET + * @return - + */ + on(type: 'fail', callback: (err: number) => void): void; + + /** + * Called when the current download session fails. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @param type Indicates the download session type, fail: download task has failed. + * @param callback Indicate the callback function to receive err. + * err The error code for download task. + * @permission ohos.permission.INTERNET + * @return - + */ + off(type: 'fail', callback?: (err: number) => void): void; + + /** + * Deletes a download session and the downloaded files. + * @syscap SystemCapability.MiscServices.Download + * @since 6 + * @param callback Indicates asynchronous invoking Result. + * @permission ohos.permission.INTERNET + * @return - + */ + remove(callback: AsyncCallback): void; + + /** + * Deletes a download session and the downloaded files. + * @syscap SystemCapability.MiscServices.Download + * @since 6 + * @permission ohos.permission.INTERNET + * @return - + */ + remove(): Promise; + + /** + * Pause a download session. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @param callback Indicates asynchronous invoking Result. + * @permission ohos.permission.INTERNET + * @return - + */ + pause(callback: AsyncCallback): void; + + /** + * Pause a download session. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + * @return - + */ + pause(): Promise; + + /** + * Resume a paused download session. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @param callback Indicates asynchronous invoking Result. + * @permission ohos.permission.INTERNET + * @return - + */ + resume(callback: AsyncCallback): void; + + /** + * Resume a paused download session. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + * @return - + */ + resume(): Promise; + + /** + * Queries download information of a session, which is defined in DownloadSession.DownloadInfo. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @param callback Indicate the callback function to receive download info. + * @permission ohos.permission.INTERNET + * @return - + */ + query(callback: AsyncCallback): void; + + /** + * Queries download information of a session, which is defined in DownloadSession.DownloadInfo. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + * @return - + */ + query(): Promise; + + /** + * Queries the MIME type of the download file. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @param callback Indicate the callback function to receive download file MIME type. + * @permission ohos.permission.INTERNET + * @return - + */ + queryMimeType(callback: AsyncCallback): void; + + /** + * Queries the MIME type of the download file. + * @syscap SystemCapability.MiscServices.Download + * @since 7 + * @permission ohos.permission.INTERNET + * @return - + */ + queryMimeType(): Promise; + } + + /** + * File data Structure + * + * @name File + * @since 6 + * @syscap SystemCapability.MiscServices.Download + * @permission ohos.permission.INTERNET + */ + interface File { + /** + * When multipart is submitted, the file name in the request header. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + filename: string; + /** + * When multipart is submitted, the name of the form item. The default is file. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + name: string; + /** + * The local storage path of the file (please refer to the storage directory definition for path usage). + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + uri: string; + /** + * The content type of the file is obtained by default according to the suffix of the file name or path. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + type: string; + } + + /** + * RequestData data Structure + * + * @name RequestData + * @since 6 + * @syscap SystemCapability.MiscServices.Download + * @permission ohos.permission.INTERNET + */ + interface RequestData { + /** + * Represents the name of the form element. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + name: string; + /** + * Represents the value of the form element. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + value: string; + } + + /** + * UploadConfig data Structure + * + * @name UploadConfig + * @since 6 + * @syscap SystemCapability.MiscServices.Upload + * @permission ohos.permission.INTERNET + */ + interface UploadConfig { + /** + * Resource address. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + url: string; + /** + * Adds an HTTP or HTTPS header to be included with the upload request. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + header: Object; + /** + * Request method: POST, PUT. The default POST. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + method: string; + /** + * A list of files to be uploaded. Please use multipart/form-data to submit. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + files: Array; + /** + * The requested form data. + * + * @since 6 + * @permission ohos.permission.INTERNET + */ + data: Array; + } + + interface UploadTask { + /** + * Called when the current upload session is in process. + * @syscap SystemCapability.MiscServices.Upload + * @since 6 + * @param type progress Indicates the upload task progress. + * @param callback The callback function for the upload progress change event + * uploadedSize The length of uploaded data, in bytes + * totalSize The length of data expected to be uploaded, in bytes. + * @permission ohos.permission.INTERNET + * @return - + */ + on(type: 'progress', callback: (uploadedSize: number, totalSize: number) => void): void; + + /** + * Called when the current upload session is in process. + * @syscap SystemCapability.MiscServices.Upload + * @since 6 + * @param type progress Indicates the upload task progress. + * @param callback The callback function for the upload progress change event + * uploadedSize The length of uploaded data, in bytes + * totalSize The length of data expected to be uploaded, in bytes. + * @permission ohos.permission.INTERNET + * @return - + */ + off(type: 'progress', callback?: (uploadedSize: number, totalSize: number) => void): void; + + /** + * Called when the header of the current upload session has been received. + * @syscap SystemCapability.MiscServices.Upload + * @since 7 + * @param type headerReceive Indicates the upload task headed receive. + * @param callback The callback function for the HTTP Response Header event + * header HTTP Response Header returned by the developer server. + * @permission ohos.permission.INTERNET + * @return - + */ + on(type: 'headerReceive', callback: (header: object) => void): void; + + /** + * Called when the header of the current upload session has been received. + * @syscap SystemCapability.MiscServices.Upload + * @since 7 + * @param type headerReceive Indicates the upload task headed receive. + * @param callback The callback function for the HTTP Response Header event + * header HTTP Response Header returned by the developer server. + * @permission ohos.permission.INTERNET + * @return - + */ + off(type: 'headerReceive', callback?: (header: object) => void): void; + + /** + * Deletes a upload session. + * @syscap SystemCapability.MiscServices.Upload + * @since 6 + * @param callback Indicates asynchronous invoking Result. + * @permission ohos.permission.INTERNET + * @return - + */ + remove(callback: AsyncCallback): void; + + /** + * Deletes a upload session. + * @syscap SystemCapability.MiscServices.Upload + * @since 6 + * @permission ohos.permission.INTERNET + * @return - + */ + remove(): Promise; + } +} + +export default request; + diff --git a/api/@ohos.resourceManager.d.ts b/api/@ohos.resourceManager.d.ts index 258978388031bccc282f99ee03478c28fb0acb3e..e3adf351d788eabd25c545c4c9063a219247774f 100644 --- a/api/@ohos.resourceManager.d.ts +++ b/api/@ohos.resourceManager.d.ts @@ -199,7 +199,7 @@ export interface AsyncCallback { * @since 6 * @FAModelOnly */ -export function getResourceManager(callback: AsyncCallback); +export function getResourceManager(callback: AsyncCallback): void; /** * Obtains the ResourceManager object of the specified application. @@ -209,7 +209,7 @@ export function getResourceManager(callback: AsyncCallback); * @since 6 * @FAModelOnly */ -export function getResourceManager(bundleName: string, callback: AsyncCallback); +export function getResourceManager(bundleName: string, callback: AsyncCallback): void; /** * Obtains the ResourceManager object of the current application. @@ -230,48 +230,6 @@ export function getResourceManager(): Promise; */ export function getResourceManager(bundleName: string): Promise; -/** - * Obtains the ResourceManager object of the current application. - * - * @param ctx The Context object. - * @param callback Indicates the callback containing the ResourceManager object. - * @since 9 preview - * @StageModelOnly - */ -export function getResourceManager(ctx: Context, callback: AsyncCallback); - -/** - * Obtains the ResourceManager object of the specified application. - * - * @param ctx The Context object. - * @param bundleName Indicates the bundle name of the specified application. - * @param callback Indicates the callback containing the ResourceManager object. - * @since 9 preview - * @StageModelOnly - */ -export function getResourceManager(ctx: Context, bundleName: string, callback: AsyncCallback); - -/** - * Obtains the ResourceManager object of the current application. - * - * @param ctx The Context object. - * @return Returns that the ResourceManager object is returned in Promise mode. - * @since 9 preview - * @StageModelOnly - */ -export function getResourceManager(ctx: Context): Promise; - -/** - * Obtains the ResourceManager object of the specified application. - * - * @param ctx The Context object. - * @param bundleName Indicates the bundle name of the specified application. - * @return Returns that the ResourceManager object is returned in Promise mode. - * @since 9 preview - * @StageModelOnly - */ -export function getResourceManager(ctx: Context, bundleName: string): Promise; - /** * Provides the capability of accessing application resources. * @@ -285,7 +243,7 @@ export interface ResourceManager { * @param callback Indicates the asynchronous callback used to return the obtained character string. * @since 6 */ - getString(resId: number, callback: AsyncCallback); + getString(resId: number, callback: AsyncCallback): void; /** * Obtains string resources associated with a specified resource ID in Promise mode. @@ -303,7 +261,7 @@ export interface ResourceManager { * @param callback Indicates the asynchronous callback used to return the obtained array of character strings. * @since 6 */ - getStringArray(resId: number, callback: AsyncCallback>); + getStringArray(resId: number, callback: AsyncCallback>): void; /** * Obtains the array of character strings corresponding to a specified resource ID in Promise mode. @@ -321,7 +279,7 @@ export interface ResourceManager { * @param callback Indicates the asynchronous callback used to return the obtained media file content. * @since 6 */ - getMedia(resId: number, callback: AsyncCallback); + getMedia(resId: number, callback: AsyncCallback): void; /** * Obtains the content of the media file corresponding to a specified resource ID in Promise mode. @@ -340,7 +298,7 @@ export interface ResourceManager { * resource. * @since 6 */ - getMediaBase64(resId: number, callback: AsyncCallback); + getMediaBase64(resId: number, callback: AsyncCallback): void; /** * Obtains the Base64 code of the image resource corresponding to the specified resource ID in Promise mode. @@ -357,7 +315,7 @@ export interface ResourceManager { * @param callback Indicates the asynchronous callback used to return the obtained device capability. * @since 6 */ - getDeviceCapability(callback: AsyncCallback); + getDeviceCapability(callback: AsyncCallback): void; /** * Obtains the device capability in Promise mode. @@ -374,7 +332,7 @@ export interface ResourceManager { * configuration. * @since 6 */ - getConfiguration(callback: AsyncCallback); + getConfiguration(callback: AsyncCallback): void; /** * Obtains the device configuration in Promise mode. @@ -394,7 +352,7 @@ export interface ResourceManager { * string represented by the ID string corresponding to the specified number. * @since 6 */ - getPluralString(resId: number, num: number, callback: AsyncCallback); + getPluralString(resId: number, num: number, callback: AsyncCallback): void; /** * Obtains the singular-plural character string represented by the ID string corresponding to @@ -415,7 +373,7 @@ export interface ResourceManager { * @param callback Indicates the asynchronous callback used to return the raw file resource. * @since 8 */ - getRawFile(path: string, callback: AsyncCallback); + getRawFile(path: string, callback: AsyncCallback): void; /** * Obtains the raw file resource corresponding to the specified resource path in Promise mode. @@ -433,7 +391,7 @@ export interface ResourceManager { * @param callback Indicates the asynchronous callback used to return the raw file resource descriptor. * @since 8 */ - getRawFileDescriptor(path: string, callback: AsyncCallback); + getRawFileDescriptor(path: string, callback: AsyncCallback): void; /** * Obtains the raw file resource descriptor corresponding to the specified resource path in Promise mode. @@ -444,6 +402,24 @@ export interface ResourceManager { */ getRawFileDescriptor(path: string): Promise; + /** + * Obtains close raw file resource descriptor corresponding to the specified resource path in callback mode. + * + * @param path Indicates the resource relative path. + * @param callback Indicates the asynchronous callback used to return result close raw file resource descriptor. + * @since 8 + */ + closeRawFileDescriptor(path: string, callback: AsyncCallback): void; + + /** + * Obtains close raw file resource descriptor corresponding to the specified resource path in Promise mode. + * + * @param path Indicates the resource relative path. + * @return Returns result close raw file resource descriptor corresponding to the specified resource path. + * @since 8 + */ + closeRawFileDescriptor(path: string): Promise; + /** * Obtains release resourceManager. * diff --git a/api/@ohos.router.d.ts b/api/@ohos.router.d.ts index dc9fb60ca4840efc0c3b7b49194eb743a58b939b..92b1ec6badc9aef6b5023bb407632d0bb9cfb7dc 100644 --- a/api/@ohos.router.d.ts +++ b/api/@ohos.router.d.ts @@ -16,6 +16,7 @@ import {Callback} from './basic'; /** + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 * @import router from '@ohos.router'; */ @@ -33,6 +34,7 @@ declare namespace router { * pages/index/index * pages/detail/detail * 2. Particular path. If the URI is a slash (/), the home page is displayed. + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 8 */ url: string; @@ -41,24 +43,12 @@ declare namespace router { * Data that needs to be passed to the destination page during navigation. * After the destination page is displayed, the parameter can be directly used for the page. * For example, this.data1 (data1 is the key value of the params used for page navigation.) + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 8 */ params?: Object; } - /** - * @since 8 - */ - 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. - * @since 8 - */ - path?: string; - } - /** * @since 8 */ @@ -115,7 +105,7 @@ declare namespace router { * @param options Options. * @since 8 */ - function back(options: BackRouterOptions):void; + function back(options?: RouterOptions ):void; /** * Clears all historical pages and retains only the current page at the top of the stack. diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 8932f4c6bb6c5fe5c1b9e79683ed37e5eee0ebed..be1fea91ce77caa670504e93cbfe96ec96586e4f 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -33,7 +33,7 @@ declare namespace rpc { * {@link Sequenceable}, and SequenceableArray. * * @since 7 - * @sysCap SystemCapability.Communication.IPC.Core + * @syscap SystemCapability.Communication.IPC.Core * @import import rpc from '@ohos.rpc' */ class MessageParcel { @@ -645,7 +645,7 @@ declare namespace rpc { * @param sequenceableArray Sequenceable array to read. * @since 8 */ - readSequenceableArray(sequenceableArray Sequenceable[]): void; + readSequenceableArray(sequenceableArray: Sequenceable[]): void; /** * Reads the specified {@link IRemoteObject} array from this {@link MessageParcel} object. @@ -657,7 +657,6 @@ declare namespace rpc { /** * Reads {@link IRemoteObject} objects from this {@link MessageParcel} object. * @return An array of {@link IRemoteObject} objects obtained. - * @device phone, tablet, tv, wearable, car * @since 8 */ readRemoteObjectArray(): IRemoteObject[]; @@ -665,7 +664,6 @@ declare namespace rpc { /** * Closes the specified file descriptor. * @param fd File descriptor to be closed. - * @device phone, tablet, tv, wearable, car * @since 8 */ static closeFileDescriptor(fd: number): void; @@ -674,7 +672,6 @@ declare namespace rpc { * Duplicates the specified file descriptor. * @param fd File descriptor to be duplicated. * @return A duplicated file descriptor. - * @device phone, tablet, tv, wearable, car * @since 8 */ static dupFileDescriptor(fd: number) :number; @@ -683,7 +680,6 @@ declare namespace rpc { * Checks whether this {@link MessageParcel} object contains a file descriptor. * @return Returns true if the {@link MessageParcel} object contains a file descriptor; * returns false otherwise. - * @device phone, tablet, tv, wearable, car * @since 8 */ containFileDescriptors(): boolean; @@ -692,7 +688,6 @@ declare namespace rpc { * Writes a file descriptor to this {@link MessageParcel} object. * @param fd File descriptor to wrote. * @return Returns true if the operation is successful; returns false otherwise. - * @device phone, tablet, tv, wearable, car * @since 8 */ writeFileDescriptor(fd: number): boolean; @@ -700,7 +695,6 @@ declare namespace rpc { /** * Reads a file descriptor from this {@link MessageParcel} object. * @return File descriptor obtained. - * @device phone, tablet, tv, wearable, car * @since 8 */ readFileDescriptor(): number; @@ -709,7 +703,6 @@ declare namespace rpc { * Writes an anonymous shared memory object to this {@link MessageParcel} object. * @param ashmem Anonymous shared memory object to wrote. * @return Returns true if the operation is successful; returns false otherwise. - * @device phone, tablet, tv, wearable, car * @since 8 */ writeAshmem(ashmem: Ashmem): boolean; @@ -717,7 +710,6 @@ declare namespace rpc { /** * Reads the anonymous shared memory object from this {@link MessageParcel} object. * @return Anonymous share object obtained. - * @device phone, tablet, tv, wearable, car * @since 8 */ readAshmem(): Ashmem; @@ -725,7 +717,6 @@ declare namespace rpc { /** * Obtains the maximum amount of raw data that can be sent in a time. * @return 128 MB. - * @device phone, tablet, tv, wearable, car * @since 8 */ getRawDataCapacity(): number; @@ -735,7 +726,6 @@ declare namespace rpc { * @param rawData Raw data to wrote. * @param size Size of the raw data, in bytes. * @return Returns true if the operation is successful; returns false otherwise. - * @device phone, tablet, tv, wearable, car * @since 8 */ writeRawData(rawData: number[], size: number): boolean; @@ -744,12 +734,17 @@ declare namespace rpc { * Reads raw data from this {@link MessageParcel} object. * @param size Size of the raw data to read. * @return Raw data obtained, in bytes. - * @device phone, tablet, tv, wearable, car * @since 8 */ readRawData(size: number): number[]; } + + /** + * @syscap SystemCapability.Communication.IPC.Core + * @import import rpc from '@ohos.rpc' + * @since 7 + */ interface Sequenceable { /** * Marshals this {@code Sequenceable} object into a {@link MessageParcel}. @@ -779,8 +774,9 @@ declare namespace rpc { *

SendRequestResult object contains four members, * namely error code of this operation, request code, data parcel * and reply parcel. - * @since 8 + * @syscap SystemCapability.Communication.IPC.Core * @import import rpc from '@ohos.rpc' + * @since 8 */ interface SendRequestResult { /** @@ -810,7 +806,12 @@ declare namespace rpc { reply: MessageParcel; } - interface IRemoteObject { + /** + * @syscap SystemCapability.Communication.IPC.Core + * @import import rpc from '@ohos.rpc' + * @since 7 + */ + abstract class IRemoteObject { /** * Queries the description of an interface. * @@ -918,6 +919,11 @@ declare namespace rpc { isObjectDead(): boolean; } + /** + * @syscap SystemCapability.Communication.IPC.Core + * @import import rpc from '@ohos.rpc' + * @since 7 + */ interface IRemoteBroker { /** * Obtains a proxy or remote object. This method must be implemented by its derived classes. @@ -929,6 +935,11 @@ declare namespace rpc { asObject(): IRemoteObject; } + /** + * @since 7 + * @syscap SystemCapability.Communication.IPC.Core + * @import import rpc from '@ohos.rpc' + */ interface DeathRecipient { /** * Called to perform subsequent operations when a death notification of the remote object is received. @@ -938,41 +949,62 @@ declare namespace rpc { onRemoteDied(): void; } + /** + * @syscap SystemCapability.Communication.IPC.Core + * @import import rpc from '@ohos.rpc' + * @since 7 + */ class MessageOption { /** * Indicates synchronous call. + * + * @constant + * @default 0 + * @since 7 */ - TF_SYNC = 0; + TF_SYNC: number; /** * Indicates asynchronous call. + * + * @constant + * @default 1 + * @since 7 */ - TF_ASYNC = 1; + TF_ASYNC: number; /** * Indicates the sendRequest API for returning the file descriptor. + * + * @constant + * @default 16 + * @since 7 */ - TF_ACCEPT_FDS = 0x10; + TF_ACCEPT_FDS: number; /** * Indicates the wait time for RPC, in seconds. It is NOT used in IPC case. + * + * @constant + * @default 4 + * @since 7 */ - TF_WAIT_TIME = 4; + TF_WAIT_TIME: number; /** * A constructor used to create a MessageOption instance. * * @param syncFlags Specifies whether the SendRequest is called synchronously (default) or asynchronously. * @param waitTime Maximum wait time for a RPC call. The default value is TF_WAIT_TIME. - * @since 8 + * @since 7 */ - constructor(syncFlags?: number, waitTime = TF_WAIT_TIME); + constructor(syncFlags?: number, waitTime?: number); /** * Obtains the SendRequest call flag, which can be synchronous or asynchronous. * * @return Returns whether the SendRequest is called synchronously or asynchronously. - * @since 8 + * @since 7 */ getFlags(): number; @@ -980,7 +1012,7 @@ declare namespace rpc { * Sets the SendRequest call flag, which can be synchronous or asynchronous. * * @param flags Indicates the call flag, which can be synchronous or asynchronous. - * @since 8 + * @since 7 */ setFlags(flags: number): void; @@ -988,7 +1020,7 @@ declare namespace rpc { * Obtains the maximum wait time for this RPC call. * * @return Returns maximum wait time obtained. - * @since 8 + * @since 7 */ getWaitTime(): number; @@ -996,17 +1028,22 @@ declare namespace rpc { * Sets the maximum wait time for this RPC call. * * @param waitTime Indicates maximum wait time to set. - * @since 8 + * @since 7 */ setWaitTime(waitTime: number): void; } - class RemoteObject implements IRemoteObject { + /** + * @syscap SystemCapability.Communication.IPC.Core + * @import import rpc from '@ohos.rpc' + * @since 7 + */ + class RemoteObject extends IRemoteObject { /** * A constructor to create a RemoteObject instance. * * @param descriptor Specifies interface descriptor. - * @since 8 + * @since 7 */ constructor(descriptor: string); @@ -1124,35 +1161,60 @@ declare namespace rpc { attachLocalInterface(localInterface: IRemoteBroker, descriptor: string): void; } + /** + * @syscap SystemCapability.Communication.IPC.Core + * @import import rpc from '@ohos.rpc' + * @since 7 + */ class RemoteProxy implements IRemoteObject { /** * Indicates the message code for a Ping operation. + * + * @constant + * @default 1599098439 + * @since 7 */ - PING_TRANSACTION = ('_' << 24) | ('P' << 16) | ('N' << 8) | 'G'; + PING_TRANSACTION: number; /** * Indicates the message code for a dump operation. + * + * @constant + * @default 1598311760 + * @since 7 */ - DUMP_TRANSACTION = ('_' << 24) | ('D' << 16) | ('M' << 8) | 'P'; + DUMP_TRANSACTION: number; /** * Indicates the message code for a transmission. + * + * @constant + * @default 1598968902 + * @since 7 */ - INTERFACE_TRANSACTION = ('_' << 24) | ('N' << 16) | ('T' << 8) | 'F'; + INTERFACE_TRANSACTION: number; /** * Indicates the minimum value of a valid message code. * *

This constant is used to check the validity of an operation. + * + * @constant + * @default 0x1 + * @since 7 */ - MIN_TRANSACTION_ID = 0x1; + MIN_TRANSACTION_ID: number; /** * Indicates the maximum value of a valid message code. * *

This constant is used to check the validity of an operation. + * + * @constant + * @default 0x00FFFFFF + * @since 7 */ - MAX_TRANSACTION_ID = 0x00FFFFFF; + MAX_TRANSACTION_ID: number; /** * Queries a local interface with a specified descriptor. @@ -1252,6 +1314,11 @@ declare namespace rpc { isObjectDead(): boolean; } + /** + * @syscap SystemCapability.Communication.IPC.Core + * @import import rpc from '@ohos.rpc' + * @since 7 + */ class IPCSkeleton { /** * Obtains a local {@link IRemoteObject} reference of a registered service. @@ -1372,32 +1439,46 @@ declare namespace rpc { * including creating, closing, mapping, and unmapping an Ashmem object, * reading data from and writing data to an Ashmem object, * obtaining the Ashmem size, and setting Ashmem protection. + * @syscap SystemCapability.Communication.IPC.Core + * @import import rpc from '@ohos.rpc' * @since 8 */ class Ashmem { /** * The mapped memory is executable. + * + * @constant + * @default 4 * @since 8 */ - PROT_EXEC = 4; + PROT_EXEC: number; /** * The mapped memory is inaccessible. + * + * @constant + * @default 0 * @since 8 */ - PROT_NONE = 0; + PROT_NONE: number; /** * The mapped memory is readable. + * + * @constant + * @default 1 * @since 8 */ - PROT_READ = 1; + PROT_READ: number; /** - * The mapped memory is writeable. + * The mapped memory is writable. + * + * @constant + * @default 2 * @since 8 */ - PROT_WRITE = 2; + PROT_WRITE: number; /** * Creates an Ashmem object with the specified name and size. @@ -1488,4 +1569,4 @@ declare namespace rpc { } } -export default rpc; +export default rpc; \ No newline at end of file diff --git a/api/@ohos.runninglock.d.ts b/api/@ohos.runningLock.d.ts similarity index 90% rename from api/@ohos.runninglock.d.ts rename to api/@ohos.runningLock.d.ts index ea56c90fc78c75abeae60b0e51e34b7c00693d27..d9365fbcf38354c149b12a47f207b70fa82fed55 100644 --- a/api/@ohos.runninglock.d.ts +++ b/api/@ohos.runningLock.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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 @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback} from './basic.d.ts'; +import {AsyncCallback} from './basic'; /** * Provides a mechanism to prevent the system from hibernating so that the applications can run in the background or @@ -24,16 +24,18 @@ import {AsyncCallback} from './basic.d.ts'; * lock duration times out, the lock is automatically released and the system hibernates if no other {@link * RunningLock} is set. * - * @sysCap SystemCapability.PowerManager.PowerManager.Core + * @syscap SystemCapability.PowerManager.PowerManager.Core * @since 7 */ declare namespace runningLock { class RunningLock { /** * Prevents the system from hibernating and sets the lock duration. + * This method requires the ohos.permission.RUNNING_LOCK permission. * * @param timeout Indicates the lock duration (ms). After the lock duration times out, the lock is automatically * released and the system hibernates if no other {@link RunningLock} is set. + * @permission ohos.permission.RUNNING_LOCK * @since 7 */ lock(timeout: number): void; @@ -48,8 +50,10 @@ declare namespace runningLock { /** * Release the {@link RunningLock} that prevents the system from hibernating. + * This method requires the ohos.permission.RUNNING_LOCK permission. * * @since 7 + * @permission ohos.permission.RUNNING_LOCK */ unlock(): void; } @@ -98,6 +102,7 @@ declare namespace runningLock { * a suffix. * @param type Indicates the {@link RunningLockType}. * @return Returns the {@link RunningLock} object. + * @permission ohos.permission.RUNNING_LOCK * @since 7 */ function createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback): void; diff --git a/api/@ohos.application.UriPermissionManager.d.ts b/api/@ohos.screenLock.d.ts similarity index 38% rename from api/@ohos.application.UriPermissionManager.d.ts rename to api/@ohos.screenLock.d.ts index f79c74100803bf19b1987cf5a266b915bff2f50b..af9878dfa017fb27035b1abe3c11eafaeb7d5ef2 100644 --- a/api/@ohos.application.UriPermissionManager.d.ts +++ b/api/@ohos.screenLock.d.ts @@ -1,6 +1,6 @@ /* * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), + * 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 * @@ -12,28 +12,44 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - import { AsyncCallback } from './basic'; -import wantConstant from "./@ohos.ability.wantConstant"; +import { Callback } from './basic'; /** - * The management class for uri of file. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A + * systemScreenLock + * @syscap SystemCapability.MiscServices.ScreenLock + * @since 7 */ -export default class UriPermissionManager { - /** - * Check whether the application corresponding to the accesstokenID has access rights to the URI. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param uri File URI. - * @param flag wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION or wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION - * @param accessTokenId Indicates the access token of the application. - * @return Returns 0 if the verification is successful, otherwise returns -1. - */ - verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number, callback: AsyncCallback): void; - verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number): Promise; +declare namespace screenLock { + + /** + * Checks whether the screen is currently locked. + * + * @return Returns {@code true} if the screen is currently locked; returns {@code false} + * otherwise. + * @since 7 + */ + function isScreenLocked(callback: AsyncCallback): void; + function isScreenLocked(): Promise; + + /** + * Checks whether the screen lock of the current device is secure. + * + * @return Returns {@code true} if the screen lock of the current device is secure; returns {@code false} + * otherwise. + * @since 7 + */ + function isSecureMode(callback: AsyncCallback): void; + function isSecureMode(): Promise; + + /** + * Unlocks the screen. + * return - + * @since 7 + */ + function unlockScreen(callback: AsyncCallback): void; + function unlockScreen():Promise; + } + +export default screenLock; \ No newline at end of file diff --git a/api/@ohos.screenshot.d.ts b/api/@ohos.screenshot.d.ts index 7fa60edc4b63b3d9c2a59f6eb8dec54bc2c750d0..0e91364d1ed5051f4bbfee3141599a61bb055b61 100644 --- a/api/@ohos.screenshot.d.ts +++ b/api/@ohos.screenshot.d.ts @@ -18,11 +18,19 @@ import image from './@ohos.multimedia.image'; /** * interface for screenshot - * @syscap SystemCapability.WindowManager.WindowManager.Core. + * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 7 */ declare namespace screenshot { + /** + * Takes a screenshot and saves it as a PixelMap object + * @param options Screenshot options, which consist of screenRect, imageSize, and rotation. You need to set these parameters + * @permission ohos.permission.CAPTURE_SCREEN + * @since 7 + */ + function save(options?: ScreenshotOptions, callback: AsyncCallback): void; + /** * Takes a screenshot and saves it as a PixelMap object * @param options Screenshot options, which consist of screenRect, imageSize, and rotation. You need to set these parameters diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index 4e31ac7dd237af06e5de868103c7be289e6424ff..5175b35a69808711a01288111e18a0a92beda59c 100755 --- a/api/@ohos.security.huks.d.ts +++ b/api/@ohos.security.huks.d.ts @@ -133,22 +133,46 @@ declare namespace huks { */ function getSdkVersion(options: HuksOptions) : string; + /** + * Interface of huks param. + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export interface HuksParam { tag: HuksTag; value: boolean | number | bigint | Uint8Array; } + /** + * Interface of huks handle. + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export interface HuksHandle { errorCode: number; handle: number; token?: Uint8Array; } + /** + * Interface of huks option. + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export interface HuksOptions { properties?: Array; inData?: Uint8Array; } + /** + * Interface of huks result. + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export interface HuksResult { errorCode: number; outData?: Uint8Array; @@ -156,6 +180,12 @@ declare namespace huks { certChains?: Array; } + /** + * @name HuksErrorCode + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export enum HuksErrorCode { HUKS_SUCCESS = 0, HUKS_FAILURE = -1, @@ -228,6 +258,12 @@ declare namespace huks { HUKS_ERROR_UNKNOWN_ERROR = -1000, } + /** + * @name HuksKeyPurpose + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export enum HuksKeyPurpose { HUKS_KEY_PURPOSE_ENCRYPT = 1, /* Usable with RSA, EC and AES keys. */ HUKS_KEY_PURPOSE_DECRYPT = 2, /* Usable with RSA, EC and AES keys. */ @@ -240,6 +276,12 @@ declare namespace huks { HUKS_KEY_PURPOSE_AGREE = 256, /* Usable with agree. */ } + /** + * @name HuksKeyDigest + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export enum HuksKeyDigest { HUKS_DIGEST_NONE = 0, HUKS_DIGEST_MD5 = 1, @@ -250,6 +292,12 @@ declare namespace huks { HUKS_DIGEST_SHA512 = 14, } + /** + * @name HuksKeyPadding + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export enum HuksKeyPadding { HUKS_PADDING_NONE = 0, HUKS_PADDING_OAEP = 1, @@ -259,6 +307,12 @@ declare namespace huks { HUKS_PADDING_PKCS7 = 5, } + /** + * @name HuksCipherMode + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export enum HuksCipherMode { HUKS_MODE_ECB = 1, HUKS_MODE_CBC = 2, @@ -268,6 +322,12 @@ declare namespace huks { HUKS_MODE_GCM = 32, } + /** + * @name HuksKeySize + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export enum HuksKeySize { HUKS_RSA_KEY_SIZE_512 = 512, HUKS_RSA_KEY_SIZE_768 = 768, @@ -293,6 +353,12 @@ declare namespace huks { HUKS_DH_KEY_SIZE_4096 = 4096, } + /** + * @name HuksKeyAlg + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export enum HuksKeyAlg { HUKS_ALG_RSA = 1, HUKS_ALG_ECC = 2, @@ -309,12 +375,24 @@ declare namespace huks { HUKS_ALG_DH = 103, } + /** + * @name HuksKeyGenerateType + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export enum HuksKeyGenerateType { HUKS_KEY_GENERATE_TYPE_DEFAULT = 0, HUKS_KEY_GENERATE_TYPE_DERIVE = 1, HUKS_KEY_GENERATE_TYPE_AGREE = 2, } + /** + * @name HuksKeyFlag + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export enum HuksKeyFlag { HUKS_KEY_FLAG_IMPORT_KEY = 1, HUKS_KEY_FLAG_GENERATE_KEY = 2, @@ -322,17 +400,35 @@ declare namespace huks { HUKS_KEY_FLAG_DERIVE_KEY = 4, } + /** + * @name HuksKeyStorageType + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export enum HuksKeyStorageType { HUKS_STORAGE_TEMP = 0, HUKS_STORAGE_PERSISTENT = 1, } + /** + * @name HuksSendType + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export enum HuksSendType { HUKS_SEND_TYPE_ASYNC = 0, HUKS_SEND_TYPE_SYNC = 1, } - declare enum HuksTagType { + /** + * @name HuksTagType + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ + export enum HuksTagType { HUKS_TAG_TYPE_INVALID = 0 << 28, HUKS_TAG_TYPE_INT = 1 << 28, HUKS_TAG_TYPE_UINT = 2 << 28, @@ -341,6 +437,12 @@ declare namespace huks { HUKS_TAG_TYPE_BYTES = 5 << 28, } + /** + * @name HuksTag + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ export enum HuksTag { /* Invalid TAG */ HUKS_TAG_INVALID = HuksTagType.HUKS_TAG_TYPE_INVALID | 0, diff --git a/api/@ohos.sensor.d.ts b/api/@ohos.sensor.d.ts old mode 100755 new mode 100644 index 231c236f6b769c3d5c54007416f3c3e0297858d7..82fb268afc3a436b024b9ffd3af8be2c9c93512e --- a/api/@ohos.sensor.d.ts +++ b/api/@ohos.sensor.d.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback, Callback } from "./basic"; /** * This module provides the capability to subscribe to sensor data. @@ -32,7 +32,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback, options?: Options): void; /** @@ -43,7 +43,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback: Callback, options?: Options): void; /** @@ -54,7 +54,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback, options?: Options): void; /** @@ -65,7 +65,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback: Callback, options?: Options): void; /** @@ -76,7 +76,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback, options?: Options): void; /** @@ -87,7 +87,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback, options?: Options): void; /** @@ -95,10 +95,10 @@ declare namespace sensor { * @param type Indicate the sensor type to listen for, {@code SensorType.SENSOR_TYPE_ID_GYROSCOPE}. * @param options Optional parameters specifying the interval at which sensor data is reported, {@code Options}. * @syscap SystemCapability.Sensors.Sensor - * @permission ohos.permission.GRYOSCOPE + * @permission ohos.permission.GYROSCOPE * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback, options?: Options): void; /** @@ -106,10 +106,10 @@ declare namespace sensor { * @param type Indicate the sensor type to listen for, {@code SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED}. * @param options Optional parameters specifying the interval at which sensor data is reported, {@code Options}. * @syscap SystemCapability.Sensors.Sensor - * @permission ohos.permission.GRYOSCOPE + * @permission ohos.permission.GYROSCOPE * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback: Callback, options?: Options): void; /** @@ -120,7 +120,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_HALL, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_HALL, callback: Callback, options?: Options): void; /** @@ -128,10 +128,10 @@ declare namespace sensor { * @param type Indicate the sensor type to listen for, {@code SensorType.SENSOR_TYPE_ID_HEART_RATE}. * @param options Optional parameters specifying the interval at which sensor data is reported, {@code Options}. * @syscap SystemCapability.Sensors.Sensor - * @permission ohos.permission.HEALTH_DATA + * @permission ohos.permission.READ_HEALTH_DATA * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback, options?: Options): void; /** @@ -142,7 +142,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback, options?: Options): void; /** @@ -153,7 +153,7 @@ declare namespace sensor { * @permission ohos.permission.ACCELEROMETER * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback: Callback, options?: Options): void; /** @@ -164,7 +164,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback, options?: Options): void; /** @@ -175,7 +175,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback: Callback, options?: Options): void; /** @@ -186,7 +186,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback, options?: Options): void; /** @@ -197,7 +197,7 @@ declare namespace sensor { * @permission ohos.permission.ACTIVITY_MOTION * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback, options?: Options): void; /** @@ -208,7 +208,7 @@ declare namespace sensor { * @permission ohos.permission.ACTIVITY_MOTION * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: Callback, options?: Options): void; /** @@ -219,7 +219,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback, options?: Options): void; /** @@ -230,7 +230,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback, options?: Options): void; /** @@ -241,7 +241,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: Callback, options?: Options): void; /** @@ -252,7 +252,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function on(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: AsyncCallback, + function on(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback, options?: Options): void; /** @@ -262,7 +262,7 @@ declare namespace sensor { * @permission ohos.permission.ACCELEROMETER * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback): void; /** * Subscribe to sensor data once. @@ -271,7 +271,7 @@ declare namespace sensor { * @permission ohos.permission.ACCELEROMETER * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback: Callback): void; /** * Subscribe to sensor data once. @@ -280,7 +280,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback): void; /** * Subscribe to sensor data once. @@ -289,7 +289,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback: Callback): void; /** * Subscribe to sensor data once. @@ -298,7 +298,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback): void; /** * Subscribe to sensor data once. @@ -307,7 +307,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback): void; /** * Subscribe to sensor data once. @@ -316,7 +316,7 @@ declare namespace sensor { * @permission ohos.permission.GYROSCOPE * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback): void; /** * Subscribe to sensor data once. @@ -325,7 +325,7 @@ declare namespace sensor { * @permission ohos.permission.GYROSCOPE * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback: Callback): void; /** * Subscribe to sensor data once. @@ -334,16 +334,16 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_HALL, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_HALL, callback: Callback): void; /** * Subscribe to sensor data once. * @param type Indicate the sensor type to listen for, {@code SensorType.SENSOR_TYPE_ID_HEART_RATE}. * @syscap SystemCapability.Sensors.Sensor - * @permission ohos.permission.HEART_RATE + * @permission ohos.permission.READ_HEALTH_DATA * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback): void; /** * Subscribe to sensor data once. @@ -352,7 +352,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback): void; /** * Subscribe to sensor data once. @@ -361,7 +361,7 @@ declare namespace sensor { * @permission ohos.permission.ACCELERATION * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback: Callback): void; /** * Subscribe to sensor data once. @@ -370,7 +370,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback): void; /** * Subscribe to sensor data once. @@ -379,7 +379,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback: Callback): void; /** * Subscribe to sensor data once. @@ -388,7 +388,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback): void; /** * Subscribe to sensor data once. @@ -397,7 +397,7 @@ declare namespace sensor { * @permission ohos.permission.ACTIVITY_MOTION * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback): void; /** * Subscribe to sensor data once. @@ -406,7 +406,7 @@ declare namespace sensor { * @permission ohos.permission.ACTIVITY_MOTION * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: Callback): void; /** * Subscribe to sensor data once. @@ -415,7 +415,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback): void; /** * Subscribe to sensor data once. @@ -424,7 +424,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback): void; /** * Subscribe to sensor data once. @@ -433,7 +433,7 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: Callback): void; /** * Subscribe to sensor data once. @@ -442,16 +442,197 @@ declare namespace sensor { * @permission N/A * @since 8 */ - function once(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: AsyncCallback): void; + function once(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_ACCELEROMETER}. + * @permission ohos.permission.ACCELEROMETER + * @syscap SystemCapability.Sensors.Sensor + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED}. + * @permission ohos.permission.ACCELEROMETER + * @syscap SystemCapability.Sensors.Sensor + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, + callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT}. + * @syscap SystemCapability.Sensors.Sensor + * @permission N/A + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE}. + * @syscap SystemCapability.Sensors.Sensor + * @permission N/A + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_BAROMETER}. + * @syscap SystemCapability.Sensors.Sensor + * @permission N/A + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_GRAVITY}. + * @syscap SystemCapability.Sensors.Sensor + * @permission N/A + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_GYROSCOPE}. + * @syscap SystemCapability.Sensors.Sensor + * @permission ohos.permission.GYROSCOPE + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED}. + * @syscap SystemCapability.Sensors.Sensor + * @permission ohos.permission.GYROSCOPE + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_HALL}. + * @syscap SystemCapability.Sensors.Sensor + * @permission N/A + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_HALL, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_HEART_RATE}. + * @syscap SystemCapability.Sensors.Sensor + * @permission ohos.permission.READ_HEALTH_DATA + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_HUMIDITY}. + * @syscap SystemCapability.Sensors.Sensor + * @permission N/A + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION}. + * @syscap SystemCapability.Sensors.Sensor + * @permission ohos.permission.ACCELEROMETER + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD}. + * @syscap SystemCapability.Sensors.Sensor + * @permission N/A + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED}. + * @syscap SystemCapability.Sensors.Sensor + * @permission N/A + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_ORIENTATION}. + * @syscap SystemCapability.Sensors.Sensor + * @permission N/A + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_PEDOMETER}. + * @syscap SystemCapability.Sensors.Sensor + * @permission ohos.permission.ACTIVITY_MOTION + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION}. + * @syscap SystemCapability.Sensors.Sensor + * @permission ohos.permission.ACTIVITY_MOTION + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_PROXIMITY}. + * @syscap SystemCapability.Sensors.Sensor + * @permission N/A + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR}. + * @syscap SystemCapability.Sensors.Sensor + * @permission N/A + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback?: Callback): void; + + /** + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION}. + * @syscap SystemCapability.Sensors.Sensor + * @permission N/A + * @since 8 + */ + function off(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback?: Callback): void; /** - * Unsubscribe to sensor data once. - * @param type Indicate the sensor type to listen for, {@code SensorType}. + * Unsubscribe to sensor data. + * @param type Indicate the sensor type to unsubscribe, {@code SensorType.SENSOR_TYPE_ID_WEAR_DETECTION}. * @syscap SystemCapability.Sensors.Sensor * @permission N/A * @since 8 */ - function off(type: SensorType, callback: AsyncCallback): void; + function off(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback?: Callback): void; /** * Indicates geographic location. @@ -713,9 +894,9 @@ declare namespace sensor { * @since 8 */ interface OrientationResponse extends Response { - x: number; /**< Orientation x-axis component */ - y: number; /**< Orientation y-axis component */ - z: number; /**< Orientation z-axis component */ + alpha: number; /**< The device rotates at an angle around the Z axis */ + beta: number; /**< The device rotates at an angle around the X axis */ + gamma: number; /**< The device rotates at an angle around the Y axis */ } /** diff --git a/api/@ohos.settings.d.ts b/api/@ohos.settings.d.ts index 90c9e382fcc038a3bf58c2ea8118ee026aa19381..32bda97b14e3b67e52cc935befa43c98b1e44028 100644 --- a/api/@ohos.settings.d.ts +++ b/api/@ohos.settings.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2022 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 @@ -12,47 +12,853 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { AsyncCallback } from './basic'; import { DataAbilityHelper } from './ability/dataAbilityHelper'; /** * This module provides settings data access abilities. * - * @since 8 - * @devices phone, tablet, tv, wearable, car + * @since 7 + * @syscap SystemCapability.Applications.settings.Core * @import import settings from '@ohos.settings' * @permission N/A */ declare namespace settings { + /** + * Provides methods for setting time and date formats. + * + * @since 7 + */ + namespace date { + /** + * Indicates the date format. + * + *

The formats {@code mm/dd/yyyy}, {@code dd/mm/yyyy}, and {@code yyyy/mm/dd} are available. + * + * @since 7 + */ + const DATE_FORMAT: string + + /** + * Specifies whether the time is displayed in 12-hour or 24-hour format. + * + *

If the value is {@code 12}, the 12-hour format is used. If the value is {@code 24}, the 24-hour format + * is used. + * + * @since 7 + */ + const TIME_FORMAT: string + + /** + * Specifies whether the date, time, and time zone are automatically obtained from the Network + * Identity and Time Zone (NITZ). + * + *

If the value is {@code true}, the information is automatically obtained from NITZ. + * If the value is {@code false}, the information is not obtained from NITZ. + * + * @since 7 + */ + const AUTO_GAIN_TIME: string + + /** + * Specifies whether the time zone is automatically obtained from NITZ. + * + *

If the value is {@code true}, the information is automatically obtained from NITZ. If the value + * is {@code false}, the information is not obtained from NITZ. + * + * @since 7 + */ + const AUTO_GAIN_TIME_ZONE: string + } + + /** + * Provides methods for setting the display effect, including the font size, screen brightness, screen rotation, + * animation factor, and display color. + * + * @since 7 + */ + namespace display { + /** + * Indicates the scaling factor of fonts, which is a float number. + * + * @since 7 + */ + const FONT_SCALE: string + + /** + * Indicates the screen brightness. The value ranges from 0 to 255. + * + * @since 7 + */ + const SCREEN_BRIGHTNESS_STATUS: string + + /** + * Specifies whether automatic screen brightness adjustment is enabled. + * + *

If the value is {@code 1}, automatic adjustment is enabled. If the value is {@code 0}, automatic + * adjustment is disabled. + * + * @since 7 + */ + const AUTO_SCREEN_BRIGHTNESS: string + + /** + * Indicates the value of {@code AUTO_SCREEN_BRIGHTNESS} when automatic screen brightness adjustment is used. + * + * @since 7 + */ + const AUTO_SCREEN_BRIGHTNESS_MODE: number + + /** + * Indicates the value of {@code AUTO_SCREEN_BRIGHTNESS} when manual screen brightness adjustment is used. + * + * @since 7 + */ + const MANUAL_SCREEN_BRIGHTNESS_MODE: number + + /** + * Indicates the duration that the device waits before going to sleep after a period of inactivity, in + * milliseconds. + * + * @since 7 + */ + const SCREEN_OFF_TIMEOUT: string + + /** + * Indicates the screen rotation when no other policy is available. + * + *

This constant is invalid when auto-rotation is enabled. When auto-rotation is disabled, the following + * values are available: + * + *

    + *
  • {@code 0} - The screen rotates 0 degrees. + *
  • {@code 1} - The screen rotates 90 degrees. + *
  • {@code 2} - The screen rotates 180 degrees. + *
  • {@code 3} - The screen rotates 270 degrees. + *
+ * + * @since 7 + */ + const DEFAULT_SCREEN_ROTATION: string + + /** + * Indicates the scaling factor for the animation duration. + * + *

This affects the start delay and duration of all such animations. If the value is {@code 0}, + * the animation ends immediately. The default value is {@code 1}. + * + * @since 7 + */ + const ANIMATOR_DURATION_SCALE: string + + /** + * Indicates the scaling factor for transition animations. + * If the value is {@code 0}, transition animations are disabled. + * + * @since 7 + */ + const TRANSITION_ANIMATION_SCALE: string + + /** + * Indicates the scaling factor for normal window animations. + * If the value is {@code 0}, window animations are disabled. + * + * @since 7 + */ + const WINDOW_ANIMATION_SCALE: string + + /** + * Specifies whether display color inversion is enabled. + * + *

If the value is {@code 1}, display color inversion is enabled. If the value is {@code 0}, display color + * inversion is disabled. + * + * @since 7 + */ + const DISPLAY_INVERSION_STATUS: string + } + + /** + * Provides methods for setting general information about devices, including the device name, startup wizard, + * airplane mode, debugging information, accessibility feature switch, and touch exploration status. + * + * @since 7 + */ + namespace general { + /** + * Specifies whether the startup wizard has been run. + * + *

If the value is {@code 0}, the startup wizard has not been run. If the value is not {@code 0}, the startup + * wizard has been run. + * + * @since 7 + */ + const SETUP_WIZARD_FINISHED: string + + /** + * Specifies what happens after the user presses the call end button if the user is not in a call. + * + *

    + *
  • {@code 0} - Nothing happens. + *
  • {@code 1} - The home screen is displayed. + *
  • {@code 2} - The device enters the sleep state and the screen is locked. + *
  • {@code 3} - The home screen is displayed. If the user is already on the home screen, the device enters + * the sleep state. + *
+ * + * @since 7 + */ + const END_BUTTON_ACTION: string + + /** + * Specifies whether the accelerometer is used to change screen orientation, that is, whether auto-rotation is + * enabled. + * + *

The value {@code 1} indicates that the accelerometer is enabled by default, and {@code 0} indicates that + * the accelerometer is disabled by default. + * + * @since 7 + */ + const ACCELEROMETER_ROTATION_STATUS: string + + /** + * Specifies whether airplane mode is enabled. + * + *

If the value is {@code 1}, airplane mode is enabled. If the value is {@code 0}, airplane mode is disabled. + * + * @since 7 + */ + const AIRPLANE_MODE_STATUS: string + + /** + * Specifies whether the device is provisioned. + * + *

On a multi-user device with a single system user, the screen may be locked when the value is {@code true}. + * In addition, other abilities cannot be started on the system user unless they are marked to display over + * the screen lock. + * + * @since 7 + */ + const DEVICE_PROVISION_STATUS: string + + /** + * Specifies whether the hard disk controller (HDC) on USB devices is enabled. + * + *

If the value is {@code true}, the HDC is enabled. If the value is {@code false}, the HDC is disabled. + * + * @since 7 + */ + const HDC_STATUS: string + + /** + * Indicates the number of boot operations after the device is powered on. + * + * @since 7 + */ + const BOOT_COUNTING: string + + /** + * Specifies whether contact metadata synchronization is enabled. + * + *

If the value is {@code true}, synchronization is enabled. If the value is {@code false}, + * synchronization is disabled. + * + * @since 7 + */ + const CONTACT_METADATA_SYNC_STATUS: string + + /** + * Specifies whether developer options are enabled. + * + *

If the value is {@code true}, developer options are enabled. + * If the value is {@code false}, developer options are disabled. + * + * @since 7 + */ + const DEVELOPMENT_SETTINGS_STATUS: string + + /** + * Indicates the device name. + * + * @since 7 + */ + const DEVICE_NAME: string + + /** + * Specifies whether USB mass storage is enabled. + * + *

If the value is {@code true}, USB mass storage is enabled. + * If the value is {@code false}, USB mass storage is disabled. + * + * @since 7 + */ + const USB_STORAGE_STATUS: string + + /** + * Specifies whether the device waits for the debugger when starting an application to debug. + * + *

If the value is {@code 1}, the device waits for the debugger. + * If the value is {@code 0}, the system does not wait for the debugger, and so the application runs normally. + * + * @since 7 + */ + const DEBUGGER_WAITING: string + + /** + * Indicates the bundle name of the application to debug. + * + * @since 7 + */ + const DEBUG_APP_PACKAGE: string + + /** + * Specifies whether any accessibility feature is enabled. + * + *

If the value is {@code 1}, the accessibility feature is enabled. If the value is {@code 0}, the + * accessibility feature is disabled. + * + * @since 7 + */ + const ACCESSIBILITY_STATUS: string + + /** + * Indicates the list of accessibility features that have been activated. + * + * @since 7 + */ + const ACTIVATED_ACCESSIBILITY_SERVICES: string + + /** + * Indicates the default geographical location that can be used by the browser. Multiple geographical locations + * are separated by spaces. + * + * @since 7 + */ + const GEOLOCATION_ORIGINS_ALLOWED: string + + /** + * Specifies whether an application should attempt to skip all introductory hints at the first startup. This is + * intended for temporary users or users who are familiar with the environment. + * + *

If the value is {@code 1}, the application attempts to skip all introductory hints at the first startup. + * If the value is {@code 0}, the application does not skip introductory hints at the first startup. + * + * @since 7 + */ + const SKIP_USE_HINTS: string + + /** + * Indicates whether touch exploration is enabled. + * + *

If the value is {@code 1}, touch exploration is enabled. If the value is {@code 0}, touch exploration is + * disabled. + * + * @since 7 + */ + const TOUCH_EXPLORATION_STATUS: string + } + + /** + * Provides methods for setting information about input methods, including automatic capitalization, automatic + * punctuation, autocorrect, password presentation, input method engine, and input method subtypes. + * + * @since 7 + */ + namespace input { + /** + * Indicates the default input method and its ID. + * + * @since 7 + */ + const DEFAULT_INPUT_METHOD: string + + /** + * Indicates the default input method keyboard type and its ID. + * + * @since 7 + */ + const ACTIVATED_INPUT_METHOD_SUB_MODE: string + + /** + * Indicates the list of input methods that have been activated. + * + *

The list is a string that contains the IDs of activated input methods. The IDs are separated by colons + * (:), and keyboardTypes of an input method are separated by semicolons (;). An example format is + * {@code ima0:keyboardType0;keyboardType1;ima1:ima2:keyboardTypes0}. The type of imaID is ElementName, + * and the type of keyboard is int. + * + * @since 7 + */ + const ACTIVATED_INPUT_METHODS: string + + /** + * Specifies whether the input method selector is visible. + * + *

If the value is {@code 1}, the input method selector is visible. If the value is {@code 0}, the input + * method selector is invisible. + * + * @since 7 + */ + const SELECTOR_VISIBILITY_FOR_INPUT_METHOD: string + + /** + * Specifies whether automatic capitalization is enabled for the text editor. + * + *

If the value is {@code 0}, automatic capitalization is disabled. If the value {@code 1}, automatic + * capitalization is enabled. + * + * @since 7 + */ + const AUTO_CAPS_TEXT_INPUT: string + + /** + * Specifies whether automatic punctuation is enabled for the text editor. Automatic punctuation enables the + * text editor to convert two spaces into a period (.) and a space. + * + *

If the value is {@code 0}, automatic punctuation is disabled. If the value {@code 1}, automatic + * punctuation is enabled. + * + * @since 7 + */ + const AUTO_PUNCTUATE_TEXT_INPUT: string + + /** + * Specifies whether autocorrect is enabled for the text editor. Autocorrect enables the text editor to correct + * typos. + * + *

If the value is {@code 0}, autocorrect is disabled. If the value {@code 1}, autocorrect is enabled. + * + * @since 7 + */ + const AUTO_REPLACE_TEXT_INPUT: string + + /** + * Specifies whether password presentation is enabled in the text editor. Password presentation enables the + * text editor to show password characters when the user types them. + * + *

If the value is {@code 0}, password presentation is disabled. If the value {@code 1}, password + * presentation is enabled. + * + * @since 7 + */ + const SHOW_PASSWORD_TEXT_INPUT: string + } + + /** + * Provides methods for setting network information, including the data roaming status, HTTP proxy configurations, + * and preferred networks. + * + * @since 7 + */ + namespace network { + /** + * Specifies whether data roaming is enabled. + * + *

If the value is {@code true}, data roaming is enabled. If the value is {@code false}, + * data roaming is disabled. + * + * @since 7 + */ + const DATA_ROAMING_STATUS: string + + /** + * Indicates the host name and port number of the global HTTP proxy. + * The host name and port number are separated by a colon (:). + * + * @since 7 + */ + const HTTP_PROXY_CFG: string + + /** + * Indicates the user preferences of the network to use. + * + * @since 7 + */ + const NETWORK_PREFERENCE_USAGE: string + } + + /** + * Provides methods for setting the answering mode of incoming and outgoing calls. + * + * @since 7 + */ + namespace phone { + /** + * Specifies whether real-time text (RTT) calling is enabled. If enabled, incoming and outgoing calls are + * answered as RTT calls when supported by the device and carrier. If the value is {@code 1}, RTT calling is + * enabled. If the value is {@code 0}, RTT calling is disabled. + * + * @since 7 + */ + const RTT_CALLING_STATUS: string + } + + /** + * Provides methods for setting the sound effect, including the ringtone, dial tone, alarm sound, notification tone, + * and haptic feedback. + * + * @since 7 + */ + namespace sound { + /** + * Indicates whether the device vibrates when it is ringing for an incoming call. + * + *

This constant will be used by Phone and Settings applications. The value is of the boolean type. + * This constant affects only the scenario where the device rings for an incoming call. It does not affect + * any other application or scenario. + * + * @since 7 + */ + const VIBRATE_WHILE_RINGING: string + + /** + * Indicates the storage area of the system default alarm. + * + *

You can obtain the URI of the system default alarm. + * + * @since 7 + */ + const DEFAULT_ALARM_ALERT: string + + /** + * Indicates the type of the dual-tone multifrequency (DTMF) tone played when dialing. + * + *

The value {@code 0} indicates the normal short sound effect, and {@code 1} indicates the long sound + * effect. + * + * @since 7 + */ + const DTMF_TONE_TYPE_WHILE_DIALING: string + + /** + * Specifies whether the DTMF tone is played when dialing. + * + *

If the value is {@code 1}, the DTMF tone is played. If the value is {@code 0}, the DTMF tone is not + * played. + * + * @since 7 + */ + const DTMF_TONE_WHILE_DIALING: string + + /** + * Specifies which audio streams are affected by changes on the ringing mode and Do Not Disturb (DND) mode. + * + *

If you want a specific audio stream to be affected by changes of the ringing mode and DDN mode, set the + * corresponding bit to {@code 1}. + * + * @since 7 + */ + const AFFECTED_MODE_RINGER_STREAMS: string + + /** + * Specifies which audio streams are affected by the mute mode. + * + *

If you want a specific audio stream to remain muted in mute mode, set the corresponding bit to {@code 1}. + * + * @since 7 + */ + const AFFECTED_MUTE_STREAMS: string + + /** + * Indicates the storage area of the system default notification tone. + * + *

You can obtain the URI of the system default notification tone. + * + * @since 7 + */ + const DEFAULT_NOTIFICATION_SOUND: string + + /** + * Indicates the storage area of the system default ringtone. + * + *

You can obtain the URI of the system default ringtone. + * + * @since 7 + */ + const DEFAULT_RINGTONE: string + + /** + * Specifies whether the sound effects are enabled. + * + *

If the value is {@code 0}, the sound effects are disabled. If the value is {@code 1}, the sound effects + * are enabled. + * + * @since 7 + */ + const SOUND_EFFECTS_STATUS: string + + /** + * Specifies whether the device vibrates for an event. This parameter is used inside the system. + * + *

If the value is {@code 1}, the device vibrates for an event. If the value is {@code 0}, the device does + * not vibrate for an event. + * + * @since 7 + */ + const VIBRATE_STATUS: string + + /** + * Indicates whether the device enables haptic feedback. + * + *

The value is of the boolean type. + * + * @since 7 + */ + const HAPTIC_FEEDBACK_STATUS: string + } + + /** + * Provides methods for setting information about text-to-speech (TTS) conversion, including the pitch, speech rate, + * engine, and plug-ins. + * + * @since 7 + */ + namespace TTS { + /** + * Indicates the default pitch of the text-to-speech (TTS) engine. + * + *

100 = 1x. If the value is set to {@code 200}, the frequency is twice the normal sound frequency. + * + * @since 7 + */ + const DEFAULT_TTS_PITCH: string + + /** + * Indicates the default speech rate of the TTS engine. 100 = 1x. + * + * @since 7 + */ + const DEFAULT_TTS_RATE: string + + /** + * Indicates the default TTS engine. + * + * @since 7 + */ + const DEFAULT_TTS_SYNTH: string + + /** + * Indicates the list of activated plug-in packages used for TTS. Multiple plug-in packages are separated by + * spaces. + * + * @since 7 + */ + const ENABLED_TTS_PLUGINS: string + } + + /** + * Provides methods for setting radio network information, including information about Bluetooth, Wi-Fi, Near Field + * Communication (NFC), and the airplane mode. + * + * @since 7 + */ + namespace wireless { + /** + * Specifies whether the device can be discovered or connected by other devices through Bluetooth. + * + * If the value is {@code 0}, the device cannot be connected or discovered. If the value is {@code 1}, the + * device can be connected but cannot be discovered. If the value is {@code 2}, the device can be connected + * and discovered. + * + * @since 7 + */ + const BLUETOOTH_DISCOVER_ABILITY_STATUS: string + + /** + * Indicates the duration (in seconds) that the device can be discovered through Bluetooth. + * + *

After the duration expires, the device cannot be discovered through Bluetooth. + * + * @since 7 + */ + const BLUETOOTH_DISCOVER_TIMEOUT: string + + /** + * Indicates the list of radio signals to be disabled when airplane mode is enabled. Multiple radio + * signals are separated by commas (,). + * + *

    + *
  • {@code BLUETOOTH_RADIO} - Bluetooth is disabled in airplane mode. + *
  • {@code CELL_RADIO} - Cellular radio is disabled in airplane mode. + *
  • {@code NFC_RADIO} - NFC is disabled in airplane mode. + *
  • {@code WIFI_RADIO} - Wi-Fi is disabled in airplane mode. + *
+ * + * @since 7 + */ + const AIRPLANE_MODE_RADIOS: string /** - * get settingsdata uri - * @since 8 - * @param name uri parameter - * @return settingsdata uri + * Specifies whether Bluetooth is enabled. + * + *

If the value is {@code true}, Bluetooth is enabled. If the value is {@code false}, Bluetooth is disabled. + * + * @since 7 */ - function getUri(name: string): string; + const BLUETOOTH_STATUS: string /** - * get value from settingsdata - * @since 8 - * @param dataAbilityHelper dataAbilityHelper instance - * @param name name - * @param defValue default value - * @return settingsdata value + * A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that Bluetooth is disabled in airplane mode. + * + * @since 7 */ - function getValue(dataAbilityHelper: DataAbilityHelper, name: string, defValue: string): string; + const BLUETOOTH_RADIO: string /** - * set settingsdata value - * @need permission ohos.permission.WRITE_SYSTEM_SETTING - * @since 8 - * @param dataAbilityHelper dataAbilityHelper instance - * @param name name - * @param value value - * @return value set result + * A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that cellular radio is disabled in airplane mode. + * + * @since 7 */ - function setValue(dataAbilityHelper: DataAbilityHelper, name: string, value: string): boolean; + const CELL_RADIO: string + + /** + * A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that NFC is disabled in airplane mode. + * + * @since 7 + */ + const NFC_RADIO: string + + /** + * A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that Wi-Fi is disabled in airplane mode. + * + * @since 7 + */ + const WIFI_RADIO: string + + /** + * Specifies whether the Wi-Fi configuration created by the application of the device owner should be + * locked down. + * + *

If the value is {@code true}, the Wi-Fi configuration should be locked down. + * If the value is {@code false}, the Wi-Fi configuration should not be locked down. + * + * @since 7 + */ + const OWNER_LOCKDOWN_WIFI_CFG: string + + /** + * Indicates the maximum number of attempts to obtain an IP address from the DHCP server. + * + * @since 7 + */ + const WIFI_DHCP_MAX_RETRY_COUNT: string + + /** + * Indicates the maximum duration to hold a wake lock when waiting for the mobile data connection to + * establish after the Wi-Fi connection is disconnected. + * + * @since 7 + */ + const WIFI_TO_MOBILE_DATA_AWAKE_TIMEOUT: string + + /** + * Specifies whether Wi-Fi is enabled. + * + *

If the value is {@code true}, Wi-Fi is enabled. If the value is {@code false}, Wi-Fi is disabled. + * + * @since 7 + */ + const WIFI_STATUS: string + + /** + * Specifies whether Wi-Fi watchdog is enabled. + * + *

If the value is {@code true}, Wi-Fi watchdog is enabled. + * If the value is {@code false}, Wi-Fi watchdog is disabled. + * + * @since 7 + */ + const WIFI_WATCHDOG_STATUS: string + } + + /** + * Constructs a URI for a specific name-value pair for monitoring data of the ability that uses the Data + * template. + * + * @param name Indicates the name of the setting to set. + * @return Returns the corresponding URI; returns {@code null} if the URI does not exist. + * @since 7 + */ + function getURI(name: string, callback: AsyncCallback): void; + function getURI(name: string): Promise; + + /** + * Obtains the value of a specified character string in the database. + * + * @param dataAbilityHelper Indicates the {@link ohos.aafwk.ability.DataAbilityHelper} used to access + * the database. + * @param name Indicates the name of the character string. + * @return Returns the value of the character string in the table if any is found; returns {@code null} + * otherwise. + * @since 7 + */ + function getValue(dataAbilityHelper: DataAbilityHelper, name: string, callback: AsyncCallback): void; + function getValue(dataAbilityHelper: DataAbilityHelper, name: string): Promise; + + /** + * Saves a character string name and its value to the database. + * + * @param dataAbilityHelper Indicates the {@link ohos.aafwk.ability.DataAbilityHelper} used to access + * the database. + * @param name Indicates the name of the character string. + * @param value Indicates the value of the character string. + * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise. + * @since 7 + * @systemapi Hide this for inner system use. SystemApi + */ + function setValue(dataAbilityHelper: DataAbilityHelper, name: string, value: object, callback: AsyncCallback): void; + function setValue(dataAbilityHelper: DataAbilityHelper, name: string, value: object): Promise; + + /** + * Enables or disables airplane mode. + * + * @param enable Specifies whether to enable airplane mode. The value {@code true} means to enable airplane + * mode, and {@code false} means to disable airplane mode. + * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise. + * @since 7 + */ + function enableAirplaneMode(enable: boolean, callback: AsyncCallback): void; + function enableAirplaneMode(enable: boolean): Promise; + + /** + * Checks whether a specified application can show as float window. + * + * @param context Indicates the application context. + * @return Returns {@code true} if the application can draw over other applications; returns {@code false} + * otherwise. + * @since 7 + */ + function canShowFloating(callback: AsyncCallback): void; + function canShowFloating(): Promise; + + /** + * get settingsdata uri(synchronization method) + * @since 8 + * @param name Indicates the name of the setting to set. + * @return Return settingsdata uri. + */ + function getUriSync(name: string): string; + /** + * get value from settingsdata(synchronization method) + * @since 8 + * @param dataAbilityHelper Indicates dataAbilityHelper instance + * @param name Indicates the name of the character string. + * @param defValue Indicates the default value of the character string. + * @return settingsdata value + */ + function getValueSync(dataAbilityHelper: DataAbilityHelper, name: string, defValue: string): string; + + /** + * set settingsdata value(synchronization method) + * @need permission ohos.permission.WRITE_SYSTEM_SETTING + * @since 8 + * @param dataAbilityHelper Indicates dataAbilityHelper instance + * @param name Indicates the name of the character string. + * @param value Indicates the value of the character string. + * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise. + */ + function setValueSync(dataAbilityHelper: DataAbilityHelper, name: string, value: string): boolean; } -export default settings; +export default settings; \ No newline at end of file diff --git a/api/@ohos.storageStatistics.d.ts b/api/@ohos.storageStatistics.d.ts index 7fb9e06aed970630a3bf192671313746a163eb4f..bba0bfd94324949983c73ec51059faa11e673fc0 100644 --- a/api/@ohos.storageStatistics.d.ts +++ b/api/@ohos.storageStatistics.d.ts @@ -20,12 +20,14 @@ import {AsyncCallback, Callback} from "./basic"; * * @since 8 * @syscap SystemCapability.FileManagement.StorageService.SpatialStatistics + * @systemapi */ declare namespace storageStatistics { /** * Get the totalSize of volume. * * @since 8 + * @systemapi */ function getTotalSizeOfVolume(volumeUuid: string, callback: AsyncCallback): void; function getTotalSizeOfVolume(volumeUuid: string): Promise; @@ -33,24 +35,10 @@ declare namespace storageStatistics { * Get the free size Of volume. * * @since 8 + * @systemapi */ function getFreeSizeOfVolume(volumeUuid: string, callback: AsyncCallback): void; function getFreeSizeOfVolume(volumeUuid: string): Promise; - - /** - * Get the bundlestat - * - * @since 8 - */ - - export interface BundleStats { - appSize: number; - cacheSize: number; - dataSize: number; -} - function getBundleStats(volumeUuid: string, packageName: string, callback: AsyncCallback): void; - function getBundleStats(volumeUuid: string, packageName: string): Promise; - } export default storageStatistics; diff --git a/api/@ohos.systemTime.d.ts b/api/@ohos.systemTime.d.ts index 9071438b0ea18674ecaa7efc934630dca7ccf933..5b60b317fa22efb807680fdfdb577c789775c66f 100755 --- a/api/@ohos.systemTime.d.ts +++ b/api/@ohos.systemTime.d.ts @@ -18,8 +18,7 @@ import { AsyncCallback, ErrorCallback } from './basic'; /** * System time and timezone. * @since 7 - * @sysCap SystemCapability.Miscservices.Time - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.MiscServices.Time * @import systemTime from '@ohos.systemTime'; */ declare namespace systemTime { @@ -36,43 +35,22 @@ declare namespace systemTime { * Obtains the number of milliseconds that have elapsed since the Unix epoch. * @since 8 */ - function getCurrentTime(callback: AsyncCallback): void; - function getCurrentTime(): Promise; - - /** - * Obtains the number of nanoseconds that have elapsed since the Unix epoch. - * @since 8 - */ - function getCurrentTimeNs(callback: AsyncCallback): void; - function getCurrentTimeNs(): Promise; + function getCurrentTime(isNano?: boolean, callback: AsyncCallback): void; + function getCurrentTime(isNano?: boolean): Promise; /** * Obtains the number of milliseconds elapsed since the system was booted, not including deep sleep time. * @since 8 */ - function getRealActiveTime(callback: AsyncCallback): void; - function getRealActiveTime(): Promise; - - /** - * Obtains the number of nanoseconds elapsed since the system was booted, not including deep sleep time. - * @since 8 - */ - function getRealActiveTimeNs(callback: AsyncCallback): void; - function getRealActiveTimeNs(): Promise; + function getRealActiveTime(isNano?: boolean, callback: AsyncCallback): void; + function getRealActiveTime(isNano?: boolean): Promise; /** * Obtains the number of milliseconds elapsed since the system was booted, including deep sleep time. * @since 8 */ - function getRealTime(callback: AsyncCallback): void; - function getRealTime(): Promise; - - /** - * Obtains the number of nanoseconds elapsed since the system was booted, including deep sleep time. - * @since 8 - */ - function getRealTimeNs(callback: AsyncCallback): void; - function getRealTimeNs(): Promise; + function getRealTime(isNano?: boolean, callback: AsyncCallback): void; + function getRealTime(isNano?: boolean): Promise; /** * Sets the system time. @@ -107,4 +85,4 @@ declare namespace systemTime { function getTimezone(): Promise; } -export default systemTime; +export default systemTime; \ No newline at end of file diff --git a/api/@ohos.systemTimer.d.ts b/api/@ohos.systemTimer.d.ts index 987f9067a8bc9701f2b30df7f5b0abcb87c8749a..023a3f26442f2feb2affe150f08cab29fb9b2cde 100644 --- a/api/@ohos.systemTimer.d.ts +++ b/api/@ohos.systemTimer.d.ts @@ -20,7 +20,7 @@ import { WantAgent } from './@ohos.wantAgent'; * Provides js api for systemTimer * * @since 7 - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. */ declare namespace systemTimer { diff --git a/api/@ohos.systemparameter.d.ts b/api/@ohos.systemparameter.d.ts index 57a2906095657ffc8e63ede552c582984f76bf39..18f92152a4d997eada96721738cddebc8a02a620 100644 --- a/api/@ohos.systemparameter.d.ts +++ b/api/@ohos.systemparameter.d.ts @@ -19,8 +19,8 @@ import { AsyncCallback, BusinessError } from './basic'; * The interface of system parameters class. * * @since 6 - * @Syscap SystemCapability.Startup.SysInfo - * @hide + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. */ declare namespace systemParameter { /** @@ -29,6 +29,7 @@ declare namespace systemParameter { * @param key Key of the system attribute. * @param def Default value. * @return if the parameter is empty or doesn't exist, empty string will be returned. + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ function getSync(key: string, def?: string): string; @@ -38,6 +39,7 @@ declare namespace systemParameter { * * @param key Key of the system attribute. * @param callback Callback function. + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ function get(key: string, callback: AsyncCallback): void; @@ -48,6 +50,7 @@ declare namespace systemParameter { * @param key Key of the system attribute. * @param def Default value. * @param callback Callback function. + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ function get(key: string, def: string, callback: AsyncCallback): void; @@ -58,6 +61,7 @@ declare namespace systemParameter { * @param key Key of the system attribute. * @param def Default value. * @return Promise, which is used to obtain the result asynchronously. + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ function get(key: string, def?: string): Promise; @@ -67,6 +71,7 @@ declare namespace systemParameter { * * @param key Key of the system attribute. * @param value System attribute value to set. + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ function setSync(key: string, value: string): void; @@ -77,6 +82,7 @@ declare namespace systemParameter { * @param key Key of the system attribute. * @param value System attribute value to set. * @param callback Callback function. + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ function set(key: string, value: string, callback: AsyncCallback): void; @@ -87,6 +93,7 @@ declare namespace systemParameter { * @param key Key of the system attribute. * @param value Default value. * @return Promise, which is used to obtain the result asynchronously. + * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ function set(key: string, value: string): Promise; diff --git a/api/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts index 7b5a03dd6165bea613bd31b10cac7002b0f2f7d1..2a48ba7418b654723231e5e6e2f6c91b4b92c33c 100644 --- a/api/@ohos.telephony.call.d.ts +++ b/api/@ohos.telephony.call.d.ts @@ -1,17 +1,17 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (C) 2021-2022 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 {AsyncCallback, Callback} from "./basic"; @@ -25,8 +25,6 @@ declare namespace call { /** * Makes a call. * - *

Applications must have the {@code ohos.permission.PLACE_CALL} permission to call this method. - * * @param phoneNumber Indicates the called number. * @param options Indicates additional information carried in the call. * @param callback Returns {@code true} if the call request is successful; returns {@code false} otherwise. @@ -38,6 +36,16 @@ declare namespace call { function dial(phoneNumber: string, options: DialOptions, callback: AsyncCallback): void; function dial(phoneNumber: string, options?: DialOptions): Promise; + /** + * Go to the dial screen and the called number is displayed. + * + * @param phoneNumber Indicates the called number. + * @syscap SystemCapability.Applications.Contacts + * @since 7 + */ + function makeCall(phoneNumber: string, callback: AsyncCallback): void; + function makeCall(phoneNumber: string): Promise; + /** * Checks whether a call is ongoing. * @@ -65,7 +73,7 @@ declare namespace call { * *

If an incoming call is ringing, the phone stops ringing. Otherwise, this method does not function. * - * @permission ohos.permission.SET_TELEPHONY_STATE or System App + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 */ @@ -124,6 +132,7 @@ declare namespace call { /** * @systemapi Hide this for inner system use. + * @permission ohos.permission.ANSWER_CALL * @since 7 */ function answer(callId: number, callback: AsyncCallback): void; @@ -414,9 +423,9 @@ declare namespace call { * @since 8 */ export interface CallTransferInfo { - transferNum: string, - type: CallTransferType, - settingType: CallTransferSettingType + transferNum: string; + type: CallTransferType; + settingType: CallTransferSettingType; } /** @@ -446,16 +455,16 @@ declare namespace call { * @since 7 */ export interface CallAttributeOptions { - accountNumber: string, - speakerphoneOn: boolean, - accountId: number, - videoState: VideoStateType, - startTime: number, - isEcc: boolean, - callType: CallType, - callId: number, - callState: DetailedCallState, - conferenceState: ConferenceState, + accountNumber: string; + speakerphoneOn: boolean; + accountId: number; + videoState: VideoStateType; + startTime: number; + isEcc: boolean; + callType: CallType; + callId: number; + callState: DetailedCallState; + conferenceState: ConferenceState; } /** @@ -510,9 +519,9 @@ declare namespace call { * @since 8 */ export interface CallRestrictionInfo { - type: CallRestrictionType, - password: string - mode: CallRestrictionMode + type: CallRestrictionType; + password: string; + mode: CallRestrictionMode; } /** @@ -694,7 +703,7 @@ declare namespace call { CALL_NOT_ALLOW = 1029, SIM_INVALID = 1045, UNKNOWN = 1279, - }; + } } export default call; \ No newline at end of file diff --git a/api/@ohos.telephony.data.d.ts b/api/@ohos.telephony.data.d.ts index 24a6fa755671be2a349c21d7184f81325b2ff9cb..a82b90e3dd203f02940c831c92af55e69c970de6 100644 --- a/api/@ohos.telephony.data.d.ts +++ b/api/@ohos.telephony.data.d.ts @@ -1,17 +1,17 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (C) 2021-2022 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 {AsyncCallback} from "./basic"; @@ -25,8 +25,6 @@ declare namespace data { /** * Checks whether cellular data services are enabled. * - *

Requires Permission: {@code ohos.permission.GET_NETWORK_INFO}. - * * @return Returns {@code true} if cellular data services are enabled; returns {@code false} otherwise. * @permission ohos.permission.GET_NETWORK_INFO */ @@ -72,9 +70,8 @@ declare namespace data { /** * Checks whether cellular data services are enabled. * - *

Requires Permission: {@code ohos.permission.GET_NETWORK_INFO}. - * * @param callback Returns {@code true} if cellular data services are enabled; returns {@code false} otherwise. + * @permission ohos.permission.GET_NETWORK_INFO */ function isCellularDataEnabled(callback: AsyncCallback): void; function isCellularDataEnabled(): Promise; @@ -100,8 +97,6 @@ declare namespace data { /** * Checks whether roaming is enabled for cellular data services. * - *

Requires Permission: {@code ohos.permission.GET_NETWORK_INFO}. - * * @param slotId Indicates the ID of a card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param callback Returns {@code true} if roaming is enabled for cellular data services; returns {@code false} otherwise. diff --git a/api/@ohos.telephony.observer.d.ts b/api/@ohos.telephony.observer.d.ts index e7d6294044df12f73a131bcd017a0265da5de68f..7e0ac5b3e9b55d442749d0f41844b5f8d0dfbca3 100644 --- a/api/@ohos.telephony.observer.d.ts +++ b/api/@ohos.telephony.observer.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 2021-2022 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 @@ -29,6 +29,9 @@ import sim from "./@ohos.telephony.sim"; declare namespace observer { type NetworkState = radio.NetworkState; type SignalInformation = radio.SignalInformation; + /** + * @systemapi Hide this for inner system use. + */ type CellInformation = radio.CellInformation; type DataConnectState = data.DataConnectState; type RatType = radio.RadioTechnology; @@ -40,9 +43,6 @@ declare namespace observer { /** * Called when the network state corresponding to a monitored {@code slotId} updates. * - *

Applications must have the {@code ohos.permission.GET_NETWORK_INFO} permission - * to register this event. - * * @param type networkStateChange * @param options including slotId Indicates the ID of the target card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. @@ -71,9 +71,6 @@ declare namespace observer { /** * Called back when the cell information corresponding to a monitored {@code slotId} updates. * - *

Applications must have the {@code ohos.permission.LOCATION} permission - * to register this event. - * * @param type cellInfoChange * @param options including slotId Indicates the ID of the target card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. @@ -107,6 +104,9 @@ declare namespace observer { function on(type: 'cellularDataConnectionStateChange', options: { slotId: number }, callback: Callback<{ state: DataConnectState, network: RatType }>): void; + /** + * @since 7 + */ function off(type: 'cellularDataConnectionStateChange', callback?: Callback<{ state: DataConnectState, network: RatType }>): void; @@ -123,6 +123,9 @@ declare namespace observer { function on(type: 'cellularDataFlowChange', options: { slotId: number }, callback: Callback): void; + /** + * @since 7 + */ function off(type: 'cellularDataFlowChange', callback?: Callback): void; /** @@ -134,7 +137,7 @@ declare namespace observer { * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param callback including state Indicates the call state, and number Indicates the called number. * The value of number is an empty string if the application does not have - * the {@code ohos.permission#READ_CALL_LOG READ_CALL_LOG} permission. + * the ohos.permission.READ_CALL_LOG permission. */ function on(type: 'callStateChange', callback: Callback<{ state: CallState, number: string }>): void; function on(type: 'callStateChange', options: { slotId: number }, @@ -156,18 +159,21 @@ declare namespace observer { function on(type: 'simStateChange', callback: Callback): void; function on(type: 'simStateChange', options: { slotId: number }, callback: Callback): void; + /** + * @since 7 + */ function off(type: 'simStateChange', callback?: Callback): void; /** * @since 7 */ export interface SimStateData { - type: CardType, - state: SimState, + type: CardType; + state: SimState; /** * @since 8 */ - reason: LockReason + reason: LockReason; } /** diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index cae3d90ff79ea82b000e84a7e08579f3114e1bde..0975e3245b9eae7d943b97b1e216e6172098bba6 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -1,17 +1,17 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (C) 2021-2022 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 {AsyncCallback} from "./basic"; @@ -28,8 +28,6 @@ declare namespace radio { * Obtains radio access technology (RAT) of the registered network. The system * returns RAT of the packet service (PS) and circuit service (CS) domain. * - *

Requires Permission: {@code ohos.permission.GET_NETWORK_INFO}. - * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param callback Returns an integer indicating the RAT in use. The values are as follows: @@ -57,8 +55,6 @@ declare namespace radio { /** * Obtains the network state of the registered network. * - *

Requires Permission: {@code ohos.permission.GET_NETWORK_INFO}. - * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param callback Returns a {@code NetworkState} object. @@ -137,12 +133,11 @@ declare namespace radio { /** * Obtains the IMEI of a specified card slot of the device. * - *

Requires Permission: {@code ohos.permission.GET_TELEPHONY_STATE}. - * * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number * supported by the device. * @param callback Returns the IMEI; returns an empty string if the IMEI does not exist. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 8 */ function getIMEI(callback: AsyncCallback): void; @@ -152,12 +147,11 @@ declare namespace radio { /** * Obtains the MEID of a specified card slot of the device. * - *

Requires Permission: {@code ohos.permission.GET_TELEPHONY_STATE}. - * * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number * supported by the device. * @param callback Returns the MEID; returns an empty string if the MEID does not exist. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 8 */ function getMEID(callback: AsyncCallback): void; @@ -171,12 +165,11 @@ declare namespace radio { * (IMEI) is returned. If the device is registered with a 3GPP2-compliant network, the mobile equipment identifier * (MEID) is returned. * - *

Requires Permission: {@code ohos.permission.GET_TELEPHONY_STATE}. - * * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number * supported by the device. * @param callback Returns the unique device ID; returns an empty string if the unique device ID does not exist. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 8 */ function getUniqueDeviceId(callback: AsyncCallback): void; @@ -233,27 +226,42 @@ declare namespace radio { function isNrSupported(slotId: number): boolean; /** + * Checks whether the radio service is enabled. + * + * @param slotId Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. * @permission ohos.permission.GET_NETWORK_INFO * @since 7 */ function isRadioOn(callback: AsyncCallback): void; - function isRadioOn(): Promise; + function isRadioOn(slotId: number, callback: AsyncCallback): void + function isRadioOn(slotId?: number): Promise; /** + * Turn on the radio service. + * + * @param slotId Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 7 */ function turnOnRadio(callback: AsyncCallback): void; - function turnOnRadio(): Promise; + function turnOnRadio(slotId: number, callback: AsyncCallback): void; + function turnOnRadio(slotId?: number): Promise; /** + * Turn off the radio service. + * + * @param slotId Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 7 */ function turnOffRadio(callback: AsyncCallback): void; - function turnOffRadio(): Promise; + function turnOffRadio(slotId: number, callback: AsyncCallback): void; + function turnOffRadio(slotId?: number): Promise; /** * @since 7 @@ -623,11 +631,11 @@ declare namespace radio { * @since 8 */ export interface CdmaCellInformation { - baseId: number, - latitude: number, - longitude: number, - nid: number, - sid: number, + baseId: number; + latitude: number; + longitude: number; + nid: number; + sid: number; } /** diff --git a/api/@ohos.telephony.sim.d.ts b/api/@ohos.telephony.sim.d.ts index 35b4253181c565e3546fcf2cd6f3f4399d635701..1ff02a7ba88813d43772590c617a04998a75dafd 100644 --- a/api/@ohos.telephony.sim.d.ts +++ b/api/@ohos.telephony.sim.d.ts @@ -1,17 +1,17 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (C) 2021-2022 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 {AsyncCallback} from "./basic"; @@ -127,12 +127,12 @@ declare namespace sim { *

The ICCID is a unique identifier of a SIM card. It consists of 20 digits * and is recorded in the EFICCID file of the SIM card. * - *

Requires Permission: {@code ohos.permission.GET_TELEPHONY_STATE}. - * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param callback Returns the ICCID; returns an empty string if no SIM card is inserted. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. + * @since 7 */ function getSimIccId(slotId: number, callback: AsyncCallback): void; function getSimIccId(slotId: number): Promise; @@ -140,13 +140,12 @@ declare namespace sim { /** * Obtains the alpha identifier of the voice mailbox of the SIM card in a specified slot. * - *

Only applications with the {@code ohos.permission.GET_TELEPHONY_STATE} permission can call this method. - * * @param slotId Indicates the card slot index number, * ranging from {@code 0} to the maximum card slot index number supported by the device. * @param callback Returns the voice mailbox alpha identifier; * returns an empty string if no voice mailbox alpha identifier is written into the SIM card. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 8 */ function getVoiceMailIdentifier(slotId: number, callback: AsyncCallback): void; @@ -155,13 +154,12 @@ declare namespace sim { /** * Obtains the voice mailbox number of the SIM card in a specified slot. * - *

Only applications with the {@code ohos.permission.GET_TELEPHONY_STATE} permission can call this method. - * * @param slotId Indicates the card slot index number, * ranging from {@code 0} to the maximum card slot index number supported by the device. * @param callback Returns the voice mailbox number; * returns an empty string if no voice mailbox number is written into the SIM card. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 8 */ function getVoiceMailNumber(slotId: number, callback: AsyncCallback): void; @@ -179,13 +177,12 @@ declare namespace sim { * Obtains the MSISDN of the SIM card in a specified slot. * The MSISDN is recorded in the EFMSISDN file of the SIM card. * - *

Requires Permission: {@code ohos.permission.GET_TELEPHONY_STATE}. - * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param callback Returns the MSISDN; returns an empty string if no SIM card is inserted or * no MSISDN is recorded in the EFMSISDN file. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 8 */ function getSimTelephoneNumber(slotId: number, callback: AsyncCallback): void; @@ -195,14 +192,13 @@ declare namespace sim { * Obtains the Group Identifier Level 1 (GID1) of the SIM card in a specified slot. * The GID1 is recorded in the EFGID1 file of the SIM card. * - *

Requires Permission: {@code ohos.permission.GET_TELEPHONY_STATE}. - * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param callback Returns the GID1; returns an empty string if no SIM card is inserted or * no GID1 in the SIM card. * @permission ohos.permission.GET_TELEPHONY_STATE - * @since 8 + * @systemapi Hide this for inner system use. + * @since 7 */ function getSimGid1(slotId: number, callback: AsyncCallback): void; function getSimGid1(slotId: number): Promise; diff --git a/api/@ohos.telephony.sms.d.ts b/api/@ohos.telephony.sms.d.ts index 2a18155c134cf483126082fc6bef0aae38ca780b..42b9cf126368c27d4f6ef92ac55f071f02df169c 100644 --- a/api/@ohos.telephony.sms.d.ts +++ b/api/@ohos.telephony.sms.d.ts @@ -1,17 +1,17 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (C) 2021-2022 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 {AsyncCallback} from "./basic"; @@ -27,7 +27,6 @@ declare namespace sms { * *

If the length of an SMS message exceeds the maximum length allowed (140 bytes), * the SMS message is split into multiple segments for processing. - *

Applications must have the {@code ohos.permission.SEND_MESSAGES} permission to call this method. * * @param content Indicates the short message content, which cannot be {@code null}. * @param callback Returns a list of split segments, which can be combined into a complete SMS message; @@ -59,8 +58,6 @@ declare namespace sms { * *

This method checks whether the length of an SMS message exceeds the maximum length. If the * maximum length is exceeded, the SMS message is split into multiple parts and sent separately. - *

You need to obtain the following permission before calling this method: - * {@code ohos.permission.SEND_MESSAGES} * * @param options Indicates the parameters and callback for sending the SMS message. * @permission ohos.permission.SEND_MESSAGES @@ -93,11 +90,10 @@ declare namespace sms { /** * Sets the address for the Short Message Service Center (SMSC) based on a specified slot ID. * - *

Permissions: {@link ohos.security.SystemPermission#SET_TELEPHONY_STATE} - * * @param slotId Indicates the ID of the slot holding the SIM card for sending SMS messages. * @param smscAddr Indicates the SMSC address. * @permission ohos.permission.SET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 7 */ function setSmscAddr(slotId: number, smscAddr: string, callback: AsyncCallback): void; @@ -106,11 +102,10 @@ declare namespace sms { /** * Obtains the SMSC address based on a specified slot ID. * - *

Permissions: {@link ohos.security.SystemPermission#GET_TELEPHONY_STATE} - * * @param slotId Indicates the ID of the slot holding the SIM card for sending SMS messages. * @param callback Returns the SMSC address. * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. * @since 7 */ function getSmscAddr(slotId: number, callback: AsyncCallback): void; @@ -126,7 +121,7 @@ declare namespace sms { function hasSmsCapability(): boolean; /** - * @permission ohos.permission.RECEIVE_SMS,ohos.permission.SEND_MESSAGES + * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES * @systemapi Hide this for inner system use. * @since 7 */ @@ -134,7 +129,7 @@ declare namespace sms { function addSimMessage(options: SimMessageOptions): Promise; /** - * @permission ohos.permission.RECEIVE_SMS,ohos.permission.SEND_MESSAGES + * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES * @systemapi Hide this for inner system use. * @since 7 */ @@ -142,7 +137,7 @@ declare namespace sms { function delSimMessage(slotId: number, msgIndex: number): Promise; /** - * @permission ohos.permission.RECEIVE_SMS,ohos.permission.SEND_MESSAGES + * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES * @systemapi Hide this for inner system use. * @since 7 */ diff --git a/api/@ohos.uitest.d.ts b/api/@ohos.uitest.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..d98cc0d044eda99bd129f0ede57e0df3739a350f --- /dev/null +++ b/api/@ohos.uitest.d.ts @@ -0,0 +1,440 @@ +/* + * Copyright (C) 2022 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 "ASIS" 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. + */ + +/** + * Enumerates the string value match pattern. + * + * @since 8 + */ + declare enum MatchPattern{ + /** + * Equals to a string. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + EQUALS = 0, + /** + * Contains a substring. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + CONTAINS = 1, + /** + * StartsWith a substring. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + STARTS_WITH = 2, + /** + * EndsWith a substring. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + ENDS_WITH = 3 +} + +/** + * Describes the attribute requirements for the target UiComponents. + * + * @since 8 + * @syscap SystemCapability.Test.UiTest + */ + declare class By{ + /** + * Specifies the text for the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param txt the text value. + * @param pattern the {@link MatchPattern} of the text value,default to {@link MatchPattern.EQUALS} + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + text(txt:string,pattern?:MatchPattern):By; + + /** + * Specifies the inspectorKey of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param key the inspectorKey value. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + key(key:string):By; + + /** + * Specifies the id of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param id the id value. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + id(id:number):By; + + /** + * Specifies the type of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param tp the type value. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + type(tp:string):By; + + /** + * Specifies the clickable status of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param b the clickable status,default to true. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + clickable(b?:boolean):By; + + /** + * Specifies the scrollable status of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param b the scrollable status,default to true. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + scrollable(b?:boolean):By; + + /** + * Specifies the enabled status of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param b the enabled status,default to true. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + enabled(b?:boolean):By; + + /** + * Specifies the focused status of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param b the focused status,default to true. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + focused(b?:boolean):By; + + /** + * Specifies the selected status of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param b the selected status,default to true. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + selected(b?:boolean):By; + + /** + * Requires that the target UiComponent which is before another UiComponent that specified by the given {@link By} + * object,used to locate UiComponent relatively. + * @syscap SystemCapability.Test.UiTest + * @param by describes the attribute requirements of UiComponent which the target one is in front of. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + isBefore(by:By):By; + + /** + * Requires that the target UiComponent which is after another UiComponent that specified by the given {@link By} + * object,used to locate UiComponent relatively. + * @syscap SystemCapability.Test.UiTest + * @param by describes the attribute requirements of UiComponent which the target one is in back of. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + isAfter(by:By):By; + } + + /** + * Represents a UiComponent of the ohos application,user can perform operations or query attributes on it. + * + * @since 8 + * @test + * @syscap SystemCapability.Test.UiTest + */ + declare class UiComponent{ + /** + * Click this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + click():Promise; + + /** + * Double click this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + doubleClick():Promise; + + /** + * Long click this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + longClick():Promise; + + /** + * Get the id attribute value. + * @syscap SystemCapability.Test.UiTest + * @returns the id value. + * @since 8 + * @test + */ + getId():Promise; + + /** + * Get the inspectorKey attribute value. + * @syscap SystemCapability.Test.UiTest + * @returns the inspectorKey value. + * @since 8 + * @test + */ + getKey():Promise; + + /** + * Get the text attribute value. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + getText():Promise; + + /** + * Get the type name. + * @syscap SystemCapability.Test.UiTest + * @returns the type name. + * @since 8 + * @test + */ + getType():Promise; + + /** + * Get the clickable status of this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @returns the clickable status. + * @since 8 + * @test + */ + isClickable():Promise; + + /** + * Get the scrollable status of this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @returns the scrollable status. + * @since 8 + * @test + */ + isScrollable():Promise; + + /** + * Get the enabled status of this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @returns the enabled status. + * @since 8 + * @test + */ + isEnabled():Promise; + + /** + * Get the focused status of this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @returns the focused status. + * @since 8 + * @test + */ + isFocused():Promise; + + /** + * Get the selected status of this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @returns the selected status. + * @since 8 + * @test + */ + isSelected():Promise; + + /** + * Inject text to this {@link UiComponent},applicable to TextInput. + * @syscap SystemCapability.Test.UiTest + * @param text the text to inject. + * @since 8 + * @test + */ + inputText(text: string):Promise; + + /** + * Scroll on this {@link UiComponent}to find matched {@link UiComponent},applicable to scrollable one. + * @syscap SystemCapability.Test.UiTest + * @param by the attribute requirements of the target {@link UiComponent}. + * @return the found result,or undefined if not found. + * @since 8 + * @test + */ + scrollSearch(by:By):Promise; +} + +/** + * The unified facade of UiTest framework,can be used to find {@link UiComponent},trigger keyEvents,perform + * coordinates-based UI actions,capture screen and so on. + * + * @since 8 + * @test + * @syscap SystemCapability.Test.UiTest + */ + declare class UiDriver{ + /** + * Create an {@link UiDriver} object. + * @syscap SystemCapability.Test.UiTest + * @returns the {@link UiDriver} object. + * @since 8 + * @test + */ + static create():UiDriver; + + /** + * Delay with specified duration. + * @syscap SystemCapability.Test.UiTest + * @param duration the delay duration in milliseconds. + * @since 8 + * @test + */ + delayMs(duration:number):Promise; + + /** + * Find the first matched {@link UiComponent} on current UI. + * @syscap SystemCapability.Test.UiTest + * @param by the attribute requirements of the target {@link UiComponent}. + * @returns the first matched {@link UiComponent} or undefined. + * @since 8 + * @test + */ + findComponent(by:By):Promise; + + /** + * Find all the matched {@link UiComponent}s on current UI. + * @syscap SystemCapability.Test.UiTest + * @param by the attribute requirements of the target {@link UiComponent}. + * @returns the matched {@link UiComponent}s list. + * @since 8 + * @test + */ + findComponents(by:By):Promise>; + + /** + * Assert t the matched {@link UiComponent}s exists on current UI;if not,assertError will be raised. + * @syscap SystemCapability.Test.UiTest + * @param by the attribute requirements of the target {@link UiComponent}. + * @throws Throws this exception if following error occurs:{@code ComponentExistAssertion Failure}. + * @since 8 + * @test + */ + assertComponentExist(by:By):Promise; + + /** + * Press the BACK key. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + pressBack():Promise; + + /** + * Press the specified key. + * @syscap SystemCapability.Test.UiTest + * @param keyCode the target keyCode. + * @since 8 + * @test + */ + triggerKey(keyCode:number):Promise; + + /** + * Click on the specified location on the screen. + * @syscap SystemCapability.Test.UiTest + * @param x the x-coordinate. + * @param y the y-coordinate. + * @since 8 + * @test + */ + click(x:number,y:number):Promise; + + /** + * DoubleClick on the specified location on the screen. + * @syscap SystemCapability.Test.UiTest + * @param x the x-coordinate. + * @param y the y-coordinate. + * @since 8 + * @test + */ + doubleClick(x:number,y:number):Promise; + + /** + * LongClick on the specified location on the screen. + * @syscap SystemCapability.Test.UiTest + * @param x the x-coordinate. + * @param y the y-coordinate. + * @since 8 + * @test + */ + longClick(x:number,y:number):Promise; + + /** + * Swipe on the screen between the specified points. + * @syscap SystemCapability.Test.UiTest + * @param startx the x-coordinate of the starting point. + * @param starty the y-coordinate of the starting point. + * @param endx the x-coordinate of the ending point. + * @param endy the y-coordinate of the ending point. + * @since 8 + * @test + */ + swipe(startx:number,starty:number,endx:number,endy:number):Promise; + + /** + * Capture current screen and save as picture which PNG format. + * @syscap SystemCapability.Test.UiTest + * @param savePath the path where to store the picture. + * @returns true if screen-capturing and file-storing are completed successfully,false otherwise. + * @since 8 + * @test + */ + screenCap(savePath:string):Promise; +} + +/** + * The static builder for building {@link By}object conveniently,usage example:BY.text('txt').enabled(true). + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + declare const BY:By; + + export {UiComponent,UiDriver,BY,MatchPattern}; diff --git a/api/@ohos.update.d.ts b/api/@ohos.update.d.ts index 0620034b5dd6b219688839ad75fd9a8f9f577281..d67b84af0ff1e6d9d99b9514afff6fd7c3dd25aa 100644 --- a/api/@ohos.update.d.ts +++ b/api/@ohos.update.d.ts @@ -18,9 +18,9 @@ import { AsyncCallback, BussinessError } from "./basic"; /** * A static class to do update for device. * - * @devices all * @since 6 - * @Syscap SystemCapability.Updater.Raw + * @syscap SystemCapability.Update.UpdateService + * @systemapi hide for inner use. */ declare namespace update { /** @@ -311,9 +311,9 @@ declare namespace update { /** * A static class to do update for the specified device. * - * @devices all * @since 6 - * @Syscap SystemCapability.Updater.Raw + * @syscap SystemCapability.Update.UpdateService + * @systemapi hide for inner use. */ export interface Updater { /** @@ -376,9 +376,18 @@ declare namespace update { * Reboot to clean cache. * * @since 6 + * @deprecated since 8 */ rebootAndCleanCache(callback: AsyncCallback): void; rebootAndCleanCache(): Promise; + + /** + * Reboot and clean user data. + * + * @since 8 + */ + rebootAndCleanUserData(callback: AsyncCallback): void; + rebootAndCleanUserData(): Promise; /** * verify update package. diff --git a/api/@ohos.usb.d.ts b/api/@ohos.usb.d.ts index ac295ca5d22d2b986af8dc1134ff92654a0faf74..09068b4834152d023bb8085a1fd5499352189116 100644 --- a/api/@ohos.usb.d.ts +++ b/api/@ohos.usb.d.ts @@ -161,12 +161,14 @@ declare namespace usb { * Represents the USB endpoint from which data is sent or received. * You can obtain the USB endpoint through USBInterface {@link USBInterface}. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ interface USBEndpoint { /** * Endpoint address. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ address: number; @@ -174,6 +176,7 @@ declare namespace usb { /** * Endpoint attributes. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ attributes: number; @@ -181,6 +184,7 @@ declare namespace usb { /** * Endpoint interval. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ interval: number; @@ -188,6 +192,7 @@ declare namespace usb { /** * Maximun size of data packets on the endpoint. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ maxPacketSize: number; @@ -195,6 +200,7 @@ declare namespace usb { /** * Endpoint direction. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ direction: USBRequestDirection; @@ -202,6 +208,7 @@ declare namespace usb { /** * Endpoint number. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ number: number; @@ -209,6 +216,7 @@ declare namespace usb { /** * Endpoint type * + * @syscap SystemCapability.USB.USBManager * @since 8 */ type: number; @@ -216,6 +224,7 @@ declare namespace usb { /** * Unique ID of the interface to which the endpoint belongs {@link USBInterface.id} * + * @syscap SystemCapability.USB.USBManager * @since 8 */ interfaceId: number; @@ -226,12 +235,14 @@ declare namespace usb { * Represents a USB interface. One USBconfig {@link USBConfig} can contain multiple USBInterface instances, * each providing a specific function. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ interface USBInterface { /** * Unique ID of the USB interface. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ id: number; @@ -239,6 +250,7 @@ declare namespace usb { /** * Interface protocol. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ protocol: number; @@ -246,6 +258,7 @@ declare namespace usb { /** * Device type. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ clazz: number; @@ -253,6 +266,7 @@ declare namespace usb { /** * Device subclass. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ subClass: number; @@ -260,6 +274,7 @@ declare namespace usb { /** * Alternating between descripors of the same USB interface. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ alternateSetting: number; @@ -267,13 +282,15 @@ declare namespace usb { /** * Interface name. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ name: string; /** * Endpoints {@link USBEndpoint} that belongs to the USB interface. - * + * + * @syscap SystemCapability.USB.USBManager * @since 8 */ endpoints: Array; @@ -282,21 +299,22 @@ declare namespace usb { /** * Represents the USB configuration. One USBDevice{@link USBDevice} can contain multiple USBConfig instances. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ interface USBConfig { /** * Unique ID if the USB configuration. * + * @syscap SystemCapability.USB.USBManager * @since 8 - * - * */ id: number; /** * Configuration attributes. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ attributes: number; @@ -304,6 +322,7 @@ declare namespace usb { /** * Maximum power consumption, in mA. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ maxPower: number; @@ -311,6 +330,7 @@ declare namespace usb { /** * Configuration name, which can be left empty. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ name: string; @@ -318,6 +338,7 @@ declare namespace usb { /** * Support for remote wakeup. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ isRemoteWakeup: boolean; @@ -325,6 +346,7 @@ declare namespace usb { /** * Support for independent power supplies. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ isSelfPowered: boolean; @@ -332,6 +354,7 @@ declare namespace usb { /** * Supported interface attributes {@link USBInterface}. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ interfaces: Array; @@ -340,84 +363,98 @@ declare namespace usb { /** * Represents a USB device. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ interface USBDevice { /** * Bus address. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ busNum: number; /** * Device address. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ devAddress: number; /** * Device SN. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ serial: string; /** * Device name. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ name: string; /** * Device manufacturer. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ manufacturerName: string; /** * Product name. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ productName: string; /** * Product version. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ version: string; /** * Vendor ID. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ vendorId: number; /** * Product ID. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ productId: number; /** * Device class. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ clazz: number; /** * Device subclass. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ subClass: number; /** * Device protocol code. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ protocol: number; /** * Device configuration descriptor information {@link USBConfig}. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ configs: Array; @@ -426,18 +463,21 @@ declare namespace usb { /** * Represents a USB device pipe, which is used to determine the USB device. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ interface USBDevicePipe { /** * Bus address. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ busNum: number; /** * Device address. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ devAddress: number; @@ -446,41 +486,49 @@ declare namespace usb { /** * Represents control transfer parameters. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ interface USBControlParams { /** * Request type. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ request: number; /** * Request target tyoe. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ target: USBRequestTargetType; /** * Request control type. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ reqType: USBControlRequestType; /** * Request parameter value. - * + * + * @syscap SystemCapability.USB.USBManager * @since 8 */ value: number; /** * Index of the parameter value. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ index: number; /** * Data written to or read from the buffer. + * + * @syscap SystemCapability.USB.USBManager * @since 8 */ data: Uint8Array; @@ -489,30 +537,35 @@ declare namespace usb { /** * Enumerates USB request target types. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ enum USBRequestTargetType { /** * Device. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ USB_REQUEST_TARGET_DEVICE = 0, /** * Interface. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ USB_REQUEST_TARGET_INTERFACE, /** * Endpoint. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ USB_REQUEST_TARGET_ENDPOINT, /** * Others. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ USB_REQUEST_TARGET_OTHER @@ -520,24 +573,29 @@ declare namespace usb { /** * Enumerates control request types. + * + * @syscap SystemCapability.USB.USBManager * @since 8 */ enum USBControlRequestType { /** * Standard. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ USB_REQUEST_TYPE_STANDARD = 0, /** * Class. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ USB_REQUEST_TYPE_CLASS, /** * Verdor. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ USB_REQUEST_TYPE_VENDOR @@ -545,18 +603,22 @@ declare namespace usb { /** * Enumerates request directions. + * + * @syscap SystemCapability.USB.USBManager * @since 8 */ enum USBRequestDirection { /** * Request for writing data from the host to the device. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ USB_REQUEST_DIR_TO_DEVICE = 0, /** * Request for reading data from the device to the host. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ USB_REQUEST_DIR_FROM_DEVICE = 0x80 diff --git a/api/@ohos.userIAM.userAuth.d.ts b/api/@ohos.userIAM.userAuth.d.ts index faf424d0e50b01eb82e78bbcb8db415980b019b5..4881dfb9ad03206e97aff3f3fc9b52c503033ad7 100644 --- a/api/@ohos.userIAM.userAuth.d.ts +++ b/api/@ohos.userIAM.userAuth.d.ts @@ -18,7 +18,7 @@ import { AsyncCallback } from './basic'; /** * User authentication * @since 6 - * @sysCap SystemCapability.UserIAM.UserAuth + * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC */ declare namespace userAuth { @@ -105,7 +105,7 @@ declare namespace userAuth { interface Authenticator { /** * Execute authentication. - * @SysCap SystemCapability.UserIAM.UserAuth + * @syscap SystemCapability.UserIAM.UserAuth.Core * @param type Indicates the authentication type. * @param level Indicates the security level. * @return Returns authentication result, which is specified by AuthenticationResult. @@ -117,7 +117,7 @@ declare namespace userAuth { /** * Get Authenticator instance. - * @SysCap SystemCapability.UserIAM.UserAuth + * @syscap SystemCapability.UserIAM.UserAuth.Core * @return Returns an Authenticator. * @deprecated since 8 */ @@ -126,12 +126,13 @@ declare namespace userAuth { /** * User authentication. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ class UserAuth { /** * Constructor to get the UserAuth class instance. * @since 8 - * @SysCap SystemCapability.UserIAM.UserAuth + * @syscap SystemCapability.UserIAM.UserAuth.Core * @return Returns the UserAuth class instance. */ constructor(); @@ -139,7 +140,7 @@ declare namespace userAuth { /** * Get version information. * @since 8 - * @SysCap SystemCapability.UserIAM.UserAuth + * @syscap SystemCapability.UserIAM.UserAuth.Core * @return Returns version information. */ getVersion() : number; @@ -147,18 +148,18 @@ declare namespace userAuth { /** * Check whether the authentication capability is available. * @since 8 - * @SysCap SystemCapability.UserIAM.UserAuth + * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @param authType Credential type for authentication. * @param authTrustLevel Trust level of authentication result. * @return Returns a check result, which is specified by getAvailableStatus. */ - getAvailableStatus(authType : AuthType, authTrustLevel : AuthTrustLevel) : number; + getAvailableStatus(authType : UserAuthType, authTrustLevel : AuthTrustLevel) : number; /** * Executes authentication. * @since 8 - * @SysCap SystemCapability.UserIAM.UserAuth + * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @param challenge pass in challenge value. * @param authType type of authentication. @@ -166,12 +167,12 @@ declare namespace userAuth { * @param callback Return result and acquireinfo through callback. * @return Returns ContextId for cancel. */ - auth(challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel, callback: IUserAuthCallback): Uint8Array; + auth(challenge: Uint8Array, authType: UserAuthType, authTrustLevel: AuthTrustLevel, callback: IUserAuthCallback): Uint8Array; /** * Cancels authentication with ContextID. * @since 8 - * @SysCap SystemCapability.UserIAM.UserAuth + * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @param contextID Cancel authentication and pass in ContextID. * @return Returns a number value indicating whether Cancel authentication was successful. @@ -183,6 +184,7 @@ declare namespace userAuth { /** * The authentication result code is returned through the callback. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core * @param result authentication result code. * @param extraInfo pass the specific information for different situation. * If the authentication is passed, the authentication token is returned in extrainfo, @@ -194,6 +196,7 @@ declare namespace userAuth { /** * During an authentication, the TipsCode is returned through the callback. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core * @param module the executor type for authentication. * @param acquire the tip code for different authentication executor. * @param extraInfo reserved parameter. @@ -204,6 +207,7 @@ declare namespace userAuth { /** * Authentication result: authentication token, remaining authentication times, freezing time. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core * @param token pass the authentication result if the authentication is passed. * @param remainTimes return the remaining authentication times if the authentication fails. * @param freezingTime return the freezing time if the authectication executor is locked. @@ -217,71 +221,83 @@ declare namespace userAuth { /** * Result code. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ enum ResultCode { /** * Indicates that the result is success or ability is supported. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ SUCCESS = 0, /** * Indicates the the result is failure or ability is not supported. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FAIL = 1, /** * Indicates other errors. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ GENERAL_ERROR = 2, /** * Indicates that this operation has been canceled. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ CANCELED = 3, /** * Indicates that this operation has timed out. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ TIMEOUT = 4, /** * Indicates that this authentication type is not supported. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ TYPE_NOT_SUPPORT = 5, /** * Indicates that the authentication trust level is not supported. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ TRUST_LEVEL_NOT_SUPPORT = 6, /** * Indicates that the authentication task is busy. Wait for a few seconds and try again. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ BUSY = 7, /** * Indicates incorrect parameters. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ INVALID_PARAMETERS = 8, /** * Indicates that the authenticator is locked. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ LOCKED = 9, /** * Indicates that the user has not enrolled the authenticator. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ NOT_ENROLLED = 10 } @@ -289,71 +305,83 @@ declare namespace userAuth { /** * Indicates the enumeration of prompt codes in the process of face authentication. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ enum FaceTips { /** * Indicates that the obtained facial image is too bright due to high illumination. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FACE_AUTH_TIP_TOO_BRIGHT = 1, /** * Indicates that the obtained facial image is too dark due to low illumination. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FACE_AUTH_TIP_TOO_DARK = 2, /** * Indicates that the face is too close to the device. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FACE_AUTH_TIP_TOO_CLOSE = 3, /** * Indicates that the face is too far away from the device. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FACE_AUTH_TIP_TOO_FAR = 4, /** * Indicates that the device is too high, and that only the upper part of the face is captured. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FACE_AUTH_TIP_TOO_HIGH = 5, /** * Indicates that the device is too low, and that only the lower part of the face is captured. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FACE_AUTH_TIP_TOO_LOW = 6, /** * Indicates that the device is deviated to the right, and that only the right part of the face is captured. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FACE_AUTH_TIP_TOO_RIGHT = 7, /** * Indicates that the device is deviated to the left, and that only the left part of the face is captured. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FACE_AUTH_TIP_TOO_LEFT = 8, /** * Indicates that the face moves too fast during facial information collection. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FACE_AUTH_TIP_TOO_MUCH_MOTION = 9, /** * Indicates that the face is not facing the device. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FACE_AUTH_TIP_POOR_GAZE = 10, /** * Indicates that no face is detected. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FACE_AUTH_TIP_NOT_DETECTED = 11, } @@ -361,41 +389,48 @@ declare namespace userAuth { /** * Indicates the enumeration of prompt codes in the process of fingerprint authentication. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ enum FingerprintTips { /** * Indicates that the image acquired is good. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FINGERPRINT_AUTH_TIP_GOOD = 0, /** * Indicates that the fingerprint image is too noisy due to suspected or detected dirt on sensor. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FINGERPRINT_AUTH_TIP_DIRTY = 1, /** * Indicates that the fingerprint image is too noisy to process due to a detected condition. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FINGERPRINT_AUTH_TIP_INSUFFICIENT = 2, /** * Indicates that only a partial fingerprint image is detected. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FINGERPRINT_AUTH_TIP_PARTIAL = 3, /** * Indicates that the fingerprint image is incomplete due to quick motion. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FINGERPRINT_AUTH_TIP_TOO_FAST = 4, /** * Indicates that the fingerprint image is unreadable due to lack of motion. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FINGERPRINT_AUTH_TIP_TOO_SLOW = 5 } @@ -403,17 +438,20 @@ declare namespace userAuth { /** * Credential type for authentication. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ enum UserAuthType { /** * Authentication type face. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FACE = 2, /** * Authentication type fingerprint. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ FINGERPRINT = 4 } @@ -421,29 +459,34 @@ declare namespace userAuth { /** * Trust level of authentication results. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ enum AuthTrustLevel { /** * Authentication result trusted level 1. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ ATL1 = 10000, /** * Authentication result trusted level 2. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ ATL2 = 20000, /** * Authentication result trusted level 3. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ ATL3 = 30000, /** * Authentication result trusted level 4. * @since 8 + * @syscap SystemCapability.UserIAM.UserAuth.Core */ ATL4 = 40000 } diff --git a/api/@ohos.wallpaper.d.ts b/api/@ohos.wallpaper.d.ts index b0f83f66f4de0cce8882ae534cd803761bbc1ce9..96f958acb7b1064b4945b4a7ebf7792d5820770a 100644 --- a/api/@ohos.wallpaper.d.ts +++ b/api/@ohos.wallpaper.d.ts @@ -17,8 +17,7 @@ import image from './@ohos.multimedia.image' /** * System wallpaper - * @sysCap SystemCapability.Miscservices.WallpaperFramework - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.MiscServices.Wallpaper * @import import wallpaper from '@ohos.wallpaper'; * @since 7 */ diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts index 17dd1c8aa2d855ada9d3e36a8b994b45eb4ca9e5..15a908ec67113cf100b8d14dbf9df351101c24b5 100644 --- a/api/@ohos.wantAgent.d.ts +++ b/api/@ohos.wantAgent.d.ts @@ -24,7 +24,7 @@ import { TriggerInfo } from './wantAgent/triggerInfo'; * * @name wantAgent * @since 7 - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @import import wantAgent from '@ohos.wantAgent'; * @permission N/A */ diff --git a/api/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts index f778a933ff90a61600b0a9acb191e72360717a08..4ea5cdc7270ef4f0389996847b154b952f6e53ed 100644 --- a/api/@ohos.wifi.d.ts +++ b/api/@ohos.wifi.d.ts @@ -25,11 +25,11 @@ declare namespace wifi { /** * Enables Wi-Fi. * - * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise. + * @return Returns {@code true} if the operation is successful, returns {@code false} otherwise. * * @since 6 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.MANAGE_WIFI_CONNECTION + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. */ function enableWifi(): boolean; @@ -37,11 +37,11 @@ declare namespace wifi { /** * Disables Wi-Fi. * - * @return Returns {@code true} if the operation is successful; returns {@code false} otherwise. + * @return Returns {@code true} if the operation is successful, returns {@code false} otherwise. * * @since 6 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.MANAGE_WIFI_CONNECTION + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. */ function disableWifi(): boolean; @@ -49,7 +49,7 @@ declare namespace wifi { /** * Queries the Wi-Fi status * - * @return Returns {@code true} if the Wi-Fi is active; returns {@code false} otherwise. + * @return Returns {@code true} if the Wi-Fi is active, returns {@code false} otherwise. * * @since 6 * @syscap SystemCapability.Communication.WiFi.STA @@ -62,11 +62,11 @@ declare namespace wifi { * *

This API works in asynchronous mode.

* - * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise. + * @return Returns {@code true} if the scanning is successful, returns {@code false} otherwise. * * @since 6 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.LOCATION + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION */ function scan(): boolean; @@ -77,8 +77,7 @@ declare namespace wifi { * * @since 6 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.GET_WIFI_INFO, and at least one of the permissions of - * ohos.permission.GET_WIFI_PEERS_MAC and ohos.permission.LOCATION. + * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) */ function getScanInfos(): Promise>; function getScanInfos(callback: AsyncCallback>): void; @@ -93,7 +92,7 @@ declare namespace wifi { * * @since 6 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.SET_WIFI_CONFIG + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. */ function addDeviceConfig(config: WifiDeviceConfig): Promise; @@ -105,7 +104,7 @@ declare namespace wifi { *

This method adds one configuration at a time. After this configuration is added, * your device will determine whether to connect to the hotspot. * - * @return Returns {@code true} if the untrusted hotspot configuration is added; returns {@code false} otherwise. + * @return Returns {@code true} if the untrusted hotspot configuration is added, returns {@code false} otherwise. * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO @@ -118,7 +117,7 @@ declare namespace wifi { * *

This method removes one configuration at a time. * - * @return Returns {@code true} if the untrusted hotspot configuration is removed; returns {@code false} otherwise. + * @return Returns {@code true} if the untrusted hotspot configuration is removed, returns {@code false} otherwise. * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO @@ -130,7 +129,7 @@ declare namespace wifi { * Connects to Wi-Fi network. * * @param networkId ID of the connected network. - * @return Returns {@code true} if the network connection is successful; returns {@code false} otherwise. + * @return Returns {@code true} if the network connection is successful, returns {@code false} otherwise. * * @since 6 * @syscap SystemCapability.Communication.WiFi.STA @@ -143,11 +142,11 @@ declare namespace wifi { * Connects to Wi-Fi network. * * @param config Indicates the device configuration for connection to the Wi-Fi network. - * @return Returns {@code true} if the network connection is successful; returns {@code false} otherwise. + * @return Returns {@code true} if the network connection is successful, returns {@code false} otherwise. * * @since 6 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.SET_WIFI_CONFIG, + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG and * ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. */ @@ -160,7 +159,7 @@ declare namespace wifi { * * @since 6 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.MANAGE_WIFI_CONNECTION + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. */ function disconnect(): boolean; @@ -182,7 +181,7 @@ declare namespace wifi { * Obtains information about a Wi-Fi connection. * * @return Returns the Wi-Fi connection information. - * @since 7 + * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -192,7 +191,7 @@ declare namespace wifi { /** * Checks whether a Wi-Fi connection has been set up. * - * @return Returns {@code true} if a Wi-Fi connection has been set up; returns {@code false} otherwise. + * @return Returns {@code true} if a Wi-Fi connection has been set up, returns {@code false} otherwise. * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO @@ -216,7 +215,7 @@ declare namespace wifi { * Checks whether this device supports a specified feature. * * @param featureId Indicates the ID of the feature. - * @return Returns {@code true} if this device supports the specified feature; returns {@code false} otherwise. + * @return Returns {@code true} if this device supports the specified feature, returns {@code false} otherwise. * @since 7 * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO @@ -231,7 +230,7 @@ declare namespace wifi { * @return Returns the MAC address of the Wi-Fi device. * @since 7 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.GET_WIFI_LOCAL_MAC, ohos.permission.GET_WIFI_INFO + * @permission ohos.permission.GET_WIFI_LOCAL_MAC and ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. */ function getDeviceMacAddress(): string[]; @@ -264,7 +263,7 @@ declare namespace wifi { * @return {@code true} if the Wi-Fi network is re-associate successfully. * @since 7 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.MANAGE_WIFI_CONNECTION + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. */ function reassociate(): boolean; @@ -275,7 +274,7 @@ declare namespace wifi { * @return {@code true} if the Wi-Fi network is re-connect successfully. * @since 7 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.MANAGE_WIFI_CONNECTION + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. */ function reconnect(): boolean; @@ -288,7 +287,7 @@ declare namespace wifi { * @return Returns the list of all existing Wi-Fi configurations you created on your application. * @since 7 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, ohos.permission.GET_WIFI_CONFIG + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. */ function getDeviceConfigs(): Array; @@ -302,7 +301,7 @@ declare namespace wifi { * returns {@code -1} if the specified Wi-Fi configuration is not contained in the list. * @since 7 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.SET_WIFI_CONFIG + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. */ function updateNetwork(config: WifiDeviceConfig): number; @@ -313,10 +312,10 @@ declare namespace wifi { *

The disabled network will not be associated with again. * * @param netId Identifies the network to disable. - * @return Returns {@code true} if the specified network is disabled; returns {@code false} otherwise. + * @return Returns {@code true} if the specified network is disabled, returns {@code false} otherwise. * @since 7 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.MANAGE_WIFI_CONNECTION + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. */ function disableNetwork(netId: number): boolean; @@ -328,7 +327,7 @@ declare namespace wifi { * returns {@code false} otherwise. * @since 7 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.MANAGE_WIFI_CONNECTION + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. */ function removeAllNetwork(): boolean; @@ -342,10 +341,10 @@ declare namespace wifi { * * @param id Indicates the ID of the Wi-Fi network, * which can be obtained using the {@link #addDeviceConfig} or {@link #getLinkedInfo} method. - * @return Returns {@code true} if the Wi-Fi network is deleted successfully; returns {@code false} otherwise. + * @return Returns {@code true} if the Wi-Fi network is deleted successfully, returns {@code false} otherwise. * @since 7 * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.MANAGE_WIFI_CONNECTION + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. */ function removeDevice(id: number): boolean; @@ -355,9 +354,9 @@ declare namespace wifi { * *

This method is asynchronous. After the Wi-Fi hotspot is enabled, Wi-Fi may be disabled. * - * @return Returns {@code true} if this method is called successfully; returns {@code false} otherwise. + * @return Returns {@code true} if this method is called successfully, returns {@code false} otherwise. * @since 7 - * @syscap SystemCapability.Communication.WiFi.AP + * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. */ @@ -368,9 +367,9 @@ declare namespace wifi { * *

This method is asynchronous. If Wi-Fi is enabled after the Wi-Fi hotspot is disabled, Wi-Fi may be re-enabled. * - * @return Returns {@code true} if this method is called successfully; returns {@code false} otherwise. + * @return Returns {@code true} if this method is called successfully, returns {@code false} otherwise. * @since 7 - * @syscap SystemCapability.Communication.WiFi.AP + * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. */ @@ -379,10 +378,10 @@ declare namespace wifi { /** * Checks whether a device serving as a Wi-Fi hotspot supports both the 2.4 GHz and 5 GHz Wi-Fi. * - * @return Returns {@code true} if the method is called successfully; returns {@code false} otherwise. + * @return Returns {@code true} if the method is called successfully, returns {@code false} otherwise. * @since 7 - * @syscap SystemCapability.Communication.WiFi.AP - * @permission ohos.permission.GET_WIFI_INFO, ohos.permission.MANAGE_WIFI_HOTSPOT + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. */ function isHotspotDualBandSupported(): boolean; @@ -390,9 +389,9 @@ declare namespace wifi { /** * Checks whether Wi-Fi hotspot is active on a device. * - * @return Returns {@code true} if Wi-Fi hotspot is enabled; returns {@code false} otherwise. + * @return Returns {@code true} if Wi-Fi hotspot is enabled, returns {@code false} otherwise. * @since 7 - * @syscap SystemCapability.Communication.WiFi.AP + * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. */ @@ -406,10 +405,10 @@ declare namespace wifi { * @param config Indicates the Wi-Fi hotspot configuration. * The SSID and {@code securityType} must be available and correct. * If {@code securityType} is not {@code open}, {@code preSharedKey} must be available and correct. - * @return Returns {@code true} if the method is called successfully; returns {@code false} otherwise. + * @return Returns {@code true} if the method is called successfully, returns {@code false} otherwise. * @since 7 - * @syscap SystemCapability.Communication.WiFi.AP - * @permission ohos.permission.SET_WIFI_INFO, ohos.permission.GET_WIFI_CONFIG + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. */ function setHotspotConfig(config: HotspotConfig): boolean; @@ -419,8 +418,8 @@ declare namespace wifi { * * @return Returns the configuration of an existing or enabled Wi-Fi hotspot. * @since 7 - * @syscap SystemCapability.Communication.WiFi.AP - * @permission ohos.permission.GET_WIFI_INFO, ohos.permission.GET_WIFI_CONFIG + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. */ function getHotspotConfig(): HotspotConfig; @@ -432,8 +431,8 @@ declare namespace wifi { * * @return Returns the list of clients that are connected to the Wi-Fi hotspot. * @since 7 - * @syscap SystemCapability.Communication.WiFi.AP - * @permission ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, ohos.permission.MANAGE_WIFI_HOTSPOT + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. */ function getStations(): Array; @@ -444,6 +443,7 @@ declare namespace wifi { * @return Returns the P2P connection information. * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO */ function getP2pLinkedInfo(): Promise; function getP2pLinkedInfo(callback: AsyncCallback): void; @@ -454,6 +454,7 @@ declare namespace wifi { * @return Returns the current group information. * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ function getCurrentGroup(): Promise; function getCurrentGroup(callback: AsyncCallback): void; @@ -464,26 +465,29 @@ declare namespace wifi { * @return Returns the found devices list. * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ - function getP2pDevices(): Promise; - function getP2pDevices(callback: AsyncCallback): void; + function getP2pPeerDevices(): Promise; + function getP2pPeerDevices(callback: AsyncCallback): void; /** * Creates a P2P group. * * @param config Indicates the configuration for creating a group. - * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise. + * @return Returns {@code true} if the operation is successful, returns {@code false} otherwise. * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO */ function createGroup(config: WifiP2PConfig): boolean; /** * Removes a P2P group. * - * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise. + * @return Returns {@code true} if the operation is successful, returns {@code false} otherwise. * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO */ function removeGroup(): boolean; @@ -491,36 +495,40 @@ declare namespace wifi { * Initiates a P2P connection to a device with the specified configuration. * * @param config Indicates the configuration for connecting to a specific group. - * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise. + * @return Returns {@code true} if the operation is successful, returns {@code false} otherwise. * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ function p2pConnect(config: WifiP2PConfig): boolean; /** * Canceling a P2P connection. * - * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise. + * @return Returns {@code true} if the operation is successful, returns {@code false} otherwise. * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO */ function p2pCancelConnect(): boolean; /** * Discovers Wi-Fi P2P devices. * - * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise. + * @return Returns {@code true} if the operation is successful, returns {@code false} otherwise. * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ function startDiscoverDevices(): boolean; /** * Stops discovering Wi-Fi P2P devices. * - * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise. + * @return Returns {@code true} if the operation is successful, returns {@code false} otherwise. * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO */ function stopDiscoverDevices(): boolean; @@ -528,9 +536,11 @@ declare namespace wifi { * Deletes the persistent P2P group with the specified network ID. * * @param netId Indicates the network ID of the group to be deleted. - * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise. + * @return Returns {@code true} if the operation is successful, returns {@code false} otherwise. * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. */ function deletePersistentGroup(netId: number): boolean; @@ -538,9 +548,11 @@ declare namespace wifi { * Sets the name of the Wi-Fi P2P device. * * @param devName Indicates the name to be set. - * @return Returns {@code true} if the scanning is successful; returns {@code false} otherwise. + * @return Returns {@code true} if the operation is successful, returns {@code false} otherwise. * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. */ function setDeviceName(devName: string): boolean; @@ -656,7 +668,7 @@ declare namespace wifi { * * @return Returns 0: inactive, 1: active, 2: activating, 3: deactivating * @since 7 - * @syscap SystemCapability.Communication.WiFi.AP + * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO */ function on(type: "hotspotStateChange", callback: Callback): void; @@ -667,7 +679,7 @@ declare namespace wifi { *

All callback functions will be deregistered If there is no specific callback parameter.

* * @since 7 - * @syscap SystemCapability.Communication.WiFi.AP + * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO */ function off(type: "hotspotStateChange", callback?: Callback): void; @@ -677,7 +689,7 @@ declare namespace wifi { * * @return Returns StationInfo * @since 7 - * @syscap SystemCapability.Communication.WiFi.AP + * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. */ @@ -689,7 +701,7 @@ declare namespace wifi { *

All callback functions will be deregistered If there is no specific callback parameter.

* * @since 7 - * @syscap SystemCapability.Communication.WiFi.AP + * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. */ @@ -700,7 +712,7 @@ declare namespace wifi { * * @return Returns {@link #StationInfo} object * @since 7 - * @syscap SystemCapability.Communication.WiFi.AP + * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. */ @@ -711,7 +723,7 @@ declare namespace wifi { * * @return Returns {@link #StationInfo} object * @since 7 - * @syscap SystemCapability.Communication.WiFi.AP + * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. */ @@ -723,6 +735,7 @@ declare namespace wifi { * @return Returns 1: idle, 2: starting, 3:started, 4: closing, 5: closed * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO */ function on(type: "p2pStateChange", callback: Callback): void; @@ -731,6 +744,7 @@ declare namespace wifi { * * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO */ function off(type: "p2pStateChange", callback?: Callback): void; @@ -740,16 +754,18 @@ declare namespace wifi { * @return Returns WifiP2pLinkedInfo * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO */ - function on(type: "p2pConnectionChange", callback: AsyncCallback): void; + function on(type: "p2pConnectionChange", callback: Callback): void; /** * Unsubscribe P2P connection change events. * * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO */ - function off(type: "p2pConnectionChange", callback?: AsyncCallback): void; + function off(type: "p2pConnectionChange", callback?: Callback): void; /** * Subscribe P2P local device change events. @@ -757,8 +773,9 @@ declare namespace wifi { * @return Returns WifiP2pDevice * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ - function on(type: "p2pDeviceChange", callback: AsyncCallback): void; + function on(type: "p2pDeviceChange", callback: Callback): void; /** * Unsubscribe P2P local device change events. @@ -766,8 +783,9 @@ declare namespace wifi { * @return Returns WifiP2pDevice * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.LOCATION */ - function off(type: "p2pDeviceChange", callback?: AsyncCallback): void; + function off(type: "p2pDeviceChange", callback?: Callback): void; /** * Subscribe P2P peer device change events. @@ -775,16 +793,18 @@ declare namespace wifi { * @return Returns WifiP2pDevice[] * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ - function on(type: "p2pPeerDeviceChange", callback: AsyncCallback): void; + function on(type: "p2pPeerDeviceChange", callback: Callback): void; /** * Unsubscribe P2P peer device change events. * * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.LOCATION */ - function off(type: "p2pPeerDeviceChange", callback?: AsyncCallback): void; + function off(type: "p2pPeerDeviceChange", callback?: Callback): void; /** * Subscribe P2P persistent group change events. @@ -792,6 +812,7 @@ declare namespace wifi { * @return Returns void * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO */ function on(type: "p2pPersistentGroupChange", callback: Callback): void; @@ -800,6 +821,7 @@ declare namespace wifi { * * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO */ function off(type: "p2pPersistentGroupChange", callback?: Callback): void; @@ -809,6 +831,7 @@ declare namespace wifi { * @return Returns 0: initial state, 1: discovery succeeded * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO */ function on(type: "p2pDiscoveryChange", callback: Callback): void; @@ -817,6 +840,7 @@ declare namespace wifi { * * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO */ function off(type: "p2pDiscoveryChange", callback?: Callback): void; @@ -824,7 +848,7 @@ declare namespace wifi { * Wi-Fi device configuration information. * * @since 6 - * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.STA */ interface WifiDeviceConfig { /** Wi-Fi SSID: the maximum length is 32 */ @@ -875,7 +899,8 @@ declare namespace wifi { * Wi-Fi IP configuration information. * * @since 7 - * @systemapi + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.STA */ interface IpConfig { ipAddress: number; @@ -888,6 +913,7 @@ declare namespace wifi { * Describes the scanned Wi-Fi information. * * @since 6 + * @syscap SystemCapability.Communication.WiFi.STA */ interface WifiScanInfo { /** Wi-Fi SSID: the maximum length is 32 */ @@ -922,6 +948,7 @@ declare namespace wifi { * Describes the wifi security type. * * @since 6 + * @syscap SystemCapability.Communication.WiFi.Core */ enum WifiSecurityType { /** Invalid security type */ @@ -943,7 +970,8 @@ declare namespace wifi { /** * Wi-Fi connection information. * - * @since 7 + * @since 6 + * @syscap SystemCapability.Communication.WiFi.STA */ interface WifiLinkedInfo { /** The SSID of the Wi-Fi hotspot */ @@ -1000,6 +1028,7 @@ declare namespace wifi { * Wi-Fi IP information. * * @since 7 + * @syscap SystemCapability.Communication.WiFi.STA */ interface IpInfo { /** The IP address of the Wi-Fi connection */ @@ -1028,7 +1057,8 @@ declare namespace wifi { * Wi-Fi hotspot configuration information. * * @since 7 - * @systemapi + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.AP.Core */ interface HotspotConfig { /** The SSID of the Wi-Fi hotspot */ @@ -1051,7 +1081,8 @@ declare namespace wifi { * Wi-Fi station information. * * @since 7 - * @systemapi + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.AP.Core */ interface StationInfo { /** the network name of the Wi-Fi client */ @@ -1068,7 +1099,8 @@ declare namespace wifi { * Wi-Fi IP type enumeration. * * @since 7 - * @systemapi + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.STA */ enum IpType { /** Use statically configured IP settings */ @@ -1084,8 +1116,9 @@ declare namespace wifi { /** * The state of the supplicant enumeration. * - * @since 7 - * @systemapi + * @since 6 + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.STA */ export enum SuppState { /** The supplicant is not associated with or is disconnected from the AP. */ @@ -1128,7 +1161,8 @@ declare namespace wifi { /** * The state of Wi-Fi connection enumeration. * - * @since 7 + * @since 6 + * @syscap SystemCapability.Communication.WiFi.STA */ export enum ConnState { /** The device is searching for an available AP. */ @@ -1160,6 +1194,7 @@ declare namespace wifi { * P2P device information. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.P2P */ interface WifiP2pDevice { /** Device name */ @@ -1182,6 +1217,7 @@ declare namespace wifi { * P2P config. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.P2P */ interface WifiP2PConfig { /** Device mac address */ @@ -1207,6 +1243,7 @@ declare namespace wifi { * P2P group information. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.P2P */ interface WifiP2pGroupInfo { /** Indicates whether it is group owner */ @@ -1241,6 +1278,7 @@ declare namespace wifi { * P2P connection status. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.P2P */ enum P2pConnectState { DISCONNECTED = 0, @@ -1251,6 +1289,7 @@ declare namespace wifi { * P2P linked information. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.P2P */ interface WifiP2pLinkedInfo { /** Connection status */ @@ -1267,6 +1306,7 @@ declare namespace wifi { * P2P device status. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.P2P */ enum P2pDeviceStatus { CONNECTED = 0, @@ -1280,6 +1320,7 @@ declare namespace wifi { * P2P group owner band. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.P2P */ enum GroupOwnerBand { GO_BAND_AUTO = 0, diff --git a/api/@ohos.wifiext.d.ts b/api/@ohos.wifiext.d.ts index eaad6e06a8e76e34bbb1ce71bc546357f6960395..c881d0a13205b7a00ad5d80cd7806731309a4680 100644 --- a/api/@ohos.wifiext.d.ts +++ b/api/@ohos.wifiext.d.ts @@ -32,7 +32,7 @@ declare namespace wifiext { * @return Returns {@code true} if this method is called successfully; returns {@code false} otherwise. * @since 8 * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT - * @syscap SystemCapability.Communication.WiFi.HotspotExt + * @syscap SystemCapability.Communication.WiFi.AP.Extension */ function enableHotspot(): boolean; @@ -42,7 +42,7 @@ declare namespace wifiext { * @return Returns {@code true} if this method is called successfully; returns {@code false} otherwise. * @since 8 * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT - * @syscap SystemCapability.Communication.WiFi.HotspotExt + * @syscap SystemCapability.Communication.WiFi.AP.Extension */ function disableHotspot(): boolean; @@ -53,7 +53,7 @@ declare namespace wifiext { * * @since 8 * @permission ohos.permission.GET_WIFI_INFO - * @syscap SystemCapability.Communication.WiFi.HotspotExt + * @syscap SystemCapability.Communication.WiFi.AP.Extension */ function getSupportedPowerModel(): Promise>; function getSupportedPowerModel(callback: AsyncCallback>): void; @@ -65,7 +65,7 @@ declare namespace wifiext { * * @since 8 * @permission ohos.permission.GET_WIFI_INFO - * @syscap SystemCapability.Communication.WiFi.HotspotExt + * @syscap SystemCapability.Communication.WiFi.AP.Extension */ function getPowerModel (): Promise; function getPowerModel (callback: AsyncCallback): void; @@ -77,7 +77,7 @@ declare namespace wifiext { * * @since 8 * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT - * @syscap SystemCapability.Communication.WiFi.HotspotExt + * @syscap SystemCapability.Communication.WiFi.AP.Extension */ function setPowerModel(model: PowerModel) : boolean @@ -85,6 +85,7 @@ declare namespace wifiext { * The power model enumeration. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.AP.Extension */ export enum PowerModel { /** Sleeping model. */ diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 868d38934dcaecbf529b13934f6d49f7003b2166..21a6e812bd061d363b22a4597bf0ee8249d5ef89 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -14,15 +14,16 @@ */ import { AsyncCallback, Callback } from './basic' ; import { Context } from './app/context'; -import { ContenStorage } from './@internal/component/ets/stateManagement' +import { ContentStorage } from './@internal/component/ets/stateManagement' /** * Window manager. * @syscap SystemCapability.WindowManager.WindowManager.Core -*/ + */ declare namespace window { /** * The type of a window. * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 */ enum WindowType { /** @@ -64,89 +65,6 @@ declare namespace window { FLOATING } - /** - * Create a sub window with a specific id and type, only support 7. - * @param id Indicates window id. - * @param type Indicates window type. - * @since 7 - */ - function create(id: string, type: WindowType, callback: AsyncCallback): void; - - /** - * Create a sub window with a specific id and type, only support 7. - * @param id Indicates window id. - * @param type Indicates window type. - * @since 7 - */ - function create(id: string, type: WindowType): Promise; - - /** - * Create a system window with a specific id and type. - * @param ctx Indicates the context on which the window depends - * @param id Indicates window id. - * @param type Indicates window type. - * @systemapi Hide this for inner system use. - * @since 8 - */ - function create(ctx: Context, id: string, type: WindowType): Promise; - - /** - * Find the window by id. - * @param id Indicates window id. - * @since 7 - */ - function find(id: string, callback: AsyncCallback): void; - - /** - * Find the window by id. - * @param id Indicates window id. - * @since 7 - */ - function find(id: string): Promise; - - /** - * Get the final show window. - * @param id Indicates window id. - * @since 6 - */ - function getTopWindow(callback: AsyncCallback): void; - - /** - * Get the final show window. - * @since 6 - */ - function getTopWindow(): Promise; - - /** - * Get the final show window. - * @param ctx Indicates the context on which the window depends - * @since 8 - */ - function getTopWindow(ctx: Context): Promise; - - /** - * Get the final show window. - * @param ctx Indicates the context on which the window depends - * @since 8 - */ - function getTopWindow(ctx: Context, callback: AsyncCallback): void; - - /** - * register the callback of systemBarTintChange - * @param type: 'systemBarTintChange' - * @systemapi Hide this for inner system use. - * @since 8 - */ - function on(type: 'systemBarTintChange', callback: Callback): void; - - /** - * unregister the callback of systemBarTintChange - * @param type: 'systemBarTintChange' - * @systemapi Hide this for inner system use. - * @since 8 - */ - function off(type: 'systemBarTintChange', callback?: Callback): void; - /** * Properties of status bar and navigation bar, it couldn't update automatically * @syscap SystemCapability.WindowManager.WindowManager.Core @@ -187,7 +105,7 @@ declare namespace window { * the content color of the navigation bar * @since 8 */ - navigationBarContentColor?: string; + navigationBarContentColor?: string; } /** @@ -325,7 +243,7 @@ declare namespace window { /** * Whether the window layout is in full screen mode(whether the window is immersive). The default value is false. - * @since 6 + * @since 7 */ isLayoutFullScreen: boolean @@ -337,9 +255,45 @@ declare namespace window { /** * Whether the window is touchable. The default value is false - * @since 6 + * @since 7 */ touchable: boolean + + /** + * Brightness value of window. + * @since 6 + */ + brightness: number + + /** + * The dimbehind value of window. + * @since 7 + */ + dimBehindValue: number + + /** + * Whether keep screen on. + * @since 6 + */ + isKeepScreenOn: boolean + + /** + * Whether make window in privacy mode or not. + * @since 7 + */ + isPrivacyMode: boolean + + /** + * Whether is round corner or not. + * @since 7 + */ + isRoundCorner: boolean + + /** + * Whether is transparent or not. + * @since 7 + */ + isTransparent: boolean } /** @@ -357,41 +311,132 @@ declare namespace window { WIDE_GAMUT, } + /** + * Create a sub window with a specific id and type, only support 7. + * @param id Indicates window id. + * @param type Indicates window type. + * @since 7 + */ + function create(id: string, type: WindowType, callback: AsyncCallback): void; + + /** + * Create a sub window with a specific id and type, only support 7. + * @param id Indicates window id. + * @param type Indicates window type. + * @since 7 + */ + function create(id: string, type: WindowType): Promise; + + /** + * Create a system or float window with a specific id and type. + * @param ctx Indicates the context on which the window depends + * @param id Indicates window id. + * @param type Indicates window type. + * @since 8 + */ + function create(ctx: Context, id: string, type: WindowType): Promise; + + /** + * Create a system or float window with a specific id and type. + * @param ctx Indicates the context on which the window depends + * @param id Indicates window id. + * @param type Indicates window type. + * @since 8 + */ + function create(ctx: Context, id: string, type: WindowType, callback: AsyncCallback): void; + + /** + * Find the window by id. + * @param id Indicates window id. + * @since 7 + */ + function find(id: string, callback: AsyncCallback): void; + + /** + * Find the window by id. + * @param id Indicates window id. + * @since 7 + */ + function find(id: string): Promise; + + /** + * Get the final show window. + * @param id Indicates window id. + * @since 6 + */ + function getTopWindow(callback: AsyncCallback): void; + + /** + * Get the final show window. + * @since 6 + */ + function getTopWindow(): Promise; + + /** + * Get the final show window. + * @param ctx Indicates the context on which the window depends + * @since 8 + */ + function getTopWindow(ctx: Context): Promise; + + /** + * Get the final show window. + * @param ctx Indicates the context on which the window depends + * @since 8 + */ + function getTopWindow(ctx: Context, callback: AsyncCallback): void; + + /** + * register the callback of systemBarTintChange + * @param type: 'systemBarTintChange' + * @systemapi Hide this for inner system use. + * @since 8 + */ + function on(type: 'systemBarTintChange', callback: Callback): void; + + /** + * unregister the callback of systemBarTintChange + * @param type: 'systemBarTintChange' + * @systemapi Hide this for inner system use. + * @since 8 + */ + function off(type: 'systemBarTintChange', callback?: Callback): void; + interface Window { /** - * hide sub window. + * hide window. * @systemapi Hide this for inner system use. * @since 7 */ hide (callback: AsyncCallback): void; /** - * hide sub window. + * hide window. * @systemapi Hide this for inner system use. * @since 7 */ hide(): Promise; /** - * show sub window. + * show window. * @since 7 */ show(callback: AsyncCallback): void; /** - * show sub window. + * show window. * @since 7 */ show(): Promise; /** - * Destroy the sub window. + * Destroy the window. * @since 7 */ destroy(callback: AsyncCallback): void; /** - * Destroy the sub window. + * Destroy the window. * @since 7 */ destroy(): Promise; @@ -434,21 +479,21 @@ declare namespace window { /** * Set the type of a window. - * @param windowType Indicate the type of a window. + * @param type Indicate the type of a window. * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 7 */ - setWindowType(windowType: WindowType): Promise; + setWindowType(type: WindowType): Promise; /** * Set the type of a window. - * @param windowType Indicate the type of a window. + * @param type Indicate the type of a window. * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 7 */ - setWindowType(windowType: WindowType, callback: AsyncCallback): void; + setWindowType(type: WindowType, callback: AsyncCallback): void; /** * get the properties of current window @@ -542,15 +587,6 @@ declare namespace window { */ setSystemBarProperties(systemBarProperties: SystemBarProperties): Promise; - /** - * Loads content - * @param path path Path of the page to which the content will be loaded - * @param storage storage The data object shared within the content instance loaded by the window - * @syscap SystemCapability.WindowManager.WindowManager.Core - * @since 8 - */ - loadContent(path: string, storage: ContenStorage, callback: AsyncCallback): void; - /** * Loads content * @param path path of the page to which the content will be loaded @@ -565,7 +601,7 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 7 */ - loadContent(path: string, storage?: ContenStorage): Promise; + loadContent(path: string): Promise; /** * Checks whether the window is displayed @@ -613,6 +649,22 @@ declare namespace window { */ off(type: 'systemAvoidAreaChange', callback?: Callback): void; + /** + * register the callback of keyboardHeightChange + * @param type: 'keyboardHeightChange' + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 + */ + on(type: 'keyboardHeightChange', callback: Callback): void; + + /** + * unregister the callback of keyboardHeightChange + * @param type: 'keyboardHeightChange' + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 + */ + off(type: 'keyboardHeightChange', callback?: Callback): void; + /** * Whether the window supports thr wide gamut setting. * @since 8 @@ -650,83 +702,134 @@ declare namespace window { * @since 8 */ getColorSpace(callback: AsyncCallback): void; - } - enum WindowStageEventType { - FOREGROUND = 1, - ACTIVE, - INACTIVE, - BACKGROUND, - } - /** - * WindowStage - * @syscap SystemCapability.WindowManager.WindowManager.Core - */ - interface WindowStage { /** - * Get main window of the stage. - * @since 9 + * Sets the background color of window. + * @param color the specified color. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 6 + */ + setBackgroundColor(color: string): Promise; + + /** + * Sets the background color of window. + * @param color the specified color. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 6 + */ + setBackgroundColor(color: string, callback: AsyncCallback): void; + + /** + * Sets the brightness of window. + * @param brightness the specified brightness value. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 6 */ - getMainWindow(): Promise; + setBrightness(brightness: number): Promise; + + /** + * Sets the brightness of window. + * @param brightness the specified brightness value. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 6 + */ + setBrightness(brightness: number, callback: AsyncCallback): void; + + /** + * Sets the dimBehind of window. + * @param dimBehindValue the specified dimBehind. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 + */ + setDimBehind(dimBehindValue: number, callback: AsyncCallback): void; + /** - * Get main window of the stage. - * @since 9 + * Sets the dimBehind of window. + * @param dimBehind the specified dimBehind. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 */ - getMainWindow(callback: AsyncCallback): void; + setDimBehind(dimBehindValue: number): Promise; + /** - * Create sub window of the stage. - * @param name window name of sub window - * @since 9 + * Sets whether focusable or not. + * @param isFocusable can be focus if true, or can not be focus if false. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 */ - createSubWindow(name: string): Promise; + setFocusable(isFocusable: boolean): Promise; + /** - * Create sub window of the stage. - * @param name window name of sub window - * @since 9 + * Sets whether focusable or not. + * @param isFocusable can be focus if true, or can not be focus if false. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 */ - createSubWindow(name: string, callback: AsyncCallback): void; + setFocusable(isFocusable: boolean, callback: AsyncCallback): void; + /** - * Get sub window of the stage. - * @since 9 + * Sets whether keep screen on or not. + * @param isKeepScreenOn keep screen on if true, or not if false. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 6 */ - getSubWindow(): Promise>; + setKeepScreenOn(isKeepScreenOn: boolean): Promise; + /** - * Get sub window of the stage. - * @since 9 + * Sets whether keep screen on or not. + * @param isKeepScreenOn keep screen on if true, or not if false. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 6 */ - getSubWindow(callback: AsyncCallback>): void; + setKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback): void; + /** - * Loads content - * @param path path Path of the page to which the content will be loaded - * @param storage storage The data object shared within the content instance loaded by the window + * Sets whether outside can be touch or not. + * @param touchable outside can be touch if true, or not if false. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 + */ + setOutsideTouchable(touchable: boolean): Promise; + + /** + * Sets whether outside can be touch or not. + * @param touchable outside can be touch if true, or not if false. * @syscap SystemCapability.WindowManager.WindowManager.Core - * @since 9 + * @since 7 */ - loadContent(path: string, storage: ContenStorage, callback: AsyncCallback): void; + setOutsideTouchable(touchable: boolean, callback: AsyncCallback): void; + /** - * Loads content - * @param path path of the page to which the content will be loaded + * Sets whether is private mode or not. + * @param isPrivacyMode in private mode if true, or not if false. * @syscap SystemCapability.WindowManager.WindowManager.Core - * @since 9 + * @since 7 */ - loadContent(path: string, callback: AsyncCallback): void; + setPrivacyMode(isPrivacyMode: boolean): Promise; + /** - * Loads content - * @param path path of the page to which the content will be loaded + * Sets whether is private mode or not. + * @param isPrivacyMode in private mode if true, or not if false. * @syscap SystemCapability.WindowManager.WindowManager.Core - * @since 9 + * @since 7 */ - loadContent(path: string, storage?: ContenStorage): Promise; + setPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback): void; + /** - * window stage event callback on. - * @since 9 + * Sets whether is touchable or not. + * @param isTouchable is touchable if true, or not if false. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 */ - on(eventType: 'windowStageEvent', callback: Callback): void; + setTouchable(isTouchable: boolean): Promise; + /** - * window stage event callback off. - * @since 9 + * Sets whether is touchable or not. + * @param isTouchable is touchable if true, or not if false. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 */ - off(eventType: 'windowStageEvent', callback?: Callback): void; + setTouchable(isTouchable: boolean, callback: AsyncCallback): void; } } diff --git a/api/@ohos.workScheduler.d.ts b/api/@ohos.workScheduler.d.ts deleted file mode 100644 index 74ea4e974073d5021ecfedb3bfafbac044e7b12b..0000000000000000000000000000000000000000 --- a/api/@ohos.workScheduler.d.ts +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Copyright (c) 2022 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 {AsyncCallback} from './basic'; - -/** - * Work scheduler interface. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - */ -declare namespace workScheduler { - /** - * The info of work. - * - * @name WorkInfo - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - */ - export interface WorkInfo { - /** - * The id of the current work. - */ - workId: number; - /** - * The bundle name of the current work. - */ - bundleName: string; - /** - * The ability name of the current work. - */ - abilityName: string; - /** - * Whether the current work will be saved. - */ - isPersisted?: boolean; - /** - * The network type of the current work. - */ - networkType?: NetworkType; - /** - * Whether a charging state has been set for triggering the work. - */ - isCharging?: boolean; - /** - * The charger type based on which the work is triggered. - */ - chargerType?: ChargingType; - /** - * The battery level for triggering a work. - */ - batteryLevel?: number; - /** - * The battery status for triggering a work. - */ - batteryStatus?: BatteryStatus; - /** - * Whether a storage state has been set for triggering the work. - */ - storageRequest?: StorageRequest; - /** - * The interval at which the work is repeated. - */ - repeatCycleTime?: number; - /** - * Whether the work has been set to repeat at the specified interval. - */ - isRepeat?: boolean; - /** - * The repeat of the current work. - */ - repeatCount?: number; - /** - * Whether the device deep idle state has been set for triggering the work. - */ - isDeepIdle?: boolean; - /** - * The idle wait time based on which the work is triggered. - */ - idleWaitTime?: number; - } - - /** - * Add a work to the queue. A work can be executed only when it meets the preset triggering condition - * and complies with the rules of work scheduler manager. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @param work The info of work. - * @return true if success, otherwise false. - */ - function startWork(work: WorkInfo): boolean; - - /** - * Stop a work. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @param work The info of work. - * @param needCancel True if need to be canceled after being stopped, otherwise false. - * @return true if success, otherwise false. - */ - function stopWork(work: WorkInfo, needCancel?: boolean): boolean; - - /** - * Obtains the work info of the wordId. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @param workId The id of work. - */ - function getWorkStatus(workId: number, callback: AsyncCallback): void; - function getWorkStatus(workId: number): Promise; - - /** - * Get all works of the calling application. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @return the work info list. - */ - function obtainAllWorks(callback: AsyncCallback): Array; - function obtainAllWorks(): Promise>; - - /** - * Stop all and clear all works of the calling application. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @return true if success, otherwise false. - */ - function stopAndClearWorks(): boolean; - - /** - * Check whether last work running is timeout. The interface is for repeating work. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @param workId The id of work. - * @return true if last work running is timeout, otherwise false. - */ - function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; - function isLastWorkTimeOut(workId: number): Promise; - - /** - * Describes network type. - * - * @name NetworkType - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - */ - export enum NetworkType { - /** - * Describes any network connection. - */ - NETWORK_TYPE_ANY = 0, - /** - * Describes a mobile network connection. - */ - NETWORK_TYPE_MOBILE, - /** - * Describes a wifi network connection. - */ - NETWORK_TYPE_WIFI, - /** - * Describes a bluetooth network connection. - */ - NETWORK_TYPE_BLUETOOTH, - /** - * Describes a wifi p2p network connection. - */ - NETWORK_TYPE_WIFI_P2P, - /** - * Describes a wifi wire network connection. - */ - NETWORK_TYPE_ETHERNET - } - - /** - * Describes charging type. - * - * @name ChargingType - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - */ - export enum ChargingType { - /** - * Describes any charger is connected. - */ - CHARGING_PLUGGED_ANY = 0, - /** - * Describes ac charger is connected. - */ - CHARGING_PLUGGED_AC, - /** - * Describes usb charger is connected. - */ - CHARGING_PLUGGED_USB, - /** - * Describes wireless charger is connected. - */ - CHARGING_PLUGGED_WIRELESS - } - - /** - * Describes the battery status. - * - * @name BatteryStatus - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - */ - export enum BatteryStatus { - /** - * Describes battery status is to low. - */ - BATTERY_STATUS_LOW = 0, - /** - * Describes battery status is to ok. - */ - BATTERY_STATUS_OKAY, - /** - * Describes battery status is to low or ok. - */ - BATTERY_STATUS_LOW_OR_OKAY - } - - /** - * Describes the storage request. - * - * @name StorageRequest - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - */ - export enum StorageRequest { - /** - * Describes storage is to low. - */ - STORAGE_LEVEL_LOW = 0, - /** - * Describes storage is to ok. - */ - STORAGE_LEVEL_OKAY, - /** - * Describes storage is to low or ok. - */ - STORAGE_LEVEL_LOW_OR_OKAY - } -} -export default workScheduler; \ No newline at end of file diff --git a/api/@ohos.worker.d.ts b/api/@ohos.worker.d.ts index ae05b9fa3d391e5ba5dd955e9f8645ce66568dbb..c87b14f383b17ef0f10724e4f2ff13d1f6a037e3 100644 --- a/api/@ohos.worker.d.ts +++ b/api/@ohos.worker.d.ts @@ -67,7 +67,7 @@ export interface Event { * @since 7 * @syscap SystemCapability.Utils.Lang */ -interface ErrorEvent extends Event { + export interface ErrorEvent extends Event { /** * Information about the exception. * @since 7 @@ -109,7 +109,7 @@ interface ErrorEvent extends Event { * @since 7 * @syscap SystemCapability.Utils.Lang */ -declare interface MessageEvent extends Event { + export interface MessageEvent extends Event { /** * Data transferred when an exception occurs. * @since 7 @@ -160,7 +160,7 @@ type MessageType = "message" | "messageerror"; * @since 7 * @syscap SystemCapability.Utils.Lang */ -declare interface EventTarget { + export interface EventTarget { /** * Adds an event listener to the worker. * @param type Type of the event to listen for. @@ -231,7 +231,7 @@ declare interface WorkerGlobalScope extends EventTarget { * @since 7 * @syscap SystemCapability.Utils.Lang */ -declare interface DedicatedWorkerGlobalScope extends WorkerGlobalScope { + export interface DedicatedWorkerGlobalScope extends WorkerGlobalScope { /** * The onmessage attribute of parentPort specifies the event handler * to be called then the worker thread receives a message sent by diff --git a/api/@ohos.zlib.d.ts b/api/@ohos.zlib.d.ts index b385f259f1cd004577c00ee6eef11cbf963fd633..a7da314d6ee77d02b4212a5d1cd5e7b72e6aaa13 100644 --- a/api/@ohos.zlib.d.ts +++ b/api/@ohos.zlib.d.ts @@ -105,3 +105,4 @@ declare namespace zlib { */ function unzipFile(inFile:string, outFile:string, options: Options): Promise; } +export default zlib; \ No newline at end of file diff --git a/api/common/@system.app.d.ts b/api/@system.app.d.ts similarity index 49% rename from api/common/@system.app.d.ts rename to api/@system.app.d.ts index dc37ca1fd62908e94774e9dc46e59bc0aeb7f72a..91b94ccd2b2b2b7261188d536b1406bbad5cf5a5 100644 --- a/api/common/@system.app.d.ts +++ b/api/@system.app.d.ts @@ -14,95 +14,152 @@ */ /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * Defines the AppResponse info. + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 3 */ export interface AppResponse { /** * Application bundleName. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ appID: string; /** * Application name. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 3 */ appName: string; /** * Application version name. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 3 */ versionName: string; /** * Application version. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 3 */ versionCode: number; } /** - * @devices wearable, liteWearable + * Defines the option of screenOnVisible interface. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 */ export interface ScreenOnVisibleOptions { /** * Whether to keep the application visible. The default value is false. - * @devices wearable, liteWearable * @since 3 */ visible?: boolean; /** * Called when the application always keeps visible. - * @devices wearable, liteWearable * @since 3 */ success?: () => void; /** * Called when the application fails to keep visible. - * @devices wearable, liteWearable * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices wearable, liteWearable * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * Defines the option of RequestFullWindow interface. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 + */ +export interface RequestFullWindowOptions { + /** + * Defines the number of animation options. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 + */ + duration: number; +} + +/** + * Defines the app class info. + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 3 */ export default class App { /** * Obtains the declared information in the config.json file of an application. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 3 */ static getInfo(): AppResponse; /** * Destroys the current ability. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 3 */ static terminate(): void; + /** + * Keeps the application visible after the screen is woken up. + * This method prevents the system from returning to the home screen when the screen is locked. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 + * @deprecated since 8 + */ + static screenOnVisible(options?: ScreenOnVisibleOptions): void; + /** * Requests the application to run in full window. * In some scenarios, such as semi-modal FA, the FA runs in non-full window. * In this case, you can call this API. * This API is invalid for an application already in full-window mode. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @param options Transition time from non-full window to full window, in milliseconds. * By default, the value is in direct proportion to the distance between the non-full window and the full window. - * @devices phone, tablet + * @since 3 + * @deprecated since 8 + * @useinstead startAbility */ static requestFullWindow(options?: RequestFullWindowOptions): void; + + /** + * Set image cache capacity of decoded image count. + * if not set, the application will not cache any decoded image. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param value capacity of decoded image count. + * @since 7 + */ + 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. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param value capacity of raw image data size in bytes. + * @since 7 + */ + static setImageRawDataCacheSize(value: number): void; + + /** + * Set image file cache size in bytes on disk before decode. + * if not set, the application will cache 100MB image files on disk. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param value capacity of raw image data size in bytes. + * @since 7 + */ + static setImageFileCacheSize(value: number): void; } diff --git a/api/app/abilityMissionInfo.d.ts b/api/@system.battery.d.ts old mode 100644 new mode 100755 similarity index 33% rename from api/app/abilityMissionInfo.d.ts rename to api/@system.battery.d.ts index 19c7870cd494ba9675f0ea585dcec0b7fe1ae93d..eb9ffea7e1895a19d87c6129d69f082b3dbed479 --- a/api/app/abilityMissionInfo.d.ts +++ b/api/@system.battery.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2022 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 @@ -13,44 +13,58 @@ * limitations under the License. */ -import { ElementName } from '../bundle/elementName'; - /** - * @name Mission information corresponding to ability - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core - * @import import AbilityMissionInfo from 'app/abilityMissionInfo' - * @permission N/A + * @syscap SystemCapability.PowerManager.BatteryManager.Core + * @since 3 */ -export interface AbilityMissionInfo { + export interface BatteryResponse { /** - * @default Unique identification of task stack information corresponding to ability - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * Whether the battery is being charged. + * @since 3 */ - missionId: number; + charging: boolean; /** - * @default The component launched as the first ability in the task stack - * This can be considered the "application" of this task stack - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * Current battery level, which ranges from 0.00 to 1.00. + * @since 3 */ - bottomAbility: ElementName; + level: number; +} +/** + * @syscap SystemCapability.PowerManager.BatteryManager.Core + * @since 3 + */ +export interface GetStatusOptions { /** - * @default The ability component at the top of the history stack of the task - * This is what the user is currently doing - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * Called when the current charging state and battery level are obtained. + * @since 3 */ - topAbility: ElementName; + success?: (data: BatteryResponse) => void; /** - * @default The corresponding ability description information in the task stack - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * Called when the current charging state and battery level fail to be obtained. + * @since 3 */ - windowMode: number; + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; } +/** + * @syscap SystemCapability.PowerManager.BatteryManager.Core + * @since 3 + * @import battery from '@system.battery'; + */ +export default class Battery { + /** + * Obtains the current charging state and battery level. + * @param options Options. + * @since 3 + */ + static getStatus(options?: GetStatusOptions): void; +} \ No newline at end of file diff --git a/api/@system.bluetooth.d.ts b/api/@system.bluetooth.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..901b4b0a36c6413341e566e73dbe26607fc9a3e2 --- /dev/null +++ b/api/@system.bluetooth.d.ts @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2022 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. + */ + +/** + * @syscap SystemCapability.Communication.Bluetooth.Lite + * @since 6 + */ +export interface StartBLEScanOptions { + interval: number; + success: () => void; + fail: (data: string, code: number) => void; + complete: () => void; +} + +/** + * @syscap SystemCapability.Communication.Bluetooth.Lite + * @since 6 + */ +export interface StopBLEScanOptions { + success: () => void; + fail: (data: string, code: number) => void; + complete: () => void; +} + +/** + * @syscap SystemCapability.Communication.Bluetooth.Lite + * @since 6 + */ +export interface BluetoothDevice { + addrType: "public" | "random"; + addr: string; + rssi: number; + txpower: string; + data: string; +} + +/** + * @syscap SystemCapability.Communication.Bluetooth.Lite + * @since 6 + */ +export interface BLEFoundResponse { + devices: Array; +} + +/** + * @syscap SystemCapability.Communication.Bluetooth.Lite + * @since 6 + */ +export interface SubscribeBLEFoundOptions { + success: (data: BLEFoundResponse) => void; + fail: (data: string, code: number) => void; +} + +/** + * @syscap SystemCapability.Communication.Bluetooth.Lite + * @since 6 + */ +export default class Bluetooth { + /** + * Start BLE scan + * @param options Options + */ + static startBLEScan(options: StartBLEScanOptions): void; + + /** + * Stop BLE scan + * @param options Options + */ + static stopBLEScan(options: StopBLEScanOptions): void; + + /** + * Subscribe BLE found + * @param options Options + */ + static subscribeBLEFound(options: SubscribeBLEFoundOptions): void; + + /** + * Stop the subscription of BLE found + */ + static unsubscribeBLEFound(): void; +} \ No newline at end of file diff --git a/api/@system.brightness.d.ts b/api/@system.brightness.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..6e67325d6f9423efb33d11f4d662c714926c9b24 --- /dev/null +++ b/api/@system.brightness.d.ts @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2022 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. + */ + +/** + * @syscap SystemCapability.PowerManager.DisplayPowerManager + * @since 3 + */ +export interface BrightnessResponse { + /** + * Screen brightness, which ranges from 1 to 100. + * @since 3 + */ + value: number; +} + +/** + * @syscap SystemCapability.PowerManager.DisplayPowerManager + * @since 3 + */ +export interface GetBrightnessOptions { + /** + * Called when the current screen brightness is obtained. + * @since 3 + */ + success?: (data: BrightnessResponse) => void; + + /** + * Called when the current screen brightness fails to be obtained. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +/** + * @syscap SystemCapability.PowerManager.DisplayPowerManager + * @since 3 + */ +export interface SetBrightnessOptions { + /** + * Screen brightness. The value is an integer ranging from 1 to 100. + * If the value is less than or equal to 0, value 1 will be used. + * If the value is greater than 100, value 100 will be used. + * If the value contains decimals, the integral part of the value will be used. + * For example, if value is 8.1 is set, value 8 will be used. + * @since 3 + */ + value: number; + + /** + * Called when the setting is successful. + * @since 3 + */ + success?: () => void; + + /** + * Called when the setting fails. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void +} + +/** + * @syscap SystemCapability.PowerManager.DisplayPowerManager + * @since 3 + */ +export interface BrightnessModeResponse { + /** + * The value can be 0 or 1. + * 0: The screen brightness is manually adjusted. + * 1: The screen brightness is automatically adjusted. + * @since 3 + */ + mode: number; +} + +/** + * @syscap SystemCapability.PowerManager.DisplayPowerManager + * @since 3 + */ +export interface GetBrightnessModeOptions { + /** + * Called when the screen brightness adjustment mode is obtained. + * @since 3 + */ + success?: (data: BrightnessModeResponse) => void; + + /** + * Called when the screen brightness adjustment mode fails to be obtained. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +/** + * @syscap SystemCapability.PowerManager.DisplayPowerManager + * @since 3 + */ +export interface SetBrightnessModeOptions { + /** + * The screen brightness mode. + * 0: The screen brightness is manually adjusted. + * 1: The screen brightness is automatically adjusted. + * @since 3 + */ + mode: number; + + /** + * Called when the setting is successful. + * @since 3 + */ + success?: () => void; + + /** + * Called when the setting fails. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void +} + +/** + * @syscap SystemCapability.PowerManager.DisplayPowerManager + * @since 3 + */ +export interface SetKeepScreenOnOptions { + /** + * Whether to always keep the screen on. + * @since 3 + */ + keepScreenOn: boolean; + + /** + * Called when the setting is successful. + * @since 3 + */ + success?: () => void; + + /** + * Called when the setting fails. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void +} + +/** + * @syscap SystemCapability.PowerManager.DisplayPowerManager + * @since 3 + * @import brightness from '@system.brightness'; + */ +export default class Brightness { + /** + * Obtains the current screen brightness. + * @param options Options. + * @since 3 + */ + static getValue(options?: GetBrightnessOptions): void; + + /** + * Sets the screen brightness. + * @param options Options. + * @since 3 + */ + static setValue(options?: SetBrightnessOptions): void; + + /** + * Obtains the screen brightness adjustment mode. + * @param options Options. + * @since 3 + */ + static getMode(options?: GetBrightnessModeOptions): void; + + /** + * Sets the screen brightness adjustment mode. + * @param options Options. + * @since 3 + */ + static setMode(options?: SetBrightnessModeOptions): void; + + /** + * Sets whether to always keey the screen on. + * @param options Options. + * @since 3 + */ + static setKeepScreenOn(options?: SetKeepScreenOnOptions): void; +} \ No newline at end of file diff --git a/api/common/@system.cipher.d.ts b/api/@system.cipher.d.ts similarity index 74% rename from api/common/@system.cipher.d.ts rename to api/@system.cipher.d.ts index cffd00ed3a3fd1ef1426a05eab2e4aa08e92292a..11f0cfb9f5ec691855575920d970e9a1077dea4d 100644 --- a/api/common/@system.cipher.d.ts +++ b/api/@system.cipher.d.ts @@ -14,18 +14,25 @@ */ /** - * @devices smartVision + * Defines the cipher response. + * @since 3 + * @syscap SystemCapability.Security.Cipher + * @permission N/A */ export interface CipherResponse { /** * response text - * @devices smartVision + * @since 3 + * @syscap SystemCapability.Security.Cipher */ text: string; } /** - * @devices smartVision + * Defines the rsa cipher options. + * @since 3 + * @syscap SystemCapability.Security.Cipher + * @permission N/A */ export interface CipherRsaOptions { /** @@ -33,8 +40,8 @@ export interface CipherRsaOptions { * The options are as follows: * encrypt: Encrypts data. * decrypt: Decrypts data. - * @devices smartVision * @since 3 + * @syscap SystemCapability.Security.Cipher */ action: string; @@ -45,8 +52,8 @@ export interface CipherRsaOptions { * For example, if the key length is 1024 bytes, the text cannot exceed 62 bytes (1024/8 - 66 = 62). * The text content to be decrypted must be a binary value encoded using Base64. * The default format is used for Base64 encoding. - * @devices smartVision * @since 3 + * @syscap SystemCapability.Security.Cipher */ text: string; @@ -54,43 +61,46 @@ export interface CipherRsaOptions { * Keys encrypted using RSA. * During encryption, this parameter is a public key. * During decryption, it is a private key. - * @devices smartVision * @since 3 + * @syscap SystemCapability.Security.Cipher */ key: string; /** * RSA algorithm padding. * The default value is RSA/None/OAEPWithSHA256AndMGF1Padding. - * @devices smartVision * @since 3 + * @syscap SystemCapability.Security.Cipher */ transformation?: string; /** * Called when data is encrypted or decrypted successfully. - * @devices smartVision * @since 3 + * @syscap SystemCapability.Security.Cipher */ success: (data: CipherResponse) => void; /** * Called when data fails to be encrypted or decrypted. - * @devices smartVision * @since 3 + * @syscap SystemCapability.Security.Cipher */ fail: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices smartVision * @since 3 + * @syscap SystemCapability.Security.Cipher */ complete: () => void; } /** - * @devices smartVision + * Defines the aes cipher options. + * @since 3 + * @syscap SystemCapability.Security.Cipher + * @permission N/A */ export interface CipherAesOptions { /** @@ -98,7 +108,7 @@ export interface CipherAesOptions { * The options are as follows: * encrypt: Encrypts data. * decrypt: Decrypts data. - * @devices smartVision + * @syscap SystemCapability.Security.Cipher * @since 3 */ action: string; @@ -108,14 +118,14 @@ export interface CipherAesOptions { * The text to be encrypted must be a common text. * The text content to be decrypted must be a binary value encoded using Base64. * The default format is used for Base64 encoding. - * @devices smartVision + * @syscap SystemCapability.Security.Cipher * @since 3 */ text: string; /** * Key used for encryption or decryption, which is a character string encrypted using Base64. - * @devices smartVision + * @syscap SystemCapability.Security.Cipher * @since 3 */ key: string; @@ -123,7 +133,7 @@ export interface CipherAesOptions { /** * Encryption mode and padding of the AES algorithm. * The default value is AES/CBC/PKCS5Padding. - * @devices smartVision + * @syscap SystemCapability.Security.Cipher * @since 3 */ transformation?: string; @@ -132,7 +142,7 @@ export interface CipherAesOptions { * Initial vector for AES-based encryption and decryption. * The value is a character string encoded using Base64. * The default value is the key value. - * @devices smartVision + * @syscap SystemCapability.Security.Cipher * @since 3 */ iv?: string; @@ -140,7 +150,7 @@ export interface CipherAesOptions { /** * Offset of the initial vector for AES-based encryption and decryption. * The default value is 0. - * @devices smartVision + * @syscap SystemCapability.Security.Cipher * @since 3 */ ivOffset?: string; @@ -148,48 +158,51 @@ export interface CipherAesOptions { /** * Length of the initial vector for AES-based encryption and decryption. * The default value is 16. - * @devices smartVision + * @syscap SystemCapability.Security.Cipher * @since 3 */ ivLen?: string; /** * Called when data is encrypted or decrypted successfully. - * @devices smartVision + * @syscap SystemCapability.Security.Cipher * @since 3 */ success: (data: CipherResponse) => void; /** * Called when data fails to be encrypted or decrypted. - * @devices smartVision + * @syscap SystemCapability.Security.Cipher * @since 3 */ fail: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices smartVision + * @syscap SystemCapability.Security.Cipher * @since 3 */ complete: () => void; } /** - * @devices smartVision + * Defines the cipher functions. + * @since 3 + * @syscap SystemCapability.Security.Cipher + * @permission N/A */ export default class Cipher { /** * Encrypts or decrypts data using RSA. * @param options RSA options - * @devices smartVision + * @syscap SystemCapability.Security.Cipher */ static rsa(options: CipherRsaOptions): void; /** * Encrypts or decrypts data using AES. * @param options AES options - * @devices smartVision + * @syscap SystemCapability.Security.Cipher */ static aes(options: CipherAesOptions): void; } diff --git a/api/common/@system.configuration.d.ts b/api/@system.configuration.d.ts similarity index 79% rename from api/common/@system.configuration.d.ts rename to api/@system.configuration.d.ts index 00540ce94e0cf49ee20cc96f54a4d43d27bf4bce..86700e21c41114fe8b82153f5c925bfbcae651c2 100644 --- a/api/common/@system.configuration.d.ts +++ b/api/@system.configuration.d.ts @@ -14,19 +14,20 @@ */ /** - * @devices tv, phone, tablet, wearable, liteWearable + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 3 */ export interface LocaleResponse { /** * Current language of the application. Example: zh. - * @devices tv, phone, tablet, wearable, liteWearable + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 3 */ language: string; /** * Country or region. Example: CN. - * @devices tv, phone, tablet, wearable, liteWearable + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 3 */ countryOrRegion: string; @@ -35,19 +36,21 @@ export interface LocaleResponse { * Text layout direction. Available values are as follows: * ltr: The text direction is from left to right. * rtl: The text direction is from right to left. - * @devices tv, phone, tablet, wearable, liteWearable + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 3 */ dir: "ltr" | "rtl"; } /** - * @devices tv, phone, tablet, wearable, liteWearable + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 3 */ export default class Configuration { /** * Obtains the current locale of the application, which is the same as the system locale. - * @devices tv, phone, tablet, wearable, liteWearable + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 3 */ static getLocale(): LocaleResponse; } diff --git a/api/@system.device.d.ts b/api/@system.device.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6c741970277250c1ed6f4e298e33879a0ec593f8 --- /dev/null +++ b/api/@system.device.d.ts @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2020 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. + */ + +/** + * @syscap SystemCapability.Startup.SystemInfo + */ +export interface DeviceResponse { + /** + * Brand. + * @syscap SystemCapability.Startup.SystemInfo + * @since 3 + */ + brand: string; + + /** + * Manufacturer. + * @syscap SystemCapability.Startup.SystemInfo + * @since 3 + */ + manufacturer: string; + + /** + * Model. + * @syscap SystemCapability.Startup.SystemInfo + * @since 3 + */ + model: string; + + /** + * Product number. + * @syscap SystemCapability.Startup.SystemInfo + * @since 3 + */ + product: string; + + /** + * System language. + * @syscap SystemCapability.Startup.SystemInfo + * @since 4 + */ + language: string; + + /** + * System region. + * @syscap SystemCapability.Startup.SystemInfo + * @since 4 + */ + region: string; + + /** + * Window width. + * @syscap SystemCapability.Startup.SystemInfo + * @since 3 + */ + windowWidth: number; + + /** + * Window Height. + * @syscap SystemCapability.Startup.SystemInfo + * @since 3 + */ + windowHeight: number; + + /** + * Screen density. + * @syscap SystemCapability.Startup.SystemInfo + * @since 4 + */ + screenDensity: number; + + /** + * Screen shape. The options are as follows: + * rect: Rectangle screen. + * circle: Circle screen. + * @syscap SystemCapability.Startup.SystemInfo + * @since 4 + */ + screenShape: "rect" | "circle"; + + /** + * API version. + * @syscap SystemCapability.Startup.SystemInfo + * @since 4 + */ + apiVersion: number; + + /** + * Device type. The options are as follows: + * phone: smartphone + * tablet: tablet + * tv: smart TV + * wearable: wearable + * liteWearable: lite wearable + * ar: AR + * vr: virtual reality + * earphones: headset + * pc: personal computer + * speaker: speaker + * smartVision: smart visual device + * linkIoT: connection module + * @syscap SystemCapability.Startup.SystemInfo + * @since 4 + */ + deviceType: string; +} + +export interface GetDeviceOptions { + /** + * Called when the device information is obtained. + * @syscap SystemCapability.Startup.SystemInfo + * @since 3 + */ + success?: (data: DeviceResponse) => void; + + /** + * Called when the device information fails to be obtained. + * @syscap SystemCapability.Startup.SystemInfo + * @since 3 + */ + fail?: (data: any, code: number) => void; + + /** + * Called when the execution is completed. + * @syscap SystemCapability.Startup.SystemInfo + * @since 3 + */ + complete?: () => void; +} + +/** + * getInfo interface + */ +export default class Device { + /** + * Obtains the device information. + * @syscap SystemCapability.Startup.SystemInfo + * @param options Options. + */ + static getInfo(options?: GetDeviceOptions): void; +} diff --git a/api/@system.fetch.d.ts b/api/@system.fetch.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b36c780dbd99339081b90d156948b85406c0920c --- /dev/null +++ b/api/@system.fetch.d.ts @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2022 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 import fetch from '@system.fetch'; + * @since 3 + * @syscap SystemCapability.Communication.NetStack + */ +export interface FetchResponse { + /** + * Server status code. + * @since 3 + */ + code: number; + + /** + * Data returned by the success function. + * @since 3 + */ + data: string | object; + + /** + * All headers in the response from the server. + * @since 3 + */ + headers: Object; +} + +/** + * @import import fetch from '@system.fetch'; + * @since 3 + * @syscap SystemCapability.Communication.NetStack + */ +export default class Fetch { + /** + * Obtains data through the network. + * @param options + */ + static fetch(options: { + /** + * Resource URL. + * @since 3 + */ + url: string; + + /** + * Request parameter, which can be of the string type or a JSON object. + * @since 3 + */ + data?: string | object; + + /** + * Request header, which accommodates all attributes of the request. + * @since 3 + */ + header?: Object; + + /** + * Request methods available: OPTIONS, GET, HEAD, POST, PUT, DELETE and TRACE. The default value is GET. + * @since 3 + */ + method?: string; + + /** + * The return type can be text, or JSON. By default, the return type is determined based on Content-Type in the header returned by the server. + * @since 3 + */ + responseType?: string; + + /** + * Called when the network data is obtained successfully. + * @since 3 + */ + success?: (data: FetchResponse) => void; + + /** + * Called when the network data fails to be obtained. + * @since 3 + */ + fail?: (data: any, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; + }): void; +} diff --git a/api/common/@system.file.d.ts b/api/@system.file.d.ts similarity index 70% rename from api/common/@system.file.d.ts rename to api/@system.file.d.ts index 7f2424a1f561c551aa3e61a52535a704e13e7f5a..9bd26a69d357ab1ce62b1b475c878890c04ca67b 100644 --- a/api/common/@system.file.d.ts +++ b/api/@system.file.d.ts @@ -16,6 +16,7 @@ export interface FileResponse { /** * File URI. + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; @@ -23,6 +24,7 @@ export interface FileResponse { /** * File size, in bytes. * If type is dir, the length value is fixed to 0. + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ length: number; @@ -30,6 +32,7 @@ export interface FileResponse { /** * Timestamp when the file is stored, which is the number of milliseconds elapsed since 1970/01/01 00:00:00. * For lite wearables, the value is fixed to 0, because this parameter is restricted by the underlying file system. + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ lastModifiedTime: number; @@ -38,6 +41,7 @@ export interface FileResponse { * File type. The values are as follows: * dir: directory * file: file + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ type: "dir" | "file"; @@ -45,13 +49,15 @@ export interface FileResponse { /** * File list. When the recursive value is true and the type is dir, the file information under the subdirectory will be returned. * Otherwise, no value will be returned. + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ subFiles?: Array; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileMoveOption { /** @@ -59,7 +65,7 @@ export interface FileMoveOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ srcUri: string; @@ -69,7 +75,7 @@ export interface FileMoveOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ dstUri: string; @@ -77,39 +83,41 @@ export interface FileMoveOption { /** * Called when the source file is moved to the specified location successfully. * This function returns the URI of the file moved to the target location. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: (uri: string) => void; /** * Called when moving fails. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileListResponse { /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fileList: Array; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileListOption { /** @@ -117,28 +125,28 @@ export interface FileListOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; /** * Called when the list is obtained successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: (data: FileListResponse) => void; /** * Called when the list fails to be obtained. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; @@ -150,7 +158,7 @@ export interface FileCopyOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ srcUri: string; @@ -160,7 +168,7 @@ export interface FileCopyOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ dstUri: string; @@ -168,21 +176,21 @@ export interface FileCopyOption { /** * Called when the copy file is saved successful. * This function returns the URI of the file saved to the target location. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: (uri: string) => void; /** * Called when the copy or save operation fails. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; @@ -194,7 +202,7 @@ export interface FileGetOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; @@ -202,28 +210,28 @@ export interface FileGetOption { /** * Whether to recursively obtain the file list under a subdirectory. * The default value is false. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ recursive?: boolean; /** * Called when file information is obtained successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: (file: FileResponse) => void; /** * Called when file information fails to be obtained. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; @@ -235,35 +243,36 @@ export interface FileDeleteOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; /** * Called when local files are deleted successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: () => void; /** * Called when the deletion fails. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileWriteTextOption { /** @@ -271,60 +280,61 @@ export interface FileWriteTextOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; /** * Character string to write into the local file. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ text: string; /** * Encoding format. The default format is UTF-8. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ encoding?: string; /** * Whether to enable the append mode. The default value is false. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ append?: boolean; /** * Called when texts are written into a file successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: () => void; /** * Called when texts fail to be written into a file. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileReadTextResponse { /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ text: string; @@ -336,7 +346,7 @@ export interface FileReadTextOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; @@ -344,7 +354,7 @@ export interface FileReadTextOption { /** * Encoding format. The default format is UTF-8. * Currently, only UTF-8 is supported. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ encoding?: string; @@ -352,7 +362,7 @@ export interface FileReadTextOption { /** * Position where the reading starts. * The default value is the start position of the file. - * @devices liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ position?: number; @@ -360,35 +370,36 @@ export interface FileReadTextOption { /** * Position where the reading starts. * The default value is the start position of the file. - * @devices liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ length?: number; /** * Called when texts are read successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: (data: FileReadTextResponse) => void; /** * Called when texts fail to be read. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileWriteArrayBufferOption { /** @@ -396,21 +407,21 @@ export interface FileWriteArrayBufferOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; /** * Buffer from which the data is derived. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ buffer: Uint8Array; /** * Offset to the position where the writing starts. The default value is 0. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ position?: number; @@ -418,46 +429,48 @@ export interface FileWriteArrayBufferOption { /** * Whether to enable the append mode. * The default value is false. If the value is true, the position parameter will become invalid. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ append?: boolean; /** * Called when data from a buffer is written into a file successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: () => void; /** * Called when data from a buffer fails to be written into a file. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileReadArrayBufferResponse { /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ buffer: Uint8Array; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileReadArrayBufferOption { /** @@ -465,7 +478,7 @@ export interface FileReadArrayBufferOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; @@ -473,7 +486,7 @@ export interface FileReadArrayBufferOption { /** * Position where the reading starts. * The default value is the start position of the file. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ position?: number; @@ -481,35 +494,36 @@ export interface FileReadArrayBufferOption { /** * Length of the content to read. * If this parameter is not set, all content of the file will be read. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ length?: number; /** * Called when the buffer data is read successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: (data: FileReadArrayBufferResponse) => void; /** * Called when the buffer data fails to be read. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileAccessOption { /** @@ -517,35 +531,36 @@ export interface FileAccessOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; /** * Called when the check result is obtained successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: () => void; /** * Called when the check fails. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileMkdirOption { /** @@ -554,7 +569,7 @@ export interface FileMkdirOption { * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. * 3. A maximum of five recursions are allowed for creating the directory. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; @@ -562,35 +577,36 @@ export interface FileMkdirOption { /** * Whether to create the directory after creating its upper-level directory recursively. * The default value is false. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ recursive?: boolean; /** * Called when the directory is created successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: () => void; /** * Called when the creation fails. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileRmdirOption { /** @@ -598,7 +614,7 @@ export interface FileRmdirOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; @@ -606,118 +622,131 @@ export interface FileRmdirOption { /** * Whether to delete files and subdirectories recursively. * The default value is false. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ recursive?: boolean; /** * Called when the directory is deleted successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: () => void; /** * Called when the deletion fails. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export default class File { /** * Moves the source file to a specified location. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static move(options: FileMoveOption): void; /** * Copies a source file and save the copy to a specified location. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static copy(options: FileCopyOption): void; /** * Obtains the list of files in a specified directory. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static list(options: FileListOption): void; /** * Obtains information about a local file. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static get(options: FileGetOption): void; /** * Deletes local files. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static delete(options: FileDeleteOption): void; /** * Writes texts into a file. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static writeText(options: FileWriteTextOption): void; /** * Reads texts from a file. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static readText(options: FileReadTextOption): void; /** * Writes data from a buffer into a file. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static writeArrayBuffer(options: FileWriteArrayBufferOption): void; /** * Reads buffer data from a file. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static readArrayBuffer(options: FileReadArrayBufferOption): void; /** * Checks whether a file or directory exists. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static access(options: FileAccessOption): void; /** * Creates a directory. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static mkdir(options: FileMkdirOption): void; /** * Deletes a directory. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static rmdir(options: FileRmdirOption): void; } diff --git a/api/@system.geolocation.d.ts b/api/@system.geolocation.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d47a68ef7e6c9c020cf354ac7e49648b2f173244 --- /dev/null +++ b/api/@system.geolocation.d.ts @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2022 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. + */ + +/** + * @syscap SystemCapability.Location.Location.Lite + */ +export interface GeolocationResponse { + /** + * Longitude. + * @since 3 + */ + longitude: number; + + /** + * Latitude. + * @since 3 + */ + latitude: number; + + /** + * Altitude. + * @since 3 + */ + altitude: number; + + /** + * Location accuracy. + * @since 3 + */ + accuracy: number; + + /** + * Time when the location is obtained. + * @since 3 + */ + time: number; +} + +/** + * @syscap SystemCapability.Location.Location.Lite + * @permission ohos.permission.LOCATION + */ +export interface GetLocationOption { + /** + * Timeout duration, in milliseconds. + * For the rich device, the default value is 30000. + * For the lite wearable device, the default value is 180000. + * The timeout duration is necessary in case no result is returned if the request to obtain the geographic location is rejected for the lack of the required permission, weak positioning signal, or incorrect location settings. After the timeout duration expires, the fail function will be called. + * The value is a 32-digit positive integer. + * If the value set is less than or equal to 0, the default value will be used. + * @since 3 + */ + timeout?: number; + + /** + * Coordinate system type. Available types can be obtained using getSupportedCoordTypes. + * The default type is wgs84. + * @since 3 + */ + coordType?: string; + + /** + * Called when the geographic location is obtained. + * @since 3 + */ + success?: (data: GeolocationResponse) => void; + + /** + * Called when the location types fail to be obtained + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +/** + * @syscap SystemCapability.Location.Location.Lite + */ +export interface GetLocationTypeResponse { + /** + * @since 3 + */ + types: Array; +} + +/** + * @syscap SystemCapability.Location.Location.Lite + */ +export interface GetLocationTypeOption { + /** + * Called when the location types are obtained. + * @since 3 + */ + success?: (data: GetLocationTypeResponse) => void; + + /** + * Called when the location types fail to be obtained. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +/** + * @syscap SystemCapability.Location.Location.Lite + * @permission ohos.permission.LOCATION + */ +export interface SubscribeLocationOption { + /** + * Coordinate system type. Available types can be obtained using getSupportedCoordTypes. + * The default type is wgs84. + * @since 3 + */ + coordType?: string; + + /** + * Called whenever the geographical location changes. + * @since 3 + */ + success: (data: GeolocationResponse) => void; + + /** + * Called when the listening fails. + * @since 3 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @syscap SystemCapability.Location.Location.Lite + */ +export default class Geolocation { + /** + * Obtains the geographic location. + * @permission ohos.permission.LOCATION + * @param options Options. + */ + static getLocation(options?: GetLocationOption): void; + + /** + * Obtains the location types supported by the system. + * @param options Options. + */ + static getLocationType(options?: GetLocationTypeOption): void; + + /** + * Listens to the geographical location. If this method is called multiple times, the last call takes effect. + * @permission ohos.permission.LOCATION + * @param options Options. + */ + static subscribe(options: SubscribeLocationOption): void; + + /** + * Cancels listening to the geographical location. + * @permission ohos.permission.LOCATION + */ + static unsubscribe(): void; + + /** + * Obtains the supported coordinate system types. + * @returns A string array of the supported coordinate system types, for example, ['wgs84']. + */ + static getSupportedCoordTypes(): Array; +} diff --git a/api/common/@system.mediaquery.d.ts b/api/@system.mediaquery.d.ts similarity index 72% rename from api/common/@system.mediaquery.d.ts rename to api/@system.mediaquery.d.ts index c2c27bc3acb3cbccc4ab01e5394cf745e7c10306..445cd2d1ee6c646ceddebbbd3c82b0d937fc9f46 100644 --- a/api/common/@system.mediaquery.d.ts +++ b/api/@system.mediaquery.d.ts @@ -14,24 +14,29 @@ */ /** - * @devices tv, phone, tablet, wearable + * Defines the MediaQuery event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 */ export interface MediaQueryEvent { /** - * @devices tv, phone, tablet, wearable + * The result of match result. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ matches: boolean; } /** - * @devices tv, phone, tablet, wearable + * Defines the MediaQuery list info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 */ export interface MediaQueryList { /** * Serialized media query condition. * This parameter is read-only. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ media?: string; @@ -39,14 +44,14 @@ export interface MediaQueryList { /** * Whether the query is successful. True if the query condition is matched successfully, false otherwise. * This parameter is read-only. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ matches?: boolean; /** * Called when the matches value changes. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ onchange?: (matches: boolean) => void; @@ -54,26 +59,29 @@ export interface MediaQueryList { /** * Adds a listening function to MediaQueryList. * The listening function must be added before onShow is called, that is, added to the onInit or onReady function. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ addListener(callback: (event: MediaQueryEvent) => void): void; /** * Removes a listening function from MediaQueryList. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ removeListener(callback: (event: MediaQueryEvent) => void): void; } /** - * @devices tv, phone, tablet, wearable + * Defines the mediaqurey interface. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 */ export default class MediaQuery { /** * Queries a media item and returns a MediaQueryList object. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 */ static matchMedia(condition: string): MediaQueryList; } diff --git a/api/@system.network.d.ts b/api/@system.network.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..977bcd3414c0135317a20a7c5db1aeeb8ef3a0d2 --- /dev/null +++ b/api/@system.network.d.ts @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2022 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 import network from '@system.network'; + * @since 3 + * @syscap SystemCapability.Communication.NetManager.Core + */ +export interface NetworkResponse { + /** + * Network type. The values can be 2G, 3G, 4G, WiFi, or none. + * @since 3 + */ + type: string; + + /** + * Whether the billing is based on the data volume. + * @since 3 + */ + metered: boolean; +} + +/** + * @import import network from '@system.network'; + * @since 3 + * @syscap SystemCapability.Communication.NetManager.Core + */ +export default class Network { + /** + * Obtains the network type. + * @param options + */ + static getType(options?: { + /** + * Called when the network type is obtained. + * @since 3 + */ + success?: (data: NetworkResponse) => void; + + /** + * Called when the network type fails to be obtained. + * @since 3 + */ + fail?: (data: any, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; + }): void; + + /** + * Listens to the network connection state. If this method is called multiple times, the last call takes effect. + * @param options + */ + static subscribe(options?: { + /** + * Called when the network connection state changes. + * @since 3 + */ + success?: (data: NetworkResponse) => void; + + /** + * Called when the listening fails. + * @since 3 + */ + fail?: (data: any, code: number) => void; + }): void; + + /** + * Cancels listening to the network connection state. + * @param options + */ + static unsubscribe(): void; +} diff --git a/api/liteWearable/@system.router.d.ts b/api/@system.notification.d.ts similarity index 32% rename from api/liteWearable/@system.router.d.ts rename to api/@system.notification.d.ts index 6435e2e6930ef8268b9059d2bab8fd478d57d5bc..4c2f763cfe4581100839d2e595a0532fe6830459 100644 --- a/api/liteWearable/@system.router.d.ts +++ b/api/@system.notification.d.ts @@ -1,47 +1,75 @@ -/* - * Copyright (c) 2020 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. - */ - -export interface RouterOptions { - /** - * URI of the destination page, which supports the following formats: - * 1. Absolute path of the page, which is provided by the pages list in the config.json file. - * Example: - * a. pages/index/index - * b. pages/detail/detail - * 2. Particular path. If the URI is a slash (/), the home page is displayed. - * @since 3 - */ - uri: string; - - /** - * Data that needs to be passed to the destination page during navigation. - * After the destination page is displayed, the parameter can be directly used for the page. - * For example, this.data1 (data1 is the key value of the params used for page navigation.) - * @since 3 - */ - params?: object; -} - -/** - * @Syscap SysCap.ACE.UIEngineLite - */ -export default class Router { - /** - * Replaces the current page with another one in the application. - * The current page is destroyed after replacement. - * @param route route options. - */ - static replace(route: RouterOptions): void; -} +/* + * Copyright (c) 2021-2022 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. + */ + +/** + * @name ActionResult + * @since 3 + * @syscap SystemCapability.Notification.Notification + */ +export interface ActionResult { + /** + * Bundle name of the application to be redirected to after the notification is clicked. + */ + bundleName: string; + + /** + * Ability name of the application to be redirected to after the notification is clicked. + */ + abilityName: string; + + /** + * URI of the page to be redirected to. The supported URI formats are as follows: + * 1. Absolute path of the page, which is provided by the pages list in the config.json file. Example: + * pages/index/index + * pages/detail/detail + * 2. Particular path. If the value is a slash (/), the home page is displayed. + */ + uri: string; +} + +/** + * @name ShowNotificationOptions + * @since 3 + * @syscap SystemCapability.Notification.Notification + */ +export interface ShowNotificationOptions { + /** + * Notification title. + */ + contentTitle?: string; + + /** + * Notification content. + */ + contentText?: string; + + /** + * Action triggered after the notification is clicked. + */ + clickAction?: ActionResult; +} + +/** + * @name Notification + * @since 3 + * @syscap SystemCapability.Notification.Notification + */ +export default class Notification { + /** + * Displays the notification. + * @param options Options. + */ + static show(options?: ShowNotificationOptions): void; +} diff --git a/api/bundle/metadata.d.ts b/api/@system.package.d.ts similarity index 35% rename from api/bundle/metadata.d.ts rename to api/@system.package.d.ts index 4fba45c5348ca3d4806cf46783ba4570b1c7e6c3..7a667d63cc945dcedf9a9d11311e6145ae4daaca 100644 --- a/api/bundle/metadata.d.ts +++ b/api/@system.package.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2022 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 @@ -13,32 +13,63 @@ * limitations under the License. */ - /** - * @name Indicates the Metadata - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ - export interface Metadata { +/** + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 + */ +export interface CheckPackageHasInstalledResponse { + /** + * Whether the application exists, or whether the native application has been installed. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 + */ + result: boolean; +} + +/** + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 + */ +export interface CheckPackageHasInstalledOptions { /** - * @default Indicates the metadata name - * @since 9 + * Application bundle name. * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 */ - name: string; + bundleName: string; /** - * @default Indicates the metadata value - * @since 9 + * Called when native applications are installed. * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 */ - value: string; + success?: (data: CheckPackageHasInstalledResponse) => void; /** - * @default Indicates the metadata resource - * @since 9 + * Called when native applications fail to be installed. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 + */ + fail?: (data: any, code: number) => void; + + /** + * Called when the excution is completed. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 + */ + complete?: () => void; +} + +/** + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 + * @import package from '@system.package'; + */ +export default class Package { + /** + * Checks whethers an application exists, or whether a native application has been installed. + * @param options Options * @syscap SystemCapability.BundleManager.BundleFramework */ - resource: string; - } \ No newline at end of file + static hasInstalled(options: CheckPackageHasInstalledOptions): void; +} \ No newline at end of file diff --git a/api/common/@system.prompt.d.ts b/api/@system.prompt.d.ts similarity index 67% rename from api/common/@system.prompt.d.ts rename to api/@system.prompt.d.ts index faa72559cb72f2a9b9a045146ced67bb802542c6..c2b4c100add4b46b9bd59fa90820312544045ea1 100644 --- a/api/common/@system.prompt.d.ts +++ b/api/@system.prompt.d.ts @@ -14,12 +14,14 @@ */ /** - * @devices tv, phone, tablet, wearable + * Defines the options of ShowToast. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 */ export interface ShowToastOptions { /** * Text to display. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ message: string; @@ -28,61 +30,70 @@ export interface ShowToastOptions { * Duration of toast dialog box. The default value is 1500. * The recommended value ranges from 1500 ms to 10000ms. * NOTE: A value less than 1500 is automatically changed to 1500. The maximum value is 10000 ms. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ duration?: number; /** * The distance between toast dialog box and the bottom of screen. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 5 */ bottom?: string | number; } /** - * @devices tv, phone, tablet, wearable + * Defines the prompt info of button. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 */ export interface Button { /** - * @devices tv, phone, tablet, wearable + * Defines the button info. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ text: string; /** - * @devices tv, phone, tablet, wearable + * Defines the color of button. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ color: string; } /** - * @devices tv, phone, tablet, wearable + * Defines the response of ShowDialog. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 */ export interface ShowDialogSuccessResponse { /** - * @devices tv, phone, tablet, wearable + * Defines the index of data. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ index: number; } /** - * @devices tv, phone, tablet, wearable + * Defines the option of show dialog. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 */ export interface ShowDialogOptions { /** * Title of the text to display. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ title?: string; /** * Text body. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ message?: string; @@ -91,40 +102,42 @@ export interface ShowDialogOptions { * Array of buttons in the dialog box. * The array structure is {text:'button', color: '#666666'}. * One to three buttons are supported. The first button is of the positiveButton type, the second is of the negativeButton type, and the third is of the neutralButton type. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ buttons?: [Button, Button?, Button?]; /** * Called when the dialog box is displayed. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ success?: (data: ShowDialogSuccessResponse) => void; /** * Called when the operation is cancelled. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ cancel?: (data: string, code: string) => void; /** * Called when the dialog box is closed. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ complete?: (data: string) => void; } /** - * @devices phone, tablet + * Defines the option of ShowActionMenu. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 6 */ export interface ShowActionMenuOptions { /** * Title of the text to display. - * @devices phone, tablet + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ title?: string; @@ -133,55 +146,60 @@ export interface ShowActionMenuOptions { * Array of buttons in the dialog box. * The array structure is {text:'button', color: '#666666'}. * One to six buttons are supported. - * @devices phone, tablet + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ buttons: [Button, Button?, Button?, Button?, Button?, Button?]; /** * Called when the dialog box is displayed. - * @devices phone, tablet + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ success?: (tapIndex: number, errMsg: string) => void; /** * Called when the operation is cancelled. - * @devices phone, tablet + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ fail?: (errMsg: string) => void; /** * Called when the dialog box is closed. - * @devices phone, tablet + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable + * Defines the prompt interface. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 */ export default class Prompt { /** * Displays the notification text. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @param options Options. - * @devices tv, phone, tablet, wearable + * @since 3 */ static showToast(options: ShowToastOptions): void; /** * Displays the dialog box. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @param options Options. - * @devices tv, phone, tablet, wearable + * @since 3 */ static showDialog(options: ShowDialogOptions): void; /** * Displays the menu. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @param options Options. - * @devices phone, tablet + * @since 6 */ static showActionMenu(options: ShowActionMenuOptions): void; } diff --git a/api/@system.request.d.ts b/api/@system.request.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9c946b7d73f0906f1460a6a933dd0b729c174bf4 --- /dev/null +++ b/api/@system.request.d.ts @@ -0,0 +1,291 @@ +/* + * Copyright (c) 2020 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. + */ + +/** + * @syscap SystemCapability.MiscServices.Upload + */ +export interface UploadResponse { + /** + * Status code returned by the server. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + code: number; + + /** + * Content returned by the server. + * The value type is determined by the returned content. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + data: string; + + /** + * Headers returned by the server. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + headers: Object; +} + +/** + * @syscap SystemCapability.MiscServices.Download + */ +export interface DownloadResponse { + /** + * Download token, which is used to obtain the download status. + * @syscap SystemCapability.MiscServices.Download + * @since 3 + */ + token: string; +} + +/** + * @syscap SystemCapability.MiscServices.Download + */ +export interface OnDownloadCompleteResponse { + /** + * URI of the download file. + * @syscap SystemCapability.MiscServices.Download + * @since 3 + */ + uri: string; +} + +/** + * @syscap SystemCapability.MiscServices.Upload + */ +export interface RequestFile { + /** + * File name in the header when multipart is used. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + filename?: string; + + /** + * Name of a form item when multipart is used. The default value is file. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + name?: string; + + /** + * Local storage directory of a file. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + uri: string; + + /** + * Type of the file content. + * By default, the type is obtained based on the suffix of the file name or URI. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + type?: string; +} + +/** + * @syscap SystemCapability.MiscServices.Upload + */ +export interface RequestData { + /** + * Name of the form element. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + name: string; + + /** + * Value of the form element. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + value: string; +} + +/** + * @syscap SystemCapability.MiscServices.Upload + */ +export interface UploadRequestOptions { + /** + * Resource URL. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + url: string; + + /** + * Form data in the request body. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + data?: Array; + + /** + * List of files to upload, which is submitted through multipart/form-data. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + files: Array; + + /** + * Request header. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + header?: Object; + + /** + * Request methods available: POST and PUT. The default value is POST. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + method?: string; + + /** + * Called when the files are uploaded successfully. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + success?: (data: UploadResponse) => void; + + /** + * Called when uploading fails. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + fail?: (data: any, code: number) => void; + + /** + * Called when the execution is completed. + * @syscap SystemCapability.MiscServices.Upload + * @since 3 + */ + complete?: () => void; +} + +/** + * @syscap SystemCapability.MiscServices.Download + */ +export interface DownloadRequestOptions { + /** + * Resource URL. + * @syscap SystemCapability.MiscServices.Download + * @since 3 + */ + url: string; + + /** + * Name of the file to downloaded. + * The value is obtained from the current request or resource URL by default. + * @syscap SystemCapability.MiscServices.Download + * @since 3 + */ + filename?: string; + + /** + * Request header. + * @syscap SystemCapability.MiscServices.Download + * @since 3 + */ + header?: string; + + /** + * Download description. + * The default value is the file name. + * @syscap SystemCapability.MiscServices.Download + * @since 3 + */ + description?: string; + + /** + * Called when the files are successfully downloaded. + * @syscap SystemCapability.MiscServices.Download + * @since 3 + */ + success?: (data: DownloadResponse) => void; + + /** + * Called when downloading fails. + * @syscap SystemCapability.MiscServices.Download + * @since 3 + */ + fail?: (data: any, code: number) => void; + + /** + * Called when the execution is completed. + * @syscap SystemCapability.MiscServices.Download + * @since 3 + */ + complete?: () => void; +} + +/** + * @syscap SystemCapability.MiscServices.Download + */ +export interface OnDownloadCompleteOptions { + /** + * Token of the result returned by the download function. + * @syscap SystemCapability.MiscServices.Download + * @since 3 + */ + token: string; + + /** + * Called when the downloads are successfully obtained + * @syscap SystemCapability.MiscServices.Download + * @since 3 + */ + success?: (data: OnDownloadCompleteResponse) => void; + + /** + * Called when the downloads fail to be obtained. + * @syscap SystemCapability.MiscServices.Download + * @since 3 + */ + fail?: (data: any, code: number) => void; + + /** + * Called when the execution is completed. + * @syscap SystemCapability.MiscServices.Download + * @since 3 + */ + complete?: () => void; +} + +export default class Request { + /** + * Upload files. + * @param options Options. + * @syscap SystemCapability.MiscServices.Upload + */ + static upload(options: UploadRequestOptions): void; + + /** + * This API is used to download files. + * @param options Options. + * @syscap SystemCapability.MiscServices.Download + */ + static download(options: DownloadRequestOptions): void; + + /** + * Listens to download task status. + * @param options Options. + * @syscap SystemCapability.MiscServices.Download + */ + static onDownloadComplete(options: OnDownloadCompleteOptions): void; +} \ No newline at end of file diff --git a/api/common/@system.router.d.ts b/api/@system.router.d.ts similarity index 66% rename from api/common/@system.router.d.ts rename to api/@system.router.d.ts index b1ae2255732aa0b1c9b0a42a7e404d5d697ea6a8..0867df975c4ec5ef7654ac8ddd35db46df7881be 100644 --- a/api/common/@system.router.d.ts +++ b/api/@system.router.d.ts @@ -14,7 +14,10 @@ */ /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * Defines the option of router. + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @deprecated since 8, please use @ohos.router instead. + * @since 3 */ export interface RouterOptions { /** @@ -24,7 +27,7 @@ export interface RouterOptions { * pages/index/index * pages/detail/detail * 2. Particular path. If the URI is a slash (/), the home page is displayed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 3 */ uri: string; @@ -33,183 +36,209 @@ export interface RouterOptions { * Data that needs to be passed to the destination page during navigation. * After the destination page is displayed, the parameter can be directly used for the page. * For example, this.data1 (data1 is the key value of the params used for page navigation.) - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 3 */ params?: Object; } /** - * @devices tv, phone, tablet, wearable + * Defines the option of router back. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @deprecated since 8, please use @ohos.router instead. + * @since 7 */ 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 + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ uri?: string; /** * Data that needs to be passed to the destination page during navigation. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 7 */ params?: Object; } /** - * @devices tv, phone, tablet, wearable + * Defines the state of router. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @deprecated since 8, please use @ohos.router instead. + * @since 3 */ export interface RouterState { /** * Index of the current page in the stack. * NOTE: The index starts from 1 from the bottom to the top of the stack. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ index: number; /** * Name of the current page, that is, the file name. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ name: string; /** * Path of the current page. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ path: string; } /** - * @devices phone, tablet + * Defines the option of EnableAlertBeforeBackPage. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @deprecated since 8, please use @ohos.router instead. + * @since 6 */ export interface EnableAlertBeforeBackPageOptions { /** * dialog context. - * @devices phone, tablet + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ message: string; /** * Called when the dialog box is displayed. - * @devices phone, tablet + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ success?: (errMsg: string) => void; /** * Called when the operation is cancelled. - * @devices phone, tablet + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ cancel?: (errMsg: string) => void; /** * Called when the dialog box is closed. - * @devices phone, tablet + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ complete?: () => void; } /** - * @devices phone, tablet + * Defines the option of DisableAlertBeforeBackPage. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @deprecated since 8, please use @ohos.router instead. + * @since 6 */ export interface DisableAlertBeforeBackPageOptions { /** * Called when the dialog box is displayed. - * @devices phone, tablet + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ success?: (errMsg: string) => void; /** * Called when the operation is cancelled. - * @devices phone, tablet + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ cancel?: (errMsg: string) => void; /** * Called when the dialog box is closed. - * @devices phone, tablet + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ complete?: () => void; } +type ParamsInterface = { + [key: string]: Object; +}; + /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * Defines the Router interface. + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @deprecated since 8, please use @ohos.router instead. + * @since 3 */ export default class Router { /** * Navigates to a specified page in the application based on the page URL and parameters. * @param options Options. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 */ static push(options: RouterOptions): void; /** * Replaces the current page with another one in the application. The current page is destroyed after replacement. + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @since 3 */ static replace(options: RouterOptions): void; /** * Returns to the previous page or a specified page. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @param options Options. - * @devices tv, phone, tablet, wearable - * @since 7 + * @since 3 */ static back(options?: BackRouterOptions): void; /** * Obtains information about the current page params. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @returns Page params. - * @devices tv, phone, tablet, wearable * @since 7 */ - static getParams(): Object; + static getParams(): ParamsInterface; /** * Clears all historical pages and retains only the current page at the top of the stack. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 */ static clear(): void; /** * Obtains the number of pages in the current stack. * @returns Number of pages in the stack. The maximum value is 32. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 */ static getLength(): string; /** * Obtains information about the current page state. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @returns Page state. - * @devices tv, phone, tablet, wearable + * @since 3 */ static getState(): RouterState; /** * Pop up dialog to ask whether to back + * @syscap SystemCapability.ArkUI.ArkUI.Full * @param options Options. - * @devices phone, tablet + * @since 6 */ static enableAlertBeforeBackPage(options: EnableAlertBeforeBackPageOptions): void; /** * cancel enableAlertBeforeBackPage + * @syscap SystemCapability.ArkUI.ArkUI.Full * @param options Options. - * @devices phone, tablet + * @since 6 */ static disableAlertBeforeBackPage(options?: DisableAlertBeforeBackPageOptions): void; } diff --git a/api/@system.sensor.d.ts b/api/@system.sensor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e5d7ecca4b7ecfa2bf648623cecc2da6814ab777 --- /dev/null +++ b/api/@system.sensor.d.ts @@ -0,0 +1,665 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.ACCELEROMETER + * @since 3 + * @deprecated since 8 + */ +export interface AccelerometerResponse { + /** + * X-coordinate + * @since 3 + */ + x: number; + + /** + * Y-coordinate + * @since 3 + */ + y: number; + + /** + * Z-coordinate + * @since 3 + */ + z: number; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.ACCELEROMETER + * @since 3 + * @deprecated since 8 + */ +export interface subscribeAccelerometerOptions { + /** + * Execution frequency of the callback function for listening to acceleration sensor data. + * Available values are as follows: + * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. + * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. + * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. + * The default value is normal. + * @since 3 + */ + interval: string; + + /** + * Called when acceleration sensor data changes. + * @since 3 + */ + success: (data: AccelerometerResponse) => void; + + /** + * Called when the listening fails. + * @since 3 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @since 3 + * @deprecated since 8 + */ +export interface CompassResponse { + /** + * Direction of the device (in degrees). + * @since 3 + */ + direction: number; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @since 3 + * @deprecated since 8 + */ +export interface SubscribeCompassOptions { + /** + * Called when compass sensor data changes. + * @since 3 + */ + success: (data: CompassResponse) => void; + + /** + * Called when the listening fails. + * @since 3 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @since 3 + * @deprecated since 8 + */ +export interface ProximityResponse { + /** + * Distance between a visible object and the device screen + * @since 3 + */ + distance: number; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @since 3 + * @deprecated since 8 + */ +export interface SubscribeProximityOptions { + /** + * Called when distance sensor data changes. + * @since 3 + */ + success: (data: ProximityResponse) => void; + + /** + * Called when the listening fails. + * @since 3 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @since 3 + * @deprecated since 8 + */ +export interface LightResponse { + /** + * Light intensity, in lux. + * @since 3 + */ + intensity: number; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @since 3 + * @deprecated since 8 + */ +export interface SubscribeLightOptions { + /** + * Called when ambient light sensor data changes. + * @since 3 + */ + success: (data: LightResponse) => void; + + /** + * Called when the listening fails. + * @since 3 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.ACTIVITY_MOTION + * @since 3 + * @deprecated since 8 + */ +export interface StepCounterResponse { + /** + * Number of steps counted. + * Each time the device restarts, the value is recalculated from 0 in phone, tablet. + * @since 3 + */ + steps: number; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.ACTIVITY_MOTION + * @since 3 + * @deprecated since 8 + */ +export interface SubscribeStepCounterOptions { + /** + * Called when step counter sensor data changes. + * @since 3 + */ + success: (data: StepCounterResponse) => void; + + /** + * Called when the listening fails. + * @since 3 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @since 3 + * @deprecated since 8 + */ +export interface BarometerResponse { + /** + * Pressure, in pascal. + * @since 3 + */ + pressure: number; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @since 3 + * @deprecated since 8 + */ +export interface SubscribeBarometerOptions { + /** + * Called when the barometer sensor data changes. + * @since 3 + */ + success: (data: BarometerResponse) => void; + + /** + * Called when the listening fails. + * @since 3 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.READ_HEALTH_DATA + * @since 3 + * @deprecated since 8 + */ +export interface HeartRateResponse { + /** + * Heart rate. + * 255 indicates an invalid value in lite wearable. + * @since 3 + */ + heartRate: number; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.READ_HEALTH_DATA + * @since 3 + * @deprecated since 8 + */ +export interface SubscribeHeartRateOptions { + /** + * Called when the heart rate sensor data changes. + * @since 3 + */ + success: (data: HeartRateResponse) => void; + + /** + * Called when the listening fails + * @since 3 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @since 3 + * @deprecated since 8 + */ +export interface OnBodyStateResponse { + /** + * Whether the sensor is worn. + * @since 3 + */ + value: boolean; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @since 3 + * @deprecated since 8 + */ +export interface SubscribeOnBodyStateOptions { + /** + * Called when the wearing status changes. + * @since 3 + */ + success: (data: OnBodyStateResponse) => void; + + /** + * Called when the listening fails. + * @since 3 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @since 3 + * @deprecated since 8 + */ +export interface GetOnBodyStateOptions { + /** + * Called when the sensor wearing state is obtained + * @since 3 + */ + success: (data: OnBodyStateResponse) => void; + + /** + * Called when the sensor wearing state fails to be obtained + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed + * @since 3 + */ + complete?: () => void; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @since 6 + * @deprecated since 8 + */ +export interface DeviceOrientationResponse { + /** + * alpha + * @since 6 + */ + alpha: number; + + /** + * beta + * @since 6 + */ + beta: number; + + /** + * gamma + * @since 6 + */ + gamma: number; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @since 6 + * @deprecated since 8 + */ +export interface SubscribeDeviceOrientationOptions { + /** + * Execution frequency of the callback function for listening to device orientation sensor data. + * Available values are as follows: + * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. + * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. + * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. + * The default value is normal. + * @since 6 + */ + interval: string; + + /** + * Called when device orientation sensor data changes. + * @since 6 + */ + success: (data: DeviceOrientationResponse) => void; + + /** + * Called when the listening fails. + * @since 6 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.GYROSCOPE + * @since 6 + * @deprecated since 8 + */ +export interface GyroscopeResponse { + /** + * X-coordinate + * @since 6 + */ + x: number; + + /** + * Y-coordinate + * @since 6 + */ + y: number; + + /** + * Z-coordinate + * @since 6 + */ + z: number; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @permission ohos.permission.GYROSCOPE + * @since 6 + * @deprecated since 8 + */ +export interface SubscribeGyroscopeOptions { + /** + * Execution frequency of the callback function for listening to gyroscope sensor data. + * Available values are as follows: + * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. + * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. + * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. + * The default value is normal. + * @since 6 + */ + interval: string; + + /** + * Called when gyroscope sensor data changes. + * @since 6 + */ + success: (data: GyroscopeResponse) => void; + + /** + * Called when the listening fails. + * @since 6 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @syscap SystemCapability.Sensors.Sensor + * @import import sensor from '@system.sensor'; + * @since 6 + * @deprecated since 8 + */ +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 + * @permission ohos.permission.ACCELEROMETER + * @since 3 + * @deprecated since 8 + */ + static subscribeAccelerometer(options: subscribeAccelerometerOptions): void; + + /** + * Cancels listening to acceleration sensor data. + * @syscap SystemCapability.Sensors.Sensor + * @permission ohos.permission.ACCELEROMETER + * @since 3 + * @deprecated since 8 + */ + static unsubscribeAccelerometer(): void; + + /** + * 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 + * @since 3 + * @deprecated since 8 + */ + static subscribeCompass(options: SubscribeCompassOptions): void; + + /** + * Cancels listening to compass sensor data. + * @syscap SystemCapability.Sensors.Sensor + * @since 3 + * @deprecated since 8 + */ + static unsubscribeCompass(): void; + + /** + * 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 + * @since 3 + * @deprecated since 8 + */ + static subscribeProximity(options: SubscribeProximityOptions): void; + + /** + * Cancels listening to distance sensor data. + * @param options Options. + * @syscap SystemCapability.Sensors.Sensor + * @since 3 + * @deprecated since 8 + */ + static unsubscribeProximity(): void; + + /** + * 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 + * @since 3 + * @deprecated since 8 + */ + static subscribeLight(options: SubscribeLightOptions): void; + + /** + * Cancels listening to ambient light sensor data. + * @syscap SystemCapability.Sensors.Sensor + * @since 3 + * @deprecated since 8 + */ + static unsubscribeLight(): void; + + /** + * 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 + * @permission ohos.permission.ACTIVITY_MOTION + * @since 3 + * @deprecated since 8 + */ + static subscribeStepCounter(options: SubscribeStepCounterOptions): void; + + /** + * Cancels listening to step counter sensor data. + * @syscap SystemCapability.Sensors.Sensor + * @permission ohos.permission.ACTIVITY_MOTION + * @since 3 + * @deprecated since 8 + */ + static unsubscribeStepCounter(): void; + + /** + * 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 + * @since 3 + * @deprecated since 8 + */ + static subscribeBarometer(options: SubscribeBarometerOptions): void; + + /** + * Cancels listening to barometer sensor data. + * @syscap SystemCapability.Sensors.Sensor + * @since 3 + * @deprecated since 8 + */ + static unsubscribeBarometer(): void; + + /** + * 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 + * @permission ohos.permission.READ_HEALTH_DATA + * @since 3 + * @deprecated since 8 + */ + static subscribeHeartRate(options: SubscribeHeartRateOptions): void; + + /** + * Cancels listening to heart rate sensor data. + * @syscap SystemCapability.Sensors.Sensor + * @permission ohos.permission.READ_HEALTH_DATA + * @since 3 + * @deprecated since 8 + */ + static unsubscribeHeartRate(): void; + + /** + * 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 + * @since 3 + * @deprecated since 8 + */ + static subscribeOnBodyState(options: SubscribeOnBodyStateOptions): void; + + /** + * Cancels listening to whether the sensor is worn. + * @syscap SystemCapability.Sensors.Sensor + * @since 3 + * @deprecated since 8 + */ + static unsubscribeOnBodyState(): void; + + /** + * Obtains the sensor wearing state. + * @param options Options. + * @syscap SystemCapability.Sensors.Sensor + * @since 3 + * @deprecated since 8 + */ + 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 + * @since 6 + * @deprecated since 8 + */ + static subscribeDeviceOrientation(options: SubscribeDeviceOrientationOptions): void; + + /** + * Cancels listening to device orientation sensor data. + * @syscap SystemCapability.Sensors.Sensor + * @since 6 + * @deprecated since 8 + */ + static unsubscribeDeviceOrientation(): void; + + /** + * 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 + * @permission ohos.permission.GYROSCOPE + * @since 6 + * @deprecated since 8 + */ + static subscribeGyroscope(options: SubscribeGyroscopeOptions): void; + + /** + * Cancels listening to gyroscope sensor data. + * @syscap SystemCapability.Sensors.Sensor + * @permission ohos.permission.GYROSCOPE + * @since 6 + * @deprecated since 8 + */ + static unsubscribeGyroscope(): void; +} diff --git a/api/@system.storage.d.ts b/api/@system.storage.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..26a49d9557e83330e13abf1b880b9f84b074ca8e --- /dev/null +++ b/api/@system.storage.d.ts @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2022 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 import storage from '@system.storage'; + * @since 3 + * @syscap SystemCapability.DistributedDataManager.Preferences.Core + */ +export interface GetStorageOptions { + /** + * Content index. + * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. + * @since 3 + */ + key: string; + + /** + * Default value returned when the key does not exist. + * If this parameter is not specified, an empty string is returned. + * @since 3 + */ + default?: string; + + /** + * Called when the stored content is read successfully. + * @since 3 + */ + success?: (data: any) => void; + + /** + * Called when the stored content fails to be read. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +/** + * @import import storage from '@system.storage'; + * @since 3 + * @syscap SystemCapability.DistributedDataManager.Preferences.Core + */ +export interface SetStorageOptions { + /** + * Index of the stored content to be modified. + * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. + * @since 3 + */ + key: string; + + /** + * Target storage content. If the content is an empty string, the data item with the key as the index will be deleted. + * @since 3 + */ + value: string; + + /** + * Called when the stored content is modified successfully. + * @since 3 + */ + success?: () => void; + + /** + * Called when the stored content fails to be modified. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +/** + * @import import storage from '@system.storage'; + * @since 3 + * @syscap SystemCapability.DistributedDataManager.Preferences.Core + */ +export interface ClearStorageOptions { + /** + * Called when the stored content is cleared successfully. + * @since 3 + */ + success?: () => void; + + /** + * Called when the stored content fails to be cleared. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +/** + * @import import storage from '@system.storage'; + * @since 3 + * @syscap SystemCapability.DistributedDataManager.Preferences.Core + */ +export interface DeleteStorageOptions { + /** + * Content index. + * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. + * @since 3 + */ + key: string; + + /** + * Called when the stored content is deleted successfully. + * @since 3 + */ + success?: () => void; + + /** + * Called when the stored content fails to be deleted. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +/** + * @import import storage from '@system.storage'; + * @since 3 + * @syscap SystemCapability.DistributedDataManager.Preferences.Core + */ +export default class Storage { + /** + * Reads the stored content. + * @param options Options. + */ + static get(options: GetStorageOptions): void; + + /** + * Modifies the stored content. + * @param options Options. + */ + static set(options: SetStorageOptions): void; + + /** + * Clears the stored content. + * @param options Options. + */ + static clear(options?: ClearStorageOptions): void; + + /** + * Deletes the stored content. + * @param options Options. + */ + static delete(options: DeleteStorageOptions): void; +} diff --git a/api/liteWearable/@system.app.d.ts b/api/@system.vibrator.d.ts similarity index 46% rename from api/liteWearable/@system.app.d.ts rename to api/@system.vibrator.d.ts index a25c8d9414277aec135bfea073b516442670cd20..f8fd9d1be2962baa1b34bfa92fa54e26cbda0f38 100644 --- a/api/liteWearable/@system.app.d.ts +++ b/api/@system.vibrator.d.ts @@ -1,81 +1,66 @@ -/* - * Copyright (c) 2020 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. - */ - -export interface AppResponse { - /** - * Application name - * @since 3 - */ - appName: string; - - /** - * Application version name - * @since 3 - */ - versionName: string; - - /** - * Application version - * @since 3 - */ - versionCode: number; -} - -export interface ScreenOnVisibleOptions { - /** - * Whether to keep the application visible. The default value is false. - * @since 3 - */ - visible?: boolean; - - /** - * Called when the application always keeps visible. - * @since 3 - */ - success?: () => void; - - /** - * Called when the application fails to keep visible. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @Syscap SysCap.ACE.UIEngineLite - */ -export default class App { - /** - * Obtains the declared information in the config.json file of an application. - */ - static getInfo(): AppResponse; - - /** - * Destroys the current ability. - */ - static terminate(): void; - - /** - * Keeps the application visible after the screen is woken up. - * This method prevents the system from returning to the home screen when the screen is locked. - */ - static screenOnVisible(options?: ScreenOnVisibleOptions): void; -} +/* + * Copyright (c) 2020 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. + */ + +/** + * @syscap SystemCapability.Sensors.MiscDevice + * @import import vibrator from '@system.vibrator'; + * @permission ohos.permission.VIBRATE + * @since 3 + * @deprecated since 8 + */ +export interface VibrateOptions { + /** + * Vibration mode. The value long indicates long vibration, and short indicates short vibration. + * The default value is long. + * @since 3 + */ + mode?: "long" | "short"; + + /** + * Called when success to trigger vibration. + * @since 3 + */ + success: () => void; + + /** + * Called when fail to trigger vibration. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +/** + * @syscap SystemCapability.Sensors.MiscDevice + * @import import vibrator from '@system.vibrator'; + * @permission ohos.permission.VIBRATE + * @since 3 + * @deprecated since 8 + */ +export default class Vibrator { + /** + * Triggers vibration. + * @param options Options. + * @permission ohos.permission.VIBRATE + * @since 3 + * @deprecated since 8 + */ + static vibrate(options?: VibrateOptions): void; +} diff --git a/api/ability/abilityResult.d.ts b/api/ability/abilityResult.d.ts index bac8cd8756c1b766d842dedc839cff4747d0de56..253243e97fbd0b5f0468ea7c29002334892777a2 100644 --- a/api/ability/abilityResult.d.ts +++ b/api/ability/abilityResult.d.ts @@ -16,7 +16,7 @@ import { Want } from './want'; /** * @since 7 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @permission N/A */ export interface AbilityResult { @@ -25,7 +25,7 @@ export interface AbilityResult { * code to identify an error. * @default - * @since 7 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase */ resultCode: number; @@ -34,7 +34,7 @@ export interface AbilityResult { * This parameter can be null. * @default - * @since 7 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase */ want?: Want; } \ No newline at end of file diff --git a/api/ability/connectOptions.d.ts b/api/ability/connectOptions.d.ts index 1604b9bf5e0797c5dc51dcd8842a15d40fd95c81..0ba5280c1d40849dc19a1d19819dde7ba9d7c6a3 100644 --- a/api/ability/connectOptions.d.ts +++ b/api/ability/connectOptions.d.ts @@ -17,7 +17,7 @@ import rpc from './../@ohos.rpc'; /** * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A */ export interface ConnectOptions { @@ -26,29 +26,29 @@ export interface ConnectOptions { * * @default - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param elementName The element name of the service ability - * @param remoteObject The remote object instance + * @param remote The remote object instance */ - onConnect: (elementName: ElementName, remoteObject: RemoteObject) => void; + onConnect(elementName: ElementName, remote: rpc.IRemoteObject): void; /** * The callback interface was disconnect successfully. * * @default - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param elementName The element name of the service ability */ - onDisconnect: (elementName: ElementName) => void; + onDisconnect(elementName: ElementName): void; /** * The callback interface was connect failed. * * @default - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param code The error code of the failed. */ - onFailed: (code: number) => void; + onFailed(code: number): void; } diff --git a/api/ability/dataAbilityHelper.d.ts b/api/ability/dataAbilityHelper.d.ts index f1cf3feefbda2e86dcbfc99117cd44f9ba789af8..4b55b5a51234882a3120541328866dbc31d0193e 100644 --- a/api/ability/dataAbilityHelper.d.ts +++ b/api/ability/dataAbilityHelper.d.ts @@ -22,7 +22,7 @@ import rdb from '../@ohos.data.rdb'; /** * DataAbilityHelper - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * * @since 7 * @FAModelOnly @@ -32,7 +32,7 @@ export interface DataAbilityHelper { * Opens a file in a specified remote path. * * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of the file to open. * @param mode Indicates the file open mode, which can be "r" for read-only access, "w" for write-only access * (erasing whatever data is currently in the file), "wt" for write access that truncates any existing @@ -49,7 +49,7 @@ export interface DataAbilityHelper { * Registers an observer to observe data specified by the given uri. * * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param type dataChange. * @param uri Indicates the path of the data to operate. * @param callback Indicates the callback when dataChange. @@ -62,7 +62,7 @@ export interface DataAbilityHelper { * Deregisters an observer used for monitoring data specified by the given uri. * * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param type dataChange. * @param uri Indicates the path of the data to operate. * @param callback Indicates the registered callback. @@ -75,7 +75,7 @@ export interface DataAbilityHelper { * Obtains the MIME type of the date specified by the given URI. * * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of the data to operate. * @return Returns the MIME type that matches the data specified by uri. * @FAModelOnly @@ -87,20 +87,20 @@ export interface DataAbilityHelper { * Obtains the MIME types of files supported. * * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of the files to obtain. * @param mimeTypeFilter Indicates the MIME types of the files to obtain. * @return Returns the matched MIME types Array. * @FAModelOnly */ - getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; - getFileTypes(uri: string, mimeTypeFilter: string): Promise>; + getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; + getFileTypes(uri: string, mimeTypeFilter: string): Promise>; /** * Converts the given uri that refers to the Data ability into a normalized uri. * * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the uri object to normalize. * @return Returns the normalized uri object if the Data ability supports URI normalization or null. * @FAModelOnly @@ -112,7 +112,7 @@ export interface DataAbilityHelper { * Converts the given normalized uri generated by normalizeUri(uri) into a denormalized one. * * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the uri object to normalize. * @return Returns the denormalized uri object if the denormalization is successful. * @FAModelOnly @@ -124,7 +124,7 @@ export interface DataAbilityHelper { * Notifies the registered observers of a change to the data resource specified by uri. * * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of the data to operate. * @return - * @FAModelOnly @@ -136,7 +136,7 @@ export interface DataAbilityHelper { * Inserts a single data record into the database. * * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of the data to insert. * @param valuesBucket Indicates the data record to insert. If this parameter is null, a blank row will be inserted. * @return Returns the index of the inserted data record. @@ -149,7 +149,7 @@ export interface DataAbilityHelper { * Inserts multiple data records into the database. * * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of the data to batchInsert. * @param valuesBuckets Indicates the data records to insert. * @return Returns the number of data records inserted. @@ -162,20 +162,21 @@ export interface DataAbilityHelper { * Deletes one or more data records from the database. * * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of the data to delete. * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. * @return Returns the number of data records deleted. * @FAModelOnly */ delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - delete(uri: string, predicates: dataAbility.DataAbilityPredicates): Promise; + delete(uri: string, predicates?: dataAbility.DataAbilityPredicates): Promise; + delete(uri: string, callback: AsyncCallback): void; /** * Updates data records in the database. * * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of data to update. * @param valuesBucket Indicates the data to update. * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. @@ -183,13 +184,14 @@ export interface DataAbilityHelper { * @FAModelOnly */ update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates): Promise; + update(uri: string, valuesBucket: rdb.ValuesBucket, predicates?: dataAbility.DataAbilityPredicates): Promise; + update(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback): void; /** * Queries data in the database. * * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of data to query. * @param columns Indicates the columns to query. If this parameter is null, all columns are queried. * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. @@ -197,5 +199,60 @@ export interface DataAbilityHelper { * @FAModelOnly */ query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates): Promise; + query(uri: string, callback: AsyncCallback): void; + query(uri: string, columns: Array, callback: AsyncCallback): void; + query(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; + query(uri: string, columns?: Array, predicates?: dataAbility.DataAbilityPredicates): Promise; + + /** + * Calls the extended API of the DataAbility. This method uses a promise to return the result. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri URI of the Data ability. Example: "dataability:///com.example.xxx.xxxx" + * @param method Indicates the method to call. + * @param arg Indicates the parameter of the String type. + * @param extras Indicates the parameter of the PacMap type. + * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes, + * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object. + * If the PacMap object is to be transferred to a non-OHOS process, + * values of primitive types are supported, but not custom Sequenceable objects. + * @return Returns the query result {@link PacMap}. + * @FAModelOnly + */ + call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback): void; + call(uri: string, method: string, arg: string, extras: PacMap): Promise; + + /** + * Queries data in the database. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the path of data to query. + * @param operations Indicates the data operation list, which can contain multiple operations on the database. + * @return Returns the result of each operation, in array {@link DataAbilityResult}. + */ + executeBatch(uri: string, operations: Array, callback: AsyncCallback>): void; + executeBatch(uri: string, operations: Array): Promise>; +} + +/** + * Defines a PacMap object for storing a series of values. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ + export interface PacMap { + + /** + * Indicates the parameter of the PacMap type. + * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes, + * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object. + * If the PacMap object is to be transferred to a non-OHOS process, + * values of primitive types are supported, but not custom Sequenceable objects. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ + [key: string]: number | string | boolean | Array | null; } diff --git a/api/ability/dataAbilityOperation.d.ts b/api/ability/dataAbilityOperation.d.ts index 4d961357d179bf0883bb3e92f8599ef2392533ea..8b8a1ca9c85cced12ffde98cb12b164ba4d98985 100644 --- a/api/ability/dataAbilityOperation.d.ts +++ b/api/ability/dataAbilityOperation.d.ts @@ -19,7 +19,7 @@ import rdb from '../@ohos.data.rdb'; /** * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @permission N/A */ export interface DataAbilityOperation { @@ -27,7 +27,7 @@ export interface DataAbilityOperation { * Indicates the path of data to operate. * @default - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ uri: string; @@ -36,7 +36,7 @@ export interface DataAbilityOperation { * Indicates a operation type. * @default - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ type: featureAbility.DataAbilityOperationType; @@ -45,7 +45,7 @@ export interface DataAbilityOperation { * Indicates the data values to be set. * @default - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ valuesBucket?: rdb.ValuesBucket; @@ -54,7 +54,7 @@ export interface DataAbilityOperation { * Indicates the valuesBucket object containing a set of key-value pairs. * @default - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ valueBackReferences?: rdb.ValuesBucket; @@ -64,7 +64,7 @@ export interface DataAbilityOperation { * will be operated by default. * @default - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ predicates?: dataAbility.DataAbilityPredicates; @@ -73,7 +73,7 @@ export interface DataAbilityOperation { * Indicates the back reference to be used as a filter criterion in predicates. * @default - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ predicatesBackReferences?: Map; @@ -82,7 +82,7 @@ export interface DataAbilityOperation { * Specifies whether a batch operation can be interrupted. * @default - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ interrupted?: boolean; @@ -91,7 +91,7 @@ export interface DataAbilityOperation { * Indicates the expected number of rows to update or delete. * @default - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ expectedCount?: number; diff --git a/api/ability/dataAbilityResult.d.ts b/api/ability/dataAbilityResult.d.ts index e7c53bc8f7054960adce5c645ff839d8ede37234..4b6600d6823b46d3e785619ba25c3acd8caabab4 100644 --- a/api/ability/dataAbilityResult.d.ts +++ b/api/ability/dataAbilityResult.d.ts @@ -16,7 +16,7 @@ /** * @name DataAbilityResult * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @permission N/A */ export interface DataAbilityResult { @@ -24,7 +24,7 @@ export interface DataAbilityResult { * Indicates the path of data to operate. * @default - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ uri?: string; @@ -33,7 +33,7 @@ export interface DataAbilityResult { * Indicates the number of rows affected by the operation. * @default - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ count?:number; diff --git a/api/ability/startAbilityParameter.d.ts b/api/ability/startAbilityParameter.d.ts index 7ad38dddddcdaf822ab5cafcc3294a1589a982e5..a2a65148daaa4081dd8776276456c6ccbfe0c042 100644 --- a/api/ability/startAbilityParameter.d.ts +++ b/api/ability/startAbilityParameter.d.ts @@ -15,8 +15,8 @@ import { Want } from './want'; /** - * @since 3 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @permission N/A */ export interface StartAbilityParameter { @@ -24,8 +24,8 @@ export interface StartAbilityParameter { * Indicates the Want containing information about the target ability to start. * * @default - - * @since 3 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ want: Want; @@ -34,8 +34,8 @@ export interface StartAbilityParameter { * Indicates the special start setting used in starting ability. * * @default - - * @since 3 - * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ abilityStartSetting?: {[key: string]: any}; diff --git a/api/ability/want.d.ts b/api/ability/want.d.ts index f6c264684fd49365ed0c2b57de5d99c2e846b20a..7a0de81e061428530ad5e4698035175a61b32c56 100644 --- a/api/ability/want.d.ts +++ b/api/ability/want.d.ts @@ -17,7 +17,7 @@ * Want is the basic communication component of the system. * @name Want * @since 6 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @permission N/A */ export declare interface Want { @@ -25,7 +25,7 @@ export declare interface Want { * device id * @default - * @since 6 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase */ deviceId?: string; @@ -33,7 +33,7 @@ export declare interface Want { * bundle name * @default - * @since 6 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase */ bundleName?: string; @@ -41,14 +41,14 @@ export declare interface Want { * ability name * @default - * @since 6 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase */ abilityName?: string; /** * The description of a URI in a Want. * @since 6 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @default - */ uri?: string; @@ -56,7 +56,7 @@ export declare interface Want { /** * The description of the type in this Want. * @since 6 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @default - */ type?: string; @@ -64,7 +64,7 @@ export declare interface Want { /** * The options of the flags in this Want. * @since 6 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @default - */ flags?: number; @@ -72,7 +72,7 @@ export declare interface Want { /** * The description of an action in an want. * @since 6 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @default - */ action?: string; @@ -80,7 +80,7 @@ export declare interface Want { /** * The description of the WantParams object in an Want * @since 6 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @default - */ parameters?: {[key: string]: any}; @@ -88,24 +88,8 @@ export declare interface Want { /** * The description of a entities in a Want. * @since 6 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @default - */ entities?: Array; - - /** - * The description of a extension ability name in a Want. - * @since 9 - * @sysCap SystemCapability.Ability.AbilityBase - * @default - - */ - extensionAbilityName?: string; - - /** - * The description of a extension ability type in a Want. - * @since 9 - * @sysCap SystemCapability.Ability.AbilityBase - * @default - - */ - extensionAbilityType?: number; } \ No newline at end of file diff --git a/api/@internal/component/ets/sheet.d.ts b/api/app/appVersionInfo.d.ts similarity index 45% rename from api/@internal/component/ets/sheet.d.ts rename to api/app/appVersionInfo.d.ts index 59b190edb3a11f2084de9c2a82ec7ce0e579d985..16333f0d7794c63d6a39debeebd10844a30d586e 100644 --- a/api/@internal/component/ets/sheet.d.ts +++ b/api/app/appVersionInfo.d.ts @@ -1,35 +1,47 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Provides the interface for the sheet attributes. - * @since 8 - */ -interface SheetInterface { - /** - * Create sheet. - * @since 8 - */ - (): SheetAttribute; -} - -/** - * Declares sheet properties. - * @since 8 - */ -declare class SheetAttribute extends CommonMethod {} - -declare const Sheet: SheetInterface; -declare const SheetInstance: SheetAttribute; +/* + * Copyright (c) 2022 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. + */ + +/** + * Defines an AppVersionInfo object. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission NA + */ +export interface AppVersionInfo { + + /** + * Application name. + * @default appName + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + readonly appName: string; + + /** + * Application version number. + * @default versionCode + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + readonly versionCode: number; + + /** + * Application version name. + * @default versionName + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + readonly versionName: string; +} diff --git a/api/app/context.d.ts b/api/app/context.d.ts index 6bdb28af617e7c24e8254c20f63846d43420ee53..e114ebf09d171c78315fe6b27883dc6e71d83ee3 100644 --- a/api/app/context.d.ts +++ b/api/app/context.d.ts @@ -18,6 +18,11 @@ import { ApplicationInfo } from '../bundle/applicationInfo'; import { ProcessInfo } from './processInfo'; import { ElementName } from '../bundle/elementName'; import BaseContext from '../application/BaseContext'; +import { HapModuleInfo } from '../bundle/hapModuleInfo'; +import { AppVersionInfo } from './appVersionInfo'; +import { AbilityInfo } from '../bundle/abilityInfo'; +import bundle from '../@ohos.bundle'; + /** * The context of an ability or an application. It allows access to @@ -25,7 +30,7 @@ import BaseContext from '../application/BaseContext'; * Can only be obtained through the ability. * * @since 6 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @import import abilityManager from 'app/context' * @permission N/A * @FAModelOnly @@ -39,7 +44,7 @@ export interface Context extends BaseContext { * the ability; if in the context of the application, return the * root dir of the application. * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @return the root dir * @FAModelOnly */ @@ -54,7 +59,7 @@ export interface Context extends BaseContext { * @note Pid and uid are optional. If you do not pass in pid and uid, * it will check your own permission. * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @return asynchronous callback with {@code 0} if the PID * and UID have the permission; callback with {@code -1} otherwise. * @FAModelOnly @@ -68,15 +73,16 @@ export interface Context extends BaseContext { * @param permissions Indicates the list of permissions to be requested. This parameter cannot be null. * @param requestCode Indicates the request code to be passed to the PermissionRequestResult * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ requestPermissionsFromUser(permissions: Array, requestCode: number, resultCallback: AsyncCallback): void; + requestPermissionsFromUser(permissions: Array, requestCode: number): Promise; /** * Obtains information about the current application. * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ getApplicationInfo(callback: AsyncCallback): void @@ -85,16 +91,51 @@ export interface Context extends BaseContext { /** * Obtains the bundle name of the current ability. * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ getBundleName(callback: AsyncCallback): void getBundleName(): Promise; + /** + * Obtains the current display orientation of this ability. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + getDisplayOrientation(callback: AsyncCallback): void + getDisplayOrientation(): Promise; + + /** + * Sets the display orientation of the current ability. + * @param orientation Indicates the new orientation for the current ability. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + setDisplayOrientation(orientation: bundle.DisplayOrientation, callback: AsyncCallback): void + setDisplayOrientation(orientation: bundle.DisplayOrientation): Promise; + + /** + * Sets whether to show this ability on top of the lock screen whenever the lock screen is displayed, keeping the ability in the ACTIVE state. + * @param show Specifies whether to show this ability on top of the lock screen. The value true means to show it on the lock screen, and the value false means not. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + setShowOnLockScreen(show: boolean, callback: AsyncCallback): void + setShowOnLockScreen(show: boolean): Promise; + + /** + * Sets whether to wake up the screen when this ability is restored. + * @param wakeUp Specifies whether to wake up the screen. The value true means to wake it up, and the value false means not. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + setWakeUpScreen(wakeUp: boolean, callback: AsyncCallback): void + setWakeUpScreen(wakeUp: boolean): Promise; + /** * Obtains information about the current process, including the process ID and name. * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ getProcessInfo(callback: AsyncCallback): void @@ -103,7 +144,7 @@ export interface Context extends BaseContext { /** * Obtains the ohos.bundle.ElementName object of the current ability. This method is available only to Page abilities. * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ getElementName(callback: AsyncCallback): void @@ -112,7 +153,7 @@ export interface Context extends BaseContext { /** * Obtains the name of the current process. * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ getProcessName(callback: AsyncCallback): void @@ -121,17 +162,108 @@ export interface Context extends BaseContext { /** * Obtains the bundle name of the ability that called the current ability. * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ getCallingBundle(callback: AsyncCallback): void getCallingBundle(): Promise; + + /** + * Obtains the file directory of this application on the internal storage. + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getFilesDir(callback: AsyncCallback): void; + getFilesDir(): Promise; + + /** + * Obtains the cache directory of this application on the internal storage. + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getCacheDir(callback: AsyncCallback): void; + getCacheDir(): Promise; + + /** + * Obtains the distributed file path for storing ability or application data files. + * If the distributed file path does not exist, the system will create a path and return the created path. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getOrCreateDistributedDir(): Promise; + getOrCreateDistributedDir(callback: AsyncCallback): void; + + /** + * Obtains the application type. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getAppType(callback: AsyncCallback): void + getAppType(): Promise; + + /** + * Obtains the ModuleInfo object for this application. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getHapModuleInfo(callback: AsyncCallback): void + getHapModuleInfo(): Promise; + + /** + * Obtains the application version information. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getAppVersionInfo(callback: AsyncCallback): void + getAppVersionInfo(): Promise; + + /** + * Obtains the context of this application. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getApplicationContext(): Context; + + /** + * Checks the detailed information of this ability. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getAbilityInfo(callback: AsyncCallback): void + getAbilityInfo(): Promise; + + /** + * Checks whether the configuration of this ability is changing. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return true if the configuration of this ability is changing and false otherwise. + * @FAModelOnly + */ + isUpdatingConfigurations(callback: AsyncCallback): void; + isUpdatingConfigurations(): Promise; + + /** + * Informs the system of the time required for drawing this Page ability. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + printDrawnCompleted(callback: AsyncCallback): void; + printDrawnCompleted(): Promise; } /** * @name the result of requestPermissionsFromUser with asynchronous callback * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @FAModelOnly */ @@ -139,7 +271,7 @@ interface PermissionRequestResult { /** * @default The request code passed in by the user * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ requestCode: number; @@ -147,7 +279,7 @@ interface PermissionRequestResult { /** * @default The permissions passed in by the user * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ permissions: Array; @@ -155,7 +287,7 @@ interface PermissionRequestResult { /** * @default The results for the corresponding request permissions * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ authResults: Array; @@ -164,7 +296,7 @@ interface PermissionRequestResult { /** * @name PermissionOptions * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @FAModelOnly */ @@ -172,7 +304,7 @@ interface PermissionOptions { /** * @default The process id * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ pid?: number; @@ -180,8 +312,8 @@ interface PermissionOptions { /** * @default The user id * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ uid?: number; -} \ No newline at end of file +} diff --git a/api/app/processInfo.d.ts b/api/app/processInfo.d.ts index cd25a592d8978806e77b31e8fed30ef26c6464a1..5f3c2a825d89ac46e030cdb4cf2b524a879f97dd 100644 --- a/api/app/processInfo.d.ts +++ b/api/app/processInfo.d.ts @@ -16,7 +16,7 @@ /** * @name This class saves process information about an application * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @import import ProcessInfo from 'app/processInfo' * @permission N/A */ @@ -26,7 +26,7 @@ export interface ProcessInfo { * * @default - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ pid: number; @@ -35,7 +35,7 @@ export interface ProcessInfo { * * @default - * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - processName: string; + processName: string; } \ No newline at end of file diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts deleted file mode 100755 index 442c46a5d07d4cb904e775c2375a2ff8223c8c7b..0000000000000000000000000000000000000000 --- a/api/application/AbilityContext.d.ts +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { AbilityInfo } from "../bundle/abilityInfo"; -import { AbilityResult } from "../ability/abilityResult"; -import { AsyncCallback } from "../basic"; -import { ConnectOptions } from "../ability/connectOptions"; -import { HapModuleInfo } from "../bundle/hapModuleInfo"; -import Context from "./Context"; -import Want from "../@ohos.application.Want"; -import StartOptions from "../@ohos.application.StartOptions"; -import PermissionRequestResult from "./PermissionRequestResult"; -import { Configuration } from '../@ohos.application.Configuration'; -import Caller from '../@ohos.application.Ability'; - -/** - * The context of an ability. It allows access to ability-specific resources. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly - */ -export default class AbilityContext extends Context { - /** - * Indicates configuration information about an ability. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - abilityInfo: AbilityInfo; - - /** - * Indicates configuration information about an module. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - currentHapModuleInfo: HapModuleInfo; - - /** - * Indicates configuration information. - * - * @since 9 - * @sysCap AAFwk - * @StageModelOnly - */ - config: Configuration; - - /** - * Starts a new ability. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param parameter Indicates the ability to start. - * @return - - * @StageModelOnly - */ - startAbility(want: Want, callback: AsyncCallback): void; - startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; - startAbility(want: Want, options?: StartOptions): Promise; - - /** - * Get the caller object of the startup capability - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @param parameter Indicates the ability to start. - * @return Caller - * @StageModelOnly - */ - startAbilityByCall(want: Want): Promise; - - /** - * Starts a new ability with account. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @param want Indicates the account to start. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; - startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; - startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; - - /** - * Starts an ability and returns the execution result when the ability is destroyed. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param parameter Indicates the ability to start. - * @return Returns the {@link AbilityResult}. - * @StageModelOnly - */ - startAbilityForResult(want: Want, callback: AsyncCallback): void; - startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void; - startAbilityForResult(want: Want, options?: StartOptions): Promise; - - /** - * Starts an ability and returns the execution result when the ability is destroyed with account. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @param want Indicates the account to start. - * @systemapi hide for inner use. - * @return Returns the {@link AbilityResult}. - * @StageModelOnly - */ - startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; - startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; - startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; - - /** - * Destroys this Page ability. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @return - - * @StageModelOnly - */ - terminateSelf(callback: AsyncCallback): void; - terminateSelf(): Promise; - - /** - * Sets the result code and data to be returned by this Page ability to the caller - * and destroys this Page ability. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param parameter Indicates the result to return. - * @return - - * @StageModelOnly - */ - terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; - terminateSelfWithResult(parameter: AbilityResult): Promise; - - /** - * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param want The element name of the service ability - * @param options The remote object instance - * @hide hide for inner use. - * @return Returns the number code of the ability connected - * @StageModelOnly - */ - connectAbility(want: Want, options: ConnectOptions): number; - - /** - * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template with account. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param want The element name of the service ability - * @param options The remote object instance - * @param accountId The account to connect - * @systemapi hide for inner use. - * @return Returns the number code of the ability connected - * @StageModelOnly - */ - connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; - - /** - * The callback interface was connect successfully. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param connection The number code of the ability connected - * @hide hide for inner use. - * @StageModelOnly - */ - disconnectAbility(connection: number, callback:AsyncCallback): void; - disconnectAbility(connection: number): Promise; - - /** - * Set mission label of current ability. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param label The label of ability that showed in recent missions. - * @StageModelOnly - */ - setMissionLabel(label: string, callback:AsyncCallback): void; - setMissionLabel(label: string): Promise; - - /** - * Requests certain permissions from the system. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param permissions Indicates the list of permissions to be requested. This parameter cannot be null or empty. - * @StageModelOnly - */ - requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback) : void; - requestPermissionsFromUser(permissions: Array) : Promise; -} \ No newline at end of file diff --git a/api/application/AbilityRunningInfo.d.ts b/api/application/AbilityRunningInfo.d.ts index 41bff388cefc203e2f6f1391602360b3e33a6182..6ffba2b8246e826e32c33e769b02dc4f8471b0b6 100644 --- a/api/application/AbilityRunningInfo.d.ts +++ b/api/application/AbilityRunningInfo.d.ts @@ -20,49 +20,56 @@ import abilityManager from '../@ohos.application.abilityManager'; * The class of an ability running information. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use * @permission N/A */ export interface AbilityRunningInfo { /** * @default ability element name * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use */ ability: ElementName; /** * @default process id * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use */ pid: number; /** * @default user id * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use */ uid: number; - + /** * @default the name of the process * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use */ processName: string; /** * @default ability start time * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use */ startTime: number; /** * @default Enumerates state of the ability state info * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use */ abilityState: abilityManager.AbilityState; } \ No newline at end of file diff --git a/api/application/AbilityStateData.d.ts b/api/application/AbilityStateData.d.ts index 653d556b05b5a56640fdb7d0f89520f4b8b4f27e..0f32059761ff63dca219ea171c1bd8169d32ca2b 100644 --- a/api/application/AbilityStateData.d.ts +++ b/api/application/AbilityStateData.d.ts @@ -17,7 +17,7 @@ * The ability or extension state data. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. * @permission N/A */ @@ -26,7 +26,7 @@ export default class AbilityStateData { * The bundle name. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. */ bundleName: string; @@ -35,7 +35,7 @@ export default class AbilityStateData { * The ability name. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. */ abilityName: string; @@ -44,7 +44,7 @@ export default class AbilityStateData { * The pid. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. */ pid: number; @@ -53,7 +53,7 @@ export default class AbilityStateData { * The uid. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. */ uid: number; @@ -62,7 +62,7 @@ export default class AbilityStateData { * The application state. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. */ state: number; @@ -70,9 +70,8 @@ export default class AbilityStateData { /** * The ability type, page or service and so on. * - * @devices phone, tablet, tv, wearable, car * @since 8 - * @sysCap appexecfwk + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. */ abilityType: number; diff --git a/api/application/AppStateData.d.ts b/api/application/AppStateData.d.ts index 62ae586ba60a945b27300bd822d9f467fe53f347..753f38cc356f785c82aa85535803e6c1a233c943 100644 --- a/api/application/AppStateData.d.ts +++ b/api/application/AppStateData.d.ts @@ -17,7 +17,7 @@ * The application state data. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. * @permission N/A */ @@ -26,7 +26,7 @@ export default class AppStateData { * The bundle name. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. */ bundleName: string; @@ -35,7 +35,7 @@ export default class AppStateData { * The uid. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. */ uid: number; @@ -44,7 +44,7 @@ export default class AppStateData { * The application state. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. */ state: number; diff --git a/api/application/ApplicationStateObserver.d.ts b/api/application/ApplicationStateObserver.d.ts index 5ce1e00ba543d1334e6ce9aaf06955af556c2435..96341bd8a353877a4c6ea313e527c8ab4b4ec8b6 100644 --- a/api/application/ApplicationStateObserver.d.ts +++ b/api/application/ApplicationStateObserver.d.ts @@ -21,7 +21,7 @@ import ProcessData from "./ProcessData"; * The application state observer. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. * @permission N/A */ @@ -30,7 +30,7 @@ export default class ApplicationStateObserver { * Will be called when foreground or background application changed. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param appStateData State changed Application info. * @systemapi hide for inner use. * @return - @@ -41,7 +41,7 @@ export default class ApplicationStateObserver { * Will be called when ability state changed. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param abilityStateData State changed ability info. * @systemapi hide for inner use. * @return - @@ -52,7 +52,7 @@ export default class ApplicationStateObserver { * Will be called when process created. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param processData Process info. * @systemapi hide for inner use. * @return - @@ -63,7 +63,7 @@ export default class ApplicationStateObserver { * Will be called when process died. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param processData Process info. * @systemapi hide for inner use. * @return - diff --git a/api/application/BaseContext.d.ts b/api/application/BaseContext.d.ts index 7b63cc832dff0ff702a8ccdda8003be62412b6a4..50ab781d4c89f84d667680aae1b0ba251b025c70 100644 --- a/api/application/BaseContext.d.ts +++ b/api/application/BaseContext.d.ts @@ -18,7 +18,7 @@ * 'application.Context' for Stage Mode. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A */ export default interface BaseContext { @@ -26,7 +26,7 @@ export default interface BaseContext { * Indicates the context is FA Mode or Stage Mode. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ stageMode: boolean; } \ No newline at end of file diff --git a/api/application/Context.d.ts b/api/application/Context.d.ts deleted file mode 100755 index e8678b43276c66040a4184285842bc073b0f1024..0000000000000000000000000000000000000000 --- a/api/application/Context.d.ts +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { ApplicationInfo } from "../bundle/applicationInfo"; -import resmgr from "../@ohos.resourceManager"; -import BaseContext from "./BaseContext"; -import EventHub from "./EventHub"; - -/** - * The base context of an ability or an application. It allows access to - * application-specific resources. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly - */ -export default class Context extends BaseContext { - /** - * Indicates the capability of accessing application resources. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - resourceManager: resmgr.ResourceManager; - - /** - * Indicates configuration information about an application. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - applicationInfo: ApplicationInfo; - - /** - * Indicates app cache dir. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - cacheDir: string; - - /** - * Indicates app temp dir. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - tempDir: string; - - /** - * Indicates app files dir. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - filesDir : string; - - /** - * Indicates app database dir. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - databaseDir : string; - - /** - * Indicates app storage dir. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - storageDir : string; - - /** - * Indicates app bundle code dir. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - bundleCodeDir : string; - - /** - * Indicates app distributed files dir. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - distributedFilesDir: string; - - /** - * Indicates event hub. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - eventHub: EventHub; - - /** - * Create a bundle context - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @param bundleName Indicates the bundle name. - * @return application context - * @StageModelOnly - */ - createBundleContext(bundleName: string): Context; - - /** - * Get application context - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @return application context - * @StageModelOnly - */ - getApplicationContext(): Context; - - /** - * Switch file area - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param mode file area. - * @StageModelOnly - */ - switchArea(mode: AreaMode): void; -} - -export enum AreaMode { - EL1 = 0, - EL2 = 1, - EL3 = 2, - EL4 = 3 -} \ No newline at end of file diff --git a/api/application/EventHub.d.ts b/api/application/EventHub.d.ts deleted file mode 100644 index 8c198ce678f19d2b61f049ec3950dfdba52d1a39..0000000000000000000000000000000000000000 --- a/api/application/EventHub.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * The event center of a context, support the subscription and publication of events. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @devices phone, tablet, tv, wearable, car - * @permission N/A - * @StageModelOnly - */ -export default class EventHub { - /** - * Subscribe to an event. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param event Indicates the event. - * @param callback Indicates the callback. - * @return - - * @StageModelOnly - */ - on(event: string, callback: Function): void - - /** - * Unsubscribe from an event. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param event Indicates the event. - * @param callback Indicates the callback. - * @return - - * @StageModelOnly - */ - off(event: string, callback?: Function): void - - /** - * Trigger the event callbacks. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param event Indicates the event. - * @param args Indicates the callback arguments. - * @return - - * @StageModelOnly - */ - emit(event: string, ...args: Object[]): void -} \ No newline at end of file diff --git a/api/application/ExtAbilityContext.d.ts b/api/application/ExtAbilityContext.d.ts deleted file mode 100644 index c8cccfb6b2d788463029406016e348d5eca01d97..0000000000000000000000000000000000000000 --- a/api/application/ExtAbilityContext.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { HapModuleInfo } from "../bundle/hapModuleInfo"; -import Context from "./Context"; - -/** - * The context of an extension. It allows access to extension-specific resources. - * - * @since 9 - * @sysCap AAFwk - * @devices phone, tablet, tv, wearable, car - * @permission N/A - * @StageModelOnly - */ -export default class ExtAbilityContext extends Context { - - /** - * Indicates configuration information about an module. - * - * @since 9 - * @sysCap AAFwk - * @StageModelOnly - */ - currentHapModuleInfo: HapModuleInfo; -} \ No newline at end of file diff --git a/api/application/ExtensionRunningInfo.d.ts b/api/application/ExtensionRunningInfo.d.ts deleted file mode 100644 index 17cd0bd6e7c765a731eec4dbc5a435b8da8feda5..0000000000000000000000000000000000000000 --- a/api/application/ExtensionRunningInfo.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { ElementName } from '../bundle/elementName'; -import bundle from '../@ohos.bundle'; - -/** - * The class of an extension running information. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - */ -export interface ExtensionRunningInfo { - /** - * @default Indicates the extension of the extension info - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - */ - extension: ElementName; - - /** - * @default process id - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - */ - pid: number; - - /** - * @default user id - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - */ - uid: number; - - /** - * @default the name of the process - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - */ - processName: string; - - /** - * @default ability start time - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - */ - startTime: number; - - /** - * @default All package names under the current process - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - */ - clientPackage: Array; - - /** - * @default Enumerates types of the entension info - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - */ - type: bundle.ExtensionAbilityType; -} \ No newline at end of file diff --git a/api/application/FormExtensionContext.d.ts b/api/application/FormExtensionContext.d.ts deleted file mode 100644 index dd2d16bc81cb98b14817a9b96a0e5e6472a91fb3..0000000000000000000000000000000000000000 --- a/api/application/FormExtensionContext.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { AsyncCallback } from "../basic"; -import ExtensionContext from "./ExtensionContext"; -import formBindingData from '../@ohos.application.formBindingData'; - -/** - * The context of form extension. It allows access to - * formExtension-specific resources. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly - */ -export default class FormExtensionContext extends ExtensionContext { - - /** - * update the given form. - * - *

You can use this method to update the given form

- * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @permission ohos.permission.REQUIRE_FORM. - * @param formId Indicates the given form. - * @param formBindingData Indicates the form data. - * @return - - * @StageModelOnly - */ - updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback): void; - updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise; -} \ No newline at end of file diff --git a/api/application/MissionInfo.d.ts b/api/application/MissionInfo.d.ts index 0b2a3e92a177b5dbcb194a7ba7a40b82515fbd91..5233bce35ebd239f203655f55dfa93045eece809 100644 --- a/api/application/MissionInfo.d.ts +++ b/api/application/MissionInfo.d.ts @@ -19,8 +19,7 @@ import Want from "../@ohos.application.Want"; * Mission information corresponding to ability. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @permission N/A * @systemapi hide for inner use. */ @@ -29,7 +28,7 @@ export interface MissionInfo { * Indicates mission id. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission */ missionId: number; @@ -37,7 +36,7 @@ export interface MissionInfo { * Indicates running state. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission */ runningState: number; @@ -45,7 +44,7 @@ export interface MissionInfo { * Indicates locked state. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission */ lockedState: boolean; @@ -53,7 +52,7 @@ export interface MissionInfo { * Indicates the recent create or update time of the mission. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission */ timestamp: string; @@ -61,7 +60,7 @@ export interface MissionInfo { * Indicates want of the mission. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission */ want: Want; @@ -69,7 +68,7 @@ export interface MissionInfo { * Indicates label of the mission. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission */ label: string; @@ -77,7 +76,7 @@ export interface MissionInfo { * Indicates icon path of the mission. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission */ iconPath: string; @@ -85,7 +84,7 @@ export interface MissionInfo { * Indicates whether the mision is continuable. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission */ continuable: boolean; } \ No newline at end of file diff --git a/api/application/MissionListener.d.ts b/api/application/MissionListener.d.ts index d9f36505f5de78a1843504bac720d42a7af37510..c4bb55f70d81efad3dbaa9fe3d8de69b46aac594 100644 --- a/api/application/MissionListener.d.ts +++ b/api/application/MissionListener.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 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 @@ -18,7 +18,7 @@ * * @name MissionListener * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @permission N/A * @systemapi hide for inner use. */ @@ -27,7 +27,8 @@ * Called by system when mission created. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param mission Indicates the id of created mission. * @return - */ onMissionCreated(mission: number): void; @@ -36,7 +37,8 @@ * Called by system when mission destroyed. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param mission Indicates the id of destroyed mission. * @return - */ onMissionDestroyed(mission: number): void; @@ -45,7 +47,8 @@ * Called by system when mission shapshot changed. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param mission Indicates the id of the mission which the snapshot changes * @return - */ onMissionSnapshotChanged(mission: number): void; @@ -54,7 +57,8 @@ * Called by system when mission moved to fornt. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param mission Indicates the id of the mission being moved to the foreground. * @return - */ onMissionMovedToFront(mission: number): void; diff --git a/api/application/MissionSnapshot.d.ts b/api/application/MissionSnapshot.d.ts index d7b85a300f5a037e4090eb8f48fac12f5bcedc9e..3fa0dd05878ad1bb7db96bcb761bfd91b50b15f7 100644 --- a/api/application/MissionSnapshot.d.ts +++ b/api/application/MissionSnapshot.d.ts @@ -20,7 +20,7 @@ import { image } from '../@ohos.multimedia.image'; * Mission snapshot corresponding to mission. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @permission N/A * @systemapi hide for inner use. */ @@ -29,7 +29,7 @@ export interface MissionSnapshot { * Indicates the ability elementName of the mission. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission */ ability: ElementName; @@ -37,7 +37,7 @@ export interface MissionSnapshot { * Indicates mission snapshot. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission */ snapshot: image.PixelMap; } \ No newline at end of file diff --git a/api/application/ProcessData.d.ts b/api/application/ProcessData.d.ts index 3bd242710666869cbdc89bb76375a0352a15e96b..8be5e311efff552f8eb946333d61bd2c7c7f7f33 100644 --- a/api/application/ProcessData.d.ts +++ b/api/application/ProcessData.d.ts @@ -17,7 +17,7 @@ * The process data. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @systemapi hide for inner use. * @permission N/A */ @@ -26,7 +26,7 @@ export default class ProcessData { * The bundle name. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @systemapi hide for inner use. */ bundleName: string; @@ -35,7 +35,7 @@ export default class ProcessData { * The pid. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @systemapi hide for inner use. */ pid: number; @@ -44,7 +44,7 @@ export default class ProcessData { * The uid. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @systemapi hide for inner use. */ uid: number; diff --git a/api/application/ProcessRunningInfo.d.ts b/api/application/ProcessRunningInfo.d.ts index 9349cb9135ecdf064806690211e3ac8592d9f3e9..ba19a3b55b473a5a6c2319ae60d3892194630abc 100644 --- a/api/application/ProcessRunningInfo.d.ts +++ b/api/application/ProcessRunningInfo.d.ts @@ -17,35 +17,35 @@ * The class of an process running information. * * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @permission N/A */ export interface ProcessRunningInfo { /** * @default process id * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission */ pid: number; /** * @default user id * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission */ uid: number; - + /** * @default the name of the process * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission */ processName: string; - + /** * @default an array of the bundleNames running in the process * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Mission */ bundleNames: Array; } \ No newline at end of file diff --git a/api/application/ServiceExtAbilityContext.d.ts b/api/application/ServiceExtAbilityContext.d.ts deleted file mode 100644 index 6ffe342387e66323cc19ba25e4cab726dc761553..0000000000000000000000000000000000000000 --- a/api/application/ServiceExtAbilityContext.d.ts +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { AsyncCallback } from "../basic"; -import { ConnectOptions } from "../ability/connectOptions"; -import ExtAbilityContext from "./ExtAbilityContext"; -import Want from "../@ohos.application.Want"; -import StartOptions from "../@ohos.application.StartOptions"; - -/** - * The context of service extension. It allows access to - * serviceExtension-specific resources. - * - * @since 9 - * @sysCap AAFwk - * @devices phone, tablet, tv, wearable, car - * @systemapi hide for inner use. - * @permission N/A - * @StageModelOnly - */ -export default class ServiceExtAbilityContext extends ExtAbilityContext { - /** - * Service extension uses this method to start a specific ability. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @param parameter Indicates the ability to start. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - startAbility(want: Want, callback: AsyncCallback): void; - startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; - startAbility(want: Want, options?: StartOptions): Promise; - - /** - * Service extension uses this method to start a specific ability with account. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @param parameter Indicates the ability to start. - * @param parameter Indicates the accountId to start. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; - startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; - startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; - - /** - * Destroys this service extension. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - terminateSelf(callback: AsyncCallback): void; - terminateSelf(): Promise; - - /** - * Connects an ability to a Service extension. - * - *

This method can be called by an ability or service extension, but the destination of the connection must be a - * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target - * service extension when the Service extension is connected.

- * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @param request Indicates the service extension to connect. - * @systemapi hide for inner use. - * @return connection id, int value. - * @StageModelOnly - */ - connectAbility(want: Want, options: ConnectOptions): number; - - /** - * Connects an ability to a Service extension with account. - * - *

This method can be called by an ability or service extension, but the destination of the connection must be a - * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target - * service extension when the Service extension is connected.

- * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @param request Indicates the service extension to connect. - * @param request Indicates the account to connect. - * @systemapi hide for inner use. - * @return connection id, int value. - * @StageModelOnly - */ - connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; - - /** - * Disconnects an ability to a service extension, in contrast to - * {@link connectAbility}. - * - * @devices phone, tablet, tv, wearable, car - * @since 9 - * @sysCap AAFwk - * @param connection the connection id returned from connectAbility api. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - disconnectAbility(connection: number, callback:AsyncCallback): void; - disconnectAbility(connection: number): Promise; -} \ No newline at end of file diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts deleted file mode 100644 index ce5e61f0654409a57810d33d2bb64108bf4c0509..0000000000000000000000000000000000000000 --- a/api/application/ServiceExtensionContext.d.ts +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { AsyncCallback } from "../basic"; -import { ConnectOptions } from "../ability/connectOptions"; -import ExtensionContext from "./ExtensionContext"; -import Want from "../@ohos.application.Want"; -import StartOptions from "../@ohos.application.StartOptions"; -import { ExtensionAbilityInfo } from "../bundle/extensionAbilityInfo"; - -/** - * The context of service extension. It allows access to - * serviceExtension-specific resources. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission - * @systemapi hide for inner use. - * @permission N/A - * @StageModelOnly - */ -export default class ServiceExtensionContext extends ExtensionContext { - /** - * Service extension information. - * - * @since 9 - * @sysCap AAFwk - */ - extensionAbilityInfo: ExtensionAbilityInfo; - - /** - * Service extension uses this method to start a specific ability. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission - * @param parameter Indicates the ability to start. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - startAbility(want: Want, callback: AsyncCallback): void; - startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; - startAbility(want: Want, options?: StartOptions): Promise; - - /** - * Service extension uses this method to start a specific ability with account. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission - * @param parameter Indicates the ability to start. - * @param parameter Indicates the accountId to start. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; - startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; - startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; - - /** - * Destroys this service extension. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - terminateSelf(callback: AsyncCallback): void; - terminateSelf(): Promise; - - /** - * Connects an ability to a Service extension. - * - *

This method can be called by an ability or service extension, but the destination of the connection must be a - * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target - * service extension when the Service extension is connected.

- * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission - * @param request Indicates the service extension to connect. - * @systemapi hide for inner use. - * @return connection id, int value. - * @StageModelOnly - */ - connectAbility(want: Want, options: ConnectOptions): number; - - /** - * Connects an ability to a Service extension with account. - * - *

This method can be called by an ability or service extension, but the destination of the connection must be a - * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target - * service extension when the Service extension is connected.

- * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission - * @param request Indicates the service extension to connect. - * @param request Indicates the account to connect. - * @systemapi hide for inner use. - * @return connection id, int value. - * @StageModelOnly - */ - connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; - - /** - * Disconnects an ability to a service extension, in contrast to - * {@link connectAbility}. - * - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission - * @param connection the connection id returned from connectAbility api. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly - */ - disconnectAbility(connection: number, callback:AsyncCallback): void; - disconnectAbility(connection: number): Promise; -} \ No newline at end of file diff --git a/api/application/abilityDelegator.d.ts b/api/application/abilityDelegator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b19a849e732fc11b38a88fbbdcc60347002bf2bc --- /dev/null +++ b/api/application/abilityDelegator.d.ts @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from '../basic'; +import { Ability } from '../@ohos.application.Ability' +import { AbilityMonitor } from './abilityMonitor' +import { Context } from '../app/context' +import { ShellCmdResult } from './shellCmdResult' + +/** + * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import AbilityDelegator from 'application/abilityDelegator.d' + * @permission N/A + */ +export interface AbilityDelegator { + /** + * Prints log information to the unit testing console. + * The total length of the log information to be printed cannot exceed 1000 characters. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param msg Log information + */ + print(msg: string, callback: AsyncCallback): void; + print(msg: string): Promise; + + /** + * Execute the given command in the aa tools side. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param cmd Shell command + * @param timeoutSecs Timeout, in seconds + * @return ShellCmdResult object + */ + executeShellCommand(cmd: string, callback: AsyncCallback): void; + executeShellCommand(cmd: string, timeoutSecs: number, callback: AsyncCallback): void; + executeShellCommand(cmd: string, timeoutSecs?: number): Promise; + + /** + * Prints log information to the unit testing console. + * The total length of the log information to be printed cannot exceed 1000 characters. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi Hide this for inner system use. + * @param msg Log information + * @param code Result code + */ + finishTest(msg: string, code: number, callback: AsyncCallback): void; + finishTest(msg: string, code: number): Promise; +} + +export default AbilityDelegator; \ No newline at end of file diff --git a/api/@ohos.application.AbilityStage.d.ts b/api/application/abilityDelegatorArgs.d.ts similarity index 50% rename from api/@ohos.application.AbilityStage.d.ts rename to api/application/abilityDelegatorArgs.d.ts index 7d1762c145c62798083d80e1da61e1aae9809520..f140bc13d89c9c29c89e85b85b480d4cd9522b95 100644 --- a/api/@ohos.application.AbilityStage.d.ts +++ b/api/application/abilityDelegatorArgs.d.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), + * 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 * @@ -13,56 +13,47 @@ * limitations under the License. */ -import AbilityStageContext from "./application/AbilityStageContext"; -import Want from './@ohos.application.Want'; -import { Configuration } from './@ohos.application.Configuration'; /** - * The class of an ability stage. + * Store unit testing-related parameters, including test case names, and test runner name. * - * @since 9 + * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import AbilityDelegatorArgs from 'application/abilityDelegatorArgs.d' * @permission N/A - * @StageModelOnly */ -export default class AbilityStage { +export interface AbilityDelegatorArgs { /** - * Indicates configuration information about context. + * the bundle name of the application being tested. * - * @since 9 + * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly */ - context: AbilityStageContext; + bundleName: string; /** - * Called back when an ability stage is started for initialization. + * the parameters used for unit testing. * - * @since 9 + * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return - - * @StageModelOnly */ - onCreate(): void; + parameters: {[key: string]: string}; /** - * Called back when start specified ability. + * the class names of all test cases. * - * @devices phone, tablet, tv, wearable, car - * @since 9 + * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return - - * @StageModelOnly */ - onAcceptWant(want: Want): string; + testCaseNames: string; /** - * Called when the system configuration is updated. + * the class name of the test runner used to execute test cases. * - * @since 9 + * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return - - * @StageModelOnly */ - onConfigurationUpdated(config: Configuration): void; + testRunnerClassName: string; } + +export default AbilityDelegatorArgs; \ No newline at end of file diff --git a/api/application/AbilityStageContext.d.ts b/api/application/shellCmdResult.d.ts similarity index 55% rename from api/application/AbilityStageContext.d.ts rename to api/application/shellCmdResult.d.ts index 4b2777b37d1f0f7a7441e4e0c7661829f3fce56b..78e64926aba74fcb5ac9ee25788916e4a13b6c02 100644 --- a/api/application/AbilityStageContext.d.ts +++ b/api/application/shellCmdResult.d.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), + * 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 * @@ -13,35 +13,30 @@ * limitations under the License. */ -import { HapModuleInfo } from "../bundle/hapModuleInfo"; -import { Configuration } from '../@ohos.application.Configuration'; -import Context from "./Context"; - /** - * The context of an abilityStage. It allows access to abilityStage-specific resources. + * A object that records the result of shell command executes. * - * @since 9 + * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import ShellCmdResult from 'application/shellCmdResult.d' * @permission N/A - * @StageModelOnly */ -export default class AbilityStageContext extends Context { - +export interface ShellCmdResult { /** - * Indicates configuration information about an module. + * the cmd standard result. * - * @since 9 + * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly */ - currentHapModuleInfo: HapModuleInfo; + stdResult: String; /** - * Indicates configuration information. + * shell cmd exec result. * - * @since 9 + * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly */ - config: Configuration; -} \ No newline at end of file + exitCode: number; +} + +export default ShellCmdResult; \ No newline at end of file diff --git a/api/basic.d.ts b/api/basic.d.ts index e55591b491fb19f037b3c16c1bd5dfcef5dc6e30..66a84e73b9f18b2ff56f4d724b4da6c8ac3ba694 100755 --- a/api/basic.d.ts +++ b/api/basic.d.ts @@ -13,18 +13,50 @@ * limitations under the License. */ +/** + * Defines the basic callback. + * @since 6 + */ export interface Callback { - (data: T): void; + /** + * Defines the callback info. + * @since 6 + */ + (data: T): void; } - + +/** + * Defines the basic error callback. + * @since 6 + */ export interface ErrorCallback { - (err: T): void; + /** + * Defines the basic error callback. + * @since 6 + */ + (err: T): void; } +/** + * Defines the basic async callback. + * @since 6 + */ export interface AsyncCallback { - (err: BusinessError, data: T): void; + /** + * Defines the callback data. + * @since 6 + */ + (err: BusinessError, data: T): void; } +/** + * Defines the error interface. + * @since 6 + */ export interface BusinessError extends Error { - code: number; + /** + * Defines the basic error code. + * @since 6 + */ + code: number; } diff --git a/api/bundle/abilityInfo.d.ts b/api/bundle/abilityInfo.d.ts index 87bd8399bc566e9c80a386ddadbc71fe3337ddd8..4a7fb44e5eeaf71e1fc189ba753507b078e13bf1 100644 --- a/api/bundle/abilityInfo.d.ts +++ b/api/bundle/abilityInfo.d.ts @@ -15,7 +15,6 @@ import { ApplicationInfo } from './applicationInfo'; import { CustomizeData } from './customizeData' -import { Metadata } from './metadata' import bundle from './../@ohos.bundle'; /** @@ -217,15 +216,7 @@ export interface AbilityInfo { readonly metaData: Array; /** - * @default Indicates the metadata of ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * - */ - readonly metadata: Array; - - /** - * @default Indicates the metadata of ability + * @default Indicates whether the ability is enabled * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework */ diff --git a/api/bundle/applicationInfo.d.ts b/api/bundle/applicationInfo.d.ts index 469e18a970c63cb5b39ef54c20a9396ef72ad9fe..b2007eb007d7f8c7fe42d18d3a4216dfc78d6331 100644 --- a/api/bundle/applicationInfo.d.ts +++ b/api/bundle/applicationInfo.d.ts @@ -15,7 +15,6 @@ import { ModuleInfo } from './moduleInfo'; import { CustomizeData } from './customizeData' -import { Metadata } from './metadata' /** * @name Obtains configuration information about an application @@ -144,13 +143,6 @@ export interface ApplicationInfo { */ readonly metaData: Map>; - /** - * @default Indicates the metadata of module - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly metadata: Map>; - /** * @default Indicates whether or not this application may be removable * @since 8 diff --git a/api/bundle/bundleInfo.d.ts b/api/bundle/bundleInfo.d.ts index dddca464338e6f6db81c9f5770e02038222b65d0..2bf2e4abc1ac7152b1e1319e2d1006a760c34eff 100644 --- a/api/bundle/bundleInfo.d.ts +++ b/api/bundle/bundleInfo.d.ts @@ -15,7 +15,6 @@ import { AbilityInfo } from './abilityInfo'; import { ApplicationInfo } from './applicationInfo'; -import { ExtensionAbilityInfo } from './extensionAbilityInfo'; import { HapModuleInfo } from './hapModuleInfo'; /** @@ -242,11 +241,4 @@ export interface BundleInfo { * @syscap SystemCapability.BundleManager.BundleFramework */ readonly reqPermissionStates: Array; - - /** - * @default Obtains configuration information about an ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly extensionAbilityInfo: Array; } diff --git a/api/bundle/bundleInstaller.d.ts b/api/bundle/bundleInstaller.d.ts index e70342173f638e17968381bdbde6154d8c8453d2..671798824333ac80949166ca22e13b36df5794ac 100644 --- a/api/bundle/bundleInstaller.d.ts +++ b/api/bundle/bundleInstaller.d.ts @@ -21,7 +21,7 @@ import bundle from './../@ohos.bundle'; * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @systemapi Hide this for inner system use */ export interface InstallParam { /** @@ -51,7 +51,7 @@ export interface InstallParam { * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @systemapi Hide this for inner system use */ export interface InstallStatus { @@ -75,7 +75,7 @@ export interface InstallStatus { * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @systemapi Hide this for inner system use */ export interface BundleInstaller { /** diff --git a/api/bundle/bundleStatusCallback.d.ts b/api/bundle/bundleStatusCallback.d.ts index d42bbf232980d8b3113e98a8b25181bd4ffc9261..b5c4d368583d4bffdefc1f34d8fe4d41654cdf0c 100644 --- a/api/bundle/bundleStatusCallback.d.ts +++ b/api/bundle/bundleStatusCallback.d.ts @@ -24,7 +24,7 @@ * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @systemapi Hide this for inner system use */ -declare interface BundleStatusCallback { +export interface BundleStatusCallback { /** * @name Obtains add callback about an launcherStatusCallback. * @since 8 diff --git a/api/bundle/extensionAbilityInfo.d.ts b/api/bundle/extensionAbilityInfo.d.ts deleted file mode 100644 index c533ad6dc54b7aab9eb928e0b6be0940c01001f5..0000000000000000000000000000000000000000 --- a/api/bundle/extensionAbilityInfo.d.ts +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { ApplicationInfo } from './applicationInfo'; -import { Metadata } from './metadata' -import bundle from './../@ohos.bundle'; - -/** - * @name Obtains extension information about a bundle - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ -export interface ExtensionAbilityInfo { - /** - * @default Indicates the name of the bundle - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly bundleName: string; - - /** - * @default Indicates the name of the module - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleName: string; - - /** - * @default Indicates the name of the extension info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - - /** - * @default Indicates the label id of the entension info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly labelId: number; - - /** - * @default Indicates the description id of the entension info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly descriptionId: number; - - /** - * @default Indicates the icon id of the entension info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly iconId: number; - - /** - * @default Indicates whether the entensionInfo can be visible or not - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly isVisible: boolean; - - /** - * @default Enumerates types of the entension info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly extensionAbilityType: bundle.ExtensionAbilityType; - - /** - * @default The permissions that others need to use this extension info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly permissions: Array; - - /** - * @default Obtains configuration information about an application - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly applicationInfo: ApplicationInfo; - - /** - * @default Indicates the metadata of bundle - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly metadata: Array; - - /** - * @default Indicates the src language to express extension info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly enabled: boolean; - - /** - * @default Indicates the read permission extension ability info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly readPermission: string; - - /** - * @default Indicates the write permission of extension ability info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly writePermission: string; -} diff --git a/api/bundle/hapModuleInfo.d.ts b/api/bundle/hapModuleInfo.d.ts index 9c428d4376b4c4a901ef1a19be14d7597ad17232..5b96ad988375b843ce8fb88e417bb250f3843dd2 100644 --- a/api/bundle/hapModuleInfo.d.ts +++ b/api/bundle/hapModuleInfo.d.ts @@ -14,7 +14,6 @@ */ import { AbilityInfo } from "./abilityInfo"; -import { ExtensionAbilityInfo } from "./extensionAbilityInfo"; /** * @name Obtains configuration information about an module. @@ -114,18 +113,4 @@ export interface HapModuleInfo { * @syscap SystemCapability.BundleManager.BundleFramework */ readonly installationFree: boolean; - - /** - * @default Indicates main elementName of the module - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly mainElementName: string; - - /** - * @default Obtains configuration information about extension ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly extensionAbilityInfo: Array; } \ No newline at end of file diff --git a/api/bundle/launcherAbilityInfo.d.ts b/api/bundle/launcherAbilityInfo.d.ts index ea83266096c200057cd08cc868884e7d7cc5bf1b..0029d5578d022fe337bd320cf08b93adf13c21ce 100644 --- a/api/bundle/launcherAbilityInfo.d.ts +++ b/api/bundle/launcherAbilityInfo.d.ts @@ -20,7 +20,6 @@ * @name Contains basic launcher Ability information, which uniquely identifies an LauncherAbilityInfo * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework - * * @permission N/A * @systemapi Hide this for inner system use */ diff --git a/api/bundle/moduleUsageRecord.d.ts b/api/bundle/moduleUsageRecord.d.ts deleted file mode 100644 index 4b7f457e9aab64c0305c93210c9698eb40969ec8..0000000000000000000000000000000000000000 --- a/api/bundle/moduleUsageRecord.d.ts +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @name Stores FA usage information. - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - * @systemapi hide this for inner system use - */ - export interface ModuleUsageRecord { - /** - * @default Indicates the name of the bundle containing the module - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly bundleName: string; - /** - * @default Indicates the app label id of this module - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly appLabelId: number; - /** - * @default Indicates the name of this module - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - /** - * @default Indicates the label id of this module - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly labelId: number; - /** - * @default Indicates the description id of this module - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly descriptionId: number; - /** - * @default Indicates the ability name of this module - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly abilityName: string; - /** - * @default Indicates the ability label id of this module - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly abilityLabelId: number; - /** - * @default Indicates the ability description id of this module - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly abilityDescriptionId: number; - /** - * @default Indicates the ability icon id of this module - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly abilityIconId: number; - /** - * @default Indicates the launched count of this module - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly launchedCount: number; - /** - * @default Indicates the last launch time of this module - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly lastLaunchTime: number; - /** - * @default Indicates whether the module is removed - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly isRemoved: boolean; - /** - * @default Indicates whether free installation of the module is supported - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly installationFreeSupported: boolean; -} \ No newline at end of file diff --git a/api/bundle/shortcutInfo.d.ts b/api/bundle/shortcutInfo.d.ts index 8ae4be279fa42a47d6595ca192e8dcc5c2547758..78d78ce8d93d000a32cea805e2cead8d68026aaf 100644 --- a/api/bundle/shortcutInfo.d.ts +++ b/api/bundle/shortcutInfo.d.ts @@ -19,7 +19,7 @@ * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @systemapi Hide this for inner system use */ export interface ShortcutWant{ /** diff --git a/api/common/full/canvaspattern.d.ts b/api/common/full/canvaspattern.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..df8620d802bd120b2886d254d895e2ab5cb4f2b8 --- /dev/null +++ b/api/common/full/canvaspattern.d.ts @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2022 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. + */ + +/** + * Describes an opaque object of a template, which is created using the createPattern() method. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + export interface CanvasPattern { + /** + * Adds the matrix transformation effect to the current template. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param transform transformation matrix + * @since 8 + */ + setTransform(transform?: Matrix2D): void; +} + +/** + * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ +export class Matrix2D { + /** + * Horizontal Zoom + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + scaleX?: number; + + /** + * Vertical Tilt + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + rotateY?: number; + + /** + * Horizontal Tilt + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + rotateX?: number; + + /** + * Vertical Zoom + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + scaleY?: number; + + /** + * Horizontal movement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + translateX?: number; + + /** + * Vertical movement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + translateY?: number; + + /** + * Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational + * translation scaling effect) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + identity(): Matrix2D; + + /** + * Transform the current 2D matrix into an inverse matrix (that is, the transformation effect + * is the opposite effect of the original) + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + invert(): Matrix2D; + + /** + * The matrix is superimposed in right multiplication mode. When the input parameter is empty, + * the matrix is superimposed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param other Matrix to be superimposed + * @since 8 + */ + multiply(other?: Matrix2D): Matrix2D; + + /** + * Adds the rotation effect of the X and Y axes to the current matrix. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param rx Rotation effect of the X axis + * @param ry Rotation effect of the Y-axis + * @since 8 + */ + rotate(rx?: number, ry?: number): Matrix2D; + + /** + * Adds the translation effect of the X and Y axes to the current matrix. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param tx X-axis translation effect + * @param ty Y-axis translation effect + * @since 8 + */ + translate(tx?: number, ty?: number): Matrix2D; + + /** + * Adds the scaling effect of the X and Y axes to the current matrix. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param sx X-axis scaling effect + * @param sy Y-axis scaling effect + * @since 8 + */ + scale(sx?: number, sy?: number): Matrix2D; + + /** + * Constructs a 2D change matrix object. The default value is the unit matrix. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + constructor(); +} \ No newline at end of file diff --git a/api/common/@internal/console.d.ts b/api/common/full/console.d.ts similarity index 76% rename from api/common/@internal/console.d.ts rename to api/common/full/console.d.ts index 69aa3336d55ea8a95641b051e8ec6aad51abb54d..4aac0b1c9255feb2e83208c7028cb081345118ec 100644 --- a/api/common/@internal/console.d.ts +++ b/api/common/full/console.d.ts @@ -14,42 +14,37 @@ */ /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ export declare class console { /** * Prints "debug" logs. * @param message Text to print. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static debug(message: string, ...arguments: any[]): void; /** * Prints "log" logs. * @param message Text to print. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static log(message: string, ...arguments: any[]): void; /** * Prints "info" logs. * @param message Text to print. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static info(message: string, ...arguments: any[]): void; /** * Prints "warn" logs. * @param message Text to print. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static warn(message: string, ...arguments: any[]): void; /** * Prints "error" logs. * @param message Text to print. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static error(message: string, ...arguments: any[]): void; } diff --git a/api/common/@internal/dom.d.ts b/api/common/full/dom.d.ts similarity index 92% rename from api/common/@internal/dom.d.ts rename to api/common/full/dom.d.ts index 39f358f314f49f9cdc76571f5c1a9f1ec20f26e5..3480dfd2a1a4ab49544cd19be87424ea110511ad 100644 --- a/api/common/@internal/dom.d.ts +++ b/api/common/full/dom.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -export { Element } from './viewmodel'; +import { Element } from './viewmodel'; /** * global dom diff --git a/api/common/full/featureability.d.ts b/api/common/full/featureability.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bc82d0a30fe70a1ef0816665a0a5d0da0bbfcaac --- /dev/null +++ b/api/common/full/featureability.d.ts @@ -0,0 +1,399 @@ +/* + * Copyright (c) 2020 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. + */ + +/** + * @since 5 + * @deprecated since 8 + */ +export interface Result { + /** + * Result code. + * @since 5 + */ + code: number; + + /** + * Returned data. + * @since 5 + */ + data: object; +} + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 5 + * @deprecated since 8 + */ +export interface SubscribeMessageResponse { + /** + * Peer device ID. + * @since 5 + */ + deviceId: string; + + /** + * Name of the bundle where the peer ability locates. The name is case sensitive. + * @since 5 + */ + bundleName: string; + + /** + * Peer ability name, which is case sensitive. + * @since 5 + */ + abilityName: string; + + /** + * Messages received from the device. + * @since 5 + */ + message: string; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export interface CallAbilityParam { + /** + * Name of the bundle where the ability locates. The name is case sensitive and must be the same as that on the AA side. + * @since 5 + */ + bundleName: string; + + /** + * Ability name, which is case sensitive and must be the same as that on the AA side. + * @since 5 + */ + abilityName: string; + + /** + * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. + * @since 5 + */ + messageCode: number; + + /** + * Ability type. Different types of abilities have different implementation on the AA side. + * 0: Ability, which has an independent lifecycle. The FA starts and requests an AA through an RPC. Such type of abilities are used to provide basic services for multiple FAs to call or are used when the abilities should run in the background. + * 1: Internal ability, which shares the same process with the FA and communicates with it by calling internal functions. Such type of abilities are used in scenarios that require low response latency and cannot be called by other FAs. + * @since 5 + */ + abilityType: number; + + /** + * Data sent to the ability. The data to carry differs depending on the service to be processed and its field name must be consistent with the AA side. + * @since 5 + */ + data?: object; + + /** + * Whether the request is synchronous or asynchronous. The synchronous mode is used by default. Currently, the asynchronous mode is available only for internal abilities. + * 0: Synchronous mode (default value) + * 1: Asynchronous mode + * @since 5 + */ + syncOption?: number; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export interface SubscribeAbilityEventParam { + /** + * Name of the bundle where the ability locates. The name is case sensitive and must be the same as that on the AA side. + * @since 5 + */ + bundleName: string; + + /** + * Ability name, which is case sensitive and must be the same as that on the AA side. + * @since 5 + */ + abilityName: string; + + /** + * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. + * @since 5 + */ + messageCode: number; + + /** + * Ability type. Different types of abilities have different implementation on the AA side. + * 0: Ability, which has an independent lifecycle. The FA starts and requests an AA through an RPC. Such type of abilities are used to provide basic services for multiple FAs to call or are used when the abilities should run in the background. + * 1: Internal ability, which shares the same process with the FA and communicates with it by calling internal functions. Such type of abilities are used in scenarios that require low response latency and cannot be called by other FAs. + * @since 5 + */ + abilityType: number; + + /** + * Whether the request is synchronous or asynchronous. The synchronous mode is used by default. Currently, the asynchronous mode is available only for internal abilities. + * 0: Synchronous mode (default value) + * 1: Asynchronous mode + * @since 5 + */ + syncOption?: number; +} + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 5 + * @deprecated since 8 + */ +export interface SendMessageOptions { + /** + * Destination device ID. + * @since 5 + */ + deviceId: string; + + /** + * Name of the destination bundle where the ability locates. The name is case sensitive. + * @since 5 + */ + bundleName: string; + + /** + * Destination ability name, which is case sensitive. + * @since 5 + */ + abilityName: string; + + /** + * Messages sent to the destination device. + * A maximum of 1 KB of data can be transmitted at a time. + * If more than 1 KB of data needs to be transmitted, split the messages into multiple parts to transmit. + * @since 5 + */ + message?: string; + + /** + * Called when the messages are sent successfully. + * @since 5 + */ + success?: () => void; + + /** + * Called when the messages fail to be sent. + * @since 5 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 5 + */ + complete?: () => void; +} + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 5 + * @deprecated since 8 + */ +export interface SubscribeMessageOptions { + /** + * Called when the messages are sent successfully. + * @since 5 + */ + success?: (data: SubscribeMessageResponse) => void; + + /** + * Called when the messages fail to be sent. + * @since 5 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export interface RequestParams { + /** + * The name of the bundle to start. It should be used with abilityname and case sensitive. + * @since 5 + */ + bundleName?: string; + + /** + * Ability name, which is case sensitive. + * @since 5 + */ + abilityName?: string; + + /** + * The list of entities to which the FA to be called. If it is not filled in, all entity lists will be found by default. It should be used with action. + * @since 5 + */ + entities?: Array; + + /** + * Without specifying the bundle name and ability name, you can start the application according to other properties with action. + * @since 5 + */ + action?: string; + + /** + * If more than one FA meets the conditions, the user can select the device from the popup. + * 0: Default. Select the FA to start from the local and remote devices. + * 1: start FA from the local device. + * @since 5 + */ + deviceType?: number; + + /** + * Data sent to the ability which need to be serializable. + * @since 5 + */ + data?: object; + + /** + * Configuration switch when start FA. + * @since 5 + */ + flag?: number; + + /** + * Specify the url of the page which the FA to be called. Use home page directly by default. + * @since 5 + */ + url?: string; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export interface FinishWithResultParams { + /** + * Result code. + * @since 5 + */ + code: number; + + /** + * Returned data. + * @since 5 + */ + result: object; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export declare class FeatureAbility { + /** + * Start a FA without callback result. + * @param request Indicates the request param. + * @returns A Promise object is returned, which contains the result of whether to call Ability's interface successfully. + * @since 5 + * @deprecated since 8 + */ + static startAbility(request: RequestParams): Promise; + + /** + * Start a FA with callback result. + * @param request Indicates the request param. + * @returns A Promise object is returned, which contains the result of the data FA returned. + * @since 5 + * @deprecated since 8 + */ + static startAbilityForResult(request: RequestParams): Promise; + + /** + * FA call the interface to destory itself and set the result as parameters. + * @param request Indicates the request param. + * @returns A Promise object is returned, which contains the result whether to callback successfully. + * @since 5 + * @deprecated since 8 + */ + static finishWithResult(param: FinishWithResultParams): Promise; + + /** + + * Get device information list. + * @param flag Default 0, get the information list of all devices in the network. + * @returns A Promise object is returned, which contains the result whether the device information list is obtained successfully. + * @since 5 + * @deprecated since 8 + */ + static getDeviceList(flag: number): Promise; + + /** + + * Calls an AA. + * @param param Indicates the request param. + * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. + * @since 5 + * @deprecated since 8 + */ + static callAbility(param: CallAbilityParam): Promise; + + /** + * Start FA migration. + * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. + * @since 5 + * @deprecated since 8 + */ + static continueAbility(): Promise; + + /** + * Subscribes to events of an AA. + * @param param Indicates the request param. + * @param func Indicates the event reporting callback. + * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. + * @since 5 + * @deprecated since 8 + */ + static subscribeAbilityEvent(param: SubscribeAbilityEventParam, func: Function): Promise; + + /** + * Unsubscribes from events of an AA. + * @param param Indicates the request param. + * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. + * @since 5 + * @deprecated since 8 + */ + static unsubscribeAbilityEvent(param: SubscribeAbilityEventParam): Promise; + + /** + * Sends messages to the destination device. + * @param options Options. + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 5 + * @deprecated since 8 + */ + static sendMsg(options: SendMessageOptions): void; + + /** + * Listens for messages sent from other devices. + * @param options Options. + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 5 + * @deprecated since 8 + */ + static subscribeMsg(options: SubscribeMessageOptions): void; + + /** + * Cancels the listening for messages sent from other devices. + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 5 + * @deprecated since 8 + */ + static unsubscribeMsg(): void; +} diff --git a/api/common/@internal/global.d.ts b/api/common/full/global.d.ts similarity index 42% rename from api/common/@internal/global.d.ts rename to api/common/full/global.d.ts index 36a6d6d1822f8ef784c9d2efea65c5447b48d359..8162470099c76dda0bba3958c679a15bdfa001b3 100644 --- a/api/common/@internal/global.d.ts +++ b/api/common/full/global.d.ts @@ -13,167 +13,224 @@ * limitations under the License. */ +import { OffscreenCanvasRenderingContext2D } from './viewmodel'; + /** * Sets the interval for repeatedly calling a function. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @param handler Indicates the function to be called after the timer goes off. For devices of "tv", "phone, tablet", and "wearable" types, this parameter can be a function or string. For devices of "lite wearable" and "smartVision" types, this parameter must be a function. * @param delay Indicates the interval between each two calls, in milliseconds. The function will be called after this delay. * @param arguments Indicates additional arguments to pass to "handler" when the timer goes off. * @returns Returns the timer ID. - * @devices tv, phone, tablet, wearable * @since 3 */ export declare function setInterval(handler: Function | string, delay: number, ...arguments: any[]): number; /** * Sets a timer after which a function will be executed. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @param handler Indicates the function to be called after the timer goes off. For devices of "tv", "phone, tablet", and "wearable" types, this parameter can be a function or string. For devices of "lite wearable" and "smartVision" types, this parameter must be a function. * @param delay Indicates the delay (in milliseconds) after which the function will be called. If this parameter is left empty, default value "0" will be used, which means that the function will be called immediately or as soon as possible. * @param arguments Indicates additional arguments to pass to "handler" when the timer goes off. * @returns Returns the timer ID. - * @devices tv, phone, tablet, wearable * @since 3 */ export declare function setTimeout(handler: Function | string, delay?: number, ...arguments: any[]): number; +/** + * Sets a vsync after which a function will be executed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param handler Indicates the function to be called when the vsync trigger. + * @since 3 + */ +export declare function requestAnimationFrame(handler: Function): number; + +/** + * Cancels the vsync callback set by "requestAnimationFrame()". + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param requestId Indicates the vsync callback ID returned by "requestAnimationFrame()". + * @since 3 + */ +export declare function cancelAnimationFrame(requestId: number): void; + /** * Cancels the interval set by " setInterval()". + * @syscap SystemCapability.ArkUI.ArkUI.Full * @param intervalID Indicates the timer ID returned by "setInterval()". - * @devices tv, phone, tablet, wearable, liteWearable, smartVision * @since 3 */ export declare function clearInterval(intervalID?: number): void; /** * Cancels the timer set by "setTimeout()". + * @syscap SystemCapability.ArkUI.ArkUI.Full * @param timeoutID Indicates the timer ID returned by "setTimeout()". - * @devices tv, phone, tablet, wearable, liteWearable, smartVision * @since 3 */ 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. + * @since 5 + * @deprecated since 8 + */ +export declare function createLocalParticleAbility(name?: string): any; + +/** + * Defining syscap function. + * @since 8 + */ +export declare function canIUse(syscap: string): boolean; + /** * Obtain the objects exposed in app.js - * @devices tv, phone, tablet, wearable, smartVision + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 6 */ export declare function getApp(): object; /** * You can create an Image object by calling new Image(). - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export declare class Image { - /** - * Network address or local resource. The internal URI is supported. - * @devices tv, phone, tablet, wearable - */ - src: string; - /** - * Image width. - * @devices tv, phone, tablet, wearable - */ - width?: number; - /** - * Image height. - * @devices tv, phone, tablet, wearable - */ - height?: number; - /** - * Called when an image is successfully loaded. This function has no parameter. - * @devices tv, phone, tablet, wearable - */ - onload?: () => void; - /** - * Called when an image fails to be loaded. This function has no parameter. - * @devices tv, phone, tablet, wearable - */ - onerror?: () => void; + /** + * Network address or local resource. The internal URI is supported. + * @since 4 + */ + src: string; + /** + * Image width. + * @since 4 + */ + width?: number; + /** + * Image height. + * @since 4 + */ + height?: number; + /** + * Called when an image is successfully loaded. This function has no parameter. + * @since 4 + */ + onload?: () => void; + /** + * Called when an image fails to be loaded. This function has no parameter. + * @since 4 + */ + onerror?: () => void; } /** * An ImageData object is a common object that stores the actual pixel data of a Canvas object. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export declare class ImageData { - /** - * Actual width of the ImageData object, in pixels. - * @devices tv, phone, tablet, wearable - */ - width: number; - /** - * Actual height of the ImageData object, in pixels. - * @devices tv, phone, tablet, wearable - */ - height: number; - /** - * A one-dimensional array of color values. The color values are sorted in the RGBA order and represented by integers from 0 to 255. - * @devices tv, phone, tablet, wearable - */ - data: Uint8ClampedArray; + /** + * Actual width of the ImageData object, in pixels. + * @since 4 + */ + width: number; + /** + * Actual height of the ImageData object, in pixels. + * @since 4 + */ + height: number; + /** + * A one-dimensional array of color values. The color values are sorted in the RGBA order and represented by integers from 0 to 255. + * @since 4 + */ + data: Uint8ClampedArray; } /** * OffscreenCanvas provides a Canvas object that can be rendered off-screen. * It works in both window and Web worker environments. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 */ export declare class OffscreenCanvas { - /** - * The width of the offScreen Canvas object - * The height of the offScreen Canvas object - */ - constructor(width: number, height: number); - - /** - * The width of the offScreen Canvas object - */ - width: number; - - /** - * The height of the offScreen Canvas object - */ - height: number; - - /** - * Gets the context object for off-screen drawing. - * @param contextId creates a CanvasRenderingContext2D object representing a two-dimensional rendering context. - * @param options object representing a three-dimensional rendering context. - * @returns a render canvas for the offScreen Canvas object. - */ - getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D; - - /** - * Converts the draw contents of the current off-screen draw object to a string in the form of a Blob. - * @param type indicating the image format. - * @param quality between 0 and 1 indicating image quality if the type option is image/jpeg or image/webp. - * @returns A Promise returning a Blob object representing the image contained in the canvas. - */ - toDataURL(type?: string, quality?: number): string; - - /** - * Converts the draw content in the current off-screen draw object to a Bitmap object. - * @returns Returns An ImageBitmap object. - */ - transferToImageBitmap(): ImageBitmap; + /** + * The width of the offScreen Canvas object + * The height of the offScreen Canvas object + * @since 7 + */ + constructor(width: number, height: number); + + /** + * The width of the offScreen Canvas object + * @since 7 + */ + width: number; + + /** + * The height of the offScreen Canvas object + * @since 7 + */ + height: number; + + /** + * Gets the context object for off-screen drawing. + * @param contextId creates a CanvasRenderingContext2D object representing a two-dimensional rendering context. + * @param options object representing a three-dimensional rendering context. + * @returns a render canvas for the offScreen Canvas object. + * @since 7 + */ + getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D; + + /** + * Converts the draw contents of the current off-screen draw object to a string in the form of a Blob. + * @param type indicating the image format. + * @param quality between 0 and 1 indicating image quality if the type option is image/jpeg or image/webp. + * @returns A Promise returning a Blob object representing the image contained in the canvas. + * @since 7 + */ + toDataURL(type?: string, quality?: number): string; + + /** + * Converts the draw content in the current off-screen draw object to a Bitmap object. + * @returns Returns An ImageBitmap object. + * @since 7 + */ + transferToImageBitmap(): ImageBitmap; } +/** + * Defines the ImageBitmap. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ export declare class ImageBitmap { - /** - * The height of the Image Bitmap object - */ - readonly height: number; - - /** - * The width of the Image Bitmap object - */ - readonly width: number; + /** + * The height of the Image Bitmap object. + * @since 7 + */ + readonly height: number; + + /** + * The width of the Image Bitmap object. + * @since 7 + */ + readonly width: number; } /** * Conditional compilation for rich equipment + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 + * @systemapi */ export declare const STANDARD: string; /** * Conditional compilation for lite equipment + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 + * @systemapi */ export declare const LITE: string; diff --git a/api/common/@internal/index.d.ts b/api/common/full/index.d.ts similarity index 100% rename from api/common/@internal/index.d.ts rename to api/common/full/index.d.ts diff --git a/api/common/@internal/viewmodel.d.ts b/api/common/full/viewmodel.d.ts similarity index 83% rename from api/common/@internal/viewmodel.d.ts rename to api/common/full/viewmodel.d.ts index 149e18bb6e9a29450e68f5da0a8acd7b2731c4cf..0bb59c3e7028dd465225fea4e9542520f9d26e0c 100644 --- a/api/common/@internal/viewmodel.d.ts +++ b/api/common/full/viewmodel.d.ts @@ -13,125 +13,136 @@ * limitations under the License. */ -import { Image, ImageData } from "./global"; -import { WebGLContextAttributes, WebGLRenderingContext } from "../webgl/webgl"; -import { WebGL2RenderingContext } from "../webgl/webgl2"; +import { Image, ImageData, ImageBitmap } from "./global"; +import { WebGLContextAttributes, WebGLRenderingContext } from "../../webgl/webgl"; +import { WebGL2RenderingContext } from "../../webgl/webgl2"; +import { CanvasPattern } from './canvaspattern'; /** - * @devices tv, phone, tablet, wearable + * Defines the foucs param. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 3 */ export interface FocusParamObj { /** - * @devices tv, phone, tablet, wearable + * Whether needs to focus. + * @since 3 */ focus: boolean; } /** - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 6 */ export interface RectObj { /** - * @devices tv, phone, tablet, wearable + * @since 6 */ width: number; /** - * @devices tv, phone, tablet, wearable + * @since 6 */ height: number; /** - * @devices tv, phone, tablet, wearable + * @since 6 */ left: number; /** - * @devices tv, phone, tablet, wearable + * @since 6 */ top: number; } /** - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 6 */ export interface ContextAttrOptions { + /** + * @since 6 + */ antialias: boolean; } /** - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface AnimateStyle { /** * Width value applied to the component after the animation is executed. - * @devices tv, phone, tablet, wearable + * @since 4 */ width: number; /** * Height value applied to the component after the animation is executed. - * @devices tv, phone, tablet, wearable + * @since 4 */ height: number; /** * left offset applied to the component after the animation is executed. - * @devices tv, phone, tablet, wearable + * @since 4 */ left: number; /** * top offset applied to the component after the animation is executed. - * @devices tv, phone, tablet, wearable + * @since 4 */ top: number; /** * right offset applied to the component after the animation is executed. - * @devices tv, phone, tablet, wearable + * @since 4 */ right: number; /** * bottom offset applied to the component after the animation is executed. - * @devices tv, phone, tablet, wearable + * @since 4 */ bottom: number; /** * Background color applied to the component after the animation is executed. * The default value is none. - * @devices tv, phone, tablet, wearable + * @since 4 */ backgroundColor: string; /** * Opacity applied to the component. The value ranges from 0 to 1. * The default value is 1. - * @devices tv, phone, tablet, wearable + * @since 4 */ opacity: number; /** * The value format is "x y", in percentage or pixels. * The first value indicates the horizontal position, and the second value indicates the vertical position. * If only one value is specified, the other value is 50% by default. - * @devices tv, phone, tablet, wearable + * @since 4 */ backgroundPosition: string; /** * Origin position of the transformed element. * The first value indicates the x-axis position. The value can be left, center, right, a length, or percentage. * The second value indicates the y-axis position. The value can be top, center, bottom, a length, or a percentage. - * @devices tv, phone, tablet, wearable + * @since 4 */ transformOrigin: string; /** * Transformation type applied to an element. - * @devices tv, phone, tablet, wearable + * @since 4 */ transform: "none" | TransformObject; /** * The value of offset must be within (0.0,1.0] and sorted in ascending order if it is provided. * If there are only two frames, offset can be left empty. * If there are more than two frames, offset is mandatory. - * @devices tv, phone, tablet, wearable + * @since 4 */ offset?: number; } /** - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface TransformObject { /** @@ -142,15 +153,9 @@ export interface TransformObject { * @param scaleY the scale value for y-axis * @param translateX the translate value for x-axis * @param translateY the translate value for y-axis - * @devices tv, phone, tablet, wearable + * @since 6 */ - matrix( - scaleX: number, - skewX: number, - skewY: number, - scaleY: number, - translateX: number, - translateY: number): void; + matrix(scaleX: number, skewX: number, skewY: number, scaleY: number, translateX: number, translateY: number): void; /** * Defines a 3D transformation using a 4x4 matrix of 16 values. * @param n00 the value of the 0 row and 0 column of the 4x4 matrix @@ -169,17 +174,31 @@ export interface TransformObject { * @param n31 the value of the 3 row and 1 column of the 4x4 matrix * @param n32 the value of the 3 row and 2 column of the 4x4 matrix * @param n33 the value of the 3 row and 3 column of the 4x4 matrix - * @devices tv, phone, tablet, wearable - */ - matrix3d(n00: number, n01: number, n02: number, n03: number, - n10: number, n11: number, n12: number, n13: number, - n20: number, n21: number, n22: number, n23: number, - n30: number, n31: number, n32: number, n33: number): void; + * @since 6 + */ + matrix3d( + n00: number, + n01: number, + n02: number, + n03: number, + n10: number, + n11: number, + n12: number, + n13: number, + n20: number, + n21: number, + n22: number, + n23: number, + n30: number, + n31: number, + n32: number, + n33: number, + ): void; /** * Defines 2D transformations for translation of the X and Y axes * @param x the translate value for x-axis * @param y the translate value for y-axis - * @devices tv, phone, tablet, wearable + * @since 4 */ translate(x: number, y: number): void; /** @@ -187,32 +206,32 @@ export interface TransformObject { * @param x the translate value for x-axis * @param y the translate value for y-axis * @param z the translate value for z-axis - * @devices tv, phone, tablet, wearable + * @since 6 */ translate3d(x: number, y: number, z: number): void; /** * Defines 2D transformations for translation of the X axes * @param x the translate value for x-axis - * @devices tv, phone, tablet, wearable + * @since 4 */ translateX(x: number): void; /** * Defines 2D transformations for translation of the Y axes * @param y the translate value for y-axis - * @devices tv, phone, tablet, wearable + * @since 4 */ translateY(y: number): void; /** * Defines 3D transformations for translation of the Z axes * @param z the translate value for z-axis - * @devices tv, phone, tablet, wearable + * @since 6 */ translateZ(z: number): void; /** * Defines 2D transformations for scaling of the X and Y axes * @param x the scale value for x-axis * @param y the scale value for y-axis - * @devices tv, phone, tablet, wearable + * @since 4 */ scale(x: number, y: number): void; /** @@ -220,31 +239,31 @@ export interface TransformObject { * @param x the scale value for x-axis * @param y the scale value for y-axis * @param z the scale value for z-axis - * @devices tv, phone, tablet, wearable + * @since 6 */ scale3d(x: number, y: number, z: number): void; /** * Defines 2D transformations for scaling of the X axes * @param x the scale value for x-axis - * @devices tv, phone, tablet, wearable + * @since 4 */ scaleX(x: number): void; /** * Defines 2D transformations for scaling of the Y axes * @param y the scale value for y-axis - * @devices tv, phone, tablet, wearable + * @since 4 */ scaleY(y: number): void; /** * Defines 3D transformations for scaling of the Z axes * @param z the scale value for z-axis - * @devices tv, phone, tablet, wearable + * @since 6 */ scaleZ(z: number): void; /** * Define the 2D rotation and specify the angle in the parameters. * @param angle the rotate value for z-axis - * @devices tv, phone, tablet, wearable + * @since 4 */ rotate(angle: number): void; /** @@ -253,62 +272,63 @@ export interface TransformObject { * @param y the vector value of the y-axis * @param z the vector value of the z-axis * @param angle the rotate value for x&y&z vector. - * @devices tv, phone, tablet, wearable + * @since 6 */ rotate3d(x: number, y: number, z: number, angle: number): void; /** * Defines 3D transformations for rotating of the X axes. * @param x the scale value for x-axis - * @devices tv, phone, tablet, wearable + * @since 4 */ rotateX(angle: number): void; /** * Defines 3D transformations for rotating of the Y axes. * @param y the scale value for y-axis - * @devices tv, phone, tablet, wearable + * @since 4 */ rotateY(angle: number): void; /** * Defines 3D transformations for rotating of the Z axes. * @param z the scale value for z-axis - * @devices tv, phone, tablet, wearable + * @since 6 */ rotateZ(angle: number): void; /** * Defines the 2D skew transition along the X and Y axes. * @param xAngle the angle of inclination along the x axis. * @param yAngle the angle of inclination along the y axis. - * @devices tv, phone, tablet, wearable + * @since 6 */ skew(xAngle: number, yAngle: number): void; /** * Defines the 2D skew transition along the X axes. * @param angle the angle of inclination along the x axis. - * @devices tv, phone, tablet, wearable + * @since 6 */ skewX(angle: number): void; /** * Defines the 2D skew transition along the Y axes. * @param angle the angle of inclination along the y axis. - * @devices tv, phone, tablet, wearable + * @since 6 */ skewY(angle: number): void; /** * Defines a perspective view for the 3D transformation element. * @param n the vertical distance from the observation point to the component plane. - * @devices tv, phone, tablet, wearable + * @since 6 */ perspective(verticalDistance: number): void; } /** - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface AnimateOptions { /** * Duration of the animation, in milliseconds. * The default value is 0. - * @devices tv, phone, tablet, wearable + * @since 4 */ duration: number; @@ -330,28 +350,28 @@ export interface AnimateOptions { * cubic-bezier(x1, y1, x2, y2) You can customize an animation speed curve in the cubic-bezier() function. The x and y values of each input parameter must be between 0 and 1. * Step curve. The number must be set and only an integer is supported, step-position is optional. It can be set to start or end. The default value is end. * The default value is ease. - * @devices tv, phone, tablet, wearable + * @since 4 */ easing: string; /** * Delay for the animation start. The default value indicates no delay. * The default value is 0. - * @devices tv, phone, tablet, wearable + * @since 4 */ delay: number; /** * Number of times the animation will be played. number indicates a fixed number of playback operations, and Infinity indicates an unlimited number of playback operations. * The default value is 1. - * @devices tv, phone, tablet, wearable + * @since 4 */ iterations: number | string; /** * The animation playback mode. * The default value is "normal". - * @devices tv, phone, tablet, wearable + * @since 6 */ direction: "normal" | "reverse" | "alternate" | "alternate-reverse"; @@ -359,23 +379,24 @@ export interface AnimateOptions { * Whether to resume to the initial state after the animation is executed. * none: The initial state is restored after the animation is executed. * forwards: The state at the end of the animation (defined in the last key frame) is retained after the animation is executed. - * @devices tv, phone, tablet, wearable + * @since 4 */ fill: "none" | "forwards" | "backwards" | "both"; } /** - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface AnimationResult { /** * Read-only attribute, which indicates whether the animation playback is complete. - * @devices tv, phone, tablet, wearable + * @since 4 */ finished: boolean; /** * Read-only attribute, which indicates whether an animation is waiting for the completion of other asynchronous operations (for example, start an animation with a delay). - * @devices tv, phone, tablet, wearable + * @since 4 */ pending: boolean; /** @@ -384,63 +405,64 @@ export interface AnimationResult { * running: The animation is running. * paused: The animation is paused. * finished: Animation playback ends. - * @devices tv, phone, tablet, wearable + * @since 4 */ playstate: string; /** * Animation start time. This attribute is similar to that of delay in the options parameters. - * @devices tv, phone, tablet, wearable + * @since 4 */ startTime: number; /** * Starts the animation. - * @devices tv, phone, tablet, wearable + * @since 4 */ play(): void; /** * Ends the animation. - * @devices tv, phone, tablet, wearable + * @since 4 */ finish(): void; /** * Pauses the animation. - * @devices tv, phone, tablet, wearable + * @since 4 */ pause(): void; /** * Cancels the animation. - * @devices tv, phone, tablet, wearable + * @since 4 */ cancel(): void; /** * Plays the animation in reverse direction. - * @devices tv, phone, tablet, wearable + * @since 4 */ reverse(): void; /** * The animation is started. - * @devices tv, phone, tablet, wearable + * @since 4 */ onstart: () => void; /** * The animation is finished. - * @devices tv, phone, tablet, wearable + * @since 4 */ onfinish: () => void; /** * The animation is canceled. - * @devices tv, phone, tablet, wearable + * @since 4 */ oncancel: () => void; /** * The animation is repeated. - * @devices tv, phone, tablet, wearable + * @since 4 */ onrepeat: () => void; } /** - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface Element { /** @@ -449,7 +471,7 @@ export interface Element { * If focus is set to false, the focus is canceled for the component. * This attribute can be defaulted to true. * @param obj { focus: true | false } - * @devices tv, phone, tablet, wearable + * @since 4 */ focus(obj?: FocusParamObj): void; @@ -459,7 +481,7 @@ export interface Element { * If focus is set to false, the crown event focus is canceled. * This attribute can be defaulted to true. * @param obj { focus: true | false } - * @devices tv, phone, tablet, wearable + * @since 4 */ rotation(obj?: FocusParamObj): void; @@ -468,39 +490,38 @@ export interface Element { * @param keyframes keyframes is used to describe key frame parameters of the animation. * @param options Options. is used to describe animation parameters. * @returns This method returns the animation object. - * @devices tv, phone, tablet, wearable + * @since 4 */ - animate( - keyframes: Array, - options: AnimateOptions - ): AnimationResult; + animate(keyframes: Array, options: AnimateOptions): AnimationResult; /** * Obtains the size and position of the element. * @returns RectObj the size position of the element. - * @devices tv, phone, tablet, wearable + * @since 6 */ getBoundingClientRect(): RectObj; /** * Obtains attributes of the element. * @returns attributes of the element in json string. - * @devices tv, phone, tablet, wearable + * @since 8 + * @systemapi */ getInspector(): string; /** * If 0.5 is returned, 50% of the current component is visible. * @param radios Scope of Monitoring components. + * @since 6 */ - createIntersectionObserver(param: {ratios: Array}): observer; + createIntersectionObserver(param: { ratios: Array }): observer; - /** + /** * Adds a node to the end of the child node list of the current node. * @param child Subnode object to be added * @since 8 */ - addChild(child: Element): void + addChild(child: Element): void; /** * Sets the value of an attribute on a specified element. If the attribute already exists, update the value. Otherwise, a new attribute is added with the specified name and value. @@ -508,7 +529,7 @@ export interface Element { * @param value attribute value¡¢ * @since 8 */ - setAttribute(name: string, value: string): void + setAttribute(name: string, value: string): void; /** * Sets a style value on a specified element. If the style exists and the style value is valid, the setting is successful. Otherwise, the setting is invalid. @@ -517,118 +538,130 @@ export interface Element { * @returns If the setting is successful, true is returned. If the setting fails, false is returned. * @since 8 */ - setStyle(name: string, value: string): boolean + setStyle(name: string, value: string): boolean; } +/** + * Defines the observer interface. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 6 + */ export interface observer { /** * Turn on the listener. + * @since 6 */ observe(callback: string): void; /** * Turn off the listenerr. + * @since 6 */ unobserve(): void; } /** * animation element - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface AnimationElement extends Element { /** * Starts the animation. - * @devices tv, phone, tablet, wearable + * @since 4 */ play(): void; /** * Ends the animation. - * @devices tv, phone, tablet, wearable + * @since 4 */ finish(): void; /** * Pauses the animation. - * @devices tv, phone, tablet, wearable + * @since 4 */ pause(): void; /** * Cancels the animation. - * @devices tv, phone, tablet, wearable + * @since 4 */ cancel(): void; /** * Plays the animation in reverse direction. - * @devices tv, phone, tablet, wearable + * @since 4 */ reverse(): void; } /** - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface ScrollParam { /** * Offset for scrolling in the horizontal direction, in px. - * @devices tv, phone, tablet, wearable + * @since 4 */ dx?: number; /** * Offset for scrolling in the vertical direction, in px. - * @devices tv, phone, tablet, wearable + * @since 4 */ dy?: number; /** * Whether a sliding animation is displayed when scroll position is changed. - * @devices tv, phone, tablet, wearable + * @since 4 */ smooth?: boolean; } /** - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface CurrentOffsetResultValue { /** * Scrolling offset in the x-axis, in px. - * @devices tv, phone, tablet, wearable + * @since 4 */ x: number; /** * Scrolling offset in the y-axis, in px. - * @devices tv, phone, tablet, wearable + * @since 4 */ y: number; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface ListScrollToOptions { /** * specified position. + * @since 4 */ index: number; } /** * The component provides a list container. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full */ export interface ListElement extends Element { /** * Scrolls the list to the position of the item at the specified index. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @since 4 */ scrollTo(position: ListScrollToOptions): void; /** * Scrolls the list for a certain distance. * This method applies only to smart TVs. - * @devices tv + * @since 4 */ scrollBy(data: ScrollParam): void; @@ -636,7 +669,7 @@ export interface ListElement extends Element { * If smooth is set to false (default value), the list is directly scrolled to the top. * If smooth is set to true, the list is smoothly scrolled to the top. * @param param - * @devices tv, phone, tablet, wearable + * @since 4 */ scrollTop(param: { smooth: boolean }): void; @@ -644,7 +677,7 @@ export interface ListElement extends Element { * If smooth is set to false (default value), the list is directly scrolled to the bottom. * If smooth is set to true, the list is smoothly scrolled to the bottom. * @param param - * @devices tv, phone, tablet, wearable + * @since 4 */ scrollBottom(param: { smooth: boolean }): void; @@ -654,7 +687,7 @@ export interface ListElement extends Element { * If smooth is set to false (default value), the list is directly scrolled to another page. * If smooth is set to true, the list is smoothly scrolled to another page. * @param params - * @devices tv, phone, tablet, wearable + * @since 4 */ scrollPage(params: { reverse: boolean; smooth: boolean }): void; @@ -664,14 +697,14 @@ export interface ListElement extends Element { * If smooth is set to false (default value), the list is directly scrolled. * If smooth is set to true, the list is smoothly scrolled. * @param params - * @devices tv, phone, tablet, wearable + * @since 4 */ scrollArrow(params: { reverse: boolean; smooth: boolean }): void; /** * Collapses a group. * @param param - * @devices tv, phone, tablet, wearable + * @since 4 */ collapseGroup(param: { /** @@ -684,7 +717,7 @@ export interface ListElement extends Element { /** * Expands a group. * @param param - * @devices tv, phone, tablet, wearable + * @since 4 */ expandGroup(param: { /** @@ -696,19 +729,20 @@ export interface ListElement extends Element { /** * Returns the offset of the current scrolling. The return value type is Object. - * @devices tv, phone, tablet, wearable + * @since 4 */ currentOffset(): CurrentOffsetResultValue; } /** * The component provides a swiper container. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface SwiperElement extends Element { /** * Scrolls the child component to the position at the specified index. - * @devices tv, phone, tablet, wearable + * @since 4 */ swipeTo(position: { /** @@ -719,113 +753,119 @@ export interface SwiperElement extends Element { /** * Shows the next child component. - * @devices tv, phone, tablet, wearable + * @since 4 */ showNext(): void; /** * Shows the previous child component. - * @devices tv, phone, tablet, wearable + * @since 4 */ showPrevious(): void; } /** - * @devices tv, phone, tablet, wearable + * @since 6 + * @syscap SystemCapability.ArkUI.ArkUI.Full */ export interface CameraTakePhotoOptions { /** * Picture quality. + * @since 6 */ quality: "high" | "normal" | "low"; /** * Callback function for successful interface invocation. * @param result the request execution result. - * @devices tv, phone, tablet, wearable + * @since 6 */ success?: (result: Object) => void; /** * Callback function for interface invocation failure. * @param result the request execution result. - * @devices tv, phone, tablet, wearable + * @since 6 */ fail?: (result: Object) => void; /** * Callback function at the end of the interface invoking (executed both successfully and unsuccessfully). * @param result the request execution result. - * @devices tv, phone, tablet, wearable + * @since 6 */ complete?: (result: Object) => void; } /** - * The component provides preview and photographing functions.. - * @devices tv, phone, tablet, wearable + * The component provides preview and photographing functions. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 6 */ export interface CameraElement extends Element { /** * Take photos with specified parameters. * @param options the parameters of camera. - * @devices tv, phone, tablet, wearable + * @since 6 */ takePhoto(options: CameraTakePhotoOptions): void; } /** * The component is a container for displaying web page content. - * @devices tv, phone, tablet + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 6 */ export interface WebElement extends Element { /** * Reload the web page content - * @devices tv, phone, tablet + * @since 6 */ reload(): void; } /** * The component is a custom pop-up container. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface DialogElement extends Element { /** * Shows a dialog box. - * @devices tv, phone, tablet, wearable + * @since 4 */ show(): void; /** * Closes a dialog box. - * @devices tv, phone, tablet, wearable + * @since 4 */ close(): void; } /** * The component is used to provide an image frame animator. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface ImageAnimatorElement extends Element { /** * Starts to play the frame animation of an image. If this method is called again, the playback starts from the first frame. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @since 4 */ start(): void; /** * Pauses the frame animation playback of an image. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @since 4 */ pause(): void; /** * Stops the frame animation playback of an image. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @since 4 */ stop(): void; /** * Resumes the frame animation playback of an image. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @since 4 */ resume(): void; /** @@ -833,7 +873,7 @@ export interface ImageAnimatorElement extends Element { * Playing * Paused * Stopped - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @since 4 */ getState(): "Playing" | "Paused" | "Stopped"; } @@ -841,25 +881,27 @@ export interface ImageAnimatorElement extends Element { /** * The component inserts scrolling text, which is displayed in a single line by default. * When the text length exceeds the display area of the component, the marquee effect is displayed. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface MarqueeElement extends Element { /** * Starts scrolling. - * @devices tv, phone, tablet, wearable + * @since 4 */ start(): void; /** * Stops scrolling. - * @devices tv, phone, tablet, wearable + * @since 4 */ stop(): void; } /** * The component provides menus as temporary pop-up windows to display operations that can be performed by users. - * @devices tv, phone, tablet + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface MenuElement extends Element { /** @@ -871,14 +913,15 @@ export interface MenuElement extends Element { * When the visible space on the right is insufficient, the menu is moved leftward. * When the visible space in the lower part is insufficient, the menu is moved upward. * @param position - * @devices tv, phone, tablet + * @since 4 */ show(position: { x: number; y: number }): void; } /** * The component displays line charts, gauge charts, and bar charts. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface ChartElement extends Element { /** @@ -886,7 +929,7 @@ export interface ChartElement extends Element { * The target sequence is specified based on serial, which is the subscript of the datasets array and starts from 0. * datasets[index].data is not updated. Only line charts support this attribute. * The value is incremented by 1 based on the horizontal coordinate and is related to the xAxis min/max setting. - * @devices tv, phone, tablet, wearable + * @since 4 */ append(params: { /** @@ -902,14 +945,15 @@ export interface ChartElement extends Element { /** * The component provides an interactive interface to receive user input, which is displayed in a single line by default. - * @devices tv, phone, tablet, wearable + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 4 */ export interface InputElement extends Element { /** * Obtains or loses the focus of a component. * When the component type is set to text, email, date, time, number, or password, the input method can be displayed or collapsed. * @param param If focus is not passed, the default value true is used. - * @devices tv, phone, tablet, wearable + * @since 4 */ focus(param: { focus: boolean }): void; @@ -917,20 +961,21 @@ export interface InputElement extends Element { * Displays the error message. * This attribute is available when the component type is set to text, email, date, time, number, or password. * @param param - * @devices tv, phone, tablet, wearable + * @since 4 */ showError(param: { error: string }): void; /** * Deletes the previous character at the cursor position. - * @devices tv, phone, tablet, wearable + * @since 6 */ delete(): void; } /** * The