From 442e8644cd590a7e34439e7245c75b82740751f5 Mon Sep 17 00:00:00 2001 From: buzhenwang Date: Wed, 6 Aug 2025 17:30:51 +0800 Subject: [PATCH] add RecordData Signed-off-by: buzhenwang --- api/@ohos.hilog.d.ts | 57 ++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/api/@ohos.hilog.d.ts b/api/@ohos.hilog.d.ts index 9983202026..6f94ea48ed 100644 --- a/api/@ohos.hilog.d.ts +++ b/api/@ohos.hilog.d.ts @@ -16,7 +16,6 @@ /** * @file * @kit PerformanceAnalysisKit - * @arkts 1.1&1.2 */ /** @@ -46,6 +45,18 @@ */ declare namespace hilog { + /** + * Using RecordData Replace any, unknown, ESObject. + * + * @typedef { undefined | null | Object | Record | Array } + * @syscap SystemCapability.HiviewDFX.HiLog + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + type RecordData = undefined | null | Object | Record | Array; + /** * Outputs debug-level logs. * @@ -60,8 +71,8 @@ declare namespace hilog { /** * Outputs debug-level logs. * - * * @param { number } domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFF - * if the value exceeds the range, logs cannot be printed. + * @param { number } domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFF + * if the value exceeds the range, logs cannot be printed. * @param { string } tag Identifies the log tag, length cannot exceed 32 bytes, the excess part will be truncated. * @param { string } format Indicates the log format string. * @param { any[] }args Indicates the log parameters. @@ -82,6 +93,8 @@ declare namespace hilog { * @atomicservice * @since 11 */ + function debug(domain: number, tag: string, format: string, ...args: any[]): void; + /** * Outputs debug-level logs. * @@ -89,14 +102,14 @@ declare namespace hilog { * if the value exceeds the range, logs cannot be printed. * @param { string } tag Identifies the log tag, length cannot exceed 32 bytes, the excess part will be truncated. * @param { string } format Indicates the log format string. - * @param { (Object | undefined | null)[] }args Indicates the log parameters. + * @param { RecordData[] }args Indicates the log parameters. * @syscap SystemCapability.HiviewDFX.HiLog * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 + * @arkts 1.2 */ - function debug(domain: number, tag: string, format: string, ...args: (Object | undefined | null)[]): void; + function debug(domain: number, tag: string, format: string, ...args: RecordData[]): void; /** * Outputs info-level logs. @@ -134,6 +147,8 @@ declare namespace hilog { * @atomicservice * @since 11 */ + function info(domain: number, tag: string, format: string, ...args: any[]): void; + /** * Outputs info-level logs. * @@ -141,14 +156,14 @@ declare namespace hilog { * if the value exceeds the range, logs cannot be printed. * @param { string } tag Identifies the log tag, length cannot exceed 32 bytes, the excess part will be truncated. * @param { string } format Indicates the log format string. - * @param { (Object | undefined | null)[] }args Indicates the log parameters. + * @param { RecordData[] }args Indicates the log parameters. * @syscap SystemCapability.HiviewDFX.HiLog * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 + * @arkts 1.2 */ - function info(domain: number, tag: string, format: string, ...args: (Object | undefined | null)[]): void; + function info(domain: number, tag: string, format: string, ...args: RecordData[]): void; /** * Outputs warning-level logs. @@ -186,6 +201,8 @@ declare namespace hilog { * @atomicservice * @since 11 */ + function warn(domain: number, tag: string, format: string, ...args: any[]): void; + /** * Outputs warning-level logs. * @@ -193,14 +210,14 @@ declare namespace hilog { * if the value exceeds the range, logs cannot be printed. * @param { string } tag Identifies the log tag, length cannot exceed 32 bytes, the excess part will be truncated. * @param { string } format Indicates the log format string. - * @param { (Object | undefined | null)[] }args Indicates the log parameters. + * @param { RecordData[] }args Indicates the log parameters. * @syscap SystemCapability.HiviewDFX.HiLog * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 + * @arkts 1.2 */ - function warn(domain: number, tag: string, format: string, ...args: (Object | undefined | null)[]): void; + function warn(domain: number, tag: string, format: string, ...args: RecordData[]): void; /** * Outputs error-level logs. @@ -238,6 +255,8 @@ declare namespace hilog { * @atomicservice * @since 11 */ + function error(domain: number, tag: string, format: string, ...args: any[]): void; + /** * Outputs error-level logs. * @@ -245,14 +264,14 @@ declare namespace hilog { * if the value exceeds the range, logs cannot be printed. * @param { string } tag Identifies the log tag, length cannot exceed 32 bytes, the excess part will be truncated. * @param { string } format Indicates the log format string. - * @param { (Object | undefined | null)[] }args Indicates the log parameters. + * @param { RecordData[] }args Indicates the log parameters. * @syscap SystemCapability.HiviewDFX.HiLog * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 + * @arkts 1.2 */ - function error(domain: number, tag: string, format: string, ...args: (Object | undefined | null)[]): void; + function error(domain: number, tag: string, format: string, ...args: RecordData[]): void; /** * Outputs fatal-level logs. @@ -290,6 +309,8 @@ declare namespace hilog { * @atomicservice * @since 11 */ + function fatal(domain: number, tag: string, format: string, ...args: any[]): void; + /** * Outputs fatal-level logs. * @@ -297,14 +318,14 @@ declare namespace hilog { * if the value exceeds the range, logs cannot be printed. * @param { string } tag Identifies the log tag, length cannot exceed 32 bytes, the excess part will be truncated. * @param { string } format Indicates the log format string. - * @param { (Object | undefined | null)[] }args Indicates the log parameters. + * @param { RecordData[] }args Indicates the log parameters. * @syscap SystemCapability.HiviewDFX.HiLog * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 + * @arkts 1.2 */ - function fatal(domain: number, tag: string, format: string, ...args: (Object | undefined | null)[]): void; + function fatal(domain: number, tag: string, format: string, ...args: RecordData[]): void; /** * Checks whether logs of the specified tag, and level can be printed. -- Gitee