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..ce3c01431f97a50d8863b02318d906d4b3f510df 100644 --- a/api/@internal/component/ets/alphabet_indexer.d.ts +++ b/api/@internal/component/ets/alphabet_indexer.d.ts @@ -143,7 +143,7 @@ declare class AlphabetIndexerAttribute 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..e8e9b7e4adc350167035479141f85a4f181811df 100644 --- a/api/@internal/component/ets/button.d.ts +++ b/api/@internal/component/ets/button.d.ts @@ -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..45f68e8070149ba2fab45690d3b90d425155df87 100644 --- a/api/@internal/component/ets/canvas.d.ts +++ b/api/@internal/component/ets/canvas.d.ts @@ -1061,7 +1061,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 +1116,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..e96cf31217f745d46fa8f2b060397ad4a411cc30 100644 --- a/api/@internal/component/ets/checkbox.d.ts +++ b/api/@internal/component/ets/checkbox.d.ts @@ -22,13 +22,13 @@ declare interface CheckboxOption { * Current name of Checkbox. * @since 8 */ - name?: string; + name?: string; /** * Sets the group of Checkbox. * @since 8 */ - group?: string; + group?: string; } /** @@ -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..ebf1461c3827c2b53aa34363fa099544eb8153d9 100644 --- a/api/@internal/component/ets/checkboxgroup.d.ts +++ b/api/@internal/component/ets/checkboxgroup.d.ts @@ -44,7 +44,7 @@ declare interface CheckboxGroupOption { * Setting the group of CheckboxGroup. * @since 8 */ - group?: string; + group?: string; } /** @@ -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; } /** @@ -85,13 +85,13 @@ declare class CheckboxGroupAttribute extends CommonMethod PropertyDecorator; */ declare const Watch: (value: string) => PropertyDecorator; - /** * Defining Builder MethodDecorator * @since 7 @@ -177,6 +176,7 @@ declare interface Rectangle { /** * Defining isSystemplugin Constants. * @since 7 + * @systemapi */ declare const isSystemplugin: (...args: string[]) => any; @@ -198,6 +198,11 @@ declare function $rawfile(value: string): Resource; */ declare function getContentStorage(value: any): ContentStorage; +/** + * Defines the context mock object. + * @since 8 + * @systemapi + */ declare type Context = any; /** @@ -206,29 +211,291 @@ declare type Context = any; */ declare function getContext(value: any): Context; -interface AnimateToParam { +/** + * Defines the animate function params. + * @since 7 + */ +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 option. + * @since 7 + */ +declare interface MotionPathOption { + /** + * 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 sharedTransitionOption { + /** + * 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?: MotionPathOption; + /** + * Z index info. + * @since 7 + */ + zIndex?: number; + /** + * the animate type. + * @since 7 + */ + type?: SharedTransitionEffectType; +} + +/** + * Defines the option of translate. + * @since 7 + */ +declare interface TranslateOption { + /** + * 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 option of scale. + * @since 7 + */ +declare interface ScaleOption { + /** + * 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 RotateOption { + /** + * 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 TransitionOption { + /** + * 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?: TransitionOption; + /** + * Defines the param of scale. + * @since 7 + */ + scale?: ScaleOption; + /** + * Defines the param of rotate. + * @since 7 + */ + rotate?: RotateOption; +} + /** * 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 +503,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 +521,7 @@ interface ItemDragInfo { * DragItemInfo object description * @since 8 */ -interface DragItemInfo { +declare interface DragItemInfo { /** * Uses the pixelMap object for drawing. * @since 8 @@ -274,17 +541,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 +587,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 +623,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 +647,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 +677,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 +725,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 +767,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 +793,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 class PixelMapMock { /** * release function. + * @systemapi * @since 7 */ release(): void; @@ -548,7 +817,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 +835,7 @@ interface DragEvent { * KeyEvent object description: * @since 7 */ -interface KeyEvent { +declare interface KeyEvent { /** * Type of a key. * @since 7 @@ -621,7 +890,7 @@ interface KeyEvent { * Component State Styels. * @since 8 */ -interface StateStyels { +declare interface StateStyels { /** * Defines normal state styles. * @since 8 @@ -653,7 +922,11 @@ interface StateStyels { clicked?: any; } -interface PopupOption { +/** + * Defines the popup options. + * @since 7 + */ +declare interface PopupOption { /** * Information in the pop-up window. * @since 7 @@ -709,7 +982,11 @@ interface PopupOption { onStateChange?: (event: { isVisible: boolean }) => void; } -interface CustomPopupOption { +/** + * Defines the custom popup option. + * @since 8 + */ +declare interface CustomPopupOption { /** * builder of popup * @since 8 @@ -754,13 +1031,15 @@ interface CustomPopupOption { } /** - * CommonMethod + * CommonMethod. * @since 7 */ declare class CommonMethod { /** * constructor. + * @systemapi * @since 7 + * @ignore */ constructor(); @@ -778,7 +1057,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 +1065,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 */ 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 +1102,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 +1135,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: BorderOption): T; /** * Border style @@ -886,19 +1147,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 +1201,38 @@ 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; + onBlur(event: () => void): T; /** * Trigger a event when focus move. * @since 8 + * @systemapi */ - onFocusMove(event: (direction?: FocusDirection) => void): T; + onFocusMove(event: (direction?: FocusDirection) => 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: TransitionOption): T; /** * Bind gesture recognition. @@ -1105,13 +1336,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: TranslateOption): 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: ScaleOption): 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 +1362,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: RotateOption): T; /** * Sets the transformation matrix for the current component. @@ -1211,22 +1435,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?: sharedTransitionOption): T; /** * Sets the sliding direction. The enumerated value supports logical AND (&) and logical OR (|). @@ -1244,20 +1453,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 +1580,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: MotionPathOption): T; /** * Add a shadow effect to the current component @@ -1400,6 +1609,8 @@ declare class CommonMethod { /** * Key. User can set an key to the component to identify it. * @since 8 + * @systemapi + * @test */ key(value: string): T; @@ -1431,7 +1642,7 @@ declare class CommonMethod { * ContextMenu control * @since 8 */ - bindContextMenu(content: CustomBuilder, responseType : ResponseType): T; + bindContextMenu(content: CustomBuilder, responseType: ResponseType): T; /** * Sets styles for component state. @@ -1447,13 +1658,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 +1672,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 +1697,7 @@ declare class CommonShapeMethod extends CommonMethod { /** * constructor. * @since 7 + * @syetemapi */ constructor(); @@ -1493,13 +1705,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 +1753,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 @@ -1583,11 +1795,15 @@ declare class CustomComponent { /** * 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; } diff --git a/api/@internal/component/ets/date_picker.d.ts b/api/@internal/component/ets/date_picker.d.ts index d5c55b20326d52915413b59f6e530182066a9787..13052c049659af9bb1fd0b7560f7d5e66eabb91d 100644 --- a/api/@internal/component/ets/date_picker.d.ts +++ b/api/@internal/component/ets/date_picker.d.ts @@ -80,20 +80,24 @@ declare interface DatePickerResult { declare interface DatePickerOption { /** * 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. + * @since 8 */ type?: DatePickerType; } 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..87d43584336f47be4a130346430559a1bdf053c2 100644 --- a/api/@internal/component/ets/enums.d.ts +++ b/api/@internal/component/ets/enums.d.ts @@ -457,60 +457,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 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..5186c6c7748337777aa9d14805ad6d5afb73b19a 100644 --- a/api/@internal/component/ets/gauge.d.ts +++ b/api/@internal/component/ets/gauge.d.ts @@ -62,5 +62,5 @@ declare class GaugeAttribute extends CommonMethod { strokeWidth(length: number): 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..e5c58dc6825e62d56c2444cf3b29ed7fbbe3e8b9 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 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/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/lazy_for_each.d.ts b/api/@internal/component/ets/lazy_for_each.d.ts index 8498b93cb12817ebde6a80faffd21d5c1d44aea3..65e7c2cdbf88eb1c62303c01164abf6241cf436d 100644 --- a/api/@internal/component/ets/lazy_for_each.d.ts +++ b/api/@internal/component/ets/lazy_for_each.d.ts @@ -50,7 +50,7 @@ declare interface DataChangeListener { } /** - * Data changed. + * Data changed. * @since 7 */ declare interface IDataSource { @@ -95,7 +95,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..322f7fb52cea0440af6bfbbff28365515bb25c3e 100644 --- a/api/@internal/component/ets/list.d.ts +++ b/api/@internal/component/ets/list.d.ts @@ -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..c72b8b44caa401b3534af26f1870bc24d9706b49 100644 --- a/api/@internal/component/ets/list_item.d.ts +++ b/api/@internal/component/ets/list_item.d.ts @@ -113,4 +113,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/middle_class.d.ts b/api/@internal/component/ets/middle_class.d.ts index 05aaf273f822dd40c45e45467b007806db124d2d..aa0c7f2ba6a3331e16495898093bb26256fcb147 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?: ButtonOption): ButtonAttribute; + /** + * Used for TS compiler. + * @ignore + * @systemapi + * @since 8 + */ + createWithLabel(label?: ResourceStr, options?: ButtonOption): 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?: CheckboxOption): 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?: CheckboxGroupOption): 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?: CircleOption): 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: DataPanelOption): 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?: DatePickerOption): 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?: FlexOption): 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?: GridContainerOption): 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(object: { value: number; total?: number; style?: ProgressStyle }): 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: RadioOption): 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: ScrollBarOption): 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?: SliderOption): 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?: TextAreaOption): 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?: TextInputOption): 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?: TextPickerOption): 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?: TextTimerOption): 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; + } + | PanGestureOption, + ): 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/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..e4fb5939d009250d2a09ffe328c8d53923870d03 100644 --- a/api/@internal/component/ets/progress.d.ts +++ b/api/@internal/component/ets/progress.d.ts @@ -13,6 +13,30 @@ * limitations under the License. */ +/** + * Defines style option for progress component. + * @since 8 + */ +declare interface ProgressStyleOption { + /** + * 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 +44,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, @@ -67,6 +86,7 @@ interface ProgressInterface { } /** + * Defines the progress attibute functions. * @since 7 */ declare class ProgressAttribute extends CommonMethod { @@ -83,17 +103,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: ProgressStyleOption): 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..703e0034671e43e91531da8127ca3d3668e387c7 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 { /** * Radio group name. - * @devices phone, tablet, car * @since 8 */ group: string; /** * Radio name. - * @devices phone, tablet, car * @since 8 */ value: string; @@ -36,13 +33,11 @@ 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; @@ -55,14 +50,12 @@ interface RadioInterface { 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..a20aa44f461e338ca9b44fa8a72d873442127ee1 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 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..afccfd11ebbfb4c00dabf97c644a29f689101505 100644 --- a/api/@internal/component/ets/scroll_bar.d.ts +++ b/api/@internal/component/ets/scroll_bar.d.ts @@ -68,8 +68,10 @@ interface ScrollBarInterface { } /** + * 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/sidebar.d.ts b/api/@internal/component/ets/sidebar.d.ts index 083b948e47a5591ec05453c67190cad015912084..e2c77a2d9e8ea1b2d60c0a04ab3856615d6f5dd2 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,21 +73,28 @@ 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 @@ -114,4 +125,4 @@ declare class SideBarContainerAttribute extends CommonMethod 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,86 +483,114 @@ 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; } /** + * Defines the content storage interface. * @since 9 * @StageModelOnly */ - declare class ContentStorage { +declare class ContentStorage { /** * Called when a link is set. * @since 9 @@ -600,6 +684,9 @@ declare abstract class SubscribaleAbstract { } /** + * 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..e4664068a3bd885392b2bf76ded74e9e723eaeb2 100644 --- a/api/@internal/component/ets/swiper.d.ts +++ b/api/@internal/component/ets/swiper.d.ts @@ -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..978ff49deb5f6a585d2f4fadb2dea839615932cf 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 @@ -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..88d4ce1cf9e43326075724f42677e249c4de1fa7 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 @@ -134,6 +133,7 @@ interface TextInputInterface { } /** + * Defines the TextInput attribute functions. * @since 7 */ declare class TextInputAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/text_timer.d.ts b/api/@internal/component/ets/text_timer.d.ts index 3001ddf1eede63b200a8507c59d17d9c7352385a..d43d3e12ae79c5b19bafba8a6727d681acc02363 100644 --- a/api/@internal/component/ets/text_timer.d.ts +++ b/api/@internal/component/ets/text_timer.d.ts @@ -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/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..72c00a5679760a174e91c2e37b5ab79ca9e20622 100644 --- a/api/@internal/component/ets/units.d.ts +++ b/api/@internal/component/ets/units.d.ts @@ -161,17 +161,88 @@ declare interface Area { /** * 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 option. + * @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 option. + * @since 7 + */ +declare interface SizeOptions { + /** + * Defines the width. + * @since 7 + */ + width?: Length; + /** + * Defines the height. + * @since 7 + */ + height?: Length; +} + +/** + * Defines the option of border. + * @since 7 + */ +declare interface BorderOption { + /** + * 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..8083acb3fc88707f2b74f28c013f7da2ede7987c 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 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; +} /** + * Defines the video controller. * @since 7 */ declare class VideoController { @@ -150,6 +152,7 @@ declare class VideoController { } /** + * Defines the video interface. * @since 7 */ interface VideoInterface { @@ -161,6 +164,7 @@ interface VideoInterface { } /** + * Defines the video attribute functions. * @since 7 */ declare class VideoAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index 6c34f1228cdd79bbb2cafafe49153075d5de5968..35531a512cd08d3c2c1289166d554064dee6e165 100755 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -1,3 +1,18 @@ +/* + * 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. + */ + declare enum MessageLevel { /** * Debug level. @@ -27,27 +42,31 @@ declare enum MessageLevel { * Warn level. * @since 8 */ - Warn + Warn, } -declare enum MixedModeContent { +/** + * Defines the mixed mode. + * @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, } declare enum HitTestType { @@ -97,26 +116,37 @@ declare enum HitTestType { * Other unknown hit test. * @since 8 */ - Unknown + Unknown, } +/** + * Defines the cache mode interface. + * @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,6 +167,10 @@ declare class JsResult { handleConfirm(): void; } +/** + * Defines the console message. + * @since 8 + */ declare class ConsoleMessage { /** * Constructor. @@ -177,6 +211,10 @@ declare class ConsoleMessage { getMessageLevel(): MessageLevel; } +/** + * Defines the web resource request. + * @since 8 + */ declare class WebResourceRequest { /** * Constructor. @@ -187,10 +225,10 @@ declare class WebResourceRequest { /** * Get request headers. * - * @return Return a map of the request headers + * @return Return the request headers * @since 8 */ - getRequestHeader(): Map; + getRequestHeader(): Array
; /** * Get the request url. @@ -225,6 +263,90 @@ declare class WebResourceRequest { isRedirect(): boolean; } + +/** + * Defines the web resource response. + * @since 8 + */ + declare class WebResourceResponse { + /** + * Constructor. + * @since 8 + */ + constructor(); + + /** + * Get the response data. + * + * @return Return the response data. + * @since 8 + */ + getResponseData(): string; + + /** + * Get the response encoding. + * + * @return Return the response encoding. + * @since 8 + */ + getResponseEncoding(): string; + + /** + * Get the response mime type. + * + * @return Return the response mime type. + * @since 8 + */ + getResponseMimeType(): string; + + /** + * Get the reason message. + * + * @return Return the reason message. + * @since 8 + */ + getReasonMessage(): string; + + /** + * Get the response headers. + * @return Return the response headers. + * @since 8 + */ + getResponseHeader() : Array
; + + /** + * Get the response code. + * + * @return Return the response code. + * @since 8 + */ + getResponseCode(): number; +} + +/** + * Defines the web resource header. + * @since 8 + */ + declare interface Header { + /** + * Get the key of the web header. + * + * @since 8 + */ + headerKey: string; + + /** + * Get the value of the web header. + * + * @since 8 + */ + headerValue: string; +} + +/** + * Defines the web resource error. + * @since 8 + */ declare class WebResourceError { /** * Constructor. @@ -249,6 +371,10 @@ declare class WebResourceError { getErrorCode(): number; } +/** + * Defines the js geolocation request. + * @since 8 + */ declare class JsGeolocation { /** * Constructor. @@ -258,7 +384,7 @@ 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. @@ -267,6 +393,10 @@ declare class JsGeolocation { invoke(origin: string, allow: boolean, retain: boolean): void; } +/** + * Defines the js web cookie. + * @since 8 + */ declare class WebCookie { /** * Constructor. @@ -287,6 +417,10 @@ declare class WebCookie { saveCookie(); } +/** + * Defines the web controller. + * @since 8 + */ declare class WebController { /** * Constructor. @@ -306,6 +440,14 @@ declare class WebController { */ onActive(): void; + /** + * Let the Web zoom by. + * @param factor The zoom factor. + * + * @since 8 + */ + zoom(factor: number): void; + /** * Clear the history in the Web. * @since 8 @@ -316,19 +458,19 @@ declare class WebController { * Means to load a piece of code and execute JS code in the context of the currently displayed page * @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 * @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 * @since 8 */ - loadUrl(url: string, additionalHttpHeaders?: Array<{ key: string, value: string }>); + loadUrl(options: { url: string; headers?: Array<{ key: string; value: string }> }); /** * refreshes the current URL. @@ -346,13 +488,13 @@ declare class WebController { * Registers the JavaScript object and method list. * @since 8 */ - registerJavaScriptProxy(value: { obj: object, name: string, methodList: Array }); + registerJavaScriptProxy(options: { obj: object; name: string; methodList: Array }); /** * Deletes a registered JavaScript object with given name. * @since 8 */ - deleteJavaScriptProxy(value: { name: string }); + deleteJavaScriptRegister(name: string); /** * Get the type of hit test. @@ -367,46 +509,57 @@ declare class WebController { requestFocus(); /** - * Check whether the web page can go back - * @since 8 - */ + * Check whether the web page can go back + * @since 8 + */ accessBackward(): boolean; /** - * Check whether the web page can go forward - * @since 8 - */ + * Check 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 - */ + * Check whether the web page can go back or forward the given number of steps + * @since 8 + */ accessStep(step: number): boolean; /** - * Go back in the history of the web - * @since 8 - */ + * Go back in the history of the web + * @since 8 + */ backward(); /** - * Go forward in the history of the web - * @since 8 - */ + * Go forward in the history of the web + * @since 8 + */ forward(); - } +/** + * Defines the web options. + * @since 8 + */ declare interface WebOptions { /** - * Set the address of the web page to be displayed + * Set the address of the web page to be displayed. * @since 8 */ src: string | Resource; + /** + * Set the controller of the web. + * @since 8 + */ controller: WebController; } +/** + * Defines the web interface. + * @since 8 + */ interface WebInterface { /** * Set Value. @@ -415,6 +568,10 @@ interface WebInterface { (value: WebOptions): WebAttribute; } +/** + * Defines the web attribute functions. + * @since 8 + */ declare class WebAttribute extends CommonMethod { /** * Set whether WebView allows JavaScript scripts to execute @@ -450,7 +607,7 @@ declare class WebAttribute extends CommonMethod { * Whether to load HTTP and HTTPS content * @since 8 */ - mixedMode(mixedMode: MixedModeContent): WebAttribute; + mixedMode(mixedMode: MixedMode): WebAttribute; /** * Sets whether the WebView supports zooming using on-screen controls or gestures @@ -468,9 +625,14 @@ declare class WebAttribute extends CommonMethod { * Inject the arkUI JS object into H5 and invoke the function of the object in H5. * @since 8 */ - javaScriptProxy(javaScriptProxy: { obj: object, name: string, methodList: Array }): WebAttribute; + javaScriptProxy(javaScriptProxy: { + obj: 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. * @@ -526,6 +688,14 @@ declare class WebAttribute extends CommonMethod { */ databaseAccess(databaseAccess: boolean): WebAttribute; + /** + * 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 * @since 8 @@ -558,12 +728,12 @@ declare class WebAttribute extends CommonMethod { /** * Show prompt to ask for the geolocation permission. - * + * * @param origin the origin of the resource to get geolocation. * @param geolocation callback to report geolocation. * @since 8 */ - onGeolocationShow(callback: (event?: { origin: string, geolocation: JsGeolocation }) => void): WebAttribute; + onGeolocationShow(callback: (event?: { origin: string; geolocation: JsGeolocation }) => void): WebAttribute; /** * Get WebView focus callback event @@ -577,7 +747,7 @@ declare class WebAttribute extends CommonMethod { * @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; + onAlert(callback: (event?: { url: string; message: string; result: JsResult }) => boolean): WebAttribute; /** * Triggered when the web page wants to confirm navigation from JavaScript onbeforeunload. @@ -585,7 +755,7 @@ declare class WebAttribute extends CommonMethod { * @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. @@ -593,7 +763,7 @@ declare class WebAttribute extends CommonMethod { * @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. @@ -601,7 +771,7 @@ declare class WebAttribute extends CommonMethod { * @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. @@ -609,7 +779,7 @@ declare class WebAttribute extends CommonMethod { * @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. @@ -617,13 +787,23 @@ declare class WebAttribute extends CommonMethod { * @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 * @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. @@ -631,7 +811,7 @@ declare class WebAttribute extends CommonMethod { * * @since 8 */ - onRefreshAccessedHistory(callback: (event?: { url: string, refreshed: boolean }) => void): WebAttribute; + onRefreshAccessedHistory(callback: (event?: { url: string; refreshed: boolean }) => void): WebAttribute; /** * Triggered when the url is about to be loaded. @@ -648,7 +828,7 @@ declare class WebAttribute extends CommonMethod { * * @since 8 */ - onSslErrorReceive(callback: (event?: { handler: Function, error: object }) => void): WebAttribute; + onSslErrorReceive(callback: (event?: { handler: Function; error: object }) => void): WebAttribute; /** * Triggered when the render process is exited. @@ -666,7 +846,7 @@ declare class WebAttribute extends CommonMethod { * * @since 8 */ - onFileSelectorShow(callback: (event?: { callback: Function, fileSelector: object }) => void): WebAttribute; + onFileSelectorShow(callback: (event?: { callback: Function; fileSelector: object }) => void): WebAttribute; } declare const Web: WebInterface; diff --git a/api/@internal/component/ets/xcomponent.d.ts b/api/@internal/component/ets/xcomponent.d.ts index 9cbc7cb1cd9c0f6264ff0072422e178da1e6d947..d93f4579a04fa056ce34b0ce372fe6ee49f35ba4 100644 --- a/api/@internal/component/ets/xcomponent.d.ts +++ b/api/@internal/component/ets/xcomponent.d.ts @@ -32,6 +32,13 @@ declare class XComponentController { * @systemapi */ getXComponentSurfaceId(); + + /** + * get the context of native XComponent. + * @since 8 + * @systemapi + */ + getXComponentContext(); } /** @@ -45,12 +52,7 @@ interface XComponentInterface { * @since 8 * @systemapi */ - (value: { - id: string; - type: string; - libraryname?: string; - controller?: XComponentController; - }): XComponentAttribute; + (value: { id: string; type: string; libraryname?: string; controller?: XComponentController }): XComponentAttribute; } /** @@ -64,14 +66,14 @@ declare class XComponentAttribute extends CommonMethod { * @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/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index e93c7b285fe44b2b8e654613baf2e5b8786cfe96..e493b6a62e1894dc8d1f013a0fc7f88e9ea0177b 100644 --- a/api/@internal/ets/lifecycle.d.ts +++ b/api/@internal/ets/lifecycle.d.ts @@ -31,7 +31,6 @@ import { PacMap } from "../ability/dataAbilityHelper"; * * @name LifecycleForm * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ export declare interface LifecycleForm { @@ -39,7 +38,6 @@ export declare interface LifecycleForm { * Called to return a {@link formBindingData.FormBindingData} object. * * @since 7 - * @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}, @@ -55,7 +53,6 @@ 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 * @param formId Indicates the ID of the form. * @return - * @FAModelOnly @@ -66,7 +63,6 @@ export declare interface LifecycleForm { * Called to notify the form provider to update a specified form. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @param formId Indicates the ID of the form to update. * @return - * @FAModelOnly @@ -77,7 +73,6 @@ export declare interface LifecycleForm { * Called when the form provider receives form events from the system. * * @since 7 - * @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} @@ -93,7 +88,6 @@ export declare interface LifecycleForm { * JS forms. * * @since 7 - * @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 @@ -108,7 +102,6 @@ export declare interface LifecycleForm { * you want your application, as the form provider, to be notified of form deletion. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @param formId Indicates the ID of the deleted form. * @return - * @FAModelOnly @@ -122,7 +115,6 @@ export declare interface LifecycleForm { * 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. * The description covers the bundle name, ability name, module name, form name, and form dimensions. * @return Returns the {@link formManager#FormState} object. @@ -136,7 +128,6 @@ export declare interface LifecycleForm { * * @name LifecycleApp * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAMode * @FAModelOnly */ export declare interface LifecycleApp { @@ -144,7 +135,6 @@ export declare interface LifecycleApp { * Called back when the state of an ability changes from BACKGROUND to INACTIVE. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -154,7 +144,6 @@ export declare interface LifecycleApp { * Called back when an ability enters the BACKGROUND state. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -164,7 +153,6 @@ export declare interface LifecycleApp { * Called back before an ability is destroyed. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -174,7 +162,6 @@ export declare interface LifecycleApp { * Called back when an ability is started for initialization. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -185,7 +172,6 @@ export declare interface LifecycleApp { * to multi-window mode or from multi-window mode to fullscreen mode. * * @since 7 - * @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 +185,6 @@ export declare interface LifecycleApp { * Asks a user whether to start the migration. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @return Returns {@code true} if the user allows the migration; returns {@code false} otherwise. * @FAModelOnly */ @@ -211,7 +196,6 @@ export declare interface LifecycleApp { * Scheduler Service requests data from the local ability. * * @since 7 - * @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 +209,6 @@ export declare interface LifecycleApp { * notify the user of the successful migration and then exit the local ability.

* * @since 7 - * @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 +222,6 @@ export declare interface LifecycleApp { * is restored. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @param data Indicates the user data to restore. * @return - * @FAModelOnly @@ -251,7 +233,6 @@ 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 * @return - * @FAModelOnly */ @@ -263,7 +244,6 @@ export declare interface LifecycleApp { * this method is used only to save temporary states. * * @since 7 - * @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 +257,6 @@ export declare interface LifecycleApp { * states. Generally, this method is called after the {@link #onStart(Want)} method. * * @since 7 - * @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 +269,6 @@ export declare interface LifecycleApp { * change to the BACKGROUND or ACTIVE state). * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -300,7 +278,6 @@ export declare interface LifecycleApp { * Called back when an ability enters the ACTIVE state. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -310,7 +287,6 @@ export declare interface LifecycleApp { * Called when the launch mode of an ability is set to singleton. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @param want Indicates the new {@code want} containing information about the ability. * @return - * @FAModelOnly @@ -322,7 +298,6 @@ 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 * @param level Indicates the memory trim level, which shows the current memory usage status. * @return - * @FAModelOnly @@ -335,7 +310,6 @@ export declare interface LifecycleApp { * * @name LifecycleService * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAMode * @FAModelOnly */ export declare interface LifecycleService { @@ -344,7 +318,6 @@ export declare interface LifecycleService { * an ability). * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -354,7 +327,6 @@ export declare interface LifecycleService { * Called back when Service is started. * * @since 7 - * @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 +340,6 @@ export declare interface LifecycleService { * Called back before an ability is destroyed. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @return - * @FAModelOnly */ @@ -378,7 +349,6 @@ export declare interface LifecycleService { * Called back when a Service ability is first connected to an ability. * * @since 7 - * @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 +359,6 @@ export declare interface LifecycleService { * Called back when all abilities connected to a Service ability are disconnected. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @param want Indicates disconnection information about the Service ability. * @return - * @FAModelOnly @@ -404,7 +373,6 @@ export declare interface LifecycleService { * called but {@link #terminateSelf} has not.

* * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @param want Indicates the want of the Service ability being connected. * @return - * @FAModelOnly @@ -417,7 +385,6 @@ export declare interface LifecycleService { * * @name LifecycleData * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAMode * @FAModelOnly */ export declare interface LifecycleData { @@ -425,7 +392,6 @@ 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 * @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 +407,6 @@ 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 * @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 +423,6 @@ 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 * @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 +439,6 @@ export declare interface LifecycleData { * even if the context has changed. * * @since 7 - * @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 +451,6 @@ 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 * @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 +465,6 @@ export declare interface LifecycleData { * The default implementation of this method returns the original uri passed to it. * * @since 7 - * @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 +477,6 @@ 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 * @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 +490,6 @@ export declare interface LifecycleData { * Opens a file. This method should be implemented by a Data ability. * * @since 7 - * @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 +506,6 @@ 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 * @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 +523,6 @@ export declare interface LifecycleData { * Called to carry {@code AbilityInfo} to this ability after the ability is initialized. * * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel * @param info Indicates the {@code AbilityInfo} object containing information about this ability. * @return - * @FAModelOnly @@ -579,12 +536,39 @@ export declare interface LifecycleData { *

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

* * @since 7 - * @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..81dbba645a9123cc5e98d00154ce1ea1808cbf59 100644 --- a/api/@internal/global.d.ts +++ b/api/@internal/global.d.ts @@ -13,66 +13,89 @@ * limitations under the License. */ +/** + * 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; diff --git a/api/@ohos.workSchedulerExtension.d.ts b/api/@ohos.WorkSchedulerExtensionAbility.d.ts similarity index 92% rename from api/@ohos.workSchedulerExtension.d.ts rename to api/@ohos.WorkSchedulerExtensionAbility.d.ts index ffecb73734b6b38751f3e7d593616aaa8bc2ba34..df30bd831e426edec007243471ac505d27209e50 100644 --- a/api/@ohos.workSchedulerExtension.d.ts +++ b/api/@ohos.WorkSchedulerExtensionAbility.d.ts @@ -16,13 +16,13 @@ import workScheduler from "./@ohos.workScheduler"; /** - * Class of the work scheduler extension. + * Class of the work scheduler extension ability. * * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly */ -export default class WorkSchedulerExtension { +export default class WorkSchedulerExtensionAbility { /** * Called back when a work is started. * 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/@ohos.ability.errorCode.d.ts b/api/@ohos.ability.errorCode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..155f039766c9f43e869df44ef695970b524b57f8 --- /dev/null +++ b/api/@ohos.ability.errorCode.d.ts @@ -0,0 +1,49 @@ +/* + * 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.account.appAccount.d.ts b/api/@ohos.account.appAccount.d.ts index a08f33eac576ebfa78272b0e913b12dacecb679f..1d06c863abfa0a8075260223003401d92cf1c474 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 @@ -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..38a0fa43bd19d003d967e3f1c7759eefd2c32ec5 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 diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 9229e35f59653bda9ede893ff9f339062254852a..703c36b1f37f2cf19e6223ba85f07080dac6bfc9 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 @@ -64,11 +64,11 @@ 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. + * @return Returns {@code true} if the OS account is activated; returns {@code false} otherwise. * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS/ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS */ isOsAccountActived(localId: number, callback: AsyncCallback): void; @@ -466,7 +466,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 index 65963be527b5e0901076ed6d413728e4407f4a79..8a19baf2bb13055826e0af9c1a01c0435d6de2b0 100755 --- a/api/@ohos.application.Ability.d.ts +++ b/api/@ohos.application.Ability.d.ts @@ -20,21 +20,51 @@ import window from './@ohos.window'; import { Configuration } from './@ohos.application.Configuration'; import rpc from '/@ohos.rpc'; +/** + * The prototype of the listener function interface registered by the Caller. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @permission N/A + * @param msg Monitor status notification information. + * @return - + * @StageModelOnly + */ +export interface OnReleaseCallBack { + (msg: string): void; +} + +/** + * The prototype of the message listener function interface registered by the Callee. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @permission N/A + * @param indata Notification data notified from the caller. + * @return rpc.Sequenceable + * @StageModelOnly + */ +export interface CaleeCallBack { + (indata: rpc.MessageParcel): rpc.Sequenceable; +} + /** * The interface of a Caller. * * @since 9 - * @sysCap AAFwk - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @permission N/A * @StageModelOnly */ - interface Caller { +export interface Caller { /** * Notify the server of Sequenceable type data. * * @since 9 - * @sysCap AAFwk + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param method The notification event string listened to by the callee. + * @param data Notification data to the callee. + * @return - * @StageModelOnly */ call(method: string, data: rpc.Sequenceable): Promise; @@ -43,8 +73,10 @@ import rpc from '/@ohos.rpc'; * Notify the server of Sequenceable type data and return the notification result. * * @since 9 - * @sysCap AAFwk - * return Sequenceable data + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param method The notification event string listened to by the callee. + * @param data Notification data to the callee. + * @return Returns the callee's notification result data on success, and returns undefined on failure. * @StageModelOnly */ callWithResult(method: string, data: rpc.Sequenceable): Promise; @@ -53,8 +85,8 @@ import rpc from '/@ohos.rpc'; * Clear service records. * * @since 9 - * @sysCap AAFwk - * return Sequenceable data + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @return - * @StageModelOnly */ release(): void; @@ -63,38 +95,43 @@ import rpc from '/@ohos.rpc'; * Register death listener notification callback. * * @since 9 - * @sysCap AAFwk - * return Sequenceable data + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param callback Register a callback function for listening for notifications. + * @return - * @StageModelOnly */ - onRelease(callback: function): void; + onRelease(callback: OnReleaseCallBack): void; } /** * The interface of a Callee. * * @since 9 - * @sysCap AAFwk - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @permission N/A * @StageModelOnly */ - interface Callee { +export interface Callee { /** * Register data listener callback. * * @since 9 - * @sysCap AAFwk + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param method A string registered to listen for notification events. + * @param callback Register a callback function that listens for notification events. + * @return - * @StageModelOnly */ - on(method: string, callback: function): void; + on(method: string, callback: CaleeCallBack): void; /** * Unregister data listener callback. * * @since 9 - * @sysCap AAFwk + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param method A string registered to listen for notification events. + * @return - * @StageModelOnly */ off(method: string): void; @@ -104,7 +141,7 @@ import rpc from '/@ohos.rpc'; * The class of an ability. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @permission N/A * @StageModelOnly */ @@ -113,7 +150,7 @@ export default class Ability { * Indicates configuration information about an ability context. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly */ context: AbilityContext; @@ -122,7 +159,7 @@ export default class Ability { * Indicates ability launch want. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly */ launchWant: Want; @@ -131,7 +168,7 @@ export default class Ability { * Indicates ability last request want. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly */ lastRequestWant: Want; @@ -140,7 +177,7 @@ export default class Ability { * Call Service Stub Object. * * @since 9 - * @sysCap AAFwk + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly */ callee: Callee; @@ -149,7 +186,9 @@ export default class Ability { * Called back when an ability is started for initialization. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param want Indicates the want info of the created ability. + * @param param Indicates the launch param. * @return - * @StageModelOnly */ @@ -159,7 +198,8 @@ export default class Ability { * Called back when an ability window stage is created. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param windowStage Indicates the created WindowStage. * @return - * @StageModelOnly */ @@ -169,17 +209,28 @@ export default class Ability { * Called back when an ability window stage is destroyed. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ onWindowStageDestroy(): void; + /** + * Called back when an ability window stage is restored. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param windowStage window stage to restore + * @return - + * @StageModelOnly + */ + onWindowStageRestore(windowStage: window.WindowStage): void; + /** * Called back before an ability is destroyed. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ @@ -189,7 +240,7 @@ export default class Ability { * Called back when the state of an ability changes to foreground. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ @@ -199,7 +250,7 @@ export default class Ability { * Called back when the state of an ability changes to background. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @return - * @StageModelOnly */ @@ -209,7 +260,8 @@ export default class Ability { * Called back when an ability prepares to migrate. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param wantParam Indicates the want parameter. * @return true if ability agrees to migrate and saves data successfully, otherwise false. * @StageModelOnly */ @@ -219,9 +271,9 @@ export default class Ability { * 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 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param want Indicates the want info of ability. * @return - * @StageModelOnly */ @@ -230,9 +282,9 @@ export default class Ability { /** * Called when the system configuration is updated. * - * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap AAFwk + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param config Indicates the updated configuration. * @return - * @StageModelOnly */ diff --git a/api/@ohos.application.AbilityConstant.d.ts b/api/@ohos.application.AbilityConstant.d.ts index d2691c2e98cdb1048738e380ceffe927876e5dfb..e43db61c8a1c4d1ab277e8b228cae536fcb11eb4 100644 --- a/api/@ohos.application.AbilityConstant.d.ts +++ b/api/@ohos.application.AbilityConstant.d.ts @@ -17,7 +17,7 @@ * The definition of AbilityConstant. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly */ @@ -26,7 +26,7 @@ declare namespace AbilityConstant { * Interface of launch param. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ export interface LaunchParam { @@ -34,7 +34,7 @@ declare namespace AbilityConstant { * Indicates launch reason. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ launchReason: LaunchReason; @@ -43,7 +43,7 @@ declare namespace AbilityConstant { * Indicates last exit reason. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ lastExitReason: LastExitReason; @@ -53,7 +53,7 @@ declare namespace AbilityConstant { * Type of launch reason. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ export enum LaunchReason { @@ -67,7 +67,7 @@ declare namespace AbilityConstant { * Type of last exit reason. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ export enum LastExitReason { diff --git a/api/@ohos.application.AbilityStage.d.ts b/api/@ohos.application.AbilityStage.d.ts index 7d1762c145c62798083d80e1da61e1aae9809520..ae3a53612f466a5b9de20467dde06bd0733cb572 100644 --- a/api/@ohos.application.AbilityStage.d.ts +++ b/api/@ohos.application.AbilityStage.d.ts @@ -48,10 +48,12 @@ export default class AbilityStage { /** * Called back when start specified ability. * - * @devices phone, tablet, tv, wearable, car * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return - + * @param want Indicates the want info of startd ability. + * @return The user returns an ability string ID. If the ability of this ID has been started before, + * do not create a new instance and pull it back to the top of the stack. + * Otherwise, create a new instance and start it. * @StageModelOnly */ onAcceptWant(want: Want): string; @@ -61,6 +63,7 @@ export default class AbilityStage { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param config Indicates the updated configuration. * @return - * @StageModelOnly */ diff --git a/api/@ohos.application.Configuration.d.ts b/api/@ohos.application.Configuration.d.ts index 9acbda4fa5ba669522f1ead499705f9fb036064e..f00b528ddf7fa6039c6e630a6571f830b40793a0 100644 --- a/api/@ohos.application.Configuration.d.ts +++ b/api/@ohos.application.Configuration.d.ts @@ -43,7 +43,7 @@ export interface Configuration { /** * Indicates the screen direction of the current device. * - * @since 8 + * @since 9 * @syscap SystemCapability.Ability.AbilityBase */ direction: ConfigurationConstant.Direction; @@ -51,7 +51,7 @@ export interface Configuration { /** * Indicates the screen density of the current device. * - * @since 8 + * @since 9 * @syscap SystemCapability.Ability.AbilityBase */ screenDensity: ConfigurationConstant.ScreenDensity; @@ -59,7 +59,7 @@ export interface Configuration { /** * Indicates the displayId of the current device. * - * @since 8 + * @since 9 * @syscap SystemCapability.Ability.AbilityBase */ displayId: number; diff --git a/api/@ohos.application.ConfigurationConstant.d.ts b/api/@ohos.application.ConfigurationConstant.d.ts index b9ed5f3e19e620af0b740b26577a639825afa721..cdf3b32724869aa6705e85d53a58b7dddbff196f 100644 --- a/api/@ohos.application.ConfigurationConstant.d.ts +++ b/api/@ohos.application.ConfigurationConstant.d.ts @@ -35,7 +35,7 @@ /** * @name Direction - * @since 8 + * @since 9 * @syscap SystemCapability.Ability.AbilityBase * @permission N/A */ @@ -47,7 +47,7 @@ /** * @name ScreenDensity - * @since 8 + * @since 9 * @syscap SystemCapability.Ability.AbilityBase * @permission N/A */ diff --git a/api/@ohos.application.DataShareExtensionAbility.d.ts b/api/@ohos.application.DataShareExtensionAbility.d.ts index dce6c206a8ff9926c35894233dfb8fa8da70de1d..495ac85091bc5345c5e121f2de3f95345f4b063e 100644 --- a/api/@ohos.application.DataShareExtensionAbility.d.ts +++ b/api/@ohos.application.DataShareExtensionAbility.d.ts @@ -62,7 +62,7 @@ export default class DataShareExtensionAbility { * @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; + getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; /** * Inserts a data record into the database. This method should be implemented by a data share. @@ -74,7 +74,7 @@ export default class DataShareExtensionAbility { * @systemapi Hide this for inner system use. * @return Returns the index of the newly inserted data record. */ - insert?(uri: string, valueBucket: rdb.ValuesBucket): number; + insert?(uri: string, valueBucket: rdb.ValuesBucket, callback: AsyncCallback): void; /** * Updates one or more data records in the database. This method should be implemented by a data share. @@ -88,7 +88,8 @@ export default class DataShareExtensionAbility { * @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; + update?(uri: string, valueBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, + callback: AsyncCallback): void; /** * Deletes one or more data records. This method should be implemented by a data share. @@ -101,7 +102,7 @@ export default class DataShareExtensionAbility { * @systemapi Hide this for inner system use. * @return Returns the number of data records deleted. */ - delete?(uri: string, predicates: dataAbility.DataAbilityPredicates): number; + delete?(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; /** * Queries one or more data records in the database. This method should be implemented by a data share. @@ -116,7 +117,8 @@ export default class DataShareExtensionAbility { * @systemapi Hide this for inner system use. * @return Returns the queried data. */ - query?(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates): ResultSet; + query?(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, + callback: AsyncCallback): void; /** * Obtains the MIME type matching the data specified by the URI of the data share. This method should be @@ -130,7 +132,7 @@ export default class DataShareExtensionAbility { * @systemapi Hide this for inner system use. * @return Returns the MIME type that matches the data specified by {@code uri}. */ - getType?(uri: string): string; + getType?(uri: string, callback: AsyncCallback): void; /** * Inserts multiple data records into the database. This method should be implemented by a data share. @@ -142,7 +144,7 @@ export default class DataShareExtensionAbility { * @systemapi Hide this for inner system use. * @return Returns the number of data records inserted. */ - batchInsert?(uri: string, valueBuckets: Array): number; + batchInsert?(uri: string, valueBuckets: Array, callback: AsyncCallback): void; /** * Converts the given {@code uri} that refer to the data share into a normalized URI. A normalized URI can be @@ -155,7 +157,7 @@ export default class DataShareExtensionAbility { * @systemapi Hide this for inner system use. * @return Returns the normalized uri if the data share supports URI normalization; */ - normalizeUri?(uri: string): string; + normalizeUri?(uri: string, callback: AsyncCallback): void; /** * Converts the given normalized {@code uri} generated by {@link #normalizeUri(uri)} into a denormalized one. @@ -169,5 +171,5 @@ export default class DataShareExtensionAbility { * {@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; + denormalizeUri?(uri: string, callback: AsyncCallback): void; } \ No newline at end of file diff --git a/api/@ohos.application.FormExtension.d.ts b/api/@ohos.application.FormExtension.d.ts index 63862c0c221b5e3524fc49735c6fe848bad82b3f..166674ad6086c4989d89385e42d80839c3e322ca 100644 --- a/api/@ohos.application.FormExtension.d.ts +++ b/api/@ohos.application.FormExtension.d.ts @@ -118,6 +118,7 @@ export default class FormExtension { * * @since 9 * @syscap SystemCapability.Ability.Form + * @param system configuration, such as language and color mode. * @return - * @StageModelOnly */ diff --git a/api/@ohos.application.ServiceExtension.d.ts b/api/@ohos.application.ServiceExtension.d.ts index 002684069a63fda834df098140a46b339d008254..8ef9102c89638a0bb3a484ca64d1b2c43c1df24d 100644 --- a/api/@ohos.application.ServiceExtension.d.ts +++ b/api/@ohos.application.ServiceExtension.d.ts @@ -42,6 +42,7 @@ export default class ServiceExtension { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want of created service extension. * @systemapi hide for inner use. * @return - * @StageModelOnly @@ -116,6 +117,7 @@ export default class ServiceExtension { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param config Indicates the updated configuration. * @return - * @StageModelOnly */ diff --git a/api/@ohos.application.ServiceExtAbility.d.ts b/api/@ohos.application.ServiceExtensionAbility.d.ts similarity index 72% rename from api/@ohos.application.ServiceExtAbility.d.ts rename to api/@ohos.application.ServiceExtensionAbility.d.ts index 57a549082fc195e6c9f0ce9c98d039428b4dfdab..d4d06bc4049ed66d3da2a102513a14cb640bc907 100644 --- a/api/@ohos.application.ServiceExtAbility.d.ts +++ b/api/@ohos.application.ServiceExtensionAbility.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,35 +14,35 @@ */ import rpc from "./@ohos.rpc"; -import ServiceExtAbilityContext from "./application/ServiceExtAbilityContext"; +import ServiceExtensionContext from "./application/ServiceExtensionContext"; import Want from './@ohos.application.Want'; +import { Configuration } from './@ohos.application.Configuration'; /** * class of service extension ability. * * @since 9 - * @sysCap AAFwk - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. * @StageModelOnly */ -export default class ServiceExtAbility { +export default class ServiceExtensionAbility { /** * Indicates service extension ability context. * * @since 9 - * @sysCap AAFwk + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. * @StageModelOnly */ - context: ServiceExtAbilityContext; + context: ServiceExtensionContext; /** * Called back when a service extension is started for initialization. * - * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap AAFwk + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want of created service extension. * @systemapi hide for inner use. * @return - * @StageModelOnly @@ -52,9 +52,8 @@ export default class ServiceExtAbility { /** * Called back before a service extension is destroyed. * - * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap AAFwk + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. * @return - * @StageModelOnly @@ -64,9 +63,8 @@ export default class ServiceExtAbility { /** * Called back when a service extension is started. * - * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap AAFwk + * @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 @@ -80,9 +78,8 @@ export default class ServiceExtAbility { /** * Called back when a service extension is first connected to an ability. * - * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap AAFwk + * @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. @@ -93,9 +90,8 @@ export default class ServiceExtAbility { /** * Called back when all abilities connected to a service extension are disconnected. * - * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap AAFwk + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param want Indicates disconnection information about the service extension. * @systemapi hide for inner use. * @return - @@ -107,14 +103,24 @@ export default class ServiceExtAbility { * 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 + * @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 + * @param config Indicates the updated configuration. + * @return - + * @StageModelOnly + */ + onConfigurationUpdated(config: Configuration): void; } diff --git a/api/@ohos.application.StartOptions.d.ts b/api/@ohos.application.StartOptions.d.ts index 5c0b9e7d041e9e27f562824297483e010cc21b6e..b4cd41bbceab5748d8c933e5331f968ec393817e 100644 --- a/api/@ohos.application.StartOptions.d.ts +++ b/api/@ohos.application.StartOptions.d.ts @@ -18,7 +18,7 @@ * * @name StartOptions * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly */ @@ -27,7 +27,7 @@ export default class StartOptions { * windowMode * @default - * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ windowMode?: number; @@ -35,9 +35,8 @@ export default class StartOptions { /** * displayId * @default - - * @devices phone, tablet * @since 9 - * @sysCap AAFwk + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ displayId?: number; diff --git a/api/@ohos.application.StaticSubscriberExtensionAbility.d.ts b/api/@ohos.application.StaticSubscriberExtensionAbility.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ebd6484ac6fee62f5cfe1c91699ec6a662c9de96 --- /dev/null +++ b/api/@ohos.application.StaticSubscriberExtensionAbility.d.ts @@ -0,0 +1,37 @@ +/* + * 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 CommonEventData from "./commonEvent/commonEventData"; + +/** + * class of static subscriber extension ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + * @StageModelOnly + */ +export default class StaticSubscriberExtensionAbility { + /** + * Called back when a specific common event is published. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + onReceiveEvent(event: CommonEventData): void; +} \ 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..c21a8cc64ede0a8d5e28226ba6dc2087d3b8ff97 --- /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 9 + * @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 9 + * @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 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return the previously registered AbilityDelegatorArgs object. + */ + function getArguments(): AbilityDelegatorArgs; + + /** + * Describes all lifecycle states of an ability. + * + * @since 9 + * @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..5221fc08a0d6a920ccbb6bd401a8b2387372b4ad 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,7 @@ declare namespace abilityManager { /** * @name AbilityState * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A */ export enum AbilityState { @@ -45,10 +45,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,21 +58,23 @@ 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 + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param upperLimit Get the maximum limit of the number of messages * @systemapi Hide this for inner system use. - * @return - + * @return Returns the array of {@link ExtensionRunningInfo}. + * @permission ohos.permission.GET_RUNNING_INFO */ function getExtensionRunningInfos(upperLimit: number): Promise>; function getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback>): void; diff --git a/api/@ohos.application.appManager.d.ts b/api/@ohos.application.appManager.d.ts index dcb6dca86ab862ac726dd65add9cc4c67820639f..eb086aec2838d5ac416242f732b174a7fde2c75e 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, 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,10 @@ declare namespace appManager { * Get information about running processes * * @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 ProcessRunningInfo}. + * @permission ohos.permission.GET_RUNNING_INFO */ function getProcessRunningInfos(): Promise>; function getProcessRunningInfos(callback: AsyncCallback>): void; @@ -99,11 +104,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 +115,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.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/ability/continueAbilityOptions.d.ts b/api/@ohos.application.testRunner.d.ts old mode 100755 new mode 100644 similarity index 47% rename from api/ability/continueAbilityOptions.d.ts rename to api/@ohos.application.testRunner.d.ts index 32c09d141425de7df7c76477511658ea6505d8c6..58593017d019b48e98981fd1e5218d61cc7e77c8 --- a/api/ability/continueAbilityOptions.d.ts +++ b/api/@ohos.application.testRunner.d.ts @@ -13,30 +13,31 @@ * limitations under the License. */ - /** - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core +/** + * 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 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import TestRunner from '@ohos.application.testRunner' * @permission N/A */ -export interface ContinueAbilityOptions { - /** - * Indicates the ID of the target device where this ability will be migrated to. - * - * @default - - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ - deviceId: string; +export interface TestRunner { + /** + * Prepare the unit testing environment for running test cases. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + onPrepare(): void; + + /** + * Run all test cases. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + onRun(): void; +} - /** - * Indicates whether the ability to be migrated back to the local device through - * This is a reserved field. - * - * @default - - * @since 7 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ - reversible?: boolean; -} \ No newline at end of file +export default TestRunner; \ No newline at end of file diff --git a/api/@ohos.application.UriPermissionManager.d.ts b/api/@ohos.application.uriPermissionManager.d.ts similarity index 72% rename from api/@ohos.application.UriPermissionManager.d.ts rename to api/@ohos.application.uriPermissionManager.d.ts index f79c74100803bf19b1987cf5a266b915bff2f50b..37cd85441c8e8f9653759a09967c58e6a360c5be 100644 --- a/api/@ohos.application.UriPermissionManager.d.ts +++ b/api/@ohos.application.uriPermissionManager.d.ts @@ -20,20 +20,22 @@ import wantConstant from "./@ohos.ability.wantConstant"; * The management class for uri of file. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A */ -export default class UriPermissionManager { +declare namespace uriPermissionManager { /** * Check whether the application corresponding to the accesstokenID has access rights to the URI. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @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; + function verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number, callback: AsyncCallback): void; + function verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number): Promise; } + +export default uriPermissionManager; \ No newline at end of file diff --git a/api/@ohos.batteryinfo.d.ts b/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..b3dde1d0f94f8727c4ddc8530bf3bf44bc8dfdf8 100644 --- a/api/@ohos.bluetooth.d.ts +++ b/api/@ohos.bluetooth.d.ts @@ -121,6 +121,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 +346,202 @@ 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; + + /** + * Obtains the sco state of device. + * + * @param device The address of the remote device. + * @return Returns {@code true} if the disconnect is in process; returns {@code false} otherwise. + * @since 8 + * @permission permission ohos.permission.USE_BLUETOOTH + */ + getScoState(device: string): number; + + /** + * Create audio channel. + * + * @param device The address of the remote device. + * @return Returns {@code true} if the request is in process; returns {@code false} otherwise. + * @since 8 + * @permission permission ohos.permission.DISCOVER_BLUETOOTH + */ + connectSco(device: string): boolean; + + /** + * Close audio channel. + * + * @param device The address of the remote device. + * @return Returns {@code true} if the request is in process; returns {@code false} otherwise. + * @since 8 + * @permission permission ohos.permission.DISCOVER_BLUETOOTH + */ + disconnectSco(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; + + /** + * Subscribe the event reported when the sco 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: "scoStateChange", callback: Callback): void; + + /** + * Unsubscribe the event reported when the sco 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: "scoStateChange", callback?: Callback): void; + + /** + * Open voice recognition function. + * + * @param device The address of the remote device to disconnect. + * @return Returns {@code true} if success; returns {@code false} otherwise. + * @since 8 + * @permission permission ohos.permission.DISCOVER_BLUETOOTH + */ + openVoiceRecognition(device: string): boolean; + + /** + * Close voice recognition function. + * + * @param device The address of the remote device to disconnect. + * @return Returns {@code true} if success; returns {@code false} otherwise. + * @since 8 + * @permission permission ohos.permission.DISCOVER_BLUETOOTH + */ + closeVoiceRecognition(device: string): boolean; + } + namespace BLE { /** * create a JavaScript Gatt server instance. @@ -1306,6 +1512,64 @@ 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; + } + + /** + * Sco state change parameters. + * + * @since 8 + */ + Interface ScoStateParam { + /** The address of device */ + deviceId: string, + + /** Sco state value */ + state: ScoState + } + + /** + * The enum of a2dp playing state. + * + * @since 8 + */ + enum PlayingState { + STATE_NOT_PLAYING, + STATE_PLAYING, + } + + /** + * The enum of sco audio state. + * + * @since 8 + */ + enum ScoState { + SCO_DISCONNECTED, + SCO_CONNECTING, + SCO_DISCONNECTING, + SCO_CONNECTED + } + + /** + * 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..efe17b4b64240357af10d9f8d189a60dea3bbdfe 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -20,9 +20,9 @@ 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. @@ -384,6 +384,19 @@ declare namespace bundle { */ 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, 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 +406,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 */ 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. @@ -439,12 +453,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. @@ -467,12 +482,11 @@ declare namespace bundle { * @param bundleFlags Indicates the flag used to specify information contained in the BundleInfo object to be * returned. * @return Returns the BundleInfo object. + * @systemapi Hide this for inner system use */ 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,18 +503,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. * @@ -582,6 +584,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 + * @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 + */ + 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.commonEvent.d.ts b/api/@ohos.commonEvent.d.ts index e9b04424dc98e1dddef6814796df654253435606..f6a59b218ee165e505f7d5d10e5377df6ffa9614 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. */ @@ -890,35 +896,35 @@ declare namespace commonEvent { /** * The external storage was removed. * This is a protected common event that can only be sent by system. - * @since 8 + * @since 9 */ 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 + * @since 9 */ 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 + * @since 9 */ 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 + * @since 9 */ 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 + * @since 9 */ COMMON_EVENT_VOLUME_EJECT = "usual.event.data.VOLUME_EJECT", 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.contact.d.ts b/api/@ohos.contact.d.ts similarity index 100% rename from api/ohos.contact.d.ts rename to api/@ohos.contact.d.ts 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.preferences.d.ts b/api/@ohos.data.preferences.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..000599ed5d287eb42bd8ea5e9894562ac7905021 --- /dev/null +++ b/api/@ohos.data.preferences.d.ts @@ -0,0 +1,199 @@ +/* +* 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'; +import Context from "./application/Context"; + +/** + * Provides interfaces to obtain and modify preferences data. + * + * @name preferences + * @since 9 + * @syscap SystemCapability.DistributedDataManager.Preferences.Core + * + */ +declare namespace preferences { + /** + * Obtains a {@link Preferences} instance matching a specified preferences file name. + * + *

The {@link references} instance loads all data of the preferences file and + * resides in the memory. You can use removePreferencesFromCache to remove the instance from the memory. + * + * @param context Indicates the context of application or capability. + * @param name Indicates the preferences file name. + * @return Returns the {@link Preferences} instance matching the specified preferences file name. + * @throws BusinessError if invoked failed + * @since 9 + */ + function getPreferences(context: Context, name: string, callback: AsyncCallback): void; + function getPreferences(context: Context, name: string): Promise; + + /** + * Deletes a {@link Preferences} instance matching a specified preferences file name + * from the cache which is performed by removePreferencesFromCache and deletes the + * preferences file. + * + *

When deleting the {@link Preferences} instance, you must release all references + * of the instance. In addition, do not use the instance to perform data operations. Otherwise, data inconsistency + * will occur. + * + * @param context Indicates the context of application or capability. + * @param name Indicates the preferences file name. + * @throws BusinessError if invoked failed + * @since 9 + */ + function deletePreferences(context: Context, name: string, callback: AsyncCallback): void; + function deletePreferences(context: Context, name: string): Promise; + + /** + * Deletes a {@link Preferences} instance matching a specified preferences file name + * from the cache. + * + *

When deleting the {@link Preferences} instance, you must release all references + * of the instance. In addition, do not use the instance to perform data operations. Otherwise, data inconsistency + * will occur. + * + * @param context Indicates the context of application or capability. + * @param name Indicates the preferences file name. + * @throws BusinessError if invoked failed + * @since 9 + */ + function removePreferencesFromCache(context: Context, name: string, callback: AsyncCallback): void; + function removePreferencesFromCache(context: Context, name: string): Promise; + + /** + * Provides interfaces to obtain and modify preferences data. + * + *

The preferences data is stored in a file, which matches only one {@link Preferences} instance in the memory. + * You can use getPreferences to obtain the {@link Preferences} instance matching + * the file that stores preferences data, and use emovePreferencesFromCache + * to remove the {@link Preferences} instance from the memory. + * + * @syscap SystemCapability.DistributedDataManager.Preferences.Core + * + * @since 9 + */ + interface Preferences { + /** + * Obtains the value of a preferences in the int format. + * + *

If the value is {@code null} or not in the int format, the default value is returned. + * + * @param key Indicates the key of the preferences. It cannot be {@code null} or empty. + * @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 9 + */ + get(key: string, defValue: ValueType, callback: AsyncCallback): void; + get(key: string, defValue: ValueType): Promise; + + /** + * Checks whether the {@link Preferences} object contains a preferences matching a specified key. + * + * @param key Indicates the key of the preferences to check for. + * @return Returns {@code true} if the {@link Preferences} object contains a preferences with the specified key; + * returns {@code false} otherwise. + * @throws BusinessError if invoked failed + * @since 9 + */ + has(key: string, callback: AsyncCallback): boolean; + has(key: string): Promise; + + /** + * Sets an int value for the key in the {@link Preferences} object. + * + *

You can call the {@link #flush} method to save the {@link Preferences} object to the + * file. + * + * @param key Indicates the key of the preferences to modify. It cannot be {@code null} or empty. + * @param value Indicates the value of the preferences. + * MAX_KEY_LENGTH. + * @throws BusinessError if invoked failed + * @since 9 + */ + put(key: string, value: ValueType, callback: AsyncCallback): void; + put(key: string, value: ValueType): Promise; + + /** + * Deletes the preferences with a specified key from the {@link Preferences} object. + * + *

You can call the {@link #flush} method to save the {@link Preferences} object to the + * file. + * + * @param key Indicates the key of the preferences to delete. It cannot be {@code null} or empty. + * MAX_KEY_LENGTH. + * @throws BusinessError if invoked failed + * @since 9 + */ + delete(key: string, callback: AsyncCallback): void; + delete(key: string): Promise; + + /** + * Clears all preferences from the {@link Preferences} object. + * + *

You can call the {@link #flush} method to save the {@link Preferences} object to the + * file. + * + * @throws BusinessError if invoked failed + * @since 9 + */ + clear(callback: AsyncCallback): void; + clear(): Promise; + + /** + * Asynchronously saves the {@link Preferences} object to the file. + * + * @throws BusinessError if invoked failed + * @since 9 + */ + flush(callback: AsyncCallback): void; + flush(): Promise; + + /** + * Registers an observer to listen for the change of a {@link Preferences} object. + * + * @param callback Indicates the callback when preferences changes. + * @throws BusinessError if invoked failed + * @since 9 + */ + on(type: 'change', callback: Callback<{ key: string }>): void; + + /** + * Unregisters an existing observer. + * + * @param callback Indicates the registered callback. + * @throws BusinessError if invoked failed + * @since 9 + */ + off(type: 'change', callback: Callback<{ key: string }>): void; + } + + /** + * Indicates possible value types + */ + type ValueType = number | string | boolean; + + /** + * Indicates the maximum length of a key (80 characters). + */ + const MAX_KEY_LENGTH: 80; + + /** + * Indicates the maximum length of a string (8192 characters). + */ + const MAX_VALUE_LENGTH: 8192; +} + +export default preferences; diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 4ddeecdf177a887cb10cf35f5aa131096f819ea4..e2317b1d94dc98aa1d913bd02426d9f652662a84 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -32,7 +32,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 +47,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. @@ -240,7 +240,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 +254,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>; diff --git a/api/@ohos.data.storage.d.ts b/api/@ohos.data.storage.d.ts index 10190d3808fe2cdc1d4ab1e511c6181f537527a5..e0d4107e06d10319817f9d4e264863eb28240f50 100644 --- a/api/@ohos.data.storage.d.ts +++ b/api/@ohos.data.storage.d.ts @@ -18,9 +18,10 @@ import { AsyncCallback, Callback } from './basic'; * Provides interfaces to obtain and modify storage data. * * @name storage - * @since 5 + * @since 6 + * @deprecated since 9, please use @ohos.data.preferences instead. * @syscap SystemCapability.DistributedDataManager.Preferences.Core - * + * */ declare namespace storage { /** @@ -32,8 +33,10 @@ 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 + * @deprecated since 9, please use @ohos.data.preferences instead. */ + function getStorageSync(path: string): Storage; function getStorage(path: string, callback: AsyncCallback): void; function getStorage(path: string): Promise; @@ -49,7 +52,8 @@ declare namespace storage { * * @param path Indicates the path of storage file * @throws BusinessError if invoked failed - * @since 5 + * @since 6 + * @deprecated since 9, please use @ohos.data.preferences instead. */ function deleteStorageSync(path: string): void; function deleteStorage(path: string, callback: AsyncCallback): void; @@ -65,7 +69,8 @@ declare namespace storage { * * @param path Indicates the path of storage file. * @throws BusinessError if invoked failed - * @since 5 + * @since 6 + * @deprecated since 9, please use @ohos.data.preferences instead. */ function removeStorageFromCacheSync(path: string): void; function removeStorageFromCache(path: string, callback: AsyncCallback): void; @@ -80,8 +85,9 @@ declare namespace storage { * to remove the {@link Storage} instance from the memory. * * @syscap SystemCapability.DistributedDataManager.Preferences.Core - * - * @since 5 + * + * @since 6 + * @deprecated since 9, please use @ohos.data.preferences instead. */ interface Storage { /** @@ -93,7 +99,8 @@ 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 + * @deprecated since 9, please use @ohos.data.preferences instead. */ getSync(key: string, defValue: ValueType): ValueType; get(key: string, defValue: ValueType, callback: AsyncCallback): void; @@ -106,7 +113,8 @@ 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 + * @deprecated since 9, please use @ohos.data.preferences instead. */ hasSync(key: string): boolean; has(key: string, callback: AsyncCallback): boolean; @@ -122,7 +130,8 @@ declare namespace storage { * @param value Indicates the value of the storage. * MAX_KEY_LENGTH. * @throws BusinessError if invoked failed - * @since 5 + * @since 6 + * @deprecated since 9, please use @ohos.data.preferences instead. */ putSync(key: string, value: ValueType): void; put(key: string, value: ValueType, callback: AsyncCallback): void; @@ -137,7 +146,8 @@ 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 + * @deprecated since 9, please use @ohos.data.preferences instead. */ deleteSync(key: string): void; delete(key: string, callback: AsyncCallback): void; @@ -150,7 +160,8 @@ declare namespace storage { * file. * * @throws BusinessError if invoked failed - * @since 5 + * @since 6 + * @deprecated since 9, please use @ohos.data.preferences instead. */ clearSync(): void; clear(callback: AsyncCallback): void; @@ -160,7 +171,8 @@ declare namespace storage { * Asynchronously saves the {@link Storage} object to the file. * * @throws BusinessError if invoked failed - * @since 5 + * @since 6 + * @deprecated since 9, please use @ohos.data.preferences instead. */ flushSync(): void; flush(callback: AsyncCallback): void; @@ -171,7 +183,8 @@ declare namespace storage { * * @param callback Indicates the callback when storage changes. * @throws BusinessError if invoked failed - * @since 5 + * @since 6 + * @deprecated since 9, please use @ohos.data.preferences instead. */ on(type: 'change', callback: Callback): void; @@ -180,7 +193,8 @@ declare namespace storage { * * @param callback Indicates the registered callback. * @throws BusinessError if invoked failed - * @since 5 + * @since 6 + * @deprecated since 9, please use @ohos.data.preferences instead. */ off(type: 'change', callback: Callback): void; } @@ -194,8 +208,9 @@ declare namespace storage { * Define the change data information object. * * @syscap SystemCapability.DistributedDataManager.Preferences.Core - * - * @since 5 + * + * @since 6 + * @deprecated since 9, please use @ohos.data.preferences instead. */ interface StorageObserver { /** @@ -215,4 +230,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..8e91729a901cf1b776dfa7611728b7a507c71410 100644 --- a/api/@ohos.deviceInfo.d.ts +++ b/api/@ohos.deviceInfo.d.ts @@ -17,7 +17,7 @@ * A static class pertaining to the product information. * * @since 6 - * @Syscap SystemCapability.Startup.SysInfo + * @syscap SystemCapability.Startup.SysInfo */ declare namespace deviceInfo { /** 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/@ohos.fileManager.d.ts b/api/@ohos.fileManager.d.ts index f6df405e7ed3a6456173db27dc557aa37e8ff197..5486431568c4f16b31bffd1884068eca9dc6e903 100644 --- a/api/@ohos.fileManager.d.ts +++ b/api/@ohos.fileManager.d.ts @@ -30,7 +30,7 @@ declare namespace filemanager { * * @note N/A * @syscap SystemCapability.FileManagement.FileManagerService - * @since 8 + * @since 9 * @permission N/A * @function listFile * @param {string} path - path. @@ -51,7 +51,7 @@ declare function listFile(path: string, type: string, options?: {dev?: DevInfo, * * @note N/A * @syscap SystemCapability.FileManagement.FileManagerService - * @since 8 + * @since 9 * @permission N/A * @function getRoot * @param {Object} options - options @@ -68,7 +68,7 @@ declare function getRoot(options?: {dev?: DevInfo}, 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,7 +306,7 @@ 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 { @@ -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.i18n.d.ts b/api/@ohos.i18n.d.ts index cec604281101c1f0c31084b969968bd8370d1153..1a370d6351eba2a6c870d1f3fe6cd4cdb5e90a8e 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,7 @@ export function getSystemLanguage(): string; /** * Set the language currently used by the system. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param language The language to be used. * @since 7 * @systemapi Hide this for inner system use. @@ -99,7 +99,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 +108,7 @@ export function getSystemRegion(): string; /** * Set the region currently used by the system. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param region The region to be used. * @since 7 * @systemapi Hide this for inner system use. @@ -118,7 +118,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 +127,7 @@ export function getSystemLocale(): string; /** * Set the locale currently used by the system. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param locale The locale to be used. * @since 7 * @systemapi Hide this for inner system use. @@ -137,14 +137,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 +158,7 @@ export interface Util { /** * Provides the options of unit. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export interface UnitInfo { @@ -176,7 +176,7 @@ export interface UnitInfo { /** * Provides the options of PhoneNumberFormat. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export interface PhoneNumberFormatOptions { @@ -189,14 +189,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 +206,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 +216,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 +227,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,7 +240,7 @@ 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 */ @@ -249,7 +249,7 @@ export class Calendar { /** * 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 */ @@ -258,7 +258,7 @@ export class Calendar { /** * 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. @@ -272,7 +272,7 @@ export class Calendar { /** * Set the timezone of this calendar. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param timezone The id of a timezone. * @since 8 */ @@ -281,7 +281,7 @@ export class Calendar { /** * 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 +290,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,7 +299,7 @@ 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 */ @@ -308,7 +308,7 @@ export class Calendar { /** * 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,7 +317,7 @@ 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 */ @@ -326,7 +326,7 @@ export class Calendar { /** * 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 +338,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 +349,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,7 +360,7 @@ 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 * @@ -371,7 +371,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 +381,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 +398,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 +408,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 +417,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 +427,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 +436,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 +445,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 +454,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 +465,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 @@ -477,14 +477,14 @@ export class BreakIterator { * 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 + * @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. @@ -495,7 +495,7 @@ export class 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,7 +504,7 @@ 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 */ @@ -513,7 +513,7 @@ export class IndexUtil { /** * Get corresponding index of the input text. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @param text input text * @since 8 */ @@ -523,14 +523,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 +539,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 +548,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 +557,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 +566,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 +575,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 +584,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 +593,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 +602,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,7 +612,7 @@ 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 */ @@ -621,7 +621,7 @@ export class Character { /** * set 24-hour system. * - * @sysCap SystemCapability.Global.I18n + * @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 @@ -631,7 +631,7 @@ export class Character { /** * Add one language to preferred language List. * - * @sysCap SystemCapability.Global.I18n + * @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 +642,7 @@ export function addPreferredLanguage(language: string, index?: number): boolean; /** * Remove one language from preferred language list. * - * @sysCap SystemCapability.Global.I18n + * @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 +652,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 +661,75 @@ 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; + +/** + * 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 8 + */ +export function getTimeZone(zoneID?: string): TimeZone; + +/** + * Provides the API for accessing TimeZone name, rawOffset and offset information. + * + * @syscap SystemCapability.Global.I18n + * @since 8 + */ +export class TimeZone { + /** + * Get the id of the TimeZone object. + * + * @syscap SystemCapability.Global.I18n + * @return Returns a string represents the timezone id. + * @since 8 + */ + getID(): string; + + /** + * Get the displayName of the TimeZone Object under the default locale. + * + * @syscap SystemCapability.Global.I18n + * @return Returns a string represents the display name. + * @since 8 + */ + getDisplayName(): 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 8 + */ + 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 8 + */ + 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 8 + */ + getOffset(date: number): number; +} } \ No newline at end of file diff --git a/api/@ohos.intl.d.ts b/api/@ohos.intl.d.ts index 2a1bcdda7275691cb16a09c5fef05809dce04de5..cf384e60714bb09a5b1c4c8cf74b696bd4338119 100755 --- a/api/@ohos.intl.d.ts +++ b/api/@ohos.intl.d.ts @@ -16,7 +16,7 @@ /** * Provides internationalization related APIs. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 6 */ declare namespace intl { @@ -24,7 +24,7 @@ declare namespace intl { * Provides the options of Locale. * * @since 8 - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n */ export interface LocaleOptions { /** @@ -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 6 + */ + 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,7 +124,7 @@ 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 @@ -153,7 +162,7 @@ export class Locale { /** * Convert the locale information to string. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns locale information in string form. */ toString(): string; @@ -161,7 +170,7 @@ export class Locale { /** * Maximize the locale's base information. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns maximized locale. */ maximize(): Locale; @@ -169,7 +178,7 @@ export class Locale { /** * Minimize the locale's base information. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @return Returns minimized locale. */ minimize(): Locale; @@ -178,7 +187,7 @@ export class Locale { /** * Provides the options of date time format. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n */ export interface DateTimeOptions { /** @@ -280,14 +289,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 +304,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 +315,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 +325,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 +336,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,7 +346,7 @@ export class DateTimeFormat { /** * Provides the options of number format. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n */ export interface NumberOptions { /** @@ -439,13 +448,13 @@ export interface NumberOptions { /** * Provides the API for formatting number strings. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n */ export class NumberFormat { /** * A constructor used to create a NumberFormat object. * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ constructor(); @@ -453,7 +462,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 +473,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 +483,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,7 +493,7 @@ export class NumberFormat { /** * Provides the options of Collator * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export interface CollatorOptions { @@ -533,21 +542,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 +567,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 +582,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,7 +592,7 @@ export class Collator { /** * Provides the options of PluralRules * - * @sysCap SystemCapability.Global.I18n + * @syscap SystemCapability.Global.I18n * @since 8 */ export interface PluralRulesOptions { @@ -633,14 +642,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 +657,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 +668,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,7 +680,7 @@ export class PluralRules { /** * Provides the input options of RelativeTimeFormat. * - * @sysCap SystemCapability.Intl + * @syscap SystemCapability.Global.I18n * @since 8 */ export interface RelativeTimeFormatInputOptions { @@ -697,7 +706,7 @@ export class PluralRules { /** * Provides the resolved options of RelativeTimeFormat. * - * @sysCap SystemCapability.Intl + * @syscap SystemCapability.Global.I18n * @since 8 */ export interface RelativeTimeFormatResolvedOptions { @@ -728,14 +737,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 +752,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 +763,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 +776,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 +789,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..d406fe07df4da9a2e7d98b393c56d75e1c1d23b0 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -276,13 +276,13 @@ declare namespace audio { * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication */ - RINGER_MODE_VIBRATE, + RINGER_MODE_VIBRATE = 1, /** * Normal mode * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication */ - RINGER_MODE_NORMAL, + RINGER_MODE_NORMAL = 2, } /** @@ -510,7 +510,7 @@ declare namespace audio { * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core */ - STREAM_USAGE_NOTIFICATION_RINGTONE = 3 + STREAM_USAGE_NOTIFICATION_RINGTONE = 6 } /** @@ -690,6 +690,7 @@ declare namespace audio { * Interrupt force type. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @systemapi */ enum InterruptForceType { /** @@ -782,7 +783,7 @@ declare namespace audio { * Enumerates audio scenes. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Communication - */ + */ enum AudioScene { /** * Default audio scene @@ -822,50 +823,52 @@ declare namespace audio { * Sets volume for a stream. This method uses an asynchronous callback to return the execution 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. * @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. * @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. * @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. * @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. * @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. * @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. * @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. * @since 7 @@ -883,71 +886,77 @@ declare namespace audio { * @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. * @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. * @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. * @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. * @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. * @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. * @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. * @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. * @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. * @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. * @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. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication + * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY */ setRingerMode(mode: AudioRingMode): Promise; /** @@ -966,12 +975,14 @@ declare namespace audio { * Sets the audio parameter. This method uses an asynchronous callback to return the execution 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. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core + * @permission ohos.permission.MODIFY_AUDIO_SETTINGS */ setAudioParameter(key: string, value: string): Promise; /** @@ -1030,12 +1041,14 @@ declare namespace audio { * This method uses an asynchronous callback to return the execution 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. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Communication + * @systemapi */ setAudioScene(scene: AudioScene): Promise; /** @@ -1043,7 +1056,7 @@ declare namespace audio { * @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. * @since 8 @@ -1051,12 +1064,19 @@ declare namespace audio { */ getAudioScene(): Promise; /** - * Monitors device changes - * @since 7 - * @syscap SystemCapability.Multimedia.Audio.Device - */ + * Monitors device changes + * @since 7 + * @syscap SystemCapability.Multimedia.Audio.Device + */ on(type: 'deviceChange', callback: Callback): void; + /** + * Cancels the listening of device change events. + * @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. @@ -1391,6 +1411,7 @@ declare namespace audio { * @return InterruptEvent callback. * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @systemapi */ on(type: 'interrupt', callback: Callback): void; /** @@ -1456,7 +1477,13 @@ declare namespace audio { * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core */ - SOURCE_TYPE_MIC + SOURCE_TYPE_MIC = 0, + /** + * Voice communication source. + * @since 8 + * @syscap SystemCapability.Multimedia.Audio.Core + */ + SOURCE_TYPE_VOICE_COMMUNICATION = 7 } /** diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index 001206f1315d16ad23193752b9de4b00418a1a71..5acbd7dcff0dfe27d0a35509b1f110fd16b082c6 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -267,25 +267,6 @@ declare namespace camera { 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 @@ -301,28 +282,6 @@ declare namespace camera { 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. @@ -1076,4 +1035,4 @@ declare namespace camera { } } -export default camera; \ No newline at end of file +export default camera; diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index da3700eec7a52597c2696687190e670e9e4f6825..74aef73ea4ae607f1f2fb7a083bea55be07da74f 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -162,6 +162,7 @@ declare namespace image { * The componet type of image. * @since 8 * @syscap SystemCapability.Multimedia.Image.ImageReceiver + * @systemapi */ enum ComponentType { /** @@ -374,6 +375,7 @@ declare namespace image { * Describes image color components. * @since 8 * @syscap SystemCapability.Multimedia.Image.Core + * @systemapi */ interface Component { /** @@ -483,6 +485,7 @@ declare namespace image { * {@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. + * @systemapi */ function createImageReceiver(width: number, height: number, format: number, capacity: number): ImageReceiver; @@ -817,6 +820,7 @@ declare namespace image { * Provides basic image operations, including obtaining image information, and reading and writing image data. * @since 8 * @syscap SystemCapability.Multimedia.Image.Core + * @systemapi */ interface Image { /** @@ -879,6 +883,7 @@ declare namespace image { * Image receiver object. * @since 8 * @syscap SystemCapability.Multimedia.Image.ImageReceiver + * @systemapi */ interface ImageReceiver { /** diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts old mode 100755 new mode 100644 index c33f70bef3721965f684172ae32d90933aa3329b..5d6692bde378c59d6101b65bcd21832c182375c2 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -62,6 +62,7 @@ declare namespace media { * @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. + * @systemapi */ function createVideoRecorder(callback: AsyncCallback): void; /** @@ -70,6 +71,7 @@ declare namespace media { * @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. + * @systemapi */ function createVideoRecorder(): Promise; @@ -282,6 +284,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 +352,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 +396,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 +410,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 +541,7 @@ declare namespace media { * @since 6 * @syscap SystemCapability.Multimedia.Media.AudioRecorder * @param config Recording parameters. + * @permission ohos.permission.MICROPHONE */ prepare(config: AudioRecorderConfig): void; @@ -559,6 +612,7 @@ declare namespace media { * Describes video recorder states. * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ type VideoRecordState = 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error'; @@ -567,6 +621,7 @@ declare namespace media { * to create an VideoRecorder instance. * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ interface VideoRecorder { /** @@ -1158,6 +1213,7 @@ declare namespace media { * Provides the video recorder profile definitions. * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ interface VideoRecorderProfile { /** @@ -1236,6 +1292,7 @@ declare namespace media { * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @import import media from '@ohos.multimedia.media' + * @systemapi */ enum AudioSourceType { /** @@ -1257,6 +1314,7 @@ declare namespace media { * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @import import media from '@ohos.multimedia.media' + * @systemapi */ enum VideoSourceType { /** @@ -1277,6 +1335,7 @@ declare namespace media { * Provides the video recorder configuration definitions. * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ interface VideoRecorderConfig { /** diff --git a/api/@ohos.multimedia.mediaLibrary.d.ts b/api/@ohos.multimedia.mediaLibrary.d.ts index 32b8fd0b1add3e489963b3b240982c1344889f00..5c9b1822bd9204a0d9184e834b9746a52e569076 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 './app/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, 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, 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 | 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 | 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 | 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 | 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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 index 389f62a0139347e7ba83d2f08cc101962ecbab8f..e10019666ddd9e967e9eefb947365fc997357501 100755 --- 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. @@ -47,11 +47,11 @@ 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. + * @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. @@ -59,11 +59,11 @@ 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. + * @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.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..78ec3e6702cef7f4ee06df2694a3091ad41dafea --- /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..5ca1f74e4f1ff58c64eecb618e970888fa9a561b 100644 --- a/api/@ohos.notification.d.ts +++ b/api/@ohos.notification.d.ts @@ -55,6 +55,8 @@ 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; @@ -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 isNotificationEnabledSelf(callback: AsyncCallback): void; - function isNotificationEnabledSelf(): Promise; + function requestEnableNotification(callback: AsyncCallback): void; + function requestEnableNotification(): Promise; /** - * Request permission to send notification. + * Sets whether the device supports distributed notification. * * @since 8 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER */ - function requestEnableNotification(callback: AsyncCallback): void; - function requestEnableNotification(): Promise; + function enableDistributed(enable: boolean, callback: AsyncCallback): void; + function enableDistributed(enable: boolean): Promise; + + /** + * Obtains whether the device supports distributed notification. + * + * @since 8 + */ + 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, + + /** + * Execute do not disturb once in the set time period (only watch hours and minutes) + */ + TYPE_ONCE = 1, + + /** + * Execute do not disturb every day with a set time period (only watch hours and minutes) + */ + TYPE_DAILY = 2, /** - * Indicates that all notifications are allowed to interrupt the user in Do Not Disturb mode. + * Execute in the set time period (specify the time, month, day and hour) */ - ALLOW_ALL, + TYPE_CLEARLY = 3, + } + /** + * Describes a DoNotDisturbDate instance. + * + * @systemapi Hide this for inner system use. + */ + export interface DoNotDisturbDate { /** - * Indicates that only notifications meeting the specified priority criteria are allowed to interrupt - * the user in Do Not Disturb mode. + * 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; } /** @@ -725,26 +808,31 @@ declare namespace notification { } /** - * Notification source type + * The remind type of the nofication. * * @since 8 * @systemapi Hide this for inner system use. */ - export enum SourceType { + export enum DeviceRemindType { + /** + * The device is not in use, no reminder + */ + IDLE_DONOT_REMIND = 0, + /** - * General notification + * The device is not in use, remind */ - TYPE_NORMAL = 0x00000000, + IDLE_REMIND = 1, /** - * Continuous notification + * The device is in use, no reminder */ - TYPE_CONTINUOUS = 0x00000001, + ACTIVE_DONOT_REMIND = 2, /** - * Scheduled notification + * The device is in use, reminder */ - TYPE_TIMER = 0x00000002, + ACTIVE_REMIND = 3, } } diff --git a/api/@ohos.pasteboard.d.ts b/api/@ohos.pasteboard.d.ts index facf37ba9e9c95a0364d2dfd745615445eae1977..fd64ab9ab8cf9f4656d58599b87ceb6a70b3aa5d 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..5f59da72f5ad0406eb6b09f4d603f6dee2447a9b 100644 --- a/api/@ohos.power.d.ts +++ b/api/@ohos.power.d.ts @@ -18,7 +18,7 @@ import {AsyncCallback} from './basic'; /** * Provides interfaces to manage power. * - * @sysCap SystemCapability.PowerManager.PowerManager.Core + * @syscap SystemCapability.PowerManager.PowerManager.Core * @since 7 */ declare namespace power { 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..272992c0acf94d02bb8486e4b090a63a171b60a6 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..d50e6e72acb7f576e5b4f90ae62686105c198fee --- /dev/null +++ b/api/@ohos.request.d.ts @@ -0,0 +1,520 @@ +/* + * 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 + * + * @since 7 + * @import request from '@ohos.request'; + * @permission {@code ohos.permission.INTERNET} + */ +declare namespace request { + + /** + * Bit flag indicating download is allowed when using the cellular network. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + const NETWORK_MOBILE: number; + + /** + * Bit flag indicating download is allowed when using the WLAN. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code 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 {@code 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 {@code 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 {@code ohos.permission.INTERNET} + */ + const ERROR_FILE_ALREADY_EXISTS: number; + + /** + * Indicates that a file operation fails. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + const ERROR_FILE_ERROR: number; + + /** + * Indicates that the HTTP transmission fails. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + const ERROR_HTTP_DATA_ERROR: number; + + /** + * Indicates insufficient storage space. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + const ERROR_INSUFFICIENT_SPACE: number; + + /** + * Indicates an error caused by too many network redirections. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + const ERROR_TOO_MANY_REDIRECTS: number; + + /** + * Indicates an HTTP code that cannot be identified. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + const ERROR_UNHANDLED_HTTP_CODE: number; + + /** + * Indicates an undefined error. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code 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 {@code 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 {@code 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 {@code 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 {@code 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 {@code ohos.permission.INTERNET} + */ + const SESSION_FAILED: number; + + /** + * Indicates that the download session has been paused. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + const SESSION_PAUSED: number; + + /** + * Indicates that the download session is being scheduled. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + const SESSION_PENDING: number; + + /** + * Indicates that the download session is in progress. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code ohos.permission.INTERNET} + */ + const SESSION_RUNNING: number; + + /** + * Indicates that the download session is completed. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code 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 {@code 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 {@code 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 {@code 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 {@code ohos.permission.INTERNET} + * @return - + */ + function upload(config: UploadConfig): Promise; + + interface DownloadConfig { + url: string; // Resource address. + header?: Object; // Adds an HTTP or HTTPS header to be included with the download request. + enableMetered?: boolean; // Allows download under a metered connection. + enableRoaming?: boolean; // Allows download in a roaming network. + description?: string; // Sets the description of a download session. + networkType?: number; // Sets the network type allowed for download. + filePath?: string; // Sets the path for downloads. + title?: string; // Sets a download session title. + } + + interface DownloadInfo { + description: string; // the description of a file to be downloaded. + downloadedBytes: number; // the real-time downloads size (in bytes). + downloadId: number; // the ID of a file to be downloaded. + failedReason: number; // a download failure cause, which can be any DownloadSession.ERROR_* constant. + fileName: string; // the name of a file to be downloaded. + filePath: string; // the URI of a stored file. + pausedReason: number; // the reason why a session is paused, which can be any DownloadSession.PAUSED_* constant. + status: number; // the download status code, which can be any DownloadSession.SESSION_* constant. + targetURI: string; // the URI of files to be downloaded. + downloadTitle: string; // the title of a file to be downloaded. + downloadTotalBytes: number; // the total size of files to be downloaded (in bytes). + } + + 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 {@code 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 {@code 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 {@code 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 {@code 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 {@code 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 {@code 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 {@code ohos.permission.INTERNET} + * @return - + */ + remove(callback: AsyncCallback): void; + + /** + * Deletes a download session and the downloaded files. + * @syscap SystemCapability.Miscservices.Download + * @since 6 + * @permission {@code ohos.permission.INTERNET} + * @return - + */ + remove(): Promise; + + /** + * Pause a download session. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @param callback Indicates asynchronous invoking Result. + * @permission {@code ohos.permission.INTERNET} + * @return - + */ + pause(callback: AsyncCallback): void; + + /** + * Pause a download session. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code ohos.permission.INTERNET} + * @return - + */ + pause(): Promise; + + /** + * Resume a paused download session. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @param callback Indicates asynchronous invoking Result. + * @permission {@code ohos.permission.INTERNET} + * @return - + */ + resume(callback: AsyncCallback): void; + + /** + * Resume a paused download session. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code 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 {@code 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 {@code 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 {@code ohos.permission.INTERNET} + * @return - + */ + queryMimeType(callback: AsyncCallback): void; + + /** + * Queries the MIME type of the download file. + * @syscap SystemCapability.Miscservices.Download + * @since 7 + * @permission {@code ohos.permission.INTERNET} + * @return - + */ + queryMimeType(): Promise; + } + + interface File { + filename: string; // When multipart is submitted, the file name in the request header. + name: string; // When multipart is submitted, the name of the form item. The default is file. + uri: string; // The local storage path of the file (please refer to the storage directory definition for path usage). + type: string; // The content type of the file is obtained by default according to the suffix of the file name or path. + } + + interface RequestData { + name: string; // Represents the name of the form element. + value: string; // Represents the value of the form element. + } + + interface UploadConfig { + url: string; // Resource address. + header: Object; // Adds an HTTP or HTTPS header to be included with the upload request. + method: string; // Request method: POST, PUT. The default POST. + files: Array; // A list of files to be uploaded. Please use multipart/form-data to submit. + data: Array; // The requested form data. + } + + 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 {@code 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 {@code 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 {@code 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 {@code 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 {@code ohos.permission.INTERNET} + * @return - + */ + remove(callback: AsyncCallback): void; + + /** + * Deletes a upload session. + * @syscap SystemCapability.Miscservices.Upload + * @since 6 + * @permission {@code ohos.permission.INTERNET} + * @return - + */ + remove(): Promise; + } +} + +export default request; \ No newline at end of file diff --git a/api/@ohos.resourceManager.d.ts b/api/@ohos.resourceManager.d.ts index 258978388031bccc282f99ee03478c28fb0acb3e..55fe1e882ca6968e90400ae8c748bf78dbb5af1d 100644 --- a/api/@ohos.resourceManager.d.ts +++ b/api/@ohos.resourceManager.d.ts @@ -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. * @@ -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..74a6234d489d2dc72ecebd5e72d6c4cf458b093b 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,6 +43,7 @@ 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; @@ -54,6 +57,7 @@ declare namespace router { /** * 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. + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ path?: string; diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 8932f4c6bb6c5fe5c1b9e79683ed37e5eee0ebed..c9d8edd82065e768c48836921636ede30a622855 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 { @@ -941,21 +941,25 @@ declare namespace rpc { class MessageOption { /** * Indicates synchronous call. + * @since 7 */ TF_SYNC = 0; /** * Indicates asynchronous call. + * @since 7 */ TF_ASYNC = 1; /** * Indicates the sendRequest API for returning the file descriptor. + * @since 7 */ TF_ACCEPT_FDS = 0x10; /** * Indicates the wait time for RPC, in seconds. It is NOT used in IPC case. + * @since 7 */ TF_WAIT_TIME = 4; @@ -1127,16 +1131,19 @@ declare namespace rpc { class RemoteProxy implements IRemoteObject { /** * Indicates the message code for a Ping operation. + * @since 7 */ PING_TRANSACTION = ('_' << 24) | ('P' << 16) | ('N' << 8) | 'G'; /** * Indicates the message code for a dump operation. + * @since 7 */ DUMP_TRANSACTION = ('_' << 24) | ('D' << 16) | ('M' << 8) | 'P'; /** * Indicates the message code for a transmission. + * @since 7 */ INTERFACE_TRANSACTION = ('_' << 24) | ('N' << 16) | ('T' << 8) | 'F'; @@ -1144,6 +1151,7 @@ declare namespace rpc { * Indicates the minimum value of a valid message code. * *

This constant is used to check the validity of an operation. + * @since 7 */ MIN_TRANSACTION_ID = 0x1; @@ -1151,6 +1159,7 @@ declare namespace rpc { * Indicates the maximum value of a valid message code. * *

This constant is used to check the validity of an operation. + * @since 7 */ MAX_TRANSACTION_ID = 0x00FFFFFF; diff --git a/api/@ohos.screenLock.d.ts b/api/@ohos.screenLock.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ad709d2617033526f1be7fb0ddf2c54362f75fd3 --- /dev/null +++ b/api/@ohos.screenLock.d.ts @@ -0,0 +1,101 @@ +/* + * 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'; + +/** + * systemScreenLock + * @syscap SystemCapability.Miscservices.ScreenLock + * @since 7 + */ +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; + + /** + * Receives {beginWakeUp|endWakeUp|beginScreenOn|endScreenOn|beginScreenOff|endScreenOff|unlockScreen|beginExitAnimation} called. + * This callback is invoked when {beginWakeUp|endWakeUp|beginScreenOn|endScreenOn|beginScreenOff|endScreenOff|unlockScreen|beginExitAnimation} + * is called by runtime + * + * @systemapi Hide this for inner system use. + * @since 9 + */ + function on(type: 'beginWakeUp' | 'endWakeUp' | 'beginScreenOn' | 'endScreenOn' | 'beginScreenOff' | 'endScreenOff' | 'unlockScreen' | 'beginExitAnimation', callback: Callback): void; + + /** + * Receives {beginSleep | endSleep | changeUser} called. This callback is invoked when {beginSleep | endSleep | changeUser} is called by runtime + * + * @systemapi Hide this for inner system use. + * @since 9 + */ + function on(type: 'beginSleep' | 'endSleep' | 'changeUser', callback: Callback): void; + + /** + * Receives screenlockEnabled change. This callback is invoked when screenlockEnabled is called by runtime + * + * @systemapi Hide this for inner system use. + * @since 9 + */ + function on(type: 'screenlockEnabled', callback: Callback): void; + + /** + * Remove the receives of {beginWakeUp | endWakeUp | beginScreenOn | endScreenOn | beginScreenOff | endScreenOff | unlockScreen + * | beginExitAnimation | screenlockEnabled | beginSleep | endSleep | changeUser}. + * + * @systemapi Hide this for inner system use. + * @since 9 + */ + function off(type: 'beginWakeUp' | 'endWakeUp' | 'beginScreenOn' | 'endScreenOn' | 'beginScreenOff' | 'endScreenOff' + | 'unlockScreen' | 'beginExitAnimation' | 'screenlockEnabled' | 'beginSleep' | 'endSleep' | 'changeUser', callback: Callback): void; + + + /** + * screenlockAPP send event to screenlockSA + * + * @systemapi Hide this for inner system use. + * @since 9 + */ + function sendScreenLockEvent(event: String, parameter: number, callback: AsyncCallback): void; + function sendScreenLockEvent(event: String, parameter: number): 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..cbb2a2f69f853bf9f468fffc3d5f0dacd1d4e68b 100644 --- a/api/@ohos.screenshot.d.ts +++ b/api/@ohos.screenshot.d.ts @@ -23,6 +23,14 @@ import image from './@ohos.multimedia.image'; * @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..7745e387fbb8a3ce0943b67e754f830d28ac06ee 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,16 +400,34 @@ 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, } + /** + * @name HuksTagType + * @since 8 + * @syscap SystemCapability.Security.Huks + * @permission N/A + */ declare enum HuksTagType { HUKS_TAG_TYPE_INVALID = 0 << 28, HUKS_TAG_TYPE_INT = 1 << 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..79297988d263eb61d2cfbfbf4062ecaa8ab407a8 --- 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; /** @@ -98,7 +98,7 @@ declare namespace sensor { * @permission ohos.permission.GRYOSCOPE * @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; /** @@ -109,7 +109,7 @@ declare namespace sensor { * @permission ohos.permission.GRYOSCOPE * @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; /** @@ -131,7 +131,7 @@ declare namespace sensor { * @permission ohos.permission.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,7 +334,7 @@ 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. @@ -343,7 +343,7 @@ declare namespace sensor { * @permission ohos.permission.HEART_RATE * @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 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_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.GRYOSCOPE + * @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.GRYOSCOPE + * @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.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. + * @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. diff --git a/api/@ohos.settings.d.ts b/api/@ohos.settings.d.ts index 90c9e382fcc038a3bf58c2ea8118ee026aa19381..c2ffe4e43a02c8125869bfe1019b8e562bfaec69 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,854 @@ * 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 + * @since 7 * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Applictaions.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. + */ + 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..e8fa8d8634bdd6d3f46cc90e5d514d25c80eaddb 100644 --- a/api/@ohos.storageStatistics.d.ts +++ b/api/@ohos.storageStatistics.d.ts @@ -40,7 +40,7 @@ declare namespace storageStatistics { /** * Get the bundlestat * - * @since 8 + * @since 9 */ export interface BundleStats { @@ -48,8 +48,8 @@ declare namespace storageStatistics { cacheSize: number; dataSize: number; } - function getBundleStats(volumeUuid: string, packageName: string, callback: AsyncCallback): void; - function getBundleStats(volumeUuid: string, packageName: string): Promise; + function getBundleStats(packageName: string, callback: AsyncCallback): void; + function getBundleStats(packageName: string): Promise; } diff --git a/api/@ohos.systemTime.d.ts b/api/@ohos.systemTime.d.ts index 9071438b0ea18674ecaa7efc934630dca7ccf933..8a15765fcbe99d75634d843f1225bb5677b169a8 100755 --- a/api/@ohos.systemTime.d.ts +++ b/api/@ohos.systemTime.d.ts @@ -18,7 +18,7 @@ import { AsyncCallback, ErrorCallback } from './basic'; /** * System time and timezone. * @since 7 - * @sysCap SystemCapability.Miscservices.Time + * @syscap SystemCapability.Miscservices.Time * @devices phone, tablet, tv, wearable, car * @import systemTime from '@ohos.systemTime'; */ diff --git a/api/@ohos.systemparameter.d.ts b/api/@ohos.systemparameter.d.ts index 57a2906095657ffc8e63ede552c582984f76bf39..c0d4adafa76399df80f37af8f41f9d47d066453a 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.SysInfo + * @systemapi Hide this for inner system use. */ declare namespace systemParameter { /** diff --git a/api/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts index 7b5a03dd6165bea613bd31b10cac7002b0f2f7d1..96816be1f73218cc187011b08e712b40e868e691 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"; @@ -38,6 +38,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. * @@ -414,9 +424,9 @@ declare namespace call { * @since 8 */ export interface CallTransferInfo { - transferNum: string, - type: CallTransferType, - settingType: CallTransferSettingType + transferNum: string; + type: CallTransferType; + settingType: CallTransferSettingType; } /** @@ -446,16 +456,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 +520,9 @@ declare namespace call { * @since 8 */ export interface CallRestrictionInfo { - type: CallRestrictionType, - password: string - mode: CallRestrictionMode + type: CallRestrictionType; + password: string; + mode: CallRestrictionMode; } /** diff --git a/api/@ohos.telephony.data.d.ts b/api/@ohos.telephony.data.d.ts index 24a6fa755671be2a349c21d7184f81325b2ff9cb..d32d033a35fb9102b344307e8198246ffc9974a2 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"; diff --git a/api/@ohos.telephony.observer.d.ts b/api/@ohos.telephony.observer.d.ts index e7d6294044df12f73a131bcd017a0265da5de68f..8193aca0556d6a93da396099949fda566c6e06a1 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 @@ -162,12 +162,12 @@ declare namespace observer { * @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..c7486d60a3605c3ca85ed67a85e245f78494f02b 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"; @@ -143,6 +143,7 @@ declare namespace radio { * 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; @@ -158,6 +159,7 @@ declare namespace radio { * 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; @@ -177,6 +179,7 @@ declare namespace radio { * 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 +236,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 +641,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..3b3eac8443bfc48caf9dc75eee94365c89388fc3 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"; @@ -133,6 +133,8 @@ declare namespace sim { * 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; @@ -147,6 +149,7 @@ declare namespace sim { * @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; @@ -162,6 +165,7 @@ declare namespace sim { * @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; @@ -186,6 +190,7 @@ declare namespace sim { * @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; @@ -202,7 +207,8 @@ declare namespace sim { * @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..d67425155519d9338bd5cd242cfdf8cd38016359 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"; @@ -98,6 +98,7 @@ declare namespace sms { * @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; @@ -111,6 +112,7 @@ declare namespace sms { * @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; diff --git a/api/@ohos.uitest.d.ts b/api/@ohos.uitest.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..a884571d437ab7d9cfbdd1eb043211db95b3f26d --- /dev/null +++ b/api/@ohos.uitest.d.ts @@ -0,0 +1,421 @@ +/* + * 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 + */ + enum MatchPattern{ + /**Equals to a string.*/ + EQUALS = 0, + /**Contains a substring.*/ + CONTAINS = 1, + /**StartsWith a substring.*/ + STARTS_WITH = 2, + /**EndsWith a substring.*/ + ENDS_WITH = 3 +} + +/** + * Describes the attribute requirements for the target UiComponents. + * + * @since 8 + * @syscap SystemCapability.Test.UiTest + */ + 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?:bool):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?:bool):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?:bool):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?:bool):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?:bool):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 + */ + 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 + * @devices phone,tablet,tv,wearable,car + * @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 + */ + 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 + */ + const BY:By; + + export {UiComponent,UiDriver,BY}; \ No newline at end of file diff --git a/api/@ohos.usb.d.ts b/api/@ohos.usb.d.ts index ac295ca5d22d2b986af8dc1134ff92654a0faf74..4d8b08a6a231d7699653bba38e1faf9522e3af82 100644 --- a/api/@ohos.usb.d.ts +++ b/api/@ohos.usb.d.ts @@ -161,19 +161,22 @@ 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; /** * 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,6 +282,7 @@ declare namespace usb { /** * Interface name. * + * @syscap SystemCapability.USB.USBManager * @since 8 */ name: string; @@ -274,6 +290,7 @@ declare namespace usb { /** * 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..2366aa5f1f57a3ddeecdd0c50aa16c00fa9abcf2 100644 --- a/api/@ohos.userIAM.userAuth.d.ts +++ b/api/@ohos.userIAM.userAuth.d.ts @@ -153,7 +153,7 @@ declare namespace userAuth { * @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. @@ -166,7 +166,7 @@ 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. diff --git a/api/@ohos.volumeManager.d.ts b/api/@ohos.volumeManager.d.ts index 0aa1f212770084f558eb0e7db56542c78ded51af..563201404be96ca0a8ca0ec2af8604d405583725 100644 --- a/api/@ohos.volumeManager.d.ts +++ b/api/@ohos.volumeManager.d.ts @@ -18,7 +18,7 @@ import {AsyncCallback, Callback} from "./basic"; /** * Provides volumemanager statistics APIs * - * @since 8 + * @since 9 * @syscap SystemCapability.FileManagement.StorageService.Volume */ declare namespace volumeManager { @@ -26,10 +26,10 @@ declare namespace volumeManager { /** * Get All Volumes * - * @since 8 + * @since 9 */ export interface Volume { - id: number; + id: string; uuid: string; description: string; removeAble: boolean; @@ -43,7 +43,7 @@ function getAllVolumes(): Promise>; /** * Mount * - * @since 8 + * @since 9 */ function mount(volumeId: string, callback: AsyncCallback): void; function mount(volumeId: string): Promise; @@ -51,7 +51,7 @@ function mount(volumeId: string): Promise; /** * UnMount * - * @since 8 + * @since 9 */ function unmount(volumeId: string, callback: AsyncCallback): void; function unmount(volumeId: string): Promise; diff --git a/api/@ohos.wallpaper.d.ts b/api/@ohos.wallpaper.d.ts index b0f83f66f4de0cce8882ae534cd803761bbc1ce9..59ec8147d252cf7aead135898f5b10b51f6ff0b5 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..4876093c5d69b111c2914ea4570807501737e248 100644 --- a/api/@ohos.wifi.d.ts +++ b/api/@ohos.wifi.d.ts @@ -182,7 +182,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 */ @@ -444,6 +444,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 +455,7 @@ declare namespace wifi { * @return Returns the current group information. * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION */ function getCurrentGroup(): Promise; function getCurrentGroup(callback: AsyncCallback): void; @@ -464,26 +466,29 @@ declare namespace wifi { * @return Returns the found devices list. * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO, 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 +496,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, 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, 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 +537,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, ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. */ function deletePersistentGroup(netId: number): boolean; @@ -538,9 +549,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, ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. */ function setDeviceName(devName: string): boolean; @@ -723,6 +736,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 +745,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,6 +755,7 @@ 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; @@ -748,6 +764,7 @@ declare namespace wifi { * * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO */ function off(type: "p2pConnectionChange", callback?: AsyncCallback): void; @@ -757,6 +774,7 @@ declare namespace wifi { * @return Returns WifiP2pDevice * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION */ function on(type: "p2pDeviceChange", callback: AsyncCallback): void; @@ -766,6 +784,7 @@ declare namespace wifi { * @return Returns WifiP2pDevice * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.LOCATION */ function off(type: "p2pDeviceChange", callback?: AsyncCallback): void; @@ -775,6 +794,7 @@ declare namespace wifi { * @return Returns WifiP2pDevice[] * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION */ function on(type: "p2pPeerDeviceChange", callback: AsyncCallback): void; @@ -783,6 +803,7 @@ declare namespace wifi { * * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.LOCATION */ function off(type: "p2pPeerDeviceChange", callback?: AsyncCallback): void; @@ -792,6 +813,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 +822,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 +832,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 +841,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 +849,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 +900,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 +914,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 +949,7 @@ declare namespace wifi { * Describes the wifi security type. * * @since 6 + * @syscap SystemCapability.Communication.WiFi.Core */ enum WifiSecurityType { /** Invalid security type */ @@ -943,7 +971,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 +1029,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 +1058,8 @@ declare namespace wifi { * Wi-Fi hotspot configuration information. * * @since 7 - * @systemapi + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.AP */ interface HotspotConfig { /** The SSID of the Wi-Fi hotspot */ @@ -1051,7 +1082,8 @@ declare namespace wifi { * Wi-Fi station information. * * @since 7 - * @systemapi + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.AP */ interface StationInfo { /** the network name of the Wi-Fi client */ @@ -1068,7 +1100,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 */ @@ -1085,7 +1118,8 @@ declare namespace wifi { * The state of the supplicant enumeration. * * @since 7 - * @systemapi + * @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. */ @@ -1129,6 +1163,7 @@ declare namespace wifi { * The state of Wi-Fi connection enumeration. * * @since 7 + * @syscap SystemCapability.Communication.WiFi.STA */ export enum ConnState { /** The device is searching for an available AP. */ @@ -1160,6 +1195,7 @@ declare namespace wifi { * P2P device information. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.P2P */ interface WifiP2pDevice { /** Device name */ @@ -1182,6 +1218,7 @@ declare namespace wifi { * P2P config. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.P2P */ interface WifiP2PConfig { /** Device mac address */ @@ -1207,6 +1244,7 @@ declare namespace wifi { * P2P group information. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.P2P */ interface WifiP2pGroupInfo { /** Indicates whether it is group owner */ @@ -1241,6 +1279,7 @@ declare namespace wifi { * P2P connection status. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.P2P */ enum P2pConnectState { DISCONNECTED = 0, @@ -1251,6 +1290,7 @@ declare namespace wifi { * P2P linked information. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.P2P */ interface WifiP2pLinkedInfo { /** Connection status */ @@ -1267,6 +1307,7 @@ declare namespace wifi { * P2P device status. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.P2P */ enum P2pDeviceStatus { CONNECTED = 0, @@ -1280,6 +1321,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..83c6bdade80a0b5fed3febef6ef0e72c0907ff39 100644 --- a/api/@ohos.wifiext.d.ts +++ b/api/@ohos.wifiext.d.ts @@ -85,6 +85,7 @@ declare namespace wifiext { * The power model enumeration. * * @since 8 + * @syscap SystemCapability.Communication.WiFi.HotspotExt */ export enum PowerModel { /** Sleeping model. */ diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 868d38934dcaecbf529b13934f6d49f7003b2166..ef85ec277a87c0a7c668b3e064577f28cb476d87 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 @@ -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,7 +255,7 @@ declare namespace window { /** * Whether the window is touchable. The default value is false - * @since 6 + * @since 7 */ touchable: boolean } @@ -357,41 +275,138 @@ 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. + * @permission ohos.permission.SYSTEM_FLOAT_WINDOW + * @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. + * @permission ohos.permission.SYSTEM_FLOAT_WINDOW + * @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. + * @systemapi Hide this for inner system use. + * @permission ohos.permission.SYSTEM_FLOAT_WINDOW + * @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. + * @systemapi Hide this for inner system use. + * @permission ohos.permission.SYSTEM_FLOAT_WINDOW + * @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 +449,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 @@ -547,9 +562,18 @@ declare namespace window { * @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 + * @since 9 + */ + loadContent(path: string, storage: ContentStorage, callback: AsyncCallback): void; + + /** + * Loads content + * @param 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 9 */ - loadContent(path: string, storage: ContenStorage, callback: AsyncCallback): void; + loadContent(path: string, storage: ContentStorage): Promise; /** * Loads content @@ -559,13 +583,13 @@ declare namespace window { */ loadContent(path: string, callback: AsyncCallback): void; - /** + /** * Loads content * @param path path of the page to which the content will be loaded * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 7 */ - loadContent(path: string, storage?: ContenStorage): Promise; + loadContent(path: string): Promise; /** * Checks whether the window is displayed @@ -651,7 +675,11 @@ declare namespace window { */ getColorSpace(callback: AsyncCallback): void; } - + /** + * window stage callback event type + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 9 + */ enum WindowStageEventType { FOREGROUND = 1, ACTIVE, @@ -661,6 +689,7 @@ declare namespace window { /** * WindowStage * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 9 */ interface WindowStage { /** @@ -702,21 +731,22 @@ declare namespace window { * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 9 */ - loadContent(path: string, storage: ContenStorage, callback: AsyncCallback): void; + loadContent(path: string, storage: ContentStorage, callback: AsyncCallback): void; /** * Loads content * @param 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 9 */ - loadContent(path: string, callback: AsyncCallback): void; + loadContent(path: string, storage?: ContentStorage): Promise; /** * Loads content * @param path path of the page to which the content will be loaded * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 9 */ - loadContent(path: string, storage?: ContenStorage): Promise; + loadContent(path: string, callback: AsyncCallback): void; /** * window stage event callback on. * @since 9 diff --git a/api/@system.battery.d.ts b/api/@system.battery.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..eb9ffea7e1895a19d87c6129d69f082b3dbed479 --- /dev/null +++ b/api/@system.battery.d.ts @@ -0,0 +1,70 @@ +/* + * 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.BatteryManager.Core + * @since 3 + */ + export interface BatteryResponse { + /** + * Whether the battery is being charged. + * @since 3 + */ + charging: boolean; + + /** + * Current battery level, which ranges from 0.00 to 1.00. + * @since 3 + */ + level: number; +} + +/** + * @syscap SystemCapability.PowerManager.BatteryManager.Core + * @since 3 + */ +export interface GetStatusOptions { + /** + * Called when the current charging state and battery level are obtained. + * @since 3 + */ + success?: (data: BatteryResponse) => void; + + /** + * Called when the current charging state and battery level fail to be obtained. + * @since 3 + */ + 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.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/@system.package.d.ts b/api/@system.package.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a667d63cc945dcedf9a9d11311e6145ae4daaca --- /dev/null +++ b/api/@system.package.d.ts @@ -0,0 +1,75 @@ +/* + * 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.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 { + /** + * Application bundle name. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 + */ + bundleName: string; + + /** + * Called when native applications are installed. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 + */ + success?: (data: CheckPackageHasInstalledResponse) => void; + + /** + * 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 + */ + static hasInstalled(options: CheckPackageHasInstalledOptions): void; +} \ No newline at end of file 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/@system.vibrator.d.ts b/api/@system.vibrator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f8fd9d1be2962baa1b34bfa92fa54e26cbda0f38 --- /dev/null +++ b/api/@system.vibrator.d.ts @@ -0,0 +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. + */ + +/** + * @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..40bfe433ae5c723c7d76bc7ca7aaf7289c9b0654 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,7 +88,7 @@ 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; @@ -96,7 +96,7 @@ export declare interface Want { /** * The description of a extension ability name in a Want. * @since 9 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @default - */ extensionAbilityName?: string; @@ -104,7 +104,7 @@ export declare interface Want { /** * The description of a extension ability type in a Want. * @since 9 - * @sysCap SystemCapability.Ability.AbilityBase + * @syscap SystemCapability.Ability.AbilityBase * @default - */ extensionAbilityType?: number; diff --git a/api/app/abilityMissionInfo.d.ts b/api/app/abilityMissionInfo.d.ts index 19c7870cd494ba9675f0ea585dcec0b7fe1ae93d..082993e8962af9fdecb94d985e49b77b8e852e02 100644 --- a/api/app/abilityMissionInfo.d.ts +++ b/api/app/abilityMissionInfo.d.ts @@ -18,7 +18,7 @@ import { ElementName } from '../bundle/elementName'; /** * @name Mission information corresponding to ability * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @import import AbilityMissionInfo from 'app/abilityMissionInfo' * @permission N/A */ @@ -26,7 +26,7 @@ export interface AbilityMissionInfo { /** * @default Unique identification of task stack information corresponding to ability * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ missionId: number; @@ -34,7 +34,7 @@ export interface AbilityMissionInfo { * @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 + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ bottomAbility: ElementName; @@ -42,14 +42,14 @@ export interface AbilityMissionInfo { * @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 + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ topAbility: ElementName; /** * @default The corresponding ability description information in the task stack * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ windowMode: number; } diff --git a/api/app/activeProcessInfo.d.ts b/api/app/activeProcessInfo.d.ts index 68571a2d497043434fef4f91c793ef7b937b3ec9..72ac4eb1bb42a9e6398b23f7638fe520d4f314e4 100644 --- a/api/app/activeProcessInfo.d.ts +++ b/api/app/activeProcessInfo.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 app from 'app/activeProcessInfo' * @permission N/A */ @@ -24,28 +24,28 @@ export interface ActiveProcessInfo { /** * @default process id * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ pid: number; /** * @default user id * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ uid: number; /** * @default the name of the process * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ processName: string; /** * @default an array of the bundleNames running in the process * @since 7 - * @SysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ bundleNames: Array; } diff --git a/api/app/appVersionInfo.d.ts b/api/app/appVersionInfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..16333f0d7794c63d6a39debeebd10844a30d586e --- /dev/null +++ b/api/app/appVersionInfo.d.ts @@ -0,0 +1,47 @@ +/* + * 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..b03bc6357af7db0f3dd0afbf36e8c7bede366c35 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 { DisplayOrientation } 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: DisplayOrientation, callback: AsyncCallback): void + setDisplayOrientation(orientation: 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 index 442c46a5d07d4cb904e775c2375a2ff8223c8c7b..d7961444e2ea6215f795a3e182541ea0ea9b0a2a 100755 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.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,12 +24,13 @@ import StartOptions from "../@ohos.application.StartOptions"; import PermissionRequestResult from "./PermissionRequestResult"; import { Configuration } from '../@ohos.application.Configuration'; import Caller from '../@ohos.application.Ability'; +import { ContentStorage } from '../@internal/component/ets/state_management'; /** * The context of an ability. It allows access to ability-specific resources. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly */ @@ -38,7 +39,7 @@ export default class AbilityContext extends Context { * Indicates configuration information about an ability. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ abilityInfo: AbilityInfo; @@ -47,7 +48,7 @@ export default class AbilityContext extends Context { * Indicates configuration information about an module. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ currentHapModuleInfo: HapModuleInfo; @@ -56,7 +57,7 @@ export default class AbilityContext extends Context { * Indicates configuration information. * * @since 9 - * @sysCap AAFwk + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ config: Configuration; @@ -65,8 +66,9 @@ export default class AbilityContext extends Context { * Starts a new ability. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @param parameter Indicates the ability to start. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the ability to start. + * @param options Indicates the start options. * @return - * @StageModelOnly */ @@ -77,24 +79,25 @@ export default class AbilityContext extends Context { /** * 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 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the ability to start. + * @return Returns to the Caller interface on success Returns empty or undefined on failure * @StageModelOnly */ - startAbilityByCall(want: Want): Promise; + startAbilityByCall(want: Want): Promise; /** * Starts a new ability with account. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param want Indicates the want info to start. - * @param want Indicates the account to start. + * @param accountId Indicates the account to start. + * @param options Indicates the start options. * @systemapi hide for inner use. * @return - + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @StageModelOnly */ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; @@ -105,8 +108,9 @@ export default class AbilityContext extends Context { * 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. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the ability to start. + * @param options Indicates the start options. * @return Returns the {@link AbilityResult}. * @StageModelOnly */ @@ -118,11 +122,13 @@ export default class AbilityContext extends Context { * Starts an ability and returns the execution result when the ability is destroyed with account. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param want Indicates the want info to start. - * @param want Indicates the account to start. + * @param accountId Indicates the account to start. + * @param options Indicates the start options. * @systemapi hide for inner use. * @return Returns the {@link AbilityResult}. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @StageModelOnly */ startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; @@ -133,7 +139,7 @@ export default class AbilityContext extends Context { * Destroys this Page ability. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @return - * @StageModelOnly */ @@ -145,7 +151,7 @@ export default class AbilityContext extends Context { * and destroys this Page ability. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param parameter Indicates the result to return. * @return - * @StageModelOnly @@ -157,10 +163,10 @@ export default class AbilityContext extends Context { * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @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. + * @systemapi Hide this for inner system use. * @return Returns the number code of the ability connected * @StageModelOnly */ @@ -170,12 +176,13 @@ export default class AbilityContext extends Context { * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template with account. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @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 + * @param options The remote object instance * @systemapi hide for inner use. * @return Returns the number code of the ability connected + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @StageModelOnly */ connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; @@ -184,9 +191,9 @@ export default class AbilityContext extends Context { * The callback interface was connect successfully. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param connection The number code of the ability connected - * @hide hide for inner use. + * @systemapi Hide this for inner system use. * @StageModelOnly */ disconnectAbility(connection: number, callback:AsyncCallback): void; @@ -196,7 +203,7 @@ export default class AbilityContext extends Context { * Set mission label of current ability. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param label The label of ability that showed in recent missions. * @StageModelOnly */ @@ -207,10 +214,22 @@ export default class AbilityContext extends Context { * Requests certain permissions from the system. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param permissions Indicates the list of permissions to be requested. This parameter cannot be null or empty. + * @return Returns the {@link PermissionRequestResult}. * @StageModelOnly */ requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback) : void; requestPermissionsFromUser(permissions: Array) : Promise; + + /** + * Restore window stage data in ability continuation + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param contentStorage the storage data used to restore window stage + * @StageModelOnly + */ + restoreWindowStage(contentStorage: ContentStorage) : void; + } \ No newline at end of file diff --git a/api/application/AbilityRunningInfo.d.ts b/api/application/AbilityRunningInfo.d.ts index 41bff388cefc203e2f6f1391602360b3e33a6182..243f1b482710745dddf13f173adf87447296bb81 100644 --- a/api/application/AbilityRunningInfo.d.ts +++ b/api/application/AbilityRunningInfo.d.ts @@ -20,49 +20,49 @@ 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 * @permission N/A */ export interface AbilityRunningInfo { /** * @default ability element name * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ ability: ElementName; /** * @default process id * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ pid: number; /** * @default user id * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ uid: number; - + /** * @default the name of the process * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ processName: string; /** * @default ability start time * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ startTime: number; /** * @default Enumerates state of the ability state info * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ 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 index e8678b43276c66040a4184285842bc073b0f1024..a06fff35298917c4d62e1537fb67937805bc2fc0 100755 --- a/api/application/Context.d.ts +++ b/api/application/Context.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 @@ -23,7 +23,7 @@ import EventHub from "./EventHub"; * application-specific resources. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly */ @@ -32,7 +32,7 @@ export default class Context extends BaseContext { * Indicates the capability of accessing application resources. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ resourceManager: resmgr.ResourceManager; @@ -41,7 +41,7 @@ export default class Context extends BaseContext { * Indicates configuration information about an application. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ applicationInfo: ApplicationInfo; @@ -50,7 +50,7 @@ export default class Context extends BaseContext { * Indicates app cache dir. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ cacheDir: string; @@ -59,7 +59,7 @@ export default class Context extends BaseContext { * Indicates app temp dir. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ tempDir: string; @@ -68,7 +68,7 @@ export default class Context extends BaseContext { * Indicates app files dir. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ filesDir : string; @@ -77,7 +77,7 @@ export default class Context extends BaseContext { * Indicates app database dir. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ databaseDir : string; @@ -86,7 +86,7 @@ export default class Context extends BaseContext { * Indicates app storage dir. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ storageDir : string; @@ -95,7 +95,7 @@ export default class Context extends BaseContext { * Indicates app bundle code dir. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ bundleCodeDir : string; @@ -104,7 +104,7 @@ export default class Context extends BaseContext { * Indicates app distributed files dir. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ distributedFilesDir: string; @@ -113,7 +113,7 @@ export default class Context extends BaseContext { * Indicates event hub. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ eventHub: EventHub; @@ -122,10 +122,11 @@ export default class Context extends BaseContext { * Create a bundle context * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. * @param bundleName Indicates the bundle name. * @return application context + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @StageModelOnly */ createBundleContext(bundleName: string): Context; @@ -134,7 +135,7 @@ export default class Context extends BaseContext { * Get application context * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @return application context * @StageModelOnly */ @@ -144,16 +145,21 @@ export default class Context extends BaseContext { * Switch file area * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param mode file area. * @StageModelOnly */ switchArea(mode: AreaMode): void; } +/** + * File area mode + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ export enum AreaMode { EL1 = 0, - EL2 = 1, - EL3 = 2, - EL4 = 3 + EL2 = 1 } \ No newline at end of file diff --git a/api/application/EventHub.d.ts b/api/application/EventHub.d.ts index 8c198ce678f19d2b61f049ec3950dfdba52d1a39..cbc9cbdc8b52946d1a78035c0be3fbac91e74a67 100644 --- a/api/application/EventHub.d.ts +++ b/api/application/EventHub.d.ts @@ -17,8 +17,7 @@ * 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 + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly */ @@ -26,9 +25,8 @@ export default class EventHub { /** * Subscribe to an event. * - * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param event Indicates the event. * @param callback Indicates the callback. * @return - @@ -39,9 +37,8 @@ export default class EventHub { /** * Unsubscribe from an event. * - * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param event Indicates the event. * @param callback Indicates the callback. * @return - @@ -52,9 +49,8 @@ export default class EventHub { /** * Trigger the event callbacks. * - * @devices phone, tablet, tv, wearable, car * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param event Indicates the event. * @param args Indicates the callback arguments. * @return - diff --git a/api/application/ExtensionRunningInfo.d.ts b/api/application/ExtensionRunningInfo.d.ts index 17cd0bd6e7c765a731eec4dbc5a435b8da8feda5..21b196d36414bc24a32b44e162334a6b2ada95a8 100644 --- a/api/application/ExtensionRunningInfo.d.ts +++ b/api/application/ExtensionRunningInfo.d.ts @@ -20,56 +20,56 @@ import bundle from '../@ohos.bundle'; * The class of an extension running information. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @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 + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ extension: ElementName; /** * @default process id * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ pid: number; /** * @default user id * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ uid: number; /** * @default the name of the process * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ processName: string; /** * @default ability start time * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ startTime: number; /** * @default All package names under the current process * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ clientPackage: Array; /** * @default Enumerates types of the entension info * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @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 index dd2d16bc81cb98b14817a9b96a0e5e6472a91fb3..b1c4da76914085b8ca54266704725546f1ab08f2 100644 --- a/api/application/FormExtensionContext.d.ts +++ b/api/application/FormExtensionContext.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 formBindingData from '../@ohos.application.formBindingData'; * formExtension-specific resources. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core + * @syscap SystemCapability.Ability.Form * @permission N/A * @StageModelOnly */ @@ -34,8 +34,7 @@ export default class FormExtensionContext extends ExtensionContext { *

You can use this method to update the given form

* * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Core - * @permission ohos.permission.REQUIRE_FORM. + * @syscap SystemCapability.Ability.Form * @param formId Indicates the given form. * @param formBindingData Indicates the form data. * @return - 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/PermissionRequestResult.d.ts b/api/application/PermissionRequestResult.d.ts index 6c44ea461f8be4c4a7c03b20ed9c48c9540ec04f..e99911584718ffa2abc7fcbbd36fd75b4d996321 100755 --- a/api/application/PermissionRequestResult.d.ts +++ b/api/application/PermissionRequestResult.d.ts @@ -17,7 +17,7 @@ * The result of requestPermissionsFromUser with asynchronous callback. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly */ @@ -26,7 +26,7 @@ export default class PermissionRequestResult { * The permissions passed in by the user. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ permissions: Array; @@ -36,7 +36,7 @@ export default class PermissionRequestResult { * permission is granted, and the value -1 indicates not. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly */ authResults: Array; 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..ff53765b0f9a81b59a017cd49221c5491a04dba3 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.Core * @permission N/A */ export interface ProcessRunningInfo { /** * @default process id * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ pid: number; /** * @default user id * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ uid: number; - + /** * @default the name of the process * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ processName: string; - + /** * @default an array of the bundleNames running in the process * @since 8 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ 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 index ce5e61f0654409a57810d33d2bb64108bf4c0509..670eff1ca35cfeb47ef49d0b372a3b0747af8580 100644 --- a/api/application/ServiceExtensionContext.d.ts +++ b/api/application/ServiceExtensionContext.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 @@ -25,7 +25,7 @@ import { ExtensionAbilityInfo } from "../bundle/extensionAbilityInfo"; * serviceExtension-specific resources. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. * @permission N/A * @StageModelOnly @@ -35,7 +35,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * Service extension information. * * @since 9 - * @sysCap AAFwk + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ extensionAbilityInfo: ExtensionAbilityInfo; @@ -43,8 +43,9 @@ export default class ServiceExtensionContext extends ExtensionContext { * Service extension uses this method to start a specific ability. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission - * @param parameter Indicates the ability to start. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the ability to start. + * @param options Indicates the start options. * @systemapi hide for inner use. * @return - * @StageModelOnly @@ -57,9 +58,10 @@ export default class ServiceExtensionContext extends ExtensionContext { * 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. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the ability to start. + * @param accountId Indicates the accountId to start. + * @param options Indicates the start options. * @systemapi hide for inner use. * @return - * @StageModelOnly @@ -72,7 +74,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * Destroys this service extension. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. * @return - * @StageModelOnly @@ -88,8 +90,9 @@ export default class ServiceExtensionContext extends ExtensionContext { * service extension when the Service extension is connected.

* * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission - * @param request Indicates the service extension to connect. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the service extension to connect. + * @param options Indicates the callback of connection. * @systemapi hide for inner use. * @return connection id, int value. * @StageModelOnly @@ -104,9 +107,10 @@ export default class ServiceExtensionContext extends ExtensionContext { * 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. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the service extension to connect. + * @param accountId Indicates the account to connect. + * @param options Indicates the callback of connection. * @systemapi hide for inner use. * @return connection id, int value. * @StageModelOnly @@ -118,7 +122,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * {@link connectAbility}. * * @since 9 - * @sysCap SystemCapability.Ability.AbilityRuntime.Mission + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param connection the connection id returned from connectAbility api. * @systemapi hide for inner use. * @return - diff --git a/api/application/abilityDelegator.d.ts b/api/application/abilityDelegator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f937ee0ea25ef8a0e9133bb03cfb80b1cc8760c4 --- /dev/null +++ b/api/application/abilityDelegator.d.ts @@ -0,0 +1,153 @@ +/* + * 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 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import AbilityDelegator from 'application/abilityDelegator.d' + * @permission N/A + */ +export interface AbilityDelegator { + /** + * Add an AbilityMonitor object for monitoring the lifecycle state changes of the specified ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param monitor AbilityMonitor object + */ + addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; + addAbilityMonitor(monitor: AbilityMonitor): Promise; + + /** + * Remove a specified AbilityMonitor object from the application memory. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param monitor AbilityMonitor object + */ + removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; + removeAbilityMonitor(monitor: AbilityMonitor): Promise; + + /** + * Wait for and returns the Ability object that matches the conditions set in the given AbilityMonitor. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param monitor AbilityMonitor object + * @param timeout Maximum wait time, in milliseconds + * @return success: return the Ability object, failure: return null + */ + waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; + waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCallback): void; + waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise; + + /** + * Obtain the application context. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return App Context + */ + getAppContext(): Context; + + /** + * Obtain the lifecycle state of a specified ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param ability The Ability object + * @return The state of the Ability object. enum AbilityLifecycleState + */ + getAbilityState(ability: Ability): number; + + /** + * Obtain the ability that is currently being displayed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return The top ability of the current application + */ + getCurrentTopAbility(callback: AsyncCallback): void; + getCurrentTopAbility(): Promise + + /** + * Invoke the Ability.onForeground() callback of a specified ability without changing its lifecycle state. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param ability The ability object + * @return true: success false: failure + */ + doAbilityForeground(ability: Ability, callback: AsyncCallback): void; + doAbilityForeground(ability: Ability): Promise; + + /** + * Invoke the Ability.onBackground() callback of a specified ability without changing its lifecycle state. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param ability The ability object + * @return true: success false: failure + */ + doAbilityBackground(ability: Ability, callback: AsyncCallback): void; + doAbilityBackground(ability: Ability): Promise; + + /** + * Prints log information to the unit testing console. + * The total length of the log information to be printed cannot exceed 1000 characters. + * + * @since 9 + * @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 9 + * @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 9 + * @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/application/abilityDelegatorArgs.d.ts b/api/application/abilityDelegatorArgs.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..321a68e0d256c10e48f33031dafaff2138b24167 --- /dev/null +++ b/api/application/abilityDelegatorArgs.d.ts @@ -0,0 +1,59 @@ +/* + * 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. + */ + + +/** + * Store unit testing-related parameters, including test case names, and test runner name. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import AbilityDelegatorArgs from 'application/abilityDelegatorArgs.d' + * @permission N/A + */ +export interface AbilityDelegatorArgs { + /** + * the bundle name of the application being tested. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + bundleName: string; + + /** + * the parameters used for unit testing. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + parameters: {[key: string]: string}; + + /** + * the class names of all test cases. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + testCaseNames: string; + + /** + * the class name of the test runner used to execute test cases. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + testRunnerClassName: string; +} + +export default AbilityDelegatorArgs; \ No newline at end of file diff --git a/api/application/abilityMonitor.d.ts b/api/application/abilityMonitor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..81806c4369611e8fb3aaefa64ab368a0c452dc68 --- /dev/null +++ b/api/application/abilityMonitor.d.ts @@ -0,0 +1,91 @@ +/* + * 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. + */ + +/** + * Provide methods for matching monitored Ability objects that meet specified conditions. + * The most recently matched Ability objects will be saved in the AbilityMonitor object. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import AbilityMonitor from 'application/abilityMonitor.d' + * @permission N/A + */ +export interface AbilityMonitor { + /** + * The name of the ability to monitor. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + abilityName: string; + + /** + * Called back when the ability is started for initialization. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + onAbilityCreate?:() => void; + + /** + * Called back when the state of the ability changes to foreground. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + onAbilityForeground?:() => void; + + /** + * Called back when the state of the ability changes to background. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + onAbilityBackground?:() => void; + + /** + * Called back before the ability is destroyed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + onAbilityDestroy?:() => void; + + /** + * Called back when an ability window stage is created. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + onWindowStageCreate?:() => void; + + /** + * Called back when an ability window stage is restored. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + onWindowStageRestore?:() => void; + + /** + * Called back when an ability window stage is destroyed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + onWindowStageDestroy?:() => void; +} + +export default AbilityMonitor; \ No newline at end of file diff --git a/api/application/ExtAbilityContext.d.ts b/api/application/shellCmdResult.d.ts similarity index 56% rename from api/application/ExtAbilityContext.d.ts rename to api/application/shellCmdResult.d.ts index c8cccfb6b2d788463029406016e348d5eca01d97..b8cc3f894a8eb9629dbcd60d3d53d6a1d60ed076 100644 --- a/api/application/ExtAbilityContext.d.ts +++ b/api/application/shellCmdResult.d.ts @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 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 * @@ -13,26 +13,30 @@ * 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. + * A object that records the result of shell command executes. * * @since 9 - * @sysCap AAFwk - * @devices phone, tablet, tv, wearable, car + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import ShellCmdResult from 'application/shellCmdResult.d' * @permission N/A - * @StageModelOnly */ -export default class ExtAbilityContext extends Context { +export interface ShellCmdResult { + /** + * the cmd standard result. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + stdResult: String; /** - * Indicates configuration information about an module. + * shell cmd exec result. * * @since 9 - * @sysCap AAFwk - * @StageModelOnly + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - currentHapModuleInfo: HapModuleInfo; -} \ 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..099ba7a1b75925ecb5664c3972350e15fb5c1246 100644 --- a/api/bundle/abilityInfo.d.ts +++ b/api/bundle/abilityInfo.d.ts @@ -225,7 +225,7 @@ export interface AbilityInfo { 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..b092df52e56f0f9946a4aa012dbd014ab177d3cd 100644 --- a/api/bundle/applicationInfo.d.ts +++ b/api/bundle/applicationInfo.d.ts @@ -174,7 +174,7 @@ export interface ApplicationInfo { /** * @default Indicates entity type of the application - * @since 8 + * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework */ readonly entityType: string; diff --git a/api/bundle/hapModuleInfo.d.ts b/api/bundle/hapModuleInfo.d.ts index 9c428d4376b4c4a901ef1a19be14d7597ad17232..477ca86021fed8caf1c892dee53f3f2de6160065 100644 --- a/api/bundle/hapModuleInfo.d.ts +++ b/api/bundle/hapModuleInfo.d.ts @@ -15,6 +15,7 @@ import { AbilityInfo } from "./abilityInfo"; import { ExtensionAbilityInfo } from "./extensionAbilityInfo"; +import { Metadata } from './metadata' /** * @name Obtains configuration information about an module. @@ -128,4 +129,11 @@ export interface HapModuleInfo { * @syscap SystemCapability.BundleManager.BundleFramework */ readonly extensionAbilityInfo: Array; + /** + * @default Indicates the metadata of ability + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + * + */ + readonly metadata: Array; } \ No newline at end of file diff --git a/api/common/@internal/console.d.ts b/api/common/@internal/console.d.ts index 69aa3336d55ea8a95641b051e8ec6aad51abb54d..2c5c4430994a70f8abe7d01cf9a92c5563a04103 100644 --- a/api/common/@internal/console.d.ts +++ b/api/common/@internal/console.d.ts @@ -14,42 +14,37 @@ */ /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @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/global.d.ts b/api/common/@internal/global.d.ts index 36a6d6d1822f8ef784c9d2efea65c5447b48d359..23fe8c0eb544a6a06c450c46ced2f72260badbdb 100644 --- a/api/common/@internal/global.d.ts +++ b/api/common/@internal/global.d.ts @@ -15,165 +15,194 @@ /** * 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; /** * Cancels the interval set by " setInterval()". + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @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.Lite * @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; +/** + * 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/viewmodel.d.ts b/api/common/@internal/viewmodel.d.ts index 149e18bb6e9a29450e68f5da0a8acd7b2731c4cf..3e0cceef68ffb76bca8b4ef7350ee8f6f5e09b93 100644 --- a/api/common/@internal/viewmodel.d.ts +++ b/api/common/@internal/viewmodel.d.ts @@ -18,120 +18,130 @@ import { WebGLContextAttributes, WebGLRenderingContext } from "../webgl/webgl"; import { WebGL2RenderingContext } from "../webgl/webgl2"; /** - * @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 +152,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 +173,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 +205,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 +238,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 +271,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 +349,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 +378,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 +404,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 +470,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 +480,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 +489,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 +528,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 +537,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 +668,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 +676,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 +686,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 +696,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 +716,7 @@ export interface ListElement extends Element { /** * Expands a group. * @param param - * @devices tv, phone, tablet, wearable + * @since 4 */ expandGroup(param: { /** @@ -696,19 +728,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 +752,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 +872,7 @@ export interface ImageAnimatorElement extends Element { * Playing * Paused * Stopped - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @since 4 */ getState(): "Playing" | "Paused" | "Stopped"; } @@ -841,25 +880,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 +912,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 +928,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 +944,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 +960,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