1/* 2 * Copyright (c) 2020-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @interface FileResponse 18 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 19 * @since 3 20 * @deprecated since 10 21 */ 22export interface FileResponse { 23 /** 24 * File URI. 25 * 26 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 27 * @since 3 28 * @deprecated since 10 29 */ 30 uri: string; 31 32 /** 33 * File size, in bytes. 34 * If type is dir, the length value is fixed to 0. 35 * 36 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 37 * @since 3 38 * @deprecated since 10 39 */ 40 length: number; 41 42 /** 43 * Timestamp when the file is stored, which is the number of milliseconds elapsed since 1970/01/01 00:00:00. 44 * For lite wearables, the value is fixed to 0, because this parameter is restricted by the underlying file system. 45 * 46 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 47 * @since 3 48 * @deprecated since 10 49 */ 50 lastModifiedTime: number; 51 52 /** 53 * File type. The values are as follows: 54 * dir: directory 55 * file: file 56 * 57 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 58 * @since 3 59 * @deprecated since 10 60 */ 61 type: 'dir' | 'file'; 62 63 /** 64 * File list. When the recursive value is true and the type is dir, the file information under the subdirectory will be returned. 65 * Otherwise, no value will be returned. 66 * 67 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 68 * @since 3 69 * @deprecated since 10 70 */ 71 subFiles?: Array<FileResponse>; 72} 73 74/** 75 * @interface FileMoveOption 76 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 77 * @since 3 78 * @deprecated since 10 79 */ 80export interface FileMoveOption { 81 /** 82 * URI of the file to move. 83 * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: 84 * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. 85 * 2. The maximum number of characters allowed is 128. 86 * 87 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 88 * @since 3 89 * @deprecated since 10 90 */ 91 srcUri: string; 92 93 /** 94 * URI of the file moved to the target location. 95 * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: 96 * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. 97 * 2. The maximum number of characters allowed is 128. 98 * 99 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 100 * @since 3 101 * @deprecated since 10 102 */ 103 dstUri: string; 104 105 /** 106 * Called when the source file is moved to the specified location successfully. 107 * This function returns the URI of the file moved to the target location. 108 * 109 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 110 * @since 3 111 * @deprecated since 10 112 */ 113 success?: (uri: string) => void; 114 115 /** 116 * Called when moving fails. 117 * 118 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 119 * @since 3 120 * @deprecated since 10 121 */ 122 fail?: (data: string, code: number) => void; 123 124 /** 125 * Called when the execution is completed. 126 * 127 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 128 * @since 3 129 * @deprecated since 10 130 */ 131 complete?: () => void; 132} 133 134/** 135 * @interface FileListResponse 136 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 137 * @since 3 138 * @deprecated since 10 139 */ 140export interface FileListResponse { 141 /** 142 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 143 * @since 3 144 * @deprecated since 10 145 */ 146 fileList: Array<FileResponse>; 147} 148 149/** 150 * @interface FileListOption 151 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 152 * @since 3 153 * @deprecated since 10 154 */ 155export interface FileListOption { 156 /** 157 * URI of the directory. 158 * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: 159 * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. 160 * 2. The maximum number of characters allowed is 128. 161 * 162 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 163 * @since 3 164 * @deprecated since 10 165 */ 166 uri: string; 167 168 /** 169 * Called when the list is obtained successfully. 170 * 171 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 172 * @since 3 173 * @deprecated since 10 174 */ 175 success?: (data: FileListResponse) => void; 176 177 /** 178 * Called when the list fails to be obtained. 179 * 180 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 181 * @since 3 182 * @deprecated since 10 183 */ 184 fail?: (data: string, code: number) => void; 185 186 /** 187 * Called when the execution is completed. 188 * 189 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 190 * @since 3 191 * @deprecated since 10 192 */ 193 complete?: () => void; 194} 195 196/** 197 * @interface FileCopyOption 198 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 199 * @since 3 200 * @deprecated since 10 201 */ 202export interface FileCopyOption { 203 /** 204 * URI of the file to copy. 205 * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: 206 * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. 207 * 2. The maximum number of characters allowed is 128. 208 * 209 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 210 * @since 3 211 * @deprecated since 10 212 */ 213 srcUri: string; 214 215 /** 216 * URI of the file moved to the target location. 217 * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: 218 * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. 219 * 2. The maximum number of characters allowed is 128. 220 * 221 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 222 * @since 3 223 * @deprecated since 10 224 */ 225 dstUri: string; 226 227 /** 228 * Called when the copy file is saved successful. 229 * This function returns the URI of the file saved to the target location. 230 * 231 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 232 * @since 3 233 * @deprecated since 10 234 */ 235 success?: (uri: string) => void; 236 237 /** 238 * Called when the copy or save operation fails. 239 * 240 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 241 * @since 3 242 * @deprecated since 10 243 */ 244 fail?: (data: string, code: number) => void; 245 246 /** 247 * Called when the execution is completed. 248 * 249 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 250 * @since 3 251 * @deprecated since 10 252 */ 253 complete?: () => void; 254} 255 256/** 257 * @interface FileGetOption 258 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 259 * @since 3 260 * @deprecated since 10 261 */ 262export interface FileGetOption { 263 /** 264 * File URI, which cannot be an application resource path. 265 * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: 266 * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. 267 * 2. The maximum number of characters allowed is 128. 268 * 269 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 270 * @since 3 271 * @deprecated since 10 272 */ 273 uri: string; 274 275 /** 276 * Whether to recursively obtain the file list under a subdirectory. 277 * The default value is false. 278 * 279 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 280 * @since 3 281 * @deprecated since 10 282 */ 283 recursive?: boolean; 284 285 /** 286 * Called when file information is obtained successfully. 287 * 288 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 289 * @since 3 290 * @deprecated since 10 291 */ 292 success?: (file: FileResponse) => void; 293 294 /** 295 * Called when file information fails to be obtained. 296 * 297 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 298 * @since 3 299 * @deprecated since 10 300 */ 301 fail?: (data: string, code: number) => void; 302 303 /** 304 * Called when the execution is completed. 305 * 306 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 307 * @since 3 308 * @deprecated since 10 309 */ 310 complete?: () => void; 311} 312 313/** 314 * @interface FileDeleteOption 315 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 316 * @since 3 317 * @deprecated since 10 318 */ 319export interface FileDeleteOption { 320 /** 321 * URI of the file to be deleted, which cannot be an application resource path. 322 * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: 323 * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. 324 * 2. The maximum number of characters allowed is 128. 325 * 326 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 327 * @since 3 328 * @deprecated since 10 329 */ 330 uri: string; 331 332 /** 333 * Called when local files are deleted successfully. 334 * 335 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 336 * @since 3 337 * @deprecated since 10 338 */ 339 success?: () => void; 340 341 /** 342 * Called when the deletion fails. 343 * 344 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 345 * @since 3 346 * @deprecated since 10 347 */ 348 fail?: (data: string, code: number) => void; 349 350 /** 351 * Called when the execution is completed. 352 * 353 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 354 * @since 3 355 * @deprecated since 10 356 */ 357 complete?: () => void; 358} 359 360/** 361 * @interface FileWriteTextOption 362 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 363 * @since 3 364 * @deprecated since 10 365 */ 366export interface FileWriteTextOption { 367 /** 368 * URI of a local file. If it does not exist, a file will be created. 369 * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: 370 * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. 371 * 2. The maximum number of characters allowed is 128. 372 * 373 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 374 * @since 3 375 * @deprecated since 10 376 */ 377 uri: string; 378 379 /** 380 * Character string to write into the local file. 381 * 382 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 383 * @since 3 384 * @deprecated since 10 385 */ 386 text: string; 387 388 /** 389 * Encoding format. The default format is UTF-8. 390 * 391 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 392 * @since 3 393 * @deprecated since 10 394 */ 395 encoding?: string; 396 397 /** 398 * Whether to enable the append mode. The default value is false. 399 * 400 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 401 * @since 3 402 * @deprecated since 10 403 */ 404 append?: boolean; 405 406 /** 407 * Called when texts are written into a file successfully. 408 * 409 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 410 * @since 3 411 * @deprecated since 10 412 */ 413 success?: () => void; 414 415 /** 416 * Called when texts fail to be written into a file. 417 * 418 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 419 * @since 3 420 * @deprecated since 10 421 */ 422 fail?: (data: string, code: number) => void; 423 424 /** 425 * Called when the execution is completed. 426 * 427 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 428 * @since 3 429 * @deprecated since 10 430 */ 431 complete?: () => void; 432} 433 434/** 435 * @interface FileReadTextResponse 436 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 437 * @since 3 438 * @deprecated since 10 439 */ 440export interface FileReadTextResponse { 441 /** 442 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 443 * @since 3 444 * @deprecated since 10 445 */ 446 text: string; 447} 448 449/** 450 * @interface FileReadTextOption 451 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 452 * @since 3 453 * @deprecated since 10 454 */ 455export interface FileReadTextOption { 456 /** 457 * URI of a local file. 458 * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: 459 * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. 460 * 2. The maximum number of characters allowed is 128. 461 * 462 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 463 * @since 3 464 * @deprecated since 10 465 */ 466 uri: string; 467 468 /** 469 * Encoding format. The default format is UTF-8. 470 * Currently, only UTF-8 is supported. 471 * 472 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 473 * @since 3 474 * @deprecated since 10 475 */ 476 encoding?: string; 477 478 /** 479 * Position where the reading starts. 480 * The default value is the start position of the file. 481 * 482 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 483 * @since 3 484 * @deprecated since 10 485 */ 486 position?: number; 487 488 /** 489 * Position where the reading starts. 490 * The default value is the start position of the file. 491 * 492 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 493 * @since 3 494 * @deprecated since 10 495 */ 496 length?: number; 497 498 /** 499 * Called when texts are read successfully. 500 * 501 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 502 * @since 3 503 * @deprecated since 10 504 */ 505 success?: (data: FileReadTextResponse) => void; 506 507 /** 508 * Called when texts fail to be read. 509 * 510 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 511 * @since 3 512 * @deprecated since 10 513 */ 514 fail?: (data: string, code: number) => void; 515 516 /** 517 * Called when the execution is completed. 518 * 519 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 520 * @since 3 521 * @deprecated since 10 522 */ 523 complete?: () => void; 524} 525 526/** 527 * @interface FileWriteArrayBufferOption 528 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 529 * @since 3 530 * @deprecated since 10 531 */ 532export interface FileWriteArrayBufferOption { 533 /** 534 * URI of a local file. If it does not exist, a file will be created. 535 * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: 536 * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. 537 * 2. The maximum number of characters allowed is 128. 538 * 539 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 540 * @since 3 541 * @deprecated since 10 542 */ 543 uri: string; 544 545 /** 546 * Buffer from which the data is derived. 547 * 548 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 549 * @since 3 550 * @deprecated since 10 551 */ 552 buffer: Uint8Array; 553 554 /** 555 * Offset to the position where the writing starts. The default value is 0. 556 * 557 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 558 * @since 3 559 * @deprecated since 10 560 */ 561 position?: number; 562 563 /** 564 * Whether to enable the append mode. 565 * The default value is false. If the value is true, the position parameter will become invalid. 566 * 567 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 568 * @since 3 569 * @deprecated since 10 570 */ 571 append?: boolean; 572 573 /** 574 * Called when data from a buffer is written into a file successfully. 575 * 576 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 577 * @since 3 578 * @deprecated since 10 579 */ 580 success?: () => void; 581 582 /** 583 * Called when data from a buffer fails to be written into a file. 584 * 585 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 586 * @since 3 587 * @deprecated since 10 588 */ 589 fail?: (data: string, code: number) => void; 590 591 /** 592 * Called when the execution is completed. 593 * 594 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 595 * @since 3 596 * @deprecated since 10 597 */ 598 complete?: () => void; 599} 600 601/** 602 * @interface FileReadArrayBufferResponse 603 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 604 * @since 3 605 * @deprecated since 10 606 */ 607export interface FileReadArrayBufferResponse { 608 /** 609 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 610 * @since 3 611 * @deprecated since 10 612 */ 613 buffer: Uint8Array; 614} 615 616/** 617 * @interface FileReadArrayBufferOption 618 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 619 * @since 3 620 * @deprecated since 10 621 */ 622export interface FileReadArrayBufferOption { 623 /** 624 * URI of a local file. 625 * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: 626 * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. 627 * 2. The maximum number of characters allowed is 128. 628 * 629 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 630 * @since 3 631 * @deprecated since 10 632 */ 633 uri: string; 634 635 /** 636 * Position where the reading starts. 637 * The default value is the start position of the file. 638 * 639 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 640 * @since 3 641 * @deprecated since 10 642 */ 643 position?: number; 644 645 /** 646 * Length of the content to read. 647 * If this parameter is not set, all content of the file will be read. 648 * 649 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 650 * @since 3 651 * @deprecated since 10 652 */ 653 length?: number; 654 655 /** 656 * Called when the buffer data is read successfully. 657 * 658 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 659 * @since 3 660 * @deprecated since 10 661 */ 662 success?: (data: FileReadArrayBufferResponse) => void; 663 664 /** 665 * Called when the buffer data fails to be read. 666 * 667 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 668 * @since 3 669 * @deprecated since 10 670 */ 671 fail?: (data: string, code: number) => void; 672 673 /** 674 * Called when the execution is completed. 675 * 676 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 677 * @since 3 678 * @deprecated since 10 679 */ 680 complete?: () => void; 681} 682 683/** 684 * @interface FileAccessOption 685 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 686 * @since 3 687 * @deprecated since 10 688 */ 689export interface FileAccessOption { 690 /** 691 * URI of the directory or file. 692 * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: 693 * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. 694 * 2. The maximum number of characters allowed is 128. 695 * 696 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 697 * @since 3 698 * @deprecated since 10 699 */ 700 uri: string; 701 702 /** 703 * Called when the check result is obtained successfully. 704 * 705 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 706 * @since 3 707 * @deprecated since 10 708 */ 709 success?: () => void; 710 711 /** 712 * Called when the check fails. 713 * 714 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 715 * @since 3 716 * @deprecated since 10 717 */ 718 fail?: (data: string, code: number) => void; 719 720 /** 721 * Called when the execution is completed. 722 * 723 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 724 * @since 3 725 * @deprecated since 10 726 */ 727 complete?: () => void; 728} 729 730/** 731 * @interface FileMkdirOption 732 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 733 * @since 3 734 * @deprecated since 10 735 */ 736export interface FileMkdirOption { 737 /** 738 * URI of the directory. 739 * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: 740 * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. 741 * 2. The maximum number of characters allowed is 128. 742 * 3. A maximum of five recursions are allowed for creating the directory. 743 * 744 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 745 * @since 3 746 * @deprecated since 10 747 */ 748 uri: string; 749 750 /** 751 * Whether to create the directory after creating its upper-level directory recursively. 752 * The default value is false. 753 * 754 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 755 * @since 3 756 * @deprecated since 10 757 */ 758 recursive?: boolean; 759 760 /** 761 * Called when the directory is created successfully. 762 * 763 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 764 * @since 3 765 * @deprecated since 10 766 */ 767 success?: () => void; 768 769 /** 770 * Called when the creation fails. 771 * 772 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 773 * @since 3 774 * @deprecated since 10 775 */ 776 fail?: (data: string, code: number) => void; 777 778 /** 779 * Called when the execution is completed. 780 * 781 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 782 * @since 3 783 * @deprecated since 10 784 */ 785 complete?: () => void; 786} 787 788/** 789 * @interface FileRmdirOption 790 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 791 * @since 3 792 * @deprecated since 10 793 */ 794export interface FileRmdirOption { 795 /** 796 * URI of the directory. 797 * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: 798 * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. 799 * 2. The maximum number of characters allowed is 128. 800 * 801 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 802 * @since 3 803 * @deprecated since 10 804 */ 805 uri: string; 806 807 /** 808 * Whether to delete files and subdirectories recursively. 809 * The default value is false. 810 * 811 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 812 * @since 3 813 * @deprecated since 10 814 */ 815 recursive?: boolean; 816 817 /** 818 * Called when the directory is deleted successfully. 819 * 820 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 821 * @since 3 822 * @deprecated since 10 823 */ 824 success?: () => void; 825 826 /** 827 * Called when the deletion fails. 828 * 829 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 830 * @since 3 831 * @deprecated since 10 832 */ 833 fail?: (data: string, code: number) => void; 834 835 /** 836 * Called when the execution is completed. 837 * 838 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 839 * @since 3 840 * @deprecated since 10 841 */ 842 complete?: () => void; 843} 844 845/** 846 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 847 * @since 3 848 * @deprecated since 10 849 */ 850export default class File { 851 /** 852 * Moves the source file to a specified location. 853 * 854 * @param { FileMoveOption } options - Options. 855 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 856 * @since 3 857 * @deprecated since 10 858 * @useinstead ohos.file.fs.moveFile 859 */ 860 static move(options: FileMoveOption): void; 861 862 /** 863 * Copies a source file and save the copy to a specified location. 864 * 865 * @param { FileCopyOption } options - Options. 866 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 867 * @since 3 868 * @deprecated since 10 869 * @useinstead ohos.file.fs.copyFile 870 */ 871 static copy(options: FileCopyOption): void; 872 873 /** 874 * Obtains the list of files in a specified directory. 875 * 876 * @param { FileListOption } options - Options. 877 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 878 * @since 3 879 * @deprecated since 10 880 * @useinstead ohos.file.fs.listFile 881 */ 882 static list(options: FileListOption): void; 883 884 /** 885 * Obtains information about a local file. 886 * 887 * @param { FileGetOption } options - Options. 888 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 889 * @since 3 890 * @deprecated since 10 891 * @useinstead ohos.file.fs.stat 892 */ 893 static get(options: FileGetOption): void; 894 895 /** 896 * Deletes local files. 897 * 898 * @param { FileDeleteOption } options - Options. 899 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 900 * @since 3 901 * @deprecated since 10 902 * @useinstead ohos.file.fs.unlink 903 */ 904 static delete(options: FileDeleteOption): void; 905 906 /** 907 * Writes texts into a file. 908 * 909 * @param { FileWriteTextOption } options - Options. 910 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 911 * @since 3 912 * @deprecated since 10 913 * @useinstead ohos.file.fs.write 914 */ 915 static writeText(options: FileWriteTextOption): void; 916 917 /** 918 * Reads texts from a file. 919 * 920 * @param { FileReadTextOption } options - Options. 921 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 922 * @since 3 923 * @deprecated since 10 924 * @useinstead ohos.file.fs.readText 925 */ 926 static readText(options: FileReadTextOption): void; 927 928 /** 929 * Writes data from a buffer into a file. 930 * 931 * @param { FileWriteArrayBufferOption } options - Options. 932 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 933 * @since 3 934 * @deprecated since 10 935 * @useinstead ohos.file.fs.write 936 */ 937 static writeArrayBuffer(options: FileWriteArrayBufferOption): void; 938 939 /** 940 * Reads buffer data from a file. 941 * 942 * @param { FileReadArrayBufferOption } options - Options. 943 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 944 * @since 3 945 * @deprecated since 10 946 * @useinstead ohos.file.fs.read 947 */ 948 static readArrayBuffer(options: FileReadArrayBufferOption): void; 949 950 /** 951 * Checks whether a file or directory exists. 952 * 953 * @param { FileAccessOption } options - Options. 954 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 955 * @since 3 956 * @deprecated since 10 957 * @useinstead ohos.file.fs.access 958 */ 959 static access(options: FileAccessOption): void; 960 961 /** 962 * Creates a directory. 963 * 964 * @param { FileMkdirOption } options - Options. 965 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 966 * @since 3 967 * @deprecated since 10 968 * @useinstead ohos.file.fs.mkdir 969 */ 970 static mkdir(options: FileMkdirOption): void; 971 972 /** 973 * Deletes a directory. 974 * 975 * @param { FileRmdirOption } options - Options. 976 * @syscap SystemCapability.FileManagement.File.FileIO.Lite 977 * @since 3 978 * @deprecated since 10 979 * @useinstead ohos.file.fs.rmdir 980 */ 981 static rmdir(options: FileRmdirOption): void; 982} 983