diff --git a/BUILD.gn b/BUILD.gn index 38c871c84353a215a6d2c56da31c2f58f9cd9dc8..a6eb9c2bdb4d478151ef031a0103336463fb41ab 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -102,6 +102,7 @@ ohos_copy("ets_component") { "api/@internal/component/ets/toggle.d.ts", "api/@internal/component/ets/units.d.ts", "api/@internal/component/ets/video.d.ts", + "api/@internal/component/ets/web.d.ts", "api/@internal/component/ets/xcomponent.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] diff --git a/api/@internal/component/ets/column.d.ts b/api/@internal/component/ets/column.d.ts index 8a6feea284dc684437b93173a47b6e3de910696e..f1045dccf42d3e8b095ec1cd35989f0e3fe3cbb2 100644 --- a/api/@internal/component/ets/column.d.ts +++ b/api/@internal/component/ets/column.d.ts @@ -37,6 +37,12 @@ declare class ColumnAttribute extends CommonMethod { * @since 7 */ alignItems(value: HorizontalAlign): ColumnAttribute; + + /** + * Sets the alignment format of the subassembly in the vertical direction. + * @since 8 + */ + justifyContent(value: FlexAlign): ColumnAttribute; } declare const Column: ColumnInterface; diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 875e800ff3a9dd6afb835188174dbd816d6f339a..ca5a28f447a3f830484b78515e5528f2271387f2 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -36,6 +36,12 @@ declare const Observed: ClassDecorator; */ declare const Preview: ClassDecorator & ((value: PreviewParams) => ClassDecorator); +/** + * Defining BuilderParam PropertyDecorator + * @since 7 + */ +declare const BuilderParam: PropertyDecorator; + /** * Defining State PropertyDecorator. * @since 7 @@ -90,6 +96,7 @@ declare const StorageLink: (value: string) => PropertyDecorator; */ declare const Watch: (value: string) => PropertyDecorator; + /** * Defining Builder MethodDecorator * @since 7 @@ -173,6 +180,20 @@ declare function $r(value: string, ...params: any[]): Resource; */ declare function $rawfile(value: string): Resource; +/** + * global getContentStorage function + * @since 8 + */ +declare function getContentStorage(value: any): ContentStorage; + +declare type Context = any; + +/** + * global getContext function + * @since 8 + */ +declare function getContext(value: any): Context; + interface AnimateToParam { duration?: number; tempo?: number; @@ -1297,13 +1318,13 @@ declare class CommonMethod { * When the parameter is of the boolean type, this parameter specifies whether to crop based on the edge contour. * @since 7 */ - clip(value: boolean | CircleInterface | EllipseInterface | PathInterface | RectInterface): T; + clip(value: boolean | CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute): T; /** * Applies a mask of the specified shape to the current assembly. * @since 7 */ - mask(value: CircleInterface | EllipseInterface | PathInterface | RectInterface): T; + mask(value: CircleAttribute | EllipseAttribute | PathAttribute | RectAttribute): T; /** * Key. User can set an key to the component to identify it. diff --git a/api/@internal/component/ets/index.d.ts b/api/@internal/component/ets/index.d.ts index 3c4fc1ec962e2f172b3ba5e13b2d3a5ba02a50ef..b6db78203af52854db27a9983a9ee0b059fbb29a 100644 --- a/api/@internal/component/ets/index.d.ts +++ b/api/@internal/component/ets/index.d.ts @@ -93,5 +93,6 @@ /// /// /// +/// /// /// diff --git a/api/@internal/component/ets/row.d.ts b/api/@internal/component/ets/row.d.ts index 412041e9dff153882804ffe6be67d59fa22266e9..6d723e4b8baf61b87857b95aced6fc55cc2b89ae 100644 --- a/api/@internal/component/ets/row.d.ts +++ b/api/@internal/component/ets/row.d.ts @@ -34,6 +34,12 @@ declare class RowAttribute extends CommonMethod { * @since 7 */ alignItems(value: VerticalAlign): RowAttribute; + + /** + * Called when the horizontal alignment is set. + * @since 8 + */ + justifyContent(value: FlexAlign): RowAttribute; } declare const Row: RowInterface; diff --git a/api/@internal/component/ets/stateManagement.d.ts b/api/@internal/component/ets/stateManagement.d.ts index ca532e1754d9397d6e0b8d4e882d60f598e9ef4c..0fea7d5697cf83487c3a9badf7fe6e022265c017 100644 --- a/api/@internal/component/ets/stateManagement.d.ts +++ b/api/@internal/component/ets/stateManagement.d.ts @@ -502,6 +502,89 @@ declare abstract class SubscribaleAbstract { public removeOwningPropertyById(subscriberId: number): void; } +/** + * @since 8 + */ + declare class ContentStorage { + /** + * Called when a link is set. + * @since 8 + */ + link(propName: string): any; + + /** + * Called when a hyperlink is set. + * @since 8 + */ + setAndLink(propName: string, defaultValue: T): SubscribedAbstractProperty; + + /** + * Called when a property is set. + * @since 8 + */ + prop(propName: string): any; + + /** + * Called when dynamic properties are set. + * @since 8 + */ + setAndProp(propName: string, defaultValue: S): SubscribedAbstractProperty; + + /** + * Called when owning or not. + * @since 8 + */ + has(propName: string): boolean; + + /** + * Called when data is obtained. + * @since 8 + */ + get(propName: string): T | undefined; + + /** + * Called when setting. + * @since 8 + */ + set(propName: string, newValue: T): boolean; + + /** + * Called when setting or creating. + * @since 8 + */ + setOrCreate(propName: string, newValue: T): void; + + /** + * Called when a deletion is made. + * @since 8 + */ + delete(propName: string): boolean; + + /** + * Called when a dictionary is sorted. + * @since 8 + */ + keys(): IterableIterator; + + /** + * Called when a cleanup occurs. + * @since 8 + */ + clear(): boolean; + + /** + * Called when the data can be changed. + * @since 8 + */ + isMutable(propName: string): boolean; + + /** + * Called when you check how much data is stored. + * @since 8 + */ + size(): number; +} + /** * @since 7 */ diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..636060804afc100460ddf6c304b25c40ff86ba69 --- /dev/null +++ b/api/@internal/component/ets/web.d.ts @@ -0,0 +1,71 @@ +declare class WebController { + /** + * Constructor. + * @since 8 + */ + constructor(); + + /** + * Means to load a piece of code and execute JS code in the context of the currently displayed page + * @since 8 + */ + evaluateJavaScript(jscode: string); + + /** + * Indicates that a piece of code is loaded + * @since 8 + */ + loadDataWithBaseURL(value : {baseUrl: string, data: string, mimeType:string, encoding:string, historyUrl: string}); + + /** + * Load the given URL + * @since 8 + */ + loadUrl(url : string); +} + +declare interface WebOptions { + /** + * Set the address of the web page to be displayed + * @since 8 + */ + src: string | Resource; + controller: WebController; +} + +interface WebInterface { + /** + * Set Value. + * @since 8 + */ + (value: WebOptions): WebAttribute; +} + +declare class WebAttribute extends CommonMethod { + /** + * Triggered at the end of web page loading + * @since 8 + */ + onPageFinish(callback: (event?:{ url: string }) => void): WebAttribute; + + /** + * Get WebView focus callback event + * @since 8 + */ + onRequestFocus(event: () => void): WebAttribute; + + /** + * Set whether WebView allows JavaScript scripts to execute + * @since 8 + */ + javaScriptEnabled(value: boolean): WebAttribute; + + /** + * Enable or disable local file system access in WebView + * @since 8 + */ + fileAccessEnabled(value: boolean): WebAttribute; +} + +declare const Web: WebInterface; +declare const WebInstance: WebAttribute; diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts old mode 100755 new mode 100644 index cbdab0cafc637bf75b38dab031f0b79f6345eaed..f279a2e91541fc7fc381a4db5e2f93e17af04e27 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -17,6 +17,7 @@ import { AsyncCallback, Callback } from './basic'; import { ApplicationInfo } from './bundle/applicationInfo'; import { BundleInfo } from './bundle/bundleInfo'; import { AbilityInfo } from './bundle/abilityInfo'; +import { ExtensionAbilityInfo } from './bundle/extensionAbilityInfo'; import { Want } from './ability/want'; import { BundleInstaller } from './bundle/bundleInstaller'; import { ShortcutInfo } from './bundle/shortcutInfo'; @@ -49,27 +50,46 @@ declare namespace bundle { GET_BUNDLE_WITH_REQUESTED_PERMISSION = 0x00000010, GET_ALL_APPLICATION_INFO = 0xFFFF0000, /** - * @since 8 - */ + * @since 8 + */ GET_ABILITY_INFO_WITH_METADATA = 0x00000020, /** - * @since 8 - */ - GET_APPLICATION_INFO_WITH_METADATA = 0x00000040, + * @since 8 + */ + GET_BUNDLE_WITH_EXTENSION_ABILITY = 0x00000020, /** - * @since 8 - */ + * @since 8 + */ + GET_APPLICATION_INFO_WITH_METADATA = 0x00000040, + /** + * @since 8 + */ GET_ABILITY_INFO_SYSTEMAPP_ONLY = 0x00000080, /** - * @since 8 - */ + * @since 8 + */ GET_ABILITY_INFO_WITH_DISABLE = 0x00000100, - /** - * @since 8 - */ + /** + * @since 8 + */ GET_APPLICATION_INFO_WITH_DISABLE = 0x00000200, } + /** + * @name ExtensionFlag + * @since 8 + * @SysCap SystemCapability.Appexecfwk + * @import NA + * @permission NA + * @devices phone, tablet, tv, wearable + */ + enum ExtensionFlag { + GET_EXTENSION_INFO_DEFAULT = 0x00000000, + GET_EXTENSION_INFO_WITH_PERMISSION = 0x00000002, + GET_EXTENSION_INFO_WITH_APPLICATION = 0x00000004, + GET_EXTENSION_INFO_WITH_METADATA = 0x00000020, + } + /** * @name ColorMode * @since 7 @@ -107,31 +127,31 @@ declare namespace bundle { */ export enum AbilityType { /** - * @default Indicates an unknown ability type - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates an unknown ability type + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ UNKNOWN, /** - * @default Indicates that the ability has a UI - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability has a UI + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ PAGE, /** - * @default Indicates that the ability does not have a UI - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability does not have a UI + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ SERVICE, /** - * @default Indicates that the ability is used to provide data access services - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability is used to provide data access services + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ DATA, } @@ -158,31 +178,31 @@ declare namespace bundle { */ export enum DisplayOrientation { /** - * @default Indicates that the system automatically determines the display orientation - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the system automatically determines the display orientation + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ UNSPECIFIED, /** - * @default Indicates the landscape orientation - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the landscape orientation + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ LANDSCAPE, /** - * @default Indicates the portrait orientation - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the portrait orientation + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ PORTRAIT, /** - * @default Indicates the page ability orientation is the same as that of the nearest ability in the stack - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the page ability orientation is the same as that of the nearest ability in the stack + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ FOLLOW_RECENT, } @@ -196,20 +216,91 @@ declare namespace bundle { */ export enum LaunchMode { /** - * @default Indicates that the ability has only one instance - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability has only one instance + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ SINGLETON = 0, /** - * @default Indicates that the ability can have multiple instances - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability can have multiple instances + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ STANDARD = 1, } + /** + * @name ExtensionAbilityType + * @since 8 + * @SysCap SystemCapability.Appexecfwk + * @import NA + * @permission NA + * @devices phone, tablet, tv, wearable + */ + export enum ExtensionAbilityType { + /** + * @default Indicates extension info with type of form + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + FORM = 0, + /** + * @default Indicates extension info with type of work schedule + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + WORK_SCHEDULER = 1, + /** + * @default Indicates extension info with type of input method + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + INPUTMETHOD = 2, + /** + * @default Indicates extension info with type of service + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + SERVICE = 3, + /** + * @default Indicates extension info with type of accessibility + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + ACCESSIBILITY = 4, + /** + * @default Indicates extension info with type of datashare + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + DATASHARE = 5, + /** + * @default Indicates extension info with type of fileshare + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + FILESHARE = 6, + /** + * @default Indicates extension info with type of staticsubscriber + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + STATICSUBSCRIBER = 7, + /** + * @default Indicates extension info with type of wallpaper + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + WALLPAPER = 8, + /** + * @default Indicates extension info with type of unspecified + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + UNSPECIFIED = 9, + } + /** * @name BundleOptions * @since 7 @@ -220,17 +311,17 @@ declare namespace bundle { */ export interface BundleOptions { /** - * @default Indicates the user id - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the user id + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ userId?: number; /** - * @default Indicates the network id - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the network id + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ networkId?: string; } @@ -256,9 +347,22 @@ declare namespace bundle { STATUS_UNINSTALL_FAILURE_CONFLICT = 10, STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT = 0x0B, STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED = 0x0C, + /** + * @since 8 + */ STATUS_RECOVER_FAILURE_INVALID = 0x0D, + /** + * @since 7 + */ STATUS_ABILITY_NOT_FOUND = 0x40, - STATUS_BMS_SERVICE_ERROR = 0x41 + /** + * @since 7 + */ + STATUS_BMS_SERVICE_ERROR = 0x41, + /** + * @since 8 + */ + STATUS_FAILED_NO_SPACE_LEFT = 0x42 } /** @@ -296,7 +400,7 @@ declare namespace bundle { * @since 7 * @SysCap SystemCapability.Appexecfwk * @param bundleName Indicates the application bundle name to be queried. - * @param flags Indicates the flag used to specify information contained in the ApplicationInfo object + * @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo object * that will be returned. * @param userId Indicates the user ID. * @return Returns the ApplicationInfo object. @@ -324,9 +428,9 @@ declare namespace bundle { * @devices phone, tablet, tv, wearable * @since 7 * @SysCap SystemCapability.Appexecfwk - * @param intent Indicates the Intent containing the application bundle name to + * @param want Indicates the Want containing the application bundle name to * be queried. - * @param flags Indicates the flag used to specify information contained in the AbilityInfo objects that + * @param bundleFlags Indicates the flag used to specify information contained in the AbilityInfo objects that * will be returned. * @param userId Indicates the user ID. * @return Returns a list of AbilityInfo objects. @@ -358,7 +462,7 @@ declare namespace bundle { * @devices phone, tablet, tv, wearable * @since 7 * @SysCap SystemCapability.Appexecfwk - * @param flags Indicates the flag used to specify information contained in the ApplicationInfo objects + * @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo objects * that will be returned. * @param userId Indicates the user ID. * @return Returns a list of ApplicationInfo objects. @@ -375,7 +479,7 @@ declare namespace bundle { * @SysCap SystemCapability.Appexecfwk * @param hapFilePath Indicates the path storing the HAP. The path should be the relative path to the data * directory of the current application. - * @param flags Indicates the flag used to specify information contained in the BundleInfo object to be + * @param bundleFlags Indicates the flag used to specify information contained in the BundleInfo object to be * returned. * @return Returns the BundleInfo object. */ @@ -385,16 +489,16 @@ declare namespace bundle { /** /** - * Obtains the Intent for starting the main ability of an application based on the + * Obtains the Want for starting the main ability of an application based on the * given bundle name. The main ability of an application is the ability that has the - * #ACTION_HOME and #ENTITY_HOME intent + * #ACTION_HOME and #ENTITY_HOME Want * filters set in the application's config.json file. * * @devices phone, tablet, tv, wearable * @since 7 * @SysCap SystemCapability.Appexecfwk * @param bundleName Indicates the bundle name of the application. - * @return Returns the Intent for starting the application's main ability if any; returns null if + * @return Returns the Want for starting the application's main ability if any; returns null if * the given bundle does not exist or does not contain any main ability. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED */ @@ -470,6 +574,23 @@ declare namespace bundle { */ function setAbilityEnabled(info: AbilityInfo, isEnable: boolean, callback: AsyncCallback): void; function setAbilityEnabled(info: AbilityInfo, isEnable: boolean): Promise; + + /** + * Query extension info of by utilizing a Want. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @SysCap SystemCapability.Appexecfwk + * @param want Indicates the Want containing the application bundle name to be queried. + * @param extensionFlags Indicates the flag used to specify information contained in the ExtensionInfo objects that + * will be returned. + * @param userId Indicates the user ID. + * @return Returns a list of ExtensionInfo objects. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO + */ + function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId: number, callback: AsyncCallback>): void; + function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, callback: AsyncCallback>): void; + function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId?: number): Promise>; } export default bundle; \ No newline at end of file diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 498bebb88a0ed497e78a84dcd502bbe1a4f4f38c..dfbcea11dae41540078e23fd102a837239841a12 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -194,6 +194,18 @@ declare namespace rdb { */ rollBack(callback: AsyncCallback):void; rollBack(): Promise; + + /** + * Set table to be distributed table. + * + * @note N/A + * @since 8 + * @sysCap SystemCapability.Data.DATA_APPDATAMGR + * @param tables the tables name you want to set + * @devices phone, tablet, tv, wearable, car + */ + setDistributedTables(tables: Array, callback: AsyncCallback): void; + setDistributedTables(tables: Array): Promise; } /** diff --git a/api/@ohos.distributedHardware.deviceManager.d.ts b/api/@ohos.distributedHardware.deviceManager.d.ts index 646861dc96449ab663281565dc6864835c0ce093..69179ba17e203845da9658da477386deed0167ee 100644 --- a/api/@ohos.distributedHardware.deviceManager.d.ts +++ b/api/@ohos.distributedHardware.deviceManager.d.ts @@ -15,9 +15,18 @@ import { AsyncCallback, Callback } from './basic'; +/** + * Providers interfaces to creat a {@link deviceManager} instances. + * + * @since 7 + * @Syscap SystemCapability.DISTRIBUTEDHARDWARE.deviceManager + * + */ declare namespace deviceManager { /** * DeviceInfo + * + * @systemapi this method can be used only by system applications. */ interface DeviceInfo { /** @@ -34,6 +43,13 @@ declare namespace deviceManager { * Device type of the device. */ deviceType: DeviceType; + + /** + * NetworkId of the device. + * + * @since 8 + */ + networkId: string; } /** @@ -78,6 +94,8 @@ declare namespace deviceManager { /** * Device state change event definition + * + * @systemapi this method can be used only by system applications. */ enum DeviceStateChangeAction { /** @@ -242,16 +260,6 @@ declare namespace deviceManager { */ authType: number; - /** - * App application Icon. - */ - appIcon?: Uint8Array; - - /** - * App application thumbnail. - */ - appThumbnail?: Uint8Array; - /** * Authentication extra infos. */ @@ -288,6 +296,7 @@ declare namespace deviceManager { * * @param bundleName Indicates the bundle name of the application. * @param callback Indicates the callback to be invoked upon {@code DeviceManager} instance creation. + * @systemapi this method can be used only by system applications. */ function createDeviceManager(bundleName: string, callback: AsyncCallback): void; @@ -297,19 +306,66 @@ declare namespace deviceManager { interface DeviceManager { /** * Releases the {@code DeviceManager} instance after the methods for device management are no longer used. + * + * @systemapi this method can be used only by system applications. */ release(): void; /** * Obtains a list of trusted devices. * - * @param options Indicates the extra parameters to be passed to this method for device filtering or sorting. - * This parameter can be null. For details about available values, see {@link #TARGET_PACKAGE_NAME} and - * {@link #SORT_TYPE}. * @return Returns a list of trusted devices. + * @systemapi this method can be used only by system applications. */ getTrustedDeviceListSync(): Array; + /** + * Obtains a list of trusted devices. + * + * @since 8 + * @param callback Indicates the callback to be invoked upon getTrustedDeviceList + * @return Returns a list of trusted devices. + * @systemapi this method can be used only by system applications. + */ + getTrustedDeviceList(callback:AsyncCallback>): void; + + /** + * Obtains a list of trusted devices. + * + * @since 8 + * @return Returns a list of trusted devices. + * @systemapi this method can be used only by system applications. + */ + getTrustedDeviceList(): Promise>; + + /** + * Obtains local device info + * + * @since 8 + * @return Returns local device info. + * @systemapi this method can be used only by system applications. + */ + getLocalDeviceInfoSync(): DeviceInfo; + + /** + * Obtains local device info + * + * @since 8 + * @param callback Indicates the callback to be invoked upon getLocalDeviceInfo + * @return Returns local device info. + * @systemapi this method can be used only by system applications. + */ + getLocalDeviceInfo(callback:AsyncCallback): void; + + /** + * Obtains local device info + * + * @since 8 + * @return Returns local device info. + * @systemapi this method can be used only by system applications. + */ + getLocalDeviceInfo(): Promise; + /** * Start to discover device. * @@ -330,12 +386,21 @@ declare namespace deviceManager { * Authenticate the specified device. * * @param deviceInfo deviceInfo of device to authenticate - * @param authparam authparam of device to authenticate + * @param authParam authParam of device to authenticate * @param callback Indicates the callback to be invoked upon authenticateDevice * @systemapi this method can be used only by system applications. */ authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: AsyncCallback<{deviceId: string, pinTone ?: number}>): void; + /** + * unAuthenticate the specified device. + * + * @since 8 + * @param deviceInfo deviceInfo of device to unAuthenticate + * @systemapi this method can be used only by system applications. + */ + unAuthenticateDevice(deviceInfo: DeviceInfo): void + /** * verify auth info, such as pin code. * @@ -345,13 +410,13 @@ declare namespace deviceManager { */ verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback<{deviceId: string, level: number}>): void; - /** * Register a device state callback so that the application can be notified upon device state changes based on * the application bundle name. * * @param bundleName Indicates the bundle name of the application. * @param callback Indicates the device state callback to register. + * @systemapi this method can be used only by system applications. */ on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void; @@ -360,6 +425,7 @@ declare namespace deviceManager { * * @param bundleName Indicates the bundle name of the application. * @param callback Indicates the device state callback to register. + * @systemapi this method can be used only by system applications. */ off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void; @@ -399,6 +465,7 @@ declare namespace deviceManager { * Register a serviceError callback so that the application can be notified when devicemanager service died * * @param callback Indicates the service error callback to register. + * @systemapi this method can be used only by system applications. */ on(type: 'serviceDie', callback: () => void): void; @@ -406,6 +473,7 @@ declare namespace deviceManager { * UnRegister a serviceError callback so that the application can be notified when devicemanager service died * * @param callback Indicates the service error callback to register. + * @systemapi this method can be used only by system applications. */ off(type: 'serviceDie', callback?: () => void): void; } diff --git a/api/@ohos.hilog.ts b/api/@ohos.hilog.ts new file mode 100755 index 0000000000000000000000000000000000000000..75f30d6ea78dc4aca2fffd376ad9b9e5e96c9fe9 --- /dev/null +++ b/api/@ohos.hilog.ts @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** +* Provides interfaces to generate system logs. +* +* @devices tv, phone, tablet, wearable, car +* @since 7 +* @Syscap SystemCapability.HiviewDFX +*/ + +declare namespace hilog { + /** + * Outputs debug-level logs. + * + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param tag Identifies the log tag. + * @param format Indicates the log format string. + * @param args Indicates the log parameters. + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + function debug(domain: number, tag: string, format: string, ...args: any[]) : void; + /** + * Outputs info-level logs. + * + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param tag Identifies the log tag. + * @param format Indicates the log format string. + * @param args Indicates the log parameters. + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + function info(domain: number, tag: string, format: string, ...args: any[]) : void; + /** + * Outputs warning-level logs. + * + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param tag Identifies the log tag. + * @param format Indicates the log format string. + * @param args Indicates the log parameters. + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + function warn(domain: number, tag: string, format: string, ...args: any[]) : void; + /** + * Outputs error-level logs. + * + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param tag Identifies the log tag. + * @param format Indicates the log format string. + * @param args Indicates the log parameters. + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + function error(domain: number, tag: string, format: string, ...args: any[]) : void; + /** + * Outputs fatal-level logs. + * + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param tag Identifies the log tag. + * @param format Indicates the log format string. + * @param args Indicates the log parameters. + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + function fatal(domain: number, tag: string, format: string, ...args: any[]) : void; + /** + * Checks whether logs of the specified tag, and level can be printed. + * + * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF + * @param tag Identifies the log tag. + * @param level log level + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + function isLoggable(domain: number, tag: string, level: LogLevel) : boolean; + /** + * Log level define + */ + enum LogLevel { + DEBUG = 3, + INFO = 4, + WARN = 5, + ERROR = 6, + FATAL = 7, + } +} + +export default hilog; \ No newline at end of file diff --git a/api/@ohos.multimodalInput.inputConsumer.d.ts b/api/@ohos.multimodalInput.inputConsumer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..100ba90e03d44426bcdd5753fea580646f83357c --- /dev/null +++ b/api/@ohos.multimodalInput.inputConsumer.d.ts @@ -0,0 +1,72 @@ +/* +* Copyright (C) 2021 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import { AsyncCallback } from './basic'; + + /** + * The event of key input management module is configured to subscribe and unsubscribe system keys. + * + * @since 8 + * @sysCap SystemCapability.MultimodalInput.MULTIMODAL_INPUT + * @devices phone, tablet, tv, wearable + * @import import inputConsumer from '@ohos.multimodalInput.inputConsumer'; + * @permission N/A + */ + +declare namespace inputConsumer { + /** + * Defines event of key that user want to subscribe or unsubscribe. + * + * @sysCap SystemCapability.MultimodalInput.MULTIMODAL_INPUT + * @param preKeys The pre-keys that want to subscribe or unsubscribe. + * @param finalKey The post position key that want to subscribe or unsubscribe. + * @param isFinalKeyDown The final key press down or up. + * @param finalKeyDownDuration Duration of final key press. + */ + interface KeyOptions { + preKeys: Array; + finalKey: number; + isFinalKeyDown: boolean; + finalKeyDownDuration: number; + } + + /** + * Subscribe system keys. + * + * @since 8 + * @sysCap SystemCapability.MultimodalInput.MULTIMODAL_INPUT + * @devices phone, tablet, tv, wearable + * @permission N/A + * @param type type of the keyevent about input which is to be subscribed. + * @param keyOption the key events about input which is to be subscribed. + * @param callback callback function, receive reported data. + */ + function on(type: string, keyOption: KeyOptions, callback: AsyncCallback): void; + + /** + * Subscribe system keys. + * + * @since 8 + * @sysCap SystemCapability.MultimodalInput.MULTIMODAL_INPUT + * @devices phone, tablet, tv, wearable + * @permission N/A + * @param type type of the keyevent about input which is to be subscribed. + * @param keyOption the key events about input which is to be subscribed. + * @param callback callback function, receive reported data. + */ + function off(type: string, keyOption: KeyOptions, callback: AsyncCallback): void; +} + +export default inputConsumer; \ No newline at end of file diff --git a/api/@ohos.screenshot.d.ts b/api/@ohos.screenshot.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..94f912c24391fab0125559c6b48771623e00fd92 --- /dev/null +++ b/api/@ohos.screenshot.d.ts @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback, ErrorCallback } from './basic'; +import image from './@ohos.multimedia.image'; + +/** + * interface for screenshot + * @devices tv, phone, tablet, wearable, car + * @systemapi Hide this for inner system use. + * @since 7 + */ +declare namespace screenshot { + /** + * Takes a screenshot and saves it as a PixelMap object + * @param options Screenshot options, which consist of screenRect, imageSize, and rotation. You need to set these parameters + * @devices tv, phone, tablet, wearable, car + * @permission ohos.permission.CAPTURE_SCREEN + * @since 7 + */ + function save(options?: ScreenshotOptions): Promise; + + /** + * Describes the region of the screen to capture + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + interface Rect { + left: number; + top: number; + width: number; + height: number; + } + + /** + * Describes the size of the screen region to capture + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + interface Size { + width: number; + height: number; + } + + /** + * Describes screenshot options + * @devices tv, phone, tablet, wearable, car + * @since 7 + */ + interface ScreenshotOptions { + /** + * Region of the screen to capture. If this parameter is null, the full screen will be captured + */ + screenRect?: Rect; + /** + * Region of the screen to capture. If this parameter is null, the full screen will be captured + */ + imageSize?: Size; + /** + * Rotation angle of the screenshot. The value can be 0, 90, 180, or 270. The default value is 0 + */ + rotation?: number; + /** + * The specify screen to be captured. + * @since 8 + */ + displayId?: number; + } +} + +export default screenshot; diff --git a/api/ability/want.d.ts b/api/ability/want.d.ts index af2183ded2e6bd1db19f78012e18925d70a88482..6935e769631d863e6b09af14c439e1eee7ed7c36 100644 --- a/api/ability/want.d.ts +++ b/api/ability/want.d.ts @@ -102,4 +102,22 @@ export declare interface Want { * @default - */ entities?: Array; + + /** + * The description of a extension ability name in a Want. + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + * @default - + */ + extensionAbilityName?: string; + + /** + * The description of a extension ability type in a Want. + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + * @default - + */ + extensionAbilityType?: number; } \ No newline at end of file diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index 3cec14e13d51091937d835afd996c092e1d11450..345363d17e5ce59faf77296a90183b44feb4b241 100644 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -70,7 +70,8 @@ export default class AbilityContext extends Context { * @return Returns the {@link AbilityResult}. */ startAbilityForResult(want: Want, callback: AsyncCallback): void; - startAbilityForResult(want: Want): Promise; + startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void; + startAbilityForResult(want: Want, options?: StartOptions): Promise; /** * Destroys this Page ability. diff --git a/api/bundle/abilityInfo.d.ts b/api/bundle/abilityInfo.d.ts index a7cf71866bcd08b934e02b1cf224f4d6624c853f..863800d2907cf274a84ff8aeb3ec8a099ea28f64 100644 --- a/api/bundle/abilityInfo.d.ts +++ b/api/bundle/abilityInfo.d.ts @@ -15,6 +15,7 @@ import { ApplicationInfo } from './applicationInfo'; import { CustomizeData } from './customizeData' +import { Metadata } from './metadata' import bundle from './../@ohos.bundle'; /** @@ -248,4 +249,18 @@ export interface AbilityInfo { * @SysCap SystemCapability.Appexecfwk */ readonly metaData: Array; + + /** + * @default Indicates the metadata of ability + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly metadata: Array; + + /** + * @default Indicates the metadata of ability + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly enabled: boolean; } diff --git a/api/bundle/applicationInfo.d.ts b/api/bundle/applicationInfo.d.ts index d57fbd7bc891e561202c1dbc797aa4d1e09fb394..49c2482bfabd24e22a0065449d6dfecea731d8b7 100644 --- a/api/bundle/applicationInfo.d.ts +++ b/api/bundle/applicationInfo.d.ts @@ -15,6 +15,7 @@ import { ModuleInfo } from './moduleInfo'; import { CustomizeData } from './customizeData' +import { Metadata } from './metadata' /** * @name Obtains configuration information about an application @@ -148,12 +149,40 @@ export interface ApplicationInfo { * @since 8 * @SysCap SystemCapability.Appexecfwk */ - readonly metaData: Map>; + readonly metaData: Map>; + + /** + * @default Indicates the metadata of module + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly metadata: Array /** * @default Indicates whether or not this application may be removable * @since 8 * @SysCap SystemCapability.Appexecfwk */ - readonly removable: boolean; + readonly removable: boolean; + + /** + * @default Indicates the access token of the application + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly accessTokenId: number; + + /** + * @default Indicates the uid of the application + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly uid: number; + + /** + * @default Indicates entity type of the application + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly entityType: string; } \ No newline at end of file diff --git a/api/bundle/bundleInfo.d.ts b/api/bundle/bundleInfo.d.ts index 6353eaef993782219ad6861054cf73d4e256c9e2..09072dff6a2d2e6b60767f92f2b4a1ef4c08d08a 100644 --- a/api/bundle/bundleInfo.d.ts +++ b/api/bundle/bundleInfo.d.ts @@ -15,6 +15,7 @@ import { AbilityInfo } from './abilityInfo'; import { ApplicationInfo } from './applicationInfo'; +import { ExtensionAbilityInfo } from './extensionAbilityInfo'; import { HapModuleInfo } from './hapModuleInfo'; /** @@ -234,4 +235,18 @@ export interface BundleInfo { * @SysCap SystemCapability.Appexecfwk */ readonly entryInstallationFree: boolean; + + /** + * @default Indicates whether free installation of the entry is supported + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly reqPermissionStates: Array; + + /** + * @default Obtains configuration information about an ability + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly extensionAbilityInfo: Array; } diff --git a/api/bundle/extensionAbilityInfo.d.ts b/api/bundle/extensionAbilityInfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..57888bb5c5801834f3c049385dae13fab73db5d7 --- /dev/null +++ b/api/bundle/extensionAbilityInfo.d.ts @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ApplicationInfo } from './applicationInfo'; +import { Metadata } from './metadata' +import bundle from './../@ohos.bundle'; + +/** + * @name Obtains extension information about a bundle + * @since 8 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface ExtensionAbilityInfo { + /** + * @default Indicates the name of the bundle + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly bundleName: string; + + /** + * @default Indicates the name of the module + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly moduleName: string; + + /** + * @default Indicates the name of the extension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly name: string; + + /** + * @default Indicates the label id of the entension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly labelId: number; + + /** + * @default Indicates the description id of the entension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly descriptionId: number; + + /** + * @default Indicates the icon id of the entension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly iconId: number; + + /** + * @default Indicates whether the entensionInfo can be visible or not + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly isVisible: boolean; + + /** + * @default Enumerates types of the entension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly extensionAbilityType: bundle.ExtensionAbilityType; + + /** + * @default The permissions that others need to use this extension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly permissions: Array; + + /** + * @default Obtains configuration information about an application + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly applicationInfo: ApplicationInfo; + + /** + * @default Indicates the metadata of bundle + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly metadata: Array; + + /** + * @default Indicates the src language to express extension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly enabled: boolean; + + /** + * @default Indicates the read permission extension ability info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly readPermission: string; + + /** + * @default Indicates the write permission of extension ability info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly writePermission: string; +} diff --git a/api/bundle/hapModuleInfo.d.ts b/api/bundle/hapModuleInfo.d.ts index a62a66955d341a076b9600c522bf4c14e2ae7be9..067bc267565489d14a9416fcc2c90ec5df94d19a 100644 --- a/api/bundle/hapModuleInfo.d.ts +++ b/api/bundle/hapModuleInfo.d.ts @@ -14,6 +14,7 @@ */ import { AbilityInfo } from "./abilityInfo"; +import { ExtensionAbilityInfo } from "./extensionAbilityInfo"; /** * @name Obtains configuration information about an module. @@ -113,4 +114,18 @@ export interface HapModuleInfo { * @SysCap SystemCapability.Appexecfwk */ readonly installationFree: boolean; + + /** + * @default Indicates main elementName of the module + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly mainElementName: string; + + /** + * @default Obtains configuration information about extension ability + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly extensionAbilityInfo: Array; } \ No newline at end of file diff --git a/api/bundle/metadata.d.ts b/api/bundle/metadata.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..43f3dba9ea744431b316ab16dabe74de668e38d1 --- /dev/null +++ b/api/bundle/metadata.d.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + /** + * @name Indicates the Metadata + * @since 8 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ + export interface Metadata { + /** + * @default Indicates the metadata name + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + name: string; + + /** + * @default Indicates the metadata value + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + value: string; + + /** + * @default Indicates the metadata resource + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + resource: string; + } \ No newline at end of file