diff --git a/api/@ohos.EnterpriseAdminExtensionAbility.d.ts b/api/@ohos.EnterpriseAdminExtensionAbility.d.ts deleted file mode 100644 index a290390863bed628f4684622785e432018d53d7f..0000000000000000000000000000000000000000 --- a/api/@ohos.EnterpriseAdminExtensionAbility.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Class of the enterprise admin extension ability. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @StageModelOnly - */ -export default class EnterpriseAdminExtensionAbility { - /** - * Called back when an application is enabled. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @StageModelOnly - */ - onAdminEnabled(): void; - - /** - * Called back when an application is disabled. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @StageModelOnly - */ - onAdminDisabled(): void; -} \ No newline at end of file diff --git a/api/@ohos.enterprise.AdminExtensionAbility.d.ts b/api/@ohos.enterprise.AdminExtensionAbility.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0d2970446ecc693168873948ed87b82bab240a3c --- /dev/null +++ b/api/@ohos.enterprise.AdminExtensionAbility.d.ts @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The class of the enterprise admin extension ability. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +export default class AdminExtensionAbility { + /** + * Called back when an application is enabled. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onAdminEnabled(): void; + + /** + * Called back when an application is disabled. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onAdminDisabled(): void; + + /** + * Called back when a bundle is installed. + * @param { string } bundleName - bundleName indicates the name of the bundle installed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onBundleAdded(bundleName: string): void; + + /** + * Called back when a bundle is uninstalled. + * @param { string } bundleName - bundleName indicates the name of the bundle uninstalled. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onBundleRemoved(bundleName: string): void; + + /** + * Called back when an application start. + * @param { string } bundleName - bundleName indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onAppStart(bundleName: string): void; + + /** + * Called back when an application stop. + * @param { string } bundleName - bundleName indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onAppStop(bundleName: string): void; + + /** + * Called back when an application get content on paste board. + * @param { string } bundleName - bundleName indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onPasteBoardGet(bundleName: string): void; + + /** + * Called back when an application set content to paste board. + * @param { string } bundleName - bundleName indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onPasteBoardSet(bundleName: string): void; + + /** + * Called back when an application screenshot. + * @param { string } bundleName - bundleName indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onScreenshot(bundleName: string): void; + + /** + * Called back when an application start share screen. + * @param { string } bundleName - bundleName indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onShareScreenStart(bundleName: string): void; + + /** + * Called back when an application stop share screen. + * @param { string } bundleName - bundleName indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onShareScreenStop(bundleName: string): void; +} \ No newline at end of file diff --git a/api/@ohos.enterprise.accountManager.d.ts b/api/@ohos.enterprise.accountManager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a71fafd55db106de381502810c1232dc189e21ed --- /dev/null +++ b/api/@ohos.enterprise.accountManager.d.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.application.Want"; + +/** + * This module offers set account policies on the devices. + * @namespace accountManager + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace accountManager { + /** + * Disallow add local account. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_ACCOUNT_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { boolean } disallow - True if disallow add local account, otherwise false. + * @param { AsyncCallback } callback - the callback of disalloweAddLocalAccount. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disalloweAddLocalAccount(admin: Want, disallow: boolean, callback: AsyncCallback): void; + /** + * Disallow add local account. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_ACCOUNT_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { boolean } disallow - True if disallow add local account, otherwise false. + * @returns { Promise } the promise returned by the disalloweAddLocalAccount. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disalloweAddLocalAccount(admin: Want, disallow: boolean): Promise; +} + +export default accountManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.adminManager.d.ts b/api/@ohos.enterprise.adminManager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b60312f81822a1b453ebe8a97a2430bcfd35eb16 --- /dev/null +++ b/api/@ohos.enterprise.adminManager.d.ts @@ -0,0 +1,455 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.application.Want"; + +/** + * The enterprise admin manager. + * @namespace adminManager + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace adminManager { + + /** + * @typedef EnterpriseInfo + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + export interface EnterpriseInfo { + /** + * The name of enterprise. + * @type { string } + * @since 9 + */ + name: string; + + /** + * The description of enterprise. + * @type { string } + * @since 9 + */ + description: string; + } + + /** + * Enum for admin type. + * @enum { number } + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + export enum AdminType { + /** + * The value of normal admin. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + ADMIN_TYPE_NORMAL = 0x00, + /** + * The value of super admin. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + ADMIN_TYPE_SUPER = 0x01 + } + + /** + * Enum for system event. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @enum { number } + * @since 9 + */ + export enum ManagedEvent { + /** + * The event of bundle added. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_BUNDLE_ADDED = 0, + /** + * The event of bundle removed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_BUNDLE_REMOVED = 1, + /** + * The event of app start. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_APP_START = 2, + /** + * The event of app stop. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_APP_STOP = 3, + /** + * The event of get paste board. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_PASTE_BOARD_GET = 4, + /** + * The event of set paste board. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_PASTE_BOARD_SET = 5, + /** + * The event of paste screenshot. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_PASTE_SCREENSHOT = 6, + /** + * The event of share screen start. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_SHARE_SCREEN_START = 7, + /** + * The event of share screen stop. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_SHARE_SCREEN_STOP = 8 + } + + /** + * Enables the given ability as a administrator of the device. + * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN + * @param { Want } admin - admin indicates the administrator ability information. + * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. + * @param { AdminType } type - type indicates the type of administrator to set. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of enableAdmin. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200004 - failed to activate the adminstrator application of the device. + * @throws { BusinessError } 9200006 - the specified user ID is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + * + */ + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback): void; + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback): void; + /** + * Enables the given ability as a administrator of the device. + * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN + * @param { Want } admin - admin indicates the administrator ability information. + * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. + * @param { AdminType } type - type indicates the type of administrator to set. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the enableAdmin. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200004 - failed to activate the adminstrator application of the device. + * @throws { BusinessError } 9200006 - the specified user ID is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + * + */ + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise; + + /** + * Disables a current normal administrator ability. + * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of disableAdmin. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200005 - failed to deactivate the administrator application of the device. + * @throws { BusinessError } 9200006 - the specified user ID is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disableAdmin(admin: Want, callback: AsyncCallback): void; + function disableAdmin(admin: Want, userId: number, callback: AsyncCallback): void; + /** + * Disables a current normal administrator ability. + * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the disableAdmin. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200005 - failed to deactivate the administrator application of the device. + * @throws { BusinessError } 9200006 - the specified user ID is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disableAdmin(admin: Want, userId?: number): Promise; + + /** + * Disables a current super administrator ability. + * Only the administrator app or apps with the shell uid can call this method. + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN + * @param { string } bundleName - bundleName indicates the administrator bundle information. + * @param { AsyncCallback } callback - the callback of disableSuperAdmin. + * @throws { BusinessError } 9200005 - failed to deactivate the administrator application of the device. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disableSuperAdmin(bundleName: String, callback: AsyncCallback): void; + /** + * Disables a current super administrator ability. + * Only the administrator app or apps with the shell uid can call this method. + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN + * @param { string } bundleName - bundleName indicates the administrator bundle information. + * @returns { Promise } the promise returned by the disableSuperAdmin. + * @throws { BusinessError } 9200005 - failed to deactivate the administrator application of the device. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disableSuperAdmin(bundleName: String): Promise; + + /** + * Get whether the ability is enabled as device administrator. + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of isAdminEnabled. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200006 - the specified user ID is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isAdminEnabled(admin: Want, callback: AsyncCallback): void; + function isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback): void; + /** + * Get whether the ability is enabled as device administrator. + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the isAdminEnabled. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200006 - the specified user ID is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isAdminEnabled(admin: Want, userId?: number): Promise; + + /** + * Get information of the administrator's enterprise. + * @permission ohos.permission.SET_ENTERPRISE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getEnterpriseInfo. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getEnterpriseInfo(admin: Want, callback: AsyncCallback): void; + /** + * Get information of the administrator's enterprise. + * @permission ohos.permission.SET_ENTERPRISE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by the getEnterpriseInfo. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getEnterpriseInfo(admin: Want): Promise; + + /** + * Set the information of the administrator's enterprise. + * Only the administrator app can call this method. + * @permission ohos.permission.SET_ENTERPRISE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. + * @param { AsyncCallback } callback - the callback of setEnterpriseInfo. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback): void; + /** + * Set the information of the administrator's enterprise. + * Only the administrator app can call this method. + * @permission ohos.permission.SET_ENTERPRISE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. + * @returns { Promise } the promise returned by the setEnterpriseInfo. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise; + + /** + * Get whether the ability is enabled as super device administrator. + * @param { string } bundleName - bundleName indicates the administrator bundle information. + * @param { AsyncCallback } callback - the callback of isSuperAdmin. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isSuperAdmin(bundleName: String, callback: AsyncCallback): void; + /** + * Get whether the ability is enabled as super device administrator. + * @param { string } bundleName - bundleName indicates the administrator bundle information. + * @returns { Promise } the promise returned by the isSuperAdmin. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isSuperAdmin(bundleName: String): Promise; + + /** + * Subscribes the managed event of admin. + * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } managedEvents - managedEvents indicates the managed events to subscribe. + * @param { AsyncCallback } callback - the callback of subscribeManagedEvent. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 9200008 - the specified system events enum is invalid. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function subscribeManagedEvent(admin: Want, managedEvents: Array, callback: AsyncCallback): void; + /** + * Subscribes the managed event of admin. + * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } managedEvents - managedEvents indicates the managed events to subscribe. + * @returns { Promise } the promise returned by the subscribeManagedEvent. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 9200008 - the specified system events enum is invalid. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function subscribeManagedEvent(admin: Want, managedEvents: Array): Promise; + + /** + * Unsubscribes the managed event of admin. + * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } managedEvents - managedEvents indicates the managed events to subscribe. + * @param { AsyncCallback } callback - the callback of unsubscribeManagedEvent. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 9200008 - the specified system events enum is invalid. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function unsubscribeManagedEvent(admin: Want, managedEvents: Array, callback: AsyncCallback): void; + /** + * Unsubscribes the managed event of admin. + * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } managedEvents - managedEvents indicates the managed events to subscribe. + * @returns { Promise } the promise returned by the unsubscribeManagedEvent. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 9200008 - the specified system events enum is invalid. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function unsubscribeManagedEvent(admin: Want, managedEvents: Array): Promise; +} + +export default adminManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.applicationManager.d .ts b/api/@ohos.enterprise.applicationManager.d .ts new file mode 100644 index 0000000000000000000000000000000000000000..ba86294a7177ce90f8ac1d0364b8b26f9fe6067d --- /dev/null +++ b/api/@ohos.enterprise.applicationManager.d .ts @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.application.Want"; + +/** + * This nodule offers application management. + * @namespace applicationManager + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace applicationManager { + /** + * Adds disallowed running list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed running. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of addDisallowedRunningBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function addDisallowedRunningBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function addDisallowedRunningBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + /** + * Adds disallowed running list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed running. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promiose returned by the addDisallowedRunningBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function addDisallowedRunningBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Removes disallowed running list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed running. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of removeDisallowedRunningBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter.s + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function removeDisallowedRunningBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function removeDisallowedRunningBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + /** + * Removes disallowed running list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed running. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promiose returned by the removeDisallowedRunningBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function removeDisallowedRunningBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Gets disallowed running list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + * @since 9 + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback> } callback - the callback of getDisallowedRunningBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDisallowedRunningBundles(admin: Want, userId: number, callback: AsyncCallback>): void; + function getDisallowedRunningBundles(admin: Want, callback: AsyncCallback>): void; + /** + * Gets disallowed running list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + * @since 9 + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise> } the promiose returned by the getDisallowedRunningBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDisallowedRunningBundles(admin: Want, userId?: number): Promise>; +} + +export default applicationManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.bundleManager.d.ts b/api/@ohos.enterprise.bundleManager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e801344b2c958bf2818639085bfdcd7bd3967ca1 --- /dev/null +++ b/api/@ohos.enterprise.bundleManager.d.ts @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.application.Want"; + +/** + * This module offers application management. + * @namespace bundleManager + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace bundleManager { + /** + * Adds the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of addDisallowedUninstallBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function addDisallowedUninstallBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function addDisallowedUninstallBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + /** + * Adds the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by addDisallowedUninstallBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function addDisallowedUninstallBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Removes the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of removeDisallowedUninstallBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function removeDisallowedUninstallBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function removeDisallowedUninstallBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + /** + * Removes the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by removeDisallowedUninstallBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function removeDisallowedUninstallBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Gets the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback> } callback - the callback of getDisallowedUninstallBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDisallowedUninstallBundles(admin: Want, userId: number, callback: AsyncCallback>): void; + function getDisallowedUninstallBundles(admin: Want, callback: AsyncCallback>): void; + /** + * Gets the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise> } the promise returned by getDisallowedUninstallBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDisallowedUninstallBundles(admin: Want, userId?: number): Promise>; + + /** + * Adds the allowed install list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of addAllowedInstallBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function addAllowedInstallBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function addAllowedInstallBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + /** + * Adds the allowed install list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by addAllowedInstallBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function addAllowedInstallBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Removes allowed install list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of removeAllowedInstallBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function removeAllowedInstallBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function removeAllowedInstallBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + /** + * Removes allowed install list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by removeAllowedInstallBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function removeAllowedInstallBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Gets allowed install list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback> } callback - the callback of getAllowedInstallBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getAllowedInstallBundles(admin: Want, userId: number, callback: AsyncCallback>): void; + function getAllowedInstallBundles(admin: Want, callback: AsyncCallback>): void; + /** + * Gets allowed install list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise> } the promise returned by getAllowedInstallBundles. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getAllowedInstallBundles(admin: Want, userId?: number): Promise>; +} + +export default bundleManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.datetimeManager.d.ts b/api/@ohos.enterprise.datetimeManager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..51659119aff547ff7c149ea16053d9da4e474341 --- /dev/null +++ b/api/@ohos.enterprise.datetimeManager.d.ts @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.application.Want"; + +/** + * This module offers set restricted policies on the devices. + * @namespace dateTimeManager + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace dateTimeManager { + /** + * Sets the system time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } time - time indicates rhe target time stamp (ms). + * @param { AsyncCallback } callback - the callback of setDateTime. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator applicayion does not have permission to manage the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setDateTime(admin: Want, time: number, callback: AsyncCallback): void; + /** + * Sets the system time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } time - time indicates rhe target time stamp (ms). + * @returns { Promise } the promise returned by the setDateTime. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator applicayion does not have permission to manage the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setDateTime(admin: Want, time: number): Promise; + + /** + * Disallow the modificationing of date time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { boolean } disallow - True if set the modificationing of date time disabled, otherwise false. + * @param { AsyncCallback } callback - the callback of disallowModifyDateTime. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disallowModifyDateTime(admin: Want, disallow: boolean, callback: AsyncCallback): void; + /** + * Disallow the modificationing of date time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { boolean } disallow - True if set the modificationing of date time disabled, otherwise false. + * @returns { Promise } the promise returned by the disallowModifyDateTime. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disallowModifyDateTime(admin: Want, disallow: boolean): Promise; + + /** + * Gets state of whether the modificationing of date time is disallowed. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of isModifyDateTimeDisallowed. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isModifyDateTimeDisallowed(admin: Want, callback: AsyncCallback): void; + /** + * Gets state of whether the modificationing of date time is disallowed. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by the isModifyDateTimeDisallowed. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isModifyDateTimeDisallowed(admin: Want): Promise; +} + +export default dateTimeManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.deviceControl.d.ts b/api/@ohos.enterprise.deviceControl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8fc334a429a193040d631fdbcccc715e729c5d94 --- /dev/null +++ b/api/@ohos.enterprise.deviceControl.d.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.application.Want"; + +/** + * This module offers set control polices on the devices. + * @namespace deviceControl + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace deviceControl { + /** + * Resets the device factory. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_RESET_DEVICE + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of resetFactory. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function resetFactory(admin: Want, callback: AsyncCallback): void; + /** + * Resets the device factory. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_RESET_DEVICE + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by resetFactory. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function resetFactory(admin: Want): Promise; +} + +export default deviceControl; \ No newline at end of file diff --git a/api/@ohos.enterprise.deviceInfo.ts b/api/@ohos.enterprise.deviceInfo.ts new file mode 100644 index 0000000000000000000000000000000000000000..7c2484230af9922d593c382dac7c049ceb7dc788 --- /dev/null +++ b/api/@ohos.enterprise.deviceInfo.ts @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.application.Want"; + +/** + * This module offers set or get device info policies on the devices. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace deviceInfo { + /** + * Get the serial of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getDeviceSerial. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDeviceSerial(admin: Want, callback: AsyncCallback): void; + /** + * Get the serial of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by getDeviceSerial. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDeviceSerial(admin: Want): Promise; + + /** + * Get the display version of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getDisplayVersion. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDisplayVersion(admin: Want, callback: AsyncCallback): void; + /** + * Get the display version of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by getDisplayVersion. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDisplayVersion(admin: Want): Promise; + + /** + * Get the device name of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getDeviceName. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDeviceName(admin: Want, callback: AsyncCallback): void; + /** + * Get the device name of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by getDeviceName. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDeviceName(admin: Want): Promise; + + /** + * Get the hard disk serial of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getHardDiskSerial. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getHardDiskSerial(admin: Want, callback: AsyncCallback): void; + /** + * Get the hard disk serial of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by getHardDiskSerial. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getHardDiskSerial(admin: Want): Promise; +} + +export default deviceInfo; \ No newline at end of file diff --git a/api/@ohos.enterprise.deviceSettings.d.ts b/api/@ohos.enterprise.deviceSettings.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b88d3ed2f6d2098fd362f9226c141d832da10b66 --- /dev/null +++ b/api/@ohos.enterprise.deviceSettings.d.ts @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.application.Want"; + +/** + * This module offers set settings policies on the devices. + * @namespace deviceSettings + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace deviceSettings { + /** + * Sets the screen off time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_SCREENOFF_TIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } time - time indicates rhe target time stamp (ms). + * @param { AsyncCallback } callback - the callback of setScreenOffTime. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setScreenOffTime(admin: Want, time: number, callback: AsyncCallback): void; + /** + * Sets the screen off time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_SCREENOFF_TIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } time - time indicates rhe target time stamp (ms). + * @returns { Promise } the promise returned by setScreenOffTime. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setScreenOffTime(admin: Want, time: number): Promise; + + /** + * Gets the screen off time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_SCREENOFF_TIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getScreenOffTime. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getScreenOffTime(admin: Want, callback: AsyncCallback): void; + /** + * Gets the screen off time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_SCREENOFF_TIME + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by getScreenOffTime. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getScreenOffTime(admin: Want): Promise; +} + +export default deviceSettings; \ No newline at end of file diff --git a/api/@ohos.enterprise.networkManager.ts b/api/@ohos.enterprise.networkManager.ts new file mode 100644 index 0000000000000000000000000000000000000000..557ad00bae80d8a3d4c576c1c982528c5c344bb6 --- /dev/null +++ b/api/@ohos.enterprise.networkManager.ts @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.application.Want"; + +/** + * This module offers set network policies on the devices. + * @namespace networkManager + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace networkManager { + + /** + * Gets all of the network interfaces of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback> } callback - the callback of getAllNetworkInterfaces. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getAllNetworkInterfaces(admin: Want, callback: AsyncCallback>): void; + /** + * Gets all of the network interfaces of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise> } the promise returned by getAllNetworkInterfaces. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getAllNetworkInterfaces(admin: Want): Promise>; + + /** + * Gets the ip address of the network interface. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get ip address. + * @param { AsyncCallback } callback - the callback of getIpAddress. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getIpAddress(admin: Want, networkInterface: string, callback: AsyncCallback): void; + /** + * Gets the ip address of the network interface. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get ip address. + * @returns { Promise } the promise returned by getIpAddress. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getIpAddress(admin: Want, networkInterface: string): Promise; + + /** + * Gets the mac address of the network interface. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get mac address. + * @param { AsyncCallback } callback - the callback of getMac. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getMac(admin: Want, networkInterface: string, callback: AsyncCallback): void; + /** + * Gets the mac address of the network interface. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get mac address. + * @returns { Promise } the promise returned by getMac. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getMac(admin: Want, networkInterface: string): Promise; + + /** + * Gets the status of the network interface. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get status. + * @param { AsyncCallback } callback - the callback of getNetworkInterfaceStatus. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getNetworkInterfaceStatus(admin: Want, networkInterface: string, callback: AsyncCallback): void; + /** + * Gets the status of the network interface. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get status. + * @returns { Promise } the promise returned by getNetworkInterfaceStatus. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getNetworkInterfaceStatus(admin: Want, networkInterface: string): Promise; + + /** + * Disables the network interfaces. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_NETWORK + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get mac address. + * @param { boolean } isDisabled - True if disable the network interfaces, otherwise false. + * @param { AsyncCallback } callback - the callback of setNetworkInterfaceDisabled. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setNetworkInterfaceDisabled(admin: Want, networkInterface: string, isDisabled: boolean, callback: AsyncCallback): void; + /** + * Disables the network interfaces. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_NETWORK + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get mac address. + * @param { boolean } isDisabled - True if disable the network interfaces, otherwise false. + * @returns { Promise } the promise returned setNetworkInterfaceDisabled. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setNetworkInterfaceDisabled(admin: Want, networkInterface: string, isDisabled: boolean): Promise; +} + +export default networkManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.wifiManager.d.ts b/api/@ohos.enterprise.wifiManager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fd1ed6d9d7c451a5ef2965df9183cb946d11c93f --- /dev/null +++ b/api/@ohos.enterprise.wifiManager.d.ts @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.application.Want"; +import wifi from "./@ohos.wifi"; + +/** + * This module offers set wifi policies on the devices. + * @namespace wifiManager + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace wifiManager { + + /** + * Disables the wifi of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + * @since 9 + * @param { Want } admin - admin indicates the administrator ability information. + * @param { boolean } isDisabled - True if disable the wifi of the device, otherwise false. + * @param { AsyncCallback } callback - the callback of setWifiDisabled. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setWifiDisabled(admin: Want, isDisabled: boolean, callback: AsyncCallback): void; + /** + * Disables the wifi of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + * @since 9 + * @param { Want } admin - admin indicates the administrator ability information. + * @param { boolean } isDisabled - True if disable the wifi of the device, otherwise false. + * @returns { Promise } the promise returned by setWifiDisabled. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setWifiDisabled(admin: Want, isDisabled: boolean): Promise; + + /** + * Gets state of whether the wifi is disabled. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of isWifiDisabled. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isWifiDisabled(admin: Want, callback: AsyncCallback): void; + /** + * Gets state of whether the wifi is disabled. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by isWifiDisabled. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isWifiDisabled(admin: Want): Promise; + + /** + * Sets the wifi profile. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + * @param { Want } admin - admin indicates the administrator ability information. + * @param { wifi.WifiDeviceConfig } config - config indicates the configuration of wifi. + * @param { AsyncCallback } callback - the callback of setWifiProfile. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setWifiProfile(admin: Want, config: wifi.WifiDeviceConfig, callback: AsyncCallback): void; + /** + * Sets the wifi profile. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + * @param { Want } admin - admin indicates the administrator ability information. + * @param { wifi.WifiDeviceConfig } config - config indicates the configuration of wifi. + * @returns { Promise } the promise returned by setWifiProfile. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setWifiProfile(admin: Want, config: wifi.WifiDeviceConfig): Promise; +} + +export default wifiManager; \ No newline at end of file diff --git a/api/@ohos.enterpriseDeviceManager.d.ts b/api/@ohos.enterpriseDeviceManager.d.ts deleted file mode 100644 index 273c97f1174fee9f4667838aebe769b198c0706e..0000000000000000000000000000000000000000 --- a/api/@ohos.enterpriseDeviceManager.d.ts +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { AsyncCallback, Callback } from "./basic"; -import { DeviceSettingsManager as _DeviceSettingsManager } from "./enterpriseDeviceManager/DeviceSettingsManager"; -import Want from "./@ohos.application.Want"; - -/** - * enterprise device manager. - * @name enterpriseDeviceManager - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - */ -declare namespace enterpriseDeviceManager { - - /** - * @name EnterpriseInfo - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - */ - export interface EnterpriseInfo { - name: string; - description: string; - } - - /** - * @name DeviceSettingsManager - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - */ - export type DeviceSettingsManager = _DeviceSettingsManager - - /** - * @name AdminType - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - */ - export enum AdminType { - ADMIN_TYPE_NORMAL = 0x00, - ADMIN_TYPE_SUPER = 0x01 - } - - /** - * Enables the given ability as a administrator of the device. - * - * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param enterpriseInfo Indicates the enterprise information of the calling application. - * @param type Indicates the type of administrator to set. - * @param userId Indicates the user ID or do not pass user ID. - * @return {@code true} if enables administrator success. - * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN - */ - function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback): void; - function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback): void; - function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise; - - /** - * Disables a current normal administrator ability. - * - * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param userId Indicates the user ID or do not pass user ID. - * @return {@code true} if disables administrator success. - * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN - */ - function disableAdmin(admin: Want, callback: AsyncCallback): void; - function disableAdmin(admin: Want, userId: number, callback: AsyncCallback): void; - function disableAdmin(admin: Want, userId?: number): Promise; - - /** - * Disables a current super administrator ability. - * - * Only the administrator app or apps with the shell uid can call this method. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param bundleName Indicates the administrator bundle information. - * @return {@code true} if disables super administrator success. - */ - function disableSuperAdmin(bundleName: String, callback: AsyncCallback): void; - function disableSuperAdmin(bundleName: String): Promise; - - /** - * Get whether the ability is enabled as device administrator. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param userId Indicates the user ID or do not pass user ID. - * @return {@code true} if the administrator is enabled. - */ - function isAdminEnabled(admin: Want, callback: AsyncCallback): void; - function isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback): void; - function isAdminEnabled(admin: Want, userId?: number): Promise; - - /** - * Get information of the administrator's enterprise. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @return Returns the enterprise information of the administrator. - */ - function getEnterpriseInfo(admin: Want, callback: AsyncCallback): void; - function getEnterpriseInfo(admin: Want): Promise; - - /** - * Set the information of the administrator's enterprise. - * - * Only the administrator app can call this method. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param enterpriseInfo Indicates the enterprise information of the calling application. - * @return {@code true} if sets enterprise information success. - */ - function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback): void; - function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise; - - /** - * Get whether the ability is enabled as super device administrator. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param bundleName Indicates the administrator bundle information. - * @return {@code true} if the administrator is enabled as super device administrator. - */ - function isSuperAdmin(bundleName: String, callback: AsyncCallback): void; - function isSuperAdmin(bundleName: String): Promise; - - /** - * Obtains the interface used to set device settings policy. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @return Returns the DeviceSettingsManager interface. - */ - function getDeviceSettingsManager(callback: AsyncCallback): void; - function getDeviceSettingsManager(): Promise; - -} - -export default enterpriseDeviceManager; \ No newline at end of file diff --git a/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts b/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts deleted file mode 100644 index c29c0dda15f0914d3d49df606b81687b93eea872..0000000000000000000000000000000000000000 --- a/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { AsyncCallback, Callback } from "./../basic"; -import Want from "./../@ohos.application.Want"; - -/** - * @name Offers set settings policies on the devices. - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - */ -export interface DeviceSettingsManager { - - /** - * Sets the system time.This function can be called by a super administrator. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param time Target time stamp (ms) - * @return {@code true} if success. - * @permission ohos.permission.EDM_MANAGE_DATETIME - */ - setDateTime(admin: Want, time: number, callback: AsyncCallback): void; - setDateTime(admin: Want, time: number): Promise; -} \ No newline at end of file