diff --git a/api/@ohos.display.d.ts b/api/@ohos.display.d.ts index 6690c73c7563a6671d1cc35ac5c65626efbb370e..0ad4c485c9bffa33cf374302704259b716f33efe 100644 --- a/api/@ohos.display.d.ts +++ b/api/@ohos.display.d.ts @@ -222,7 +222,6 @@ declare namespace display { /** * Register the callback for display changes. * - * @param { 'add' | 'remove' | 'change' } type the event of display change * @param { Callback } callback the display id of changed * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -232,7 +231,6 @@ declare namespace display { /** * Register the callback for display changes. * - * @param { 'add' | 'remove' | 'change' } type the event of display change * @param { Callback } callback the display id of changed * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -243,7 +241,6 @@ declare namespace display { /** * Register the callback for display changes. * - * @param { 'add' | 'remove' | 'change' } type the event of display change * @param { Callback } callback the display id of changed * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -253,12 +250,143 @@ declare namespace display { * @since 20 * @arkts 1.1&1.2 */ - function on(type: 'add' | 'remove' | 'change', callback: Callback): void; + function onAdd(callback: Callback): void; + + /** + * Register the callback for display changes. + * + * @param { Callback } callback the display id of changed + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 + */ + /** + * Register the callback for display changes. + * + * @param { Callback } callback the display id of changed + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @atomicservice + * @since 12 + */ + /** + * Register the callback for display changes. + * + * @param { Callback } callback the display id of changed + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.1&1.2 + */ + function onRemove(callback: Callback): void; + + /** + * Register the callback for display changes. + * + * @param { Callback } callback the display id of changed + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 + */ + /** + * Register the callback for display changes. + * + * @param { Callback } callback the display id of changed + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @atomicservice + * @since 12 + */ + /** + * Register the callback for display changes. + * + * @param { Callback } callback the display id of changed + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.1&1.2 + */ + function onChange(callback: Callback): void; + + /** + * Unregister the callback for display changes. + * + * @param { Callback } callback the display id of changed + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 + */ + /** + * Unregister the callback for display changes. + * + * @param { Callback } callback the display id of changed + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @atomicservice + * @since 12 + */ + /** + * Unregister the callback for display changes. + * + * @param { Callback } callback the display id of changed + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.1&1.2 + */ + function offAdd(callback?: Callback): void; + + /** + * Unregister the callback for display changes. + * + * @param { Callback } callback the display id of changed + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @since 7 + */ + /** + * Unregister the callback for display changes. + * + * @param { Callback } callback the display id of changed + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @atomicservice + * @since 12 + */ + /** + * Unregister the callback for display changes. + * + * @param { Callback } callback the display id of changed + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.1&1.2 + */ + function offRemove(callback?: Callback): void; /** * Unregister the callback for display changes. * - * @param { 'add' | 'remove' | 'change' } type the event of display change event * @param { Callback } callback the display id of changed * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -268,7 +396,6 @@ declare namespace display { /** * Unregister the callback for display changes. * - * @param { 'add' | 'remove' | 'change' } type the event of display change event * @param { Callback } callback the display id of changed * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -279,7 +406,6 @@ declare namespace display { /** * Unregister the callback for display changes. * - * @param { 'add' | 'remove' | 'change' } type the event of display change event * @param { Callback } callback the display id of changed * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -289,12 +415,11 @@ declare namespace display { * @since 20 * @arkts 1.1&1.2 */ - function off(type: 'add' | 'remove' | 'change', callback?: Callback): void; + function offChange(callback?: Callback): void; /** * Register the callback for private mode changes. * - * @param { 'privateModeChange' } type the event of private mode changes * @param { Callback } callback Callback used to return the result whether display is on private mode or not * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -304,12 +429,11 @@ declare namespace display { * @since arkts {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - function on(type: 'privateModeChange', callback: Callback): void; + function onPrivateModeChange(callback: Callback): void; /** * Unregister the callback for private mode changes. * - * @param { 'privateModeChange' } type the event of private mode changes * @param { Callback } callback Callback used to return the result whether display is on private mode or not * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -319,7 +443,7 @@ declare namespace display { * @since arkts {'1.1':'10', '1.2':'20'} * @arkts 1.1&1.2 */ - function off(type: 'privateModeChange', callback?: Callback): void; + function offPrivateModeChange(callback?: Callback): void; /** * Check whether the device is foldable. @@ -384,7 +508,6 @@ declare namespace display { /** * Register the callback for fold status changes. * - * @param { 'foldStatusChange' } type the event of fold status changes * @param { Callback } callback Callback used to return the current fold status of device * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -395,7 +518,6 @@ declare namespace display { /** * Register the callback for fold status changes. * - * @param { 'foldStatusChange' } type the event of fold status changes * @param { Callback } callback Callback used to return the current fold status of device * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -407,7 +529,6 @@ declare namespace display { /** * Register the callback for fold status changes. * - * @param { 'foldStatusChange' } type the event of fold status changes * @param { Callback } callback Callback used to return the current fold status of device * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -418,12 +539,11 @@ declare namespace display { * @since 20 * @arkts 1.1&1.2 */ - function on(type: 'foldStatusChange', callback: Callback): void; + function onFoldStatusChange(callback: Callback): void; /** * Unregister the callback for fold status changes. * - * @param { 'foldStatusChange' } type the event of fold status changes * @param { Callback } callback Callback used to return the current fold status of device * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -434,7 +554,6 @@ declare namespace display { /** * Unregister the callback for fold status changes. * - * @param { 'foldStatusChange' } type the event of fold status changes * @param { Callback } callback Callback used to return the current fold status of device * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -446,7 +565,6 @@ declare namespace display { /** * Unregister the callback for fold status changes. * - * @param { 'foldStatusChange' } type the event of fold status changes * @param { Callback } callback Callback used to return the current fold status of device * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -457,12 +575,11 @@ declare namespace display { * @since 20 * @arkts 1.1&1.2 */ - function off(type: 'foldStatusChange', callback?: Callback): void; + function offFoldStatusChange(callback?: Callback): void; /** * Register the callback for fold angle changes. * - * @param { 'foldAngleChange' } type the event of fold angle changes. * @param { Callback> } callback Callback used to return the current fold angle of device. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -474,7 +591,6 @@ declare namespace display { /** * Register the callback for fold angle changes. * - * @param { 'foldAngleChange' } type the event of fold angle changes. * @param { Callback> } callback Callback used to return the current fold angle of device. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -485,12 +601,11 @@ declare namespace display { * @since 20 * @arkts 1.1&1.2 */ - function on(type: 'foldAngleChange', callback: Callback>): void; + function onFoldAngleChange(callback: Callback>): void; /** * Unregister the callback for fold angle changes. * - * @param { 'foldAngleChange' } type the event of fold angle changes. * @param { Callback> } callback Callback used to return the current fold angle of device. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -502,7 +617,6 @@ declare namespace display { /** * Unregister the callback for fold angle changes. * - * @param { 'foldAngleChange' } type the event of fold angle changes. * @param { Callback> } callback Callback used to return the current fold angle of device. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -513,12 +627,11 @@ declare namespace display { * @since 20 * @arkts 1.1&1.2 */ - function off(type: 'foldAngleChange', callback?: Callback>): void; + function offFoldAngleChange(callback?: Callback>): void; /** * Register the callback for device capture, casting, or recording status changes. * - * @param { 'captureStatusChange' } type the event of capture, casting, or recording status changes. * @param { Callback } callback Callback used to return the device capture, casting, or recording status. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -528,12 +641,11 @@ declare namespace display { * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - function on(type: 'captureStatusChange', callback: Callback): void; + function onCaptureStatusChange(callback: Callback): void; /** * Unregister the callback for device capture, casting, or recording status changes. * - * @param { 'captureStatusChange' } type the event of capture, casting, or recording status changes. * @param { Callback } callback Callback used to return the device capture, casting, or recording status . * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. @@ -543,7 +655,7 @@ declare namespace display { * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - function off(type: 'captureStatusChange', callback?: Callback): void; + function offCaptureStatusChange(callback?: Callback): void; /** @@ -620,7 +732,6 @@ declare namespace display { /** * Register the callback for fold display mode changes. * - * @param { 'foldDisplayModeChange' } type the event of fold display mode changes * @param { Callback } callback Callback used to return the current fold display mode * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -631,7 +742,6 @@ declare namespace display { /** * Register the callback for fold display mode changes. * - * @param { 'foldDisplayModeChange' } type the event of fold display mode changes * @param { Callback } callback Callback used to return the current fold display mode * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -643,7 +753,6 @@ declare namespace display { /** * Register the callback for fold display mode changes. * - * @param { 'foldDisplayModeChange' } type the event of fold display mode changes * @param { Callback } callback Callback used to return the current fold display mode * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -654,12 +763,11 @@ declare namespace display { * @since 20 * @arkts 1.1&1.2 */ - function on(type: 'foldDisplayModeChange', callback: Callback): void; + function onFoldDisplayModeChange(callback: Callback): void; /** * Unregister the callback for fold display mode changes. * - * @param { 'foldDisplayModeChange' } type the event of fold display mode changes * @param { Callback } callback Callback used to return the current fold display mode * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -670,7 +778,6 @@ declare namespace display { /** * Unregister the callback for fold display mode changes. * - * @param { 'foldDisplayModeChange' } type the event of fold display mode changes * @param { Callback } callback Callback used to return the current fold display mode * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -682,7 +789,6 @@ declare namespace display { /** * Unregister the callback for fold display mode changes. * - * @param { 'foldDisplayModeChange' } type the event of fold display mode changes * @param { Callback } callback Callback used to return the current fold display mode * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -693,7 +799,7 @@ declare namespace display { * @since 20 * @arkts 1.1&1.2 */ - function off(type: 'foldDisplayModeChange', callback?: Callback): void; + function offFoldDisplayModeChange(callback?: Callback): void; /** * Get the fold crease region in the current display mode. diff --git a/api/@ohos.screen.d.ts b/api/@ohos.screen.d.ts index a0955a35a5dec605cd8cd32efcb1291d3f1b6ba4..89023955bc13c05eea29bb09b452a450f060959c 100644 --- a/api/@ohos.screen.d.ts +++ b/api/@ohos.screen.d.ts @@ -60,7 +60,6 @@ declare namespace screen { /** * Register the callback for screen changes. * - * @param { 'connect' | 'disconnect' | 'change' } eventType the event of screen changes. This parameter is of string * type and cannot be empty. * @param { Callback } callback Callback used to return the screen ID. This parameter is callable. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. @@ -71,13 +70,70 @@ declare namespace screen { * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - function on(eventType: 'connect' | 'disconnect' | 'change', callback: Callback): void; + function onConnect(callback: Callback): void; /** - * Unregister the callback for screen changes. + * Register the callback for screen changes. + * + * @param { Callback } callback Callback used to return the screen ID. This parameter is callable. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function onDisconnect(callback: Callback): void; + + /** + * Register the callback for screen changes. * - * @param { 'connect' | 'disconnect' | 'change' } eventType the event of screen changes. This parameter is of string * type and cannot be empty. + * @param { Callback } callback Callback used to return the screen ID. This parameter is callable. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function onChange(callback: Callback): void; + + /** + * Unregister the callback for screen changes. + * + * @param { Callback } callback Callback used to return the screen ID. If this parameter is specified, it must + * be a callback. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function offChange(callback?: Callback): void; + + /** + * Unregister the callback for screen changes. + * + * @param { Callback } callback Callback used to return the screen ID. If this parameter is specified, it must + * be a callback. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 + */ + function offDisconnect(callback?: Callback): void; + + /** + * Unregister the callback for screen changes. + * * @param { Callback } callback Callback used to return the screen ID. If this parameter is specified, it must * be a callback. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. @@ -88,7 +144,7 @@ declare namespace screen { * @since arkts {'1.1':'9', '1.2':'20'} * @arkts 1.1&1.2 */ - function off(eventType: 'connect' | 'disconnect' | 'change', callback?: Callback): void; + function offChange(callback?: Callback): void; /** * Make screens as expand-screen