openharmony 鸿蒙 js-apidiff-distributed-data

2022-12-22 浏览 (848)

分布式数据管理子系统JS API变更

OpenHarmony 3.2 Beta1版本相较于OpenHarmony 3.1 Release版本,分布式数据管理子系统的API变更如下:

接口变更

模块名类名方法/属性/枚举/常量变更类型
ohos.data.preferencespreferencesconst MAX_VALUE_LENGTH: 8192;新增
ohos.data.preferencespreferencesconst MAX_KEY_LENGTH: 80;新增
ohos.data.preferencesPreferencesoff(type: 'change', callback?: Callback<{ key: string }>): void;新增
ohos.data.preferencesPreferenceson(type: 'change', callback: Callback<{ key: string }>): void;新增
ohos.data.preferencesPreferencesflush(callback: AsyncCallback<void>): void;
flush(): Promise<void>;
新增
ohos.data.preferencesPreferencesclear(callback: AsyncCallback<void>): void;
clear(): Promise<void>;
新增
ohos.data.preferencesPreferencesdelete(key: string, callback: AsyncCallback<void>): void;
delete(key: string): Promise<void>;
新增
ohos.data.preferencesPreferencesput(key: string, value: ValueType, callback: AsyncCallback<void>): void;
put(key: string, value: ValueType): Promise<void>;
新增
ohos.data.preferencesPreferenceshas(key: string, callback: AsyncCallback<boolean>): void;
has(key: string): Promise<boolean>;
新增
ohos.data.preferencesPreferencesgetAll(callback: AsyncCallback<Object>): void;
getAll(): Promise<Object>;
新增
ohos.data.preferencesPreferencesget(key: string, defValue: ValueType, callback: AsyncCallback<ValueType>): void;
get(key: string, defValue: ValueType): Promise<ValueType>;
新增
ohos.data.preferencespreferencesremovePreferencesFromCache(context: Context, name: string, callback: AsyncCallback<void>): void;
removePreferencesFromCache(context: Context, name: string): Promise<void>;
新增
ohos.data.preferencespreferencesdeletePreferences(context: Context, name: string, callback: AsyncCallback<void>): void;
deletePreferences(context: Context, name: string): Promise<void>;
新增
ohos.data.preferencespreferencesgetPreferences(context: Context, name: string, callback: AsyncCallback<Preferences>): void;
getPreferences(context: Context, name: string): Promise<Preferences>;
新增
ohos.data.storagestorageconst MAX_VALUE_LENGTH: 8192;废弃
ohos.data.storagestorageconst MAX_KEY_LENGTH: 80;废弃
ohos.data.storageStorageObserverkey: string;废弃
ohos.data.storageStorageoff(type: 'change', callback: Callback<StorageObserver>): void;废弃
ohos.data.storageStorageon(type: 'change', callback: Callback<StorageObserver>): void;废弃
ohos.data.storageStorageflush(callback: AsyncCallback<void>): void;
flush(): Promise<void>;
废弃
ohos.data.storageStorageflushSync(): void;废弃
ohos.data.storageStorageclear(callback: AsyncCallback<void>): void;
clear(): Promise<void>;
废弃
ohos.data.storageStorageclearSync(): void;废弃
ohos.data.storageStoragedelete(key: string, callback: AsyncCallback<void>): void;
delete(key: string): Promise<void>;
废弃
ohos.data.storageStoragedeleteSync(key: string): void;废弃
ohos.data.storageStorageput(key: string, value: ValueType, callback: AsyncCallback<void>): void;
put(key: string, value: ValueType): Promise<void>;
废弃
ohos.data.storageStorageputSync(key: string, value: ValueType): void;废弃
ohos.data.storageStoragehas(key: string, callback: AsyncCallback<boolean>): boolean;
has(key: string): Promise<boolean>;
废弃
ohos.data.storageStoragehasSync(key: string): boolean;废弃
ohos.data.storageStorageget(key: string, defValue: ValueType, callback: AsyncCallback<ValueType>): void;
get(key: string, defValue: ValueType): Promise<ValueType>;
废弃
ohos.data.storageStoragegetSync(key: string, defValue: ValueType): ValueType;废弃
ohos.data.storagestorageremoveStorageFromCache(path: string, callback: AsyncCallback<void>): void;
removeStorageFromCache(path: string): Promise<void>;
废弃
ohos.data.storagestorageremoveStorageFromCacheSync(path: string): void;废弃
ohos.data.storagestoragedeleteStorage(path: string, callback: AsyncCallback<void>): void;
deleteStorage(path: string): Promise<void>;
废弃
ohos.data.storagestoragedeleteStorageSync(path: string): void;废弃
ohos.data.storagestoragegetStorage(path: string, callback: AsyncCallback<Storage>): void;
getStorage(path: string): Promise<Storage>;
废弃
ohos.data.storagestoragegetStorageSync(path: string): Storage;废弃

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Readme

harmony 鸿蒙元能力子系统JS API变更

harmony 鸿蒙ArkUI子系统JS API变更

harmony 鸿蒙电源服务子系统JS API变更

harmony 鸿蒙包管理子系统JS API变更

harmony 鸿蒙基础通信子系统JS API变更

harmony 鸿蒙DFX子系统JS API变更

harmony 鸿蒙事件通知子系统JS API变更

harmony 鸿蒙文件管理子系统JS API变更

harmony 鸿蒙全球化子系统JS API变更

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