From dfb95d97913f980586d86799516619a2a794b421 Mon Sep 17 00:00:00 2001 From: luzehui Date: Thu, 18 Aug 2022 11:44:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0OHOS=20error=20callback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/basic.d.ts | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/api/basic.d.ts b/api/basic.d.ts index 66a84e73b9..89d00e4b4a 100755 --- a/api/basic.d.ts +++ b/api/basic.d.ts @@ -60,3 +60,52 @@ export interface BusinessError extends Error { */ code: number; } + +/** + * Defines the basic ohos error callback. + * @interface + * @since 9 + */ +export interface OHErrorCallback { + /** + * Defines the OHErrorCallback info. + * @param { T } err - the error info. + * @since 9 + */ + (err: T): void; +} + +/** + * Defines the basic ohos async callback. + * @interface + * @since 9 + */ +export interface OHAsyncCallback { + /** + * Defines the basic ohos async callback info. + * @param { OHBusinessError } err - the error info. + * @param { T } data - the callback result. + * @since 9 + */ + (err: OHBusinessError, data: T) : void; +} + +/** + * Defines the basic ohos error interface. + * @interface + * @since 9 + */ +export interface OHBusinessError extends Error { + /** + * Defines the ohos error number. + * @type { number } + * @since 9 + */ + errorNumber: number; + /** + * Defines the extra error info. + * @type { T } [errorData] + * @since 9 + */ + errorData?: T; +} -- Gitee From 67579fc710572186e69468d419f4006adb38d73f Mon Sep 17 00:00:00 2001 From: luzehui Date: Mon, 22 Aug 2022 12:52:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0OHOS=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/basic.d.ts | 56 ++++---------------------------------------------- 1 file changed, 4 insertions(+), 52 deletions(-) diff --git a/api/basic.d.ts b/api/basic.d.ts index 89d00e4b4a..2fe3d41b7e 100755 --- a/api/basic.d.ts +++ b/api/basic.d.ts @@ -41,71 +41,23 @@ export interface ErrorCallback { * Defines the basic async callback. * @since 6 */ -export interface AsyncCallback { +export interface AsyncCallback { /** * Defines the callback data. * @since 6 */ - (err: BusinessError, data: T): void; + (err: BusinessError, data: T): void; } /** * Defines the error interface. * @since 6 */ -export interface BusinessError extends Error { +export interface BusinessError extends Error { /** * Defines the basic error code. * @since 6 */ code: number; -} - -/** - * Defines the basic ohos error callback. - * @interface - * @since 9 - */ -export interface OHErrorCallback { - /** - * Defines the OHErrorCallback info. - * @param { T } err - the error info. - * @since 9 - */ - (err: T): void; -} - -/** - * Defines the basic ohos async callback. - * @interface - * @since 9 - */ -export interface OHAsyncCallback { - /** - * Defines the basic ohos async callback info. - * @param { OHBusinessError } err - the error info. - * @param { T } data - the callback result. - * @since 9 - */ - (err: OHBusinessError, data: T) : void; -} - -/** - * Defines the basic ohos error interface. - * @interface - * @since 9 - */ -export interface OHBusinessError extends Error { - /** - * Defines the ohos error number. - * @type { number } - * @since 9 - */ - errorNumber: number; - /** - * Defines the extra error info. - * @type { T } [errorData] - * @since 9 - */ - errorData?: T; + data?: T; } -- Gitee