46 Star 173 Fork 4.7K

OpenHarmony/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@system.file.d.ts 25.17 KB
一键复制 编辑 原始数据 按行查看 历史
zhuhongtao666 提交于 1年前 . remove kit
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986
/*
* Copyright (c) 2020-2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
*/
/**
* @interface FileResponse
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileResponse {
/**
* File URI.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
uri: string;
/**
* File size, in bytes.
* If type is dir, the length value is fixed to 0.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
length: number;
/**
* Timestamp when the file is stored, which is the number of milliseconds elapsed since 1970/01/01 00:00:00.
* For lite wearables, the value is fixed to 0, because this parameter is restricted by the underlying file system.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
lastModifiedTime: number;
/**
* File type. The values are as follows:
* dir: directory
* file: file
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
type: 'dir' | 'file';
/**
* File list. When the recursive value is true and the type is dir, the file information under the subdirectory will be returned.
* Otherwise, no value will be returned.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
subFiles?: Array<FileResponse>;
}
/**
* @interface FileMoveOption
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileMoveOption {
/**
* URI of the file to move.
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
srcUri: string;
/**
* URI of the file moved to the target location.
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
dstUri: string;
/**
* Called when the source file is moved to the specified location successfully.
* This function returns the URI of the file moved to the target location.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
success?: (uri: string) => void;
/**
* Called when moving fails.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
complete?: () => void;
}
/**
* @interface FileListResponse
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileListResponse {
/**
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
fileList: Array<FileResponse>;
}
/**
* @interface FileListOption
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileListOption {
/**
* URI of the directory.
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
uri: string;
/**
* Called when the list is obtained successfully.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
success?: (data: FileListResponse) => void;
/**
* Called when the list fails to be obtained.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
complete?: () => void;
}
/**
* @interface FileCopyOption
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileCopyOption {
/**
* URI of the file to copy.
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
srcUri: string;
/**
* URI of the file moved to the target location.
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
dstUri: string;
/**
* Called when the copy file is saved successful.
* This function returns the URI of the file saved to the target location.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
success?: (uri: string) => void;
/**
* Called when the copy or save operation fails.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
complete?: () => void;
}
/**
* @interface FileGetOption
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileGetOption {
/**
* File URI, which cannot be an application resource path.
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
uri: string;
/**
* Whether to recursively obtain the file list under a subdirectory.
* The default value is false.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
recursive?: boolean;
/**
* Called when file information is obtained successfully.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
success?: (file: FileResponse) => void;
/**
* Called when file information fails to be obtained.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
complete?: () => void;
}
/**
* @interface FileDeleteOption
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileDeleteOption {
/**
* URI of the file to be deleted, which cannot be an application resource path.
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
uri: string;
/**
* Called when local files are deleted successfully.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
success?: () => void;
/**
* Called when the deletion fails.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
complete?: () => void;
}
/**
* @interface FileWriteTextOption
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileWriteTextOption {
/**
* URI of a local file. If it does not exist, a file will be created.
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
uri: string;
/**
* Character string to write into the local file.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
text: string;
/**
* Encoding format. The default format is UTF-8.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
encoding?: string;
/**
* Whether to enable the append mode. The default value is false.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
append?: boolean;
/**
* Called when texts are written into a file successfully.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
success?: () => void;
/**
* Called when texts fail to be written into a file.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
complete?: () => void;
}
/**
* @interface FileReadTextResponse
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileReadTextResponse {
/**
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
text: string;
}
/**
* @interface FileReadTextOption
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileReadTextOption {
/**
* URI of a local file.
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
uri: string;
/**
* Encoding format. The default format is UTF-8.
* Currently, only UTF-8 is supported.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
encoding?: string;
/**
* Position where the reading starts.
* The default value is the start position of the file.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
position?: number;
/**
* Position where the reading starts.
* The default value is the start position of the file.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
length?: number;
/**
* Called when texts are read successfully.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
success?: (data: FileReadTextResponse) => void;
/**
* Called when texts fail to be read.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
complete?: () => void;
}
/**
* @interface FileWriteArrayBufferOption
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileWriteArrayBufferOption {
/**
* URI of a local file. If it does not exist, a file will be created.
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
uri: string;
/**
* Buffer from which the data is derived.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
buffer: Uint8Array;
/**
* Offset to the position where the writing starts. The default value is 0.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
position?: number;
/**
* Whether to enable the append mode.
* The default value is false. If the value is true, the position parameter will become invalid.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
append?: boolean;
/**
* Called when data from a buffer is written into a file successfully.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
success?: () => void;
/**
* Called when data from a buffer fails to be written into a file.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
complete?: () => void;
}
/**
* @interface FileReadArrayBufferResponse
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileReadArrayBufferResponse {
/**
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
buffer: Uint8Array;
}
/**
* @interface FileReadArrayBufferOption
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileReadArrayBufferOption {
/**
* URI of a local file.
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
uri: string;
/**
* Position where the reading starts.
* The default value is the start position of the file.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
position?: number;
/**
* Length of the content to read.
* If this parameter is not set, all content of the file will be read.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
length?: number;
/**
* Called when the buffer data is read successfully.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
success?: (data: FileReadArrayBufferResponse) => void;
/**
* Called when the buffer data fails to be read.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
complete?: () => void;
}
/**
* @interface FileAccessOption
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileAccessOption {
/**
* URI of the directory or file.
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
uri: string;
/**
* Called when the check result is obtained successfully.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
success?: () => void;
/**
* Called when the check fails.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
complete?: () => void;
}
/**
* @interface FileMkdirOption
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileMkdirOption {
/**
* URI of the directory.
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
* 3. A maximum of five recursions are allowed for creating the directory.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
uri: string;
/**
* Whether to create the directory after creating its upper-level directory recursively.
* The default value is false.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
recursive?: boolean;
/**
* Called when the directory is created successfully.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
success?: () => void;
/**
* Called when the creation fails.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
complete?: () => void;
}
/**
* @interface FileRmdirOption
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export interface FileRmdirOption {
/**
* URI of the directory.
* Restricted by the underlying file system of lite wearables, the value must meet the following requirements:
* 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F.
* 2. The maximum number of characters allowed is 128.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
uri: string;
/**
* Whether to delete files and subdirectories recursively.
* The default value is false.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
recursive?: boolean;
/**
* Called when the directory is deleted successfully.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
success?: () => void;
/**
* Called when the deletion fails.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
*
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
complete?: () => void;
}
/**
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
*/
export default class File {
/**
* Moves the source file to a specified location.
*
* @param { FileMoveOption } options - Options.
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
* @useinstead ohos.file.fs.moveFile
*/
static move(options: FileMoveOption): void;
/**
* Copies a source file and save the copy to a specified location.
*
* @param { FileCopyOption } options - Options.
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
* @useinstead ohos.file.fs.copyFile
*/
static copy(options: FileCopyOption): void;
/**
* Obtains the list of files in a specified directory.
*
* @param { FileListOption } options - Options.
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
* @useinstead ohos.file.fs.listFile
*/
static list(options: FileListOption): void;
/**
* Obtains information about a local file.
*
* @param { FileGetOption } options - Options.
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
* @useinstead ohos.file.fs.stat
*/
static get(options: FileGetOption): void;
/**
* Deletes local files.
*
* @param { FileDeleteOption } options - Options.
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
* @useinstead ohos.file.fs.unlink
*/
static delete(options: FileDeleteOption): void;
/**
* Writes texts into a file.
*
* @param { FileWriteTextOption } options - Options.
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
* @useinstead ohos.file.fs.write
*/
static writeText(options: FileWriteTextOption): void;
/**
* Reads texts from a file.
*
* @param { FileReadTextOption } options - Options.
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
* @useinstead ohos.file.fs.readText
*/
static readText(options: FileReadTextOption): void;
/**
* Writes data from a buffer into a file.
*
* @param { FileWriteArrayBufferOption } options - Options.
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
* @useinstead ohos.file.fs.write
*/
static writeArrayBuffer(options: FileWriteArrayBufferOption): void;
/**
* Reads buffer data from a file.
*
* @param { FileReadArrayBufferOption } options - Options.
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
* @useinstead ohos.file.fs.read
*/
static readArrayBuffer(options: FileReadArrayBufferOption): void;
/**
* Checks whether a file or directory exists.
*
* @param { FileAccessOption } options - Options.
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
* @useinstead ohos.file.fs.access
*/
static access(options: FileAccessOption): void;
/**
* Creates a directory.
*
* @param { FileMkdirOption } options - Options.
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
* @useinstead ohos.file.fs.mkdir
*/
static mkdir(options: FileMkdirOption): void;
/**
* Deletes a directory.
*
* @param { FileRmdirOption } options - Options.
* @syscap SystemCapability.FileManagement.File.FileIO.Lite
* @since 3
* @deprecated since 10
* @useinstead ohos.file.fs.rmdir
*/
static rmdir(options: FileRmdirOption): void;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/interface_sdk-js.git
git@gitee.com:openharmony/interface_sdk-js.git
openharmony
interface_sdk-js
interface_sdk-js
master

搜索帮助