开源鸿蒙 JS API Changes of the Distributed Data Management Subsystem

2022-08-09 浏览 (669)

JS API Changes of the Distributed Data Management Subsystem

The table below lists the APIs changes of the distributed data management subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release.

API Changes

ModuleClassMethod/Attribute/Enumeration/ConstantChange Type
ohos.data.preferencespreferencesconst MAX_VALUE_LENGTH: 8192;Added
ohos.data.preferencespreferencesconst MAX_KEY_LENGTH: 80;Added
ohos.data.preferencesPreferencesoff(type: 'change', callback?: Callback<{ key: string }>): void;Added
ohos.data.preferencesPreferenceson(type: 'change', callback: Callback<{ key: string }>): void;Added
ohos.data.preferencesPreferencesflush(callback: AsyncCallback<void>): void;
flush(): Promise<void>;
Added
ohos.data.preferencesPreferencesclear(callback: AsyncCallback<void>): void;
clear(): Promise<void>;
Added
ohos.data.preferencesPreferencesdelete(key: string, callback: AsyncCallback<void>): void;
delete(key: string): Promise<void>;
Added
ohos.data.preferencesPreferencesput(key: string, value: ValueType, callback: AsyncCallback<void>): void;
put(key: string, value: ValueType): Promise<void>;
Added
ohos.data.preferencesPreferenceshas(key: string, callback: AsyncCallback<boolean>): void;
has(key: string): Promise<boolean>;
Added
ohos.data.preferencesPreferencesgetAll(callback: AsyncCallback<Object>): void;
getAll(): Promise<Object>;
Added
ohos.data.preferencesPreferencesget(key: string, defValue: ValueType, callback: AsyncCallback<ValueType>): void;
get(key: string, defValue: ValueType): Promise<ValueType>;
Added
ohos.data.preferencespreferencesremovePreferencesFromCache(context: Context, name: string, callback: AsyncCallback<void>): void;
removePreferencesFromCache(context: Context, name: string): Promise<void>;
Added
ohos.data.preferencespreferencesdeletePreferences(context: Context, name: string, callback: AsyncCallback<void>): void;
deletePreferences(context: Context, name: string): Promise<void>;
Added
ohos.data.preferencespreferencesgetPreferences(context: Context, name: string, callback: AsyncCallback<Preferences>): void;
getPreferences(context: Context, name: string): Promise<Preferences>;
Added
ohos.data.storagestorageconst MAX_VALUE_LENGTH: 8192;Deprecated
ohos.data.storagestorageconst MAX_KEY_LENGTH: 80;Deprecated
ohos.data.storageStorageObserverkey: string;Deprecated
ohos.data.storageStorageoff(type: 'change', callback: Callback<StorageObserver>): void;Deprecated
ohos.data.storageStorageon(type: 'change', callback: Callback<StorageObserver>): void;Deprecated
ohos.data.storageStorageflush(callback: AsyncCallback<void>): void;
flush(): Promise<void>;
Deprecated
ohos.data.storageStorageflushSync(): void;Deprecated
ohos.data.storageStorageclear(callback: AsyncCallback<void>): void;
clear(): Promise<void>;
Deprecated
ohos.data.storageStorageclearSync(): void;Deprecated
ohos.data.storageStoragedelete(key: string, callback: AsyncCallback<void>): void;
delete(key: string): Promise<void>;
Deprecated
ohos.data.storageStoragedeleteSync(key: string): void;Deprecated
ohos.data.storageStorageput(key: string, value: ValueType, callback: AsyncCallback<void>): void;
put(key: string, value: ValueType): Promise<void>;
Deprecated
ohos.data.storageStorageputSync(key: string, value: ValueType): void;Deprecated
ohos.data.storageStoragehas(key: string, callback: AsyncCallback<boolean>): boolean;
has(key: string): Promise<boolean>;
Deprecated
ohos.data.storageStoragehasSync(key: string): boolean;Deprecated
ohos.data.storageStorageget(key: string, defValue: ValueType, callback: AsyncCallback<ValueType>): void;
get(key: string, defValue: ValueType): Promise<ValueType>;
Deprecated
ohos.data.storageStoragegetSync(key: string, defValue: ValueType): ValueType;Deprecated
ohos.data.storagestorageremoveStorageFromCache(path: string, callback: AsyncCallback<void>): void;
removeStorageFromCache(path: string): Promise<void>;
Deprecated
ohos.data.storagestorageremoveStorageFromCacheSync(path: string): void;Deprecated
ohos.data.storagestoragedeleteStorage(path: string, callback: AsyncCallback<void>): void;
deleteStorage(path: string): Promise<void>;
Deprecated
ohos.data.storagestoragedeleteStorageSync(path: string): void;Deprecated
ohos.data.storagestoragegetStorage(path: string, callback: AsyncCallback<Storage>): void;
getStorage(path: string): Promise<Storage>;
Deprecated
ohos.data.storagestoragegetStorageSync(path: string): Storage;Deprecated

你可能感兴趣的文章

开源鸿蒙 JS API Changes of the Ability Framework

开源鸿蒙 JS API Changes of the ArkUI Development Framework

开源鸿蒙 JS API Changes of the Power Management Subsystem

开源鸿蒙 JS API Changes of the Bundle Management Framework

开源鸿蒙 JS API Changes of the Communication Subsystem

开源鸿蒙 JS API Changes of the DFX Subsystem

开源鸿蒙 JS API Changes of the Distributed Scheduler Subsystem

开源鸿蒙 JS API Changes of the Common Event and Notification Subsystem

开源鸿蒙 JS API Changes of the File Management Subsystem

开源鸿蒙 JS API Changes of the Globalization Subsystem

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/432c8ed1d144423ca0898c551ed2c8fa