diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index dfbcea11dae41540078e23fd102a837239841a12..16a70711de0c74e040392831639372b9638bbb3a 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -32,29 +32,33 @@ declare namespace rdb { * to obtain a rdb store. * * @note N/A - * @since 7 + * @since 8 * @sysCap SystemCapability.Data.DATA_APPDATAMGR * @devices phone, tablet, tv, wearable, car + * + * @param context Indicates the context of the ability or the application. * @param config Indicates the configuration of the database related to this RDB store. The configurations include * the database path, storage mode, and whether the database is read-only. * @param version Indicates the database version for upgrade or downgrade. * @return Returns an RDB store {@link ohos.data.rdb.RdbStore}. */ - function getRdbStore(config: StoreConfig, version: number, callback: AsyncCallback): void; - function getRdbStore(config: StoreConfig, version: number): Promise; + function getRdbStore(context:Context, config: StoreConfig, version: number, callback: AsyncCallback): void; + function getRdbStore(context:Context, config: StoreConfig, version: number): Promise; /** * Deletes the database with a specified name. * * @note N/A - * @since 7 + * @since 8 * @sysCap SystemCapability.Data.DATA_APPDATAMGR * @devices phone, tablet, tv, wearable, car + * + * @param context Indicates the context of the ability or the application. * @param name Indicates the database name. * @return Returns true if the database is deleted; returns false otherwise. */ - function deleteRdbStore(name: string, callback: AsyncCallback): void; - function deleteRdbStore(name: string): Promise; + function deleteRdbStore(context:Context, name: string, callback: AsyncCallback): void; + function deleteRdbStore(context:Context, name: string): Promise; /** * Provides methods for managing the relational database (RDB). diff --git a/api/@ohos.data.storage.d.ts b/api/@ohos.data.storage.d.ts index 937ce3ad4a09f48e1be7fe85fe1f8d6be23cd43a..7a3fe8fd62496d8d8aefbe891a2b97e3ed3af1d5 100644 --- a/api/@ohos.data.storage.d.ts +++ b/api/@ohos.data.storage.d.ts @@ -29,14 +29,19 @@ declare namespace storage { *

The {@link references} instance loads all data of the storage file and * resides in the memory. You can use removeStorageFromCache to remove the instance from the memory. * - * @param path Indicates the path of storage file stored. + * @note N/A + * @since 8 + * @sysCap SystemCapability.Data.DATA_APPDATAMGR + * @devices phone, tablet, tv, wearable, car + * + * @param context Indicates the context of the ability or the application. + * @param name Indicates the path of storage file name stored. * @return Returns the {@link Storage} instance matching the specified storage file name. * @throws BusinessError if invoked failed - * @since 5 */ - function getStorageSync(path: string): Storage; - function getStorage(path: string, callback: AsyncCallback): void; - function getStorage(path: string): Promise; + function getStorageSync(context:Context, name: string): Storage; + function getStorage(context:Context, name: string, callback: AsyncCallback): void; + function getStorage(context:Context, name: string): Promise; /** * Deletes a {@link Storage} instance matching a specified storage file name @@ -47,13 +52,18 @@ declare namespace storage { * of the instance. In addition, do not use the instance to perform data operations. Otherwise, data inconsistency * will occur. * - * @param path Indicates the path of storage file + * @note N/A + * @since 8 + * @sysCap SystemCapability.Data.DATA_APPDATAMGR + * @devices phone, tablet, tv, wearable, car + * + * @param context Indicates the context of the ability or the application. + * @param name Indicates the path of storage file name stored. * @throws BusinessError if invoked failed - * @since 5 */ - function deleteStorageSync(path: string): void; - function deleteStorage(path: string, callback: AsyncCallback): void; - function deleteStorage(path: string): Promise; + function deleteStorageSync(context:Context, name: string): void; + function deleteStorage(context:Context, name: string, callback: AsyncCallback): void; + function deleteStorage(context:Context, name: string): Promise; /** * Deletes a {@link Storage} instance matching a specified storage file name @@ -63,13 +73,18 @@ declare namespace storage { * of the instance. In addition, do not use the instance to perform data operations. Otherwise, data inconsistency * will occur. * - * @param path Indicates the path of storage file. + * @note N/A + * @since 8 + * @sysCap SystemCapability.Data.DATA_APPDATAMGR + * @devices phone, tablet, tv, wearable, car + * + * @param context Indicates the context of the ability or the application. + * @param name Indicates the path of storage file name stored. * @throws BusinessError if invoked failed - * @since 5 */ - function removeStorageFromCacheSync(path: string): void; - function removeStorageFromCache(path: string, callback: AsyncCallback): void; - function removeStorageFromCache(path: string): Promise; + function removeStorageFromCacheSync(context:Context, name: string): void; + function removeStorageFromCache(context:Context, name: string, callback: AsyncCallback): void; + function removeStorageFromCache(context:Context, name: string): Promise; /** * Provides interfaces to obtain and modify storage data.