1/* 2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit AbilityKit 19 */ 20 21import Want from '../../@ohos.app.ability.Want'; 22import { ResultSet } from '../../data/rdb/resultSet'; 23import { AbilityInfo } from '../../bundle/abilityInfo'; 24import { DataAbilityResult } from '../../ability/dataAbilityResult'; 25import { DataAbilityOperation } from '../../ability/dataAbilityOperation'; 26import dataAbility from '../../@ohos.data.dataAbility'; 27import formBindingData from '../../@ohos.application.formBindingData'; 28import formInfo from '../../@ohos.app.form.formInfo'; 29import rdb from '../../@ohos.data.rdb'; 30import rpc from '../../@ohos.rpc'; 31import resourceManager from '../../@ohos.resourceManager'; 32import { PacMap } from '../../ability/dataAbilityHelper'; 33import { AsyncCallback } from '../../@ohos.base'; 34 35/** 36 * interface of form lifecycle. 37 * 38 * @interface LifecycleForm 39 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 40 * @FAModelOnly 41 * @since 7 42 */ 43export declare interface LifecycleForm { 44 /** 45 * Called to return a {@link formBindingData.FormBindingData} object. 46 * 47 * @param { Want } want - Indicates the detailed information for creating a {@link formBindingData#FormBindingData}. 48 * The {@code Want} object must include the form ID, form name, and grid style of the form, 49 * which can be obtained from {@link formInfo#FormParam#IDENTITY_KEY}, 50 * {@link formInfo#FormParam#NAME_KEY}, and {@link formInfo#FormParam#DIMENSION_KEY}, 51 * respectively. Such form information must be managed as persistent data for further form 52 * acquisition, update, and deletion. 53 * @returns { formBindingData.FormBindingData } Returns the created {@link formBindingData#FormBindingData} object. 54 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 55 * @FAModelOnly 56 * @since 8 57 */ 58 onCreate?(want: Want): formBindingData.FormBindingData; 59 60 /** 61 * Called when the form provider is notified that a temporary form is successfully converted to a normal form. 62 * 63 * @param { string } formId - Indicates the ID of the form. 64 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 65 * @FAModelOnly 66 * @since 8 67 */ 68 onCastToNormal?(formId: string): void; 69 70 /** 71 * Called to notify the form provider to update a specified form. 72 * 73 * @param { string } formId - Indicates the ID of the form to update. 74 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 75 * @FAModelOnly 76 * @since 8 77 */ 78 onUpdate?(formId: string): void; 79 80 /** 81 * Called when the form provider receives form events from the system. 82 * 83 * @param { object } newStatus - Indicates the form events occurred. The key in the {@code Map} object indicates 84 * form ID,and the value indicates the event type, which can be either 85 * {@link formInfo#VisibilityType#FORM_VISIBLE} or 86 * {@link formInfo#VisibilityType#FORM_INVISIBLE}. 87 * {@link formInfo#VisibilityType#FORM_VISIBLE} 88 * means that the form becomes visible, and 89 * {@link formInfo#VisibilityType#FORM_INVISIBLE} 90 * means that the form becomes invisible. 91 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 92 * @FAModelOnly 93 * @since 8 94 */ 95 /** 96 * Called when the form provider receives form events from the system. 97 * 98 * @param { Record<string, number> } newStatus - Indicates the form events occurred. The key in the {@code Map} 99 * object indicates form ID,and the value indicates the event type, 100 * which can be either 101 * {@link formInfo#VisibilityType#FORM_VISIBLE} or 102 * {@link formInfo#VisibilityType#FORM_INVISIBLE}. 103 * {@link formInfo#VisibilityType#FORM_VISIBLE} 104 * means that the form becomes visible, and 105 * {@link formInfo#VisibilityType#FORM_INVISIBLE} 106 * means that the form becomes invisible. 107 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 108 * @FAModelOnly 109 * @since 11 110 */ 111 onVisibilityChange?(newStatus: Record<string, number>): void; 112 113 /** 114 * Called when a specified message event defined by the form provider is triggered. This method is valid only for 115 * JS forms. 116 * 117 * @param { string } formId - Indicates the ID of the form on which the message event is triggered, which is 118 * provided by the client to the form provider. 119 * @param { string } message - Indicates the value of the {@code params} field of the message event. This parameter 120 * is used to identify the specific component on which the event is triggered. 121 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 122 * @FAModelOnly 123 * @since 8 124 */ 125 onEvent?(formId: string, message: string): void; 126 127 /** 128 * Called to notify the form provider that a specified form has been deleted. Override this method if 129 * you want your application, as the form provider, to be notified of form deletion. 130 * 131 * @param { string } formId - Indicates the ID of the deleted form. 132 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 133 * @FAModelOnly 134 * @since 8 135 */ 136 onDestroy?(formId: string): void; 137 138 /** 139 * Called to return a {@link FormState} object. 140 * <p>You must override this callback if you want this ability to return the actual form state. Otherwise, 141 * this method returns {@link FormState#DEFAULT} by default.</p> 142 * 143 * @param { Want } want - Indicates the description of the form for which the {@link formInfo#FormState} is obtained. 144 * The description covers the bundle name, ability name, module name, form name, form 145 * dimensions. 146 * @returns { formInfo.FormState } Returns the {@link formInfo#FormState} object. 147 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 148 * @FAModelOnly 149 * @since 8 150 */ 151 onAcquireFormState?(want: Want): formInfo.FormState; 152 153 /** 154 * Called when the system shares the form. 155 * 156 * @param { string } formId - Indicates the ID of the deleted form. 157 * @returns { object } Returns the wantParams object. 158 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 159 * @systemapi 160 * @FAModelOnly 161 * @since 9 162 */ 163 onShare?(formId: string): { [key: string]: any }; 164 165 /** 166 * Called when the system shares the form. 167 * The ability of this function is same as onShare. If both are set, this function will be called. 168 * 169 * @param { string } formId - Indicates the ID of the deleted form. 170 * @returns { Record<string, Object> } Returns the wantParams object. 171 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 172 * @systemapi 173 * @FAModelOnly 174 * @since 11 175 */ 176 onShareForm?(formId: string): Record<string, Object>; 177} 178 179/** 180 * interface of app lifecycle. 181 * 182 * @interface LifecycleApp 183 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 184 * @FAModelOnly 185 * @since 7 186 */ 187export declare interface LifecycleApp { 188 /** 189 * Called back when the state of an ability changes from <b>BACKGROUND</b> to <b>INACTIVE</b>. 190 * 191 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 192 * @FAModelOnly 193 * @since 7 194 */ 195 onShow?(): void; 196 197 /** 198 * Called back when an ability enters the <b>BACKGROUND</b> state. 199 * 200 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 201 * @FAModelOnly 202 * @since 7 203 */ 204 onHide?(): void; 205 206 /** 207 * Called back before an ability is destroyed. 208 * 209 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 210 * @FAModelOnly 211 * @since 7 212 */ 213 onDestroy?(): void; 214 215 /** 216 * Called back when an ability is started for initialization. 217 * 218 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 219 * @FAModelOnly 220 * @since 7 221 */ 222 onCreate?(): void; 223 224 /** 225 * Called when the window display mode of this ability changes, for example, from fullscreen mode 226 * to multi-window mode or from multi-window mode to fullscreen mode. 227 * 228 * @param { boolean } isShownInMultiWindow - Specifies whether this ability is currently in multi-window mode.The 229 * value {@code true} indicates the multi-window mode, and {@code false} 230 * indicates another mode. 231 * @param { resourceManager.Configuration } newConfig - Indicates the new configuration information about Page ability. 232 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 233 * @systemapi 234 * @FAModelOnly 235 * @since 7 236 */ 237 onWindowDisplayModeChanged?(isShownInMultiWindow: boolean, newConfig: resourceManager.Configuration): void; 238 239 /** 240 * Asks a user whether to start the migration. 241 * 242 * @returns { boolean } Returns {@code true} if the user allows the migration; returns {@code false} otherwise. 243 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 244 * @FAModelOnly 245 * @since 7 246 */ 247 onStartContinuation?(): boolean; 248 249 /** 250 * Saves the user data of a local ability generated during runtime. 251 * After the migration is triggered and the local ability is ready, this method is called when the Distributed 252 * Scheduler Service requests data from the local ability. 253 * 254 * @param { Object } data - Indicates the user data to save. 255 * @returns { boolean } Returns {@code true} if the data is successfully saved; returns {@code false} otherwise. 256 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 257 * @FAModelOnly 258 * @since 7 259 */ 260 onSaveData?(data: Object): boolean; 261 262 /** 263 * Called back when a local ability migration is complete. 264 * <p>You can define the processing logic after the migration is complete. For example, you can display a prompt to 265 * notify the user of the successful migration and then exit the local ability.</p> 266 * 267 * @param { number } result - Indicates the migration result code. The value {@code 0} indicates that the migration is 268 * successful, and {@code -1} indicates that the migration fails. 269 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 270 * @FAModelOnly 271 * @since 7 272 */ 273 onCompleteContinuation?(result: number): void; 274 275 /** 276 * Restores the user data saved during the migration for an ability on the remote device immediately after the 277 * ability is created on the remote device. Lifecycle scheduling for the ability starts only after the user data 278 * is restored. 279 * 280 * @param { Object } data - Indicates the user data to restore. 281 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 282 * @FAModelOnly 283 * @since 7 284 */ 285 onRestoreData?(data: Object): void; 286 287 /** 288 * Called to notify the local device when a running ability on the remote device is destroyed after a reversible 289 * migration is performed for the ability from the local device to the remote device. 290 * 291 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 292 * @FAModelOnly 293 * @since 7 294 */ 295 onRemoteTerminated?(): void; 296 297 /** 298 * This method is called when the system determines that the ability may be destroyed in an unexpected 299 * situation, for example, when the screen orientation changes or the user touches the Home key. Generally, 300 * this method is used only to save temporary states. 301 * 302 * @param { PacMap } outState - Indicates the {@code PacMap} object used for storing user data and states. This 303 * parameter cannot be null. 304 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 305 * @FAModelOnly 306 * @since 7 307 */ 308 onSaveAbilityState?(outState: PacMap): void; 309 310 /** 311 * This method is called if an ability was destroyed at a certain time due to resource reclaim or was 312 * unexpectedly destroyed and the {@link #onSaveAbilityState(PacMap)} method was called to save its user data and 313 * states. Generally, this method is called after the {@link #onStart(Want)} method. 314 * 315 * @param { PacMap } inState - Indicates the {@code PacMap} object used for storing data and states. This 316 * parameter can not be null. 317 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 318 * @FAModelOnly 319 * @since 7 320 */ 321 onRestoreAbilityState?(inState: PacMap): void; 322 323 /** 324 * Called back when an ability enters the <b>INACTIVE</b> state (an ability in this state is not interactive and may 325 * change to the <b>BACKGROUND</b> or <b>ACTIVE</b> state). 326 * 327 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 328 * @FAModelOnly 329 * @since 7 330 */ 331 onInactive?(): void; 332 333 /** 334 * Called back when an ability enters the <b>ACTIVE</b> state. 335 * 336 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 337 * @FAModelOnly 338 * @since 7 339 */ 340 onActive?(): void; 341 342 /** 343 * Called when the launch mode of an ability is set to singleton. 344 * 345 * @param { Want } want - Indicates the new {@code want} containing information about the ability. 346 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 347 * @FAModelOnly 348 * @since 7 349 */ 350 onNewWant?(want: Want): void; 351 352 /** 353 * Called when the system has determined to trim the memory, for example, when the ability is running in the 354 * background and there is no enough memory for running as many background processes as possible. 355 * 356 * @param { number } level - Indicates the memory trim level, which shows the current memory usage status. 357 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 358 * @FAModelOnly 359 * @since 7 360 */ 361 onMemoryLevel?(level: number): void; 362} 363 364/** 365 * interface of service lifecycle. 366 * 367 * @interface LifecycleService 368 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 369 * @FAModelOnly 370 * @since 7 371 */ 372export declare interface LifecycleService { 373 /** 374 * Called back when an ability is started for initialization (it can be called only once in the entire lifecycle of 375 * an ability). 376 * 377 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 378 * @FAModelOnly 379 * @since 7 380 */ 381 onStart?(): void; 382 383 /** 384 * Called back when Service is started. 385 * 386 * @param { Want } want - Indicates the want of Service to start. 387 * @param { number } startId - Indicates the number of times the Service ability has been started. {@code startId} is 388 * incremented by 1 every time the ability is started. For example, if the ability 389 * has been started for six times. 390 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 391 * @FAModelOnly 392 * @since 7 393 */ 394 onCommand?(want: Want, startId: number): void; 395 396 /** 397 * Called back before an ability is destroyed. 398 * 399 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 400 * @FAModelOnly 401 * @since 7 402 */ 403 onStop?(): void; 404 405 /** 406 * Called back when a Service ability is first connected to an ability. 407 * 408 * @param { Want } want - Indicates connection information about the Service ability. 409 * @returns { rpc.RemoteObject } Returns the proxy of the Service ability. 410 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 411 * @FAModelOnly 412 * @since 7 413 */ 414 onConnect?(want: Want): rpc.RemoteObject; 415 416 /** 417 * Called back when all abilities connected to a Service ability are disconnected. 418 * 419 * @param { Want } want - Indicates disconnection information about the Service ability. 420 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 421 * @FAModelOnly 422 * @since 7 423 */ 424 onDisconnect?(want: Want): void; 425 426 /** 427 * Called when a new client attempts to connect to a Service ability after all previous client connections to it 428 * are disconnected. 429 * <p>The Service ability must have been started but not been destroyed, that is, {@link #startAbility} has been 430 * called but {@link #terminateSelf} has not.</p> 431 * 432 * @param { Want } want - Indicates the want of the Service ability being connected. 433 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 434 * @FAModelOnly 435 * @since 7 436 */ 437 onReconnect?(want: Want): void; 438} 439 440/** 441 * interface of data lifecycle. 442 * 443 * @interface LifecycleData 444 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 445 * @FAModelOnly 446 * @since 7 447 */ 448export declare interface LifecycleData { 449 /** 450 * Updates one or more data records in the database. This method should be implemented by a Data ability. 451 * 452 * @param { string } uri - Indicates the database table storing the data to update. 453 * @param { rdb.ValuesBucket } valueBucket - Indicates the data to update. This parameter can be null. 454 * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. If this parameter is null, 455 * all data records will be updated by default. 456 * @param { AsyncCallback<number> } callback - function specified by framework to receive the result, developer should 457 * call this function to return the result to framework. 458 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 459 * @FAModelOnly 460 * @since 7 461 */ 462 update?( 463 uri: string, 464 valueBucket: rdb.ValuesBucket, 465 predicates: dataAbility.DataAbilityPredicates, 466 callback: AsyncCallback<number> 467 ): void; 468 469 /** 470 * Queries one or more data records in the database. This method should be implemented by a Data ability. 471 * 472 * @param { string } uri - Indicates the database table storing the data to query. 473 * @param { Array<string> } columns - Indicates the columns to be queried, in array, for example, {"name","age"}. 474 * You should define the processing logic when this parameter is null. 475 * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. If this parameter is null, 476 * all data records will be queried by default. 477 * @param { AsyncCallback<ResultSet> } callback - function specified by framework to receive the result, developer 478 * should call this function to return the result to framework. 479 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 480 * @FAModelOnly 481 * @since 7 482 */ 483 query?( 484 uri: string, 485 columns: Array<string>, 486 predicates: dataAbility.DataAbilityPredicates, 487 callback: AsyncCallback<ResultSet> 488 ): void; 489 490 /** 491 * Deletes one or more data records. This method should be implemented by a Data ability. 492 * 493 * @param { string } uri - Indicates the database table storing the data to delete. 494 * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. If this parameter is null, 495 * all data records will be deleted by default. 496 * @param { AsyncCallback<number> } callback - function specified by framework to receive the result, developer should 497 * call this function to return the result to framework. 498 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 499 * @FAModelOnly 500 * @since 7 501 */ 502 delete?(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback<number>): void; 503 504 /** 505 * Converts the given {@code uri} that refer to the Data ability into a normalized URI. A normalized URI can be 506 * used across devices, persisted, backed up, and restored. It can refer to the same item in the Data ability 507 * even if the context has changed. 508 * 509 * @param { string } uri - Indicates the uri to normalize. 510 * @param { AsyncCallback<string> } callback - function specified by framework to receive the result, developer 511 * should call this function to return the result to framework. 512 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 513 * @FAModelOnly 514 * @since 7 515 */ 516 normalizeUri?(uri: string, callback: AsyncCallback<string>): void; 517 518 /** 519 * Inserts multiple data records into the database. This method should be implemented by a Data ability. 520 * 521 * @param { string } uri - Indicates the position where the data is to insert. 522 * @param { Array<rdb.ValuesBucket> } valueBuckets - Indicates the data to insert. 523 * @param { AsyncCallback<number> } callback - function specified by framework to receive the result, developer should 524 * call this function to return the result to framework. 525 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 526 * @FAModelOnly 527 * @since 7 528 */ 529 batchInsert?(uri: string, valueBuckets: Array<rdb.ValuesBucket>, callback: AsyncCallback<number>): void; 530 531 /** 532 * Converts the given normalized {@code uri} generated by {@link #normalizeUri(uri)} into a denormalized one. 533 * The default implementation of this method returns the original uri passed to it. 534 * 535 * @param { string } uri - Indicates the uri to denormalize. 536 * @param { AsyncCallback<string> } callback - function specified by framework to receive the result, developer 537 * should call this function to return the result to framework. 538 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 539 * @FAModelOnly 540 * @since 7 541 */ 542 denormalizeUri?(uri: string, callback: AsyncCallback<string>): void; 543 544 /** 545 * Inserts a data record into the database. This method should be implemented by a Data ability. 546 * 547 * @param { string } uri - Indicates the position where the data is to insert. 548 * @param { rdb.ValuesBucket } valueBucket - Indicates the data to insert. 549 * @param { AsyncCallback<number> } callback - function specified by framework to receive the result, developer 550 * should call this function to return the result to framework. 551 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 552 * @FAModelOnly 553 * @since 7 554 */ 555 insert?(uri: string, valueBucket: rdb.ValuesBucket, callback: AsyncCallback<number>): void; 556 557 /** 558 * Opens a file. This method should be implemented by a Data ability. 559 * 560 * @param { string } uri - Indicates the path of the file to open. 561 * @param { string } mode - Indicates the open mode, which can be "r" for read-only access, "w" for write-only access 562 * (erasing whatever data is currently in the file), "wt" for write access that truncates any 563 * existing file,"wa" for write-only access to append to any existing data, "rw" for read and 564 * write access on any existing data, or "rwt" for read and write access that truncates any 565 * existing file. 566 * @param { AsyncCallback<number> } callback - function specified by framework to receive the result, developer should 567 * call this function to return the result to framework. 568 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 569 * @FAModelOnly 570 * @since 7 571 */ 572 openFile?(uri: string, mode: string, callback: AsyncCallback<number>): void; 573 574 /** 575 * Obtains the MIME type of files. This method should be implemented by a Data ability. 576 * 577 * @param { string } uri - Indicates the path of the files to obtain. 578 * @param { string } mimeTypeFilter - Indicates the MIME type of the files to obtain. This parameter cannot be set to 579 * {@code null}. 580 * <p>1. "*/*": Obtains all types supported by a Data ability. 581 * <p>2. "image/*": Obtains files whose main type is image of any subtype. 582 * <p>3. "*/jpg": Obtains files whose subtype is JPG of any main type. 583 * @param { AsyncCallback<Array<string>> } callback - function specified by framework to receive the result, developer 584 * should call this function to return the result to framework. 585 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 586 * @FAModelOnly 587 * @since 7 588 */ 589 getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback<Array<string>>): void; 590 591 /** 592 * Called to carry {@code AbilityInfo} to this ability after the ability is initialized. 593 * 594 * @param { AbilityInfo } info - Indicates the {@code AbilityInfo} object containing information about this ability. 595 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 596 * @FAModelOnly 597 * @since 7 598 */ 599 onInitialized?(info: AbilityInfo): void; 600 601 /** 602 * Obtains the MIME type matching the data specified by the URI of the Data ability. This method should be 603 * implemented by a Data ability. 604 * <p>Data abilities supports general data types, including text, HTML, and JPEG.</p> 605 * 606 * @param { string } uri - Indicates the uri of the data. 607 * @param { AsyncCallback<string> } callback - function specified by framework to receive the result, developer should 608 * call this function to return the result to framework. 609 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 610 * @FAModelOnly 611 * @since 7 612 */ 613 getType?(uri: string, callback: AsyncCallback<string>): void; 614 615 /** 616 * Performs batch operations on the database. This method should be implemented by a Data ability. 617 * 618 * @param { Array<DataAbilityOperation> } ops - Indicates the data operation list, which can contain multiple operations 619 * on the database. 620 * @param { AsyncCallback<Array<DataAbilityResult>> } callback - specified by framework to receive the result, 621 * developer should call this function to return 622 * the result to framework. 623 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 624 * @FAModelOnly 625 * @since 7 626 */ 627 executeBatch?(ops: Array<DataAbilityOperation>, callback: AsyncCallback<Array<DataAbilityResult>>): void; 628 629 /** 630 * Defines a method in this Data ability (implementation depending on child classes). 631 * 632 * @param { string } method - Indicates the method name. 633 * @param { string } arg - Indicates the parameter transferred by the method. 634 * @param { PacMap } extras - Indicates the parameter transferred by the method. 635 * @param { AsyncCallback<PacMap> } callback - function specified by framework to receive the result, developer 636 * should call this function to return the result to framework. 637 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel 638 * @FAModelOnly 639 * @since 7 640 */ 641 call?(method: string, arg: string, extras: PacMap, callback: AsyncCallback<PacMap>): void; 642} 643