import Vnmf from '../../index' declare module '../../index' { namespace saveFileToDisk { interface Option { /** Path to Save File */ filePath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (result: VnmfGeneral.CallbackResult) => void } } namespace saveFile { interface Option { /** Path to temporary storage of files */ tempFilePath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: FailCallbackResult) => void /** File path to store */ filePath?: string /** Interface calls a successful echo function */ success?: (result: SuccessCallbackResult) => void } interface FailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail tempFilePath file not exist': Assigned tempFilePath File not found; * - 'fail permission denied, open "${filePath}"': Assigned filePath Path without write permission; * - 'fail no such file or directory "${dirPath}"': A higher directory does not exist; * - 'fail the maximum size of the file storage limit is exceeded': Insufficient storage space; */ errMsg: string } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** File path after storage */ savedFilePath: string /** Call Results */ errMsg: string } } namespace removeSavedFile { interface Option { /** File path to delete */ filePath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface RemoveSavedFileFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail file not exist': Assigned tempFilePath File not found; */ errMsg: string } } namespace openDocument { interface Option { /** File Path,Through downloadFile Access */ filePath: string /** Whether or not to show the upper right corner menu */ showMenu?: boolean /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** File type,Specifies the file type to open */ fileType?: keyof FileType /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } /** File type */ interface FileType { /** doc Format */ doc /** docx Format */ docx /** xls Format */ xls /** xlsx Format */ xlsx /** ppt Format */ ppt /** pptx Format */ pptx /** pdf Format */ pdf } } namespace getSavedFileList { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (result: SuccessCallbackResult) => void } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** File array */ fileList: FileItem[] /** Call Results */ errMsg: string } /** File array */ interface FileItem { /** Time stamp on file save,From1970/01/01 08:00:00 Number of seconds to current time */ createTime: number /** Local Path */ filePath: string /** Local file size,Bytes */ size: number } } namespace getSavedFileInfo { interface Option { /** File Path */ filePath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (result: SuccessCallbackResult) => void } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** Time stamp on file save,From1970/01/01 08:00:00 Number of seconds to that moment */ createTime: number /** File Size,Units B */ size: number /** Call Results */ errMsg: string } } namespace getFileInfo { interface Option { /** File path to read */ filePath: string /** * Calculating the algorithm for summary of files * @default 'md5' */ digestAlgorithm?: 'md5' | 'sha1' /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: FailCallbackResult) => void /** Interface calls a successful echo function */ success?: (result: SuccessCallbackResult) => void } interface FailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail file not exist': Assigned filePath File not found; */ errMsg: string } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** File Size,Bytes */ size: number /** As transferred. digestAlgorithm Calculated summary of documents */ digest: string /** Call Results */ errMsg: string } } /** File Manager,Through [Vnmf.getFileSystemManager](./getFileSystemManager) Fetch。 * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.html */ interface FileSystemManager { /** Deciding Files/Directory Exists * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.access.html */ access(option: FileSystemManager.AccessOption): void /** [FileSystemManager.access](#access) Synchronized version of the * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.accessSync.html */ accessSync( /** It's a document to determine if it exists./Directory Path */ path: string, ): void /** Add at the end of document * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.appendFile.html */ appendFile(option: FileSystemManager.AppendFileOption): void /** [FileSystemManager.appendFile](#appendfile) Synchronized version of the * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.appendFileSync.html */ appendFileSync( /** File path to add */ filePath: string, /** Text or binary data to add */ data: string | ArrayBuffer, /** Specify Character Encoding for Writing File */ encoding?: keyof FileSystemManager.Encoding, ): void /** Close File * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.close.html */ close(option: FileSystemManager.CloseOption): void /** [FileSystemManager.close](#close) Synchronized version of the * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.closeSync.html */ closeSync(option: FileSystemManager.CloseSyncOption): void /** Copy File * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.copyFile.html */ copyFile(option: FileSystemManager.CopyFileOption): void /** [FileSystemManager.copyFile](#copyfile) Synchronized version of the * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.copyFileSync.html */ copyFileSync( /** Source File Path,It can only be a regular file. */ srcPath: string, /** Destination File Path */ destPath: string, ): void /** Retrieving status information for files * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.fstat.html */ fstat(option: FileSystemManager.FstatOption): void /** [FileSystemManager.fstat](#fstat) Synchronized version of the * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.fstatSync.html */ fstatSync(option: FileSystemManager.FstatSyncOption): Stats /** Intercept the contents of files * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.ftruncate.html */ ftruncate(option: FileSystemManager.FtruncateOption): void /** [FileSystemManager.ftruncate](#ftruncate) Synchronized version of the * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.ftruncateSync.html */ ftruncateSync(option: FileSystemManager.FtruncateSyncOption): void /** Get under this applet `Local Temporary File` or `Local cache file` Information * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.getFileInfo.html */ getFileInfo(option: FileSystemManager.getFileInfoOption): void /** Fetch the list of saved local cache files under this applet * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.getSavedFileList.html */ getSavedFileList(option?: FileSystemManager.getSavedFileListOption): void /** Create Directory * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.mkdir.html */ mkdir(option: FileSystemManager.MkdirOption): void /** [FileSystemManager.mkdir](#mkdir) Synchronized version of the * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.mkdirSync.html */ mkdirSync( /** Cannot initialise Evolution's mail component. */ dirPath: string, /** Whether to create the directory after parent that created。If the corresponding superior directory already exists,Do not create the higher directory。Like dirPath Yes. a/b/c/d and recursive Yes. true,Will create a Contents,Again. a Create under Directory b Contents,And so on until it's created. a/b/c Under Contents d Contents。 */ recursive?: boolean, ): void /**Open File,Returns File Descriptor * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.open.html */ open(option: FileSystemManager.OpenOption): void /** [FileSystemManager.openSync](#opensync) Synchronized version of the * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.ftruncateSync.html */ openSync(option: FileSystemManager.OpenSyncOption): string /** File Descriptor */ /** Read File * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.read.html */ read(option: FileSystemManager.ReadOption): void /** Read local file contents of the specified compression type * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readCompressedFile.html */ readCompressedFile(option: FileSystemManager.readCompressedFile.Option): Promise /** Synchronize reading of local file contents the specified compression type * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readCompressedFileSync.html */ readCompressedFileSync(option: FileSystemManager.readCompressedFileSync.Option): ArrayBuffer /** File Read Results */ /** Read the list of files in directory * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readdir.html */ readdir(option: FileSystemManager.ReaddirOption): void /** [FileSystemManager.readdir](#readdir) Synchronized version of the * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readdirSync.html */ readdirSync( /** Directory path to read */ dirPath: string, ): string[] /** Read local file contents * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readFile.html */ readFile(option: FileSystemManager.ReadFileOption): void /** [FileSystemManager.readFile](#readfile) Synchronized version of the * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readFileSync.html */ readFileSync( /** Path to the file read */ filePath: string, /** Specifies the character encoding for reading files,If you don't pass it, encoding,by ArrayBuffer Format binary content for reading files */ encoding?: keyof FileSystemManager.Encoding, /**Read From File Specified Location,If not specified,Read from file。The range of reading should be left closed right open area. [position, position+length)。Valid scope:[0, fileLength - 1]。Units:byte */ position?: number, /**Specifies the length of file,If not specified,Read to the end of document。Valid scope:[1, fileLength]。Units:byte */ length?: number, ): string | ArrayBuffer /** [FileSystemManager.read](#read) Synchronized version of the * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readSync.html */ readSync( option: FileSystemManager.ReadSyncOption ): { /** Number of bytes actually read */ bytesRead: number /** The object of the written cache,i.e. interface entry arrayBuffer */ arrayBuffer: ArrayBuffer } /** Read File in Compressor Package * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readZipEntry.html */ readZipEntry(option: FileSystemManager.readZipEntry.Option): Promise /** Remove a saved local cache file under this applet * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.removeSavedFile.html */ removeSavedFile(option: FileSystemManager.RemoveSavedFileOption): void /** Rename File。Could take the files from oldPath Move to newPath * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rename.html */ rename(option: FileSystemManager.RenameOption): void /** [FileSystemManager.rename](#rename) Synchronized version of the * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.renameSync.html */ renameSync( /** Source File Path,Could be a normal file or directory */ oldPath: string, /** New File Path */ newPath: string, ): void /** Remove Directory * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rmdir.html */ rmdir(option: FileSystemManager.RmdirOption): void /** [FileSystemManager.rmdir](#rmdir) Synchronized version of the * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rmdirSync.html */ rmdirSync( /** Directory path to delete */ dirPath: string, /** Whether to remove directories backwards。If true,and delete the directory all subdirectories files under。 */ recursive?: boolean, ): void /** Save temporary files to local。This interface moves temporary files,So when the call is successful,,tempFilePath Cannot initialise Evolution's mail component.。 * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.saveFile.html */ saveFile(option: FileSystemManager.SaveFileOption): void /** [FileSystemManager.saveFile](#savefile) Synchronized version of the * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.saveFileSync.html */ saveFileSync( /** Path to temporary storage of files */ tempFilePath: string, /** File path to store */ filePath?: string, ): string /** Fetch File Stats Object * @supported weapp, tt * https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.stat.html */ stat(option: FileSystemManager.StatOption): void /** [FileSystemManager.stat](#stat) Synchronized version of the * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.statSync.html */ statSync( /** Documentation/Directory Path */ path: string, /** Whether to retrieve each file in the directory Stats Information */ recursive?: boolean, ): Stats | VnmfGeneral.IAnyObject /** Intercept the contents of files * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.truncate.html */ truncate(option: FileSystemManager.TruncateOption): void /** Intercept the contents of files ([truncate](#truncate) Synchronized version of the) * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.truncateSync.html */ truncateSync(option: FileSystemManager.TruncateSyncOption): void /** Remove File * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unlink.html */ unlink(option: FileSystemManager.UnlinkOption): void /** [FileSystemManager.unlink](#unlink) Synchronized version of the * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unlinkSync.html */ unlinkSync( /** File path to delete */ filePath: string, ): void /** Unpress file * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unzip.html */ unzip(option: FileSystemManager.UnzipOption): void /** Write File * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.write.html */ write(option: FileSystemManager.WriteOption): void /** Writing documents * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeFile.html */ writeFile(option: FileSystemManager.WriteFileOption): void /** [FileSystemManager.writeFile](#writefile) Synchronized version of the * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeFileSync.html */ writeFileSync( /** File path to write */ filePath: string, /** Text or binary data to write */ data: string | ArrayBuffer, /** Specify Character Encoding for Writing File */ encoding?: keyof FileSystemManager.Encoding, ): void /** [write](#write) Synchronized version of the * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeSync.html */ writeSync( option: FileSystemManager.WriteSyncOption ): { /** Bytes actually written into the file(Attention.,The number of bytes written may not necessarily be the same as string characters) */ bytesWritten: number } } namespace FileSystemManager { /** Character Encoding */ interface Encoding { ascii base64 binary hex /** Read in small order */ ucs2 /** Read in small order */ 'ucs-2' /** Read in small order */ utf16le /** Read in small order */ 'utf-16le' 'utf-8' utf8 latin1 } /** Filesystem Marker */ interface flag { a /**Open File for Append。 If the file does not exist,Create this file */ ax /**Kind of. 'a',But if the path exists,,. */ 'a+' /**Open file to read and add。 If the file does not exist,Create this file */ 'ax+' /**Kind of. 'a+',But if the path exists,,. */ as /**Open File for Append(In Synchronization Mode)。 If the file does not exist,Create this file */ 'as+' /**Open file to read and add(In Synchronization Mode)。 If the file does not exist,Create this file */ r /**Open file for reading。 If the file does not exist,Something's going to happen. */ 'r+' /**Open file for reading and writing。 If the file does not exist,Something's going to happen. */ w /**Open file for writing。 Create a file if it does not exist,Cut files if they exist */ wx /**Kind of. 'w',But if the path exists,,. */ 'w+' /**Open file for reading and writing。 Create a file if it does not exist,Cut files if they exist */ 'wx+' /**Kind of. 'w+',But if the path exists,,.*/ } interface AccessOption { /** It's a document to determine if it exists./Directory Path */ path: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: AccessFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface AccessFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail no such file or directory ${path}': Documentation/Directory does not exist; */ errMsg: string } interface AppendFileOption { /** Text or binary data to add */ data: string | ArrayBuffer /** File path to add */ filePath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Specify Character Encoding for Writing File */ encoding?: keyof FileSystemManager.Encoding /** Interface call failed echo function */ fail?: (result: AppendFileFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface AppendFileFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail no such file or directory, open ${filePath}': Assigned filePath File does not exist; * - 'fail illegal operation on a directory, open "${filePath}"': Assigned filePath It's an existing directory.; * - 'fail permission denied, open ${dirPath}': Assigned filePath Path without write permission; * - 'fail sdcard not mounted': Assigned filePath It's an existing directory.; */ errMsg: string } interface CopyFileOption { /** Destination File Path */ destPath: string /** Source File Path,It can only be a regular file. */ srcPath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: CopyFileFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface CopyFileFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail permission denied, copyFile ${srcPath} -> ${destPath}': Specify target file path without write permission; * - 'fail no such file or directory, copyFile ${srcPath} -> ${destPath}': Source does not exist,The top directory of the target file path does not exist; * - 'fail the maximum size of the file storage limit is exceeded': Insufficient storage space; */ errMsg: string } interface getFileInfoOption { /** File path to read */ filePath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: GetFileInfoFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (result: GetFileInfoSuccessCallbackResult) => void } interface GetFileInfoFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail file not exist': Assigned filePath File not found; */ errMsg: string } interface GetFileInfoSuccessCallbackResult extends VnmfGeneral.CallbackResult { /** File Size,Bytes */ size: number /** Call Results */ errMsg: string } interface getSavedFileListOption { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (result: GetSavedFileListSuccessCallbackResult) => void } interface GetSavedFileListSuccessCallbackResult extends VnmfGeneral.CallbackResult { /** File array */ fileList: GetSavedFileListSuccessCallbackResultFileItem[] /** Call Results */ errMsg: string } /** File array */ interface GetSavedFileListSuccessCallbackResultFileItem { /** Time stamp on file save,From1970/01/01 08:00:00 Number of seconds to current time */ createTime: number /** Local Path */ filePath: string /** Local file size,Bytes */ size: number } interface MkdirOption { /** Cannot initialise Evolution's mail component. */ dirPath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: MkdirFailCallbackResult) => void /** Whether to create the directory after parent that created。If the corresponding superior directory already exists,Do not create the higher directory。Like dirPath Yes. a/b/c/d and recursive Yes. true,Will create a Contents,Again. a Create under Directory b Contents,And so on until it's created. a/b/c Under Contents d Contents。 */ recursive?: boolean /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface MkdirFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail no such file or directory ${dirPath}': A higher directory does not exist; * - 'fail permission denied, open ${dirPath}': Assigned filePath Path without write permission; * - 'fail file already exists ${dirPath}': Could not close temporary folder: %s; */ errMsg: string } interface ReadFileOption { /** Path to the file read */ filePath: string /** Read From File Specified Location,If not specified,Read from file。The range of reading should be left closed right open area. [position, position+length)。Valid scope:[0, fileLength - 1]。Units:byte*/ position?: number /**Specifies the length of file,If not specified,Read to the end of document。Valid scope:[1, fileLength]。Units:byte */ length?: number /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Specifies the character encoding for reading files,If you don't pass it, encoding,by ArrayBuffer Format binary content for reading files */ encoding?: keyof FileSystemManager.Encoding /** Interface call failed echo function */ fail?: (result: ReadFileFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: ReadFileSuccessCallbackResult) => void } interface ReadFileSuccessCallbackResult extends VnmfGeneral.CallbackResult { /** File Contents */ data: string | ArrayBuffer /** Call Results */ errMsg: string } interface ReadFileFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail no such file or directory, open ${filePath}': Assigned filePath Cannot initialise Evolution's mail component.; * - 'fail permission denied, open ${dirPath}': Assigned filePath Path does not have read permissions; */ errMsg: string } interface ReaddirOption { /** Directory path to read */ dirPath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: ReaddirFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (result: ReaddirSuccessCallbackResult) => void } interface ReaddirFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail no such file or directory ${dirPath}': Directory does not exist; * - 'fail not a directory ${dirPath}': dirPath It's not a directory.; * - 'fail permission denied, open ${dirPath}': Assigned filePath Path does not have read permissions; */ errMsg: string } interface ReaddirSuccessCallbackResult extends VnmfGeneral.CallbackResult { /** Specifies the array of filenames under directory。 */ files: string[] /** Call Results */ errMsg: string } namespace readZipEntry { type Promised = FailCallbackResult | SuccessCallbackResult interface Option { /** Path to the compression package read (Local Path) */ filePath: string /** Harmonize character encoding for read files,It's just... entries Value as"all"_Other Organiser。If... entries Value as"all"And don't pass it on. encoding,by ArrayBuffer Format binary content for reading files */ encoding?: keyof Encoding | string /** List of files in the compressed package to read(♪ When coming in"all" while reading all files in the compressed package) */ entries: File[] | 'all' /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: FailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: SuccessCallbackResult) => void } interface File { /** The path to the compressed file in package */ path: string /** Specifies the character encoding for reading files,If you don't pass it, encoding,by ArrayBuffer Format binary content for reading files */ encoding?: keyof Encoding | string /** Read From File Specified Location,If not specified,Read from file。The range of reading should be left closed right open area. [position, position+length)。Valid scope:[0, fileLength - 1]。Units:byte */ position?: number /** Specifies the length of file,If not specified,Read to the end of document。Valid scope:[1, fileLength]。Units:byte */ length?: number } /** Character Encoding Legal Values */ interface Encoding { ascii base64 binary hex /** @illustrate Read in small order */ ucs2 /** @illustrate Read in small order */ 'ucs-2' /** @illustrate Read in small order */ utf16le /** @illustrate Read in small order */ 'utf-16le' 'utf-8' utf8 latin1 } interface FailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail no such file or directory, open ${filePath}': Assigned filePath Cannot initialise Evolution's mail component. * - 'fail permission denied, open ${dirPath}': Assigned filePath Path does not have read permissions * - 'fail sdcard not mounted': Android sdcard Mounting failed * */ errMsg: string } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** File Read Results。res.entries is an object,keyIt's the file path.,valueis an object FileItem ,Indicates the reading results of document。Every one. FileItem Organisation data (File Contents) and errMsg (Cannot initialise Evolution's mail component.) Properties。 */ entries: { [path: string]: FileItem } } interface FileItem extends VnmfGeneral.CallbackResult { /** File Contents */ data: string | ArrayBuffer /** Cannot initialise Evolution's mail component. */ errMsg: string } } interface RemoveSavedFileOption { /** File path to delete */ filePath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: RemoveSavedFileFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface RemoveSavedFileFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail file not exist': Assigned tempFilePath File not found; */ errMsg: string } interface RenameOption { /** New File Path */ newPath: string /** Source File Path,Could be a normal file or directory */ oldPath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: RenameFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface RenameFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail permission denied, rename ${oldPath} -> ${newPath}': Specify source or destination file without write permission; * - 'fail no such file or directory, rename ${oldPath} -> ${newPath}': Source does not exist,The top directory of the target file path does not exist; */ errMsg: string } interface RmdirOption { /** Directory path to delete */ dirPath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: RmdirFailCallbackResult) => void /** Whether to remove directories backwards。If true,and delete the directory all subdirectories files under。 */ recursive?: boolean /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface RmdirFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail no such file or directory ${dirPath}': Directory does not exist; * - 'fail directory not empty': Directory is not empty; * - 'fail permission denied, open ${dirPath}': Assigned dirPath Path without write permission; */ errMsg: string } interface SaveFileOption { /** Path to temporary storage of files */ tempFilePath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: SaveFileFailCallbackResult) => void /** File path to store */ filePath?: string /** Interface calls a successful echo function */ success?: (result: SaveFileSuccessCallbackResult) => void } interface SaveFileFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail tempFilePath file not exist': Assigned tempFilePath File not found; * - 'fail permission denied, open "${filePath}"': Assigned filePath Path without write permission; * - 'fail no such file or directory "${dirPath}"': A higher directory does not exist; * - 'fail the maximum size of the file storage limit is exceeded': Insufficient storage space; */ errMsg: string } interface SaveFileSuccessCallbackResult extends VnmfGeneral.CallbackResult { /** File path after storage */ savedFilePath: string /** Call Results */ errMsg: string } interface StatOption { /** Documentation/Directory Path */ path: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: StatFailCallbackResult) => void /** Whether to retrieve each file in the directory Stats Information */ recursive?: boolean /** Interface calls a successful echo function */ success?: (result: StatSuccessCallbackResult) => void } interface StatFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail permission denied, open ${path}': Assigned path Path does not have read permissions; * - 'fail no such file or directory ${path}': File does not exist; */ errMsg: string } interface StatSuccessCallbackResult extends VnmfGeneral.CallbackResult { /** [Stats](/docs/apis/files/Stats) | Object * * ♪ When recursive Yes. false Hour,res.stats It's one. Stats Object。♪ When recursive Yes. true and path When a path to directory,res.stats It's one. Object,key By path Relative Path to Root,value It corresponds to the path. Stats Object。 */ stats: Stats | VnmfGeneral.IAnyObject /** Call Results */ errMsg: string } interface UnlinkOption { /** File path to delete */ filePath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: UnlinkFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface UnlinkFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail permission denied, open ${path}': Assigned path Path does not have read permissions; * - 'fail no such file or directory ${path}': File does not exist; * - 'fail operation not permitted, unlink ${filePath}': Inbound. filePath is a directory; */ errMsg: string } interface UnzipOption { /** Destination Directory Path */ targetPath: string /** Source File Path,It can only be. zip Compress File */ zipFilePath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: UnzipFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface UnzipFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail permission denied, unzip ${zipFilePath} -> ${destPath}': Specify target file path without write permission; * - 'fail no such file or directory, unzip ${zipFilePath} -> "${destPath}': Source does not exist,The top directory of the target file path does not exist; */ errMsg: string } interface WriteFileOption { /** Text or binary data to write */ data: string | ArrayBuffer /** File path to write */ filePath: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Specify Character Encoding for Writing File */ encoding?: keyof FileSystemManager.Encoding /** Interface call failed echo function */ fail?: (result: WriteFileFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface WriteFileFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail no such file or directory, open ${filePath}': Assigned filePath Cannot initialise Evolution's mail component.; * - 'fail permission denied, open ${dirPath}': Assigned filePath Path without write permission; * - 'fail the maximum size of the file storage limit is exceeded': Insufficient storage space; */ errMsg: string } interface FstatOption { /** File Descriptor。fd Through FileSystemManager.open or FileSystemManager.openSync Interface got */ fd: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: FstatFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: FstatSuccessCallbackResult) => void } interface FstatFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'bad file descriptor': Could not close temporary folder: %s; * - 'fail permission denied': Assigned fd Path does not have read permissions; */ errMsg: string } interface FstatSuccessCallbackResult extends VnmfGeneral.CallbackResult { /** Stats Object,Include status information for files */ stats: Stats /** Call Results */ errMsg: string } interface FstatSyncOption { /** File Descriptor。fd Through FileSystemManager.open or FileSystemManager.openSync Interface got */ fd: string } interface CloseOption { /** File descriptors required to be closed。fd Through FileSystemManager.open or FileSystemManager.openSync Interface got */ fd: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: CloseFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface CloseFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'bad file descriptor': Could not close temporary folder: %s */ errMsg: string } interface CloseSyncOption { /** File descriptors required to be closed。fd Through FileSystemManager.open or FileSystemManager.openSync Interface got */ fd: string } interface FtruncateOption { /** File Descriptor。fd Through FileSystemManager.open or FileSystemManager.openSync Interface got */ fd: string /** Cut the position.,Default0。If... length Less than File Length(Units:Bytes),There's only the front. length A byte will be kept in the file,The rest will be deleted.;If... length More than file length,It will be extended.,And the extension will fill empty bytes('\0') */ length: number /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: FtruncateFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface FtruncateFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'bad file descriptor': Could not close temporary folder: %s * - 'fail permission denied': Assigned fd No permission to write * - 'fail the maximum size of the file storage limit is exceeded': Insufficient storage space * - 'fail sdcard not mounted android sdcard': Mounting failed */ errMsg: string } interface FtruncateSyncOption { /** File Descriptor。fd Through FileSystemManager.open or FileSystemManager.openSync Interface got */ fd: string /**Cut the position.,Default0。If... length Less than File Length(Units:Bytes),There's only the front. length A byte will be kept in the file,The rest will be deleted.;If... length More than file length,It will be extended.,And the extension will fill empty bytes('\0') */ length: number } interface OpenOption { /** File Path (Local Path) */ filePath: string /** Filesystem Marker,Default value: 'r' */ flag?: keyof FileSystemManager.flag /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: OpenFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: OpenSuccessCallbackResult) => void } interface OpenFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail no such file or directory "${filePath}"': A higher directory does not exist */ errMsg: string } interface OpenSuccessCallbackResult extends VnmfGeneral.CallbackResult { /** File Descriptor */ fd: string /** Call Results */ errMsg: string } interface OpenSyncOption { /** File Path (Local Path) */ filePath: string /** Filesystem Marker,Default value: 'r' */ flag?: keyof FileSystemManager.flag } interface ReadOption { /** File Descriptor。fd Through FileSystemManager.open or FileSystemManager.openSync Interface got */ fd: string /** Buffers for data writing,It has to be. ArrayBuffer Example */ arrayBuffer: ArrayBuffer /** Write offset in buffer zone,Default0 */ offset?: number /** Bytes to read from file,Default0 */ length?: number /** The beginning of the file reading,If you don't pass or pass, null,and read from the location of current file pointer。If... position It's a positive integer.,Then the file pointer position will remain unchanged and from position Read File。 */ position?: number /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: ReadFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: ReadSuccessCallbackResult) => void } interface ReadFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'bad file descriptor': Could not close temporary folder: %s * - 'fail permission denied': Assigned fd Path does not have read permissions * - 'fail the value of "offset" is out of range': Inbound. offset Invalid * - 'fail the value of "length" is out of range': Inbound. length Invalid * - 'fail sdcard not mounted': android sdcard Mounting failed * - 'bad file descriptor': Could not close temporary folder: %s * */ errMsg: string } interface ReadSuccessCallbackResult extends VnmfGeneral.CallbackResult { /** Number of bytes actually read */ bytesRead: string /** The object of the written cache,i.e. interface entry arrayBuffer */ arrayBuffer: ArrayBuffer /** Call Results */ errMsg: string } namespace readCompressedFile { type Promised = FailCallbackResult | SuccessCallbackResult interface Option { /** Path to the file read (Local user file or package) */ filePath: string /** File compression type,Only currently supported 'br'。 */ compressionAlgorithm: keyof CompressionAlgorithm | string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: FailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: SuccessCallbackResult) => void } /** Normal value of file compression type */ interface CompressionAlgorithm { /** brotliCompress File */ br } interface FailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail decompress fail': Assigned compressionAlgorithm It does not match the actual compressed format of file * - 'fail no such file or directory, open ${filePath}': Assigned filePath Cannot initialise Evolution's mail component. * - 'fail permission denied, open ${dirPath}': Assigned filePath Path does not have read permissions * */ errMsg: string } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** File Contents */ data: ArrayBuffer } } namespace readCompressedFileSync { interface Option { /** Path to the file read (Local user file or package) */ filePath: string /** File compression type,Only currently supported 'br'。 */ compressionAlgorithm: keyof CompressionAlgorithm | string } /** Normal value of file compression type */ interface CompressionAlgorithm { /** brotliCompress File */ br } } interface ReadSyncOption { /** File Descriptor。fd Through FileSystemManager.open or FileSystemManager.openSync Interface got */ fd: string /** Buffers for data writing,It has to be. ArrayBuffer Example */ arrayBuffer: ArrayBuffer /** Write offset in buffer zone,Default0 */ offset?: number /** Bytes to read from file,Default0 */ length?: number /** The beginning of the file reading,If you don't pass or pass, null,and read from the location of current file pointer。If... position It's a positive integer.,Then the file pointer position will remain unchanged and from position Read File。 */ position?: number } interface TruncateOption { /** The path of the file to be cut off (Local Path) */ filePath: string /** Cut the position.,Default0。If... length Less than File Length(Bytes),There's only the front. length A byte will be kept in the file,The rest will be deleted.;If... length More than file length,It will be extended.,And the extension will fill empty bytes('\0') */ length?: number /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: TruncateFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } interface TruncateFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * - 'fail no such file or directory, open ${filePath}': Assigned filePath Cannot initialise Evolution's mail component. * - 'fail illegal operation on a directory, open "${filePath}"': Assigned filePath It's an existing directory. * - 'fail permission denied, open ${dirPath}': Assigned filePath Path without write permission * - 'fail the maximum size of the file storage limit is exceeded': Insufficient storage space * - 'fail sdcard not mounted': android sdcard Mounting failed * */ errMsg: string } interface TruncateSyncOption { /** The path of the file to be cut off (Local Path) */ filePath: string /** Cut the position.,Default0。If... length Less than File Length(Bytes),There's only the front. length A byte will be kept in the file,The rest will be deleted.;If... length More than file length,It will be extended.,And the extension will fill empty bytes('\0') */ length?: number } interface WriteOption { /** File Descriptor。fd Through FileSystemManager.open or FileSystemManager.openSync Interface got */ fd: string /** Contents of writing,Type String or ArrayBuffer */ data: string | ArrayBuffer /** It's just... data The type is... ArrayBuffer _Other Organiser,Resolves arrayBuffe _Other Organiser,i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i arrayBuffer Index in,Default0 */ offset?: number /** It's just... data The type is... ArrayBuffer _Other Organiser,Specify the number of bytes to write,Default As arrayBuffer From0Start Offset offset The number of bytes remaining after a byte */ length?: number /** It's just... data The type is... String _Other Organiser,Specify Character Encoding for Writing File,Default As utf8 */ encoding?: keyof FileSystemManager.Encoding /** Specifies the offset at beginning of file,That is where the data to be written。♪ When position Don't pass it on or to the wrong. Number Values of the type,Data will be written to the location of current pointer。 */ position?: number /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (result: WriteFailCallbackResult) => void /** Interface calls a successful echo function */ success?: (res: WriteSuccessCallbackResult) => void } interface WriteFailCallbackResult extends VnmfGeneral.CallbackResult { /** Cannot initialise Evolution's mail component. * * Optional value: * 'bad file descriptor': Could not close temporary folder: %s * 'fail permission denied': Assigned fd Path without write permission * 'fail sdcard not mounted': android sdcard Mounting failed * */ errMsg: string } interface WriteSuccessCallbackResult extends VnmfGeneral.CallbackResult { /** Bytes actually written into the file(Attention.,The number of bytes written may not necessarily be the same as string characters) */ bytesWritten: number /** Call Results */ errMsg: string } interface WriteSyncOption { /** File Descriptor。fd Through FileSystemManager.open or FileSystemManager.openSync Interface got */ fd: string /** Contents of writing,Type String or ArrayBuffer */ data: string | ArrayBuffer /** It's just... data The type is... ArrayBuffer _Other Organiser,Resolves arrayBuffe _Other Organiser,i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i-i arrayBuffer Index in,Default0 */ offset?: number /** It's just... data The type is... ArrayBuffer _Other Organiser,Specify the number of bytes to write,Default As arrayBuffer From0Start Offset offset The number of bytes remaining after a byte */ length?: number /** It's just... data The type is... String _Other Organiser,Specify Character Encoding for Writing File,Default As utf8 */ encoding?: keyof FileSystemManager.Encoding /** Specifies the offset at beginning of file,That is where the data to be written。♪ When position Don't pass it on or to the wrong. Number Values of the type,Data will be written to the location of current pointer。 */ position?: number } } /** File Read Results。 Through [FileSystemManager.readSync](./FileSystemManager#readsync) Interface returns * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/ReadResult.html */ interface ReadResult { /** Number of bytes actually read */ bytesRead: number /** The object of the written cache,i.e. interface entry arrayBuffer */ arrayBuffer: ArrayBuffer } /** The object that describes the status of file * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.html */ interface Stats { /** Type of file and access rights,Corresponding POSIX stat.st_mode */ mode: string /** File Size,Units:B,Corresponding POSIX stat.st_size */ size: number /** Date of last document accessed or executed,UNIX Time stamp,Corresponding POSIX stat.st_atime */ lastAccessedTime: number /** Last time the document was modified,UNIX Time stamp,Corresponding POSIX stat.st_mtime */ lastModifiedTime: number /** Determining whether the current file is a directory * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.isDirectory.html */ isDirectory(): boolean /** Determining whether the current document is a normal file * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.isFile.html */ isFile(): boolean } /** File Write Results。 Through [FileSystemManager.writeSync](./FileSystemManager#writesync) Interface returns * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/WriteResult.html */ interface WriteResult { /** Bytes actually written into the file(Attention.,The number of bytes written may not necessarily be the same as string characters) */ bytesWritten: number } interface VnmfStatic { /** Save filesystem files to user disk,Just... PC End Support * @supported weapp * @example * ```tsx * Vnmf.saveFileToDisk({ * filePath: `${Vnmf.env.USER_DATA_PATH}/hello.txt`, * success(res) { * console.log(res) * }, * fail(res) { * console.error(res) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.saveFileToDisk.html */ saveFileToDisk(option: saveFileToDisk.Option): Promise /** Save file to local。**Attention.:saveFile We'll move the temporary files.,That's why the call came in after success. tempFilePath Cannot initialise Evolution's mail component.** * @supported weapp, rn, tt * @example * ```tsx * Vnmf.chooseImage({ * success: function (res) { * var tempFilePaths = res.tempFilePaths * Vnmf.saveFile({ * tempFilePath: tempFilePaths[0], * success: function (res) { * var savedFilePath = res.savedFilePath * } * }) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.saveFile.html */ saveFile(option: saveFile.Option): Promise /** Remove a saved local cache file under this applet * @supported weapp, rn, tt * @example * ```tsx * Vnmf.getSavedFileList({ * success: function (res) { * if (res.fileList.length > 0){ * Vnmf.removeSavedFile({ * filePath: res.fileList[0].filePath, * complete: function (res) { * console.log(res) * } * }) * } * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.removeSavedFile.html */ removeSavedFile(option: removeSavedFile.Option): Promise /** New Page Open Document,Support Format * @supported weapp, tt * @example ```tsx * Vnmf.downloadFile({ * url: 'https://example.com/somefile.pdf', * success: function (res) { * var filePath = res.tempFilePath * Vnmf.openDocument({ * filePath: filePath, * success: function (res) { * console.log('Document opened successfully') * } * }) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.openDocument.html */ openDocument(option: openDocument.Option): Promise /** Fetch a list of locally saved files * @supported weapp, rn, tt * @example * ```tsx * Vnmf.getSavedFileList({ * success: function (res) { * console.log(res.fileList) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.getSavedFileList.html */ getSavedFileList(option?: getSavedFileList.Option): Promise /** Fetch file information for local files。This interface can only be used to retrieve files saved locally,If you need to get temporary file information,Please use [Vnmf.getFileInfo](/docs/apis/files/getFileInfo) Interface。 * @supported weapp, rn * @example * ```tsx * Vnmf.getSavedFileInfo({ * filePath: 'wxfile://somefile', //Just for example.,Unreal file path * success: function (res) { * console.log(res.size) * console.log(res.createTime) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.getSavedFileInfo.html */ getSavedFileInfo(option: getSavedFileInfo.Option): Promise /** * Get under this applet Local Temporary File or Local cache file Information * @supported weapp, rn, tt * @example * ```tsx * Vnmf.getFileInfo({ * success: function (res) { * console.log(res.size) * console.log(res.digest) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.getFileInfo.html */ getFileInfo(option: getFileInfo.Option): Promise /** Retrieve the global only file manager * @supported weapp, tt * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.getFileSystemManager.html */ getFileSystemManager(): FileSystemManager } }