diff --git a/api/@ohos.app.ability.errorManager.d.ts b/api/@ohos.app.ability.errorManager.d.ts index fba090a7e06bb25f021f27cff4725fb44f962f88..0cfab9798a447fde33daaec2ed61230422ae6db6 100644 --- a/api/@ohos.app.ability.errorManager.d.ts +++ b/api/@ohos.app.ability.errorManager.d.ts @@ -37,16 +37,6 @@ import { LoopObserver as _LoopObserver } from './application/LoopObserver'; * @atomicservice * @since 11 */ -/** - * This module provides the function of error manager. - * - * @namespace errorManager - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ declare namespace errorManager { /** * Register error observer. @@ -56,7 +46,7 @@ declare namespace errorManager { * @returns { number } Returns the number code of the observer. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16000003 - The specified ID does not exist. + * @throws { BusinessError } 16000003 - Id does not exist. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ @@ -73,21 +63,6 @@ declare namespace errorManager { * @atomicservice * @since 11 */ - /** - * Register error observer. - * - * @param { 'error' } type - error. - * @param { ErrorObserver } observer - The error observer. - * @returns { number } Returns the number code of the observer. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; - * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16000003 - The specified ID does not exist. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ function on(type: 'error', observer: ErrorObserver): number; /** @@ -98,7 +73,7 @@ declare namespace errorManager { * @param { AsyncCallback } callback - The callback of off. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16000003 - The specified ID does not exist. + * @throws { BusinessError } 16000003 - Id does not exist. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ @@ -115,21 +90,6 @@ declare namespace errorManager { * @atomicservice * @since 11 */ - /** - * Unregister error observer. - * - * @param { 'error' } type - error. - * @param { number } observerId - Indicates the number code of the observer. - * @param { AsyncCallback } callback - The callback of off. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; - * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16000003 - The specified ID does not exist. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ function off(type: 'error', observerId: number, callback: AsyncCallback): void; /** @@ -140,7 +100,7 @@ declare namespace errorManager { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16000003 - The specified ID does not exist. + * @throws { BusinessError } 16000003 - Id does not exist. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ @@ -157,21 +117,6 @@ declare namespace errorManager { * @atomicservice * @since 11 */ - /** - * Unregister error observer. - * - * @param { 'error' } type - error. - * @param { number } observerId - Indicates the number code of the observer. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; - * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16000003 - The specified ID does not exist. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ function off(type: 'error', observerId: number): Promise; /** @@ -327,22 +272,6 @@ declare namespace errorManager { * @atomicservice * @since 12 */ - /** - * Register loop observer. This function can only by called from main thread, - * and if call this function multiple times, the last - * modification will overwrite the previous one. - * - * @param { 'loopObserver' } type - loopObserver. - * @param { number } timeout - Indicates timeout(ms) value of loop observer. - * @param { LoopObserver } observer - The loop observer. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; - * 2. Incorrect parameter types; 3. Parameter verification failed. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ function on(type: 'loopObserver', timeout: number, observer: LoopObserver): void; /** @@ -356,19 +285,6 @@ declare namespace errorManager { * @atomicservice * @since 12 */ - /** - * Unregister loop observer. This function can only by called from main thread. - * - * @param { 'loopObserver' } type - loopObserver. - * @param { LoopObserver } observer - The loop observer. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; - * 2. Incorrect parameter types; 3. Parameter verification failed. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ function off(type: 'loopObserver', observer?: LoopObserver): void; /** @@ -378,25 +294,11 @@ declare namespace errorManager { * @param { UnhandledRejectionObserver } observer - The unhandled rejection observer. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16200001 - The caller has been released. + * @throws { BusinessError } 16200001 - If the caller is invalid. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice * @since 12 */ - /** - * Register unhandled rejection observer. - * - * @param { 'unhandledRejection' } type - 'unhandledRejection'. - * @param { UnhandledRejectionObserver } observer - The unhandled rejection observer. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; - * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16200001 - The caller has been released. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ function on(type: 'unhandledRejection', observer: UnhandledRejectionObserver): void; /** @@ -406,27 +308,12 @@ declare namespace errorManager { * @param { UnhandledRejectionObserver } [observer] - the registered observer * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16200001 - The caller has been released. + * @throws { BusinessError } 16200001 - If the caller is invalid. * @throws { BusinessError } 16300004 - If the observer does not exist * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice * @since 12 */ - /** - * Unregister unhandled rejection observer. - * - * @param { 'unhandledRejection' } type - error. - * @param { UnhandledRejectionObserver } [observer] - the registered observer - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; - * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16200001 - The caller has been released. - * @throws { BusinessError } 16300004 - If the observer does not exist - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ function off(type: 'unhandledRejection', observer?: UnhandledRejectionObserver): void; /** @@ -474,16 +361,6 @@ declare namespace errorManager { * @atomicservice * @since 11 */ - /** - * The observer will be called by system when an error occurs. - * - * @typedef { _ErrorObserver.default } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ export type ErrorObserver = _ErrorObserver.default; /** * The observer will be called when application main thread execute timeout. @@ -493,16 +370,6 @@ declare namespace errorManager { * @atomicservice * @since 12 */ - /** - * The observer will be called when application main thread execute timeout. - * - * @typedef { _LoopObserver } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ export type LoopObserver = _LoopObserver; /** * The observer will be called by system when an unhandled rejection occurs. @@ -514,18 +381,6 @@ declare namespace errorManager { * @atomicservice * @since 12 */ - /** - * The observer will be called by system when an unhandled rejection occurs. - * - * @typedef { function } - * { Error | any } reason - the reason of the rejection, typically of Error type - * { Promise } promise - the promise that is rejected - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ export type UnhandledRejectionObserver = (reason: Error | any, promise: Promise) => void; /** * The observer will be called by system when freeze happens. diff --git a/api/application/ErrorObserver.d.ts b/api/application/ErrorObserver.d.ts index 24ee69262ee36f82f542b39fca94b671d1a1905d..acc0b8c036110c9b1532ea343d405c07651640d9 100644 --- a/api/application/ErrorObserver.d.ts +++ b/api/application/ErrorObserver.d.ts @@ -31,15 +31,6 @@ * @atomicservice * @since 11 */ -/** - * The observer will be called by system when an error occurs. - * - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ export default class ErrorObserver { /** * Will be called when the js runtime throws an exception which doesn't caught by user. @@ -56,16 +47,6 @@ export default class ErrorObserver { * @atomicservice * @since 11 */ - /** - * Will be called when the js runtime throws an exception which doesn't caught by user. - * - * @param { string } errMsg - the message and error stacktrace about the exception. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ onUnhandledException(errMsg: string): void; /** @@ -83,15 +64,5 @@ export default class ErrorObserver { * @atomicservice * @since 11 */ - /** - * Will be called when the js runtime throws an exception which doesn't caught by user. - * - * @param { Error } errObject - the error object about the exception. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ onException?(errObject: Error): void; } diff --git a/api/application/LoopObserver.d.ts b/api/application/LoopObserver.d.ts index 9e31616201f907c2df6f3dd457e3898baaf5058f..24f582f9d1a7cecf81c92f38f31899e26cbe6c41 100644 --- a/api/application/LoopObserver.d.ts +++ b/api/application/LoopObserver.d.ts @@ -26,16 +26,6 @@ * @atomicservice * @since 12 */ -/** - * The observer will be called by system when application main thread loop - * execute timeout - * @interface LoopObserver - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ export interface LoopObserver { /** * Will be called when the application main thread loop execute timeout. @@ -45,15 +35,5 @@ export interface LoopObserver { * @atomicservice * @since 12 */ - /** - * Will be called when the application main thread loop execute timeout. - * - * @param { number } timeout - the actual executing time of loop event. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'19', '1.2':'20'} - * @arkts 1.1&1.2 - */ onLoopTimeOut?(timeout: number): void; }