1/* 2 * Copyright (c) 2021-2024 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 LocalizationKit 19 */ 20 21/*** if arkts 1.1&1.2 */ 22import { RawFileDescriptor as _RawFileDescriptor } from './global/rawFileDescriptor'; 23import { Resource as _Resource } from './global/resource'; 24import { AsyncCallback as _AsyncCallback } from './@ohos.base'; 25/*** endif */ 26/*** if arkts 1.1 */ 27import { DrawableDescriptor } from './@ohos.arkui.drawableDescriptor'; 28/*** endif */ 29 30/** 31 * Provides resource related APIs. 32 * 33 * @namespace resourceManager 34 * @syscap SystemCapability.Global.ResourceManager 35 * @since 6 36 */ 37/** 38 * Provides resource related APIs. 39 * 40 * @namespace resourceManager 41 * @syscap SystemCapability.Global.ResourceManager 42 * @crossplatform 43 * @since 10 44 */ 45/** 46 * Provides resource related APIs. 47 * 48 * @namespace resourceManager 49 * @syscap SystemCapability.Global.ResourceManager 50 * @crossplatform 51 * @atomicservice 52 * @since arkts {'1.1':'11', '1.2':'20'} 53 * @arkts 1.1&1.2 54 */ 55declare namespace resourceManager { 56 /** 57 * Enumerates screen directions. 58 * 59 * @enum { number } 60 * @syscap SystemCapability.Global.ResourceManager 61 * @since 6 62 */ 63 /** 64 * Enumerates screen directions. 65 * 66 * @enum { number } 67 * @syscap SystemCapability.Global.ResourceManager 68 * @crossplatform 69 * @since 10 70 */ 71 /** 72 * Enumerates screen directions. 73 * 74 * @enum { number } 75 * @syscap SystemCapability.Global.ResourceManager 76 * @crossplatform 77 * @atomicservice 78 * @since arkts {'1.1':'11', '1.2':'20'} 79 * @arkts 1.1&1.2 80 */ 81 export enum Direction { 82 /** 83 * Indicates the vertical direction. 84 * 85 * @syscap SystemCapability.Global.ResourceManager 86 * @since 6 87 */ 88 /** 89 * Indicates the vertical direction. 90 * 91 * @syscap SystemCapability.Global.ResourceManager 92 * @crossplatform 93 * @since 10 94 */ 95 /** 96 * Indicates the vertical direction. 97 * 98 * @syscap SystemCapability.Global.ResourceManager 99 * @crossplatform 100 * @atomicservice 101 * @since arkts {'1.1':'11', '1.2':'20'} 102 * @arkts 1.1&1.2 103 */ 104 DIRECTION_VERTICAL = 0, 105 106 /** 107 * Indicates the horizontal direction. 108 * 109 * @syscap SystemCapability.Global.ResourceManager 110 * @since 6 111 */ 112 /** 113 * Indicates the horizontal direction. 114 * 115 * @syscap SystemCapability.Global.ResourceManager 116 * @crossplatform 117 * @since 10 118 */ 119 /** 120 * Indicates the horizontal direction. 121 * 122 * @syscap SystemCapability.Global.ResourceManager 123 * @crossplatform 124 * @atomicservice 125 * @since arkts {'1.1':'11', '1.2':'20'} 126 * @arkts 1.1&1.2 127 */ 128 DIRECTION_HORIZONTAL = 1 129 } 130 131 /** 132 * Enumerates device types. 133 * 134 * @enum { number } 135 * @syscap SystemCapability.Global.ResourceManager 136 * @since 6 137 */ 138 /** 139 * Enumerates device types. 140 * 141 * @enum { number } 142 * @syscap SystemCapability.Global.ResourceManager 143 * @crossplatform 144 * @since 10 145 */ 146 /** 147 * Enumerates device types. 148 * 149 * @enum { number } 150 * @syscap SystemCapability.Global.ResourceManager 151 * @crossplatform 152 * @atomicservice 153 * @since arkts {'1.1':'11', '1.2':'20'} 154 * @arkts 1.1&1.2 155 */ 156 export enum DeviceType { 157 /** 158 * Indicates a phone. 159 * 160 * @syscap SystemCapability.Global.ResourceManager 161 * @since 6 162 */ 163 /** 164 * Indicates a phone. 165 * 166 * @syscap SystemCapability.Global.ResourceManager 167 * @crossplatform 168 * @since 10 169 */ 170 /** 171 * Indicates a phone. 172 * 173 * @syscap SystemCapability.Global.ResourceManager 174 * @crossplatform 175 * @atomicservice 176 * @since arkts {'1.1':'11', '1.2':'20'} 177 * @arkts 1.1&1.2 178 */ 179 DEVICE_TYPE_PHONE = 0x00, 180 181 /** 182 * Indicates a tablet. 183 * 184 * @syscap SystemCapability.Global.ResourceManager 185 * @since 6 186 */ 187 /** 188 * Indicates a tablet. 189 * 190 * @syscap SystemCapability.Global.ResourceManager 191 * @since 10 192 */ 193 /** 194 * Indicates a tablet. 195 * 196 * @syscap SystemCapability.Global.ResourceManager 197 * @crossplatform 198 * @atomicservice 199 * @since arkts {'1.1':'11', '1.2':'20'} 200 * @arkts 1.1&1.2 201 */ 202 DEVICE_TYPE_TABLET = 0x01, 203 204 /** 205 * Indicates a car. 206 * 207 * @syscap SystemCapability.Global.ResourceManager 208 * @since 6 209 */ 210 /** 211 * Indicates a car. 212 * 213 * @syscap SystemCapability.Global.ResourceManager 214 * @since 10 215 */ 216 /** 217 * Indicates a car. 218 * 219 * @syscap SystemCapability.Global.ResourceManager 220 * @crossplatform 221 * @atomicservice 222 * @since arkts {'1.1':'11', '1.2':'20'} 223 * @arkts 1.1&1.2 224 */ 225 DEVICE_TYPE_CAR = 0x02, 226 227 /** 228 * Indicates a PC. 229 * 230 * @syscap SystemCapability.Global.ResourceManager 231 * @since 6 232 */ 233 /** 234 * Indicates a PC. 235 * 236 * @syscap SystemCapability.Global.ResourceManager 237 * @since 10 238 */ 239 /** 240 * Indicates a PC. 241 * 242 * @syscap SystemCapability.Global.ResourceManager 243 * @crossplatform 244 * @atomicservice 245 * @since arkts {'1.1':'11', '1.2':'20'} 246 * @arkts 1.1&1.2 247 */ 248 DEVICE_TYPE_PC = 0x03, 249 250 /** 251 * Indicates a smart TV. 252 * 253 * @syscap SystemCapability.Global.ResourceManager 254 * @since 6 255 */ 256 /** 257 * Indicates a smart TV. 258 * 259 * @syscap SystemCapability.Global.ResourceManager 260 * @since 10 261 */ 262 /** 263 * Indicates a smart TV. 264 * 265 * @syscap SystemCapability.Global.ResourceManager 266 * @crossplatform 267 * @atomicservice 268 * @since arkts {'1.1':'11', '1.2':'20'} 269 * @arkts 1.1&1.2 270 */ 271 DEVICE_TYPE_TV = 0x04, 272 273 /** 274 * Indicates a wearable device. 275 * 276 * @syscap SystemCapability.Global.ResourceManager 277 * @since 6 278 */ 279 /** 280 * Indicates a wearable device. 281 * 282 * @syscap SystemCapability.Global.ResourceManager 283 * @since 10 284 */ 285 /** 286 * Indicates a wearable device. 287 * 288 * @syscap SystemCapability.Global.ResourceManager 289 * @crossplatform 290 * @atomicservice 291 * @since arkts {'1.1':'11', '1.2':'20'} 292 * @arkts 1.1&1.2 293 */ 294 DEVICE_TYPE_WEARABLE = 0x06, 295 296 /** 297 * Indicates a 2in1 device. 298 * 299 * @syscap SystemCapability.Global.ResourceManager 300 * @crossplatform 301 * @atomicservice 302 * @since arkts {'1.1':'11', '1.2':'20'} 303 * @arkts 1.1&1.2 304 */ 305 DEVICE_TYPE_2IN1 = 0x07 306 } 307 308 /** 309 * Enumerates screen density types. 310 * 311 * @enum { number } 312 * @syscap SystemCapability.Global.ResourceManager 313 * @since 6 314 */ 315 /** 316 * Enumerates screen density types. 317 * 318 * @enum { number } 319 * @syscap SystemCapability.Global.ResourceManager 320 * @crossplatform 321 * @since 10 322 */ 323 /** 324 * Enumerates screen density types. 325 * 326 * @enum { number } 327 * @syscap SystemCapability.Global.ResourceManager 328 * @crossplatform 329 * @atomicservice 330 * @since arkts {'1.1':'11', '1.2':'20'} 331 * @arkts 1.1&1.2 332 */ 333 export enum ScreenDensity { 334 /** 335 * Indicates small screen density. 336 * 337 * @syscap SystemCapability.Global.ResourceManager 338 * @since 6 339 */ 340 /** 341 * Indicates small screen density. 342 * 343 * @syscap SystemCapability.Global.ResourceManager 344 * @crossplatform 345 * @since 10 346 */ 347 /** 348 * Indicates small screen density. 349 * 350 * @syscap SystemCapability.Global.ResourceManager 351 * @crossplatform 352 * @atomicservice 353 * @since arkts {'1.1':'11', '1.2':'20'} 354 * @arkts 1.1&1.2 355 */ 356 SCREEN_SDPI = 120, 357 358 /** 359 * Indicates medium screen density. 360 * 361 * @syscap SystemCapability.Global.ResourceManager 362 * @since 6 363 */ 364 /** 365 * Indicates medium screen density. 366 * 367 * @syscap SystemCapability.Global.ResourceManager 368 * @crossplatform 369 * @since 10 370 */ 371 /** 372 * Indicates medium screen density. 373 * 374 * @syscap SystemCapability.Global.ResourceManager 375 * @crossplatform 376 * @atomicservice 377 * @since arkts {'1.1':'11', '1.2':'20'} 378 * @arkts 1.1&1.2 379 */ 380 SCREEN_MDPI = 160, 381 382 /** 383 * Indicates large screen density. 384 * 385 * @syscap SystemCapability.Global.ResourceManager 386 * @since 6 387 */ 388 /** 389 * Indicates large screen density. 390 * 391 * @syscap SystemCapability.Global.ResourceManager 392 * @crossplatform 393 * @since 10 394 */ 395 /** 396 * Indicates large screen density. 397 * 398 * @syscap SystemCapability.Global.ResourceManager 399 * @crossplatform 400 * @atomicservice 401 * @since arkts {'1.1':'11', '1.2':'20'} 402 * @arkts 1.1&1.2 403 */ 404 SCREEN_LDPI = 240, 405 406 /** 407 * Indicates extra-large screen density. 408 * 409 * @syscap SystemCapability.Global.ResourceManager 410 * @since 6 411 */ 412 /** 413 * Indicates extra-large screen density. 414 * 415 * @syscap SystemCapability.Global.ResourceManager 416 * @crossplatform 417 * @since 10 418 */ 419 /** 420 * Indicates extra-large screen density. 421 * 422 * @syscap SystemCapability.Global.ResourceManager 423 * @crossplatform 424 * @atomicservice 425 * @since arkts {'1.1':'11', '1.2':'20'} 426 * @arkts 1.1&1.2 427 */ 428 SCREEN_XLDPI = 320, 429 430 /** 431 * Indicates extra-extra-large screen density. 432 * 433 * @syscap SystemCapability.Global.ResourceManager 434 * @since 6 435 */ 436 /** 437 * Indicates extra-extra-large screen density. 438 * 439 * @syscap SystemCapability.Global.ResourceManager 440 * @crossplatform 441 * @since 10 442 */ 443 /** 444 * Indicates extra-extra-large screen density. 445 * 446 * @syscap SystemCapability.Global.ResourceManager 447 * @crossplatform 448 * @atomicservice 449 * @since arkts {'1.1':'11', '1.2':'20'} 450 * @arkts 1.1&1.2 451 */ 452 SCREEN_XXLDPI = 480, 453 454 /** 455 * Indicates extra-extra-extra-large screen density. 456 * 457 * @syscap SystemCapability.Global.ResourceManager 458 * @since 6 459 */ 460 /** 461 * Indicates extra-extra-extra-large screen density. 462 * 463 * @syscap SystemCapability.Global.ResourceManager 464 * @crossplatform 465 * @since 10 466 */ 467 /** 468 * Indicates extra-extra-extra-large screen density. 469 * 470 * @syscap SystemCapability.Global.ResourceManager 471 * @crossplatform 472 * @atomicservice 473 * @since arkts {'1.1':'11', '1.2':'20'} 474 * @arkts 1.1&1.2 475 */ 476 SCREEN_XXXLDPI = 640 477 } 478 479 /** 480 * Enumerates color mode types. 481 * 482 * @enum { number } 483 * @syscap SystemCapability.Global.ResourceManager 484 * @crossplatform 485 * @atomicservice 486 * @since arkts {'1.1':'12', '1.2':'20'} 487 * @arkts 1.1&1.2 488 */ 489 export enum ColorMode { 490 491 /** 492 * Indicates dark mode. 493 * 494 * @syscap SystemCapability.Global.ResourceManager 495 * @crossplatform 496 * @atomicservice 497 * @since arkts {'1.1':'12', '1.2':'20'} 498 * @arkts 1.1&1.2 499 */ 500 DARK = 0, 501 502 /** 503 * Indicates light mode. 504 * 505 * @syscap SystemCapability.Global.ResourceManager 506 * @crossplatform 507 * @atomicservice 508 * @since arkts {'1.1':'12', '1.2':'20'} 509 * @arkts 1.1&1.2 510 */ 511 LIGHT = 1 512 } 513 514 /** 515 * Provides the device configuration. 516 * 517 * @syscap SystemCapability.Global.ResourceManager 518 * @since 6 519 */ 520 /** 521 * Provides the device configuration. 522 * 523 * @syscap SystemCapability.Global.ResourceManager 524 * @crossplatform 525 * @since 10 526 */ 527 /** 528 * Provides the device configuration. 529 * 530 * @syscap SystemCapability.Global.ResourceManager 531 * @crossplatform 532 * @atomicservice 533 * @since arkts {'1.1':'11', '1.2':'20'} 534 * @arkts 1.1&1.2 535 */ 536 export class Configuration { 537 /** 538 * Indicates the screen direction of the current device. 539 * 540 * @syscap SystemCapability.Global.ResourceManager 541 * @since 6 542 */ 543 /** 544 * Indicates the screen direction of the current device. 545 * 546 * @syscap SystemCapability.Global.ResourceManager 547 * @crossplatform 548 * @since 10 549 */ 550 /** 551 * Indicates the screen direction of the current device. 552 * 553 * @syscap SystemCapability.Global.ResourceManager 554 * @crossplatform 555 * @atomicservice 556 * @since 11 557 */ 558 /** 559 * Indicates the screen direction of the current device. 560 * 561 * @type { Direction } 562 * @syscap SystemCapability.Global.ResourceManager 563 * @crossplatform 564 * @atomicservice 565 * @since arkts {'1.1':'12', '1.2':'20'} 566 * @arkts 1.1&1.2 567 */ 568 direction: Direction; 569 570 /** 571 * Indicates the current system language, for example, zh-Hans-CN. 572 * 573 * @syscap SystemCapability.Global.ResourceManager 574 * @since 6 575 */ 576 /** 577 * Indicates the current system language, for example, zh-Hans-CN. 578 * 579 * @syscap SystemCapability.Global.ResourceManager 580 * @crossplatform 581 * @since 10 582 */ 583 /** 584 * Indicates the current system language, for example, zh-Hans-CN. 585 * 586 * @syscap SystemCapability.Global.ResourceManager 587 * @crossplatform 588 * @atomicservice 589 * @since 11 590 */ 591 /** 592 * Indicates the current system language, for example, zh-Hans-CN. 593 * 594 * @type { string } 595 * @syscap SystemCapability.Global.ResourceManager 596 * @crossplatform 597 * @atomicservice 598 * @since arkts {'1.1':'12', '1.2':'20'} 599 * @arkts 1.1&1.2 600 */ 601 locale: string; 602 603 /** 604 * Indicates the device type. 605 * 606 * @type { DeviceType } 607 * @syscap SystemCapability.Global.ResourceManager 608 * @crossplatform 609 * @atomicservice 610 * @since arkts {'1.1':'12', '1.2':'20'} 611 * @arkts 1.1&1.2 612 */ 613 deviceType: DeviceType; 614 615 /** 616 * Indicates the screen density. 617 * 618 * @type { ScreenDensity } 619 * @syscap SystemCapability.Global.ResourceManager 620 * @crossplatform 621 * @atomicservice 622 * @since arkts {'1.1':'12', '1.2':'20'} 623 * @arkts 1.1&1.2 624 */ 625 screenDensity: ScreenDensity; 626 627 /** 628 * Indicates the color mode. 629 * 630 * @type { ColorMode } 631 * @syscap SystemCapability.Global.ResourceManager 632 * @crossplatform 633 * @atomicservice 634 * @since arkts {'1.1':'12', '1.2':'20'} 635 * @arkts 1.1&1.2 636 */ 637 colorMode: ColorMode; 638 639 /** 640 * Indicates the mcc. 641 * 642 * @type { number } 643 * @syscap SystemCapability.Global.ResourceManager 644 * @crossplatform 645 * @atomicservice 646 * @since arkts {'1.1':'12', '1.2':'20'} 647 * @arkts 1.1&1.2 648 */ 649 mcc: number; 650 651 /** 652 * Indicates the mnc. 653 * 654 * @type { number } 655 * @syscap SystemCapability.Global.ResourceManager 656 * @crossplatform 657 * @atomicservice 658 * @since arkts {'1.1':'12', '1.2':'20'} 659 * @arkts 1.1&1.2 660 */ 661 mnc: number; 662 } 663 664 /** 665 * Provides the device capability. 666 * 667 * @syscap SystemCapability.Global.ResourceManager 668 * @since 6 669 */ 670 /** 671 * Provides the device capability. 672 * 673 * @syscap SystemCapability.Global.ResourceManager 674 * @crossplatform 675 * @since 10 676 */ 677 /** 678 * Provides the device capability. 679 * 680 * @syscap SystemCapability.Global.ResourceManager 681 * @crossplatform 682 * @atomicservice 683 * @since arkts {'1.1':'11', '1.2':'20'} 684 * @arkts 1.1&1.2 685 */ 686 export class DeviceCapability { 687 /** 688 * Indicates the screen density of the current device. 689 * 690 * @syscap SystemCapability.Global.ResourceManager 691 * @since 6 692 */ 693 /** 694 * Indicates the screen density of the current device. 695 * 696 * @syscap SystemCapability.Global.ResourceManager 697 * @crossplatform 698 * @since 10 699 */ 700 /** 701 * Indicates the screen density of the current device. 702 * 703 * @syscap SystemCapability.Global.ResourceManager 704 * @crossplatform 705 * @atomicservice 706 * @since 11 707 */ 708 /** 709 * Indicates the screen density of the current device. 710 * 711 * @type { ScreenDensity } 712 * @syscap SystemCapability.Global.ResourceManager 713 * @crossplatform 714 * @atomicservice 715 * @since arkts {'1.1':'12', '1.2':'20'} 716 * @arkts 1.1&1.2 717 */ 718 screenDensity: ScreenDensity; 719 720 /** 721 * Indicates the type of the current device. 722 * 723 * @syscap SystemCapability.Global.ResourceManager 724 * @since 6 725 */ 726 /** 727 * Indicates the type of the current device. 728 * 729 * @syscap SystemCapability.Global.ResourceManager 730 * @crossplatform 731 * @since 10 732 */ 733 /** 734 * Indicates the type of the current device. 735 * 736 * @syscap SystemCapability.Global.ResourceManager 737 * @crossplatform 738 * @atomicservice 739 * @since 11 740 */ 741 /** 742 * Indicates the type of the current device. 743 * 744 * @type { DeviceType } 745 * @syscap SystemCapability.Global.ResourceManager 746 * @crossplatform 747 * @atomicservice 748 * @since arkts {'1.1':'12', '1.2':'20'} 749 * @arkts 1.1&1.2 750 */ 751 deviceType: DeviceType; 752 } 753 754 /** 755 * The ResourceManager callback. 756 * 757 * @interface AsyncCallback 758 * @syscap SystemCapability.Global.ResourceManager 759 * @since 6 760 * @deprecated since 9 761 */ 762 export interface AsyncCallback<T> { 763 /** 764 * Defines the callback format. 765 * 766 * @param { Error } err - Indicates the error info. 767 * @param { T } data - Indicates the return data. 768 * @syscap SystemCapability.Global.ResourceManager 769 * @since 6 770 * @deprecated since 9 771 */ 772 (err: Error, data: T): void; 773 } 774 775 /** 776 * Obtains the ResourceManager object of the current application. 777 * 778 * @param { AsyncCallback<ResourceManager> } callback - Indicates the callback containing the ResourceManager object. 779 * @syscap SystemCapability.Global.ResourceManager 780 * @FAModelOnly 781 * @since 6 782 */ 783 /** 784 * Obtains the ResourceManager object of the current application. 785 * 786 * @param { AsyncCallback<ResourceManager> } callback - Indicates the callback containing the ResourceManager object. 787 * @syscap SystemCapability.Global.ResourceManager 788 * @FAModelOnly 789 * @since 11 790 */ 791 export function getResourceManager(callback: AsyncCallback<ResourceManager>): void; 792 793 /** 794 * Obtains the ResourceManager object of the specified application. 795 * 796 * @param { string } bundleName - Indicates the bundle name of the specified application. 797 * @param { AsyncCallback<ResourceManager> } callback - Indicates the callback containing the ResourceManager object. 798 * @syscap SystemCapability.Global.ResourceManager 799 * @FAModelOnly 800 * @since 6 801 */ 802 /** 803 * Obtains the ResourceManager object of the specified application. 804 * 805 * @param { string } bundleName - Indicates the bundle name of the specified application. 806 * @param { AsyncCallback<ResourceManager> } callback - Indicates the callback containing the ResourceManager object. 807 * @syscap SystemCapability.Global.ResourceManager 808 * @FAModelOnly 809 * @since 11 810 */ 811 export function getResourceManager(bundleName: string, callback: AsyncCallback<ResourceManager>): void; 812 813 /** 814 * Obtains the ResourceManager object of the current application. 815 * 816 * @returns { Promise<ResourceManager> } The ResourceManager object is returned in Promise mode. 817 * @syscap SystemCapability.Global.ResourceManager 818 * @FAModelOnly 819 * @since 6 820 */ 821 /** 822 * Obtains the ResourceManager object of the current application. 823 * 824 * @returns { Promise<ResourceManager> } The ResourceManager object is returned in Promise mode. 825 * @syscap SystemCapability.Global.ResourceManager 826 * @FAModelOnly 827 * @since 11 828 */ 829 export function getResourceManager(): Promise<ResourceManager>; 830 831 /** 832 * Obtains the ResourceManager object of the specified application. 833 * 834 * @param { string } bundleName - Indicates the bundle name of the specified application. 835 * @returns { Promise<ResourceManager> } The ResourceManager object is returned in Promise mode. 836 * @syscap SystemCapability.Global.ResourceManager 837 * @FAModelOnly 838 * @since 6 839 */ 840 /** 841 * Obtains the ResourceManager object of the specified application. 842 * 843 * @param { string } bundleName - Indicates the bundle name of the specified application. 844 * @returns { Promise<ResourceManager> } The ResourceManager object is returned in Promise mode. 845 * @syscap SystemCapability.Global.ResourceManager 846 * @FAModelOnly 847 * @since 11 848 */ 849 export function getResourceManager(bundleName: string): Promise<ResourceManager>; 850 851 /** 852 * Obtains a global shared system ResourceManager object that provides access to only system resource, in which the 853 * resConfig is default value(contains resLocale, screenDensityDpi, direction, etc). 854 * 855 * @returns { ResourceManager } The System ResourceManager object is returned. 856 * @throws { BusinessError } 9001009 - Failed to access the system resource. 857 * which is not mapped to application sandbox, This error code will be thrown. 858 * @syscap SystemCapability.Global.ResourceManager 859 * @since 10 860 */ 861 /** 862 * Obtains a global shared system ResourceManager object that provides access to only system resource, in which the 863 * resConfig is default value(contains resLocale, screenDensityDpi, direction, etc). 864 * 865 * @returns { ResourceManager } The System ResourceManager object is returned. 866 * @throws { BusinessError } 9001009 - Failed to access the system resource. 867 * which is not mapped to application sandbox, This error code will be thrown. 868 * @syscap SystemCapability.Global.ResourceManager 869 * @crossplatform 870 * @atomicservice 871 * @since 11 872 * @deprecated since 20 873 * @useinstead ohos.resourceManager.getSysResourceManager 874 */ 875 export function getSystemResourceManager(): ResourceManager; 876 877 /** 878 * Obtains a global shared system ResourceManager object that provides access to only system resource, in which the 879 * resConfig is current system resConfig(contains resLocale, screenDensityDpi, direction, etc). 880 * 881 * @returns { ResourceManager } The System ResourceManager object is returned. 882 * @throws { BusinessError } 9001009 - Failed to access the system resource. 883 * which is not mapped to application sandbox, This error code will be thrown. 884 * @syscap SystemCapability.Global.ResourceManager 885 * @crossplatform 886 * @atomicservice 887 * @since 20 888 * @arkts 1.1&1.2 889 */ 890 export function getSysResourceManager(): ResourceManager; 891 892 /** 893 * Provides the capability of accessing application resources. 894 * 895 * @interface ResourceManager 896 * @syscap SystemCapability.Global.ResourceManager 897 * @since 6 898 */ 899 /** 900 * Provides the capability of accessing application resources. 901 * 902 * @interface ResourceManager 903 * @syscap SystemCapability.Global.ResourceManager 904 * @crossplatform 905 * @since 10 906 */ 907 /** 908 * Provides the capability of accessing application resources. 909 * 910 * @interface ResourceManager 911 * @syscap SystemCapability.Global.ResourceManager 912 * @crossplatform 913 * @atomicservice 914 * @since arkts {'1.1':'11', '1.2':'20'} 915 * @arkts 1.1&1.2 916 */ 917 export interface ResourceManager { 918 /** 919 * Obtains the character string corresponding to a specified resource ID in callback mode. 920 * 921 * @param { number } resId - Indicates the resource ID. 922 * @param { AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained character string. 923 * @syscap SystemCapability.Global.ResourceManager 924 * @since 6 925 * @deprecated since 9 926 * @useinstead ohos.resourceManager.getStringValue 927 */ 928 getString(resId: number, callback: AsyncCallback<string>): void; 929 930 /** 931 * Obtains string resources associated with a specified resource ID in Promise mode. 932 * 933 * @param { number } resId - Indicates the resource ID. 934 * @returns { Promise<string> } The character string corresponding to the resource ID. 935 * @syscap SystemCapability.Global.ResourceManager 936 * @since 6 937 * @deprecated since 9 938 * @useinstead ohos.resourceManager.getStringValue 939 */ 940 getString(resId: number): Promise<string>; 941 942 /** 943 * Obtains the character string corresponding to a specified resource object in callback mode. 944 * 945 * @param { Resource } resource - Indicates the resource object. 946 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained character string. 947 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 948 * @throws { BusinessError } 9001001 - Invalid resource ID. 949 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 950 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 951 * @syscap SystemCapability.Global.ResourceManager 952 * @stagemodelonly 953 * @since 9 954 */ 955 /** 956 * Obtains the character string corresponding to a specified resource object in callback mode. 957 * 958 * @param { Resource } resource - Indicates the resource object. 959 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained character string. 960 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 961 * @throws { BusinessError } 9001001 - Invalid resource ID. 962 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 963 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 964 * @syscap SystemCapability.Global.ResourceManager 965 * @stagemodelonly 966 * @crossplatform 967 * @since 10 968 */ 969 /** 970 * Obtains the character string corresponding to a specified resource object in callback mode. 971 * 972 * @param { Resource } resource - Indicates the resource object. 973 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained character string. 974 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 975 * @throws { BusinessError } 9001001 - Invalid resource ID. 976 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 977 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 978 * @syscap SystemCapability.Global.ResourceManager 979 * @stagemodelonly 980 * @crossplatform 981 * @atomicservice 982 * @since 11 983 * @deprecated since 20 984 * @useinstead ohos.resourceManager.getStringValue 985 */ 986 getStringValue(resource: Resource, callback: _AsyncCallback<string>): void; 987 988 /** 989 * Obtains string resources associated with a specified resource object in Promise mode. 990 * 991 * @param { Resource } resource - Indicates the resource object. 992 * @returns { Promise<string> } The character string corresponding to the resource object. 993 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 994 * @throws { BusinessError } 9001001 - Invalid resource ID. 995 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 996 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 997 * @syscap SystemCapability.Global.ResourceManager 998 * @stagemodelonly 999 * @since 9 1000 */ 1001 /** 1002 * Obtains string resources associated with a specified resource object in Promise mode. 1003 * 1004 * @param { Resource } resource - Indicates the resource object. 1005 * @returns { Promise<string> } The character string corresponding to the resource object. 1006 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1007 * @throws { BusinessError } 9001001 - Invalid resource ID. 1008 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1009 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1010 * @syscap SystemCapability.Global.ResourceManager 1011 * @stagemodelonly 1012 * @crossplatform 1013 * @since 10 1014 */ 1015 /** 1016 * Obtains string resources associated with a specified resource object in Promise mode. 1017 * 1018 * @param { Resource } resource - Indicates the resource object. 1019 * @returns { Promise<string> } The character string corresponding to the resource object. 1020 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1021 * @throws { BusinessError } 9001001 - Invalid resource ID. 1022 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1023 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1024 * @syscap SystemCapability.Global.ResourceManager 1025 * @stagemodelonly 1026 * @crossplatform 1027 * @atomicservice 1028 * @since 11 1029 * @deprecated since 20 1030 * @useinstead ohos.resourceManager.getStringValue 1031 */ 1032 getStringValue(resource: Resource): Promise<string>; 1033 1034 /** 1035 * Obtains the array of character strings corresponding to a specified resource ID in callback mode. 1036 * 1037 * @param { number } resId - Indicates the resource ID. 1038 * @param { AsyncCallback<Array<string>> } callback - Indicates the asynchronous callback used to return the obtained array of character strings. 1039 * @syscap SystemCapability.Global.ResourceManager 1040 * @since 6 1041 * @deprecated since 9 1042 * @useinstead ohos.resourceManager.getStringArrayValue 1043 */ 1044 getStringArray(resId: number, callback: AsyncCallback<Array<string>>): void; 1045 1046 /** 1047 * Obtains the array of character strings corresponding to a specified resource ID in Promise mode. 1048 * 1049 * @param { number } resId - Indicates the resource ID. 1050 * @returns { Promise<Array<string>> } The array of character strings corresponding to the specified resource ID. 1051 * @syscap SystemCapability.Global.ResourceManager 1052 * @since 6 1053 * @deprecated since 9 1054 * @useinstead ohos.resourceManager.getStringArrayValue 1055 */ 1056 getStringArray(resId: number): Promise<Array<string>>; 1057 1058 /** 1059 * Obtains the array of character strings corresponding to a specified resource object in callback mode. 1060 * 1061 * @param { Resource } resource - Indicates the resource object. 1062 * @param { _AsyncCallback<Array<string>> } callback - Indicates the asynchronous callback used to return the obtained array of character strings. 1063 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1064 * @throws { BusinessError } 9001001 - Invalid resource ID. 1065 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1066 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1067 * @syscap SystemCapability.Global.ResourceManager 1068 * @stagemodelonly 1069 * @since 9 1070 */ 1071 /** 1072 * Obtains the array of character strings corresponding to a specified resource object in callback mode. 1073 * 1074 * @param { Resource } resource - Indicates the resource object. 1075 * @param { _AsyncCallback<Array<string>> } callback - Indicates the asynchronous callback used to return the obtained array of character strings. 1076 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1077 * @throws { BusinessError } 9001001 - Invalid resource ID. 1078 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1079 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1080 * @syscap SystemCapability.Global.ResourceManager 1081 * @stagemodelonly 1082 * @crossplatform 1083 * @since 10 1084 */ 1085 /** 1086 * Obtains the array of character strings corresponding to a specified resource object in callback mode. 1087 * 1088 * @param { Resource } resource - Indicates the resource object. 1089 * @param { _AsyncCallback<Array<string>> } callback - Indicates the asynchronous callback used to return the obtained array of character strings. 1090 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1091 * @throws { BusinessError } 9001001 - Invalid resource ID. 1092 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1093 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1094 * @syscap SystemCapability.Global.ResourceManager 1095 * @stagemodelonly 1096 * @crossplatform 1097 * @atomicservice 1098 * @since 11 1099 * @deprecated since 20 1100 * @useinstead ohos.resourceManager.getStringArrayValue 1101 */ 1102 getStringArrayValue(resource: Resource, callback: _AsyncCallback<Array<string>>): void; 1103 1104 /** 1105 * Obtains the array of character strings corresponding to a specified resource object in Promise mode. 1106 * 1107 * @param { Resource } resource - Indicates the resource object. 1108 * @returns { Promise<Array<string>> } The array of character strings corresponding to the specified resource object. 1109 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1110 * @throws { BusinessError } 9001001 - Invalid resource ID. 1111 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1112 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1113 * @syscap SystemCapability.Global.ResourceManager 1114 * @stagemodelonly 1115 * @since 9 1116 */ 1117 /** 1118 * Obtains the array of character strings corresponding to a specified resource object in Promise mode. 1119 * 1120 * @param { Resource } resource - Indicates the resource object. 1121 * @returns { Promise<Array<string>> } The array of character strings corresponding to the specified resource object. 1122 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1123 * @throws { BusinessError } 9001001 - Invalid resource ID. 1124 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1125 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1126 * @syscap SystemCapability.Global.ResourceManager 1127 * @stagemodelonly 1128 * @crossplatform 1129 * @since 10 1130 */ 1131 /** 1132 * Obtains the array of character strings corresponding to a specified resource object in Promise mode. 1133 * 1134 * @param { Resource } resource - Indicates the resource object. 1135 * @returns { Promise<Array<string>> } The array of character strings corresponding to the specified resource object. 1136 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1137 * @throws { BusinessError } 9001001 - Invalid resource ID. 1138 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1139 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1140 * @syscap SystemCapability.Global.ResourceManager 1141 * @stagemodelonly 1142 * @crossplatform 1143 * @atomicservice 1144 * @since 11 1145 * @deprecated since 20 1146 * @useinstead ohos.resourceManager.getStringArrayValue 1147 */ 1148 getStringArrayValue(resource: Resource): Promise<Array<string>>; 1149 1150 /** 1151 * Obtains the content of the media file corresponding to a specified resource ID in callback mode. 1152 * 1153 * @param { number } resId - Indicates the resource ID. 1154 * @param { AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained media file content. 1155 * @syscap SystemCapability.Global.ResourceManager 1156 * @since 6 1157 * @deprecated since 9 1158 * @useinstead ohos.resourceManager.getMediaContent 1159 */ 1160 getMedia(resId: number, callback: AsyncCallback<Uint8Array>): void; 1161 1162 /** 1163 * Obtains the content of the media file corresponding to a specified resource ID in Promise mode. 1164 * 1165 * @param { number } resId - Indicates the resource ID. 1166 * @returns { Promise<Uint8Array> } The content of the media file corresponding to the specified resource ID. 1167 * @syscap SystemCapability.Global.ResourceManager 1168 * @since 6 1169 * @deprecated since 9 1170 * @useinstead ohos.resourceManager.getMediaContent 1171 */ 1172 getMedia(resId: number): Promise<Uint8Array>; 1173 1174 /** 1175 * Obtains the content of the media file corresponding to a specified resource object in callback mode. 1176 * 1177 * @param { Resource } resource - Indicates the resource object. 1178 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained media file content. 1179 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1180 * @throws { BusinessError } 9001001 - Invalid resource ID. 1181 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1182 * @syscap SystemCapability.Global.ResourceManager 1183 * @stagemodelonly 1184 * @since 9 1185 */ 1186 /** 1187 * Obtains the content of the media file corresponding to a specified resource object in callback mode. 1188 * 1189 * @param { Resource } resource - Indicates the resource object. 1190 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained media file content. 1191 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1192 * @throws { BusinessError } 9001001 - Invalid resource ID. 1193 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1194 * @syscap SystemCapability.Global.ResourceManager 1195 * @stagemodelonly 1196 * @crossplatform 1197 * @since 10 1198 */ 1199 /** 1200 * Obtains the content of the media file corresponding to a specified resource object in callback mode. 1201 * 1202 * @param { Resource } resource - Indicates the resource object. 1203 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained media file content. 1204 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1205 * @throws { BusinessError } 9001001 - Invalid resource ID. 1206 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1207 * @syscap SystemCapability.Global.ResourceManager 1208 * @stagemodelonly 1209 * @crossplatform 1210 * @atomicservice 1211 * @since 11 1212 * @deprecated since 20 1213 * @useinstead ohos.resourceManager.getMediaContent 1214 */ 1215 getMediaContent(resource: Resource, callback: _AsyncCallback<Uint8Array>): void; 1216 1217 /** 1218 * Obtains the content of the specified screen density media file corresponding to a specified resource object in callback mode. 1219 * 1220 * @param { Resource } resource - Indicates the resource object. 1221 * @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 1222 * to use the density of current system dpi. 1223 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained 1224 * specified screen density media file content. 1225 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 1226 * @throws { BusinessError } 9001001 - Invalid resource ID. 1227 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1228 * @syscap SystemCapability.Global.ResourceManager 1229 * @stagemodelonly 1230 * @since 10 1231 */ 1232 /** 1233 * Obtains the content of the specified screen density media file corresponding to a specified resource object in callback mode. 1234 * 1235 * @param { Resource } resource - Indicates the resource object. 1236 * @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 1237 * to use the density of current system dpi. 1238 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained 1239 * specified screen density media file content. 1240 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 1241 * @throws { BusinessError } 9001001 - Invalid resource ID. 1242 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1243 * @syscap SystemCapability.Global.ResourceManager 1244 * @stagemodelonly 1245 * @crossplatform 1246 * @atomicservice 1247 * @since 11 1248 * @deprecated since 20 1249 * @useinstead ohos.resourceManager.getMediaContent 1250 */ 1251 getMediaContent(resource: Resource, density: number, callback: _AsyncCallback<Uint8Array>): void; 1252 1253 /** 1254 * Obtains the content of the media file corresponding to a specified resource object in Promise mode. 1255 * 1256 * @param { Resource } resource - Indicates the resource object. 1257 * @returns { Promise<Uint8Array> } The content of the media file corresponding to the specified resource object. 1258 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1259 * @throws { BusinessError } 9001001 - Invalid resource ID. 1260 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1261 * @syscap SystemCapability.Global.ResourceManager 1262 * @stagemodelonly 1263 * @since 9 1264 */ 1265 /** 1266 * Obtains the content of the media file corresponding to a specified resource object in Promise mode. 1267 * 1268 * @param { Resource } resource - Indicates the resource object. 1269 * @returns { Promise<Uint8Array> } The content of the media file corresponding to the specified resource object. 1270 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1271 * @throws { BusinessError } 9001001 - Invalid resource ID. 1272 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1273 * @syscap SystemCapability.Global.ResourceManager 1274 * @stagemodelonly 1275 * @crossplatform 1276 * @since 10 1277 */ 1278 /** 1279 * Obtains the content of the media file corresponding to a specified resource object in Promise mode. 1280 * 1281 * @param { Resource } resource - Indicates the resource object. 1282 * @returns { Promise<Uint8Array> } The content of the media file corresponding to the specified resource object. 1283 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1284 * @throws { BusinessError } 9001001 - Invalid resource ID. 1285 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1286 * @syscap SystemCapability.Global.ResourceManager 1287 * @stagemodelonly 1288 * @crossplatform 1289 * @atomicservice 1290 * @since 11 1291 * @deprecated since 20 1292 * @useinstead ohos.resourceManager.getMediaContent 1293 */ 1294 getMediaContent(resource: Resource): Promise<Uint8Array>; 1295 1296 /** 1297 * Obtains the content of the specified screen density media file corresponding to a specified resource object in Promise mode. 1298 * 1299 * @param { Resource } resource - Indicates the resource object. 1300 * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 1301 * to use the density of current system dpi. 1302 * @returns { Promise<Uint8Array> } The content of the specified screen density media file corresponding to the 1303 * specified resource object. 1304 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 1305 * @throws { BusinessError } 9001001 - Invalid resource ID. 1306 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1307 * @syscap SystemCapability.Global.ResourceManager 1308 * @stagemodelonly 1309 * @since 10 1310 */ 1311 /** 1312 * Obtains the content of the specified screen density media file corresponding to a specified resource object in Promise mode. 1313 * 1314 * @param { Resource } resource - Indicates the resource object. 1315 * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 1316 * to use the density of current system dpi. 1317 * @returns { Promise<Uint8Array> } The content of the specified screen density media file corresponding to the 1318 * specified resource object. 1319 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 1320 * @throws { BusinessError } 9001001 - Invalid resource ID. 1321 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1322 * @syscap SystemCapability.Global.ResourceManager 1323 * @stagemodelonly 1324 * @crossplatform 1325 * @atomicservice 1326 * @since 11 1327 * @deprecated since 20 1328 * @useinstead ohos.resourceManager.getMediaContent 1329 */ 1330 getMediaContent(resource: Resource, density: number): Promise<Uint8Array>; 1331 1332 /** 1333 * Obtains the Base64 code of the image resource corresponding to the specified resource ID in callback mode. 1334 * 1335 * @param { number } resId - Indicates the resource ID. 1336 * @param { AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the image 1337 * resource. 1338 * @syscap SystemCapability.Global.ResourceManager 1339 * @since 6 1340 * @deprecated since 9 1341 * @useinstead ohos.resourceManager.getMediaContentBase64 1342 */ 1343 getMediaBase64(resId: number, callback: AsyncCallback<string>): void; 1344 1345 /** 1346 * Obtains the Base64 code of the image resource corresponding to the specified resource ID in Promise mode. 1347 * 1348 * @param { number } resId - Indicates the resource ID. 1349 * @returns { Promise<string> } The Base64 code of the image resource corresponding to the specified resource ID. 1350 * @syscap SystemCapability.Global.ResourceManager 1351 * @since 6 1352 * @deprecated since 9 1353 * @useinstead ohos.resourceManager.getMediaContentBase64 1354 */ 1355 getMediaBase64(resId: number): Promise<string>; 1356 1357 /** 1358 * Obtains the Base64 code of the image resource corresponding to the specified resource object in callback mode. 1359 * 1360 * @param { Resource } resource - Indicates the resource object. 1361 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the image 1362 * resource. 1363 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1364 * @throws { BusinessError } 9001001 - Invalid resource ID. 1365 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1366 * @syscap SystemCapability.Global.ResourceManager 1367 * @stagemodelonly 1368 * @since 9 1369 */ 1370 /** 1371 * Obtains the Base64 code of the image resource corresponding to the specified resource object in callback mode. 1372 * 1373 * @param { Resource } resource - Indicates the resource object. 1374 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the image 1375 * resource. 1376 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1377 * @throws { BusinessError } 9001001 - Invalid resource ID. 1378 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1379 * @syscap SystemCapability.Global.ResourceManager 1380 * @stagemodelonly 1381 * @crossplatform 1382 * @since 10 1383 */ 1384 /** 1385 * Obtains the Base64 code of the image resource corresponding to the specified resource object in callback mode. 1386 * 1387 * @param { Resource } resource - Indicates the resource object. 1388 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the image 1389 * resource. 1390 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1391 * @throws { BusinessError } 9001001 - Invalid resource ID. 1392 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1393 * @syscap SystemCapability.Global.ResourceManager 1394 * @stagemodelonly 1395 * @crossplatform 1396 * @atomicservice 1397 * @since 11 1398 * @deprecated since 20 1399 * @useinstead ohos.resourceManager.getMediaContentBase64 1400 */ 1401 getMediaContentBase64(resource: Resource, callback: _AsyncCallback<string>): void; 1402 1403 /** 1404 * Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource object in callback mode. 1405 * 1406 * @param { Resource } resource - Indicates the resource object. 1407 * @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 1408 * to use the density of current system dpi. 1409 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the 1410 * specified screen density image resource. 1411 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 1412 * @throws { BusinessError } 9001001 - Invalid resource ID. 1413 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1414 * @syscap SystemCapability.Global.ResourceManager 1415 * @stagemodelonly 1416 * @since 10 1417 */ 1418 /** 1419 * Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource object in callback mode. 1420 * 1421 * @param { Resource } resource - Indicates the resource object. 1422 * @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 1423 * to use the density of current system dpi. 1424 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the 1425 * specified screen density image resource. 1426 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 1427 * @throws { BusinessError } 9001001 - Invalid resource ID. 1428 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1429 * @syscap SystemCapability.Global.ResourceManager 1430 * @stagemodelonly 1431 * @crossplatform 1432 * @atomicservice 1433 * @since 11 1434 * @deprecated since 20 1435 * @useinstead ohos.resourceManager.getMediaContentBase64 1436 */ 1437 getMediaContentBase64(resource: Resource, density: number, callback: _AsyncCallback<string>): void; 1438 1439 /** 1440 * Obtains the Base64 code of the image resource corresponding to the specified resource object in Promise mode. 1441 * 1442 * @param { Resource } resource - Indicates the resource object. 1443 * @returns { Promise<string> } The Base64 code of the image resource corresponding to the specified resource object. 1444 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1445 * @throws { BusinessError } 9001001 - Invalid resource ID. 1446 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1447 * @syscap SystemCapability.Global.ResourceManager 1448 * @stagemodelonly 1449 * @since 9 1450 */ 1451 /** 1452 * Obtains the Base64 code of the image resource corresponding to the specified resource object in Promise mode. 1453 * 1454 * @param { Resource } resource - Indicates the resource object. 1455 * @returns { Promise<string> } The Base64 code of the image resource corresponding to the specified resource object. 1456 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1457 * @throws { BusinessError } 9001001 - Invalid resource ID. 1458 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1459 * @syscap SystemCapability.Global.ResourceManager 1460 * @stagemodelonly 1461 * @crossplatform 1462 * @since 10 1463 */ 1464 /** 1465 * Obtains the Base64 code of the image resource corresponding to the specified resource object in Promise mode. 1466 * 1467 * @param { Resource } resource - Indicates the resource object. 1468 * @returns { Promise<string> } The Base64 code of the image resource corresponding to the specified resource object. 1469 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1470 * @throws { BusinessError } 9001001 - Invalid resource ID. 1471 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1472 * @syscap SystemCapability.Global.ResourceManager 1473 * @stagemodelonly 1474 * @crossplatform 1475 * @atomicservice 1476 * @since 11 1477 * @deprecated since 20 1478 * @useinstead ohos.resourceManager.getMediaContentBase64 1479 */ 1480 getMediaContentBase64(resource: Resource): Promise<string>; 1481 1482 /** 1483 * Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource object in Promise mode. 1484 * 1485 * @param { Resource } resource - Indicates the resource object. 1486 * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 1487 * to use the density of current system dpi. 1488 * @returns { Promise<string> } The Base64 code of the specified screen density image resource corresponding to the specified resource object. 1489 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 1490 * @throws { BusinessError } 9001001 - Invalid resource ID. 1491 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1492 * @syscap SystemCapability.Global.ResourceManager 1493 * @stagemodelonly 1494 * @since 10 1495 */ 1496 /** 1497 * Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource object in Promise mode. 1498 * 1499 * @param { Resource } resource - Indicates the resource object. 1500 * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 1501 * to use the density of current system dpi. 1502 * @returns { Promise<string> } The Base64 code of the specified screen density image resource corresponding to the specified resource object. 1503 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 1504 * @throws { BusinessError } 9001001 - Invalid resource ID. 1505 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1506 * @syscap SystemCapability.Global.ResourceManager 1507 * @stagemodelonly 1508 * @crossplatform 1509 * @atomicservice 1510 * @since 11 1511 * @deprecated since 20 1512 * @useinstead ohos.resourceManager.getMediaContentBase64 1513 */ 1514 getMediaContentBase64(resource: Resource, density: number): Promise<string>; 1515 1516 /** 1517 * Obtains the device capability in callback mode. 1518 * 1519 * @param { _AsyncCallback<DeviceCapability> } callback - Indicates the asynchronous callback used to return the obtained device capability. 1520 * @syscap SystemCapability.Global.ResourceManager 1521 * @since 6 1522 */ 1523 /** 1524 * Obtains the device capability in callback mode. 1525 * 1526 * @param { _AsyncCallback<DeviceCapability> } callback - Indicates the asynchronous callback used to return the obtained device capability. 1527 * @syscap SystemCapability.Global.ResourceManager 1528 * @crossplatform 1529 * @since 10 1530 */ 1531 /** 1532 * Obtains the device capability in callback mode. 1533 * 1534 * @param { _AsyncCallback<DeviceCapability> } callback - Indicates the asynchronous callback used to return the obtained device capability. 1535 * @syscap SystemCapability.Global.ResourceManager 1536 * @crossplatform 1537 * @atomicservice 1538 * @since arkts {'1.1':'11', '1.2':'20'} 1539 * @arkts 1.1&1.2 1540 */ 1541 getDeviceCapability(callback: _AsyncCallback<DeviceCapability>): void; 1542 1543 /** 1544 * Obtains the device capability in Promise mode. 1545 * 1546 * @returns { Promise<DeviceCapability> } the device capability. 1547 * @syscap SystemCapability.Global.ResourceManager 1548 * @since 6 1549 */ 1550 /** 1551 * Obtains the device capability in Promise mode. 1552 * 1553 * @returns { Promise<DeviceCapability> } the device capability. 1554 * @syscap SystemCapability.Global.ResourceManager 1555 * @crossplatform 1556 * @since 10 1557 */ 1558 /** 1559 * Obtains the device capability in Promise mode. 1560 * 1561 * @returns { Promise<DeviceCapability> } the device capability. 1562 * @syscap SystemCapability.Global.ResourceManager 1563 * @crossplatform 1564 * @atomicservice 1565 * @since arkts {'1.1':'11', '1.2':'20'} 1566 * @arkts 1.1&1.2 1567 */ 1568 getDeviceCapability(): Promise<DeviceCapability>; 1569 1570 /** 1571 * Obtains the device configuration in callback mode. 1572 * 1573 * @param { _AsyncCallback<Configuration> } callback - Indicates the asynchronous callback used to return the obtained device 1574 * configuration. 1575 * @syscap SystemCapability.Global.ResourceManager 1576 * @since 6 1577 */ 1578 /** 1579 * Obtains the device configuration in callback mode. 1580 * 1581 * @param { _AsyncCallback<Configuration> } callback - Indicates the asynchronous callback used to return the obtained device 1582 * configuration. 1583 * @syscap SystemCapability.Global.ResourceManager 1584 * @crossplatform 1585 * @since 10 1586 */ 1587 /** 1588 * Obtains the device configuration in callback mode. 1589 * 1590 * @param { _AsyncCallback<Configuration> } callback - Indicates the asynchronous callback used to return the obtained device 1591 * configuration. 1592 * @syscap SystemCapability.Global.ResourceManager 1593 * @crossplatform 1594 * @atomicservice 1595 * @since arkts {'1.1':'11', '1.2':'20'} 1596 * @arkts 1.1&1.2 1597 */ 1598 getConfiguration(callback: _AsyncCallback<Configuration>): void; 1599 1600 /** 1601 * Obtains the device configuration in Promise mode. 1602 * 1603 * @returns { Promise<Configuration> } the device configuration. 1604 * @syscap SystemCapability.Global.ResourceManager 1605 * @since 6 1606 */ 1607 /** 1608 * Obtains the device configuration in Promise mode. 1609 * 1610 * @returns { Promise<Configuration> } the device configuration. 1611 * @syscap SystemCapability.Global.ResourceManager 1612 * @crossplatform 1613 * @since 10 1614 */ 1615 /** 1616 * Obtains the device configuration in Promise mode. 1617 * 1618 * @returns { Promise<Configuration> } the device configuration. 1619 * @syscap SystemCapability.Global.ResourceManager 1620 * @crossplatform 1621 * @atomicservice 1622 * @since arkts {'1.1':'11', '1.2':'20'} 1623 * @arkts 1.1&1.2 1624 */ 1625 getConfiguration(): Promise<Configuration>; 1626 1627 /** 1628 * Obtains the singular-plural character string represented by the ID string corresponding to the 1629 * specified number in callback mode. 1630 * 1631 * @param { number } resId - Indicates the resource ID. 1632 * @param { number } num - Indicates the number. 1633 * @param { AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the singular-plural character 1634 * string represented by the ID string corresponding to the specified number. 1635 * @syscap SystemCapability.Global.ResourceManager 1636 * @since 6 1637 * @deprecated since 9 1638 * @useinstead ohos.resourceManager.getPluralStringValue 1639 */ 1640 getPluralString(resId: number, num: number, callback: AsyncCallback<string>): void; 1641 1642 /** 1643 * Obtains the singular-plural character string represented by the ID string corresponding to 1644 * the specified number in Promise mode. 1645 * 1646 * @param { number } resId - Indicates the resource ID. 1647 * @param { number } num - Indicates the number. 1648 * @returns { Promise<string> } The singular-plural character string represented by the ID string 1649 * corresponding to the specified number. 1650 * @syscap SystemCapability.Global.ResourceManager 1651 * @since 6 1652 * @deprecated since 9 1653 * @useinstead ohos.resourceManager.getPluralStringValue 1654 */ 1655 getPluralString(resId: number, num: number): Promise<string>; 1656 1657 /** 1658 * Obtains the singular-plural character string represented by the resource object string corresponding to the 1659 * specified number in callback mode. 1660 * 1661 * @param { Resource } resource - Indicates the resource object. 1662 * @param { number } num - Indicates the number. 1663 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the singular-plural character 1664 * string represented by the resource object string corresponding to the specified number. 1665 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1666 * @throws { BusinessError } 9001001 - Invalid resource ID. 1667 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1668 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1669 * @syscap SystemCapability.Global.ResourceManager 1670 * @stagemodelonly 1671 * @since 9 1672 */ 1673 /** 1674 * Obtains the singular-plural character string represented by the resource object string corresponding to the 1675 * specified number in callback mode. 1676 * 1677 * @param { Resource } resource - Indicates the resource object. 1678 * @param { number } num - Indicates the number. 1679 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the singular-plural character 1680 * string represented by the resource object string corresponding to the specified number. 1681 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1682 * @throws { BusinessError } 9001001 - Invalid resource ID. 1683 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1684 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1685 * @syscap SystemCapability.Global.ResourceManager 1686 * @stagemodelonly 1687 * @crossplatform 1688 * @since 10 1689 */ 1690 /** 1691 * Obtains the singular-plural character string represented by the resource object string corresponding to the 1692 * specified number in callback mode. 1693 * 1694 * @param { Resource } resource - Indicates the resource object. 1695 * @param { number } num - Indicates the number. 1696 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the singular-plural character 1697 * string represented by the resource object string corresponding to the specified number. 1698 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1699 * @throws { BusinessError } 9001001 - Invalid resource ID. 1700 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1701 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1702 * @syscap SystemCapability.Global.ResourceManager 1703 * @stagemodelonly 1704 * @crossplatform 1705 * @atomicservice 1706 * @since 11 1707 * @deprecated since 18 1708 * @useinstead ohos.resourceManager.getIntPluralStringValueSync 1709 */ 1710 getPluralStringValue(resource: Resource, num: number, callback: _AsyncCallback<string>): void; 1711 1712 /** 1713 * Obtains the singular-plural character string represented by the resource object string corresponding to 1714 * the specified number in Promise mode. 1715 * 1716 * @param { Resource } resource - Indicates the resource object. 1717 * @param { number } num - Indicates the number. 1718 * @returns { Promise<string> } The singular-plural character string represented by the resource object string 1719 * corresponding to the specified number. 1720 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1721 * @throws { BusinessError } 9001001 - Invalid resource ID. 1722 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1723 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1724 * @syscap SystemCapability.Global.ResourceManager 1725 * @stagemodelonly 1726 * @since 9 1727 */ 1728 /** 1729 * Obtains the singular-plural character string represented by the resource object string corresponding to 1730 * the specified number in Promise mode. 1731 * 1732 * @param { Resource } resource - Indicates the resource object. 1733 * @param { number } num - Indicates the number. 1734 * @returns { Promise<string> } The singular-plural character string represented by the resource object string 1735 * corresponding to the specified number. 1736 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1737 * @throws { BusinessError } 9001001 - Invalid resource ID. 1738 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1739 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1740 * @syscap SystemCapability.Global.ResourceManager 1741 * @stagemodelonly 1742 * @crossplatform 1743 * @since 10 1744 */ 1745 /** 1746 * Obtains the singular-plural character string represented by the resource object string corresponding to 1747 * the specified number in Promise mode. 1748 * 1749 * @param { Resource } resource - Indicates the resource object. 1750 * @param { number } num - Indicates the number. 1751 * @returns { Promise<string> } The singular-plural character string represented by the resource object string 1752 * corresponding to the specified number. 1753 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1754 * @throws { BusinessError } 9001001 - Invalid resource ID. 1755 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 1756 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1757 * @syscap SystemCapability.Global.ResourceManager 1758 * @stagemodelonly 1759 * @crossplatform 1760 * @atomicservice 1761 * @since 11 1762 * @deprecated since 18 1763 * @useinstead ohos.resourceManager.getIntPluralStringValueSync 1764 */ 1765 getPluralStringValue(resource: Resource, num: number): Promise<string>; 1766 1767 /** 1768 * Obtains the raw file resource corresponding to the specified resource path in callback mode. 1769 * 1770 * @param { string } path - Indicates the resource relative path. 1771 * @param { AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the raw file resource. 1772 * @syscap SystemCapability.Global.ResourceManager 1773 * @since 8 1774 * @deprecated since 9 1775 * @useinstead ohos.resourceManager.getRawFileContent 1776 */ 1777 getRawFile(path: string, callback: AsyncCallback<Uint8Array>): void; 1778 1779 /** 1780 * Obtains the raw file resource corresponding to the specified resource path in Promise mode. 1781 * 1782 * @param { string } path - Indicates the resource relative path. 1783 * @returns { Promise<Uint8Array> } The raw file resource corresponding to the specified resource path. 1784 * @syscap SystemCapability.Global.ResourceManager 1785 * @since 8 1786 * @deprecated since 9 1787 * @useinstead ohos.resourceManager.getRawFileContent 1788 */ 1789 getRawFile(path: string): Promise<Uint8Array>; 1790 1791 /** 1792 * Obtains the raw file resource descriptor corresponding to the specified resource path in callback mode. 1793 * 1794 * @param { string } path - Indicates the resource relative path. 1795 * @param { AsyncCallback<RawFileDescriptor> } callback - Indicates the asynchronous callback used to return the raw file resource descriptor. 1796 * @syscap SystemCapability.Global.ResourceManager 1797 * @since 8 1798 * @deprecated since 9 1799 * @useinstead ohos.resourceManager.getRawFd 1800 */ 1801 getRawFileDescriptor(path: string, callback: AsyncCallback<RawFileDescriptor>): void; 1802 1803 /** 1804 * Obtains the raw file resource descriptor corresponding to the specified resource path in Promise mode. 1805 * 1806 * @param { string } path - Indicates the resource relative path. 1807 * @returns { Promise<RawFileDescriptor> } The raw file resource descriptor corresponding to the specified resource path. 1808 * @syscap SystemCapability.Global.ResourceManager 1809 * @since 8 1810 * @deprecated since 9 1811 * @useinstead ohos.resourceManager.getRawFd 1812 */ 1813 getRawFileDescriptor(path: string): Promise<RawFileDescriptor>; 1814 1815 /** 1816 * Obtains close raw file resource descriptor corresponding to the specified resource path in callback mode. 1817 * 1818 * @param { string } path - Indicates the resource relative path. 1819 * @param { AsyncCallback<void> } callback - Indicates the asynchronous callback used to return result close raw file resource descriptor. 1820 * @syscap SystemCapability.Global.ResourceManager 1821 * @since 8 1822 * @deprecated since 9 1823 * @useinstead ohos.resourceManager.closeRawFd 1824 */ 1825 closeRawFileDescriptor(path: string, callback: AsyncCallback<void>): void; 1826 1827 /** 1828 * Obtains close raw file resource descriptor corresponding to the specified resource path in Promise mode. 1829 * 1830 * @param { string } path - Indicates the resource relative path. 1831 * @returns { Promise<void> } The result close raw file resource descriptor corresponding to the specified resource path. 1832 * @syscap SystemCapability.Global.ResourceManager 1833 * @since 8 1834 * @deprecated since 9 1835 * @useinstead ohos.resourceManager.closeRawFd 1836 */ 1837 closeRawFileDescriptor(path: string): Promise<void>; 1838 1839 /** 1840 * Obtains the character string corresponding to a specified resource name in callback mode. 1841 * 1842 * @param { string } resName - Indicates the resource name. 1843 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained character string. 1844 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1845 * @throws { BusinessError } 9001003 - Invalid resource name. 1846 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 1847 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1848 * @syscap SystemCapability.Global.ResourceManager 1849 * @since 9 1850 */ 1851 /** 1852 * Obtains the character string corresponding to a specified resource name in callback mode. 1853 * 1854 * @param { string } resName - Indicates the resource name. 1855 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained character string. 1856 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1857 * @throws { BusinessError } 9001003 - Invalid resource name. 1858 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 1859 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1860 * @syscap SystemCapability.Global.ResourceManager 1861 * @crossplatform 1862 * @since 10 1863 */ 1864 /** 1865 * Obtains the character string corresponding to a specified resource name in callback mode. 1866 * 1867 * @param { string } resName - Indicates the resource name. 1868 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained character string. 1869 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1870 * @throws { BusinessError } 9001003 - Invalid resource name. 1871 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 1872 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1873 * @syscap SystemCapability.Global.ResourceManager 1874 * @crossplatform 1875 * @atomicservice 1876 * @since arkts {'1.1':'11', '1.2':'20'} 1877 * @arkts 1.1&1.2 1878 */ 1879 getStringByName(resName: string, callback: _AsyncCallback<string>): void; 1880 1881 /** 1882 * Obtains string resources associated with a specified resource name in Promise mode. 1883 * 1884 * @param { string } resName - Indicates the resource name. 1885 * @returns { Promise<string> } The character string corresponding to the resource name. 1886 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1887 * @throws { BusinessError } 9001003 - Invalid resource name. 1888 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 1889 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1890 * @syscap SystemCapability.Global.ResourceManager 1891 * @since 9 1892 */ 1893 /** 1894 * Obtains string resources associated with a specified resource name in Promise mode. 1895 * 1896 * @param { string } resName - Indicates the resource name. 1897 * @returns { Promise<string> } The character string corresponding to the resource name. 1898 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1899 * @throws { BusinessError } 9001003 - Invalid resource name. 1900 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 1901 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1902 * @syscap SystemCapability.Global.ResourceManager 1903 * @crossplatform 1904 * @since 10 1905 */ 1906 /** 1907 * Obtains string resources associated with a specified resource name in Promise mode. 1908 * 1909 * @param { string } resName - Indicates the resource name. 1910 * @returns { Promise<string> } The character string corresponding to the resource name. 1911 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1912 * @throws { BusinessError } 9001003 - Invalid resource name. 1913 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 1914 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1915 * @syscap SystemCapability.Global.ResourceManager 1916 * @crossplatform 1917 * @atomicservice 1918 * @since arkts {'1.1':'11', '1.2':'20'} 1919 * @arkts 1.1&1.2 1920 */ 1921 getStringByName(resName: string): Promise<string>; 1922 1923 /** 1924 * Obtains the array of character strings corresponding to a specified resource name in callback mode. 1925 * 1926 * @param { string } resName - Indicates the resource name. 1927 * @param { _AsyncCallback<Array<string>> } callback - Indicates the asynchronous callback used to return the obtained array of character strings. 1928 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1929 * @throws { BusinessError } 9001003 - Invalid resource name. 1930 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 1931 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1932 * @syscap SystemCapability.Global.ResourceManager 1933 * @since 9 1934 */ 1935 /** 1936 * Obtains the array of character strings corresponding to a specified resource name in callback mode. 1937 * 1938 * @param { string } resName - Indicates the resource name. 1939 * @param { _AsyncCallback<Array<string>> } callback - Indicates the asynchronous callback used to return the obtained array of character strings. 1940 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1941 * @throws { BusinessError } 9001003 - Invalid resource name. 1942 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 1943 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1944 * @syscap SystemCapability.Global.ResourceManager 1945 * @crossplatform 1946 * @since 10 1947 */ 1948 /** 1949 * Obtains the array of character strings corresponding to a specified resource name in callback mode. 1950 * 1951 * @param { string } resName - Indicates the resource name. 1952 * @param { _AsyncCallback<Array<string>> } callback - Indicates the asynchronous callback used to return the obtained array of character strings. 1953 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1954 * @throws { BusinessError } 9001003 - Invalid resource name. 1955 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 1956 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1957 * @syscap SystemCapability.Global.ResourceManager 1958 * @crossplatform 1959 * @atomicservice 1960 * @since arkts {'1.1':'11', '1.2':'20'} 1961 * @arkts 1.1&1.2 1962 */ 1963 getStringArrayByName(resName: string, callback: _AsyncCallback<Array<string>>): void; 1964 1965 /** 1966 * Obtains the array of character strings corresponding to a specified resource name in Promise mode. 1967 * 1968 * @param { string } resName - Indicates the resource name. 1969 * @returns { Promise<Array<string>> } the array of character strings corresponding to the specified resource name. 1970 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1971 * @throws { BusinessError } 9001003 - Invalid resource name. 1972 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 1973 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1974 * @syscap SystemCapability.Global.ResourceManager 1975 * @since 9 1976 */ 1977 /** 1978 * Obtains the array of character strings corresponding to a specified resource name in Promise mode. 1979 * 1980 * @param { string } resName - Indicates the resource name. 1981 * @returns { Promise<Array<string>> } the array of character strings corresponding to the specified resource name. 1982 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1983 * @throws { BusinessError } 9001003 - Invalid resource name. 1984 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 1985 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1986 * @syscap SystemCapability.Global.ResourceManager 1987 * @crossplatform 1988 * @since 10 1989 */ 1990 /** 1991 * Obtains the array of character strings corresponding to a specified resource name in Promise mode. 1992 * 1993 * @param { string } resName - Indicates the resource name. 1994 * @returns { Promise<Array<string>> } the array of character strings corresponding to the specified resource name. 1995 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 1996 * @throws { BusinessError } 9001003 - Invalid resource name. 1997 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 1998 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 1999 * @syscap SystemCapability.Global.ResourceManager 2000 * @crossplatform 2001 * @atomicservice 2002 * @since arkts {'1.1':'11', '1.2':'20'} 2003 * @arkts 1.1&1.2 2004 */ 2005 getStringArrayByName(resName: string): Promise<Array<string>>; 2006 2007 /** 2008 * Obtains the content of the media file corresponding to a specified resource name in callback mode. 2009 * 2010 * @param { string } resName - Indicates the resource name. 2011 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained media file content. 2012 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2013 * @throws { BusinessError } 9001003 - Invalid resource name. 2014 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2015 * @syscap SystemCapability.Global.ResourceManager 2016 * @since 9 2017 */ 2018 /** 2019 * Obtains the content of the media file corresponding to a specified resource name in callback mode. 2020 * 2021 * @param { string } resName - Indicates the resource name. 2022 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained media file content. 2023 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2024 * @throws { BusinessError } 9001003 - Invalid resource name. 2025 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2026 * @syscap SystemCapability.Global.ResourceManager 2027 * @crossplatform 2028 * @since 10 2029 */ 2030 /** 2031 * Obtains the content of the media file corresponding to a specified resource name in callback mode. 2032 * 2033 * @param { string } resName - Indicates the resource name. 2034 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained media file content. 2035 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2036 * @throws { BusinessError } 9001003 - Invalid resource name. 2037 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2038 * @syscap SystemCapability.Global.ResourceManager 2039 * @crossplatform 2040 * @atomicservice 2041 * @since arkts {'1.1':'11', '1.2':'20'} 2042 * @arkts 1.1&1.2 2043 */ 2044 getMediaByName(resName: string, callback: _AsyncCallback<Uint8Array>): void; 2045 2046 /** 2047 * Obtains the content of the specified screen density media file corresponding to a specified resource name in callback mode. 2048 * 2049 * @param { string } resName - Indicates the resource name. 2050 * @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 2051 * to use the density of current system dpi. 2052 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained 2053 * specified screen density media file content. 2054 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 2055 * @throws { BusinessError } 9001003 - Invalid resource name. 2056 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2057 * @syscap SystemCapability.Global.ResourceManager 2058 * @since 10 2059 */ 2060 /** 2061 * Obtains the content of the specified screen density media file corresponding to a specified resource name in callback mode. 2062 * 2063 * @param { string } resName - Indicates the resource name. 2064 * @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 2065 * to use the density of current system dpi. 2066 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained 2067 * specified screen density media file content. 2068 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 2069 * @throws { BusinessError } 9001003 - Invalid resource name. 2070 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2071 * @syscap SystemCapability.Global.ResourceManager 2072 * @crossplatform 2073 * @atomicservice 2074 * @since arkts {'1.1':'11', '1.2':'20'} 2075 * @arkts 1.1&1.2 2076 */ 2077 getMediaByName(resName: string, density: number, callback: _AsyncCallback<Uint8Array>): void; 2078 2079 /** 2080 * Obtains the content of the media file corresponding to a specified resource name in Promise mode. 2081 * 2082 * @param { string } resName - Indicates the resource name. 2083 * @returns { Promise<Uint8Array> } The content of the media file corresponding to the specified resource name. 2084 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2085 * @throws { BusinessError } 9001003 - Invalid resource name. 2086 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2087 * @syscap SystemCapability.Global.ResourceManager 2088 * @since 9 2089 */ 2090 /** 2091 * Obtains the content of the media file corresponding to a specified resource name in Promise mode. 2092 * 2093 * @param { string } resName - Indicates the resource name. 2094 * @returns { Promise<Uint8Array> } The content of the media file corresponding to the specified resource name. 2095 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2096 * @throws { BusinessError } 9001003 - Invalid resource name. 2097 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2098 * @syscap SystemCapability.Global.ResourceManager 2099 * @crossplatform 2100 * @since 10 2101 */ 2102 /** 2103 * Obtains the content of the media file corresponding to a specified resource name in Promise mode. 2104 * 2105 * @param { string } resName - Indicates the resource name. 2106 * @returns { Promise<Uint8Array> } The content of the media file corresponding to the specified resource name. 2107 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2108 * @throws { BusinessError } 9001003 - Invalid resource name. 2109 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2110 * @syscap SystemCapability.Global.ResourceManager 2111 * @crossplatform 2112 * @atomicservice 2113 * @since arkts {'1.1':'11', '1.2':'20'} 2114 * @arkts 1.1&1.2 2115 */ 2116 getMediaByName(resName: string): Promise<Uint8Array>; 2117 2118 /** 2119 * Obtains the content of the specified screen density media file corresponding to a specified resource name in Promise mode. 2120 * 2121 * @param { string } resName - Indicates the resource name. 2122 * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 2123 * to use the density of current system dpi. 2124 * @returns { Promise<Uint8Array> } The content of the specified screen density media file corresponding to the 2125 * specified resource name. 2126 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 2127 * @throws { BusinessError } 9001003 - Invalid resource name. 2128 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2129 * @syscap SystemCapability.Global.ResourceManager 2130 * @since 10 2131 */ 2132 /** 2133 * Obtains the content of the specified screen density media file corresponding to a specified resource name in Promise mode. 2134 * 2135 * @param { string } resName - Indicates the resource name. 2136 * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 2137 * to use the density of current system dpi. 2138 * @returns { Promise<Uint8Array> } The content of the specified screen density media file corresponding to the 2139 * specified resource name. 2140 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 2141 * @throws { BusinessError } 9001003 - Invalid resource name. 2142 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2143 * @syscap SystemCapability.Global.ResourceManager 2144 * @crossplatform 2145 * @atomicservice 2146 * @since arkts {'1.1':'11', '1.2':'20'} 2147 * @arkts 1.1&1.2 2148 */ 2149 getMediaByName(resName: string, density: number): Promise<Uint8Array>; 2150 2151 /** 2152 * Obtains the Base64 code of the image resource corresponding to the specified resource name in callback mode. 2153 * 2154 * @param { string } resName - Indicates the resource name. 2155 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the image 2156 * resource. 2157 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2158 * @throws { BusinessError } 9001003 - Invalid resource name. 2159 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2160 * @syscap SystemCapability.Global.ResourceManager 2161 * @since 9 2162 */ 2163 /** 2164 * Obtains the Base64 code of the image resource corresponding to the specified resource name in callback mode. 2165 * 2166 * @param { string } resName - Indicates the resource name. 2167 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the image 2168 * resource. 2169 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2170 * @throws { BusinessError } 9001003 - Invalid resource name. 2171 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2172 * @syscap SystemCapability.Global.ResourceManager 2173 * @crossplatform 2174 * @since 10 2175 */ 2176 /** 2177 * Obtains the Base64 code of the image resource corresponding to the specified resource name in callback mode. 2178 * 2179 * @param { string } resName - Indicates the resource name. 2180 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the image 2181 * resource. 2182 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2183 * @throws { BusinessError } 9001003 - Invalid resource name. 2184 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2185 * @syscap SystemCapability.Global.ResourceManager 2186 * @crossplatform 2187 * @atomicservice 2188 * @since arkts {'1.1':'11', '1.2':'20'} 2189 * @arkts 1.1&1.2 2190 */ 2191 getMediaBase64ByName(resName: string, callback: _AsyncCallback<string>): void; 2192 2193 /** 2194 * Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource name in callback mode. 2195 * 2196 * @param { string } resName - Indicates the resource name. 2197 * @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 2198 * to use the density of current system dpi. 2199 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the 2200 * specified screen density image resource. 2201 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 2202 * @throws { BusinessError } 9001003 - Invalid resource name. 2203 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2204 * @syscap SystemCapability.Global.ResourceManager 2205 * @since 10 2206 */ 2207 /** 2208 * Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource name in callback mode. 2209 * 2210 * @param { string } resName - Indicates the resource name. 2211 * @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 2212 * to use the density of current system dpi. 2213 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the 2214 * specified screen density image resource. 2215 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 2216 * @throws { BusinessError } 9001003 - Invalid resource name. 2217 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2218 * @syscap SystemCapability.Global.ResourceManager 2219 * @crossplatform 2220 * @atomicservice 2221 * @since arkts {'1.1':'11', '1.2':'20'} 2222 * @arkts 1.1&1.2 2223 */ 2224 getMediaBase64ByName(resName: string, density: number, callback: _AsyncCallback<string>): void; 2225 2226 /** 2227 * Obtains the Base64 code of the image resource corresponding to the specified resource name in Promise mode. 2228 * 2229 * @param { string } resName - Indicates the resource name. 2230 * @returns { Promise<string> } The Base64 code of the image resource corresponding to the specified resource name. 2231 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2232 * @throws { BusinessError } 9001003 - Invalid resource name. 2233 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2234 * @syscap SystemCapability.Global.ResourceManager 2235 * @since 9 2236 */ 2237 /** 2238 * Obtains the Base64 code of the image resource corresponding to the specified resource name in Promise mode. 2239 * 2240 * @param { string } resName - Indicates the resource name. 2241 * @returns { Promise<string> } The Base64 code of the image resource corresponding to the specified resource name. 2242 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2243 * @throws { BusinessError } 9001003 - Invalid resource name. 2244 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2245 * @syscap SystemCapability.Global.ResourceManager 2246 * @crossplatform 2247 * @since 10 2248 */ 2249 /** 2250 * Obtains the Base64 code of the image resource corresponding to the specified resource name in Promise mode. 2251 * 2252 * @param { string } resName - Indicates the resource name. 2253 * @returns { Promise<string> } The Base64 code of the image resource corresponding to the specified resource name. 2254 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2255 * @throws { BusinessError } 9001003 - Invalid resource name. 2256 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2257 * @syscap SystemCapability.Global.ResourceManager 2258 * @crossplatform 2259 * @atomicservice 2260 * @since arkts {'1.1':'11', '1.2':'20'} 2261 * @arkts 1.1&1.2 2262 */ 2263 getMediaBase64ByName(resName: string): Promise<string>; 2264 2265 /** 2266 * Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource name in Promise mode. 2267 * 2268 * @param { string } resName - Indicates the resource name. 2269 * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 2270 * to use the density of current system dpi. 2271 * @returns { Promise<string> } The Base64 code of the specified screen density image resource corresponding to the specified resource name. 2272 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 2273 * @throws { BusinessError } 9001003 - Invalid resource name. 2274 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2275 * @syscap SystemCapability.Global.ResourceManager 2276 * @since 10 2277 */ 2278 /** 2279 * Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource name in Promise mode. 2280 * 2281 * @param { string } resName - Indicates the resource name. 2282 * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 2283 * to use the density of current system dpi. 2284 * @returns { Promise<string> } The Base64 code of the specified screen density image resource corresponding to the specified resource name. 2285 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 2286 * @throws { BusinessError } 9001003 - Invalid resource name. 2287 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2288 * @syscap SystemCapability.Global.ResourceManager 2289 * @crossplatform 2290 * @atomicservice 2291 * @since arkts {'1.1':'11', '1.2':'20'} 2292 * @arkts 1.1&1.2 2293 */ 2294 getMediaBase64ByName(resName: string, density: number): Promise<string>; 2295 2296 /** 2297 * Obtains the singular-plural character string represented by the name string corresponding to the 2298 * specified number in callback mode. 2299 * 2300 * @param { string } resName - Indicates the resource name. 2301 * @param { number } num - Indicates the number. 2302 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the singular-plural character 2303 * string represented by the name string corresponding to the specified number. 2304 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2305 * @throws { BusinessError } 9001003 - Invalid resource name. 2306 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2307 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2308 * @syscap SystemCapability.Global.ResourceManager 2309 * @since 9 2310 */ 2311 /** 2312 * Obtains the singular-plural character string represented by the name string corresponding to the 2313 * specified number in callback mode. 2314 * 2315 * @param { string } resName - Indicates the resource name. 2316 * @param { number } num - Indicates the number. 2317 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the singular-plural character 2318 * string represented by the name string corresponding to the specified number. 2319 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2320 * @throws { BusinessError } 9001003 - Invalid resource name. 2321 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2322 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2323 * @syscap SystemCapability.Global.ResourceManager 2324 * @crossplatform 2325 * @since 10 2326 */ 2327 /** 2328 * Obtains the singular-plural character string represented by the name string corresponding to the 2329 * specified number in callback mode. 2330 * 2331 * @param { string } resName - Indicates the resource name. 2332 * @param { number } num - Indicates the number. 2333 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the singular-plural character 2334 * string represented by the name string corresponding to the specified number. 2335 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2336 * @throws { BusinessError } 9001003 - Invalid resource name. 2337 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2338 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2339 * @syscap SystemCapability.Global.ResourceManager 2340 * @crossplatform 2341 * @atomicservice 2342 * @since 11 2343 * @deprecated since 18 2344 * @useinstead ohos.resourceManager.getIntPluralStringByNameSync 2345 */ 2346 getPluralStringByName(resName: string, num: number, callback: _AsyncCallback<string>): void; 2347 2348 /** 2349 * Obtains the singular-plural character string represented by the name string corresponding to 2350 * the specified number in Promise mode. 2351 * 2352 * @param { string } resName - Indicates the resource name. 2353 * @param { number } num - Indicates the number. 2354 * @returns { Promise<string> } the singular-plural character string represented by the name string 2355 * corresponding to the specified number. 2356 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2357 * @throws { BusinessError } 9001003 - Invalid resource name. 2358 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2359 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2360 * @syscap SystemCapability.Global.ResourceManager 2361 * @since 9 2362 */ 2363 /** 2364 * Obtains the singular-plural character string represented by the name string corresponding to 2365 * the specified number in Promise mode. 2366 * 2367 * @param { string } resName - Indicates the resource name. 2368 * @param { number } num - Indicates the number. 2369 * @returns { Promise<string> } the singular-plural character string represented by the name string 2370 * corresponding to the specified number. 2371 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2372 * @throws { BusinessError } 9001003 - Invalid resource name. 2373 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2374 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2375 * @syscap SystemCapability.Global.ResourceManager 2376 * @crossplatform 2377 * @since 10 2378 */ 2379 /** 2380 * Obtains the singular-plural character string represented by the name string corresponding to 2381 * the specified number in Promise mode. 2382 * 2383 * @param { string } resName - Indicates the resource name. 2384 * @param { number } num - Indicates the number. 2385 * @returns { Promise<string> } the singular-plural character string represented by the name string 2386 * corresponding to the specified number. 2387 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2388 * @throws { BusinessError } 9001003 - Invalid resource name. 2389 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2390 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2391 * @syscap SystemCapability.Global.ResourceManager 2392 * @crossplatform 2393 * @atomicservice 2394 * @since 11 2395 * @deprecated since 18 2396 * @useinstead ohos.resourceManager.getIntPluralStringByNameSync 2397 */ 2398 getPluralStringByName(resName: string, num: number): Promise<string>; 2399 2400 /** 2401 * Obtains string resources associated with a specified resource ID. 2402 * 2403 * @param { number } resId - Indicates the resource ID. 2404 * @returns { string } The character string corresponding to the resource ID. 2405 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2406 * @throws { BusinessError } 9001001 - Invalid resource ID. 2407 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2408 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2409 * @syscap SystemCapability.Global.ResourceManager 2410 * @since 9 2411 */ 2412 /** 2413 * Obtains string resources associated with a specified resource ID. 2414 * 2415 * @param { number } resId - Indicates the resource ID. 2416 * @returns { string } The character string corresponding to the resource ID. 2417 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2418 * @throws { BusinessError } 9001001 - Invalid resource ID. 2419 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2420 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2421 * @syscap SystemCapability.Global.ResourceManager 2422 * @crossplatform 2423 * @since 10 2424 */ 2425 /** 2426 * Obtains string resources associated with a specified resource ID. 2427 * 2428 * @param { number } resId - Indicates the resource ID. 2429 * @returns { string } The character string corresponding to the resource ID. 2430 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2431 * @throws { BusinessError } 9001001 - Invalid resource ID. 2432 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2433 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2434 * @syscap SystemCapability.Global.ResourceManager 2435 * @crossplatform 2436 * @atomicservice 2437 * @since arkts {'1.1':'11', '1.2':'20'} 2438 * @arkts 1.1&1.2 2439 */ 2440 getStringSync(resId: number): string; 2441 2442 /** 2443 * Obtains string resources associated with a specified resource ID. 2444 * 2445 * @param { number } resId - Indicates the resource ID. 2446 * @param { Array<string | number> } args - Indicates the formatting string resource parameters. 2447 * @returns { string } The character string corresponding to the resource ID. 2448 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2449 * @throws { BusinessError } 9001001 - Invalid resource ID. 2450 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2451 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2452 * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. 2453 * @syscap SystemCapability.Global.ResourceManager 2454 * @crossplatform 2455 * @since 10 2456 */ 2457 /** 2458 * Obtains string resources associated with a specified resource ID. 2459 * 2460 * @param { number } resId - Indicates the resource ID. 2461 * @param { Array<string | number> } args - Indicates the formatting string resource parameters. 2462 * @returns { string } The character string corresponding to the resource ID. 2463 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2464 * @throws { BusinessError } 9001001 - Invalid resource ID. 2465 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2466 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2467 * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. 2468 * @syscap SystemCapability.Global.ResourceManager 2469 * @crossplatform 2470 * @atomicservice 2471 * @since 11 2472 */ 2473 getStringSync(resId: number, ...args: Array<string | number>): string; 2474 2475 /** 2476 * Obtains string resources associated with a specified resource ID. 2477 * 2478 * @param { number } resId - Indicates the resource ID. 2479 * @param { (string | number)[] } args - Indicates the formatting string resource parameters. 2480 * @returns { string } The character string corresponding to the resource ID. 2481 * @throws { BusinessError } 9001001 - Invalid resource ID. 2482 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2483 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2484 * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. 2485 * @syscap SystemCapability.Global.ResourceManager 2486 * @crossplatform 2487 * @atomicservice 2488 * @since 20 2489 * @arkts 1.2 2490 */ 2491 getStringSync(resId: number, ...args: (string | number)[]): string; 2492 2493 /** 2494 * Obtains string resources associated with a specified resource object. 2495 * 2496 * @param { Resource } resource - Indicates the resource object. 2497 * @returns { string } The character string corresponding to the resource object. 2498 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2499 * @throws { BusinessError } 9001001 - Invalid resource ID. 2500 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2501 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2502 * @syscap SystemCapability.Global.ResourceManager 2503 * @stagemodelonly 2504 * @since 9 2505 */ 2506 /** 2507 * Obtains string resources associated with a specified resource object. 2508 * 2509 * @param { Resource } resource - Indicates the resource object. 2510 * @returns { string } The character string corresponding to the resource object. 2511 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2512 * @throws { BusinessError } 9001001 - Invalid resource ID. 2513 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2514 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2515 * @syscap SystemCapability.Global.ResourceManager 2516 * @stagemodelonly 2517 * @crossplatform 2518 * @since 10 2519 */ 2520 /** 2521 * Obtains string resources associated with a specified resource object. 2522 * 2523 * @param { Resource } resource - Indicates the resource object. 2524 * @returns { string } The character string corresponding to the resource object. 2525 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2526 * @throws { BusinessError } 9001001 - Invalid resource ID. 2527 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2528 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2529 * @syscap SystemCapability.Global.ResourceManager 2530 * @stagemodelonly 2531 * @crossplatform 2532 * @atomicservice 2533 * @since 11 2534 * @deprecated since 20 2535 * @useinstead ohos.resourceManager.getStringSync 2536 */ 2537 getStringSync(resource: Resource): string; 2538 2539 /** 2540 * Obtains string resources associated with a specified resource object. 2541 * 2542 * @param { Resource } resource - Indicates the resource object. 2543 * @param { Array<string | number> } args - Indicates the formatting string resource parameters. 2544 * @returns { string } The character string corresponding to the resource object. 2545 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2546 * @throws { BusinessError } 9001001 - Invalid resource ID. 2547 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2548 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2549 * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. 2550 * @syscap SystemCapability.Global.ResourceManager 2551 * @stagemodelonly 2552 * @crossplatform 2553 * @since 10 2554 */ 2555 /** 2556 * Obtains string resources associated with a specified resource object. 2557 * 2558 * @param { Resource } resource - Indicates the resource object. 2559 * @param { Array<string | number> } args - Indicates the formatting string resource parameters. 2560 * @returns { string } The character string corresponding to the resource object. 2561 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2562 * @throws { BusinessError } 9001001 - Invalid resource ID. 2563 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2564 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2565 * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. 2566 * @syscap SystemCapability.Global.ResourceManager 2567 * @stagemodelonly 2568 * @crossplatform 2569 * @atomicservice 2570 * @since 11 2571 * @deprecated since 20 2572 * @useinstead ohos.resourceManager.getStringSync 2573 */ 2574 getStringSync(resource: Resource, ...args: Array<string | number>): string; 2575 2576 /** 2577 * Obtains string resources associated with a specified resource name. 2578 * 2579 * @param { string } resName - Indicates the resource name. 2580 * @returns { string } The character string corresponding to the resource name. 2581 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2582 * @throws { BusinessError } 9001003 - Invalid resource name. 2583 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2584 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2585 * @syscap SystemCapability.Global.ResourceManager 2586 * @since 9 2587 */ 2588 /** 2589 * Obtains string resources associated with a specified resource name. 2590 * 2591 * @param { string } resName - Indicates the resource name. 2592 * @returns { string } The character string corresponding to the resource name. 2593 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2594 * @throws { BusinessError } 9001003 - Invalid resource name. 2595 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2596 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2597 * @syscap SystemCapability.Global.ResourceManager 2598 * @crossplatform 2599 * @since 10 2600 */ 2601 /** 2602 * Obtains string resources associated with a specified resource name. 2603 * 2604 * @param { string } resName - Indicates the resource name. 2605 * @returns { string } The character string corresponding to the resource name. 2606 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2607 * @throws { BusinessError } 9001003 - Invalid resource name. 2608 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2609 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2610 * @syscap SystemCapability.Global.ResourceManager 2611 * @crossplatform 2612 * @atomicservice 2613 * @since arkts {'1.1':'11', '1.2':'20'} 2614 * @arkts 1.1&1.2 2615 */ 2616 getStringByNameSync(resName: string): string; 2617 2618 /** 2619 * Obtains string resources associated with a specified resource name. 2620 * 2621 * @param { string } resName - Indicates the resource name. 2622 * @param { Array<string | number> } args - Indicates the formatting string resource parameters. 2623 * @returns { string } The character string corresponding to the resource name. 2624 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2625 * @throws { BusinessError } 9001003 - Invalid resource name. 2626 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2627 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2628 * @throws { BusinessError } 9001008 - Failed to format the resource obtained based on the resource Name. 2629 * @syscap SystemCapability.Global.ResourceManager 2630 * @crossplatform 2631 * @since 10 2632 */ 2633 /** 2634 * Obtains string resources associated with a specified resource name. 2635 * 2636 * @param { string } resName - Indicates the resource name. 2637 * @param { Array<string | number> } args - Indicates the formatting string resource parameters. 2638 * @returns { string } The character string corresponding to the resource name. 2639 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2640 * @throws { BusinessError } 9001003 - Invalid resource name. 2641 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2642 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2643 * @throws { BusinessError } 9001008 - Failed to format the resource obtained based on the resource Name. 2644 * @syscap SystemCapability.Global.ResourceManager 2645 * @crossplatform 2646 * @atomicservice 2647 * @since 11 2648 */ 2649 getStringByNameSync(resName: string, ...args: Array<string | number>): string; 2650 2651 /** 2652 * Obtains string resources associated with a specified resource name. 2653 * 2654 * @param { string } resName - Indicates the resource name. 2655 * @param { (string | number)[] } args - Indicates the formatting string resource parameters. 2656 * @returns { string } The character string corresponding to the resource name. 2657 * @throws { BusinessError } 9001003 - Invalid resource name. 2658 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2659 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2660 * @throws { BusinessError } 9001008 - Failed to format the resource obtained based on the resource Name. 2661 * @syscap SystemCapability.Global.ResourceManager 2662 * @crossplatform 2663 * @atomicservice 2664 * @since 20 2665 * @arkts 1.2 2666 */ 2667 getStringByNameSync(resName: string, ...args: (string | number)[]): string; 2668 2669 /** 2670 * Obtains the boolean result with a specified resource ID. 2671 * 2672 * @param { number } resId - Indicates the resource ID. 2673 * @returns { boolean } The boolean resource corresponding to the resource ID. 2674 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2675 * @throws { BusinessError } 9001001 - Invalid resource ID. 2676 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2677 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2678 * @syscap SystemCapability.Global.ResourceManager 2679 * @since 9 2680 */ 2681 /** 2682 * Obtains the boolean result with a specified resource ID. 2683 * 2684 * @param { number } resId - Indicates the resource ID. 2685 * @returns { boolean } The boolean resource corresponding to the resource ID. 2686 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2687 * @throws { BusinessError } 9001001 - Invalid resource ID. 2688 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2689 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2690 * @syscap SystemCapability.Global.ResourceManager 2691 * @crossplatform 2692 * @since 10 2693 */ 2694 /** 2695 * Obtains the boolean result with a specified resource ID. 2696 * 2697 * @param { number } resId - Indicates the resource ID. 2698 * @returns { boolean } The boolean resource corresponding to the resource ID. 2699 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2700 * @throws { BusinessError } 9001001 - Invalid resource ID. 2701 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2702 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2703 * @syscap SystemCapability.Global.ResourceManager 2704 * @crossplatform 2705 * @atomicservice 2706 * @since arkts {'1.1':'11', '1.2':'20'} 2707 * @arkts 1.1&1.2 2708 */ 2709 getBoolean(resId: number): boolean; 2710 2711 /** 2712 * Obtains the boolean result with a specified resource object. 2713 * 2714 * @param { Resource } resource - Indicates the resource object. 2715 * @returns { boolean } The boolean resource corresponding to the resource object. 2716 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2717 * @throws { BusinessError } 9001001 - Invalid resource ID. 2718 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2719 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2720 * @syscap SystemCapability.Global.ResourceManager 2721 * @stagemodelonly 2722 * @since 9 2723 */ 2724 /** 2725 * Obtains the boolean result with a specified resource object. 2726 * 2727 * @param { Resource } resource - Indicates the resource object. 2728 * @returns { boolean } The boolean resource corresponding to the resource object. 2729 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2730 * @throws { BusinessError } 9001001 - Invalid resource ID. 2731 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2732 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2733 * @syscap SystemCapability.Global.ResourceManager 2734 * @stagemodelonly 2735 * @crossplatform 2736 * @since 10 2737 */ 2738 /** 2739 * Obtains the boolean result with a specified resource object. 2740 * 2741 * @param { Resource } resource - Indicates the resource object. 2742 * @returns { boolean } The boolean resource corresponding to the resource object. 2743 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2744 * @throws { BusinessError } 9001001 - Invalid resource ID. 2745 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2746 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2747 * @syscap SystemCapability.Global.ResourceManager 2748 * @stagemodelonly 2749 * @crossplatform 2750 * @atomicservice 2751 * @since 11 2752 * @deprecated since 20 2753 * @useinstead ohos.resourceManager.getBoolean 2754 */ 2755 getBoolean(resource: Resource): boolean; 2756 2757 /** 2758 * Obtains the boolean result with a specified resource name. 2759 * 2760 * @param { string } resName - Indicates the resource name. 2761 * @returns { boolean } The boolean resource corresponding to the resource name. 2762 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2763 * @throws { BusinessError } 9001003 - Invalid resource name. 2764 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2765 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2766 * @syscap SystemCapability.Global.ResourceManager 2767 * @since 9 2768 */ 2769 /** 2770 * Obtains the boolean result with a specified resource name. 2771 * 2772 * @param { string } resName - Indicates the resource name. 2773 * @returns { boolean } The boolean resource corresponding to the resource name. 2774 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2775 * @throws { BusinessError } 9001003 - Invalid resource name. 2776 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2777 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2778 * @syscap SystemCapability.Global.ResourceManager 2779 * @crossplatform 2780 * @since 10 2781 */ 2782 /** 2783 * Obtains the boolean result with a specified resource name. 2784 * 2785 * @param { string } resName - Indicates the resource name. 2786 * @returns { boolean } The boolean resource corresponding to the resource name. 2787 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2788 * @throws { BusinessError } 9001003 - Invalid resource name. 2789 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2790 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2791 * @syscap SystemCapability.Global.ResourceManager 2792 * @crossplatform 2793 * @atomicservice 2794 * @since arkts {'1.1':'11', '1.2':'20'} 2795 * @arkts 1.1&1.2 2796 */ 2797 getBooleanByName(resName: string): boolean; 2798 2799 /** 2800 * Obtains the number result with a specified resource ID. 2801 * 2802 * @param { number } resId - Indicates the resource ID. 2803 * @returns { number } The number resource corresponding to the resource ID. 2804 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2805 * @throws { BusinessError } 9001001 - Invalid resource ID. 2806 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2807 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2808 * @syscap SystemCapability.Global.ResourceManager 2809 * @since 9 2810 */ 2811 /** 2812 * Obtains the number result with a specified resource ID. 2813 * 2814 * @param { number } resId - Indicates the resource ID. 2815 * @returns { number } The number resource corresponding to the resource ID. 2816 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2817 * @throws { BusinessError } 9001001 - Invalid resource ID. 2818 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2819 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2820 * @syscap SystemCapability.Global.ResourceManager 2821 * @crossplatform 2822 * @since 10 2823 */ 2824 /** 2825 * Obtains the number result with a specified resource ID. 2826 * 2827 * @param { number } resId - Indicates the resource ID. 2828 * @returns { number } The number resource corresponding to the resource ID. 2829 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2830 * @throws { BusinessError } 9001001 - Invalid resource ID. 2831 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2832 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2833 * @syscap SystemCapability.Global.ResourceManager 2834 * @crossplatform 2835 * @atomicservice 2836 * @since arkts {'1.1':'11', '1.2':'20'} 2837 * @arkts 1.1&1.2 2838 */ 2839 getNumber(resId: number): number; 2840 2841 /** 2842 * Obtains the number result with a specified resource object. 2843 * 2844 * @param { Resource } resource - Indicates the resource object. 2845 * @returns { number } The number resource corresponding to the resource object. 2846 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2847 * @throws { BusinessError } 9001001 - Invalid resource ID. 2848 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2849 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2850 * @syscap SystemCapability.Global.ResourceManager 2851 * @stagemodelonly 2852 * @since 9 2853 */ 2854 /** 2855 * Obtains the number result with a specified resource object. 2856 * 2857 * @param { Resource } resource - Indicates the resource object. 2858 * @returns { number } The number resource corresponding to the resource object. 2859 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2860 * @throws { BusinessError } 9001001 - Invalid resource ID. 2861 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2862 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2863 * @syscap SystemCapability.Global.ResourceManager 2864 * @stagemodelonly 2865 * @crossplatform 2866 * @since 10 2867 */ 2868 /** 2869 * Obtains the number result with a specified resource object. 2870 * 2871 * @param { Resource } resource - Indicates the resource object. 2872 * @returns { number } The number resource corresponding to the resource object. 2873 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2874 * @throws { BusinessError } 9001001 - Invalid resource ID. 2875 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2876 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2877 * @syscap SystemCapability.Global.ResourceManager 2878 * @stagemodelonly 2879 * @crossplatform 2880 * @atomicservice 2881 * @since 11 2882 * @deprecated since 20 2883 * @useinstead ohos.resourceManager.getNumber 2884 */ 2885 getNumber(resource: Resource): number; 2886 2887 /** 2888 * Obtains the number result with a specified resource name. 2889 * 2890 * @param { string } resName - Indicates the resource name. 2891 * @returns { number } The number resource corresponding to the resource name. 2892 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2893 * @throws { BusinessError } 9001003 - Invalid resource name. 2894 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2895 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2896 * @syscap SystemCapability.Global.ResourceManager 2897 * @since 9 2898 */ 2899 /** 2900 * Obtains the number result with a specified resource name. 2901 * 2902 * @param { string } resName - Indicates the resource name. 2903 * @returns { number } The number resource corresponding to the resource name. 2904 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2905 * @throws { BusinessError } 9001003 - Invalid resource name. 2906 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2907 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2908 * @syscap SystemCapability.Global.ResourceManager 2909 * @crossplatform 2910 * @since 10 2911 */ 2912 /** 2913 * Obtains the number result with a specified resource name. 2914 * 2915 * @param { string } resName - Indicates the resource name. 2916 * @returns { number } The number resource corresponding to the resource name. 2917 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2918 * @throws { BusinessError } 9001003 - Invalid resource name. 2919 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 2920 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2921 * @syscap SystemCapability.Global.ResourceManager 2922 * @crossplatform 2923 * @atomicservice 2924 * @since arkts {'1.1':'11', '1.2':'20'} 2925 * @arkts 1.1&1.2 2926 */ 2927 getNumberByName(resName: string): number; 2928 2929 /** 2930 * Obtains release resourceManager. 2931 * 2932 * @syscap SystemCapability.Global.ResourceManager 2933 * @since 7 2934 */ 2935 /** 2936 * Obtains release resourceManager. 2937 * 2938 * @syscap SystemCapability.Global.ResourceManager 2939 * @crossplatform 2940 * @since 10 2941 */ 2942 /** 2943 * Obtains release resourceManager. 2944 * 2945 * @syscap SystemCapability.Global.ResourceManager 2946 * @crossplatform 2947 * @atomicservice 2948 * @since 11 2949 * @deprecated since 12 2950 */ 2951 release(); 2952 2953 /** 2954 * Obtains the character string corresponding to a specified resource ID in callback mode. 2955 * 2956 * @param { number } resId - Indicates the resource ID. 2957 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained character string. 2958 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2959 * @throws { BusinessError } 9001001 - Invalid resource ID. 2960 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2961 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2962 * @syscap SystemCapability.Global.ResourceManager 2963 * @since 9 2964 */ 2965 /** 2966 * Obtains the character string corresponding to a specified resource ID in callback mode. 2967 * 2968 * @param { number } resId - Indicates the resource ID. 2969 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained character string. 2970 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2971 * @throws { BusinessError } 9001001 - Invalid resource ID. 2972 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2973 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2974 * @syscap SystemCapability.Global.ResourceManager 2975 * @crossplatform 2976 * @since 10 2977 */ 2978 /** 2979 * Obtains the character string corresponding to a specified resource ID in callback mode. 2980 * 2981 * @param { number } resId - Indicates the resource ID. 2982 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained character string. 2983 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 2984 * @throws { BusinessError } 9001001 - Invalid resource ID. 2985 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 2986 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 2987 * @syscap SystemCapability.Global.ResourceManager 2988 * @crossplatform 2989 * @atomicservice 2990 * @since arkts {'1.1':'11', '1.2':'20'} 2991 * @arkts 1.1&1.2 2992 */ 2993 getStringValue(resId: number, callback: _AsyncCallback<string>): void; 2994 2995 /** 2996 * Obtains string resources associated with a specified resource ID in Promise mode. 2997 * 2998 * @param { number } resId - Indicates the resource ID. 2999 * @returns { Promise<string> } The character string corresponding to the resource ID. 3000 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3001 * @throws { BusinessError } 9001001 - Invalid resource ID. 3002 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3003 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3004 * @syscap SystemCapability.Global.ResourceManager 3005 * @since 9 3006 */ 3007 /** 3008 * Obtains string resources associated with a specified resource ID in Promise mode. 3009 * 3010 * @param { number } resId - Indicates the resource ID. 3011 * @returns { Promise<string> } The character string corresponding to the resource ID. 3012 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3013 * @throws { BusinessError } 9001001 - Invalid resource ID. 3014 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3015 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3016 * @syscap SystemCapability.Global.ResourceManager 3017 * @crossplatform 3018 * @since 10 3019 */ 3020 /** 3021 * Obtains string resources associated with a specified resource ID in Promise mode. 3022 * 3023 * @param { number } resId - Indicates the resource ID. 3024 * @returns { Promise<string> } The character string corresponding to the resource ID. 3025 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3026 * @throws { BusinessError } 9001001 - Invalid resource ID. 3027 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3028 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3029 * @syscap SystemCapability.Global.ResourceManager 3030 * @crossplatform 3031 * @atomicservice 3032 * @since arkts {'1.1':'11', '1.2':'20'} 3033 * @arkts 1.1&1.2 3034 */ 3035 getStringValue(resId: number): Promise<string>; 3036 3037 /** 3038 * Obtains the array of character strings corresponding to a specified resource ID in callback mode. 3039 * 3040 * @param { number } resId - Indicates the resource ID. 3041 * @param { _AsyncCallback<Array<string>> } callback - Indicates the asynchronous callback used to return the obtained array of character strings. 3042 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3043 * @throws { BusinessError } 9001001 - Invalid resource ID. 3044 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3045 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3046 * @syscap SystemCapability.Global.ResourceManager 3047 * @since 9 3048 */ 3049 /** 3050 * Obtains the array of character strings corresponding to a specified resource ID in callback mode. 3051 * 3052 * @param { number } resId - Indicates the resource ID. 3053 * @param { _AsyncCallback<Array<string>> } callback - Indicates the asynchronous callback used to return the obtained array of character strings. 3054 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3055 * @throws { BusinessError } 9001001 - Invalid resource ID. 3056 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3057 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3058 * @syscap SystemCapability.Global.ResourceManager 3059 * @crossplatform 3060 * @since 10 3061 */ 3062 /** 3063 * Obtains the array of character strings corresponding to a specified resource ID in callback mode. 3064 * 3065 * @param { number } resId - Indicates the resource ID. 3066 * @param { _AsyncCallback<Array<string>> } callback - Indicates the asynchronous callback used to return the obtained array of character strings. 3067 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3068 * @throws { BusinessError } 9001001 - Invalid resource ID. 3069 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3070 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3071 * @syscap SystemCapability.Global.ResourceManager 3072 * @crossplatform 3073 * @atomicservice 3074 * @since arkts {'1.1':'11', '1.2':'20'} 3075 * @arkts 1.1&1.2 3076 */ 3077 getStringArrayValue(resId: number, callback: _AsyncCallback<Array<string>>): void; 3078 3079 /** 3080 * Obtains the array of character strings corresponding to a specified resource ID in Promise mode. 3081 * 3082 * @param { number } resId - Indicates the resource ID. 3083 * @returns { Promise<Array<string>> } The array of character strings corresponding to the specified resource ID. 3084 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3085 * @throws { BusinessError } 9001001 - Invalid resource ID. 3086 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3087 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3088 * @syscap SystemCapability.Global.ResourceManager 3089 * @since 9 3090 */ 3091 /** 3092 * Obtains the array of character strings corresponding to a specified resource ID in Promise mode. 3093 * 3094 * @param { number } resId - Indicates the resource ID. 3095 * @returns { Promise<Array<string>> } The array of character strings corresponding to the specified resource ID. 3096 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3097 * @throws { BusinessError } 9001001 - Invalid resource ID. 3098 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3099 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3100 * @syscap SystemCapability.Global.ResourceManager 3101 * @crossplatform 3102 * @since 10 3103 */ 3104 /** 3105 * Obtains the array of character strings corresponding to a specified resource ID in Promise mode. 3106 * 3107 * @param { number } resId - Indicates the resource ID. 3108 * @returns { Promise<Array<string>> } The array of character strings corresponding to the specified resource ID. 3109 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3110 * @throws { BusinessError } 9001001 - Invalid resource ID. 3111 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3112 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3113 * @syscap SystemCapability.Global.ResourceManager 3114 * @crossplatform 3115 * @atomicservice 3116 * @since arkts {'1.1':'11', '1.2':'20'} 3117 * @arkts 1.1&1.2 3118 */ 3119 getStringArrayValue(resId: number): Promise<Array<string>>; 3120 3121 /** 3122 * Obtains the singular-plural character string represented by the ID string corresponding to the 3123 * specified number in callback mode. 3124 * 3125 * @param { number } resId - Indicates the resource ID. 3126 * @param { number } num - Indicates the number. 3127 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the singular-plural character 3128 * string represented by the ID string corresponding to the specified number. 3129 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3130 * @throws { BusinessError } 9001001 - Invalid resource ID. 3131 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3132 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3133 * @syscap SystemCapability.Global.ResourceManager 3134 * @since 9 3135 */ 3136 /** 3137 * Obtains the singular-plural character string represented by the ID string corresponding to the 3138 * specified number in callback mode. 3139 * 3140 * @param { number } resId - Indicates the resource ID. 3141 * @param { number } num - Indicates the number. 3142 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the singular-plural character 3143 * string represented by the ID string corresponding to the specified number. 3144 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3145 * @throws { BusinessError } 9001001 - Invalid resource ID. 3146 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3147 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3148 * @syscap SystemCapability.Global.ResourceManager 3149 * @crossplatform 3150 * @since 10 3151 */ 3152 /** 3153 * Obtains the singular-plural character string represented by the ID string corresponding to the 3154 * specified number in callback mode. 3155 * 3156 * @param { number } resId - Indicates the resource ID. 3157 * @param { number } num - Indicates the number. 3158 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the singular-plural character 3159 * string represented by the ID string corresponding to the specified number. 3160 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3161 * @throws { BusinessError } 9001001 - Invalid resource ID. 3162 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3163 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3164 * @syscap SystemCapability.Global.ResourceManager 3165 * @crossplatform 3166 * @atomicservice 3167 * @since 11 3168 * @deprecated since 18 3169 * @useinstead ohos.resourceManager.getIntPluralStringValueSync 3170 */ 3171 getPluralStringValue(resId: number, num: number, callback: _AsyncCallback<string>): void; 3172 3173 /** 3174 * Obtains the singular-plural character string represented by the ID string corresponding to 3175 * the specified number in Promise mode. 3176 * 3177 * @param { number } resId - Indicates the resource ID. 3178 * @param { number } num - Indicates the number. 3179 * @returns { Promise<string> } The singular-plural character string represented by the ID string 3180 * corresponding to the specified number. 3181 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3182 * @throws { BusinessError } 9001001 - Invalid resource ID. 3183 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3184 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3185 * @syscap SystemCapability.Global.ResourceManager 3186 * @since 9 3187 */ 3188 /** 3189 * Obtains the singular-plural character string represented by the ID string corresponding to 3190 * the specified number in Promise mode. 3191 * 3192 * @param { number } resId - Indicates the resource ID. 3193 * @param { number } num - Indicates the number. 3194 * @returns { Promise<string> } The singular-plural character string represented by the ID string 3195 * corresponding to the specified number. 3196 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3197 * @throws { BusinessError } 9001001 - Invalid resource ID. 3198 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3199 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3200 * @syscap SystemCapability.Global.ResourceManager 3201 * @crossplatform 3202 * @since 10 3203 */ 3204 /** 3205 * Obtains the singular-plural character string represented by the ID string corresponding to 3206 * the specified number in Promise mode. 3207 * 3208 * @param { number } resId - Indicates the resource ID. 3209 * @param { number } num - Indicates the number. 3210 * @returns { Promise<string> } The singular-plural character string represented by the ID string 3211 * corresponding to the specified number. 3212 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3213 * @throws { BusinessError } 9001001 - Invalid resource ID. 3214 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3215 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3216 * @syscap SystemCapability.Global.ResourceManager 3217 * @crossplatform 3218 * @atomicservice 3219 * @since 11 3220 * @deprecated since 18 3221 * @useinstead ohos.resourceManager.getIntPluralStringValueSync 3222 */ 3223 getPluralStringValue(resId: number, num: number): Promise<string>; 3224 3225 /** 3226 * Obtains the singular-plural character string represented by the ID string corresponding to 3227 * the specified number. 3228 * 3229 * @param { number } resId - Indicates the resource ID. 3230 * @param { number } num - An integer used to get the correct string for the current plural rules. 3231 * @param { Array<string | number> } args - Indicates the formatting string resource parameters. 3232 * @returns { string } The singular-plural character string represented by the ID string 3233 * corresponding to the specified number. 3234 * @throws { BusinessError } 9001001 - Invalid resource ID. 3235 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3236 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3237 * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. 3238 * @syscap SystemCapability.Global.ResourceManager 3239 * @crossplatform 3240 * @atomicservice 3241 * @since 18 3242 */ 3243 getIntPluralStringValueSync(resId: number, num: number, ...args: Array<string | number>): string; 3244 3245 /** 3246 * Obtains the singular-plural character string represented by the ID string corresponding to 3247 * the specified number. 3248 * 3249 * @param { number } resId - Indicates the resource ID. 3250 * @param { number } num - An integer used to get the correct string for the current plural rules. 3251 * @param { (string | number)[] } args - Indicates the formatting string resource parameters. 3252 * @returns { string } The singular-plural character string represented by the ID string 3253 * corresponding to the specified number. 3254 * @throws { BusinessError } 9001001 - Invalid resource ID. 3255 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3256 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3257 * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. 3258 * @syscap SystemCapability.Global.ResourceManager 3259 * @crossplatform 3260 * @atomicservice 3261 * @since 20 3262 * @arkts 1.2 3263 */ 3264 getIntPluralStringValueSync(resId: number, num: number, ...args: (string | number)[]): string; 3265 3266 /** 3267 * Obtains the singular-plural character string represented by the resource object string corresponding to the 3268 * specified number. 3269 * 3270 * @param { Resource } resource - Indicates the resource object. 3271 * @param { number } num - An integer used to get the correct string for the current plural rules. 3272 * @param { Array<string | number> } args - Indicates the formatting string resource parameters. 3273 * @returns { string } The singular-plural character string represented by the ID string 3274 * corresponding to the specified number. 3275 * @throws { BusinessError } 9001001 - Invalid resource ID. 3276 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3277 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3278 * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. 3279 * @syscap SystemCapability.Global.ResourceManager 3280 * @stagemodelonly 3281 * @crossplatform 3282 * @atomicservice 3283 * @since 18 3284 * @deprecated since 20 3285 * @useinstead ohos.resourceManager.getIntPluralStringValueSync 3286 */ 3287 getIntPluralStringValueSync(resource: Resource, num: number, ...args: Array<string | number>): string; 3288 3289 /** 3290 * Obtains the singular-plural character string represented by the name string corresponding to 3291 * the specified number. 3292 * 3293 * @param { string } resName - Indicates the resource name. 3294 * @param { number } num - An integer used to get the correct string for the current plural rules. 3295 * @param { Array<string | number> } args - Indicates the formatting string resource parameters. 3296 * @returns { string } The singular-plural character string represented by the name string 3297 * corresponding to the specified number. 3298 * @throws { BusinessError } 9001003 - Invalid resource name. 3299 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 3300 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3301 * @throws { BusinessError } 9001008 - Failed to format the resource obtained based on the resource name. 3302 * @syscap SystemCapability.Global.ResourceManager 3303 * @crossplatform 3304 * @atomicservice 3305 * @since 18 3306 */ 3307 getIntPluralStringByNameSync(resName: string, num: number, ...args: Array<string | number>): string; 3308 3309 /** 3310 * Obtains the singular-plural character string represented by the name string corresponding to 3311 * the specified number. 3312 * 3313 * @param { string } resName - Indicates the resource name. 3314 * @param { number } num - An integer used to get the correct string for the current plural rules. 3315 * @param { (string | number)[] } args - Indicates the formatting string resource parameters. 3316 * @returns { string } The singular-plural character string represented by the name string 3317 * corresponding to the specified number. 3318 * @throws { BusinessError } 9001003 - Invalid resource name. 3319 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 3320 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3321 * @throws { BusinessError } 9001008 - Failed to format the resource obtained based on the resource name. 3322 * @syscap SystemCapability.Global.ResourceManager 3323 * @crossplatform 3324 * @atomicservice 3325 * @since 20 3326 * @arkts 1.2 3327 */ 3328 getIntPluralStringByNameSync(resName: string, num: number, ...args: (string | number)[]): string; 3329 3330 /** 3331 * Obtains the singular-plural character string represented by the ID string corresponding to 3332 * the specified number. 3333 * 3334 * @param { number } resId - Indicates the resource ID. 3335 * @param { number } num - A double parameter used to get the correct string for the current plural rules. 3336 * @param { Array<string | number> } args - Indicates the formatting string resource parameters. 3337 * @returns { string } The singular-plural character string represented by the ID string 3338 * corresponding to the specified number. 3339 * @throws { BusinessError } 9001001 - Invalid resource ID. 3340 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3341 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3342 * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. 3343 * @syscap SystemCapability.Global.ResourceManager 3344 * @crossplatform 3345 * @atomicservice 3346 * @since 18 3347 */ 3348 getDoublePluralStringValueSync(resId: number, num: number, ...args: Array<string | number>): string; 3349 3350 /** 3351 * Obtains the singular-plural character string represented by the ID string corresponding to 3352 * the specified number. 3353 * 3354 * @param { number } resId - Indicates the resource ID. 3355 * @param { number } num - A double parameter used to get the correct string for the current plural rules. 3356 * @param { (string | number)[] } args - Indicates the formatting string resource parameters. 3357 * @returns { string } The singular-plural character string represented by the ID string 3358 * corresponding to the specified number. 3359 * @throws { BusinessError } 9001001 - Invalid resource ID. 3360 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3361 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3362 * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. 3363 * @syscap SystemCapability.Global.ResourceManager 3364 * @crossplatform 3365 * @atomicservice 3366 * @since 20 3367 * @arkts 1.2 3368 */ 3369 getDoublePluralStringValueSync(resId: number, num: number, ...args: (string | number)[]): string; 3370 3371 /** 3372 * Obtains the singular-plural character string represented by the resource object string corresponding to the 3373 * specified number. 3374 * 3375 * @param { Resource } resource - Indicates the resource object. 3376 * @param { number } num - A double parameter used to get the correct string for the current plural rules. 3377 * @param { Array<string | number> } args - Indicates the formatting string resource parameters. 3378 * @returns { string } The singular-plural character string represented by the ID string 3379 * corresponding to the specified number. 3380 * @throws { BusinessError } 9001001 - Invalid resource ID. 3381 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3382 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3383 * @throws { BusinessError } 9001007 - Failed to format the resource obtained based on the resource ID. 3384 * @syscap SystemCapability.Global.ResourceManager 3385 * @stagemodelonly 3386 * @crossplatform 3387 * @atomicservice 3388 * @since 18 3389 * @deprecated since 20 3390 * @useinstead ohos.resourceManager.getDoublePluralStringValueSync 3391 */ 3392 getDoublePluralStringValueSync(resource: Resource, num: number, ...args: Array<string | number>): string; 3393 3394 /** 3395 * Obtains the singular-plural character string represented by the name string corresponding to 3396 * the specified number. 3397 * 3398 * @param { string } resName - Indicates the resource name. 3399 * @param { number } num - A double parameter used to get the correct string for the current plural rules. 3400 * @param { Array<string | number> } args - Indicates the formatting string resource parameters. 3401 * @returns { string } The singular-plural character string represented by the name string 3402 * corresponding to the specified number. 3403 * @throws { BusinessError } 9001003 - Invalid resource name. 3404 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 3405 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3406 * @throws { BusinessError } 9001008 - Failed to format the resource obtained based on the resource name. 3407 * @syscap SystemCapability.Global.ResourceManager 3408 * @crossplatform 3409 * @atomicservice 3410 * @since 18 3411 */ 3412 getDoublePluralStringByNameSync(resName: string, num: number, ...args: Array<string | number>): string; 3413 3414 /** 3415 * Obtains the singular-plural character string represented by the name string corresponding to 3416 * the specified number. 3417 * 3418 * @param { string } resName - Indicates the resource name. 3419 * @param { number } num - A double parameter used to get the correct string for the current plural rules. 3420 * @param { (string | number)[] } args - Indicates the formatting string resource parameters. 3421 * @returns { string } The singular-plural character string represented by the name string 3422 * corresponding to the specified number. 3423 * @throws { BusinessError } 9001003 - Invalid resource name. 3424 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 3425 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 3426 * @throws { BusinessError } 9001008 - Failed to format the resource obtained based on the resource name. 3427 * @syscap SystemCapability.Global.ResourceManager 3428 * @crossplatform 3429 * @atomicservice 3430 * @since 20 3431 * @arkts 1.2 3432 */ 3433 getDoublePluralStringByNameSync(resName: string, num: number, ...args: (string | number)[]): string; 3434 3435 /** 3436 * Obtains the content of the media file corresponding to a specified resource ID in callback mode. 3437 * 3438 * @param { number } resId - Indicates the resource ID. 3439 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained media file content. 3440 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3441 * @throws { BusinessError } 9001001 - Invalid resource ID. 3442 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3443 * @syscap SystemCapability.Global.ResourceManager 3444 * @since 9 3445 */ 3446 /** 3447 * Obtains the content of the media file corresponding to a specified resource ID in callback mode. 3448 * 3449 * @param { number } resId - Indicates the resource ID. 3450 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained media file content. 3451 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3452 * @throws { BusinessError } 9001001 - Invalid resource ID. 3453 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3454 * @syscap SystemCapability.Global.ResourceManager 3455 * @crossplatform 3456 * @since 10 3457 */ 3458 /** 3459 * Obtains the content of the media file corresponding to a specified resource ID in callback mode. 3460 * 3461 * @param { number } resId - Indicates the resource ID. 3462 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained media file content. 3463 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3464 * @throws { BusinessError } 9001001 - Invalid resource ID. 3465 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3466 * @syscap SystemCapability.Global.ResourceManager 3467 * @crossplatform 3468 * @atomicservice 3469 * @since arkts {'1.1':'11', '1.2':'20'} 3470 * @arkts 1.1&1.2 3471 */ 3472 getMediaContent(resId: number, callback: _AsyncCallback<Uint8Array>): void; 3473 3474 /** 3475 * Obtains the content of the specified screen density media file corresponding to a specified resource ID in callback mode. 3476 * 3477 * @param { number } resId - Indicates the resource ID. 3478 * @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 3479 * to use the density of current system dpi. 3480 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained 3481 * specified screen density media file content. 3482 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 3483 * @throws { BusinessError } 9001001 - Invalid resource ID. 3484 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3485 * @syscap SystemCapability.Global.ResourceManager 3486 * @since 10 3487 */ 3488 /** 3489 * Obtains the content of the specified screen density media file corresponding to a specified resource ID in callback mode. 3490 * 3491 * @param { number } resId - Indicates the resource ID. 3492 * @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 3493 * to use the density of current system dpi. 3494 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained 3495 * specified screen density media file content. 3496 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 3497 * @throws { BusinessError } 9001001 - Invalid resource ID. 3498 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3499 * @syscap SystemCapability.Global.ResourceManager 3500 * @crossplatform 3501 * @atomicservice 3502 * @since arkts {'1.1':'11', '1.2':'20'} 3503 * @arkts 1.1&1.2 3504 */ 3505 getMediaContent(resId: number, density: number, callback: _AsyncCallback<Uint8Array>): void; 3506 3507 /** 3508 * Obtains the content of the media file corresponding to a specified resource ID in Promise mode. 3509 * 3510 * @param { number } resId - Indicates the resource ID. 3511 * @returns { Promise<Uint8Array> } The content of the media file corresponding to the specified resource ID. 3512 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3513 * @throws { BusinessError } 9001001 - Invalid resource ID. 3514 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3515 * @syscap SystemCapability.Global.ResourceManager 3516 * @since 9 3517 */ 3518 /** 3519 * Obtains the content of the media file corresponding to a specified resource ID in Promise mode. 3520 * 3521 * @param { number } resId - Indicates the resource ID. 3522 * @returns { Promise<Uint8Array> } The content of the media file corresponding to the specified resource ID. 3523 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3524 * @throws { BusinessError } 9001001 - Invalid resource ID. 3525 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3526 * @syscap SystemCapability.Global.ResourceManager 3527 * @crossplatform 3528 * @since 10 3529 */ 3530 /** 3531 * Obtains the content of the media file corresponding to a specified resource ID in Promise mode. 3532 * 3533 * @param { number } resId - Indicates the resource ID. 3534 * @returns { Promise<Uint8Array> } The content of the media file corresponding to the specified resource ID. 3535 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3536 * @throws { BusinessError } 9001001 - Invalid resource ID. 3537 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3538 * @syscap SystemCapability.Global.ResourceManager 3539 * @crossplatform 3540 * @atomicservice 3541 * @since arkts {'1.1':'11', '1.2':'20'} 3542 * @arkts 1.1&1.2 3543 */ 3544 getMediaContent(resId: number): Promise<Uint8Array>; 3545 3546 /** 3547 * Obtains the content of the specified screen density media file corresponding to a specified resource ID in Promise mode. 3548 * 3549 * @param { number } resId - Indicates the resource ID. 3550 * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 3551 * to use the density of current system dpi. 3552 * @returns { Promise<Uint8Array> } The content of the specified screen density media file corresponding to the specified resource ID. 3553 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 3554 * @throws { BusinessError } 9001001 - Invalid resource ID. 3555 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3556 * @syscap SystemCapability.Global.ResourceManager 3557 * @since 10 3558 */ 3559 /** 3560 * Obtains the content of the specified screen density media file corresponding to a specified resource ID in Promise mode. 3561 * 3562 * @param { number } resId - Indicates the resource ID. 3563 * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 3564 * to use the density of current system dpi. 3565 * @returns { Promise<Uint8Array> } The content of the specified screen density media file corresponding to the specified resource ID. 3566 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 3567 * @throws { BusinessError } 9001001 - Invalid resource ID. 3568 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3569 * @syscap SystemCapability.Global.ResourceManager 3570 * @crossplatform 3571 * @atomicservice 3572 * @since arkts {'1.1':'11', '1.2':'20'} 3573 * @arkts 1.1&1.2 3574 */ 3575 getMediaContent(resId: number, density: number): Promise<Uint8Array>; 3576 3577 /** 3578 * Obtains the Base64 code of the image resource corresponding to the specified resource ID in callback mode. 3579 * 3580 * @param { number } resId - Indicates the resource ID. 3581 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the image 3582 * resource. 3583 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3584 * @throws { BusinessError } 9001001 - Invalid resource ID. 3585 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3586 * @syscap SystemCapability.Global.ResourceManager 3587 * @since 9 3588 */ 3589 /** 3590 * Obtains the Base64 code of the image resource corresponding to the specified resource ID in callback mode. 3591 * 3592 * @param { number } resId - Indicates the resource ID. 3593 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the image 3594 * resource. 3595 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3596 * @throws { BusinessError } 9001001 - Invalid resource ID. 3597 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3598 * @syscap SystemCapability.Global.ResourceManager 3599 * @crossplatform 3600 * @since 10 3601 */ 3602 /** 3603 * Obtains the Base64 code of the image resource corresponding to the specified resource ID in callback mode. 3604 * 3605 * @param { number } resId - Indicates the resource ID. 3606 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the image 3607 * resource. 3608 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3609 * @throws { BusinessError } 9001001 - Invalid resource ID. 3610 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3611 * @syscap SystemCapability.Global.ResourceManager 3612 * @crossplatform 3613 * @atomicservice 3614 * @since arkts {'1.1':'11', '1.2':'20'} 3615 * @arkts 1.1&1.2 3616 */ 3617 getMediaContentBase64(resId: number, callback: _AsyncCallback<string>): void; 3618 3619 /** 3620 * Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource ID in callback mode. 3621 * 3622 * @param { number } resId - Indicates the resource ID. 3623 * @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 3624 * to use the density of current system dpi. 3625 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the 3626 * specified screen density image resource. 3627 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 3628 * @throws { BusinessError } 9001001 - Invalid resource ID. 3629 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3630 * @syscap SystemCapability.Global.ResourceManager 3631 * @since 10 3632 */ 3633 /** 3634 * Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource ID in callback mode. 3635 * 3636 * @param { number } resId - Indicates the resource ID. 3637 * @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 3638 * to use the density of current system dpi. 3639 * @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the 3640 * specified screen density image resource. 3641 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 3642 * @throws { BusinessError } 9001001 - Invalid resource ID. 3643 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3644 * @syscap SystemCapability.Global.ResourceManager 3645 * @crossplatform 3646 * @atomicservice 3647 * @since arkts {'1.1':'11', '1.2':'20'} 3648 * @arkts 1.1&1.2 3649 */ 3650 getMediaContentBase64(resId: number, density: number, callback: _AsyncCallback<string>): void; 3651 3652 /** 3653 * Obtains the Base64 code of the image resource corresponding to the specified resource ID in Promise mode. 3654 * 3655 * @param { number } resId - Indicates the resource ID. 3656 * @returns { Promise<string> } the Base64 code of the image resource corresponding to the specified resource ID. 3657 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3658 * @throws { BusinessError } 9001001 - Invalid resource ID. 3659 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3660 * @syscap SystemCapability.Global.ResourceManager 3661 * @since 9 3662 */ 3663 /** 3664 * Obtains the Base64 code of the image resource corresponding to the specified resource ID in Promise mode. 3665 * 3666 * @param { number } resId - Indicates the resource ID. 3667 * @returns { Promise<string> } the Base64 code of the image resource corresponding to the specified resource ID. 3668 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3669 * @throws { BusinessError } 9001001 - Invalid resource ID. 3670 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3671 * @syscap SystemCapability.Global.ResourceManager 3672 * @crossplatform 3673 * @since 10 3674 */ 3675 /** 3676 * Obtains the Base64 code of the image resource corresponding to the specified resource ID in Promise mode. 3677 * 3678 * @param { number } resId - Indicates the resource ID. 3679 * @returns { Promise<string> } the Base64 code of the image resource corresponding to the specified resource ID. 3680 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3681 * @throws { BusinessError } 9001001 - Invalid resource ID. 3682 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3683 * @syscap SystemCapability.Global.ResourceManager 3684 * @crossplatform 3685 * @atomicservice 3686 * @since arkts {'1.1':'11', '1.2':'20'} 3687 * @arkts 1.1&1.2 3688 */ 3689 getMediaContentBase64(resId: number): Promise<string>; 3690 3691 /** 3692 * Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource ID in Promise mode. 3693 * 3694 * @param { number } resId - Indicates the resource ID. 3695 * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 3696 * to use the density of current system dpi. 3697 * @returns { Promise<string> } the Base64 code of the specified screen density image resource corresponding to the specified resource ID. 3698 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 3699 * @throws { BusinessError } 9001001 - Invalid resource ID. 3700 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3701 * @syscap SystemCapability.Global.ResourceManager 3702 * @since 10 3703 */ 3704 /** 3705 * Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource ID in Promise mode. 3706 * 3707 * @param { number } resId - Indicates the resource ID. 3708 * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 3709 * to use the density of current system dpi. 3710 * @returns { Promise<string> } the Base64 code of the specified screen density image resource corresponding to the specified resource ID. 3711 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 3712 * @throws { BusinessError } 9001001 - Invalid resource ID. 3713 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3714 * @syscap SystemCapability.Global.ResourceManager 3715 * @crossplatform 3716 * @atomicservice 3717 * @since arkts {'1.1':'11', '1.2':'20'} 3718 * @arkts 1.1&1.2 3719 */ 3720 getMediaContentBase64(resId: number, density: number): Promise<string>; 3721 3722 /** 3723 * Obtains the raw file resource corresponding to the specified resource path in callback mode. 3724 * 3725 * @param { string } path - Indicates the resource relative path. 3726 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the raw file resource. 3727 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3728 * @throws { BusinessError } 9001005 - Invalid relative path. 3729 * @syscap SystemCapability.Global.ResourceManager 3730 * @since 9 3731 */ 3732 /** 3733 * Obtains the raw file resource corresponding to the specified resource path in callback mode. 3734 * 3735 * @param { string } path - Indicates the resource relative path. 3736 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the raw file resource. 3737 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3738 * @throws { BusinessError } 9001005 - Invalid relative path. 3739 * @syscap SystemCapability.Global.ResourceManager 3740 * @crossplatform 3741 * @since 10 3742 */ 3743 /** 3744 * Obtains the raw file resource corresponding to the specified resource path in callback mode. 3745 * 3746 * @param { string } path - Indicates the resource relative path. 3747 * @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the raw file resource. 3748 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3749 * @throws { BusinessError } 9001005 - Invalid relative path. 3750 * @syscap SystemCapability.Global.ResourceManager 3751 * @crossplatform 3752 * @atomicservice 3753 * @since arkts {'1.1':'11', '1.2':'20'} 3754 * @arkts 1.1&1.2 3755 */ 3756 getRawFileContent(path: string, callback: _AsyncCallback<Uint8Array>): void; 3757 3758 /** 3759 * Obtains the raw file resource corresponding to the specified resource path in Promise mode. 3760 * 3761 * @param { string } path - Indicates the resource relative path. 3762 * @returns { Promise<Uint8Array> } the raw file resource corresponding to the specified resource path. 3763 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3764 * @throws { BusinessError } 9001005 - Invalid relative path. 3765 * @syscap SystemCapability.Global.ResourceManager 3766 * @since 9 3767 */ 3768 /** 3769 * Obtains the raw file resource corresponding to the specified resource path in Promise mode. 3770 * 3771 * @param { string } path - Indicates the resource relative path. 3772 * @returns { Promise<Uint8Array> } the raw file resource corresponding to the specified resource path. 3773 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3774 * @throws { BusinessError } 9001005 - Invalid relative path. 3775 * @syscap SystemCapability.Global.ResourceManager 3776 * @crossplatform 3777 * @since 10 3778 */ 3779 /** 3780 * Obtains the raw file resource corresponding to the specified resource path in Promise mode. 3781 * 3782 * @param { string } path - Indicates the resource relative path. 3783 * @returns { Promise<Uint8Array> } the raw file resource corresponding to the specified resource path. 3784 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3785 * @throws { BusinessError } 9001005 - Invalid relative path. 3786 * @syscap SystemCapability.Global.ResourceManager 3787 * @crossplatform 3788 * @atomicservice 3789 * @since arkts {'1.1':'11', '1.2':'20'} 3790 * @arkts 1.1&1.2 3791 */ 3792 getRawFileContent(path: string): Promise<Uint8Array>; 3793 3794 /** 3795 * Obtains the raw file resource descriptor corresponding to the specified resource path in callback mode. 3796 * 3797 * @param { string } path - Indicates the resource relative path. 3798 * @param { _AsyncCallback<RawFileDescriptor> } callback - Indicates the asynchronous callback used to return the raw file resource descriptor. 3799 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3800 * @throws { BusinessError } 9001005 - Invalid relative path. 3801 * @syscap SystemCapability.Global.ResourceManager 3802 * @since 9 3803 */ 3804 /** 3805 * Obtains the raw file resource descriptor corresponding to the specified resource path in callback mode. 3806 * 3807 * @param { string } path - Indicates the resource relative path. 3808 * @param { _AsyncCallback<RawFileDescriptor> } callback - Indicates the asynchronous callback used to return the raw file resource descriptor. 3809 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3810 * @throws { BusinessError } 9001005 - Invalid relative path. 3811 * @syscap SystemCapability.Global.ResourceManager 3812 * @crossplatform 3813 * @since 10 3814 */ 3815 /** 3816 * Obtains the raw file resource descriptor corresponding to the specified resource path in callback mode. 3817 * 3818 * @param { string } path - Indicates the resource relative path. 3819 * @param { _AsyncCallback<RawFileDescriptor> } callback - Indicates the asynchronous callback used to return the raw file resource descriptor. 3820 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3821 * @throws { BusinessError } 9001005 - Invalid relative path. 3822 * @syscap SystemCapability.Global.ResourceManager 3823 * @crossplatform 3824 * @atomicservice 3825 * @since arkts {'1.1':'11', '1.2':'20'} 3826 * @arkts 1.1&1.2 3827 */ 3828 getRawFd(path: string, callback: _AsyncCallback<RawFileDescriptor>): void; 3829 3830 /** 3831 * Obtains the raw file resource descriptor corresponding to the specified resource path in Promise mode. 3832 * 3833 * @param { string } path - Indicates the resource relative path. 3834 * @returns { Promise<RawFileDescriptor> } The raw file resource descriptor corresponding to the specified resource path. 3835 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3836 * @throws { BusinessError } 9001005 - Invalid relative path. 3837 * @syscap SystemCapability.Global.ResourceManager 3838 * @since 9 3839 */ 3840 /** 3841 * Obtains the raw file resource descriptor corresponding to the specified resource path in Promise mode. 3842 * 3843 * @param { string } path - Indicates the resource relative path. 3844 * @returns { Promise<RawFileDescriptor> } The raw file resource descriptor corresponding to the specified resource path. 3845 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3846 * @throws { BusinessError } 9001005 - Invalid relative path. 3847 * @syscap SystemCapability.Global.ResourceManager 3848 * @crossplatform 3849 * @since 10 3850 */ 3851 /** 3852 * Obtains the raw file resource descriptor corresponding to the specified resource path in Promise mode. 3853 * 3854 * @param { string } path - Indicates the resource relative path. 3855 * @returns { Promise<RawFileDescriptor> } The raw file resource descriptor corresponding to the specified resource path. 3856 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3857 * @throws { BusinessError } 9001005 - Invalid relative path. 3858 * @syscap SystemCapability.Global.ResourceManager 3859 * @crossplatform 3860 * @atomicservice 3861 * @since arkts {'1.1':'11', '1.2':'20'} 3862 * @arkts 1.1&1.2 3863 */ 3864 getRawFd(path: string): Promise<RawFileDescriptor>; 3865 3866 /** 3867 * Obtains close raw file resource descriptor corresponding to the specified resource path in callback mode. 3868 * 3869 * @param { string } path - Indicates the resource relative path. 3870 * @param { _AsyncCallback<void> } callback - Indicates the asynchronous callback used to return result close raw file resource descriptor. 3871 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3872 * @throws { BusinessError } 9001005 - Invalid relative path. 3873 * @syscap SystemCapability.Global.ResourceManager 3874 * @since 9 3875 */ 3876 /** 3877 * Obtains close raw file resource descriptor corresponding to the specified resource path in callback mode. 3878 * 3879 * @param { string } path - Indicates the resource relative path. 3880 * @param { _AsyncCallback<void> } callback - Indicates the asynchronous callback used to return result close raw file resource descriptor. 3881 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3882 * @throws { BusinessError } 9001005 - Invalid relative path. 3883 * @syscap SystemCapability.Global.ResourceManager 3884 * @crossplatform 3885 * @since 10 3886 */ 3887 /** 3888 * Obtains close raw file resource descriptor corresponding to the specified resource path in callback mode. 3889 * 3890 * @param { string } path - Indicates the resource relative path. 3891 * @param { _AsyncCallback<void> } callback - Indicates the asynchronous callback used to return result close raw file resource descriptor. 3892 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3893 * @throws { BusinessError } 9001005 - Invalid relative path. 3894 * @syscap SystemCapability.Global.ResourceManager 3895 * @crossplatform 3896 * @atomicservice 3897 * @since arkts {'1.1':'11', '1.2':'20'} 3898 * @arkts 1.1&1.2 3899 */ 3900 closeRawFd(path: string, callback: _AsyncCallback<void>): void; 3901 3902 /** 3903 * Obtains close raw file resource descriptor corresponding to the specified resource path in Promise mode. 3904 * 3905 * @param { string } path - Indicates the resource relative path. 3906 * @returns { Promise<void> } The result close raw file resource descriptor corresponding to the specified resource path. 3907 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3908 * @throws { BusinessError } 9001005 - Invalid relative path. 3909 * @syscap SystemCapability.Global.ResourceManager 3910 * @since 9 3911 */ 3912 /** 3913 * Obtains close raw file resource descriptor corresponding to the specified resource path in Promise mode. 3914 * 3915 * @param { string } path - Indicates the resource relative path. 3916 * @returns { Promise<void> } The result close raw file resource descriptor corresponding to the specified resource path. 3917 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3918 * @throws { BusinessError } 9001005 - Invalid relative path. 3919 * @syscap SystemCapability.Global.ResourceManager 3920 * @crossplatform 3921 * @since 10 3922 */ 3923 /** 3924 * Obtains close raw file resource descriptor corresponding to the specified resource path in Promise mode. 3925 * 3926 * @param { string } path - Indicates the resource relative path. 3927 * @returns { Promise<void> } The result close raw file resource descriptor corresponding to the specified resource path. 3928 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 3929 * @throws { BusinessError } 9001005 - Invalid relative path. 3930 * @syscap SystemCapability.Global.ResourceManager 3931 * @crossplatform 3932 * @atomicservice 3933 * @since arkts {'1.1':'11', '1.2':'20'} 3934 * @arkts 1.1&1.2 3935 */ 3936 closeRawFd(path: string): Promise<void>; 3937 3938 /** 3939 * Obtains the DrawableDescriptor of the media file corresponding to a specified resource ID. 3940 * 3941 * @param { number } resId - Indicates the resource ID. 3942 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 3943 * to use the density of current system dpi. 3944 * @returns { DrawableDescriptor } The DrawableDescriptor class to get drawable image. 3945 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 3946 * @throws { BusinessError } 9001001 - Invalid resource ID. 3947 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3948 * @syscap SystemCapability.Global.ResourceManager 3949 * @since 10 3950 */ 3951 /** 3952 * Obtains the DrawableDescriptor of the media file corresponding to a specified resource ID. 3953 * 3954 * @param { number } resId - Indicates the resource ID. 3955 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 3956 * to use the density of current system dpi. 3957 * @param { number } [type] - The optional parameter means the media type, the default value 0 means 3958 * the normal media. 3959 * @returns { DrawableDescriptor } The DrawableDescriptor class to get drawable image. 3960 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 3961 * @throws { BusinessError } 9001001 - Invalid resource ID. 3962 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3963 * @syscap SystemCapability.Global.ResourceManager 3964 * @atomicservice 3965 * @since 11 3966 */ 3967 /** 3968 * Obtains the DrawableDescriptor of the media file corresponding to a specified resource ID. 3969 * 3970 * @param { number } resId - Indicates the resource ID. 3971 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 3972 * to use the density of current system dpi. 3973 * @param { number } [type] - The optional parameter means the media type, the default value 0 means 3974 * the normal media. 3975 * @returns { DrawableDescriptor } The DrawableDescriptor class to get drawable image. 3976 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 3977 * @throws { BusinessError } 9001001 - Invalid resource ID. 3978 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 3979 * @syscap SystemCapability.Global.ResourceManager 3980 * @crossplatform 3981 * @atomicservice 3982 * @since 12 3983 */ 3984 getDrawableDescriptor(resId: number, density?: number, type?: number): DrawableDescriptor; 3985 3986 /** 3987 * Obtains the DrawableDescriptor of the media file corresponding to a specified resource Name. 3988 * 3989 * @param { string } resName - Indicates the resource name. 3990 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 3991 * to use the density of current system dpi. 3992 * @returns { DrawableDescriptor } The DrawableDescriptor class to get drawable image. 3993 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 3994 * @throws { BusinessError } 9001003 - Invalid resource name. 3995 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 3996 * @syscap SystemCapability.Global.ResourceManager 3997 * @since 10 3998 */ 3999 /** 4000 * Obtains the DrawableDescriptor of the media file corresponding to a specified resource Name. 4001 * 4002 * @param { string } resName - Indicates the resource name. 4003 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4004 * to use the density of current system dpi. 4005 * @param { number } [type] - The optional parameter means the media type, the default value 0 means 4006 * the normal media. 4007 * @returns { DrawableDescriptor } The DrawableDescriptor class to get drawable image. 4008 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4009 * @throws { BusinessError } 9001003 - Invalid resource name. 4010 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4011 * @syscap SystemCapability.Global.ResourceManager 4012 * @atomicservice 4013 * @since 11 4014 */ 4015 /** 4016 * Obtains the DrawableDescriptor of the media file corresponding to a specified resource Name. 4017 * 4018 * @param { string } resName - Indicates the resource name. 4019 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4020 * to use the density of current system dpi. 4021 * @param { number } [type] - The optional parameter means the media type, the default value 0 means 4022 * the normal media. 4023 * @returns { DrawableDescriptor } The DrawableDescriptor class to get drawable image. 4024 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4025 * @throws { BusinessError } 9001003 - Invalid resource name. 4026 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4027 * @syscap SystemCapability.Global.ResourceManager 4028 * @crossplatform 4029 * @atomicservice 4030 * @since 12 4031 */ 4032 getDrawableDescriptorByName(resName: string, density?: number, type?: number): DrawableDescriptor; 4033 4034 /** 4035 * Obtains the DrawableDescriptor of the media file corresponding to a specified resource. 4036 * 4037 * @param { Resource } resource - Indicates the resource object. 4038 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4039 * to use the density of current system dpi. 4040 * @returns { DrawableDescriptor } The DrawableDescriptor class to get drawable image. 4041 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4042 * @throws { BusinessError } 9001001 - Invalid resource ID. 4043 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4044 * @syscap SystemCapability.Global.ResourceManager 4045 * @stagemodelonly 4046 * @since 10 4047 */ 4048 /** 4049 * Obtains the DrawableDescriptor of the media file corresponding to a specified resource. 4050 * 4051 * @param { Resource } resource - Indicates the resource object. 4052 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4053 * to use the density of current system dpi. 4054 * @param { number } [type] - The optional parameter means the media type, the default value 0 means 4055 * the normal media. 4056 * @returns { DrawableDescriptor } The DrawableDescriptor class to get drawable image. 4057 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4058 * @throws { BusinessError } 9001001 - Invalid resource ID. 4059 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4060 * @syscap SystemCapability.Global.ResourceManager 4061 * @stagemodelonly 4062 * @atomicservice 4063 * @since 11 4064 */ 4065 /** 4066 * Obtains the DrawableDescriptor of the media file corresponding to a specified resource. 4067 * 4068 * @param { Resource } resource - Indicates the resource object. 4069 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4070 * to use the density of current system dpi. 4071 * @param { number } [type] - The optional parameter means the media type, the default value 0 means 4072 * the normal media. 4073 * @returns { DrawableDescriptor } The DrawableDescriptor class to get drawable image. 4074 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4075 * @throws { BusinessError } 9001001 - Invalid resource ID. 4076 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4077 * @syscap SystemCapability.Global.ResourceManager 4078 * @stagemodelonly 4079 * @crossplatform 4080 * @atomicservice 4081 * @since 12 4082 * @deprecated since 20 4083 * @useinstead ohos.resourceManager.getDrawableDescriptor 4084 */ 4085 getDrawableDescriptor(resource: Resource, density?: number, type?: number): DrawableDescriptor; 4086 4087 /** 4088 * Obtains the rawfile resource list corresponding to the specified resource path in callback mode. 4089 * 4090 * @param { string } path - Indicates the resource relative path. 4091 * @param { _AsyncCallback<Array<string>> } callback - Indicates the asynchronous callback used to return the raw file list. 4092 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4093 * @throws { BusinessError } 9001005 - Invalid relative path. 4094 * @syscap SystemCapability.Global.ResourceManager 4095 * @since 10 4096 */ 4097 /** 4098 * Obtains the rawfile resource list corresponding to the specified resource path in callback mode. 4099 * 4100 * @param { string } path - Indicates the resource relative path. 4101 * @param { _AsyncCallback<Array<string>> } callback - Indicates the asynchronous callback used to return the raw file list. 4102 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4103 * @throws { BusinessError } 9001005 - Invalid relative path. 4104 * @syscap SystemCapability.Global.ResourceManager 4105 * @crossplatform 4106 * @atomicservice 4107 * @since arkts {'1.1':'11', '1.2':'20'} 4108 * @arkts 1.1&1.2 4109 */ 4110 getRawFileList(path: string, callback: _AsyncCallback<Array<string>>): void; 4111 4112 /** 4113 * Obtains the rawfile resource list corresponding to the specified resource path in Promise mode. 4114 * 4115 * @param { string } path - Indicates the resource relative path. 4116 * @returns { Promise<Array<string>> } The rawfile list corresponding to the specified resource path. 4117 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4118 * @throws { BusinessError } 9001005 - Invalid relative path. 4119 * @syscap SystemCapability.Global.ResourceManager 4120 * @since 10 4121 */ 4122 /** 4123 * Obtains the rawfile resource list corresponding to the specified resource path in Promise mode. 4124 * 4125 * @param { string } path - Indicates the resource relative path. 4126 * @returns { Promise<Array<string>> } The rawfile list corresponding to the specified resource path. 4127 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4128 * @throws { BusinessError } 9001005 - Invalid relative path. 4129 * @syscap SystemCapability.Global.ResourceManager 4130 * @crossplatform 4131 * @atomicservice 4132 * @since arkts {'1.1':'11', '1.2':'20'} 4133 * @arkts 1.1&1.2 4134 */ 4135 getRawFileList(path: string): Promise<Array<string>>; 4136 4137 /** 4138 * Obtains the color resource corresponding to the specified resource ID in callback mode. 4139 * 4140 * @param { number } resId - Indicates the resource ID. 4141 * @param { _AsyncCallback<number> } callback - Indicates the asynchronous callback used to 4142 * return the integer reference value representing the color data. 4143 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4144 * @throws { BusinessError } 9001001 - Invalid resource ID. 4145 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4146 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4147 * @syscap SystemCapability.Global.ResourceManager 4148 * @since 10 4149 */ 4150 /** 4151 * Obtains the color resource corresponding to the specified resource ID in callback mode. 4152 * 4153 * @param { number } resId - Indicates the resource ID. 4154 * @param { _AsyncCallback<number> } callback - Indicates the asynchronous callback used to 4155 * return the integer reference value representing the color data. 4156 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4157 * @throws { BusinessError } 9001001 - Invalid resource ID. 4158 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4159 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4160 * @syscap SystemCapability.Global.ResourceManager 4161 * @crossplatform 4162 * @atomicservice 4163 * @since arkts {'1.1':'11', '1.2':'20'} 4164 * @arkts 1.1&1.2 4165 */ 4166 getColor(resId: number, callback: _AsyncCallback<number>): void; 4167 4168 /** 4169 * Obtains the color resource corresponding to the specified resource ID in promise mode. 4170 * 4171 * @param { number } resId - Indicates the resource ID. 4172 * @returns { Promise<number> } Indicates return the integer reference value representing the color data. 4173 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4174 * @throws { BusinessError } 9001001 - Invalid resource ID. 4175 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4176 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4177 * @syscap SystemCapability.Global.ResourceManager 4178 * @since 10 4179 */ 4180 /** 4181 * Obtains the color resource corresponding to the specified resource ID in promise mode. 4182 * 4183 * @param { number } resId - Indicates the resource ID. 4184 * @returns { Promise<number> } Indicates return the integer reference value representing the color data. 4185 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4186 * @throws { BusinessError } 9001001 - Invalid resource ID. 4187 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4188 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4189 * @syscap SystemCapability.Global.ResourceManager 4190 * @crossplatform 4191 * @atomicservice 4192 * @since arkts {'1.1':'11', '1.2':'20'} 4193 * @arkts 1.1&1.2 4194 */ 4195 getColor(resId: number): Promise<number>; 4196 4197 /** 4198 * Obtains the color resource corresponding to the specified resource object in callback mode. 4199 * 4200 * @param { Resource } resource - Indicates the resource object. 4201 * @param { _AsyncCallback<number> } callback - Indicates the asynchronous callback used to 4202 * return the integer reference value representing the color data. 4203 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4204 * @throws { BusinessError } 9001001 - Invalid resource ID. 4205 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4206 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4207 * @syscap SystemCapability.Global.ResourceManager 4208 * @stagemodelonly 4209 * @since 10 4210 */ 4211 /** 4212 * Obtains the color resource corresponding to the specified resource object in callback mode. 4213 * 4214 * @param { Resource } resource - Indicates the resource object. 4215 * @param { _AsyncCallback<number> } callback - Indicates the asynchronous callback used to 4216 * return the integer reference value representing the color data. 4217 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4218 * @throws { BusinessError } 9001001 - Invalid resource ID. 4219 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4220 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4221 * @syscap SystemCapability.Global.ResourceManager 4222 * @stagemodelonly 4223 * @crossplatform 4224 * @atomicservice 4225 * @since 11 4226 * @deprecated since 20 4227 * @useinstead ohos.resourceManager.getColor 4228 */ 4229 getColor(resource: Resource, callback: _AsyncCallback<number>): void; 4230 4231 /** 4232 * Obtains the color resource corresponding to the specified resource object in promise mode. 4233 * 4234 * @param { Resource } resource - Indicates the resource object. 4235 * @returns { Promise<number> } Indicates return the integer reference value representing the color data. 4236 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4237 * @throws { BusinessError } 9001001 - Invalid resource ID. 4238 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4239 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4240 * @syscap SystemCapability.Global.ResourceManager 4241 * @stagemodelonly 4242 * @since 10 4243 */ 4244 /** 4245 * Obtains the color resource corresponding to the specified resource object in promise mode. 4246 * 4247 * @param { Resource } resource - Indicates the resource object. 4248 * @returns { Promise<number> } Indicates return the integer reference value representing the color data. 4249 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4250 * @throws { BusinessError } 9001001 - Invalid resource ID. 4251 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4252 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4253 * @syscap SystemCapability.Global.ResourceManager 4254 * @stagemodelonly 4255 * @crossplatform 4256 * @atomicservice 4257 * @since 11 4258 * @deprecated since 20 4259 * @useinstead ohos.resourceManager.getColor 4260 */ 4261 getColor(resource: Resource): Promise<number>; 4262 4263 /** 4264 * Obtains the color resource corresponding to the specified resource object in callback mode. 4265 * 4266 * @param { string } resName - Indicates the resource name. 4267 * @param { _AsyncCallback<number> } callback - Indicates the asynchronous callback used to 4268 * return the integer reference value representing the color data. 4269 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4270 * @throws { BusinessError } 9001003 - Invalid resource name. 4271 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4272 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4273 * @syscap SystemCapability.Global.ResourceManager 4274 * @since 10 4275 */ 4276 /** 4277 * Obtains the color resource corresponding to the specified resource object in callback mode. 4278 * 4279 * @param { string } resName - Indicates the resource name. 4280 * @param { _AsyncCallback<number> } callback - Indicates the asynchronous callback used to 4281 * return the integer reference value representing the color data. 4282 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4283 * @throws { BusinessError } 9001003 - Invalid resource name. 4284 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4285 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4286 * @syscap SystemCapability.Global.ResourceManager 4287 * @crossplatform 4288 * @atomicservice 4289 * @since arkts {'1.1':'11', '1.2':'20'} 4290 * @arkts 1.1&1.2 4291 */ 4292 getColorByName(resName: string, callback: _AsyncCallback<number>): void; 4293 4294 /** 4295 * Obtains the color resource corresponding to the specified resource object in promise mode. 4296 * 4297 * @param { string } resName - Indicates the resource name. 4298 * @returns { Promise<number> } Indicates return the integer reference value representing the color data. 4299 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4300 * @throws { BusinessError } 9001003 - Invalid resource name. 4301 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4302 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4303 * @syscap SystemCapability.Global.ResourceManager 4304 * @since 10 4305 */ 4306 /** 4307 * Obtains the color resource corresponding to the specified resource object in promise mode. 4308 * 4309 * @param { string } resName - Indicates the resource name. 4310 * @returns { Promise<number> } Indicates return the integer reference value representing the color data. 4311 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4312 * @throws { BusinessError } 9001003 - Invalid resource name. 4313 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4314 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4315 * @syscap SystemCapability.Global.ResourceManager 4316 * @crossplatform 4317 * @atomicservice 4318 * @since arkts {'1.1':'11', '1.2':'20'} 4319 * @arkts 1.1&1.2 4320 */ 4321 getColorByName(resName: string): Promise<number>; 4322 4323 /** 4324 * Obtains the color resource corresponding to the specified resource ID. 4325 * 4326 * @param { number } resId - Indicates the resource ID. 4327 * @returns { number } Indicates the integer reference value representing the color data. 4328 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4329 * @throws { BusinessError } 9001001 - Invalid resource ID. 4330 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4331 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4332 * @syscap SystemCapability.Global.ResourceManager 4333 * @since 10 4334 */ 4335 /** 4336 * Obtains the color resource corresponding to the specified resource ID. 4337 * 4338 * @param { number } resId - Indicates the resource ID. 4339 * @returns { number } Indicates the integer reference value representing the color data. 4340 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4341 * @throws { BusinessError } 9001001 - Invalid resource ID. 4342 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4343 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4344 * @syscap SystemCapability.Global.ResourceManager 4345 * @crossplatform 4346 * @atomicservice 4347 * @since arkts {'1.1':'11', '1.2':'20'} 4348 * @arkts 1.1&1.2 4349 */ 4350 getColorSync(resId: number) : number; 4351 4352 /** 4353 * Obtains the color resource corresponding to the specified resource object. 4354 * 4355 * @param { Resource } resource - Indicates the resource object. 4356 * @returns { number } Indicates the integer reference value representing the color data. 4357 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4358 * @throws { BusinessError } 9001001 - Invalid resource ID. 4359 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4360 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4361 * @syscap SystemCapability.Global.ResourceManager 4362 * @stagemodelonly 4363 * @since 10 4364 */ 4365 /** 4366 * Obtains the color resource corresponding to the specified resource object. 4367 * 4368 * @param { Resource } resource - Indicates the resource object. 4369 * @returns { number } Indicates the integer reference value representing the color data. 4370 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4371 * @throws { BusinessError } 9001001 - Invalid resource ID. 4372 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4373 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4374 * @syscap SystemCapability.Global.ResourceManager 4375 * @stagemodelonly 4376 * @crossplatform 4377 * @atomicservice 4378 * @since 11 4379 * @deprecated since 20 4380 * @useinstead ohos.resourceManager.getColorSync 4381 */ 4382 getColorSync(resource: Resource) : number; 4383 4384 /** 4385 * Obtains the color resource corresponding to the specified resource name. 4386 * 4387 * @param { string } resName - Indicates the resource name. 4388 * @returns { number } Indicates the integer reference value representing the color data. 4389 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4390 * @throws { BusinessError } 9001003 - Invalid resource name. 4391 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4392 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4393 * @syscap SystemCapability.Global.ResourceManager 4394 * @since 10 4395 */ 4396 /** 4397 * Obtains the color resource corresponding to the specified resource name. 4398 * 4399 * @param { string } resName - Indicates the resource name. 4400 * @returns { number } Indicates the integer reference value representing the color data. 4401 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4402 * @throws { BusinessError } 9001003 - Invalid resource name. 4403 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4404 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4405 * @syscap SystemCapability.Global.ResourceManager 4406 * @crossplatform 4407 * @atomicservice 4408 * @since arkts {'1.1':'11', '1.2':'20'} 4409 * @arkts 1.1&1.2 4410 */ 4411 getColorByNameSync(resName: string) : number; 4412 4413 /** 4414 * Add overlay resources during application runtime. 4415 * 4416 * @param { string } path - Indicates the application overlay path. 4417 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4418 * @throws { BusinessError } 9001010 - Invalid overlay path. 4419 * @syscap SystemCapability.Global.ResourceManager 4420 * @since 10 4421 */ 4422 /** 4423 * Add overlay resources during application runtime. 4424 * 4425 * @param { string } path - Indicates the application overlay path. 4426 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4427 * @throws { BusinessError } 9001010 - Invalid overlay path. 4428 * @syscap SystemCapability.Global.ResourceManager 4429 * @crossplatform 4430 * @atomicservice 4431 * @since arkts {'1.1':'11', '1.2':'20'} 4432 * @arkts 1.1&1.2 4433 */ 4434 addResource(path: string) : void; 4435 4436 /** 4437 * Remove overlay resources during application runtime. 4438 * 4439 * @param { string } path - Indicates the application overlay path. 4440 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4441 * @throws { BusinessError } 9001010 - Invalid overlay path. 4442 * @syscap SystemCapability.Global.ResourceManager 4443 * @since 10 4444 */ 4445 /** 4446 * Remove overlay resources during application runtime. 4447 * 4448 * @param { string } path - Indicates the application overlay path. 4449 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4450 * @throws { BusinessError } 9001010 - Invalid overlay path. 4451 * @syscap SystemCapability.Global.ResourceManager 4452 * @crossplatform 4453 * @atomicservice 4454 * @since arkts {'1.1':'11', '1.2':'20'} 4455 * @arkts 1.1&1.2 4456 */ 4457 removeResource(path: string) : void; 4458 4459 /** 4460 * Obtains the raw file resource descriptor corresponding to the specified resource path. 4461 * 4462 * @param { string } path - Indicates the resource relative path. 4463 * @returns { RawFileDescriptor } The raw file resource descriptor. 4464 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4465 * @throws { BusinessError } 9001005 - Invalid relative path. 4466 * @syscap SystemCapability.Global.ResourceManager 4467 * @since 10 4468 */ 4469 /** 4470 * Obtains the raw file resource descriptor corresponding to the specified resource path. 4471 * 4472 * @param { string } path - Indicates the resource relative path. 4473 * @returns { RawFileDescriptor } The raw file resource descriptor. 4474 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4475 * @throws { BusinessError } 9001005 - Invalid relative path. 4476 * @syscap SystemCapability.Global.ResourceManager 4477 * @crossplatform 4478 * @atomicservice 4479 * @since arkts {'1.1':'11', '1.2':'20'} 4480 * @arkts 1.1&1.2 4481 */ 4482 getRawFdSync(path: string): RawFileDescriptor; 4483 4484 /** 4485 * Close the raw file resource descriptor corresponding to the specified resource path. 4486 * 4487 * @param { string } path - Indicates the resource relative path. 4488 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4489 * @throws { BusinessError } 9001005 - Invalid relative path. 4490 * @syscap SystemCapability.Global.ResourceManager 4491 * @since 10 4492 */ 4493 /** 4494 * Close the raw file resource descriptor corresponding to the specified resource path. 4495 * 4496 * @param { string } path - Indicates the resource relative path. 4497 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4498 * @throws { BusinessError } 9001005 - Invalid relative path. 4499 * @syscap SystemCapability.Global.ResourceManager 4500 * @crossplatform 4501 * @atomicservice 4502 * @since arkts {'1.1':'11', '1.2':'20'} 4503 * @arkts 1.1&1.2 4504 */ 4505 closeRawFdSync(path: string): void; 4506 4507 /** 4508 * Obtains the rawfile resource list corresponding to the specified resource path. 4509 * 4510 * @param { string } path - Indicates the resource relative path. 4511 * @returns { Array<string> } The rawfile resource list. 4512 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4513 * @throws { BusinessError } 9001005 - Invalid relative path. 4514 * @syscap SystemCapability.Global.ResourceManager 4515 * @since 10 4516 */ 4517 /** 4518 * Obtains the rawfile resource list corresponding to the specified resource path. 4519 * 4520 * @param { string } path - Indicates the resource relative path. 4521 * @returns { Array<string> } The rawfile resource list. 4522 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4523 * @throws { BusinessError } 9001005 - Invalid relative path. 4524 * @syscap SystemCapability.Global.ResourceManager 4525 * @crossplatform 4526 * @atomicservice 4527 * @since arkts {'1.1':'11', '1.2':'20'} 4528 * @arkts 1.1&1.2 4529 */ 4530 getRawFileListSync(path: string): Array<string>; 4531 4532 /** 4533 * Obtains the raw file resource corresponding to the specified resource path. 4534 * 4535 * @param { string } path - Indicates the resource relative path. 4536 * @returns { Uint8Array } the raw file resource corresponding to the specified resource path. 4537 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4538 * @throws { BusinessError } 9001005 - Invalid relative path. 4539 * @syscap SystemCapability.Global.ResourceManager 4540 * @since 10 4541 */ 4542 /** 4543 * Obtains the raw file resource corresponding to the specified resource path. 4544 * 4545 * @param { string } path - Indicates the resource relative path. 4546 * @returns { Uint8Array } the raw file resource corresponding to the specified resource path. 4547 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4548 * @throws { BusinessError } 9001005 - Invalid relative path. 4549 * @syscap SystemCapability.Global.ResourceManager 4550 * @crossplatform 4551 * @atomicservice 4552 * @since arkts {'1.1':'11', '1.2':'20'} 4553 * @arkts 1.1&1.2 4554 */ 4555 getRawFileContentSync(path: string): Uint8Array; 4556 4557 /** 4558 * Obtains the content of the specified screen density media file corresponding to a specified resource ID. 4559 * 4560 * @param { number } resId - Indicates the resource ID. 4561 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4562 * to use the density of current system dpi. 4563 * @returns { Uint8Array } Indicates the obtained media file content. 4564 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4565 * @throws { BusinessError } 9001001 - Invalid resource ID. 4566 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4567 * @syscap SystemCapability.Global.ResourceManager 4568 * @since 10 4569 */ 4570 /** 4571 * Obtains the content of the specified screen density media file corresponding to a specified resource ID. 4572 * 4573 * @param { number } resId - Indicates the resource ID. 4574 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4575 * to use the density of current system dpi. 4576 * @returns { Uint8Array } Indicates the obtained media file content. 4577 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4578 * @throws { BusinessError } 9001001 - Invalid resource ID. 4579 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4580 * @syscap SystemCapability.Global.ResourceManager 4581 * @crossplatform 4582 * @atomicservice 4583 * @since arkts {'1.1':'11', '1.2':'20'} 4584 * @arkts 1.1&1.2 4585 */ 4586 getMediaContentSync(resId: number, density?: number): Uint8Array; 4587 4588 /** 4589 * Obtains the content of the specified screen density media file corresponding to a specified resource object. 4590 * 4591 * @param { Resource } resource - Indicates the resource object. 4592 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4593 * to use the density of current system dpi. 4594 * @returns { Uint8Array } Indicates the obtained media file content. 4595 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4596 * @throws { BusinessError } 9001001 - Invalid resource ID. 4597 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4598 * @syscap SystemCapability.Global.ResourceManager 4599 * @stagemodelonly 4600 * @since 10 4601 */ 4602 /** 4603 * Obtains the content of the specified screen density media file corresponding to a specified resource object. 4604 * 4605 * @param { Resource } resource - Indicates the resource object. 4606 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4607 * to use the density of current system dpi. 4608 * @returns { Uint8Array } Indicates the obtained media file content. 4609 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4610 * @throws { BusinessError } 9001001 - Invalid resource ID. 4611 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4612 * @syscap SystemCapability.Global.ResourceManager 4613 * @stagemodelonly 4614 * @crossplatform 4615 * @atomicservice 4616 * @since 11 4617 * @deprecated since 20 4618 * @useinstead ohos.resourceManager.getMediaContentSync 4619 */ 4620 getMediaContentSync(resource: Resource, density?: number): Uint8Array; 4621 4622 /** 4623 * Obtains the Base64 code of the specified screen density media file corresponding to the specified resource ID. 4624 * 4625 * @param { number } resId - Indicates the resource ID. 4626 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4627 * to use the density of current system dpi. 4628 * @returns { string } Indicates the obtained Base64 code of the media file. 4629 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4630 * @throws { BusinessError } 9001001 - Invalid resource ID. 4631 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4632 * @syscap SystemCapability.Global.ResourceManager 4633 * @since 10 4634 */ 4635 /** 4636 * Obtains the Base64 code of the specified screen density media file corresponding to the specified resource ID. 4637 * 4638 * @param { number } resId - Indicates the resource ID. 4639 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4640 * to use the density of current system dpi. 4641 * @returns { string } Indicates the obtained Base64 code of the media file. 4642 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4643 * @throws { BusinessError } 9001001 - Invalid resource ID. 4644 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4645 * @syscap SystemCapability.Global.ResourceManager 4646 * @crossplatform 4647 * @atomicservice 4648 * @since arkts {'1.1':'11', '1.2':'20'} 4649 * @arkts 1.1&1.2 4650 */ 4651 getMediaContentBase64Sync(resId: number, density?: number): string; 4652 4653 /** 4654 * Obtains the content of the specified screen density media file corresponding to the specified resource object. 4655 * 4656 * @param { Resource } resource - Indicates the resource object. 4657 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4658 * to use the density of current system dpi. 4659 * @returns { string } Indicates the obtained Base64 code of the media file. 4660 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4661 * @throws { BusinessError } 9001001 - Invalid resource ID. 4662 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4663 * @syscap SystemCapability.Global.ResourceManager 4664 * @stagemodelonly 4665 * @since 10 4666 */ 4667 /** 4668 * Obtains the content of the specified screen density media file corresponding to the specified resource object. 4669 * 4670 * @param { Resource } resource - Indicates the resource object. 4671 * @param { number } [density] - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4672 * to use the density of current system dpi. 4673 * @returns { string } Indicates the obtained Base64 code of the media file. 4674 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4675 * @throws { BusinessError } 9001001 - Invalid resource ID. 4676 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4677 * @syscap SystemCapability.Global.ResourceManager 4678 * @stagemodelonly 4679 * @crossplatform 4680 * @atomicservice 4681 * @since 11 4682 * @deprecated since 20 4683 * @useinstead ohos.resourceManager.getMediaContentBase64Sync 4684 */ 4685 getMediaContentBase64Sync(resource: Resource, density?: number): string; 4686 4687 /** 4688 * Obtains the singular-plural character string represented by the ID string corresponding to 4689 * the specified number. 4690 * 4691 * @param { number } resId - Indicates the resource ID. 4692 * @param { number } num - Indicates the number. 4693 * @returns { string } The singular-plural character string represented by the ID string 4694 * corresponding to the specified number. 4695 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4696 * @throws { BusinessError } 9001001 - Invalid resource ID. 4697 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4698 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4699 * @syscap SystemCapability.Global.ResourceManager 4700 * @since 10 4701 */ 4702 /** 4703 * Obtains the singular-plural character string represented by the ID string corresponding to 4704 * the specified number. 4705 * 4706 * @param { number } resId - Indicates the resource ID. 4707 * @param { number } num - Indicates the number. 4708 * @returns { string } The singular-plural character string represented by the ID string 4709 * corresponding to the specified number. 4710 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4711 * @throws { BusinessError } 9001001 - Invalid resource ID. 4712 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4713 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4714 * @syscap SystemCapability.Global.ResourceManager 4715 * @crossplatform 4716 * @atomicservice 4717 * @since 11 4718 * @deprecated since 18 4719 * @useinstead ohos.resourceManager.getIntPluralStringValueSync 4720 */ 4721 getPluralStringValueSync(resId: number, num: number): string; 4722 4723 /** 4724 * Obtains the singular-plural character string represented by the resource object string corresponding to the 4725 * specified number. 4726 * 4727 * @param { Resource } resource - Indicates the resource object. 4728 * @param { number } num - Indicates the number. 4729 * @returns { string } The singular-plural character string represented by the ID string 4730 * corresponding to the specified number. 4731 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4732 * @throws { BusinessError } 9001001 - Invalid resource ID. 4733 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4734 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4735 * @syscap SystemCapability.Global.ResourceManager 4736 * @stagemodelonly 4737 * @since 10 4738 */ 4739 /** 4740 * Obtains the singular-plural character string represented by the resource object string corresponding to the 4741 * specified number. 4742 * 4743 * @param { Resource } resource - Indicates the resource object. 4744 * @param { number } num - Indicates the number. 4745 * @returns { string } The singular-plural character string represented by the ID string 4746 * corresponding to the specified number. 4747 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4748 * @throws { BusinessError } 9001001 - Invalid resource ID. 4749 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4750 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4751 * @syscap SystemCapability.Global.ResourceManager 4752 * @stagemodelonly 4753 * @crossplatform 4754 * @atomicservice 4755 * @since 11 4756 * @deprecated since 18 4757 * @useinstead ohos.resourceManager.getIntPluralStringValueSync 4758 */ 4759 getPluralStringValueSync(resource: Resource, num: number): string; 4760 4761 /** 4762 * Obtains the array of character strings corresponding to a specified resource ID. 4763 * 4764 * @param { number } resId - Indicates the resource ID. 4765 * @returns { Array<string> } The array of character strings corresponding to the specified resource ID. 4766 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4767 * @throws { BusinessError } 9001001 - Invalid resource ID. 4768 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4769 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4770 * @syscap SystemCapability.Global.ResourceManager 4771 * @since 10 4772 */ 4773 /** 4774 * Obtains the array of character strings corresponding to a specified resource ID. 4775 * 4776 * @param { number } resId - Indicates the resource ID. 4777 * @returns { Array<string> } The array of character strings corresponding to the specified resource ID. 4778 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4779 * @throws { BusinessError } 9001001 - Invalid resource ID. 4780 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4781 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4782 * @syscap SystemCapability.Global.ResourceManager 4783 * @crossplatform 4784 * @atomicservice 4785 * @since arkts {'1.1':'11', '1.2':'20'} 4786 * @arkts 1.1&1.2 4787 */ 4788 getStringArrayValueSync(resId: number): Array<string>; 4789 4790 /** 4791 * Obtains the array of character strings corresponding to a specified resource object. 4792 * 4793 * @param { Resource } resource - Indicates the resource object. 4794 * @returns { Array<string> } The array of character strings corresponding to the specified resource object. 4795 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4796 * @throws { BusinessError } 9001001 - Invalid resource ID. 4797 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4798 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4799 * @syscap SystemCapability.Global.ResourceManager 4800 * @stagemodelonly 4801 * @since 10 4802 */ 4803 /** 4804 * Obtains the array of character strings corresponding to a specified resource object. 4805 * 4806 * @param { Resource } resource - Indicates the resource object. 4807 * @returns { Array<string> } The array of character strings corresponding to the specified resource object. 4808 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4809 * @throws { BusinessError } 9001001 - Invalid resource ID. 4810 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 4811 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4812 * @syscap SystemCapability.Global.ResourceManager 4813 * @stagemodelonly 4814 * @crossplatform 4815 * @atomicservice 4816 * @since 11 4817 * @deprecated since 20 4818 * @useinstead ohos.resourceManager.getStringArrayValueSync 4819 */ 4820 getStringArrayValueSync(resource: Resource): Array<string>; 4821 4822 /** 4823 * Obtains the singular-plural character string represented by the name string corresponding to 4824 * the specified number. 4825 * 4826 * @param { string } resName - Indicates the resource name. 4827 * @param { number } num - Indicates the number. 4828 * @returns { string } The singular-plural character string represented by the name string 4829 * corresponding to the specified number. 4830 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4831 * @throws { BusinessError } 9001003 - Invalid resource name. 4832 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4833 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4834 * @syscap SystemCapability.Global.ResourceManager 4835 * @since 10 4836 */ 4837 /** 4838 * Obtains the singular-plural character string represented by the name string corresponding to 4839 * the specified number. 4840 * 4841 * @param { string } resName - Indicates the resource name. 4842 * @param { number } num - Indicates the number. 4843 * @returns { string } The singular-plural character string represented by the name string 4844 * corresponding to the specified number. 4845 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4846 * @throws { BusinessError } 9001003 - Invalid resource name. 4847 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4848 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4849 * @syscap SystemCapability.Global.ResourceManager 4850 * @crossplatform 4851 * @atomicservice 4852 * @since 11 4853 * @deprecated since 18 4854 * @useinstead ohos.resourceManager.getIntPluralStringByNameSync 4855 */ 4856 getPluralStringByNameSync(resName: string, num: number): string; 4857 4858 /** 4859 * Obtains the content of the specified screen density media file corresponding to a specified resource name. 4860 * 4861 * @param { string } resName - Indicates the resource name. 4862 * @param { number } [density] - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4863 * to use the density of current system dpi. 4864 * @returns { Uint8Array } The obtained specified screen density media file content. 4865 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4866 * @throws { BusinessError } 9001003 - Invalid resource name. 4867 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4868 * @syscap SystemCapability.Global.ResourceManager 4869 * @since 10 4870 */ 4871 /** 4872 * Obtains the content of the specified screen density media file corresponding to a specified resource name. 4873 * 4874 * @param { string } resName - Indicates the resource name. 4875 * @param { number } [density] - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4876 * to use the density of current system dpi. 4877 * @returns { Uint8Array } The obtained specified screen density media file content. 4878 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4879 * @throws { BusinessError } 9001003 - Invalid resource name. 4880 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4881 * @syscap SystemCapability.Global.ResourceManager 4882 * @crossplatform 4883 * @atomicservice 4884 * @since arkts {'1.1':'11', '1.2':'20'} 4885 * @arkts 1.1&1.2 4886 */ 4887 getMediaByNameSync(resName: string, density?: number): Uint8Array; 4888 4889 /** 4890 * Obtains the Base64 code of the specified screen density media file corresponding to the specified resource name. 4891 * 4892 * @param { string } resName - Indicates the resource name. 4893 * @param { number } [density] - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4894 * to use the density of current system dpi. 4895 * @returns { string } The obtained Base64 code of the specified screen density media file. 4896 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4897 * @throws { BusinessError } 9001003 - Invalid resource name. 4898 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4899 * @syscap SystemCapability.Global.ResourceManager 4900 * @since 10 4901 */ 4902 /** 4903 * Obtains the Base64 code of the specified screen density media file corresponding to the specified resource name. 4904 * 4905 * @param { string } resName - Indicates the resource name. 4906 * @param { number } [density] - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means 4907 * to use the density of current system dpi. 4908 * @returns { string } The obtained Base64 code of the specified screen density media file. 4909 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: 1.Incorrect parameter types; 2.Parameter verification failed. 4910 * @throws { BusinessError } 9001003 - Invalid resource name. 4911 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4912 * @syscap SystemCapability.Global.ResourceManager 4913 * @crossplatform 4914 * @atomicservice 4915 * @since arkts {'1.1':'11', '1.2':'20'} 4916 * @arkts 1.1&1.2 4917 */ 4918 getMediaBase64ByNameSync(resName: string, density?: number): string; 4919 4920 /** 4921 * Obtains the array of character strings corresponding to a specified resource name. 4922 * 4923 * @param { string } resName - Indicates the resource name. 4924 * @returns { Array<string> } the array of character strings corresponding to the specified resource name. 4925 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4926 * @throws { BusinessError } 9001003 - Invalid resource name. 4927 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4928 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4929 * @syscap SystemCapability.Global.ResourceManager 4930 * @since 10 4931 */ 4932 /** 4933 * Obtains the array of character strings corresponding to a specified resource name. 4934 * 4935 * @param { string } resName - Indicates the resource name. 4936 * @returns { Array<string> } the array of character strings corresponding to the specified resource name. 4937 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4938 * @throws { BusinessError } 9001003 - Invalid resource name. 4939 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 4940 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 4941 * @syscap SystemCapability.Global.ResourceManager 4942 * @crossplatform 4943 * @atomicservice 4944 * @since arkts {'1.1':'11', '1.2':'20'} 4945 * @arkts 1.1&1.2 4946 */ 4947 getStringArrayByNameSync(resName: string): Array<string>; 4948 4949 /** 4950 * Obtains the device configuration. 4951 * 4952 * @returns { Configuration } the device configuration. 4953 * @syscap SystemCapability.Global.ResourceManager 4954 * @since 10 4955 */ 4956 /** 4957 * Obtains the device configuration. 4958 * 4959 * @returns { Configuration } the device configuration. 4960 * @syscap SystemCapability.Global.ResourceManager 4961 * @crossplatform 4962 * @atomicservice 4963 * @since arkts {'1.1':'11', '1.2':'20'} 4964 * @arkts 1.1&1.2 4965 */ 4966 getConfigurationSync(): Configuration; 4967 4968 /** 4969 * Obtains the device capability. 4970 * 4971 * @returns { DeviceCapability } the device capability. 4972 * @syscap SystemCapability.Global.ResourceManager 4973 * @since 10 4974 */ 4975 /** 4976 * Obtains the device capability. 4977 * 4978 * @returns { DeviceCapability } the device capability. 4979 * @syscap SystemCapability.Global.ResourceManager 4980 * @crossplatform 4981 * @atomicservice 4982 * @since arkts {'1.1':'11', '1.2':'20'} 4983 * @arkts 1.1&1.2 4984 */ 4985 getDeviceCapabilitySync(): DeviceCapability; 4986 4987 /** 4988 * Obtains locales list. 4989 * 4990 * @param { boolean } [includeSystem] - the parameter controls whether to include system resources, 4991 * the default value is false, it has no effect when only system resources query the locales list. 4992 * @returns { Array<string> } the list of strings for the locales. 4993 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 4994 * @syscap SystemCapability.Global.ResourceManager 4995 * @crossplatform 4996 * @atomicservice 4997 * @since arkts {'1.1':'11', '1.2':'20'} 4998 * @arkts 1.1&1.2 4999 */ 5000 getLocales(includeSystem?: boolean): Array<string>; 5001 5002 /** 5003 * Obtains the symbol resource corresponding to the specified resource ID. 5004 * 5005 * @param { number } resId - Indicates the resource ID. 5006 * @returns { number } Indicates the integer reference value representing the symbol data. 5007 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 5008 * @throws { BusinessError } 9001001 - Invalid resource ID. 5009 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 5010 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 5011 * @syscap SystemCapability.Global.ResourceManager 5012 * @crossplatform 5013 * @atomicservice 5014 * @since arkts {'1.1':'11', '1.2':'20'} 5015 * @arkts 1.1&1.2 5016 */ 5017 getSymbol(resId: number) : number; 5018 5019 /** 5020 * Obtains the symbol resource corresponding to the specified resource object. 5021 * 5022 * @param { Resource } resource - Indicates the resource object. 5023 * @returns { number } Indicates the integer reference value representing the symbol data. 5024 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 5025 * @throws { BusinessError } 9001001 - Invalid resource ID. 5026 * @throws { BusinessError } 9001002 - No matching resource is found based on the resource ID. 5027 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 5028 * @syscap SystemCapability.Global.ResourceManager 5029 * @stagemodelonly 5030 * @crossplatform 5031 * @atomicservice 5032 * @since 11 5033 * @deprecated since 20 5034 * @useinstead ohos.resourceManager.getSymbol 5035 */ 5036 getSymbol(resource: Resource) : number; 5037 5038 /** 5039 * Obtains the symbol resource corresponding to the specified resource name. 5040 * 5041 * @param { string } resName - Indicates the resource name. 5042 * @returns { number } Indicates the integer reference value representing the symbol data. 5043 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 5044 * @throws { BusinessError } 9001003 - Invalid resource name. 5045 * @throws { BusinessError } 9001004 - No matching resource is found based on the resource name. 5046 * @throws { BusinessError } 9001006 - The resource is referenced cyclically. 5047 * @syscap SystemCapability.Global.ResourceManager 5048 * @crossplatform 5049 * @atomicservice 5050 * @since arkts {'1.1':'11', '1.2':'20'} 5051 * @arkts 1.1&1.2 5052 */ 5053 getSymbolByName(resName: string) : number; 5054 5055 /** 5056 * Whether the rawfile resource is a directory or not. 5057 * 5058 * @param { string } path - Indicates the rawfile resource relative path. 5059 * @returns { boolean } True means the file path is directory, else false. 5060 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 5061 * @throws { BusinessError } 9001005 - Invalid relative path. 5062 * @syscap SystemCapability.Global.ResourceManager 5063 * @crossplatform 5064 * @atomicservice 5065 * @since arkts {'1.1':'12', '1.2':'20'} 5066 * @arkts 1.1&1.2 5067 */ 5068 isRawDir(path: string): boolean; 5069 5070 /** 5071 * Get the override ResourceManager object related to the specified Configuration. 5072 * 5073 * @param { Configuration } [configuration] - Indicates the override Configuration{@link Configuration} 5074 * @returns { ResourceManager } The ResourceManager object is returned. 5075 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 5076 * @syscap SystemCapability.Global.ResourceManager 5077 * @crossplatform 5078 * @atomicservice 5079 * @since arkts {'1.1':'12', '1.2':'20'} 5080 * @arkts 1.1&1.2 5081 */ 5082 getOverrideResourceManager(configuration?: Configuration): ResourceManager; 5083 5084 /** 5085 * Get the current override Configuration related to the specified override ResourceManager. 5086 * 5087 * @returns { Configuration } The Configuration object is returned. 5088 * @syscap SystemCapability.Global.ResourceManager 5089 * @crossplatform 5090 * @atomicservice 5091 * @since arkts {'1.1':'12', '1.2':'20'} 5092 * @arkts 1.1&1.2 5093 */ 5094 getOverrideConfiguration(): Configuration; 5095 5096 /** 5097 * Update the current override Configuration. 5098 * 5099 * @param { Configuration } configuration - Indicates the override Configuration{@link Configuration} 5100 * @throws { BusinessError } 401 - If the input parameter invalid. Possible causes: Incorrect parameter types. 5101 * @syscap SystemCapability.Global.ResourceManager 5102 * @crossplatform 5103 * @atomicservice 5104 * @since arkts {'1.1':'12', '1.2':'20'} 5105 * @arkts 1.1&1.2 5106 */ 5107 updateOverrideConfiguration(configuration: Configuration): void; 5108 } 5109 5110 /** 5111 * Contains rawFile descriptor information. 5112 * 5113 * @syscap SystemCapability.Global.ResourceManager 5114 * @since 9 5115 */ 5116 /** 5117 * Contains rawFile descriptor information. 5118 * 5119 * @syscap SystemCapability.Global.ResourceManager 5120 * @crossplatform 5121 * @since 10 5122 */ 5123 /** 5124 * Contains rawFile descriptor information. 5125 * 5126 * @typedef {_RawFileDescriptor} 5127 * @syscap SystemCapability.Global.ResourceManager 5128 * @crossplatform 5129 * @atomicservice 5130 * @since arkts {'1.1':'11', '1.2':'20'} 5131 * @arkts 1.1&1.2 5132 */ 5133 export type RawFileDescriptor = _RawFileDescriptor; 5134 5135 /** 5136 * Contains resource descriptor information. 5137 * 5138 * @syscap SystemCapability.Global.ResourceManager 5139 * @since 9 5140 */ 5141 /** 5142 * Contains resource descriptor information. 5143 * 5144 * @syscap SystemCapability.Global.ResourceManager 5145 * @crossplatform 5146 * @since 10 5147 */ 5148 /** 5149 * Contains resource descriptor information. 5150 * 5151 * @typedef {_Resource} 5152 * @syscap SystemCapability.Global.ResourceManager 5153 * @crossplatform 5154 * @atomicservice 5155 * @since arkts {'1.1':'11', '1.2':'20'} 5156 * @arkts 1.1&1.2 5157 */ 5158 export type Resource = _Resource; 5159} 5160export default resourceManager;