1/* 2 * Copyright (c) 2020-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 ArkUI 19 */ 20 21/*** if arkts 1.2 */ 22import { FillMode, PlayMode } from './arkui/component/enums'; 23import { ExpectedFrameRateRange } from './arkui/component/common'; 24/*** endif */ 25 26/** 27 * Defines the animator options. 28 * @interface AnimatorOptions 29 * @syscap SystemCapability.ArkUI.ArkUI.Full 30 * @since 6 31 */ 32/** 33 * Defines the animator options. 34 * @interface AnimatorOptions 35 * @syscap SystemCapability.ArkUI.ArkUI.Full 36 * @crossplatform 37 * @since 10 38 */ 39/** 40 * Defines the animator options. 41 * @interface AnimatorOptions 42 * @syscap SystemCapability.ArkUI.ArkUI.Full 43 * @crossplatform 44 * @atomicservice 45 * @since arkts {'1.1':'11','1.2':'20'} 46 * @arkts 1.1&1.2 47 */ 48export interface AnimatorOptions { 49 /** 50 * Duration of the animation, in milliseconds. 51 * The default value is 0. 52 * @type {number} 53 * @syscap SystemCapability.ArkUI.ArkUI.Full 54 * @since 6 55 */ 56 /** 57 * Duration of the animation, in milliseconds. 58 * The default value is 0. 59 * @type {number} 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @crossplatform 62 * @since 10 63 */ 64 /** 65 * Duration of the animation, in milliseconds. 66 * The default value is 0. 67 * @type {number} 68 * @syscap SystemCapability.ArkUI.ArkUI.Full 69 * @crossplatform 70 * @atomicservice 71 * @since arkts {'1.1':'11','1.2':'20'} 72 * @arkts 1.1&1.2 73 */ 74 duration: number; 75 76 /** 77 * Time curve of the animation. For details about the supported types. 78 * linear The animation speed keeps unchanged. 79 * ease The animation starts and ends at a low speed, cubic-bezier(0.25, 0.1, 0.25, 1.0). 80 * ease-in The animation starts at a low speed, cubic-bezier(0.42, 0.0, 1.0, 1.0). 81 * ease-out The animation ends at a low speed, cubic-bezier(0.0, 0.0, 0.58, 1.0). 82 * ease-in-out The animation starts and ends at a low speed, cubic-bezier(0.42, 0.0, 0.58, 1.0). 83 * fast-out-slow-in Standard curve, cubic-bezier(0.4, 0.0, 0.2, 1.0). 84 * linear-out-slow-in Deceleration curve, cubic-bezier(0.0, 0.0, 0.2, 1.0). 85 * fast-out-linear-in Acceleration curve, cubic-bezier(0.4, 0.0, 1.0, 1.0). 86 * friction Damping curve, cubic-bezier(0.2, 0.0, 0.2, 1.0). 87 * extreme-deceleration Extreme deceleration curve, cubic-bezier(0.0, 0.0, 0.0, 1.0). 88 * sharp Sharp curve, cubic-bezier(0.33, 0.0, 0.67, 1.0). 89 * rhythm Rhythm curve, cubic-bezier(0.7, 0.0, 0.2, 1.0). 90 * smooth Smooth curve, cubic-bezier(0.4, 0.0, 0.4, 1.0). 91 * cubic-bezier(x1, y1, x2, y2) You can customize an animation speed curve in the cubic-bezier() function. The x and y values of each input parameter must be between 0 and 1. 92 * Step curve. The number must be set and only an integer is supported, step-position is optional. It can be set to start or end. The default value is end. 93 * The default value is ease. 94 * @type {string} 95 * @syscap SystemCapability.ArkUI.ArkUI.Full 96 * @since 6 97 */ 98 /** 99 * Time curve of the animation. For details about the supported types. 100 * linear The animation speed keeps unchanged. 101 * ease The animation starts and ends at a low speed, cubic-bezier(0.25, 0.1, 0.25, 1.0). 102 * ease-in The animation starts at a low speed, cubic-bezier(0.42, 0.0, 1.0, 1.0). 103 * ease-out The animation ends at a low speed, cubic-bezier(0.0, 0.0, 0.58, 1.0). 104 * ease-in-out The animation starts and ends at a low speed, cubic-bezier(0.42, 0.0, 0.58, 1.0). 105 * fast-out-slow-in Standard curve, cubic-bezier(0.4, 0.0, 0.2, 1.0). 106 * linear-out-slow-in Deceleration curve, cubic-bezier(0.0, 0.0, 0.2, 1.0). 107 * fast-out-linear-in Acceleration curve, cubic-bezier(0.4, 0.0, 1.0, 1.0). 108 * friction Damping curve, cubic-bezier(0.2, 0.0, 0.2, 1.0). 109 * extreme-deceleration Extreme deceleration curve, cubic-bezier(0.0, 0.0, 0.0, 1.0). 110 * sharp Sharp curve, cubic-bezier(0.33, 0.0, 0.67, 1.0). 111 * rhythm Rhythm curve, cubic-bezier(0.7, 0.0, 0.2, 1.0). 112 * smooth Smooth curve, cubic-bezier(0.4, 0.0, 0.4, 1.0). 113 * cubic-bezier(x1, y1, x2, y2) You can customize an animation speed curve in the cubic-bezier() function. The x and y values of each input parameter must be between 0 and 1. 114 * Step curve. The number must be set and only an integer is supported, step-position is optional. It can be set to start or end. The default value is end. 115 * The default value is ease. 116 * @type {string} 117 * @syscap SystemCapability.ArkUI.ArkUI.Full 118 * @crossplatform 119 * @since 10 120 */ 121 /** 122 * Time curve of the animation. For details about the supported types. 123 * linear The animation speed keeps unchanged. 124 * ease The animation starts and ends at a low speed, cubic-bezier(0.25, 0.1, 0.25, 1.0). 125 * ease-in The animation starts at a low speed, cubic-bezier(0.42, 0.0, 1.0, 1.0). 126 * ease-out The animation ends at a low speed, cubic-bezier(0.0, 0.0, 0.58, 1.0). 127 * ease-in-out The animation starts and ends at a low speed, cubic-bezier(0.42, 0.0, 0.58, 1.0). 128 * fast-out-slow-in Standard curve, cubic-bezier(0.4, 0.0, 0.2, 1.0). 129 * linear-out-slow-in Deceleration curve, cubic-bezier(0.0, 0.0, 0.2, 1.0). 130 * fast-out-linear-in Acceleration curve, cubic-bezier(0.4, 0.0, 1.0, 1.0). 131 * friction Damping curve, cubic-bezier(0.2, 0.0, 0.2, 1.0). 132 * extreme-deceleration Extreme deceleration curve, cubic-bezier(0.0, 0.0, 0.0, 1.0). 133 * sharp Sharp curve, cubic-bezier(0.33, 0.0, 0.67, 1.0). 134 * rhythm Rhythm curve, cubic-bezier(0.7, 0.0, 0.2, 1.0). 135 * smooth Smooth curve, cubic-bezier(0.4, 0.0, 0.4, 1.0). 136 * cubic-bezier(x1, y1, x2, y2) You can customize an animation speed curve in the cubic-bezier() function. The x and y values of each input parameter must be between 0 and 1. 137 * Step curve. The number must be set and only an integer is supported, step-position is optional. It can be set to start or end. The default value is end. 138 * interpolating-spring(velocity, mass, stiffness, damping), interpolating spring curve. 139 * The default value is ease. 140 * @type {string} 141 * @syscap SystemCapability.ArkUI.ArkUI.Full 142 * @crossplatform 143 * @atomicservice 144 * @since arkts {'1.1':'11','1.2':'20'} 145 * @arkts 1.1&1.2 146 */ 147 easing: string; 148 149 /** 150 * Delay for the animation start. The default value indicates no delay. 151 * The default value is 0. 152 * @type {number} 153 * @syscap SystemCapability.ArkUI.ArkUI.Full 154 * @since 6 155 */ 156 /** 157 * Delay for the animation start. The default value indicates no delay. 158 * The default value is 0. 159 * @type {number} 160 * @syscap SystemCapability.ArkUI.ArkUI.Full 161 * @crossplatform 162 * @since 10 163 */ 164 /** 165 * Delay for the animation start. The default value indicates no delay. 166 * The default value is 0. 167 * @type {number} 168 * @syscap SystemCapability.ArkUI.ArkUI.Full 169 * @crossplatform 170 * @atomicservice 171 * @since arkts {'1.1':'11','1.2':'20'} 172 * @arkts 1.1&1.2 173 */ 174 delay: number; 175 176 /** 177 * Whether to resume to the initial state after the animation is executed. 178 * none: The initial state is restored after the animation is executed. 179 * forwards: The state at the end of the animation (defined in the last key frame) is retained after the animation is executed. 180 * @type {"none" | "forwards" | "backwards" | "both"} 181 * @syscap SystemCapability.ArkUI.ArkUI.Full 182 * @since 6 183 */ 184 /** 185 * Whether to resume to the initial state after the animation is executed. 186 * none: The initial state is restored after the animation is executed. 187 * forwards: The state at the end of the animation (defined in the last key frame) is retained after the animation is executed. 188 * @type {"none" | "forwards" | "backwards" | "both"} 189 * @syscap SystemCapability.ArkUI.ArkUI.Full 190 * @crossplatform 191 * @since 10 192 */ 193 /** 194 * Whether to resume to the initial state after the animation is executed. 195 * none: The initial state is restored after the animation is executed. 196 * forwards: The state at the end of the animation (defined in the last key frame) is retained after the animation is executed. 197 * @type {"none" | "forwards" | "backwards" | "both"} 198 * @syscap SystemCapability.ArkUI.ArkUI.Full 199 * @crossplatform 200 * @atomicservice 201 * @since arkts {'1.1':'11','1.2':'20'} 202 * @arkts 1.1&1.2 203 */ 204 fill: "none" | "forwards" | "backwards" | "both"; 205 206 /** 207 * The animation playback mode. 208 * The default value is "normal". 209 * @type {"normal" | "reverse" | "alternate" | "alternate-reverse"} 210 * @syscap SystemCapability.ArkUI.ArkUI.Full 211 * @since 6 212 */ 213 /** 214 * The animation playback mode. 215 * The default value is "normal". 216 * @type {"normal" | "reverse" | "alternate" | "alternate-reverse"} 217 * @syscap SystemCapability.ArkUI.ArkUI.Full 218 * @crossplatform 219 * @since 10 220 */ 221 /** 222 * The animation playback mode. 223 * The default value is "normal". 224 * @type {"normal" | "reverse" | "alternate" | "alternate-reverse"} 225 * @syscap SystemCapability.ArkUI.ArkUI.Full 226 * @crossplatform 227 * @atomicservice 228 * @since arkts {'1.1':'11','1.2':'20'} 229 * @arkts 1.1&1.2 230 */ 231 direction: "normal" | "reverse" | "alternate" | "alternate-reverse"; 232 233 /** 234 * Number of times the animation will be played. number indicates a fixed number of playback operations, and -1 an unlimited number of playback operations. 235 * The default value is 1. 236 * @type {number} 237 * @syscap SystemCapability.ArkUI.ArkUI.Full 238 * @since 6 239 */ 240 /** 241 * Number of times the animation will be played. number indicates a fixed number of playback operations, and -1 an unlimited number of playback operations. 242 * The default value is 1. 243 * @type {number} 244 * @syscap SystemCapability.ArkUI.ArkUI.Full 245 * @crossplatform 246 * @since 10 247 */ 248 /** 249 * Number of times the animation will be played. number indicates a fixed number of playback operations, and -1 an unlimited number of playback operations. 250 * The default value is 1. 251 * @type {number} 252 * @syscap SystemCapability.ArkUI.ArkUI.Full 253 * @crossplatform 254 * @atomicservice 255 * @since arkts {'1.1':'11','1.2':'20'} 256 * @arkts 1.1&1.2 257 */ 258 iterations: number; 259 260 /** 261 * Starting point of animator interpolation. 262 * The default value is 0. 263 * @type {number} 264 * @syscap SystemCapability.ArkUI.ArkUI.Full 265 * @since 6 266 */ 267 /** 268 * Starting point of animator interpolation. 269 * The default value is 0. 270 * @type {number} 271 * @syscap SystemCapability.ArkUI.ArkUI.Full 272 * @crossplatform 273 * @since 10 274 */ 275 /** 276 * Starting point of animator interpolation. 277 * The default value is 0. 278 * @type {number} 279 * @syscap SystemCapability.ArkUI.ArkUI.Full 280 * @crossplatform 281 * @atomicservice 282 * @since arkts {'1.1':'11','1.2':'20'} 283 * @arkts 1.1&1.2 284 */ 285 begin: number; 286 287 /** 288 * Ending point of Dynamic Interpolation 289 * The default value is 1. 290 * @type {number} 291 * @syscap SystemCapability.ArkUI.ArkUI.Full 292 * @since 6 293 */ 294 /** 295 * Ending point of Dynamic Interpolation 296 * The default value is 1. 297 * @type {number} 298 * @syscap SystemCapability.ArkUI.ArkUI.Full 299 * @crossplatform 300 * @since 10 301 */ 302 /** 303 * Ending point of Dynamic Interpolation 304 * The default value is 1. 305 * @type {number} 306 * @syscap SystemCapability.ArkUI.ArkUI.Full 307 * @crossplatform 308 * @atomicservice 309 * @since arkts {'1.1':'11','1.2':'20'} 310 * @arkts 1.1&1.2 311 */ 312 end: number; 313} 314 315/** 316 * Defines the SimpleAnimatorOptions class. 317 * 318 * @syscap SystemCapability.ArkUI.ArkUI.Full 319 * @crossplatform 320 * @atomicservice 321 * @since arkts {'1.1':'18','1.2':'20'} 322 * @arkts 1.1&1.2 323 */ 324export declare class SimpleAnimatorOptions { 325 /** 326 * constructor. 327 * 328 * @param { number } begin - Starting point of animator interpolation. 329 * @param { number } end - Ending point of animator interpolation. 330 * @syscap SystemCapability.ArkUI.ArkUI.Full 331 * @crossplatform 332 * @atomicservice 333 * @since arkts {'1.1':'18','1.2':'20'} 334 * @arkts 1.1&1.2 335 */ 336 constructor(begin: number, end: number); 337 338 /** 339 * Set duration of the animation, in milliseconds. 340 * 341 * @param { number } duration - if not set, default is 1000. 342 * @returns { SimpleAnimatorOptions } 343 * @syscap SystemCapability.ArkUI.ArkUI.Full 344 * @crossplatform 345 * @atomicservice 346 * @since arkts {'1.1':'18','1.2':'20'} 347 * @arkts 1.1&1.2 348 */ 349 duration(duration: number): SimpleAnimatorOptions; 350 351 /** 352 * Set time curve of the animation. For details about the supported types. 353 * linear The animation speed keeps unchanged. 354 * ease The animation starts and ends at a low speed, cubic-bezier(0.25, 0.1, 0.25, 1.0). 355 * ease-in The animation starts at a low speed, cubic-bezier(0.42, 0.0, 1.0, 1.0). 356 * ease-out The animation ends at a low speed, cubic-bezier(0.0, 0.0, 0.58, 1.0). 357 * ease-in-out The animation starts and ends at a low speed, cubic-bezier(0.42, 0.0, 0.58, 1.0). 358 * fast-out-slow-in Standard curve, cubic-bezier(0.4, 0.0, 0.2, 1.0). 359 * linear-out-slow-in Deceleration curve, cubic-bezier(0.0, 0.0, 0.2, 1.0). 360 * fast-out-linear-in Acceleration curve, cubic-bezier(0.4, 0.0, 1.0, 1.0). 361 * friction Damping curve, cubic-bezier(0.2, 0.0, 0.2, 1.0). 362 * extreme-deceleration Extreme deceleration curve, cubic-bezier(0.0, 0.0, 0.0, 1.0). 363 * sharp Sharp curve, cubic-bezier(0.33, 0.0, 0.67, 1.0). 364 * rhythm Rhythm curve, cubic-bezier(0.7, 0.0, 0.2, 1.0). 365 * smooth Smooth curve, cubic-bezier(0.4, 0.0, 0.4, 1.0). 366 * cubic-bezier(x1, y1, x2, y2) You can customize an animation speed curve in the cubic-bezier() function. The x and y values of each input parameter must be between 0 and 1. 367 * Step curve. The number must be set and only an integer is supported, step-position is optional. It can be set to start or end. The default value is end. 368 * @param { string } curve - if not set, default is ease. 369 * @returns { SimpleAnimatorOptions } 370 * @syscap SystemCapability.ArkUI.ArkUI.Full 371 * @crossplatform 372 * @atomicservice 373 * @since arkts {'1.1':'18','1.2':'20'} 374 * @arkts 1.1&1.2 375 */ 376 easing(curve: string): SimpleAnimatorOptions; 377 378 /** 379 * Set delay for the animation start. The default value indicates no delay. 380 * 381 * @param { number } delay - if not set, default is 0. 382 * @returns { SimpleAnimatorOptions } 383 * @syscap SystemCapability.ArkUI.ArkUI.Full 384 * @crossplatform 385 * @atomicservice 386 * @since arkts {'1.1':'18','1.2':'20'} 387 * @arkts 1.1&1.2 388 */ 389 delay(delay: number): SimpleAnimatorOptions; 390 391 /** 392 * Set FillMode of animation. FillMode indicates whether to resume to the initial state after the animation is executed. 393 * 394 * @param { FillMode } fillMode - if not set, default is FillMode.Forwards. 395 * @returns { SimpleAnimatorOptions } 396 * @syscap SystemCapability.ArkUI.ArkUI.Full 397 * @crossplatform 398 * @atomicservice 399 * @since arkts {'1.1':'18','1.2':'20'} 400 * @arkts 1.1&1.2 401 */ 402 fill(fillMode: FillMode): SimpleAnimatorOptions; 403 404 /** 405 * Set the animation playback mode. 406 * 407 * @param { PlayMode } direction - if not set, default is PlayMode.Normal. 408 * @returns { SimpleAnimatorOptions } 409 * @syscap SystemCapability.ArkUI.ArkUI.Full 410 * @crossplatform 411 * @atomicservice 412 * @since arkts {'1.1':'18','1.2':'20'} 413 * @arkts 1.1&1.2 414 */ 415 direction(direction: PlayMode): SimpleAnimatorOptions; 416 417 /** 418 * Set number of times the animation will be played. number indicates a fixed number of playback operations, and -1 an unlimited number of playback operations. 419 * 420 * @param { number } iterations - if not set, default is 1. 421 * @returns { SimpleAnimatorOptions } 422 * @syscap SystemCapability.ArkUI.ArkUI.Full 423 * @crossplatform 424 * @atomicservice 425 * @since arkts {'1.1':'18','1.2':'20'} 426 * @arkts 1.1&1.2 427 */ 428 iterations(iterations: number): SimpleAnimatorOptions; 429} 430 431/** 432 * Defines the Animator result interface. 433 * @interface AnimatorResult 434 * @syscap SystemCapability.ArkUI.ArkUI.Full 435 * @since 6 436 */ 437/** 438 * Defines the Animator result interface. 439 * @interface AnimatorResult 440 * @syscap SystemCapability.ArkUI.ArkUI.Full 441 * @crossplatform 442 * @since 10 443 */ 444/** 445 * Defines the Animator result interface. 446 * @interface AnimatorResult 447 * @syscap SystemCapability.ArkUI.ArkUI.Full 448 * @crossplatform 449 * @atomicservice 450 * @since arkts {'1.1':'11','1.2':'20'} 451 * @arkts 1.1&1.2 452 */ 453export interface AnimatorResult { 454 /** 455 * Update the options for current animator. 456 * @param { AnimatorOptions } options - Options. 457 * @syscap SystemCapability.ArkUI.ArkUI.Full 458 * @since 6 459 * @deprecated since 9 460 * @useinstead ohos.animator.reset 461 */ 462 update(options: AnimatorOptions): void; 463 464 /** 465 * Reset the options for current animator. 466 * @param { AnimatorOptions } options - Options. 467 * @throws { BusinessError } 401 - Parameter error. Possible causes: 468 * <br> 1. Mandatory parameters are left unspecified. 469 * <br> 2. Incorrect parameters types. 470 * <br> 3. Parameter verification failed. 471 * @throws { BusinessError } 100001 - The specified page is not found or the object property list is not obtained. 472 * @syscap SystemCapability.ArkUI.ArkUI.Full 473 * @since 9 474 */ 475 /** 476 * Reset the options for current animator. 477 * @param { AnimatorOptions } options - Options. 478 * @throws { BusinessError } 401 - Parameter error. Possible causes: 479 * <br> 1. Mandatory parameters are left unspecified. 480 * <br> 2. Incorrect parameters types. 481 * <br> 3. Parameter verification failed. 482 * @throws { BusinessError } 100001 - The specified page is not found or the object property list is not obtained. 483 * @syscap SystemCapability.ArkUI.ArkUI.Full 484 * @crossplatform 485 * @since 10 486 */ 487 /** 488 * Reset the options for current animator. 489 * @param { AnimatorOptions } options - Options. 490 * @throws { BusinessError } 401 - Parameter error. Possible causes: 491 * <br> 1. Mandatory parameters are left unspecified. 492 * <br> 2. Incorrect parameters types. 493 * <br> 3. Parameter verification failed. 494 * @throws { BusinessError } 100001 - The specified page is not found or the object property list is not obtained. 495 * @syscap SystemCapability.ArkUI.ArkUI.Full 496 * @crossplatform 497 * @atomicservice 498 * @since arkts {'1.1':'11','1.2':'20'} 499 * @arkts 1.1&1.2 500 */ 501 reset(options: AnimatorOptions): void; 502 503 /** 504 * Reset the options for current animator. 505 * @param { AnimatorOptions | SimpleAnimatorOptions } options - Options. 506 * @throws { BusinessError } 401 - Parameter error. Possible causes: 507 * <br> 1. Mandatory parameters are left unspecified. 508 * <br> 2. Incorrect parameters types. 509 * <br> 3. Parameter verification failed. 510 * @throws { BusinessError } 100001 - The specified page is not found or the object property list is not obtained. 511 * @syscap SystemCapability.ArkUI.ArkUI.Full 512 * @crossplatform 513 * @atomicservice 514 * @since arkts {'1.1':'18','1.2':'20'} 515 * @arkts 1.1&1.2 516 */ 517 reset(options: AnimatorOptions | SimpleAnimatorOptions): void; 518 519 /** 520 * Starts the animation. 521 * @syscap SystemCapability.ArkUI.ArkUI.Full 522 * @since 6 523 */ 524 /** 525 * Starts the animation. 526 * @syscap SystemCapability.ArkUI.ArkUI.Full 527 * @crossplatform 528 * @since 10 529 */ 530 /** 531 * Starts the animation. 532 * @syscap SystemCapability.ArkUI.ArkUI.Full 533 * @crossplatform 534 * @atomicservice 535 * @since arkts {'1.1':'11','1.2':'20'} 536 * @arkts 1.1&1.2 537 */ 538 play(): void; 539 540 /** 541 * Ends the animation. 542 * @syscap SystemCapability.ArkUI.ArkUI.Full 543 * @since 6 544 */ 545 /** 546 * Ends the animation. 547 * @syscap SystemCapability.ArkUI.ArkUI.Full 548 * @crossplatform 549 * @since 10 550 */ 551 /** 552 * Ends the animation. 553 * @syscap SystemCapability.ArkUI.ArkUI.Full 554 * @crossplatform 555 * @atomicservice 556 * @since arkts {'1.1':'11','1.2':'20'} 557 * @arkts 1.1&1.2 558 */ 559 finish(): void; 560 561 /** 562 * Pauses the animation. 563 * @syscap SystemCapability.ArkUI.ArkUI.Full 564 * @since 6 565 */ 566 /** 567 * Pauses the animation. 568 * @syscap SystemCapability.ArkUI.ArkUI.Full 569 * @crossplatform 570 * @since 10 571 */ 572 /** 573 * Pauses the animation. 574 * @syscap SystemCapability.ArkUI.ArkUI.Full 575 * @crossplatform 576 * @atomicservice 577 * @since arkts {'1.1':'11','1.2':'20'} 578 * @arkts 1.1&1.2 579 */ 580 pause(): void; 581 582 /** 583 * Cancels the animation. 584 * @syscap SystemCapability.ArkUI.ArkUI.Full 585 * @since 6 586 */ 587 /** 588 * Cancels the animation. 589 * @syscap SystemCapability.ArkUI.ArkUI.Full 590 * @crossplatform 591 * @since 10 592 */ 593 /** 594 * Cancels the animation. 595 * @syscap SystemCapability.ArkUI.ArkUI.Full 596 * @crossplatform 597 * @atomicservice 598 * @since arkts {'1.1':'11','1.2':'20'} 599 * @arkts 1.1&1.2 600 */ 601 cancel(): void; 602 603 /** 604 * Plays the animation in reverse direction. 605 * @syscap SystemCapability.ArkUI.ArkUI.Full 606 * @since 6 607 */ 608 /** 609 * Plays the animation in reverse direction. 610 * @syscap SystemCapability.ArkUI.ArkUI.Full 611 * @crossplatform 612 * @since 10 613 */ 614 /** 615 * Plays the animation in reverse direction. 616 * Invalid when using interpolating-spring curve. 617 * @syscap SystemCapability.ArkUI.ArkUI.Full 618 * @crossplatform 619 * @atomicservice 620 * @since arkts {'1.1':'11','1.2':'20'} 621 * @arkts 1.1&1.2 622 */ 623 reverse(): void; 624 625 /** 626 * Trigger when vsync callback. 627 * @syscap SystemCapability.ArkUI.ArkUI.Full 628 * @since 6 629 */ 630 /** 631 * Trigger when vsync callback. 632 * @syscap SystemCapability.ArkUI.ArkUI.Full 633 * @crossplatform 634 * @since 10 635 */ 636 /** 637 * Trigger when vsync callback. 638 * @syscap SystemCapability.ArkUI.ArkUI.Full 639 * @crossplatform 640 * @atomicservice 641 * @since 11 642 * @deprecated since 12 643 * @useinstead ohos.animator.onFrame 644 */ 645 onframe: (progress: number) => void; 646 647 /** 648 * Trigger when vSync callback. 649 * 650 * @type { function } 651 * @syscap SystemCapability.ArkUI.ArkUI.Full 652 * @crossplatform 653 * @atomicservice 654 * @since arkts {'1.1':'12','1.2':'20'} 655 * @arkts 1.1&1.2 656 */ 657 onFrame: (progress: number) => void; 658 659 /** 660 * The animation is finished. 661 * @syscap SystemCapability.ArkUI.ArkUI.Full 662 * @since 6 663 */ 664 /** 665 * The animation is finished. 666 * @syscap SystemCapability.ArkUI.ArkUI.Full 667 * @crossplatform 668 * @since 10 669 */ 670 /** 671 * The animation is finished. 672 * @syscap SystemCapability.ArkUI.ArkUI.Full 673 * @crossplatform 674 * @atomicservice 675 * @since 11 676 * @deprecated since 12 677 * @useinstead ohos.animator.onFinish 678 */ 679 onfinish: () => void; 680 681 /** 682 * The animation is finished. 683 * 684 * @type { function } 685 * @syscap SystemCapability.ArkUI.ArkUI.Full 686 * @crossplatform 687 * @atomicservice 688 * @since arkts {'1.1':'12','1.2':'20'} 689 * @arkts 1.1&1.2 690 */ 691 onFinish: () => void; 692 693 /** 694 * The animation is canceled. 695 * @syscap SystemCapability.ArkUI.ArkUI.Full 696 * @since 6 697 */ 698 /** 699 * The animation is canceled. 700 * @syscap SystemCapability.ArkUI.ArkUI.Full 701 * @crossplatform 702 * @since 10 703 */ 704 /** 705 * The animation is canceled. 706 * @syscap SystemCapability.ArkUI.ArkUI.Full 707 * @crossplatform 708 * @atomicservice 709 * @since 11 710 * @deprecated since 12 711 * @useinstead ohos.animator.onCancel 712 */ 713 oncancel: () => void; 714 715 /** 716 * The animation is canceled. 717 * 718 * @type { function } 719 * @syscap SystemCapability.ArkUI.ArkUI.Full 720 * @crossplatform 721 * @atomicservice 722 * @since arkts {'1.1':'12','1.2':'20'} 723 * @arkts 1.1&1.2 724 */ 725 onCancel: () => void; 726 727 /** 728 * The animation is repeated. 729 * @syscap SystemCapability.ArkUI.ArkUI.Full 730 * @since 6 731 */ 732 /** 733 * The animation is repeated. 734 * @syscap SystemCapability.ArkUI.ArkUI.Full 735 * @crossplatform 736 * @since 10 737 */ 738 /** 739 * The animation is repeated. 740 * @syscap SystemCapability.ArkUI.ArkUI.Full 741 * @crossplatform 742 * @atomicservice 743 * @since 11 744 * @deprecated since 12 745 * @useinstead ohos.animator.onRepeat 746 */ 747 onrepeat: () => void; 748 749 /** 750 * The animation is repeated. 751 * 752 * @type { function } 753 * @syscap SystemCapability.ArkUI.ArkUI.Full 754 * @crossplatform 755 * @atomicservice 756 * @since arkts {'1.1':'12','1.2':'20'} 757 * @arkts 1.1&1.2 758 */ 759 onRepeat: () => void; 760 761 /** 762 * The expected frame rate of dynamical of rate range. 763 * @param { ExpectedFrameRateRange } rateRange - Indicates ExpectedFrameRateRange. 764 * @syscap SystemCapability.ArkUI.ArkUI.Full 765 * @atomicservice 766 * @since arkts {'1.1':'12','1.2':'20'} 767 * @arkts 1.1&1.2 768 */ 769 setExpectedFrameRateRange(rateRange: ExpectedFrameRateRange): void; 770} 771 772/** 773 * Defines the Animator class. 774 * @syscap SystemCapability.ArkUI.ArkUI.Full 775 * @since 6 776 */ 777/** 778 * Defines the Animator class. 779 * @syscap SystemCapability.ArkUI.ArkUI.Full 780 * @crossplatform 781 * @since 10 782 */ 783/** 784 * Defines the Animator class. 785 * @syscap SystemCapability.ArkUI.ArkUI.Full 786 * @crossplatform 787 * @atomicservice 788 * @since 11 789 */ 790/** 791 * Defines the Animator class. 792 * @syscap SystemCapability.ArkUI.ArkUI.Full 793 * @crossplatform 794 * @atomicservice 795 * @since 20 796 * @arkts 1.1&1.2 797 */ 798declare class Animator { 799 /** 800 * Create an animator object for custom animation. 801 * @param { AnimatorOptions } options - Options. 802 * @returns { AnimatorResult } animator result 803 * @syscap SystemCapability.ArkUI.ArkUI.Full 804 * @since 6 805 * @deprecated since 9 806 * @useinstead ohos.animator.create 807 */ 808 static createAnimator(options: AnimatorOptions): AnimatorResult; 809 810 /** 811 * Create an animator object for custom animation. 812 * @param { AnimatorOptions } options - Options. 813 * @returns { AnimatorResult } animator result 814 * @throws { BusinessError } 401 - Parameter error. Possible causes: 815 * <br> 1. Mandatory parameters are left unspecified. 816 * <br> 2. Incorrect parameters types. 817 * <br> 3. Parameter verification failed. 818 * @syscap SystemCapability.ArkUI.ArkUI.Full 819 * @since 9 820 */ 821 /** 822 * Create an animator object for custom animation. 823 * @param { AnimatorOptions } options - Options. 824 * @returns { AnimatorResult } animator result 825 * @throws { BusinessError } 401 - Parameter error. Possible causes: 826 * <br> 1. Mandatory parameters are left unspecified. 827 * <br> 2. Incorrect parameters types. 828 * <br> 3. Parameter verification failed. 829 * @syscap SystemCapability.ArkUI.ArkUI.Full 830 * @crossplatform 831 * @since 10 832 */ 833 /** 834 * Create an animator object for custom animation. 835 * @param { AnimatorOptions } options - Options. 836 * @returns { AnimatorResult } animator result 837 * @throws { BusinessError } 401 - Parameter error. Possible causes: 838 * <br> 1. Mandatory parameters are left unspecified. 839 * <br> 2. Incorrect parameters types. 840 * <br> 3. Parameter verification failed. 841 * @syscap SystemCapability.ArkUI.ArkUI.Full 842 * @crossplatform 843 * @atomicservice 844 * @since 11 845 * @deprecated since 18 846 * @useinstead ohos.arkui.UIContext.UIContext#createAnimator 847 */ 848 static create(options: AnimatorOptions): AnimatorResult; 849 850 /** 851 * Create an animator object for custom animation. 852 * @param { AnimatorOptions | SimpleAnimatorOptions } options - Options. 853 * @returns { AnimatorResult } animator result 854 * @throws { BusinessError } 401 - Parameter error. Possible causes: 855 * <br> 1. Mandatory parameters are left unspecified. 856 * <br> 2. Incorrect parameters types. 857 * <br> 3. Parameter verification failed. 858 * @syscap SystemCapability.ArkUI.ArkUI.Full 859 * @crossplatform 860 * @atomicservice 861 * @since arkts {'1.1':'18','1.2':'20'} 862 * @arkts 1.1&1.2 863 */ 864 static create(options: AnimatorOptions | SimpleAnimatorOptions): AnimatorResult; 865} 866 867export default Animator; 868