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

  • 2022-08-09
  • 浏览 (508)

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

Module Class Method/Attribute/Enumeration/Constant Change Type
ohos.data.preferences preferences const MAX_VALUE_LENGTH: 8192; Added
ohos.data.preferences preferences const MAX_KEY_LENGTH: 80; Added
ohos.data.preferences Preferences off(type: ‘change’, callback?: Callback<{ key: string }>): void; Added
ohos.data.preferences Preferences on(type: ‘change’, callback: Callback<{ key: string }>): void; Added
ohos.data.preferences Preferences flush(callback: AsyncCallback<void>): void;
flush(): Promise<void>;
Added
ohos.data.preferences Preferences clear(callback: AsyncCallback<void>): void;
clear(): Promise<void>;
Added
ohos.data.preferences Preferences delete(key: string, callback: AsyncCallback<void>): void;
delete(key: string): Promise<void>;
Added
ohos.data.preferences Preferences put(key: string, value: ValueType, callback: AsyncCallback<void>): void;
put(key: string, value: ValueType): Promise<void>;
Added
ohos.data.preferences Preferences has(key: string, callback: AsyncCallback<boolean>): void;
has(key: string): Promise<boolean>;
Added
ohos.data.preferences Preferences getAll(callback: AsyncCallback<Object>): void;
getAll(): Promise<Object>;
Added
ohos.data.preferences Preferences get(key: string, defValue: ValueType, callback: AsyncCallback<ValueType>): void;
get(key: string, defValue: ValueType): Promise<ValueType>;
Added
ohos.data.preferences preferences removePreferencesFromCache(context: Context, name: string, callback: AsyncCallback<void>): void;
removePreferencesFromCache(context: Context, name: string): Promise<void>;
Added
ohos.data.preferences preferences deletePreferences(context: Context, name: string, callback: AsyncCallback<void>): void;
deletePreferences(context: Context, name: string): Promise<void>;
Added
ohos.data.preferences preferences getPreferences(context: Context, name: string, callback: AsyncCallback<Preferences>): void;
getPreferences(context: Context, name: string): Promise<Preferences>;
Added
ohos.data.storage storage const MAX_VALUE_LENGTH: 8192; Deprecated
ohos.data.storage storage const MAX_KEY_LENGTH: 80; Deprecated
ohos.data.storage StorageObserver key: string; Deprecated
ohos.data.storage Storage off(type: ‘change’, callback: Callback<StorageObserver>): void; Deprecated
ohos.data.storage Storage on(type: ‘change’, callback: Callback<StorageObserver>): void; Deprecated
ohos.data.storage Storage flush(callback: AsyncCallback<void>): void;
flush(): Promise<void>;
Deprecated
ohos.data.storage Storage flushSync(): void; Deprecated
ohos.data.storage Storage clear(callback: AsyncCallback<void>): void;
clear(): Promise<void>;
Deprecated
ohos.data.storage Storage clearSync(): void; Deprecated
ohos.data.storage Storage delete(key: string, callback: AsyncCallback<void>): void;
delete(key: string): Promise<void>;
Deprecated
ohos.data.storage Storage deleteSync(key: string): void; Deprecated
ohos.data.storage Storage put(key: string, value: ValueType, callback: AsyncCallback<void>): void;
put(key: string, value: ValueType): Promise<void>;
Deprecated
ohos.data.storage Storage putSync(key: string, value: ValueType): void; Deprecated
ohos.data.storage Storage has(key: string, callback: AsyncCallback<boolean>): boolean;
has(key: string): Promise<boolean>;
Deprecated
ohos.data.storage Storage hasSync(key: string): boolean; Deprecated
ohos.data.storage Storage get(key: string, defValue: ValueType, callback: AsyncCallback<ValueType>): void;
get(key: string, defValue: ValueType): Promise<ValueType>;
Deprecated
ohos.data.storage Storage getSync(key: string, defValue: ValueType): ValueType; Deprecated
ohos.data.storage storage removeStorageFromCache(path: string, callback: AsyncCallback<void>): void;
removeStorageFromCache(path: string): Promise<void>;
Deprecated
ohos.data.storage storage removeStorageFromCacheSync(path: string): void; Deprecated
ohos.data.storage storage deleteStorage(path: string, callback: AsyncCallback<void>): void;
deleteStorage(path: string): Promise<void>;
Deprecated
ohos.data.storage storage deleteStorageSync(path: string): void; Deprecated
ohos.data.storage storage getStorage(path: string, callback: AsyncCallback<Storage>): void;
getStorage(path: string): Promise<Storage>;
Deprecated
ohos.data.storage storage getStorageSync(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

0  赞