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.