/** * This code was generated by "react-native codegen-lib-harmony" */ import { Tag } from "@rnoh/react-native-openharmony/ts" export namespace ReactNativeFs { type Headers = { [name: string]: string }; type Fields = { [name: string]: string }; export const NAME = 'ReactNativeFs' as const export type MkdirOptionsT = {NSURLIsExcludedFromBackupKey?: boolean} export type StatResult = {ctime: number, mtime: number, size: number, mode: number, originalFilepath: string, type: number} export type DownloadResult = {jobId: number, statusCode: number, bytesWritten: number} export type UploadFileItem = { name: string, filename: string, filepath: string, filetype?: string, } export type UploadResult = { jobId: number, statusCode: number, body: string, headers?: Record, } export type UploadBeginCallbackResult = { jobId: number; // The upload job ID, required if one wishes to cancel the upload. See `stopUpload`. }; export type UploadProgressCallbackResult = { jobId: number; // The upload job ID, required if one wishes to cancel the upload. See `stopUpload`. totalBytesExpectedToSend: number; // The total number of bytes that will be sent to the server totalBytesSent: number; // The number of bytes sent to the server }; export type UploadFileOptions = { toUrl: string, files: UploadFileItem[], method?: string, headers?: Headers, fields?: Fields, binaryStreamOnly?: boolean, timeout?: number, begin?: (res: UploadBeginCallbackResult) => void; progress?: (res: UploadProgressCallbackResult) => void; } export interface Spec { getConstants(): Object; readFile(path: string): Promise; exists(path: string): Promise; mkdir(path: string, options: MkdirOptionsT): Promise; appendFile(path: string, contents: string, encoding: string): Promise; writeFile(path: string, contents: string, encoding: string): Promise; readFileAssets(path: string): Promise; copyFile(from: string, into: string): Promise; unlink(filepath: string): Promise; hash(filepath: string, algorithm: string): Promise; moveFile(filepath: string, destPath: string): Promise; read(path: string, length: number, position: number): Promise; write(filepath: string, contents: string, position: number): Promise; stat(filepath: string): Promise; touch(filepath: string, mtime: number, ctime: number): Promise; downloadFile(bridgeOptions: Object): Promise; uploadFiles(options: UploadFileOptions): Promise; readDir(dirpath: string): Promise; existsAssets(filepath: string): Promise; addListener(eventName: string): void; removeListeners(count: number): void; } }