fix conflict

This commit is contained in:
fangyun 2023-11-08 14:45:49 +08:00
commit 189a940722
198 changed files with 5389 additions and 42 deletions

View File

@ -13,6 +13,29 @@
* limitations under the License.
*/
/**
* Defines the options of Component ClassDecorator.
*
* @interface ComponentOptions
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
declare interface ComponentOptions {
/**
* freeze UI state.
*
* @type { boolean }
* @default false
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
freezeWhenInactive : boolean,
}
/**
* Defining Component ClassDecorator
*
@ -34,7 +57,16 @@
* @since 10
* @form
*/
declare const Component: ClassDecorator;
/**
* Defining Component ClassDecorator
*
* Component is a ClassDecorator and it supports ComponentOptions as parameters.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
declare const Component: ClassDecorator & ((options: ComponentOptions) => ClassDecorator);
/**
* Defines the options of Entry ClassDecorator.
@ -10675,3 +10707,23 @@ declare module 'DragControllerParam' {
export type { CustomBuilder, DragItemInfo, DragEvent };
}
}
/**
* Define EdgeEffect Options.
*
* @interface EdgeEffectOptions
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
declare interface EdgeEffectOptions {
/**
* Enable Sliding effect when component does not full screen.
*
* @type { boolean }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
alwaysEnabled: boolean;
}

View File

@ -5135,6 +5135,16 @@ declare enum CopyOptions {
* @form
*/
LocalDevice = 2,
/**
* Share in cross Device
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
CROSS_DEVICE = 3,
}
/**
@ -5885,7 +5895,7 @@ declare enum DialogButtonStyle {
* @since 10
*/
DEFAULT = 0,
/**
* Highlight Style.
* @syscap SystemCapability.ArkUI.ArkUI.Full
@ -5968,4 +5978,20 @@ declare enum EllipsisMode {
* @since 11
*/
END = 2,
}
/**
* A type which can be undefined
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
declare type Nullable<T> = T | undefined;
declare module 'CommonEnums' {
module 'CommonEnums' {
// @ts-ignore
export type { Color, FontStyle, Nullable };
}
}

View File

@ -656,7 +656,17 @@ declare class GridAttribute extends CommonMethod<GridAttribute> {
* @crossplatform
* @since 10
*/
edgeEffect(value: EdgeEffect): GridAttribute;
/**
* Called when the sliding effect is set.
*
* @param { EdgeEffect } value
* @param { EdgeEffectOptions } options
* @returns { GridAttribute } The attribute of the grid
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
edgeEffect(value: EdgeEffect, options?: EdgeEffectOptions): GridAttribute;
/**
* Called to setting the nested scroll options.

View File

@ -642,7 +642,6 @@ declare class ImageAttribute extends CommonMethod<ImageAttribute> {
* @returns { ImageAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
draggable(value: boolean): ImageAttribute;

View File

@ -666,7 +666,38 @@ declare class ListAttribute extends CommonMethod<ListAttribute> {
* @since 10
* @form
*/
edgeEffect(value: EdgeEffect): ListAttribute;
/**
* Called when the sliding effect is set.
*
* @param { EdgeEffect } value
* @param { EdgeEffectOptions } options
* @returns { ListAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
edgeEffect(value: EdgeEffect, options?: EdgeEffectOptions): ListAttribute;
/**
* Called when need to decide contentStartOffset the list will show.
* @param { number } value - the value Of startOffset.
* @returns { ListAttribute } the attribute of the list.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
contentStartOffset(value: number): ListAttribute;
/**
* Called when need to decide contentEndOffset the list will show.
* @param { number } value - the value Of endOffset.
* @returns { ListAttribute } the attribute of the list.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
contentEndOffset(value: number): ListAttribute;
/**
* Called when the ListItem split line style is set.

View File

@ -643,7 +643,17 @@ declare class ScrollAttribute extends CommonMethod<ScrollAttribute> {
* @crossplatform
* @since 10
*/
edgeEffect(edgeEffect: EdgeEffect): ScrollAttribute;
/**
* Called when the sliding effect is set.
*
* @param { EdgeEffect } edgeEffect
* @param { EdgeEffectOptions } options
* @returns { ScrollAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
edgeEffect(edgeEffect: EdgeEffect, options?: EdgeEffectOptions): ScrollAttribute;
/**
* Called when scrolling begin each frame.

View File

@ -108,6 +108,52 @@ declare enum CancelButtonStyle {
INPUT
}
/**
* Declare the type of search input box
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
declare enum SearchType {
/**
* Basic input mode.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
NORMAL = 0,
/**
* Pure digital input mode.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
NUMBER = 2,
/**
* Phone number entry mode.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
PHONE_NUMBER = 3,
/**
* E-mail address input mode.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
EMAIL = 5,
}
/**
* The construct function of search
*
@ -614,6 +660,17 @@ declare class SearchAttribute extends CommonMethod<SearchAttribute> {
* @since 11
*/
customKeyboard(value: CustomBuilder): SearchAttribute;
/**
* Called when the search type is set.
*
* @param { SearchType } value
* @returns { SearchAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
type(value: SearchType): SearchAttribute;
}
/**

View File

@ -185,6 +185,52 @@ interface TextAreaInterface {
(value?: TextAreaOptions): TextAreaAttribute;
}
/**
* Declare the type of input box
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
declare enum TextAreaType {
/**
* Basic input mode.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
NORMAL = 0,
/**
* Pure digital input mode.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
NUMBER = 2,
/**
* Phone number entry mode.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
PHONE_NUMBER = 3,
/**
* E-mail address input mode.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
EMAIL = 5,
}
/**
* Defines the attribute functions of TextArea.
*
@ -648,6 +694,17 @@ declare class TextAreaAttribute extends CommonMethod<TextAreaAttribute> {
* @since 11
*/
customKeyboard(value: CustomBuilder): TextAreaAttribute;
/**
* Called when the input type is set.
*
* @param { TextAreaType } value
* @returns { TextAreaAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
type(value: TextAreaType): TextAreaAttribute;
}
/**

View File

@ -24,6 +24,13 @@
* @crossplatform
* @since 10
*/
/**
* Provides a way to control the textclock status.
*
* @crossplatform
* @since 11
* @form
*/
declare class TextClockController {
/**
* constructor.
@ -38,6 +45,14 @@ declare class TextClockController {
* @crossplatform
* @since 10
*/
/**
* constructor.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
constructor();
/**
* Provides a start event for textclock.
@ -52,6 +67,14 @@ declare class TextClockController {
* @crossplatform
* @since 10
*/
/**
* Provides a start event for textclock.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
start();
/**
* Provides a stop event for textclock.
@ -66,6 +89,14 @@ declare class TextClockController {
* @crossplatform
* @since 10
*/
/**
* Provides a stop event for textclock.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
stop();
}
@ -84,6 +115,15 @@ declare class TextClockController {
* @crossplatform
* @since 10
*/
/**
* TextClock component, which provides the text clock capability.
*
* @interface TextClockInterface
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
interface TextClockInterface {
/**
* Construct the text clock component.
@ -108,6 +148,19 @@ interface TextClockInterface {
* @crossplatform
* @since 10
*/
/**
* Construct the text clock component.
* Specifies the current time zone.
* The valid value is an integer ranging from - 14 to 12,
* Where a negative value indicates the eastern time zone, for example, -8.
*
* @param { object } options
* @returns { TextClockAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
(options?: { timeZoneOffset?: number; controller?: TextClockController }): TextClockAttribute;
}
@ -135,7 +188,24 @@ declare class TextClockAttribute extends CommonMethod<TextClockAttribute> {
* @crossplatform
* @since 10
*/
/**
* set display time format,such as "yyyy/mm/dd","yyyy-mm-dd".
* support time formatyyyy,mm,mmm(English month abbreviation),mmmm(Full name of the month in English),
* dd,ddd(English Week abbreviation),dddd(Full name of the week in English),
* HH/hh(24-hour clock/12-hour clock),MM/mm(minute),SS/ss(second).
* The default value is "hh:mm:ss" when TextClock is not in a form.
* The default value is "hh:mm" when TextClock is in a form.
* If the value has second or millisecond, the value will be set to the default value.
*
* @param { string } value
* @returns { TextClockAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
format(value: string): TextClockAttribute;
/**
* Provides a date change callback.
* The callback parameter is Unix Time Stamp,
@ -163,6 +233,23 @@ declare class TextClockAttribute extends CommonMethod<TextClockAttribute> {
* @crossplatform
* @since 10
*/
/**
* Provides a date change callback.
* The callback parameter is Unix Time Stamp,
* The number of milliseconds that have elapsed since January 1, 1970 (UTC).
* The minimum callback interval for this event default is seconds when TextClock is not in a form.
* The minimum callback interval for this event is minutes when TextClock is in a form.
* If visibility is Hidden the callback be disabled when TextClock is in a form.
* You can listen to this callback,
* Use the format attribute method to customize data display in the callback.
*
* @param { function } event - Listening date event callback.
* @returns { TextClockAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
onDateChange(event: (value: number) => void): TextClockAttribute;
/**
@ -182,6 +269,16 @@ declare class TextClockAttribute extends CommonMethod<TextClockAttribute> {
* @crossplatform
* @since 10
*/
/**
* Called when the value of TextClock fontColor is set
*
* @param { ResourceColor } value
* @returns { TextClockAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
fontColor(value: ResourceColor): TextClockAttribute;
/**
@ -201,6 +298,16 @@ declare class TextClockAttribute extends CommonMethod<TextClockAttribute> {
* @crossplatform
* @since 10
*/
/**
* Called when the value of TextClock fontSize is set
*
* @param { Length } value
* @returns { TextClockAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
fontSize(value: Length): TextClockAttribute;
/**
@ -220,6 +327,16 @@ declare class TextClockAttribute extends CommonMethod<TextClockAttribute> {
* @crossplatform
* @since 10
*/
/**
* Called when the value of TextClock fontStyle is set
*
* @param { FontStyle } value
* @returns { TextClockAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
fontStyle(value: FontStyle): TextClockAttribute;
/**
@ -239,6 +356,16 @@ declare class TextClockAttribute extends CommonMethod<TextClockAttribute> {
* @crossplatform
* @since 10
*/
/**
* Called when the value of TextClock fontWeight is set
*
* @param { number | FontWeight | string } value
* @returns { TextClockAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
fontWeight(value: number | FontWeight | string): TextClockAttribute;
/**
@ -258,7 +385,44 @@ declare class TextClockAttribute extends CommonMethod<TextClockAttribute> {
* @crossplatform
* @since 10
*/
/**
* Called when the value of TextClock fontFamily is set
*
* @param { ResourceStr } value
* @returns { TextClockAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
fontFamily(value: ResourceStr): TextClockAttribute;
/**
* Called when the text shadow is set.
*
* @param { ShadowOptions } value - The shadow options.
* @returns { TextClockAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
textShadow(value: ShadowOptions): TextClockAttribute;
/**
* Called when the text fontFeature is set.
*
* @param { string } value - The fontFeature.
* normal | <feature-tag-value>,
* where <feature-tag-value> = <string> [ <integer> | on | off ], like: "ss01" 0
* number of <feature-tag-value> can be single or multiple, and separated by comma ','.
* @returns { TextClockAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
* @form
*/
fontFeature(value: string): TextClockAttribute;
}
/**
@ -274,6 +438,14 @@ declare class TextClockAttribute extends CommonMethod<TextClockAttribute> {
* @crossplatform
* @since 10
*/
/**
* Defines TextClock Component.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @since 11
*/
declare const TextClock: TextClockInterface;
/**
@ -289,4 +461,12 @@ declare const TextClock: TextClockInterface;
* @crossplatform
* @since 10
*/
/**
* Defines TextClock Component instance.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @form
* @since 11
*/
declare const TextClockInstance: TextClockAttribute;

View File

@ -13,6 +13,28 @@
* limitations under the License.
*/
/**
* This interface is used to set the options for UIExtensionComponentAttribute during construction
*
* @interface UIExtensionOptions
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @systemapi
* @since 11
*/
declare interface UIExtensionOptions {
/**
* Set whether the current capability is used as a Caller.<br/>
* If set to true, as a Caller, the current token of UIExtensionComponent is set to rootToken.
*
* @type { ?boolean }
* @default false
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @systemapi
* @since 11
*/
isTransferringCaller?: boolean;
}
/**
* This interface is used for send data to the UIExtensionAbility.<br/>
* It is returned from onRemoteReady callback of UIExtensionComponent<br/>
@ -55,8 +77,20 @@ interface UIExtensionComponentInterface {
* @systemapi
* @since 10
*/
/**
* Construct the UIExtensionComponent.<br/>
* Called when the UIExtensionComponent is used.
*
* @param { import('../api/@ohos.app.ability.Want').default } want - indicates the want of UIExtensionAbility
* @param { UIExtensionOptions } [option] - Construction configuration of UIExtensionComponentAttribute
* @returns { UIExtensionComponentAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @systemapi
* @since 11
*/
(
want: import('../api/@ohos.app.ability.Want').default
want: import('../api/@ohos.app.ability.Want').default,
options?: UIExtensionOptions
): UIExtensionComponentAttribute;
}

View File

@ -211,6 +211,30 @@ declare enum CacheMode {
Only,
}
/**
* Enum type supplied to {@link overScrollMode} for setting the web overScroll mode.
*
* @enum { number }
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
declare enum OverScrollMode {
/**
* Disable the web over-scroll mode.
*
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
NEVER,
/**
* Enable the web over-scroll mode.
*
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
ALWAYS
}
/**
* Enum type supplied to {@link darkMode} for setting the web dark mode.
*
@ -2193,7 +2217,15 @@ declare class WebAttribute extends CommonMethod<WebAttribute> {
* @since 8
*/
overviewModeAccess(overviewModeAccess: boolean): WebAttribute;
/**
* Sets the over-scroll mode for web
*
* @param { OverScrollMode } mode - The over-scroll mode, which can be {@link OverScrollMode}.
* @returns { WebAttribute }
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
overScrollMode(mode: OverScrollMode): WebAttribute;
/**
* Sets the ratio of the text zoom.
*

333
api/@ohos.PiPWindow.d.ts vendored Normal file
View File

@ -0,0 +1,333 @@
/*
* Copyright (c) 2023 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 type AsyncCallback from './@ohos.base';
import type BaseContext from './application/BaseContext';
/**
* Picture In Picture Window Manager
*
* @namespace PiPWindow
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
declare namespace PiPWindow {
/**
* If picture-in-picture enabled in current OS.
*
* @returns { boolean } true if PictureInPicture enabled, otherwise false
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
function isPiPEnabled(): boolean;
/**
* Create picture-in-picture controller
*
* @param { PiPConfiguration } config - Params for picture-in-picture controller creation
* @returns { Promise<PiPController> } - The promise returned by the function
* @throws { BusinessError } 401 - Params error, invalid or illegal parameter in PiPConfiguration
* @throws { BusinessError } 801 - Capability not supported
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
function create(config: PiPConfiguration): Promise<PiPController>;
/**
* Create picture-in-picture controller
*
* @param { PiPConfiguration } config - Params for picture-in-picture controller creation
* @param { AsyncCallback<PiPController> } callback - Callback used to return the PiPController created
* @throws { BusinessError } 401 - Params error, invalid or illegal parameter in PiPConfiguration
* @throws { BusinessError } 801 - Capability not supported
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
function create(config: PiPConfiguration, callback: AsyncCallback<PiPController>): void;
/**
* PiPConfiguration
*
* @interface PiPConfiguration
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
interface PiPConfiguration {
/**
* Indicates window context.
*
* @type { BaseContext }
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
context: BaseContext;
/**
* Indicates the origin XComponentController.
*
* @type { XComponentController }
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
componentController: XComponentController;
/**
* Indicates navigation ID.
*
* @type { ?string }
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
navigationId?: string;
/**
* Picture-in-picture template type.
*
* @type { ?PiPTemplateType }
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
templateType?: PiPTemplateType;
/**
* Describes the width of content to be displayed in PiP window. For adjusting PiP window aspect ratio.
*
* @type { ?number }
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
contentWidth?: number;
/**
* Describes the height of content to be displayed in PiP window. For adjusting PiP window aspect ratio.
*
* @type { ?number }
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
contentHeight?: number;
}
/**
* Describe the type of picture-in-picture.
*
* @enum { number }.
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
enum PiPTemplateType {
/**
* Indicates the content to show in picture-in-picture window is video play
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
VIDEO_PLAY,
/**
* Indicates the content to show in picture-in-picture window is video call
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
VIDEO_CALL,
/**
* Indicates the content to show in picture-in-picture window is video meeting
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
VIDEO_MEETING,
}
/**
* Enum for PiP window callback event type.
*
* @enum { number }.
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
enum PiPState {
/**
* PiP window is about to start.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
ABOUT_TO_START = 1,
/**
* PiP window started.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
STARTED = 2,
/**
* PiP window is about to stop.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
ABOUT_TO_STOP = 3,
/**
* PiP window stopped.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
STOPPED = 4,
/**
* Restore the original page from PiP window
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
ABOUT_TO_RESTORE = 5,
/**
* Error message during start/stop.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
ERROR = 6,
}
/**
* Describe picture-in-picture action event type.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
type PiPActionEventType = PiPVideoActionEvent | PiPCallActionEvent | PiPMeetingActionEvent;
type PiPVideoActionEvent = 'playbackStateChanged' | 'nextVideo' | 'previousVideo';
type PiPCallActionEvent = 'hangUp';
type PiPMeetingActionEvent = 'hangUp';
/**
* PiPController
*
* @interface PiPController
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
interface PiPController {
/**
* Start picture-in-picture
* @returns { Promise<void> } - The promise returned by the function
* @throws { BusinessError } 1300012 - If PiP window state is abnormal.
* @throws { BusinessError } 1300013 - Create PiP window failed.
* @throws { BusinessError } 1300014 - Error when load PiP window content or show PiP window
* @throws { BusinessError } 1300015 - If window has created
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
startPiP(): Promise<void>;
/**
* Start picture-in-picture
* @param { AsyncCallback<void> } callback - Callback after PiP start finish
* @throws { BusinessError } 1300012 - If PiP window state is abnormal.
* @throws { BusinessError } 1300013 - Create PiP window failed.
* @throws { BusinessError } 1300014 - Error when load PiP window content or show PiP window
* @throws { BusinessError } 1300015 - If window has created
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
startPiP(callback: AsyncCallback<void>): void;
/**
* Stop picture-in-picture.
* @returns { Promise<void> } - The promise returned by the function.
* @throws { BusinessError } 1300011 - Stop PiP window failed.
* @throws { BusinessError } 1300012 - If PiP window state is abnormal.
* @throws { BusinessError } 1300015 - If window is stopping
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
stopPiP(): Promise<void>;
/**
* Stop picture-in-picture.
* @param { AsyncCallback<void> } callback - Callback after PiP stop finish
* @throws { BusinessError } 1300011 - Stop PiP window failed.
* @throws { BusinessError } 1300012 - If PiP window state is abnormal.
* @throws { BusinessError } 1300015 - If window is stopping
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
stopPiP(callback: AsyncCallback<void>): void;
/**
* Set if auto start picture-in-picture when back home
* @param { boolean } enable - Enable auto start picture-in-picture when back home
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
setAutoStartEnabled(enable: boolean): void;
/**
* Update source content size to adjust PiP window aspect ratio.
* @param { number } width - Indicates the width of the content.
* @param { number } height - Indicates the height of the content.
* @throws { BusinessError } 401 - Params error, invalid width or height.
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
updateContentSize(width: number, height: number): void;
/**
* Register picture-in-picture control event listener.
* @param { 'stateChange' } type - Registration type, PiP lifecycle state change, 'stateChange'
* @param { function } callback - Used to handle {'stateChange'} command
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
on(type: 'stateChange', callback: (state: PiPState, reason: string) => void): void;
/**
* Unregister picture-in-picture lifecycle event listener.
* @param { 'stateChange' } type - Used to unregister listener for {'stateChange'} command
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
off(type: 'stateChange'): void;
/**
* Register picture-in-picture control event listener.
* @param { 'controlPanelActionEvent' } type - Registration type, user action event, 'controlPanelActionEvent'
* @param { function } callback - Used to handle {'controlPanelActionEvent'} command
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
on(type: 'controlPanelActionEvent', callback: (event: PiPActionEventType) => void): void;
/**
* Unregister picture-in-picture lifecycle event listener
* @param { 'controlPanelActionEvent' } type - Used to unregister listener for {'controlPanelActionEvent'} command
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
off(type: 'controlPanelActionEvent'): void;
}
}
export default PiPWindow;

View File

@ -55,7 +55,7 @@ declare enum MatchPattern {
* @test
*/
/**
* Equals to a string.
* Contains a substring.
*
* @syscap SystemCapability.Test.UiTest
* @crossplatform

View File

@ -2605,6 +2605,48 @@ declare namespace osAccount {
* @since 10
*/
static getAccountInfo(options: GetDomainAccountInfoOptions): Promise<DomainAccountInfo>;
/**
* Gets the business access token of the current domain account.
*
* @param { object } businessParams - Indicates the business parameters.
* @param { AsyncCallback<Uint8Array> } callback - Indicates the result callback.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid business parameters.
* @throws { BusinessError } 12300003 - Domain account not found.
* @throws { BusinessError } 12300013 - Network exception.
* @throws { BusinessError } 12300014 - Domain account not authenticated.
* @throws { BusinessError } 12300111 - Operation timeout.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 11
*/
static getAccessToken(businessParams: { [key: string]: Object }, callback: AsyncCallback<Uint8Array>): void;
/**
* Gets the business access token for the current domain account.
*
* @param { object } businessParams - Indicates the business parameters.
* @returns { Promise<Uint8Array> } The promise returned by the function.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid business parameters.
* @throws { BusinessError } 12300003 - Domain account not found.
* @throws { BusinessError } 12300013 - Network exception.
* @throws { BusinessError } 12300014 - Domain account not authenticated.
* @throws { BusinessError } 12300111 - Operation timeout.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 11
*/
static getAccessToken(businessParams: { [key: string]: Object }): Promise<Uint8Array>;
}
/**

View File

@ -76,4 +76,17 @@ export default class InsightIntentExecutor {
*/
onExecuteInUIExtensionAbility(name: string, param: Record<string, Object>, pageLoader: UIExtensionContentSession):
insightIntent.ExecuteResult | Promise<insightIntent.ExecuteResult>;
/**
* Called when a ServiceExtensionAbility executes the insight intent.
*
* @param { string } name - Indicates the insight intent name.
* @param { Record<string, Object> } param - Indicates the insight intent parameters.
* @returns { insightIntent.ExecuteResult | Promise<insightIntent.ExecuteResult> } The result of insight intent execution, support promise.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @since 11
*/
onExecuteInServiceExtensionAbility(name: string, param: Record<string, Object>):
insightIntent.ExecuteResult | Promise<insightIntent.ExecuteResult>;
}

View File

@ -56,6 +56,20 @@ export default class UIExtensionContentSession {
*/
setReceiveDataCallback(callback: (data: { [key: string]: Object }) => void): void;
/**
* Sets the callback with return value for the ui extension to receive data from an ui extension component.
*
* @param { function } callback - Indicates the receive data callback to set.
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @throws { BusinessError } 16000050 - Internal error.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @StageModelOnly
* @since 11
*/
setReceiveDataForResultCallback(callback: (data: { [key: string]: Object }) => { [key: string]: Object }): void;
/**
* Loads an UI extension content.
*
@ -174,6 +188,111 @@ export default class UIExtensionContentSession {
*/
startAbility(want: Want, options?: StartOptions): Promise<void>;
/**
* Starts a new ability using the original caller information. If the caller application is in foreground,
* you can use this method to start ability; If the caller application is in the background,
* you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
* If the target ability is visible, you can start the target ability; If the target ability is invisible,
* you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
* If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
*
* @param { Want } want - Indicates the ability to start.
* @param { AsyncCallback<void> } callback - The callback of startAbility.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 202 - The application is not system-app, can not use system-api.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @throws { BusinessError } 16000001 - The specified ability does not exist.
* @throws { BusinessError } 16000002 - Incorrect ability type.
* @throws { BusinessError } 16000004 - Can not start invisible component.
* @throws { BusinessError } 16000005 - The specified process does not have the permission.
* @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
* @throws { BusinessError } 16000008 - The crowdtesting application expires.
* @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
* @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000012 - The application is controlled.
* @throws { BusinessError } 16000013 - The application is controlled by EDM.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
* @throws { BusinessError } 16000055 - Installation-free timed out.
* @throws { BusinessError } 16200001 - The caller has been released.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @StageModelOnly
* @since 11
*/
startAbilityAsCaller(want: Want, callback: AsyncCallback<void>): void;
/**
* Starts a new ability using the original caller information. If the caller application is in foreground,
* you can use this method to start ability; If the caller application is in the background,
* you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
* If the target ability is visible, you can start the target ability; If the target ability is invisible,
* you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
* If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
*
* @param { Want } want - Indicates the ability to start.
* @param { StartOptions } options - Indicates the start options.
* @param { AsyncCallback<void> } callback - The callback of startAbility.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 202 - The application is not system-app, can not use system-api.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @throws { BusinessError } 16000001 - The specified ability does not exist.
* @throws { BusinessError } 16000004 - Can not start invisible component.
* @throws { BusinessError } 16000005 - The specified process does not have the permission.
* @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
* @throws { BusinessError } 16000008 - The crowdtesting application expires.
* @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000012 - The application is controlled.
* @throws { BusinessError } 16000013 - The application is controlled by EDM.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
* @throws { BusinessError } 16000055 - Installation-free timed out.
* @throws { BusinessError } 16200001 - The caller has been released.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @StageModelOnly
* @since 11
*/
startAbilityAsCaller(want: Want, options: StartOptions, callback: AsyncCallback<void>): void;
/**
* Starts a new ability using the original caller information. If the caller application is in foreground,
* you can use this method to start ability; If the caller application is in the background,
* you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
* If the target ability is visible, you can start the target ability; If the target ability is invisible,
* you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability.
* If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC.
*
* @param { Want } want - Indicates the ability to start.
* @param { StartOptions } [options] - Indicates the start options.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 202 - The application is not system-app, can not use system-api.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @throws { BusinessError } 16000001 - The specified ability does not exist.
* @throws { BusinessError } 16000002 - Incorrect ability type.
* @throws { BusinessError } 16000004 - Can not start invisible component.
* @throws { BusinessError } 16000005 - The specified process does not have the permission.
* @throws { BusinessError } 16000006 - Cross-user operations are not allowed.
* @throws { BusinessError } 16000008 - The crowdtesting application expires.
* @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
* @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000012 - The application is controlled.
* @throws { BusinessError } 16000013 - The application is controlled by EDM.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000053 - The ability is not on the top of the UI.
* @throws { BusinessError } 16000055 - Installation-free timed out.
* @throws { BusinessError } 16200001 - The caller has been released.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @StageModelOnly
* @since 11
*/
startAbilityAsCaller(want: Want, options?: StartOptions): Promise<void>;
/**
* Starts an ability and returns the execution result when the ability is destroyed.
* If the caller application is in foreground, you can use this method to start ability; If the caller application

View File

@ -57,6 +57,16 @@ declare namespace insightIntent {
* @since 11
*/
UI_EXTENSION_ABILITY = 2,
/**
* ServiceExtensionAbility.
*
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @StageModelOnly
* @since 11
*/
SERVICE_EXTENSION_ABILITY = 3,
}
/**

View File

@ -14,6 +14,7 @@
*/
/// <reference path="../component/common.d.ts" />
/// <reference path="../component/enums.d.ts" />
/// <reference path="../component/action_sheet.d.ts" />
/// <reference path="../component/alert_dialog.d.ts" />
/// <reference path="../component/date_picker.d.ts" />
@ -28,6 +29,7 @@ import router from './@ohos.router';
import type componentUtils from './@ohos.arkui.componentUtils';
import type { AnimatorOptions, AnimatorResult } from './@ohos.animator';
import type { AsyncCallback } from './@ohos.base';
import type { Color, FontStyle, Nullable } from 'CommonEnums';
import { AnimateParam } from 'AnimateToParam';
import { ActionSheetOptions } from 'actionSheetParam';
import { AlertDialogParamWithConfirm, AlertDialogParamWithButtons, DialogAlignment, DialogButtonDirection, AlertDialogParamWithOptions } from 'AlertDialogParam';
@ -511,6 +513,60 @@ export class ComponentUtils {
getRectangleById(id: string): componentUtils.ComponentInfo;
}
/**
* interface AtomicServiceBar
* @interface AtomicServiceBar
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
export interface AtomicServiceBar {
/**
* Set the visibility of the bar, except the icon.
*
* @param { boolean } visible - whether this bar is visible.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 11
*/
setVisible(visible: boolean): void;
/**
* Set the background color of the bar.
*
* @param { Nullable< Color | number | string> } color - the color to set, undefined indicates using default.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 11
*/
setBackgroundColor(color: Nullable< Color | number | string>): void;
/**
* Set the title of the bar.
*
* @param { string } content - the content of the bar.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 11
*/
setTitleContent(content: string): void;
/**
* Set the font style of the bar's title.
*
* @param { FontStyle } font - the font style of the bar's title.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 11
*/
setTitleFontStyle(font: FontStyle): void;
/**
* Set the color of the icon on the bar.
*
* @param { Nullable< Color | number | string> } color - the color to set to icon, undefined indicates using default.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 11
*/
setIconColor(color: Nullable< Color | number | string>): void;
}
/**
* class UIContext
*
@ -538,7 +594,7 @@ export class UIContext {
* @since 10
*/
getMediaQuery(): MediaQuery;
/**
* get object UIInspector.
* @returns { UIInspector } object UIInspector.
@ -678,6 +734,15 @@ export class UIContext {
* @since 11
*/
getKeyboardAvoidMode(): KeyboardAvoidMode;
/**
* Get AtomicServiceBar.
* @returns { Nullable<AtomicServiceBar> } The atomic service bar.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
getAtomicServiceBar(): Nullable<AtomicServiceBar>;
}
/**

View File

@ -135,6 +135,180 @@ declare namespace ble {
*/
function stopAdvertising(): void;
/**
* Starts BLE advertising.
* The API returns a advertising ID. The ID can be used to temporarily enable or disable this advertising
* using the API {@link enableAdvertising} or {@link disableAdvertising}.
* To completely stop the advertising corresponding to the ID, invoke the API {@link stopAdvertising} with ID.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { AdvertisingParams } advertisingParams - Indicates the params for BLE advertising.
* @param { AsyncCallback<number> } callback - the callback of advertise ID.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900003 - Bluetooth switch is off.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
function startAdvertising(advertisingParams: AdvertisingParams, callback: AsyncCallback<number>): void;
/**
* Starts BLE advertising.
* The API returns a advertising ID. The ID can be used to temporarily enable or disable this advertising
* using the API {@link enableAdvertising} or {@link disableAdvertising}.
* To completely stop the advertising corresponding to the ID, invoke the API {@link stopAdvertising} with ID.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { AdvertisingParams } advertisingParams - Indicates the param for BLE advertising.
* @returns { Promise<number> } Returns the promise object.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900003 - Bluetooth switch is off.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
function startAdvertising(advertisingParams: AdvertisingParams): Promise<number>;
/**
* Enable the advertising with a specific ID temporarily.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { AdvertisingEnableParams } advertisingEnableParams - Indicates the params for enable advertising.
* @param { AsyncCallback<void> } callback - the callback result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900003 - Bluetooth switch is off.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
function enableAdvertising(advertisingEnableParams: AdvertisingEnableParams, callback: AsyncCallback<void>): void;
/**
* Enable the advertising with a specific ID temporarily.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { AdvertisingEnableParams } advertisingEnableParams - Indicates the params for enable advertising.
* @returns { Promise<void> } Returns the promise object.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900003 - Bluetooth switch is off.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
function enableAdvertising(advertisingEnableParams: AdvertisingEnableParams): Promise<void>;
/**
* Disable the advertising with a specific ID temporarily.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { AdvertisingDisableParams } advertisingDisableParams - Indicates the params for disable advertising.
* @param { AsyncCallback<void> } callback - the callback result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900003 - Bluetooth switch is off.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
function disableAdvertising(advertisingDisableParams: AdvertisingDisableParams, callback: AsyncCallback<void>): void;
/**
* Disable the advertising with a specific ID temporarily.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { AdvertisingDisableParams } advertisingDisableParams - Indicates the params for disable advertising.
* @returns { Promise<void> } Returns the promise object.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900003 - Bluetooth switch is off.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
function disableAdvertising(advertisingDisableParams: AdvertisingDisableParams): Promise<void>;
/**
* Stops BLE advertising.
* Completely stop the advertising corresponding to the ID.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { number } advertisingId - Indicates the ID for this BLE advertising.
* @param { AsyncCallback<void> } callback - the callback result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900003 - Bluetooth switch is off.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
function stopAdvertising(advertisingId: number, callback: AsyncCallback<void>): void;
/**
* Stops BLE advertising.
* Completely stop the advertising corresponding to the ID.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { number } advertisingId - Indicates the ID for this BLE advertising.
* @returns { Promise<void> } Returns the promise object.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900003 - Bluetooth switch is off.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
function stopAdvertising(advertisingId: number): Promise<void>;
/**
* Subscribing to advertising state change event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'advertisingStateChange' } type - Type of the advertising state to listen for.
* @param { Callback<AdvertisingStateChangeInfo> } callback - Callback used to listen for the advertising state.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
function on(type: 'advertisingStateChange', callback: Callback<AdvertisingStateChangeInfo>): void;
/**
* Unsubscribe from advertising state change event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'advertisingStateChange' } type - Type of the advertising state to listen for.
* @param { Callback<AdvertisingStateChangeInfo> } callback - Callback used to listen for the advertising state.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
function off(type: 'advertisingStateChange', callback?: Callback<AdvertisingStateChangeInfo>): void;
/**
* Subscribe BLE scan result.
*
@ -1494,6 +1668,122 @@ declare namespace ble {
includeDeviceName?: boolean;
}
/**
* Describes the advertising parameters.
*
* @typedef AdvertisingParams
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
interface AdvertisingParams {
/**
* Indicates the advertising settings.
*
* @type { AdvertiseSetting }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
advertisingSettings: AdvertiseSetting;
/**
* Indicates the advertising data.
*
* @type { AdvertiseData }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
advertisingData: AdvertiseData;
/**
* Indicates the advertising response.
*
* @type { ?AdvertiseData }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
advertisingResponse?: AdvertiseData;
/**
* Indicates the duration for advertising continuously.
* The duration, in 10ms unit. Valid range is from 1 (10ms) to 65535 (655,350 ms).
* If this parameter is not specified or is set to 0, advertisement is continuously sent.
*
* @type { ?number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
duration?: number;
}
/**
* Parameter for dynamically enable advertising.
*
* @typedef AdvertisingEnableParams
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
interface AdvertisingEnableParams {
/**
* Indicates the ID of current advertising.
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
advertisingId: number;
/**
* Indicates the duration for advertising continuously.
* The duration, in 10ms unit. Valid range is from 1 (10ms) to 65535 (655,350 ms).
* If this parameter is not specified or is set to 0, advertise is continuously sent.
*
* @type { ?number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
duration?: number;
}
/**
* Parameter for dynamically disable advertising.
*
* @typedef AdvertisingDisableParams
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
interface AdvertisingDisableParams {
/**
* Indicates the ID of current advertising.
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
advertisingId: number;
}
/**
* Advertising state change information.
*
* @typedef AdvertisingStateChangeInfo
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
interface AdvertisingStateChangeInfo {
/**
* Indicates the ID of current advertising.
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
advertisingId: number;
/**
* Indicates the advertising state.
*
* @type { AdvertisingState }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
state: AdvertisingState;
}
/**
* Describes the manufacturer data.
*
@ -1793,6 +2083,44 @@ declare namespace ble {
*/
MATCH_MODE_STICKY = 2
}
/**
* The enum of BLE advertising state.
*
* @enum { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
enum AdvertisingState {
/**
* advertising started.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
STARTED = 1,
/**
* advertising temporarily enabled.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
ENABLED = 2,
/**
* advertising temporarily disabled.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
DISABLED = 3,
/**
* advertising stopped.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
STOPPED = 4
}
}
export default ble;

View File

@ -303,6 +303,23 @@ declare namespace connection {
*/
function getPairedDevices(): Array<string>;
/**
* Obtains the pair state of a specified device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
* @returns { BondState } Returns the pair state.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900003 - Bluetooth switch is off.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
function getPairState(deviceId: string): BondState;
/**
* Sets the confirmation of pairing with a certain device.
*
@ -432,6 +449,21 @@ declare namespace connection {
*/
function stopBluetoothDiscovery(): void;
/**
* Check if bluetooth is discovering.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @returns { boolean } Returns {@code true} if the local device is discovering; returns {@code false} otherwise.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900003 - Bluetooth switch is off.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
function isBluetoothDiscovering(): boolean;
/**
* Obtains the profile UUIDs supported by the local device.
*

View File

@ -805,6 +805,23 @@ declare namespace bundleManager {
INTENT_PROFILE = 1
}
/**
* Used to query the specified value in applicationReservedFlag.
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 11
*/
export enum ApplicationReservedFlag {
/**
* Used to query whether the application is encrypted.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 11
*/
ENCRYPTED_APPLICATION = 0x00000001,
}
/**
* Obtains own bundleInfo.
*

View File

@ -0,0 +1,189 @@
/*
* Copyright (c) 2023 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 type { AsyncCallback } from './@ohos.base';
import type { BundleResourceInfo as _BundleResourceInfo } from './bundleManager/BundleResourceInfo';
import type { LauncherAbilityResourceInfo as _LauncherAbilityResourceInfo } from './bundleManager/LauncherAbilityResourceInfo';
/**
* This module is used to obtain bundle resource information of various applications installed on the current device.
*
* @namespace bundleResourceManager
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
declare namespace bundleResourceManager {
/**
* Used to query the enumeration value of resource info. Multiple values can be passed in the form.
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
enum ResourceFlag {
/**
* Used to obtain the all resource info.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
GET_RESOURCE_INFO_ALL = 0x00000001,
/**
* Used to obtained the label resource info.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
GET_RESOURCE_INFO_WITH_LABEL = 0x00000002,
/**
* Used to obtained the icon resource info.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
GET_RESOURCE_INFO_WITH_ICON = 0x00000004,
/**
* Used to obtain the resource info sorted by label.
* It can't be used alone, it needs to be used with GET_RESOURCE_INFO_ALL or GET_RESOURCE_INFO_WITH_LABEL.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
GET_RESOURCE_INFO_WITH_SORTED_BY_LABEL = 0x00000008
}
/**
* Obtains the BundleResourceInfo of a specified bundle. Default resourceFlag is GET_RESOURCE_INFO_ALL.
*
* @permission ohos.permission.GET_BUNDLE_RESOURCES
* @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs.
* @param { number } resourceFlags - Indicates the flag used to specify information contained in the BundleResourceInfo object that will be returned.
* @returns { BundleResourceInfo } Returns the BundleResourceInfo object.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 17700001 - The specified bundleName is not found.
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
function getBundleResourceInfo(bundleName: string, resourceFlags?: number): BundleResourceInfo;
/**
* Obtains the LauncherAbilityResourceInfo of a specified ability. Default resourceFlag is GET_RESOURCE_INFO_ALL.
*
* @permission ohos.permission.GET_BUNDLE_RESOURCES
* @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs.
* @param { number } resourceFlags - Indicates the flag used to specify information contained in the LauncherAbilityResourceInfo object that will be returned.
* @returns { Array<LauncherAbilityResourceInfo> } Returns a list of LauncherAbilityResourceInfo objects.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 17700001 - The specified bundleName is not found.
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
function getLauncherAbilityResourceInfo(bundleName: string, resourceFlags?: number): Array<LauncherAbilityResourceInfo>;
/**
* Obtains BundleResourceInfo of all bundles available in the system.
*
* @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST and ohos.permission.GET_BUNDLE_RESOURCES
* @param { number } resourceFlags - Indicates the flag used to specify information contained in the BundleResourceInfo that will be returned.
* @param { AsyncCallback<Array<BundleResourceInfo>> } callback - The callback of getting a list of BundleResourceInfo objects.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
function getAllBundleResourceInfo(resourceFlags: number, callback: AsyncCallback<Array<BundleResourceInfo>>): void;
/**
* Obtains BundleResourceInfo of all bundles available in the system.
*
* @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST and ohos.permission.GET_BUNDLE_RESOURCES
* @param { number } resourceFlags - Indicates the flag used to specify information contained in the BundleResourceInfo that will be returned.
* @returns { Promise<Array<BundleResourceInfo>> } Returns a list of BundleResourceInfo objects.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
function getAllBundleResourceInfo(resourceFlags: number): Promise<Array<BundleResourceInfo>>;
/**
* Obtains LauncherAbilityResourceInfo of all launcher abilities available in the system.
*
* @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST and ohos.permission.GET_BUNDLE_RESOURCES
* @param { number } resourceFlags - Indicates the flag used to specify information contained in the LauncherAbilityResourceInfo that will be returned.
* @param { AsyncCallback<Array<LauncherAbilityResourceInfo>> } callback - The callback of getting a list of LauncherAbilityResourceInfo objects.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
function getAllLauncherAbilityResourceInfo(resourceFlags: number, callback: AsyncCallback<Array<LauncherAbilityResourceInfo>>): void;
/**
* Obtains LauncherAbilityResourceInfo of all launcher abilities available in the system.
*
* @permission ohos.permission.GET_INSTALLED_BUNDLE_LIST and ohos.permission.GET_BUNDLE_RESOURCES
* @param { number } resourceFlags - Indicates the flag used to specify information contained in the LauncherAbilityResourceInfo that will be returned.
* @returns { Promise<Array<LauncherAbilityResourceInfo>> } Returns a list of LauncherAbilityResourceInfo objects.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
function getAllLauncherAbilityResourceInfo(resourceFlags: number): Promise<Array<LauncherAbilityResourceInfo>>;
/**
* Obtains resource info of a bundle.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
export type BundleResourceInfo = _BundleResourceInfo;
/**
* Obtains resource info of a ability.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
export type LauncherAbilityResourceInfo = _LauncherAbilityResourceInfo;
}
export default bundleResourceManager;

View File

@ -112,6 +112,17 @@ declare namespace commonEventManager {
* @syscap SystemCapability.Notification.CommonEvent
* @since 9
*/
/**
* Creates a CommonEventSubscriber for the SubscriberInfo.
*
* @param { CommonEventSubscribeInfo } subscribeInfo - Indicates the information of the subscriber.
* @param { AsyncCallback<CommonEventSubscriber> } callback - The callback is used to return the
* CommonEventSubscriber object.
* @throws { BusinessError } 401 - parameter error
* @syscap SystemCapability.Notification.CommonEvent
* @crossplatform
* @since 11
*/
function createSubscriber(
subscribeInfo: CommonEventSubscribeInfo,
callback: AsyncCallback<CommonEventSubscriber>
@ -126,6 +137,16 @@ declare namespace commonEventManager {
* @syscap SystemCapability.Notification.CommonEvent
* @since 9
*/
/**
* Creates a CommonEventSubscriber for the SubscriberInfo.
*
* @param { CommonEventSubscribeInfo } subscribeInfo - Indicates the information of the subscriber.
* @returns { Promise<CommonEventSubscriber> } Returns the CommonEventSubscriber object.
* @throws { BusinessError } 401 - parameter error
* @syscap SystemCapability.Notification.CommonEvent
* @crossplatform
* @since 11
*/
function createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise<CommonEventSubscriber>;
/**
@ -151,6 +172,19 @@ declare namespace commonEventManager {
* @syscap SystemCapability.Notification.CommonEvent
* @since 9
*/
/**
* Subscribe an ordered, sticky, or standard common event.
*
* @param { CommonEventSubscriber } subscriber - Indicate the subscriber of the common event.
* @param { AsyncCallback<CommonEventData> } callback - The callback is used to return the CommonEventData object.
* @throws { BusinessError } 401 - parameter error
* @throws { BusinessError } 801 - capability not supported
* @throws { BusinessError } 1500007 - error sending message to Common Event Service
* @throws { BusinessError } 1500008 - Common Event Service does not complete initialization
* @syscap SystemCapability.Notification.CommonEvent
* @crossplatform
* @since 11
*/
function subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback<CommonEventData>): void;
/**
@ -165,6 +199,19 @@ declare namespace commonEventManager {
* @syscap SystemCapability.Notification.CommonEvent
* @since 9
*/
/**
* Unsubscribe from an ordered, sticky, or standard common event.
*
* @param { CommonEventSubscriber } subscriber - Indicate the subscriber of the common event.
* @param { AsyncCallback<void> } [callback] - The callback of unsubscribe.
* @throws { BusinessError } 401 - parameter error
* @throws { BusinessError } 801 - capability not supported
* @throws { BusinessError } 1500007 - error sending message to Common Event Service
* @throws { BusinessError } 1500008 - Common Event Service does not complete initialization
* @syscap SystemCapability.Notification.CommonEvent
* @crossplatform
* @since 11
*/
function unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback<void>): void;
/**
@ -1815,7 +1862,7 @@ declare namespace commonEventManager {
/**
* Indicates the action of a common event that the network connectivity changed.
* This is a protected common event that can only be sent by system.
*
*
* @syscap SystemCapability.Notification.CommonEvent
* @since 10
*/
@ -1834,7 +1881,7 @@ declare namespace commonEventManager {
/**
* Indicates the action of a common event that audio quality change.
* This is a protected common event that can only be sent by system.
*
*
* @syscap SystemCapability.Notification.CommonEvent
* @systemapi
* @since 10

View File

@ -33,6 +33,16 @@ import Context from './application/BaseContext';
* @since 10
* @name preferences
*/
/**
* Provides interfaces to obtain and modify preferences data.
*
* @namespace preferences
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
* @name preferences
*/
declare namespace preferences {
/**
* Indicates possible value types
@ -46,6 +56,13 @@ declare namespace preferences {
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @since 10
*/
/**
* Indicates possible value types
*
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @atomicservice
* @since 11
*/
type ValueType = number | string | boolean | Array<number> | Array<string> | Array<boolean>;
/**
@ -63,6 +80,15 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Indicates the maximum length of a key (80 characters).
*
* @constant
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
const MAX_KEY_LENGTH: 80;
/**
@ -80,6 +106,15 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Indicates the maximum length of a string (8192 characters).
*
* @constant
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
const MAX_VALUE_LENGTH: 8192;
/**
@ -90,6 +125,15 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Manages preferences file configurations.
*
* @interface Options
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
interface Options {
/**
* The preferences file name.
@ -98,6 +142,14 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* The preferences file name.
*
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
name: string;
/**
@ -107,6 +159,14 @@ declare namespace preferences {
* @StageModelOnly
* @since 10
*/
/**
* Application Group Id.
*
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @StageModelOnly
* @atomicservice
* @since 11
*/
dataGroupId?: string;
}
@ -137,6 +197,21 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Obtains a {@link Preferences} instance matching a specified preferences file name.
* <p>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 } context - Indicates the context of application or capability.
* @param { string } name - Indicates the preferences file name.
* @param { AsyncCallback<Preferences> } callback - The {@link Preferences} instance matching the specified
* preferences file name.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function getPreferences(context: Context, name: string, callback: AsyncCallback<Preferences>): void;
/**
@ -156,6 +231,24 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Obtains a {@link Preferences} instance matching a specified preferences file name.
* <p>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 } context - Indicates the context of application or capability.
* @param { Options } options - Indicates the {@link Options} option of preferences file position.
* @param { AsyncCallback<Preferences> } callback - The {@link Preferences} instance matching the specified
* preferences file name.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 15501001 - Only supported in stage mode.
* @throws { BusinessError } 15501002 - The data group id is not valid.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function getPreferences(context: Context, options: Options, callback: AsyncCallback<Preferences>): void;
/**
@ -183,6 +276,20 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Obtains a {@link Preferences} instance matching a specified preferences file name.
* <p>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 } context - Indicates the context of application or capability.
* @param { string } name - Indicates the preferences file name.
* @returns { Promise<Preferences> } The {@link Preferences} instance matching the specified preferences file name.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function getPreferences(context: Context, name: string): Promise<Preferences>;
/**
@ -201,6 +308,23 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Obtains a {@link Preferences} instance matching a specified preferences file name.
* <p>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 } context - Indicates the context of application or capability.
* @param { Options } options - Indicates the {@link Options} option of preferences file position.
* @returns { Promise<Preferences> } The {@link Preferences} instance matching the specified preferences file name.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 15501001 - Only supported in stage mode.
* @throws { BusinessError } 15501002 - The data group id is not valid.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function getPreferences(context: Context, options: Options): Promise<Preferences>;
/**
@ -220,6 +344,24 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Obtains a {@link Preferences} instance matching a specified preferences file name.
* This interface is executed synchronously.
* <p>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 } context - Indicates the context of application or capability.
* @param { Options } options - Indicates the {@link Options} option of preferences file position.
* @returns { Preferences } The {@link Preferences} instance matching the specified preferences file name.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 15501001 - Only supported in stage mode.
* @throws { BusinessError } 15501002 - The data group id is not valid.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function getPreferencesSync(context: Context, options: Options): Preferences;
/**
@ -255,6 +397,24 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Deletes a {@link Preferences} instance matching a specified preferences file name
* from the cache which is performed by removePreferencesFromCache and deletes the
* preferences file.
* <p>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 } context - Indicates the context of application or capability.
* @param { string } name - Indicates the preferences file name.
* @param { AsyncCallback<void> } callback - Indicates the callback function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 15500010 - Failed to delete preferences file.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function deletePreferences(context: Context, name: string, callback: AsyncCallback<void>): void;
/**
@ -277,6 +437,27 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Deletes a {@link Preferences} instance matching a specified preferences file name
* from the cache which is performed by removePreferencesFromCache and deletes the
* preferences file.
* <p>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 } context - Indicates the context of application or capability.
* @param { Options } options - Indicates the {@link Options} option of preferences file position.
* @param { AsyncCallback<void> } callback - Indicates the callback function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 15500010 - Failed to delete preferences file.
* @throws { BusinessError } 15501001 - Only supported in stage mode.
* @throws { BusinessError } 15501002 - The data group id is not valid.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function deletePreferences(context: Context, options: Options, callback: AsyncCallback<void>): void;
/**
@ -312,6 +493,24 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Deletes a {@link Preferences} instance matching a specified preferences file name
* from the cache which is performed by removePreferencesFromCache and deletes the
* preferences file.
* <p>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 } context - Indicates the context of application or capability.
* @param { string } name - Indicates the preferences file name.
* @returns { Promise<void> } A promise object.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 15500010 - Failed to delete preferences file.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function deletePreferences(context: Context, name: string): Promise<void>;
/**
@ -334,6 +533,27 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Deletes a {@link Preferences} instance matching a specified preferences file name
* from the cache which is performed by removePreferencesFromCache and deletes the
* preferences file.
* <p>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 } context - Indicates the context of application or capability.
* @param { Options } options - Indicates the {@link Options} option of preferences file position.
* @returns { Promise<void> } A promise object.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 15500010 - Failed to delete preferences file.
* @throws { BusinessError } 15501001 - Only supported in stage mode.
* @throws { BusinessError } 15501002 - The data group id is not valid.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function deletePreferences(context: Context, options: Options): Promise<void>;
/**
@ -365,6 +585,22 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Deletes a {@link Preferences} instance matching a specified preferences file name
* from the cache.
* <p>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 } context - Indicates the context of application or capability.
* @param { string } name - Indicates the preferences file name.
* @param { AsyncCallback<void> } callback - Indicates the callback function.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function removePreferencesFromCache(context: Context, name: string, callback: AsyncCallback<void>): void;
/**
@ -385,6 +621,25 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Deletes a {@link Preferences} instance matching a specified preferences file name
* from the cache.
* <p>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 } context - Indicates the context of application or capability.
* @param { Options } options - Indicates the {@link Options} option of preferences file position.
* @param { AsyncCallback<void> } callback - Indicates the callback function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 15501001 - Only supported in stage mode.
* @throws { BusinessError } 15501002 - The data group id is not valid.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function removePreferencesFromCache(context: Context, options: Options, callback: AsyncCallback<void>): void;
/**
@ -416,6 +671,22 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Deletes a {@link Preferences} instance matching a specified preferences file name
* from the cache.
* <p>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 } context - Indicates the context of application or capability.
* @param { string } name - Indicates the preferences file name.
* @returns { Promise<void> } A promise object.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function removePreferencesFromCache(context: Context, name: string): Promise<void>;
/**
@ -436,6 +707,25 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Deletes a {@link Preferences} instance matching a specified preferences file name
* from the cache.
* <p>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 } context - Indicates the context of application or capability.
* @param { Options } options - Indicates the {@link Options} option of preferences file position.
* @returns { Promise<void> } A promise object.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 15501001 - Only supported in stage mode.
* @throws { BusinessError } 15501002 - The data group id is not valid.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function removePreferencesFromCache(context: Context, options: Options): Promise<void>;
/**
@ -452,6 +742,21 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Deletes a {@link Preferences} instance matching a specified preferences file name
* from the cache. This interface is executed synchronously.
* <p>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 } context - Indicates the context of application or capability.
* @param { string } name - Indicates the preferences file name.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function removePreferencesFromCacheSync(context: Context, name: string): void;
/**
@ -471,6 +776,24 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Deletes a {@link Preferences} instance matching a specified preferences file name
* from the cache. This interface is executed synchronously.
* <p>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 } context - Indicates the context of application or capability.
* @param { Options } options - Indicates the {@link Options} option of preferences file position.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 15501001 - Only supported in stage mode.
* @throws { BusinessError } 15501002 - The data group id is not valid.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
function removePreferencesFromCacheSync(context: Context, options: Options): void;
/**
@ -496,6 +819,19 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Provides interfaces to obtain and modify preferences data.
* <p>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 movePreferencesFromCache
* to remove the {@link Preferences} instance from the memory.
*
* @interface Preferences
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
interface Preferences {
/**
* Obtains the value of a preferences in the ValueType format.
@ -522,6 +858,20 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Obtains the value of a preferences in the ValueType format.
* <p>If the value is {@code null} or not in the ValueType format, the default value is returned.
*
* @param { string } key - Indicates the key of the preferences. It cannot be {@code null} or empty.
* @param { ValueType } defValue - Indicates the default value to return.
* @param { AsyncCallback<ValueType> } callback - The value matching the specified key if it is found;
* returns the default value otherwise.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
get(key: string, defValue: ValueType, callback: AsyncCallback<ValueType>): void;
/**
@ -549,6 +899,20 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Obtains the value of a preferences in the ValueType format.
* <p>If the value is {@code null} or not in the ValueType format, the default value is returned.
*
* @param { string } key - Indicates the key of the preferences. It cannot be {@code null} or empty.
* @param { ValueType } defValue - Indicates the default value to return.
* @returns { Promise<ValueType> } The value matching the specified key if it is found;
* returns the default value otherwise.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
get(key: string, defValue: ValueType): Promise<ValueType>;
/**
@ -564,6 +928,20 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Obtains the value of a preferences in the ValueType format. This interface is executed synchronously.
* <p>If the value is {@code null} or not in the ValueType format, the default value is returned.
*
* @param { string } key - Indicates the key of the preferences. It cannot be {@code null} or empty.
* @param { ValueType } defValue - Indicates the default value to return.
* @returns { ValueType } The value matching the specified key if it is found;
* returns the default value otherwise.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
getSync(key: string, defValue: ValueType): ValueType;
/**
@ -583,6 +961,16 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Obtains all the keys and values of a preferences in an object.
*
* @param { AsyncCallback<Object> } callback - The values and keys in an object.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
getAll(callback: AsyncCallback<Object>): void;
/**
@ -602,6 +990,16 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Obtains all the keys and values of a preferences in an object.
*
* @returns { Promise<Object> } The values and keys in an object.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
getAll(): Promise<Object>;
/**
@ -614,6 +1012,17 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Obtains all the keys and values of a preferences in an object. This interface
* is executed synchronously.
*
* @returns { Object } The values and keys in an object.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
getAllSync(): Object;
/**
@ -637,6 +1046,18 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Checks whether the {@link Preferences} object contains a preferences matching a specified key.
*
* @param { string } key - Indicates the key of the preferences to modify. It cannot be {@code null} or empty.
* @param { AsyncCallback<boolean> } callback - {@code true} if the {@link Preferences} object contains a preferences
* with the specified key;returns {@code false} otherwise.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
has(key: string, callback: AsyncCallback<boolean>): void;
/**
@ -660,6 +1081,18 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Checks whether the {@link Preferences} object contains a preferences matching a specified key.
*
* @param { string } key - Indicates the key of the preferences to modify. It cannot be {@code null} or empty.
* @returns { Promise<boolean> } {@code true} if the {@link Preferences} object contains
* a preferences with the specified key; returns {@code false} otherwise.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
has(key: string): Promise<boolean>;
/**
@ -674,6 +1107,19 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Checks whether the {@link Preferences} object contains a preferences matching a specified key. This interface
* is executed synchronously.
*
* @param { string } key - Indicates the key of the preferences to modify. It cannot be {@code null} or empty.
* @returns { boolean } {@code true} if the {@link Preferences} object contains
* a preferences with the specified key; returns {@code false} otherwise.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
hasSync(key: string): boolean;
/**
@ -703,6 +1149,21 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Sets an int value for the key in the {@link Preferences} object.
* <p>You can call the {@link #flush} method to save the {@link Preferences} object to the
* file.
*
* @param { string } key - Indicates the key of the preferences to modify. It cannot be {@code null} or empty.
* @param { ValueType } value - Indicates the value of the preferences.
* <tt>MAX_KEY_LENGTH</tt>.
* @param { AsyncCallback<void> } callback - Indicates the callback function.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
put(key: string, value: ValueType, callback: AsyncCallback<void>): void;
/**
@ -732,6 +1193,21 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Sets an int value for the key in the {@link Preferences} object.
* <p>You can call the {@link #flush} method to save the {@link Preferences} object to the
* file.
*
* @param { string } key - Indicates the key of the preferences to modify. It cannot be {@code null} or empty.
* @param { ValueType } value - Indicates the value of the preferences.
* <tt>MAX_KEY_LENGTH</tt>.
* @returns { Promise<void> } A promise object.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
put(key: string, value: ValueType): Promise<void>;
/**
@ -747,6 +1223,20 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Sets an int value for the key in the {@link Preferences} object. This interface is executed synchronously.
* <p>You can call the {@link #flush} method to save the {@link Preferences} object to the
* file.
*
* @param { string } key - Indicates the key of the preferences to modify. It cannot be {@code null} or empty.
* @param { ValueType } value - Indicates the value of the preferences.
* <tt>MAX_KEY_LENGTH</tt>.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
putSync(key: string, value: ValueType): void;
/**
@ -774,6 +1264,20 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Deletes the preferences with a specified key from the {@link Preferences} object.
* <p>You can call the {@link #flush} method to save the {@link Preferences} object to the
* file.
*
* @param { string } key - Indicates the key of the preferences to delete. It cannot be {@code null} or empty.
* <tt>MAX_KEY_LENGTH</tt>.
* @param { AsyncCallback<void> } callback - Indicates the callback function.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
delete(key: string, callback: AsyncCallback<void>): void;
/**
@ -801,6 +1305,20 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Deletes the preferences with a specified key from the {@link Preferences} object.
* <p>You can call the {@link #flush} method to save the {@link Preferences} object to the
* file.
*
* @param { string } key - Indicates the key of the preferences to delete. It cannot be {@code null} or empty.
* <tt>MAX_KEY_LENGTH</tt>.
* @returns { Promise<void> } A promise object.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
delete(key: string): Promise<void>;
/**
@ -815,6 +1333,19 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Deletes the preferences with a specified key from the {@link Preferences} object. This interface is
* executed synchronously. <p>You can call the {@link #flush} method to save the {@link Preferences}
* object to the file.
*
* @param { string } key - Indicates the key of the preferences to delete. It cannot be {@code null} or empty.
* <tt>MAX_KEY_LENGTH</tt>.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
deleteSync(key: string): void;
/**
@ -834,6 +1365,16 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Clears all preferences from the {@link Preferences} object.
* <p>You can call the {@link #flush} method to save the {@link Preferences} object to the file.
*
* @param { AsyncCallback<void> } callback - Indicates the callback function.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
clear(callback: AsyncCallback<void>): void;
/**
@ -853,6 +1394,16 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Clears all preferences from the {@link Preferences} object.
* <p>You can call the {@link #flush} method to save the {@link Preferences} object to the file.
*
* @returns { Promise<void> } A promise object.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
clear(): Promise<void>;
/**
@ -863,6 +1414,15 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Clears all preferences from the {@link Preferences} object. This interface is executed synchronously.
* <p>You can call the {@link #flush} method to save the {@link Preferences} object to the file.
*
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
clearSync(): void;
/**
@ -880,6 +1440,15 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Asynchronously saves the {@link Preferences} object to the file.
*
* @param { AsyncCallback<void> } callback - Indicates the callback function.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
flush(callback: AsyncCallback<void>): void;
/**
@ -897,6 +1466,15 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Asynchronously saves the {@link Preferences} object to the file.
*
* @returns { Promise<void> } A promise object.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
flush(): Promise<void>;
/**
@ -918,6 +1496,17 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Registers an observer to listen for the change of a {@link Preferences} object.
*
* @param { 'change' } type - Indicates the callback when preferences changes.
* @param { Function } callback - Indicates the callback function.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
on(type: 'change', callback: (key: string) => void): void;
/**
@ -930,6 +1519,17 @@ declare namespace preferences {
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @since 10
*/
/**
* Registers an observer to listen for the change of a {@link Preferences} object.
*
* @param { 'multiProcessChange' } type - Indicates the callback when preferences changed in multiple processes.
* @param { Function } callback - Indicates the callback function.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 15500019 - Failed to obtain subscription service.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @atomicservice
* @since 11
*/
on(type: 'multiProcessChange', callback: (key: string) => void): void;
/**
@ -951,6 +1551,17 @@ declare namespace preferences {
* @crossplatform
* @since 10
*/
/**
* Unregisters an existing observer.
*
* @param { 'change' } type - Indicates the callback when preferences changes.
* @param { Function } callback - Indicates the callback function.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @crossplatform
* @atomicservice
* @since 11
*/
off(type: 'change', callback?: (key: string) => void): void;
/**
@ -962,6 +1573,16 @@ declare namespace preferences {
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @since 10
*/
/**
* Unregisters an existing observer.
*
* @param { 'multiProcessChange' } type - Indicates the callback when preferences changed in multiple processes.
* @param { Function } callback - Indicates the callback function.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @atomicservice
* @since 11
*/
off(type: 'multiProcessChange', callback?: (key: string) => void): void;
}
}

View File

@ -299,6 +299,16 @@ declare namespace relationalStore {
* @since 11
*/
customDir?: string;
/**
* Specifies whether to clean up dirty data that is synchronized to
* the local but deleted in the cloud.
*
* @type { ?boolean }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 11
*/
autoCleanDirtyData?: boolean;
}
/**
@ -823,6 +833,89 @@ declare namespace relationalStore {
ON_CONFLICT_REPLACE = 5
}
/**
* Describes the data origin sources.
*
* @enum { number }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 11
*/
enum Origin {
/**
* Indicates the data source is local.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 11
*/
LOCAL,
/**
* Indicates the data source is cloud.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 11
*/
CLOUD,
/**
* Indicates the data source is remote.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 11
*/
REMOTE,
}
/**
* Enumerates the field.
*
* @enum { string }
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 11
*/
enum Field {
/**
* Cursor field.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 11
*/
CURSOR_FIELD = '#_cursor',
/**
* Origin field. For details, see {@link Origin}.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 11
*/
ORIGIN_FIELD = '#_origin',
/**
* Deleted flag field.
* Indicates whether data has deleted in cloud.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 11
*/
DELETED_FLAG_FIELD = '#_deleted_flag',
/**
* Owner field.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 11
*/
OWNER_FIELD = '#_cloud_owner',
/**
* Privilege field.
*
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 11
*/
PRIVILEGE_FIELD = '#_cloud_privilege'
}
/**
* Manages relational database configurations.
*
@ -2748,6 +2841,37 @@ declare namespace relationalStore {
primaryKeys: PRIKeyType[],
callback: AsyncCallback<ModifyTime>
): void;
/**
* Cleans all dirty data deleted in the cloud.
*
* @param { string } table - Indicates the name of the table to check.
* @param { AsyncCallback<void> } callback - The callback of clean.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 14800000 - Inner error.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 11
*/
cleanDirtyData(table: string, callback: AsyncCallback<void>): void;
/**
* Cleans dirty data deleted in the cloud.
*
* If a cursor is specified, data with a cursor smaller than the specified cursor will be cleaned up.
* otherwise clean all.
*
* @param { string } table - Indicates the name of the table to check.
* @param { number } [cursor] - Indicates the cursor.
* @returns { Promise<void> } -The promise returned by the function.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 14800000 - Inner error.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.CloudSync.Client
* @since 11
*/
cleanDirtyData(table: string, cursor?: number): Promise<void>;
/**
* Executes a SQL statement that contains specified parameters but returns no value.
*

View File

@ -29,6 +29,30 @@ declare namespace uniformTypeDescriptor {
* @since 10
*/
enum UniformDataType {
/**
* Base data type for physical hierarchy, which identifies the physical representation of the data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 11
*/
ENTITY = 'general.entity',
/**
* Base data type for logical hierarchy, which identifies the logical content representation of the data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 11
*/
OBJECT = 'general.object',
/**
* Base data type for mixed object. For example, a PDF file contains both text and special formatting data.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 11
*/
COMPOSITE_OBJECT = 'general.composite-object',
/**
* Text data type.
*
@ -731,7 +755,24 @@ declare namespace uniformTypeDescriptor {
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 11
*/
OPENHARMONY_ATOMIC_SERVICE = 'openharmony.atomic-service'
OPENHARMONY_ATOMIC_SERVICE = 'openharmony.atomic-service',
/**
* OpenHarmony system defined package, which is a directory presented to the user as a file(the data is provided
* <br>and bound to OpenHarmony system).
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 11
*/
OPENHARMONY_PACKAGE = 'openharmony.package',
/**
* OpenHarmony system defined ability package(the data is provided and bound to OpenHarmony system).
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 11
*/
OPENHARMONY_HAP = 'openharmony.hap'
}
/**
@ -792,6 +833,39 @@ declare namespace uniformTypeDescriptor {
*/
readonly iconFile: string;
/**
* Checks whether the uniform data type belongs to the given uniform data type.
*
* @param { string } type - A uniform data type to be compared.
* @returns { boolean } Returns true if the data type belongs to the given data type, else false.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 11
*/
belongsTo(type: string): boolean;
/**
* Checks whether the uniform data type is the lower level type of the given uniform data type.
*
* @param { string } type - A uniform data type to be compared.
* @returns { boolean } Returns true if the data type is the lower level type of the given data type, else false.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 11
*/
isLowerLevelType(type: string): boolean;
/**
* Checks whether the uniform data type is the higher level type of the given uniform data type.
*
* @param { string } type - A uniform data type to be compared.
* @returns { boolean } Returns true if the data type is the higher level type of the given data type, else false.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 11
*/
isHigherLevelType(type: string): boolean;
/**
* Checks whether the uniform type descriptor is equal to the given uniform type descriptor.
*
@ -815,6 +889,32 @@ declare namespace uniformTypeDescriptor {
* @since 11
*/
function getTypeDescriptor(typeId: string): TypeDescriptor;
/**
* Queries and returns the uniform type descriptor by the given filename extension and the uniform data type it belongs to.
*
* @param { string } filenameExtension - Filename extension.
* @param { string } [belongsTo] - A uniform data type ID it belongs to.
* @returns { string } Returns the uniform data type ID corresponding to the given filename extension and the
* <br>uniform data type it belongs to(If the 'belongsTo' parameter is set) or null if the uniform data type does not exist.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 11
*/
function getUniformDataTypeByFilenameExtension(filenameExtension: string, belongsTo?: string): string;
/**
* Queries and returns the uniform type descriptor by the given MIME type and the uniform data type it belongs to.
*
* @param { string } mimeType - MIME type.
* @param { string } [belongsTo] - A uniform data type ID it belongs to.
* @returns { string } Returns the uniform data type ID corresponding to the given MIME type and the uniform data type
* <br>it belongs to(If the 'belongsTo' parameter is set) or null if the uniform data type does not exist.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 11
*/
function getUniformDataTypeByMIMEType(mimeType: string, belongsTo?: string): string;
}
export default uniformTypeDescriptor;

View File

@ -774,6 +774,32 @@ declare namespace display {
* @since 9
*/
getCutoutInfo(): Promise<CutoutInfo>;
/**
* Check if current display has immersive window.
*
* @param { AsyncCallback<boolean> } callback
* @throws { BusinessError } 801 - Capability not supported on this device.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
* @syscap SystemCapability.Window.SessionManager
* @systemapi Hide this for inner system use.
* @since 11
*/
hasImmersiveWindow(callback: AsyncCallback<boolean>): void;
/**
* Check if current display has immersive window.
*
* @returns { Promise<boolean> }
* @throws { BusinessError } 801 - Capability not supported on this device.
* @throws { BusinessError } 1400001 - Invalid display or screen.
* @throws { BusinessError } 1400003 - This display manager service works abnormally.
* @syscap SystemCapability.Window.SessionManager
* @systemapi Hide this for inner system use.
* @since 11
*/
hasImmersiveWindow(): Promise<boolean>;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -13,6 +13,8 @@
* limitations under the License.
*/
import type systemManager from './@ohos.enterprise.systemManager';
/**
* Class of the enterprise admin extension ability.
*
@ -86,6 +88,17 @@ export default class EnterpriseAdminExtensionAbility {
*/
onAppStop(bundleName: string): void;
/**
* Called back when a system version need to update.
*
* @param { systemManager.SystemUpdateInfo } systemUpdateInfo - the information of the system version.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
onSystemUpdate(systemUpdateInfo: systemManager.SystemUpdateInfo): void;
/**
* Called back when the enterprise admin extension is started.
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022-2023 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
@ -126,7 +126,16 @@ declare namespace adminManager {
* @systemapi
* @since 10
*/
MANAGED_EVENT_APP_STOP = 3
MANAGED_EVENT_APP_STOP = 3,
/**
* The event of system update.
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @since 11
*/
MANAGED_EVENT_SYSTEM_UPDATE = 4,
}
/**

View File

@ -62,6 +62,24 @@ declare namespace deviceControl {
* @since 10
*/
function resetFactory(admin: Want): Promise<void>;
/**
* Allows the administrator to lock screen.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_LOCK_DEVICE
* @param { Want } admin - admin indicates the administrator ability information.
* @throws { BusinessError } 9200001 - the application is not an administrator of the device.
* @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - the application does not have permission to call this function.
* @throws { BusinessError } 202 - not system application.
* @throws { BusinessError } 401 - invalid input parameter.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
function lockScreen(admin: Want): void;
}
export default deviceControl;

View File

@ -391,6 +391,149 @@ declare namespace networkManager {
protocol?: Protocol;
}
/**
* Firewall rule
*
* @typedef FirewallRule
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
interface FirewallRule {
/**
* Source IP
*
* @type { ?string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
srcAddr?: string;
/**
* Destination IP
*
* @type { ?string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
destAddr?: string;
/**
* Source Port
*
* @type { ?string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
srcPort?: string;
/**
* Destination Port
*
* @type { ?string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
destPort?: string;
/**
* Application uid
*
* @type { ?string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
appUid?: string;
/**
* Direction
*
* @type { ?Direction }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
direction?: Direction;
/**
* Action
*
* @type { ?Action }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
action?: Action;
/**
* Protocol
*
* @type { ?Protocol }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
protocol?: Protocol;
}
/**
* Domain filter rule
*
* @typedef DomainFilterRule
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
interface DomainFilterRule {
/**
* Domain name
*
* @type { ?string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
domainName?: string;
/**
* Application uid
*
* @type { ?string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
appUid?: string;
/**
* action
*
* @type { ?Action }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
action?: Action;
}
/**
* Gets all of the network interfaces of the device.
* This function can be called by a super administrator.
@ -786,6 +929,122 @@ declare namespace networkManager {
* @since 10
*/
function listIptablesFilterRules(admin: Want): Promise<string>;
/**
* Adds firewall rule by {@link Firewall}.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
* @param { Want } admin - admin indicates the administrator ability information.
* @param { FirewallRule } firewallRule - firewall rule that needs to be added.
* @throws { BusinessError } 9200001 - the application is not an administrator of the device.
* @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - the application does not have permission to call this function.
* @throws { BusinessError } 202 - not system application.
* @throws { BusinessError } 401 - invalid input parameter.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
function addFirewallRule(admin: Want, firewallRule: FirewallRule): void;
/**
* Removes firewall rule by {@link Firewall}.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
* @param { Want } admin - admin indicates the administrator ability information.
* @param { FirewallRule } firewallRule - matching rule used to remove firewall rule.
* if firewallRule or firewallRule#direction,firewallRule#action is empty, multiple firewall rule can be removed.
* @throws { BusinessError } 9200001 - the application is not an administrator of the device.
* @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - the application does not have permission to call this function.
* @throws { BusinessError } 202 - not system application.
* @throws { BusinessError } 401 - invalid input parameter.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
function removeFirewallRule(admin: Want, firewallRule?: FirewallRule): void;
/**
* Gets all firewall rules, Contains the rules added by {@link addFirewallRule} and {@link addIptablesFilterRule}.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
* @param { Want } admin - admin indicates the administrator ability information.
* @returns { Array<FirewallRule> } an array of added firewall rules.
* @throws { BusinessError } 9200001 - the application is not an administrator of the device.
* @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - the application does not have permission to call this function.
* @throws { BusinessError } 202 - not system application.
* @throws { BusinessError } 401 - invalid input parameter.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
function getFirewallRules(admin: Want): Array<FirewallRule>;
/**
* Adds domain filter rule by {@link DomainFilterRule}.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
* @param { Want } admin - admin indicates the administrator ability information.
* @param { DomainFilterRule } domainFilterRule - domain filter rule that needs to be added.
* @throws { BusinessError } 9200001 - the application is not an administrator of the device.
* @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - the application does not have permission to call this function.
* @throws { BusinessError } 202 - not system application.
* @throws { BusinessError } 401 - invalid input parameter.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
function addDomainFilterRule(admin: Want, domainFilterRule: DomainFilterRule): void;
/**
* Removes domain filter rule by {@link DomainFilterRule}.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
* @param { Want } admin - admin indicates the administrator ability information.
* @param { DomainFilterRule } domainFilterRule - matching rule used to remove domain filter rule.
* if domainFilterRule or domainFilterRule#action is empty, multiple domain filter rule can be removed.
* @throws { BusinessError } 9200001 - the application is not an administrator of the device.
* @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - the application does not have permission to call this function.
* @throws { BusinessError } 202 - not system application.
* @throws { BusinessError } 401 - invalid input parameter.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
function removeDomainFilterRule(admin: Want, domainFilterRule?: DomainFilterRule): void;
/**
* Gets all domain filter rules, Contains the rules added by {@link addDomainFilterRule}.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_NETWORK
* @param { Want } admin - admin indicates the administrator ability information.
* @returns { Array<DomainFilterRule> } an array of added domain filter rules.
* @throws { BusinessError } 9200001 - the application is not an administrator of the device.
* @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - the application does not have permission to call this function.
* @throws { BusinessError } 202 - not system application.
* @throws { BusinessError } 401 - invalid input parameter.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
function getDomainFilterRules(admin: Want): Array<DomainFilterRule>;
}
export default networkManager;

View File

@ -25,6 +25,50 @@ import type Want from './@ohos.app.ability.Want';
* @since 11
*/
declare namespace systemManager {
/**
* The device system update info.
*
* @typedef SystemUpdateInfo
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
export interface SystemUpdateInfo {
/**
* The name of version need to update.
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
versionName: string;
/**
* The time when the version first received.
*
* @type { number }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
firstReceivedTime: number;
/**
* The type of version package.
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
packageType: string;
}
/**
* Sets NTP server.
* This function can be called by a super administrator.

View File

@ -828,6 +828,33 @@ declare namespace photoAccessHelper {
ALBUM_NAME = 'album_name'
}
/**
* Enumeration of mode for displaying albums containing hidden assets
*
* @enum { number } HiddenPhotosDisplayMode
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
enum HiddenPhotosDisplayMode {
/**
* Display the system hidden album that contains all the hidden assets.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
ASSETS_MODE,
/**
* Display all albums containing hidden assets(excluding the system hidden album and the system trash album).
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
ALBUMS_MODE
}
/**
* Options to fetch assets or albums
*
@ -1141,6 +1168,14 @@ declare namespace photoAccessHelper {
* @since 10
*/
CAMERA,
/**
* Image album
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
IMAGE,
/**
* Any album
*
@ -1695,6 +1730,53 @@ declare namespace photoAccessHelper {
* @since 10
*/
getAlbums(type: AlbumType, subtype: AlbumSubtype, options?: FetchOptions): Promise<FetchResult<Album>>;
/**
* Fetch albums containing hidden assets.
*
* @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.MANAGE_PRIVATE_PHOTOS
* @param { HiddenPhotosDisplayMode } mode - Display mode of albums containing hidden assets.
* @param { FetchOptions } options - Options to fetch albums.
* @param { AsyncCallback<FetchResult<Album>> } callback - Returns fetchResult of albums containing hidden assets.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 14000011 - System inner fail.
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
getHiddenAlbums(mode: HiddenPhotosDisplayMode, options: FetchOptions, callback: AsyncCallback<FetchResult<Album>>): void;
/**
* Fetch albums containing hidden assets.
*
* @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.MANAGE_PRIVATE_PHOTOS
* @param { HiddenPhotosDisplayMode } mode - Display mode of albums containing hidden assets.
* @param { AsyncCallback<FetchResult<Album>> } callback - Returns fetchResult of albums containing hidden assets.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 14000011 - System inner fail.
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
getHiddenAlbums(mode: HiddenPhotosDisplayMode, callback: AsyncCallback<FetchResult<Album>>): void;
/**
* Fetch albums containing hidden assets.
*
* @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.MANAGE_PRIVATE_PHOTOS
* @param { HiddenPhotosDisplayMode } mode - Display mode of albums containing hidden assets.
* @param { FetchOptions } [options] - Options to fetch albums.
* @returns { Promise<FetchResult<Album>> } Returns fetchResult of albums containing hidden assets.
* @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
* @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 14000011 - System inner fail.
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
getHiddenAlbums(mode: HiddenPhotosDisplayMode, options?: FetchOptions): Promise<FetchResult<Album>>;
/**
* Delete assets
*
@ -1908,7 +1990,15 @@ declare namespace photoAccessHelper {
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 10
*/
DEFAULT_ALBUM_URI = 'file://media/PhotoAlbum'
DEFAULT_ALBUM_URI = 'file://media/PhotoAlbum',
/**
* Uri for albums in hidden album view.
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @systemapi
* @since 11
*/
DEFAULT_HIDDEN_ALBUM_URI = 'file://media/HiddenAlbum'
}
/**
@ -1997,6 +2087,24 @@ declare namespace photoAccessHelper {
* @since 10
*/
maxSelectNumber?: number;
/**
* Support taking photos.
*
* @type { ?boolean }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 11
*/
isPhotoTakingSupported?: boolean;
/**
* Support editing photos.
*
* @type { ?boolean }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @since 11
*/
isEditSupported?: boolean;
}
/**

View File

@ -16,6 +16,7 @@
import { AsyncCallback } from './@ohos.base';
import type colorSpaceManager from './@ohos.graphics.colorSpaceManager';
import type rpc from './@ohos.rpc';
import type resourceManager from './@ohos.resourceManager';
/**
* @namespace image
@ -644,7 +645,133 @@ declare namespace image {
* @syscap SystemCapability.Multimedia.Image.Core
* @since 10
*/
PHYSICAL_APERTURE = 'HwMnotePhysicalAperture'
PHYSICAL_APERTURE = 'HwMnotePhysicalAperture',
/**
* Roll Angle
*
* @syscap SystemCapability.Multimedia.Image.Core
* @crossplatform
* @since 11
*/
ROLL_ANGLE = 'HwMnoteRollAngle',
/**
* Pitch Angle
*
* @syscap SystemCapability.Multimedia.Image.Core
* @crossplatform
* @since 11
*/
PITCH_ANGLE = 'HwMnotePitchAngle',
/**
* Capture Scene: Food
*
* @syscap SystemCapability.Multimedia.Image.Core
* @crossplatform
* @since 11
*/
SCENE_FOOD_CONF = 'HwMnoteSceneFoodConf',
/**
* Capture Scene: Stage
*
* @syscap SystemCapability.Multimedia.Image.Core
* @crossplatform
* @since 11
*/
SCENE_STAGE_CONF = 'HwMnoteSceneStageConf',
/**
* Capture Scene: Blue Sky
*
* @syscap SystemCapability.Multimedia.Image.Core
* @crossplatform
* @since 11
*/
SCENE_BLUE_SKY_CONF = 'HwMnoteSceneBlueSkyConf',
/**
* Capture Scene: Green Plant
*
* @syscap SystemCapability.Multimedia.Image.Core
* @crossplatform
* @since 11
*/
SCENE_GREEN_PLANT_CONF = 'HwMnoteSceneGreenPlantConf',
/**
* Capture Scene: Beach
*
* @syscap SystemCapability.Multimedia.Image.Core
* @crossplatform
* @since 11
*/
SCENE_BEACH_CONF = 'HwMnoteSceneBeachConf',
/**
* Capture Scene: Snow
*
* @syscap SystemCapability.Multimedia.Image.Core
* @crossplatform
* @since 11
*/
SCENE_SNOW_CONF = 'HwMnoteSceneSnowConf',
/**
* Capture Scene: Sunset
*
* @syscap SystemCapability.Multimedia.Image.Core
* @crossplatform
* @since 11
*/
SCENE_SUNSET_CONF = 'HwMnoteSceneSunsetConf',
/**
* Capture Scene: Flowers
*
* @syscap SystemCapability.Multimedia.Image.Core
* @crossplatform
* @since 11
*/
SCENE_FLOWERS_CONF = 'HwMnoteSceneFlowersConf',
/**
* Capture Scene: Night
*
* @syscap SystemCapability.Multimedia.Image.Core
* @crossplatform
* @since 11
*/
SCENE_NIGHT_CONF = 'HwMnoteSceneNightConf',
/**
* Capture Scene: Text
*
* @syscap SystemCapability.Multimedia.Image.Core
* @crossplatform
* @since 11
*/
SCENE_TEXT_CONF = 'HwMnoteSceneTextConf',
/**
* Face Count
*
* @syscap SystemCapability.Multimedia.Image.Core
* @crossplatform
* @since 11
*/
FACE_COUNT = 'HwMnoteFaceCount',
/**
* Focus Mode
*
* @syscap SystemCapability.Multimedia.Image.Core
* @crossplatform
* @since 11
*/
FOCUS_MODE = 'HwMnoteFocusMode'
}
/**
@ -1713,6 +1840,18 @@ declare namespace image {
*/
function createImageSource(buf: ArrayBuffer, options: SourceOptions): ImageSource;
/**
* Creates an ImageSource instance based on the raw file descriptor.
*
* @param { resourceManager.RawFileDescriptor } rawfile The raw file descriptor of the image.
* @param { SourceOptions } options The config of Image source.
* @returns { ImageSource } Returns the ImageSource instance if the operation is successful; returns null otherwise.
* @syscap SystemCapability.Multimedia.Image.ImageSource
* @crossplatform
* @since 11
*/
function createImageSource(rawfile: resourceManager.RawFileDescriptor, options?: SourceOptions): ImageSource;
/**
* Creates an ImageSource instance based on the buffer in incremental.
*
@ -3009,6 +3148,58 @@ declare namespace image {
packing(source: PixelMap, option: PackingOption): Promise<ArrayBuffer>;
/**
* Compresses or packs an image into a file and uses a callback to return the result.
*
* @param { ImageSource } source Image to be processed.
* @param { number } fd ID of a file descriptor.
* @param { PackingOption } options Options for image packing.
* @param { AsyncCallback<void> } callback Callback used to return the operation result.
* @syscap SystemCapability.Multimedia.Image.ImagePacker
* @crossplatform
* @since 11
*/
packToFile(source: ImageSource, fd: number, options: PackingOption, callback: AsyncCallback<void>): void;
/**
* Compresses or packs an image into a file and uses a promise to return the result.
*
* @param { ImageSource } source Image to be processed.
* @param { number } fd ID of a file descriptor.
* @param { PackingOption } options Options for image packing.
* @returns { Promise<void> } A Promise instance used to return the operation result.
* @syscap SystemCapability.Multimedia.Image.ImagePacker
* @crossplatform
* @since 11
*/
packToFile(source: ImageSource, fd: number, options: PackingOption): Promise<void>;
/**
* Compresses or packs an image into a file and uses a callback to return the result.
*
* @param { PixelMap } source PixelMap to be processed.
* @param { number } fd ID of a file descriptor.
* @param { PackingOption } options Options for image packing.
* @param { AsyncCallback<void> } callback Callback used to return the operation result.
* @syscap SystemCapability.Multimedia.Image.ImagePacker
* @crossplatform
* @since 11
*/
packToFile(source: PixelMap, fd: number, options: PackingOption, callback: AsyncCallback<void>): void;
/**
* Compresses or packs an image into a file and uses a promise to return the result.
*
* @param { PixelMap } source PixelMap to be processed.
* @param { number } fd ID of a file descriptor.
* @param { PackingOption } options Options for image packing.
* @returns { Promise<void> } A Promise instance used to return the operation result.
* @syscap SystemCapability.Multimedia.Image.ImagePacker
* @crossplatform
* @since 11
*/
packToFile(source: PixelMap, fd: number, options: PackingOption): Promise<void>;
/**
* Releases an ImagePacker instance and uses a callback to return the result.
*
* @param { AsyncCallback<void> } callback Callback to return the operation result.

View File

@ -15,6 +15,7 @@
import { ErrorCallback, AsyncCallback, Callback } from './@ohos.base';
import audio from "./@ohos.multimedia.audio";
import type image from './@ohos.multimedia.image';
import type { SoundPool as _SoundPool } from './multimedia/soundPool';
import type { PlayParameters as _PlayParameters } from './multimedia/soundPool';
@ -189,6 +190,486 @@ declare namespace media {
BACKGROUND = 2,
}
/**
* Creates an AVMetadataExtractor instance.
* @returns { Promise<AVMetadataExtractor> } A Promise instance used to return AVMetadataExtractor instance
* if the operation is successful; returns null otherwise.
* @throws { BusinessError } 5400101 - No memory. Returned by promise.
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
function createAVMetadataExtractor(): Promise<AVMetadataExtractor>;
/**
* Creates an AVMetadataExtractor instance.
* @param { AsyncCallback<AVMetadataExtractor> } callback - Callback used to return AVMetadataExtractor instance
* if the operation is successful; returns null otherwise.
* @throws { BusinessError } 5400101 - No memory. Returned by callback.
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
function createAVMetadataExtractor(callback: AsyncCallback<AVMetadataExtractor>): void;
/**
* Creates an AVImageGenerator instance.
* @returns { Promise<AVImageGenerator> } A Promise instance used to return AVImageGenerator instance
* if the operation is successful; returns null otherwise.
* @throws { BusinessError } 5400101 - No memory. Returned by promise.
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
function createAVImageGenerator(): Promise<AVImageGenerator>;
/**
* Creates an AVImageGenerator instance.
* @param { AsyncCallback<AVImageGenerator> } callback - Callback used to return AVImageGenerator instance
* if the operation is successful; returns null otherwise.
* @throws { BusinessError } 5400101 - No memory. Returned by callback.
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
function createAVImageGenerator(callback: AsyncCallback<AVImageGenerator>): void;
/**
* Fetch media meta data or audio art picture from source. Before calling an AVMetadataExtractor method,
* you must use createAVMetadataExtractor() to create an AVMetadataExtractor instance.
* @typedef AVMetadataExtractor
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
interface AVMetadataExtractor {
/**
* Media file descriptor.
* @type { ?AVFileDescriptor }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
fdSrc ?: AVFileDescriptor;
/**
* DataSource descriptor.
* @type { ?AVDataSrcDescriptor }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
dataSrc ?: AVDataSrcDescriptor;
/**
* It will extract the resource to fetch media meta data info.
* @param { AsyncCallback<AVMetadata> } callback - A callback instance used to return when fetchMetadata completed.
* @throws { BusinessError } 5400102 - Operation not allowed. Returned by callback.
* @throws { BusinessError } 5400106 - Unsupported format. Returned by callback.
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
fetchMetadata(callback: AsyncCallback<AVMetadata>): void;
/**
* It will extract the resource to fetch media meta data info.
* @returns { Promise<AVMetadata> } A Promise instance used to return when fetchMetadata completed.
* @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise.
* @throws { BusinessError } 5400106 - Unsupported format. Returned by promise.
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
fetchMetadata(): Promise<AVMetadata>;
/**
* It will extract the audio resource to fetch an album cover.
* @param { AsyncCallback<image.PixelMap> } callback - A callback instance used
* to return when fetchAlbumCover completed.
* @throws { BusinessError } 5400102 - Operation not allowed. Return by callback.
* @throws { BusinessError } 5400106 - Unsupported format. Returned by callback.
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
fetchAlbumCover(callback: AsyncCallback<image.PixelMap>): void;
/**
* It will extract the audio resource to fetch an album cover.
* @returns { Promise<image.PixelMap> } A Promise instance used to return when fetchAlbumCover completed.
* @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise.
* @throws { BusinessError } 5400106 - Unsupported format. Returned by promise.
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
fetchAlbumCover(): Promise<image.PixelMap>;
/**
* Release resources used for AVMetadataExtractor.
* @param { AsyncCallback<void> } callback - A callback instance used to return when release completed.
* @throws { BusinessError } 5400102 - Operation not allowed. Returned by callback.
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
release(callback: AsyncCallback<void>): void;
/**
* Release resources used for AVMetadataExtractor.
* @returns { Promise<void> } A Promise instance used to return when release completed.
* @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise.
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
release(): Promise<void>;
}
/**
* Provides the container definition for media meta data.
* @typedef AVMetadata
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
interface AVMetadata {
/**
* The metadata to retrieve the information about the album title
* of the media source.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
album?: string;
/**
* The metadata to retrieve the information about the performer or
* artist associated with the media source.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
albumArtist?: string;
/**
* The metadata to retrieve the information about the artist of
* the media source.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
artist?: string;
/**
* The metadata to retrieve the information about the author of
* the media source.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
author?: string;
/**
* The metadata to retrieve the information about the created time of
* the media source.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
dateTime?: string;
/**
* The metadata to retrieve the information about the created or modified time
* with the specific date format of the media source.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
dateTimeFormat?: string;
/**
* The metadata to retrieve the information about the composer of
* the media source.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
composer?: string;
/**
* The metadata to retrieve the playback duration of the media source.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
duration?: string;
/**
* The metadata to retrieve the content type or genre of the data
* source.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
genre?: string;
/**
* If this value exists the media contains audio content.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
hasAudio?: string;
/**
* If this value exists the media contains video content.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
hasVideo?: string;
/**
* The metadata to retrieve the mime type of the media source. Some
* example mime types include: "video/mp4", "audio/mp4", "audio/amr-wb",
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
mimeType?: string;
/**
* The metadata to retrieve the number of tracks, such as audio, video,
* text, in the media source, such as a mp4 or 3gpp file.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
trackCount?: string;
/**
* It is the audio sample rate, if available.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
sampleRate?: string;
/**
* The metadata to retrieve the media source title.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
title?: string;
/**
* If the media contains video, this key retrieves its height.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
videoHeight?: string;
/**
* If the media contains video, this key retrieves its width.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
videoWidth?: string;
/**
* The metadata to retrieve the information about the video
* orientation.
* @type { ?string }
* @syscap SystemCapability.Multimedia.Media.AVMetadataExtractor
* @since 11
*/
videoOrientation?: string;
}
/**
* Generate an image from a video resource with the specific time. Before calling an AVImageGenerator method,
* you must use createAVImageGenerator() to create an AVImageGenerator instance.
* @typedef AVImageGenerator
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
interface AVImageGenerator {
/**
* Media file descriptor.
* @type { ?AVFileDescriptor }
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
fdSrc ?: AVFileDescriptor;
/**
* It will fetch a picture at @timeUs from the given video resource.
* @param { number } timeUs - The time expected to fetch picture from the video resource.
* The unit is microsecond(us).
* @param { AVImageQueryOptions } options - The time options about the relationship
* between the given timeUs and a key frame, see @AVImageQueryOptions .
* @param { PixelMapParams } param - The output pixel map format params, see @PixelMapParams .
* @param { AsyncCallback<image.PixelMap> } callback - A callback instance used
* to return when fetchFrameByTime completed.
* @throws { BusinessError } 5400102 - Operation not allowed. Returned by callback.
* @throws { BusinessError } 5400106 - Unsupported format. Returned by callback.
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
fetchFrameByTime(timeUs: number, options: AVImageQueryOptions, param: PixelMapParams,
callback: AsyncCallback<image.PixelMap>): void;
/**
* It will decode the given video resource. Then fetch a picture
* at @timeUs according the given @options and @param .
* @param { number } timeUs - The time expected to fetch picture from the video resource.
* The unit is microsecond(us).
* @param { AVImageQueryOptions } options - The time options about the relationship
* between the given timeUs and a key frame, see @AVImageQueryOptions .
* @param { PixelMapParams } param - The output pixel map format params, see @PixelMapParams .
* @returns { Promise<image.PixelMap> } A Promise instance used to return the pixel map
* when fetchFrameByTime completed.
* @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise.
* @throws { BusinessError } 5400106 - Unsupported format. Returned by promise.
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
fetchFrameByTime(timeUs: number, options: AVImageQueryOptions, param: PixelMapParams): Promise<image.PixelMap>;
/**
* Release resources used for AVImageGenerator.
* @param { AsyncCallback<void> } callback - A callback instance used to return when release completed.
* @throws { BusinessError } 5400102 - Operation not allowed. Returned by callback.
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
release(callback: AsyncCallback<void>): void;
/**
* Release resources used for AVImageGenerator.
* @returns { Promise<void> } A Promise instance used to return when release completed.
* @throws { BusinessError } 5400102 - Operation not allowed. Returned by promise.
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
release(): Promise<void>;
}
/**
* Enumerates options about the relationship between the given timeUs and a key frame.
* @enum { number }
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
enum AVImageQueryOptions {
/**
* This option is used to fetch a key frame from the given media
* resource that is located right after or at the given time.
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
AV_IMAGE_QUERY_NEXT_SYNC,
/**
* This option is used to fetch a key frame from the given media
* resource that is located right before or at the given time.
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
AV_IMAGE_QUERY_PREVIOUS_SYNC,
/**
* This option is used to fetch a key frame from the given media
* resource that is located closest to or at the given time.
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
AV_IMAGE_QUERY_CLOSEST_SYNC,
/**
* This option is used to fetch a frame (maybe not keyframe) from
* the given media resource that is located closest to or at the given time.
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
AV_IMAGE_QUERY_CLOSEST,
}
/**
* Expected pixel map format for the fetched image from video resource.
* @typedef PixelMapParams
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
interface PixelMapParams {
/**
* Expected pixelmap's width, -1 means to keep consistent with the
* original dimensions of the given video resource.
* @type { ?number }
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
width?: number;
/**
* Expected pixelmap's width, -1 means to keep consistent with the
* original dimensions of the given video resource.
* @type { ?number }
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
height?: number;
/**
* Expected pixelmap's color format, see {@link PixelFormat}.
* @type { ?PixelFormat }
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
colorFormat?: PixelFormat;
}
/**
* Enumerates options about the expected color options for the fetched image.
* @enum { number }
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
enum PixelFormat {
/**
* RGB_565 options.
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
RGB_565 = 2,
/**
* RGBA_8888 options.
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
RGBA_8888 = 3,
/**
* RGB_888 options.
* @syscap SystemCapability.Multimedia.Media.AVImageGenerator
* @systemapi
* @since 11
*/
RGB_888 = 5,
}
/**
* Enumerates ErrorCode types, return in BusinessError::code.
*

View File

@ -38,6 +38,33 @@ export declare interface Pinch {
scale: number;
}
/**
* Rotate event on touchPad
*
* @interface Rotate
* @syscap SystemCapability.MultimodalInput.Input.Core
* @since 11
*/
export declare interface Rotate {
/**
* Action type
*
* @type { ActionType }
* @syscap SystemCapability.MultimodalInput.Input.Core
* @since 11
*/
type: ActionType;
/**
* Rotate angle
*
* @type { number }
* @syscap SystemCapability.MultimodalInput.Input.Core
* @since 11
*/
angle: number;
}
/**
* Three fingers swipe event on touchPad
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-2023 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
@ -74,6 +74,25 @@ declare namespace inputConsumer {
finalKeyDownDuration: number;
}
/**
* Shield mode.
*
* @enum { number }
* @syscap SystemCapability.MultimodalInput.Input.InputConsumer
* @systemapi hide for inner use
* @since 11
*/
enum ShieldMode {
/**
* Factory mode shield all key events
*
* @syscap SystemCapability.MultimodalInput.Input.InputConsumer
* @systemapi hide for inner use
* @since 11
*/
FACTORY_MODE
}
/**
* Subscribe system keys.
*
@ -99,6 +118,37 @@ declare namespace inputConsumer {
* @since 8
*/
function off(type: 'key', keyOptions: KeyOptions, callback?: Callback<KeyOptions>): void;
/**
* Sets whether shield key event interception, only support shield key event.
*
* @permission ohos.permission.INPUT_CONTROL_DISPATCHING
* @param { ShieldMode } shieldMode - According the shield mode select shield key event range.
* @param { boolean } isShield - Indicates whether control key event dispatch. The value <b>true</b> indicates
* all key events directly dispatch to window, if the value <b>false</b> indicates not shield shortcut key.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - SystemAPI permission error.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.MultimodalInput.Input.InputConsumer
* @systemapi hide for inner use.
* @since 11
*/
function setShieldStatus(shieldMode: ShieldMode, isShield: boolean): void;
/**
* Gets shield event interception status corresponding to shield mode
*
* @permission ohos.permission.INPUT_CONTROL_DISPATCHING
* @param { ShieldMode } shieldMode - According the shield mode select shield key event range.
* @returns { boolean } Returns true if shield event interception, returns false otherwise.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - SystemAPI permission error.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.MultimodalInput.Input.InputConsumer
* @systemapi hide for inner use.
* @since 11
*/
function getShieldStatus(shieldMode: ShieldMode): boolean;
}
export default inputConsumer;

View File

@ -16,7 +16,7 @@
import { Callback } from './@ohos.base';
import { MouseEvent } from './@ohos.multimodalInput.mouseEvent';
import type { TouchEvent } from './@ohos.multimodalInput.touchEvent';
import type { Pinch, ThreeFingersSwipe, FourFingersSwipe } from './@ohos.multimodalInput.gestureEvent';
import type { Rotate, Pinch, ThreeFingersSwipe, FourFingersSwipe } from './@ohos.multimodalInput.gestureEvent';
/**
* Global input event listener
@ -129,6 +129,70 @@ declare namespace inputMonitor {
*/
function off(type: 'pinch', receiver?: Callback<Pinch>): void;
/**
* Listens for touchPad fingers pinch events.
*
* @permission ohos.permission.INPUT_MONITORING
* @param { 'pinch' } type - Event type, which is **pinch**.
* @param { number } fingers - the number of fingers.
* @param { Callback<Pinch> } receiver - Callback used to receive the reported data.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - SystemAPI permit error.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.MultimodalInput.Input.InputMonitor
* @systemapi hide for inner use
* @since 11
*/
function on(type: 'pinch', fingers: number, receiver: Callback<Pinch>): void;
/**
* Cancel listening for touchPad fingers pinch events.
*
* @permission ohos.permission.INPUT_MONITORING
* @param { 'pinch' } type - Event type, which is **pinch**.
* @param { number } fingers - the number of fingers.
* @param { Callback<Pinch> } receiver - Callback used to receive the reported data.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - SystemAPI permit error.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.MultimodalInput.Input.InputMonitor
* @systemapi hide for inner use
* @since 11
*/
function off(type: 'pinch', fingers: number, receiver?: Callback<Pinch>): void;
/**
* Listens for touchPad fingers rotate events.
*
* @permission ohos.permission.INPUT_MONITORING
* @param { 'rotate' } type - Event type, which is **rotate**.
* @param { number } fingers - the number of fingers.
* @param { Callback<Rotate> } receiver - Callback used to receive the reported data.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - SystemAPI permit error.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.MultimodalInput.Input.InputMonitor
* @systemapi hide for inner use
* @since 11
*/
function on(type: 'rotate', fingers: number, receiver: Callback<Rotate>): void;
/**
* Cancel listening for touchPad fingers rotate events.
*
* @permission ohos.permission.INPUT_MONITORING
* @param { 'rotate' } type - Event type, which is **rotate**.
* @param { number } fingers - the number of fingers.
* @param { Callback<Rotate> } receiver - Callback used to receive the reported data.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - SystemAPI permit error.
* @throws { BusinessError } 401 - Parameter error.
* @syscap SystemCapability.MultimodalInput.Input.InputMonitor
* @systemapi hide for inner use
* @since 11
*/
function off(type: 'rotate', fingers: number, receiver?: Callback<Rotate>): void;
/**
* Listens for touchPad three fingers swipe events.
*

View File

@ -1261,6 +1261,19 @@ declare namespace notificationManager {
* @syscap SystemCapability.Notification.Notification
* @since 9
*/
/**
* Request permission to send notification.
*
* @param { AsyncCallback<void> } callback - The callback of requestEnableNotification.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 1600001 - Internal error.
* @throws { BusinessError } 1600002 - Marshalling or unmarshalling error.
* @throws { BusinessError } 1600003 - Failed to connect service.
* @throws { BusinessError } 1600004 - Notification is not enabled.
* @throws { BusinessError } 1600013 - Enable Notification Dialog has been popping already.
* @syscap SystemCapability.Notification.Notification
* @since 11
*/
function requestEnableNotification(callback: AsyncCallback<void>): void;
/**
@ -1276,6 +1289,21 @@ declare namespace notificationManager {
* @StageModelOnly
* @since 10
*/
/**
* Request permission to send notification.
*
* @param { UIAbilityContext } context - The context indicates the ability context you want to bind;
* @param { AsyncCallback<void> } callback - The callback of requestEnableNotification.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 1600001 - Internal error.
* @throws { BusinessError } 1600002 - Marshalling or unmarshalling error.
* @throws { BusinessError } 1600003 - Failed to connect service.
* @throws { BusinessError } 1600004 - Notification is not enabled.
* @throws { BusinessError } 1600013 - Enable Notification Dialog has been popping already.
* @syscap SystemCapability.Notification.Notification
* @StageModelOnly
* @since 11
*/
function requestEnableNotification(context: UIAbilityContext, callback: AsyncCallback<void>): void;
/**
@ -1289,6 +1317,19 @@ declare namespace notificationManager {
* @syscap SystemCapability.Notification.Notification
* @since 9
*/
/**
* Request permission to send notification.
*
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 1600001 - Internal error.
* @throws { BusinessError } 1600002 - Marshalling or unmarshalling error.
* @throws { BusinessError } 1600003 - Failed to connect service.
* @throws { BusinessError } 1600004 - Notification is not enabled.
* @throws { BusinessError } 1600013 - Enable Notification Dialog has been popping already.
* @syscap SystemCapability.Notification.Notification
* @since 11
*/
function requestEnableNotification(): Promise<void>;
/**
@ -1304,6 +1345,21 @@ declare namespace notificationManager {
* @StageModelOnly
* @since 10
*/
/**
* Request permission to send notification.
*
* @param { UIAbilityContext } context - The context indicates the ability context you want to bind;
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 1600001 - Internal error.
* @throws { BusinessError } 1600002 - Marshalling or unmarshalling error.
* @throws { BusinessError } 1600003 - Failed to connect service.
* @throws { BusinessError } 1600004 - Notification is not enabled.
* @throws { BusinessError } 1600013 - Enable Notification Dialog has been popping already.
* @syscap SystemCapability.Notification.Notification
* @StageModelOnly
* @since 11
*/
function requestEnableNotification(context: UIAbilityContext): Promise<void>;
/**

View File

@ -537,6 +537,24 @@ declare namespace reminderAgentManager {
* @since 10
*/
autoDeletedTime?: number;
/**
* Type of the snoozeSlot used by the reminder.
*
* @type { ?notification.SlotType }
* @syscap SystemCapability.Notification.ReminderAgent
* @since 11
*/
snoozeSlotType?: notification.SlotType;
/**
* The directory of storing reminder announcements.
*
* @type { ?string }
* @syscap SystemCapability.Notification.ReminderAgent
* @since 11
*/
customRingUri?: string;
}
/**

View File

@ -1903,7 +1903,7 @@ declare namespace request {
* The default is 0.
*
* @type { ?number }
* @syscap SystemCapability.Request.FileTransferAgent
* @syscap SystemCapability.MiscServices.Upload
* @since 11
*/
index?: number;
@ -1914,7 +1914,7 @@ declare namespace request {
* The default is 0.
*
* @type { ?number }
* @syscap SystemCapability.Request.FileTransferAgent
* @syscap SystemCapability.MiscServices.Upload
* @since 11
*/
begins?: number;
@ -1925,7 +1925,7 @@ declare namespace request {
* The default is -1 indicating the end of the data for upload.
*
* @type { ?number }
* @syscap SystemCapability.Request.FileTransferAgent
* @syscap SystemCapability.MiscServices.Upload
* @since 11
*/
ends?: number;

View File

@ -1982,6 +1982,532 @@ declare namespace webview {
* @since 10
*/
getCustomUserAgent(): string;
/**
* Set web engine socket connection timeout.
* @param { number } timeout - Socket connection timeout.
* @throws { BusinessError } 401 - Invalid input parameter.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
static setConnectionTimeout(timeout: number): void;
/**
* Set delegate for download.
* Used to notify the progress of the download triggered from web.
* @param { WebDownloadDelegate } delegate - Delegate used for download triggered from web.
* @throws { BusinessError } 17100001 - Init error.
* The WebviewController must be associated with a Web component.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
setDownloadDelegate(delegate: WebDownloadDelegate): void;
/**
* Start a download.
* @param { string } url - The download url.
* @throws { BusinessError } 17100001 - Init error.
* The WebviewController must be associated with a Web component.
* @throws { BusinessError } 17100002 - Invalid url.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
startDownload(url: string): void;
/**
* Loads the URL use "POST" method with post data.
*
* @param { string } url - Request the URL use "POST" method.
* @param { ArrayBuffer } postData - This data will passed to "POST" request.
* @throws { BusinessError } 401 - Invalid input parameter.
* @throws { BusinessError } 17100001 - Init error.
* The WebviewController must be associated with a Web component.
* @throws { BusinessError } 17100002 - Invalid url.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
postUrl(url: string, postData: ArrayBuffer): void;
}
/**
* Defines the state for download.
* @enum {number}
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
enum WebDownloadState {
/**
* The web download is in progress.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
IN_PROGRESS = 0,
/**
* The web download has been completed.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
COMPLETED,
/**
* The web download was canceled.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
CANCELED,
/**
* The web download was interrupted.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
INTERRUPTED,
/**
* The web download is pending.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
PENDING,
/**
* The web download has been paused.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
PAUSED,
/**
* Unknown state.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
UNKNOWN,
}
/**
* Defines the error code for download.
* @enum {number}
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
enum WebDownloadErrorCode {
/**
* Unknown error.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
ERROR_UNKNOWN = 0,
/**
* Generic file operation failure.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
FILE_FAILED = 1,
/**
* The file cannot be accessed due to certain restrictions.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
FILE_ACCESS_DENIED = 2,
/**
* There is not enough disk space.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
FILE_NO_SPACE = 3,
/**
* The file name is too long.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
FILE_NAME_TOO_LONG = 5,
/**
* The file is too large.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
FILE_TOO_LARGE = 6,
/**
* Some temporary problems occurred, such as not enough memory, files in use, and too many files open at the same time.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
FILE_TRANSIENT_ERROR = 10,
/**
* The file is blocked from accessing because of some local policy.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
FILE_BLOCKED = 11,
/**
* When trying to resume the download, Found that the file is not long enough, maybe the file no longer exists.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
FILE_TOO_SHORT = 13,
/**
* Hash mismatch.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
FILE_HASH_MISMATCH = 14,
/**
* The file already exists.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
FILE_SAME_AS_SOURCE = 15,
/**
* Generic network error.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
NETWORK_FAILED = 20,
/**
* The network operation timed out.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
NETWORK_TIMEOUT = 21,
/**
* The network was disconnected.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
NETWORK_DISCONNECTED = 22,
/**
* Server down.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
NETWORK_SERVER_DOWN = 23,
/**
* Invalid network requestsmay redirect to unsupported scheme or an invalid URL.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
NETWORK_INVALID_REQUEST = 24,
/**
* The server returned a generic error.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
SERVER_FAILED = 30,
/**
* The server does not support range requests.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
SERVER_NO_RANGE = 31,
/**
* The server does not have the requested data.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
SERVER_BAD_CONTENT = 33,
/**
* The server does not allow the file to be downloaded.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
SERVER_UNAUTHORIZED = 34,
/**
* Server certificate error.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
SERVER_CERT_PROBLEM = 35,
/**
* Server access forbidden.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
SERVER_FORBIDDEN = 36,
/**
* Server unreachable.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
SERVER_UNREACHABLE = 37,
/**
* The received data does not match content-length.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
SERVER_CONTENT_LENGTH_MISMATCH = 38,
/**
* An unexpected cross-origin redirect happened.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
SERVER_CROSS_ORIGIN_REDIRECT = 39,
/**
* User cancel.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
USER_CANCELED = 40,
/**
* User shut down the application.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
USER_SHUTDOWN = 41,
/**
* Application crash.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
CRASH = 50,
}
/**
* Represents a download task, You can use this object to operate the corresponding download task.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
class WebDownloadItem {
/**
* Get guid.
* @returns { string } - Returns the download's guid.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
getGuid(): string;
/**
* Get current speed, in bytes per second.
* @returns { number } - Returns the current download speed.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
getCurrentSpeed(): number;
/**
* Get percent complete.
* @returns { number } - Returns -1 if progress is unknown. 100 if the download is already complete.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
getPercentComplete(): number;
/**
* Get total bytes.
* @returns { number } - Returns the total bytes received, -1 if the total size is unknown.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
getTotalBytes(): number;
/**
* Get state of the web download.
* @returns { WebDownloadState } - Returns the current download state.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
getState(): WebDownloadState;
/**
* Get last error code of the web download.
* @returns { WebDownloadErrorCode } - Returns the last error code.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
getLastErrorCode(): WebDownloadErrorCode;
/**
* Get http method of the web download request.
* @returns { string } - Returns the http request method.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
getMethod(): string;
/**
* Get mime type of the web download.
* @returns { string } - Returns the mimetype.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
getMimeType(): string;
/**
* Get url of the web download request.
* @returns { string } - Returns the url.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
getUrl(): string;
/**
* Get suggested file name of the web download request.
* @returns { string } - Returns the suggested file name.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
getSuggestedFileName(): string;
/**
* Start the web download.
* Used in onBeforeDownload, If you want to start the current download, call this function.
* @param { string } downloadPath - The content will be downloaded to this file.
* @throws { BusinessError } 401 - Invalid input parameter.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
start(downloadPath: string): void;
/**
* Cancel the web download.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
cancel(): void;
/**
* Pause the web download.
* @throws { BusinessError } 17100019 - The download has not been started yet.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
pause(): void;
/**
* Resume the web download.
* Use WebDownloadManager.resumeDownload to resume deserialized downloads.
* WebDownloadItem.resume is only used to resume the currently paused download.
* @throws { BusinessError } 17100016 - The download is not paused.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
resume(): void;
/**
* Get received bytes.
* @returns { number } - Returns the received bytes.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
getReceivedBytes(): number;
/**
* Get full path of the web download.
* @returns { string } - Returns the full path of the download.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
getFullPath(): string;
/**
* Serialize web download to typed array.
* @returns { Uint8Array } - Returns the serialized data.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
serialize(): Uint8Array;
/**
* Deserialize web download from typed array.
* @param { Uint8Array } serializedData - The serialized data.
* @returns { WebDownloadItem } - Deserialize the serialized data into a WebDownloadItem.
* @throws { BusinessError } 401 - Invalid input parameter.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
static deserialize(serializedData: Uint8Array): WebDownloadItem;
}
/**
* The download state is notified through this delegate.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
class WebDownloadDelegate {
/**
* Callback will be triggered before web download start.
* @param { Callback<WebDownloadItem> } callback - The callback of download will be start.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
onBeforeDownload(callback: Callback<WebDownloadItem>): void;
/**
* Callback will be triggered when web download is processing.
* @param { Callback<WebDownloadItem> } callback - The callback of download did update.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
onDownloadUpdated(callback: Callback<WebDownloadItem>): void;
/**
* Callback will be triggered when web download is completed.
* @param { Callback<WebDownloadItem> } callback - The callback of download did finish.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
onDownloadFinish(callback: Callback<WebDownloadItem>): void;
/**
* Callback will be triggered when web download is interrupted or canceled.
* @param { Callback<WebDownloadItem> } callback - The callback of download did fail.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
onDownloadFailed(callback: Callback<WebDownloadItem>): void;
}
/**
* You can trigger download manually through this interface, or resume failed or canceled downloads.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
class WebDownloadManager {
/**
* Set a delegate used to receive the progress of the download triggered from WebDownloadManager.
* @param { WebDownloadDelegate } delegate - Delegate used for download triggered from WebDownloadManager.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
static setDownloadDelegate(delegate: WebDownloadDelegate): void;
/**
* Resume the canceled or failed download.
* @param { WebDownloadItem } webDownloadItem - Download that need to be resume.
* @throws { BusinessError } 17100018 - No WebDownloadDelegate has been set yet.
* @syscap SystemCapability.Web.Webview.Core
* @since 11
*/
static resumeDownload(webDownloadItem: WebDownloadItem): void;
}
}

301
api/@ohos.zlib.d.ts vendored
View File

@ -36,10 +36,70 @@ declare namespace zlib {
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* CompressLevel
*
* @enum { number }
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
export enum CompressLevel {
/**
* Indicates the no compression mode.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Indicates the no compression mode.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
COMPRESS_LEVEL_NO_COMPRESSION = 0,
/**
* Indicates the best speed mode.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Indicates the best speed mode.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
COMPRESS_LEVEL_BEST_SPEED = 1,
/**
* Indicates the best compression mode.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Indicates the best compression mode.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
COMPRESS_LEVEL_BEST_COMPRESSION = 9,
/**
* Indicates the default compression mode.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Indicates the default compression mode.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
COMPRESS_LEVEL_DEFAULT_COMPRESSION = -1
}
@ -50,11 +110,84 @@ declare namespace zlib {
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* CompressStrategy
*
* @enum { number }
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
export enum CompressStrategy {
/**
* Indicates the default strategy.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Indicates the default strategy.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
COMPRESS_STRATEGY_DEFAULT_STRATEGY = 0,
/**
* Indicates the filtered strategy.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Indicates the filtered strategy.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
COMPRESS_STRATEGY_FILTERED = 1,
/**
* Indicates the huffman-only strategy.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Indicates the huffman-only strategy.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
COMPRESS_STRATEGY_HUFFMAN_ONLY = 2,
/**
* Indicates the RLE strategy.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Indicates the RLE strategy.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
COMPRESS_STRATEGY_RLE = 3,
/**
* Indicates the fixed strategy.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Indicates the fixed strategy.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
COMPRESS_STRATEGY_FIXED = 4
}
@ -65,20 +198,116 @@ declare namespace zlib {
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* MemLevel
*
* @enum { number }
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
export enum MemLevel {
/**
* Uses the least amount of memory.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Uses the least amount of memory.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
MEM_LEVEL_MIN = 1,
/**
* Uses the maximum amount of memory.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Uses the maximum amount of memory.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
MEM_LEVEL_MAX = 9,
/**
* Uses the default amount of memory.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Uses the default amount of memory.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
MEM_LEVEL_DEFAULT = 8
}
/**
* Defines compress or decompress options.
*
* @typedef Options
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Defines compress or decompress options.
*
* @typedef Options
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
interface Options {
/**
* Indicates the compress level.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Indicates the compress level.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
level?: CompressLevel;
/**
* Indicates the memory level.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Indicates the memory level.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
memLevel?: MemLevel;
/**
* Indicates the compress strategy.
*
* @syscap SystemCapability.BundleManager.Zlib
* @since 7
*/
/**
* Indicates the compress strategy.
*
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
strategy?: CompressStrategy;
}
@ -123,6 +352,20 @@ declare namespace zlib {
* @syscap SystemCapability.BundleManager.Zlib
* @since 9
*/
/**
* Compress the specified file.
*
* @param { string } inFile - Indicates the path of the file to be compressed.
* @param { string } outFile - Indicates the path of the output compressed file.
* @param { Options } options - Indicates the options of compressing file.
* @param { AsyncCallback<void> } callback - The callback of compressing file result.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 900001 - The input source file is invalid.
* @throws { BusinessError } 900002 - The input destination file is invalid.
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
function compressFile(inFile: string, outFile: string, options: Options, callback: AsyncCallback<void>): void;
/**
@ -138,6 +381,20 @@ declare namespace zlib {
* @syscap SystemCapability.BundleManager.Zlib
* @since 9
*/
/**
* Compress the specified file.
*
* @param { string } inFile - Indicates the path of the file to be compressed.
* @param { string } outFile - Indicates the path of the output compressed file.
* @param { Options } options - Indicates the options of compressing file.
* @returns { Promise<void> } Returns the result of compressFile file.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 900001 - The input source file is invalid.
* @throws { BusinessError } 900002 - The input destination file is invalid.
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
function compressFile(inFile: string, outFile: string, options: Options): Promise<void>;
/**
@ -167,6 +424,21 @@ declare namespace zlib {
* @syscap SystemCapability.BundleManager.Zlib
* @since 10
*/
/**
* Decompress the specified file.
*
* @param { string } inFile - Indicates the path of the file to be decompressed.
* @param { string } outFile - Indicates the path of the output decompressed file.
* @param { Options } options - Indicates the options of decompressing file.
* @param { AsyncCallback<void> } callback - The callback of decompressing file result.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 900001 - The input source file is invalid.
* @throws { BusinessError } 900002 - The input destination file is invalid.
* @throws { BusinessError } 900003 - The input source file is not ZIP format or damaged.
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
function decompressFile(inFile: string, outFile: string, options: Options, callback: AsyncCallback<void>): void;
/**
@ -182,6 +454,20 @@ declare namespace zlib {
* @syscap SystemCapability.BundleManager.Zlib
* @since 10
*/
/**
* Decompress the specified file.
*
* @param { string } inFile - Indicates the path of the file to be decompressed.
* @param { string } outFile - Indicates the path of the output decompressed file.
* @param { AsyncCallback<void> } callback - The callback of decompressing file result.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 900001 - The input source file is invalid.
* @throws { BusinessError } 900002 - The input destination file is invalid.
* @throws { BusinessError } 900003 - The input source file is not ZIP format or damaged.
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
function decompressFile(inFile: string, outFile: string, callback: AsyncCallback<void>): void;
/**
@ -211,6 +497,21 @@ declare namespace zlib {
* @syscap SystemCapability.BundleManager.Zlib
* @since 10
*/
/**
* Decompress the specified file.
*
* @param { string } inFile - Indicates the path of the file to be decompressed.
* @param { string } outFile - Indicates the path of the output decompressing file.
* @param { Options } options - Indicates the options of decompressing file.
* @returns { Promise<void> } Returns the result of decompressing file.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 900001 - The input source file is invalid.
* @throws { BusinessError } 900002 - The input destination file is invalid.
* @throws { BusinessError } 900003 - The input source file is not ZIP format or damaged.
* @syscap SystemCapability.BundleManager.Zlib
* @crossplatform
* @since 11
*/
function decompressFile(inFile: string, outFile: string, options?: Options): Promise<void>;
}
export default zlib;

View File

@ -326,6 +326,16 @@ export interface ApplicationInfo {
* @since 11
*/
readonly dataUnclearable: boolean;
/**
* Indicates the reserved flag of the application
*
* @type { number }
* @readonly
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 11
*/
readonly applicationReservedFlag: number;
}
/**

View File

@ -0,0 +1,57 @@
/*
* Copyright (c) 2023 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.
*/
/**
* Obtains resource information about a bundle
*
* @typedef BundleResourceInfo
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
export interface BundleResourceInfo {
/**
* Indicates the bundleName of this bundle
*
* @type { string }
* @readonly
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
readonly bundleName: string;
/**
* Indicates the icon of this bundle, which is base64 format
*
* @type { string }
* @readonly
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
readonly icon: string;
/**
* Indicates the label of this bundle
*
* @type { string }
* @readonly
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
readonly label: string;
}

View File

@ -0,0 +1,79 @@
/*
* Copyright (c) 2023 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.
*/
/**
* Obtains resource information about a launcher ability
*
* @typedef LauncherAbilityResourceInfo
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
export interface LauncherAbilityResourceInfo {
/**
* Indicates the bundleName of this ability
*
* @type { string }
* @readonly
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
readonly bundleName: string;
/**
* Indicates the moduleName of this ability
*
* @type { string }
* @readonly
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
readonly moduleName: string;
/**
* Indicates the abilityName of this ability
*
* @type { string }
* @readonly
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
readonly abilityName: string;
/**
* Indicates the icon of this ability, which is base64 format
*
* @type { string }
* @readonly
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
readonly icon: string;
/**
* Indicates the label of this ability
*
* @type { string }
* @readonly
* @syscap SystemCapability.BundleManager.BundleFramework.Resource
* @systemapi
* @since 11
*/
readonly label: string;
}

View File

@ -20,6 +20,14 @@
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* the data of the commonEvent
*
* @typedef CommonEventData
* @syscap SystemCapability.Notification.CommonEvent
* @crossplatform
* @since 11
*/
export interface CommonEventData {
/**
* event type
@ -28,6 +36,14 @@ export interface CommonEventData {
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* event type
*
* @type { string }
* @syscap SystemCapability.Notification.CommonEvent
* @crossplatform
* @since 11
*/
event: string;
/**

View File

@ -20,6 +20,14 @@
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* the information of the subscriber
*
* @typedef CommonEventSubscribeInfo
* @syscap SystemCapability.Notification.CommonEvent
* @crossplatform
* @since 11
*/
export interface CommonEventSubscribeInfo {
/**
* Indicates the subscribed events.
@ -28,6 +36,14 @@ export interface CommonEventSubscribeInfo {
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* Indicates the subscribed events.
*
* @type { Array<string> }
* @syscap SystemCapability.Notification.CommonEvent
* @crossplatform
* @since 11
*/
events: Array<string>;
/**

View File

@ -311,6 +311,14 @@ export interface CommonEventSubscriber {
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* get the CommonEventSubscribeInfo of this CommonEventSubscriber.
*
* @param { AsyncCallback<CommonEventSubscribeInfo> } callback - Indicate callback function to receive common event.
* @syscap SystemCapability.Notification.CommonEvent
* @crossplatform
* @since 11
*/
getSubscribeInfo(callback: AsyncCallback<CommonEventSubscribeInfo>): void;
/**
@ -320,6 +328,14 @@ export interface CommonEventSubscriber {
* @syscap SystemCapability.Notification.CommonEvent
* @since 7
*/
/**
* get the CommonEventSubscribeInfo of this CommonEventSubscriber.
*
* @returns { Promise<CommonEventSubscribeInfo> } Returns the commonEvent subscribe information
* @syscap SystemCapability.Notification.CommonEvent
* @crossplatform
* @since 11
*/
getSubscribeInfo(): Promise<CommonEventSubscribeInfo>;
/**

View File

@ -58,6 +58,8 @@
"SystemCapability.Multimedia.Media.Muxer",
"SystemCapability.Multimedia.Media.AVPlayer",
"SystemCapability.Multimedia.Media.AVRecorder",
"SystemCapability.Multimedia.Media.AVMetadataExtractor",
"SystemCapability.Multimedia.Media.AVImageGenerator",
"SystemCapability.Multimedia.AVSession.Core",
"SystemCapability.Multimedia.AVSession.Manager",
"SystemCapability.Multimedia.Audio.Core",

View File

@ -69,6 +69,8 @@
"SystemCapability.Multimedia.Media.Muxer",
"SystemCapability.Multimedia.Media.AVPlayer",
"SystemCapability.Multimedia.Media.AVRecorder",
"SystemCapability.Multimedia.Media.AVMetadataExtractor",
"SystemCapability.Multimedia.Media.AVImageGenerator",
"SystemCapability.Multimedia.AVSession.Core",
"SystemCapability.Multimedia.AVSession.Manager",
"SystemCapability.Multimedia.AVSession.AVCast",

View File

@ -64,6 +64,8 @@
"SystemCapability.Multimedia.Media.Muxer",
"SystemCapability.Multimedia.Media.AVPlayer",
"SystemCapability.Multimedia.Media.AVRecorder",
"SystemCapability.Multimedia.Media.AVMetadataExtractor",
"SystemCapability.Multimedia.Media.AVImageGenerator",
"SystemCapability.Multimedia.AVSession.Core",
"SystemCapability.Multimedia.AVSession.Manager",
"SystemCapability.Multimedia.AVSession.AVCast",

View File

@ -56,6 +56,8 @@
"SystemCapability.Multimedia.Media.Muxer",
"SystemCapability.Multimedia.Media.AVPlayer",
"SystemCapability.Multimedia.Media.AVRecorder",
"SystemCapability.Multimedia.Media.AVMetadataExtractor",
"SystemCapability.Multimedia.Media.AVImageGenerator",
"SystemCapability.Multimedia.AVSession.Core",
"SystemCapability.Multimedia.AVSession.Manager",
"SystemCapability.Multimedia.AVSession.AVCast",

View File

@ -55,6 +55,8 @@
"SystemCapability.Multimedia.Media.Muxer",
"SystemCapability.Multimedia.Media.AVPlayer",
"SystemCapability.Multimedia.Media.AVRecorder",
"SystemCapability.Multimedia.Media.AVMetadataExtractor",
"SystemCapability.Multimedia.Media.AVImageGenerator",
"SystemCapability.Multimedia.AVSession.Core",
"SystemCapability.Multimedia.AVSession.Manager",
"SystemCapability.Multimedia.Audio.Core",

View File

@ -1,6 +1,7 @@
{
"decorators": {
"customDoc": [
"atomicservice",
"constant",
"crossplatform",
"default",
@ -20,6 +21,7 @@
"since",
"stagemodelonly",
"static",
"struct",
"syscap",
"systemapi",
"type",
@ -205,6 +207,8 @@
"SystemCapability.Multimedia.MediaLibrary.DistributedCore",
"SystemCapability.Multimedia.Media.AVPlayer",
"SystemCapability.Multimedia.Media.AVRecorder",
"SystemCapability.Multimedia.Media.AVMetadataExtractor",
"SystemCapability.Multimedia.Media.AVImageGenerator",
"SystemCapability.Multimedia.Image.ImageCreator",
"SystemCapability.Multimedia.SystemSound.Core",
"SystemCapability.Telephony.CoreService",

View File

@ -43,6 +43,7 @@ asyn
asynchronized
atime
atio
atomicservice
atqa
attaches
attachment0

View File

@ -14,8 +14,7 @@
*/
const {
requireTypescriptModule, tagsArrayOfOrder, commentNodeWhiteList, parseJsDoc, ErrorType, ErrorLevel, FileType,
inheritArr, ErrorValueInfo, createErrorInfo, isWhiteListFile,
} = require('../utils');
inheritArr, ErrorValueInfo, createErrorInfo, isAscending } = require('../utils');
const { addAPICheckErrorLogs } = require('../compile_info');
const rules = require('../../code_style_rule.json');
const whiteLists = require('../../config/jsdocCheckWhiteList.json');
@ -28,6 +27,26 @@ function isOfficialTag(tagName) {
return tagsArrayOfOrder.indexOf(tagName) === -1;
}
/**
* 对form标签的顺序做兼容处理
*/
function formOrderCheck(tags, tagIndex, firstIndex, secondIndex) {
const frontFirstIndex = tagIndex - 1 > -1 ? tagsArrayOfOrder.indexOf(tags[tagIndex - 1].tag) : 0;
const formNeighborArr = [frontFirstIndex, firstIndex];
const newTagIndex = tagsArrayOfOrder.lastIndexOf(tags[tagIndex].tag);
const newFormNeighborArr = [frontFirstIndex, newTagIndex];
if (secondIndex > -1) {
formNeighborArr.push(secondIndex);
newFormNeighborArr.push(secondIndex);
}
if (!isAscending(formNeighborArr) && !isAscending(newFormNeighborArr)) {
return false;
}
return true;
}
/**
* 判断标签排列是否为升序
*/
@ -41,9 +60,12 @@ function isAscendingOrder(tags) {
// 判断标签是否为官方标签
const firstTag = isOfficialTag(tags[tagIndex].tag);
// 非自定义标签在前或数组降序时报错
if ((firstTag && secondIndex > -1) || (firstIndex > secondIndex && secondIndex > -1)) {
if (tags[tagIndex].tag !== 'form' && tags[tagIndex + 1].tag !== 'form' &&
((firstTag && secondIndex > -1) || (firstIndex > secondIndex && secondIndex > -1))) {
checkResult = false;
break;
} else if (tags[tagIndex].tag === 'form') {
checkResult = formOrderCheck(tags, tagIndex, firstIndex, secondIndex);
}
}
};

View File

@ -46,9 +46,10 @@ const commentNodeWhiteList = [
exports.commentNodeWhiteList = commentNodeWhiteList;
const tagsArrayOfOrder = [
'namespace', 'extends', 'typedef', 'interface', 'permission', 'enum', 'constant', 'type', 'param', 'default',
'namespace', 'struct', 'extends', 'typedef', 'interface', 'permission', 'enum', 'constant', 'type', 'param', 'default',
'returns', 'readonly', 'throws', 'static', 'fires', 'syscap', 'systemapi', 'famodelonly', 'FAModelOnly',
'stagemodelonly', 'StageModelOnly', 'crossplatform', 'since', 'deprecated', 'useinstead', 'test', 'form', 'example'
'stagemodelonly', 'StageModelOnly', 'crossplatform', 'form', 'atomicservice', 'since', 'deprecated', 'useinstead',
'test', 'form', 'example'
];
exports.tagsArrayOfOrder = tagsArrayOfOrder;
@ -366,11 +367,11 @@ const ErrorValueInfo = {
};
exports.ErrorValueInfo = ErrorValueInfo;
const DIFF_INFO = {
NEW_JSDOCS_LENGTH:1,
NEW_JSDOC_INDEX:2,
const DIFF_INFO = {
NEW_JSDOCS_LENGTH: 1,
NEW_JSDOC_INDEX: 2,
};
exports.DIFF_INFO = DIFF_INFO;
exports.DIFF_INFO = DIFF_INFO;
/**
* link error message
@ -458,7 +459,7 @@ function checkVersionNeedCheck(node) {
exports.checkVersionNeedCheck = checkVersionNeedCheck;
const FUNCTION_TYPES = [ts.SyntaxKind.FunctionDeclaration, ts.SyntaxKind.MethodSignature,
ts.SyntaxKind.MethodDeclaration, ts.SyntaxKind.CallSignature, ts.SyntaxKind.Constructor];
ts.SyntaxKind.MethodDeclaration, ts.SyntaxKind.CallSignature, ts.SyntaxKind.Constructor];
exports.FUNCTION_TYPES = FUNCTION_TYPES;
function splitPath(filePath, pathElements) {
@ -468,4 +469,14 @@ function splitPath(filePath, pathElements) {
splitPath(spliteResult.dir, pathElements);
}
}
exports.splitPath = splitPath;
exports.splitPath = splitPath;
function isAscending(arr) {
for (let i = 1; i < arr.length; i++) {
if (arr[i] < arr[i - 1]) {
return false;
}
}
return true;
}
exports.isAscending = isAscending;

View File

@ -374,9 +374,11 @@ export class NodeProcessorHelper {
}
const parentClasses: string[] = [];
interfaceDeclaration.heritageClauses.forEach((value: ts.HeritageClause) => {
value.types.forEach((value: ts.ExpressionWithTypeArguments) => {
parentClasses.push(value.expression.getText());
});
if (value.token === ts.SyntaxKind.ExtendsKeyword) {
value.types.forEach((value: ts.ExpressionWithTypeArguments) => {
parentClasses.push(value.getText());
});
}
});
interfaceInfo.setParentClasses(parentClasses);
return interfaceInfo;
@ -400,9 +402,11 @@ export class NodeProcessorHelper {
}
const parentClasses: string[] = [];
classDeclaration.heritageClauses.forEach((value: ts.HeritageClause) => {
value.types.forEach((value: ts.ExpressionWithTypeArguments) => {
parentClasses.push(value.expression.getText());
});
if (value.token === ts.SyntaxKind.ExtendsKeyword) {
value.types.forEach((value: ts.ExpressionWithTypeArguments) => {
parentClasses.push(value.getText());
});
}
});
classInfo.setParentClasses(parentClasses);
return classInfo;

View File

@ -20,6 +20,7 @@
}
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -38,6 +39,7 @@
"constructor"
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"callForm": "",
"params": [],

View File

@ -20,6 +20,7 @@
}
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -38,6 +39,7 @@
"constructor"
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"callForm": "",
"params": [
@ -71,6 +73,7 @@
"countDownFrom"
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"type": [
"number"

View File

@ -20,6 +20,7 @@
}
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"callForm": "@Builder MyBuilderFunction(){}",
"params": [],
@ -47,6 +48,7 @@
}
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -65,6 +67,7 @@
"constructor"
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"callForm": "",
"params": [],

View File

@ -20,6 +20,7 @@
}
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"callForm": "@Builder GlobalBuilder0() {}",
"params": [],
@ -47,6 +48,7 @@
}
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -65,6 +67,7 @@
"constructor"
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"callForm": "",
"params": [
@ -103,6 +106,7 @@
}
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"type": [
"() => void"

View File

@ -20,6 +20,7 @@
}
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -38,6 +39,7 @@
"constructor"
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"callForm": "",
"params": [
@ -76,6 +78,7 @@
}
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"type": [
"number"

View File

@ -20,6 +20,7 @@
}
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -38,6 +39,7 @@
"constructor"
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"callForm": "",
"params": [
@ -79,6 +81,7 @@
}
],
"isStruct": true,
"syscap": "",
"jsDocInfos": [],
"type": [
"number"

View File

@ -15,6 +15,7 @@
"Test"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [
{
"description": "the ut for class",

View File

@ -15,6 +15,7 @@
"test"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [
{
"description": "the ut for constant in export namespace",
@ -49,6 +50,7 @@
"CONSTANT"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"type": [
"string"

View File

@ -15,6 +15,7 @@
"test"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [
{
"description": "the ut for constant in declare namespace",
@ -49,6 +50,7 @@
"CONSTANT"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"type": [
"string"

View File

@ -15,6 +15,7 @@
"CONSTANT"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [
{
"description": "the ut for constant with export",

View File

@ -15,6 +15,7 @@
"CONSTANT"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [
{
"description": "the ut for constant don't with export",

View File

@ -15,6 +15,7 @@
"CONSTANT"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [
{
"description": "the ut for constant with long value",

View File

@ -15,6 +15,7 @@
"CONSTANT"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [
{
"description": "the ut for constant use equal flag",

View File

@ -15,6 +15,7 @@
"CONSTANT"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [
{
"description": "the ut for constant use number value",

View File

@ -15,6 +15,7 @@
"NoValue"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"VALUE_ONE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "0"
},
@ -52,6 +54,7 @@
"VALUE_TWO"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "1"
},
@ -71,6 +74,7 @@
"VALUE_THREE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "2"
}

View File

@ -15,6 +15,7 @@
"NoValue"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"VALUE_ONE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "1"
},
@ -52,6 +54,7 @@
"VALUE_TWO"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "2"
},
@ -71,6 +74,7 @@
"VALUE_THREE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "4"
}

View File

@ -15,6 +15,7 @@
"NoValue"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"VALUE_ONE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "0"
},
@ -52,6 +54,7 @@
"VALUE_TWO"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "1"
},
@ -71,6 +74,7 @@
"VALUE_THREE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "2"
}

View File

@ -15,6 +15,7 @@
"NoValue"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"VALUE_ONE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "1"
},
@ -52,6 +54,7 @@
"VALUE_TWO"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "2"
},
@ -71,6 +74,7 @@
"VALUE_THREE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "3"
}

View File

@ -15,6 +15,7 @@
"Operation"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"VALUE_ONE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "1"
},
@ -52,6 +54,7 @@
"VALUE_Two"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "1 << 0"
},
@ -71,6 +74,7 @@
"VALUE_THREE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "1 << 1"
},
@ -90,6 +94,7 @@
"VALUE_FOUR"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "1 << 2"
},
@ -109,6 +114,7 @@
"VALUE_FIVE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "1 << 3"
},
@ -128,6 +134,7 @@
"VALUE_SIX"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "1 << 4"
},
@ -147,6 +154,7 @@
"VALUE_SEVEN"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "1 << 5"
}

View File

@ -15,6 +15,7 @@
"Valuable"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"VALUE_ONE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "testOne"
},
@ -52,6 +54,7 @@
"VALUE_Two"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "testTwo"
},
@ -71,6 +74,7 @@
"VALUE_THREE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "testThree"
}

View File

@ -15,6 +15,7 @@
"Valuable"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"VALUE_ONE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "testOne"
},
@ -52,6 +54,7 @@
"VALUE_Two"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": ""
},
@ -71,6 +74,7 @@
"VALUE_THREE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "testThree"
}

View File

@ -15,6 +15,7 @@
"Valuable"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"VALUE_ONE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "0"
},
@ -52,6 +54,7 @@
"VALUE_Two"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "testTwo"
},
@ -71,6 +74,7 @@
"VALUE_THREE"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"value": "testThree"
}

View File

@ -15,6 +15,7 @@
"Test"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [
{
"description": "the ut for export",
@ -49,7 +50,8 @@
"ut_export_001.d.ts",
"export_default_Test"
],
"isStruct": false
"isStruct": false,
"syscap": ""
}
]
}

View File

@ -15,6 +15,7 @@
"Test"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [
{
"description": "the ut for export",
@ -50,6 +51,7 @@
"export_Test"
],
"isStruct": false,
"syscap": "",
"exportValues": [
{
"key": "Test",

View File

@ -15,6 +15,7 @@
"getUserName"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [
{
"description": "the ut for export",
@ -53,6 +54,7 @@
"setName"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"callForm": "setName() {}",
"params": [],
@ -75,6 +77,7 @@
"export_get_set"
],
"isStruct": false,
"syscap": "",
"exportValues": [
{
"key": "get",

View File

@ -15,6 +15,7 @@
"export_getUserName_setName"
],
"isStruct": false,
"syscap": "",
"exportValues": [
{
"key": "getUserName",

View File

@ -15,6 +15,7 @@
"export_get_set"
],
"isStruct": false,
"syscap": "",
"exportValues": [
{
"key": "get",

View File

@ -15,6 +15,7 @@
"export_myTest"
],
"isStruct": false,
"syscap": "",
"exportValues": []
}
]

View File

@ -15,6 +15,7 @@
"testNamespace"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"TestInterface"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"parentClasses": [],
"childApis": [
@ -53,6 +55,7 @@
"id"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"type": [
"string"

View File

@ -15,6 +15,7 @@
"testNamespace"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"TestInterface"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"parentClasses": [],
"childApis": [
@ -53,6 +55,7 @@
"id"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"type": [
"string"

View File

@ -15,6 +15,7 @@
"testNamespace"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"TestInterface"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"parentClasses": [],
"childApis": [
@ -53,6 +55,7 @@
"registerInputer"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"callForm": "static registerInputer(authType: AuthType, inputer: IInputer): void",
"params": [
@ -97,6 +100,7 @@
"isOpenAccessibility"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"callForm": "isOpenAccessibility(): TestInterface.registerInputer",
"params": [],

View File

@ -15,6 +15,7 @@
"testNamespace"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"TestInterface"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"parentClasses": [],
"childApis": [
@ -53,6 +55,7 @@
"id"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"type": [
"string"

View File

@ -15,6 +15,7 @@
"testNamespace"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"TestInterface"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"parentClasses": [],
"childApis": [
@ -53,6 +55,7 @@
"type"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"type": [
"string",

View File

@ -15,6 +15,7 @@
"testNamespace"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"TestInterface"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"parentClasses": [],
"childApis": [
@ -53,6 +55,7 @@
"type"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"type": [
"string",

View File

@ -15,6 +15,7 @@
"testNamespace"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"TestInterface"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"parentClasses": [],
"childApis": [
@ -53,6 +55,7 @@
"options"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"type": [
"{ [key: string]: any }"

View File

@ -15,6 +15,7 @@
"testNamespace"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"TestInterface"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"parentClasses": [],
"childApis": [
@ -53,6 +55,7 @@
"options"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"type": [
"{ [key: string | boolean]: any }"

View File

@ -15,6 +15,7 @@
"testNamespace"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"TestInterface"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"parentClasses": [],
"childApis": [
@ -53,6 +55,7 @@
"options"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"type": [
"{ [key: string]: any }"

View File

@ -15,6 +15,7 @@
"testNamespace"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"TestInterface"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"parentClasses": [],
"childApis": [
@ -53,6 +55,7 @@
"windowUpdateType"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"type": [
"WindowUpdateType"

View File

@ -15,6 +15,7 @@
"testNamespace"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"TestInterface"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"parentClasses": [],
"childApis": [
@ -53,6 +55,7 @@
"windowUpdateType"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"type": [
"WindowUpdateType",

View File

@ -15,6 +15,7 @@
"testNamespace"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"TestInterface"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"parentClasses": [],
"childApis": [
@ -53,6 +55,7 @@
"windowUpdateType"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"type": [
"WindowUpdateType",

View File

@ -15,6 +15,7 @@
"testNamespace"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"childApis": [
{
@ -33,6 +34,7 @@
"TestInterface"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"parentClasses": [],
"childApis": [
@ -53,6 +55,7 @@
"windowUpdateType"
],
"isStruct": false,
"syscap": "",
"jsDocInfos": [],
"type": [
"WindowUpdateType"

Some files were not shown because too many files have changed in this diff Show More