diff --git a/api/@internal/component/ets/ability_component.d.ts b/api/@internal/component/ets/ability_component.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..43524e4129ae0b9472a4f6abd95c4f1e001fffab --- /dev/null +++ b/api/@internal/component/ets/ability_component.d.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Want } from '../../../ability/want'; + +/** + * Provides an interface for the ability component. + * @since 9 + */ +interface AbilityComponentInterface { + /** + * Construct the ability component. + * Called when the ability component is used. + * @since 9 + */ + (want: Want): AbilityComponentAttribute; +} + +/** + * Defines the attribute functions of ability component. + * @since 9 + */ +declare class AbilityComponentAttribute extends CommonMethod { + /** + * Called when the component connected with ability. + * @since 9 + */ + onConnect(callback: () => void): AbilityComponentAttribute; + /** + * Called when the component onDisconnected with ability. + * @since 9 + */ + onDisconnect(callback: () => void): AbilityComponentAttribute; +} + +declare const abilityComponent: AbilityComponentInterface; +declare const abilityComponentInstance: AbilityComponentAttribute; diff --git a/api/@internal/component/ets/index-full.d.ts b/api/@internal/component/ets/index-full.d.ts index 25e737704ec1431e8d9a54197941dfc40709c9f0..43c35f1f8e9b0fafa765d7511cad4287b97c20b8 100644 --- a/api/@internal/component/ets/index-full.d.ts +++ b/api/@internal/component/ets/index-full.d.ts @@ -99,3 +99,4 @@ /// /// /// +/// \ No newline at end of file diff --git a/api/@internal/component/ets/sidebar.d.ts b/api/@internal/component/ets/sidebar.d.ts index e38f1ad790401262cc06ccf9b87e908c06708fcc..dcd1d9b9b4d667928d234ee92a223789c48977cd 100644 --- a/api/@internal/component/ets/sidebar.d.ts +++ b/api/@internal/component/ets/sidebar.d.ts @@ -107,21 +107,30 @@ declare class SideBarContainerAttribute extends CommonMethod void): SideBarContainerAttribute; /** * Sets the length of sidebar. - * @since 8 + * Notice: only supports 'number' type on 8, supports 'Length' type since 9. + * @since 9 */ - sideBarWidth(value: number): SideBarContainerAttribute; + sideBarWidth(value: Length): SideBarContainerAttribute; /** * Sets the min length of sidebar. * default value is 200vp. - * @since 8 + * Notice: only supports 'number' type on 8, supports 'Length' type since 9. + * @since 9 */ - minSideBarWidth(value: number): SideBarContainerAttribute; + minSideBarWidth(value: Length): SideBarContainerAttribute; /** * Sets the max length of sidebar. * default value is 280vp. - * @since 8 + * Notice: only supports 'number' type on 8, supports 'Length' type since 9. + * @since 9 + */ + maxSideBarWidth(value: Length): SideBarContainerAttribute; + /** + * Sets whether to automatically hide when drag sidebar width is less than the minimum width. + * default value is true. + * @since 9 */ - maxSideBarWidth(value: number): SideBarContainerAttribute; + autoHide(value: boolean): SideBarContainerAttribute; } declare const SideBarContainer: SideBarContainerInterface; diff --git a/api/@internal/component/ets/state_management.d.ts b/api/@internal/component/ets/state_management.d.ts index 116989c36d283412ddb701261dae99e1e7d73e3c..7054019e1aab4c057eb414ec5cd990a9b849a413 100644 --- a/api/@internal/component/ets/state_management.d.ts +++ b/api/@internal/component/ets/state_management.d.ts @@ -637,7 +637,7 @@ declare class LocalStorage { * add property if not property with given name * @since 9 */ - setOrCreate(propName: string, newValue: T): boolean; + setOrCreate(propName: string, newValue?: T): boolean; /** * create and return a 'link' (two-way sync) to named property diff --git a/api/@ohos.application.Ability.d.ts b/api/@ohos.application.Ability.d.ts index 339a0d9858c0b620ef200575351aeff2efc2f831..a21f430a775b61f4687d2fbb35eea00f4f895540 100755 --- a/api/@ohos.application.Ability.d.ts +++ b/api/@ohos.application.Ability.d.ts @@ -18,7 +18,7 @@ import AbilityContext from "./application/AbilityContext"; import Want from './@ohos.application.Want'; import window from './@ohos.window'; import { Configuration } from './@ohos.application.Configuration'; -import rpc from '/@ohos.rpc'; +import rpc from './@ohos.rpc'; /** * The prototype of the listener function interface registered by the Caller. diff --git a/api/@ohos.application.AbilityLifecycleCallback.d.ts b/api/@ohos.application.AbilityLifecycleCallback.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..13ec3ef6bbb44a9788bafff2b82417468ad05822 --- /dev/null +++ b/api/@ohos.application.AbilityLifecycleCallback.d.ts @@ -0,0 +1,95 @@ +/* + * 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 Ability from "./@ohos.application.Ability"; + +/** + * The ability lifecycle callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + */ +export default class AbilityLifecycleCallback { + /** + * Called back when the ability is started for initialization. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @StageModelOnly + */ + onAbilityCreate(ability: Ability): void; + + /** + * Called back when the ability window stage is created. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @StageModelOnly + */ + onAbilityWindowStageCreate(ability: Ability): void; + + /** + * Called back when the ability window stage is created. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @StageModelOnly + */ + onAbilityWindowStageDestroy(ability: Ability): void; + + /** + * Called back when the ability window stage is created. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @StageModelOnly + */ + onAbilityDestroy(ability: Ability): void; + + /** + * Called back when the ability window stage is created. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @StageModelOnly + */ + onAbilityForeground(ability: Ability): void; + + /** + * Called back when the ability window stage is created. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @StageModelOnly + */ + onAbilityBackground(ability: Ability): void; + + /** + * Called back when the ability window stage is created. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @StageModelOnly + */ + onAbilityContinue(ability: Ability): void; +} \ No newline at end of file diff --git a/api/@ohos.application.WindowExtensionAbility.d.ts b/api/@ohos.application.WindowExtensionAbility.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6d24e6bbdf898e4f01b0e1f876acdd2c6d0b2ad4 --- /dev/null +++ b/api/@ohos.application.WindowExtensionAbility.d.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import rpc from "./@ohos.rpc"; +import ExtensionContext from "./application/ExtensionContext"; +import Want from './@ohos.application.Want'; + +/** + * class of window extension ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + * @StageModelOnly + */ +export default class WindowExtensionAbility { + /** + * Indicates window extension ability context. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + * @StageModelOnly + */ + context: ExtensionContext; + + /** + * Called back when a window extension is first connected to an ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates connection information about the Window ability. + * @systemapi hide for inner use. + * @return Returns the proxy of the Window ability. + * @StageModelOnly + */ + onConnect(want: Want): rpc.RemoteObject; + + /** + * Called back when all abilities connected to a window extension are disconnected. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates disconnection information about the window extension. + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + onDisconnect(want: Want): void; + + /** + * Called back when window is created. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + onWindowReady(window: Window): void; +} + diff --git a/api/@ohos.application.abilityManager.d.ts b/api/@ohos.application.abilityManager.d.ts index fd21468aa808e67e054c8b8b83f358c1c40d0ebb..1546b095a45657e84908068ad75eec0d05927704 100644 --- a/api/@ohos.application.abilityManager.d.ts +++ b/api/@ohos.application.abilityManager.d.ts @@ -17,6 +17,7 @@ import { AsyncCallback } from './basic'; import { Configuration } from './@ohos.application.Configuration'; import { AbilityRunningInfo } from './application/AbilityRunningInfo'; import { ExtensionRunningInfo } from './application/ExtensionRunningInfo'; +import { ElementName } from './bundle/elementName'; /** * The class of an ability manager. @@ -79,6 +80,17 @@ declare namespace abilityManager { */ function getExtensionRunningInfos(upperLimit: number): Promise>; function getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback>): void; + + /** + * Get the top ability information of the display. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi Hide this for inner system use. + * @return Returns the {@link ElementName} info of the top ability. + */ + function getTopAbility(): Promise; + function getTopAbility(callback: AsyncCallback): void; } export default abilityManager; \ No newline at end of file diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 4f958a1c58f6c550c14ba3e09c99a067e3addab0..3ae4e909fb0ff6309adfdab21c79b061d5c826db 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -18,7 +18,7 @@ import { ApplicationInfo } from './bundle/applicationInfo'; import { BundleInfo } from './bundle/bundleInfo'; import { AbilityInfo } from './bundle/abilityInfo'; import { ExtensionAbilityInfo } from './bundle/extensionAbilityInfo'; -import Want from './@ohos.application.want'; +import { Want } from './ability/want'; import { BundleInstaller } from './bundle/bundleInstaller'; import { PermissionDef } from './bundle/PermissionDef'; import image from './@ohos.multimedia.image'; @@ -289,6 +289,12 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework */ BACKUP = 9, + /** + * @default Indicates extension info with type of window + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + WINDOW = 10, /** * @default Indicates extension info with type of unspecified * @since 9 diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 988080d255af111a9841458da9d2b30e3565bc6b..11ecf6dc418590331e6f6ad8c9e1fcaabaa20823 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -65,6 +65,27 @@ declare namespace window { FLOATING } + /** + * Describes the mode of window layout + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 + */ + enum WindowLayoutMode { + /** + * CASCADE + * @systemapi Hide this for inner system use. + * @since 9 + */ + WINDOW_LAYOUT_MODE_CASCADE, + /** + * TILE + * @systemapi Hide this for inner system use. + * @since 9 + */ + WINDOW_LAYOUT_MODE_TILE + } + /** * Properties of status bar and navigation bar, it couldn't update automatically * @syscap SystemCapability.WindowManager.WindowManager.Core @@ -380,6 +401,50 @@ declare namespace window { */ function getTopWindow(ctx: Context, callback: AsyncCallback): void; + /** + * minimize all app windows. + * @systemapi Hide this for inner system use. + * @since 9 + */ + function minimizeAll(id: number, callback: AsyncCallback): void; + + /** + * minimize all app windows. + * @systemapi Hide this for inner system use. + * @since 9 + */ + function minimizeAll(id: number): Promise; + + /** + * Toggle shown state for all app windows. Minimize or restore all app windows. + * @systemapi Hide this for inner system use. + * @since 9 + */ + function toggleShownStateForAllAppWindows(callback: AsyncCallback): void; + + /** + * Toggle shown state for all app windows. Minimize or restore all app windows. + * @systemapi Hide this for inner system use. + * @since 9 + */ + function toggleShownStateForAllAppWindows(): Promise; + + /** + * Set the layout mode of a window. + * @param mode the layout mode of a window. + * @systemapi Hide this for inner system use. + * @since 9 + */ + function setWindowLayoutMode(mode: WindowLayoutMode, callback: AsyncCallback): void; + + /** + * Set the layout mode of a window. + * @param mode the layout mode of a window. + * @systemapi Hide this for inner system use. + * @since 9 + */ + function setWindowLayoutMode(mode: WindowLayoutMode): Promise; + /** * register the callback of systemBarTintChange * @param type: 'systemBarTintChange' diff --git a/api/application/AbilityStateData.d.ts b/api/application/AbilityStateData.d.ts index 0f32059761ff63dca219ea171c1bd8169d32ca2b..5015be8fbfeada14009925496e15159666e51054 100644 --- a/api/application/AbilityStateData.d.ts +++ b/api/application/AbilityStateData.d.ts @@ -22,6 +22,15 @@ * @permission N/A */ export default class AbilityStateData { + /** + * The module name. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + */ + moduleName: string; + /** * The bundle name. * diff --git a/api/application/ApplicationContext.d.ts b/api/application/ApplicationContext.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..eb6b30bf9afdacda5a528d96c29cd4d52595eed5 --- /dev/null +++ b/api/application/ApplicationContext.d.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "../basic"; +import Context from "./Context"; +import AbilityLifecycleCallback from "../@ohos.application.AbilityLifecycleCallback"; + +/** + * The context of an application. It allows access to application-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ +export default class ApplicationContext extends Context { + /** + * Register ability lifecycle callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param callback The ability lifecycle callback. + * @return Returns the number code of the callback. + * @StageModelOnly + */ + registerAbilityLifecycleCallback(callback: AbilityLifecycleCallback): number; + + /** + * Unregister ability lifecycle callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param callbackId Indicates the number code of the callback. + * @return - + * @StageModelOnly + */ + unregisterAbilityLifecycleCallback(callbackId: number, callback: AsyncCallback): void; + unregisterAbilityLifecycleCallback(callbackId: number): Promise; +} diff --git a/api/application/Context.d.ts b/api/application/Context.d.ts index 2822761d4cee9e4d7828a6263c4ef9660498a557..1f45ba5fb1e20038da1f13f328f8df36ccca034f 100755 --- a/api/application/Context.d.ts +++ b/api/application/Context.d.ts @@ -17,6 +17,7 @@ import { ApplicationInfo } from "../bundle/applicationInfo"; import resmgr from "../@ohos.resourceManager"; import BaseContext from "./BaseContext"; import EventHub from "./EventHub"; +import ApplicationContext from "./ApplicationContext"; /** * The base context of an ability or an application. It allows access to @@ -139,7 +140,7 @@ export default class Context extends BaseContext { * @return application context * @StageModelOnly */ - getApplicationContext(): Context; + getApplicationContext(): ApplicationContext; /** * Switch file area