From 546819f61685aa58bd282ef00dede962d57c842c Mon Sep 17 00:00:00 2001 From: zzz701 Date: Tue, 12 Aug 2025 10:51:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20RecordData=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zzz701 --- api/@ohos.base.d.ets | 35 +++++++++++++++++++++++++++++------ api/@ohos.base.d.ts | 4 ++-- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/api/@ohos.base.d.ets b/api/@ohos.base.d.ets index 0f7d42b99c..858cd291ea 100644 --- a/api/@ohos.base.d.ets +++ b/api/@ohos.base.d.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 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 @@ -73,8 +73,8 @@ export declare class BusinessError extends Error { constructor(); /** * A constructor used to create a BusinessError object - * @params { number } code - * @params { Error } error + * @param { number } code + * @param { Error } error * @syscap SystemCapability.Base * @crossplatform * @form @@ -84,9 +84,9 @@ export declare class BusinessError extends Error { constructor(code: number, error: Error); /** * A constructor used to create a BusinessError object - * @params { number } code - * @params { T } data - * @params { Error } error + * @param { number } code + * @param { T } data + * @param { Error } error * @syscap SystemCapability.Base * @crossplatform * @form @@ -175,3 +175,26 @@ export declare class BusinessError extends Error { */ data?: T; } + + /** + * In ArkTS static typing, for literals where the hierarchy and the number + * of attributes per level are uncertain, you can use RecordData for initialization. + * @typedef RecordData + * @syscap SystemCapability.Base + * @since 20 + * @example + * import { RecordData } from '@kit.BasicServiceKit'; + * const param: RecordData = { + * "key": { + * "a": 1 + * } + * } + * let want: Want = { + * bundleName: 'com.example.myapplication', + * abilityName: 'EntryAbility', + * parameters: param + * }; + * this.context.startAbility(want); + */ + export type RecordData = undefined | null | Object | Record | Array; + \ No newline at end of file diff --git a/api/@ohos.base.d.ts b/api/@ohos.base.d.ts index b9930a4b6f..12b9052cb6 100644 --- a/api/@ohos.base.d.ts +++ b/api/@ohos.base.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 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 @@ -84,7 +84,7 @@ export interface Callback { /** * Defines the basic error callback. - * @typedef ErrorCallback + * @typedef ErrorCallback * @syscap SystemCapability.Base * @since 6 */ -- Gitee