harmony 鸿蒙DataAbilityHelper Switching

  • 2023-02-03
  • 浏览 (643)

DataAbilityHelper Switching

API in the FA Model Corresponding .d.ts File in the Stage Model Corresponding API in the Stage Model
openFile(uri: string, mode: string, callback: AsyncCallback<number>): void;
openFile(uri: string, mode: string): Promise<number>;
\@ohos.data.fileAccess.d.ts openFile(uri: string, flags: OPENFLAGS) : Promise<number>;
openFile(uri: string, flags: OPENFLAGS, callback: AsyncCallback<number>) : void;
on(type: ‘dataChange’, uri: string, callback: AsyncCallback<void>): void; \@ohos.data.dataShare.d.ts on(type: ‘dataChange’, uri: string, callback: AsyncCallback<void>): void;
off(type: ‘dataChange’, uri: string, callback?: AsyncCallback<void>): void; \@ohos.data.dataShare.d.ts off(type: ‘dataChange’, uri: string, callback?: AsyncCallback<void>): void;
getType(uri: string, callback: AsyncCallback<string>): void;
getType(uri: string): Promise<string>;
There is no corresponding API in the stage model. The stage model does not support cross-process URI access. You are advised to use the want parameter to carry the file descriptor and file information for cross-process file access.
getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback<Array<string>>): void;
getFileTypes(uri: string, mimeTypeFilter: string): Promise<Array<string>>;
There is no corresponding API in the stage model. The stage model does not support cross-process URI access. You are advised to use the want parameter to carry the file descriptor and file information for cross-process file access.
normalizeUri(uri: string, callback: AsyncCallback<string>): void;
normalizeUri(uri: string): Promise<string>;
\@ohos.data.dataShare.d.ts normalizeUri(uri: string, callback: AsyncCallback<string>): void;
normalizeUri(uri: string): Promise<string>;
denormalizeUri(uri: string, callback: AsyncCallback<string>): void;
denormalizeUri(uri: string): Promise<string>;
\@ohos.data.dataShare.d.ts denormalizeUri(uri: string, callback: AsyncCallback<string>): void;
denormalizeUri(uri: string): Promise<string>;
notifyChange(uri: string, callback: AsyncCallback<void>): void;
notifyChange(uri: string): Promise<void>;
\@ohos.data.dataShare.d.ts notifyChange(uri: string, callback: AsyncCallback<void>): void;
notifyChange(uri: string): Promise<void>;
insert(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback<number>): void;
insert(uri: string, valuesBucket: rdb.ValuesBucket): Promise<number>;
\@ohos.data.dataShare.d.ts insert(uri: string, value: ValuesBucket, callback: AsyncCallback<number>): void;
insert(uri: string, value: ValuesBucket): Promise<number>;
batchInsert(uri: string, valuesBuckets: Array<rdb.ValuesBucket>, callback: AsyncCallback<number>): void;
batchInsert(uri: string, valuesBuckets: Array<rdb.ValuesBucket>): Promise<number>;
\@ohos.data.dataShare.d.ts batchInsert(uri: string, values: Array<ValuesBucket>, callback: AsyncCallback<number>): void;
batchInsert(uri: string, values: Array<ValuesBucket>): Promise<number>;
delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback<number>): void;
delete(uri: string, predicates?: dataAbility.DataAbilityPredicates): Promise<number>;
delete(uri: string, callback: AsyncCallback<number>): void;
\@ohos.data.dataShare.d.ts delete(uri: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback<number>): void;
delete(uri: string, predicates: dataSharePredicates.DataSharePredicates): Promise<number>;
update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback<number>): void;
update(uri: string, valuesBucket: rdb.ValuesBucket, predicates?: dataAbility.DataAbilityPredicates): Promise<number>;
update(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback<number>): void;
\@ohos.data.dataShare.d.ts update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket, callback: AsyncCallback<number>): void;
update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket): Promise<number>;
query(uri: string, columns: Array<string>, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback<ResultSet>): void;
query(uri: string, callback: AsyncCallback<ResultSet>): void;
query(uri: string, columns: Array<string>, callback: AsyncCallback<ResultSet>): void;
query(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback<ResultSet>): void;
query(uri: string, columns?: Array<string>, predicates?: dataAbility.DataAbilityPredicates): Promise<ResultSet>;
\@ohos.data.dataShare.d.ts query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array<string>, callback: AsyncCallback<DataShareResultSet>): void;
query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array<string>): Promise<DataShareResultSet>;
call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback<PacMap>): void;
call(uri: string, method: string, arg: string, extras: PacMap): Promise<PacMap>;
There is no corresponding API in the stage model. No corresponding API is provided.
executeBatch(uri: string, operations: Array<DataAbilityOperation>, callback: AsyncCallback<Array<DataAbilityResult>>): void;
executeBatch(uri: string, operations: Array<DataAbilityOperation>): Promise<Array<DataAbilityResult>>;
There is no corresponding API in the stage model. No corresponding API is provided.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Application Models

harmony 鸿蒙Using Explicit Want to Start an Application Component

harmony 鸿蒙Using Implicit Want to Open a Website

harmony 鸿蒙AbilityStage Component Container

harmony 鸿蒙Accessing a DataAbility

harmony 鸿蒙Accessing a DataShareExtensionAbility from the FA Model

harmony 鸿蒙AccessibilityExtensionAbility

harmony 鸿蒙Common action and entities Values

harmony 鸿蒙API Switching Overview

harmony 鸿蒙Switching of app and deviceConfig

0  赞