@capacitor/filesystem 5.1.5-nightly-20231031T150412.0 → 5.1.5-nightly-20231101T150452.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/docs.json +15 -0
- package/dist/esm/definitions.d.ts +6 -0
- package/dist/esm/definitions.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -101,6 +101,7 @@ const readFilePath = async () => {
|
|
|
101
101
|
* [`requestPermissions()`](#requestpermissions)
|
|
102
102
|
* [`downloadFile(...)`](#downloadfile)
|
|
103
103
|
* [`addListener('progress', ...)`](#addlistenerprogress)
|
|
104
|
+
* [`removeAllListeners()`](#removealllisteners)
|
|
104
105
|
* [Interfaces](#interfaces)
|
|
105
106
|
* [Type Aliases](#type-aliases)
|
|
106
107
|
* [Enums](#enums)
|
|
@@ -382,6 +383,19 @@ Add a listener to file download progress events.
|
|
|
382
383
|
--------------------
|
|
383
384
|
|
|
384
385
|
|
|
386
|
+
### removeAllListeners()
|
|
387
|
+
|
|
388
|
+
```typescript
|
|
389
|
+
removeAllListeners() => Promise<void>
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Remove all listeners for this plugin.
|
|
393
|
+
|
|
394
|
+
**Since:** 5.2.0
|
|
395
|
+
|
|
396
|
+
--------------------
|
|
397
|
+
|
|
398
|
+
|
|
385
399
|
### Interfaces
|
|
386
400
|
|
|
387
401
|
|
package/dist/docs.json
CHANGED
|
@@ -350,6 +350,21 @@
|
|
|
350
350
|
"ProgressListener"
|
|
351
351
|
],
|
|
352
352
|
"slug": "addlistenerprogress"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"name": "removeAllListeners",
|
|
356
|
+
"signature": "() => Promise<void>",
|
|
357
|
+
"parameters": [],
|
|
358
|
+
"returns": "Promise<void>",
|
|
359
|
+
"tags": [
|
|
360
|
+
{
|
|
361
|
+
"name": "since",
|
|
362
|
+
"text": "5.2.0"
|
|
363
|
+
}
|
|
364
|
+
],
|
|
365
|
+
"docs": "Remove all listeners for this plugin.",
|
|
366
|
+
"complexTypes": [],
|
|
367
|
+
"slug": "removealllisteners"
|
|
353
368
|
}
|
|
354
369
|
],
|
|
355
370
|
"properties": []
|
|
@@ -588,6 +588,12 @@ export interface FilesystemPlugin {
|
|
|
588
588
|
* @since 5.1.0
|
|
589
589
|
*/
|
|
590
590
|
addListener(eventName: 'progress', listenerFunc: ProgressListener): Promise<PluginListenerHandle>;
|
|
591
|
+
/**
|
|
592
|
+
* Remove all listeners for this plugin.
|
|
593
|
+
*
|
|
594
|
+
* @since 5.2.0
|
|
595
|
+
*/
|
|
596
|
+
removeAllListeners(): Promise<void>;
|
|
591
597
|
}
|
|
592
598
|
/**
|
|
593
599
|
* @deprecated Use `ReadFileOptions`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAUA,MAAM,CAAN,IAAY,SAqEX;AArED,WAAY,SAAS;IACnB;;;;;;;;;;;OAWG;IACH,oCAAuB,CAAA;IAEvB;;;;;;;OAOG;IACH,0BAAa,CAAA;IAEb;;;;;;;OAOG;IACH,gCAAmB,CAAA;IAEnB;;;;;;OAMG;IACH,4BAAe,CAAA;IAEf;;;;;;;;;;OAUG;IACH,kCAAqB,CAAA;IAErB;;;;;;;;;;OAUG;IACH,iDAAoC,CAAA;AACtC,CAAC,EArEW,SAAS,KAAT,SAAS,QAqEpB;AAED,MAAM,CAAN,IAAY,QAyBX;AAzBD,WAAY,QAAQ;IAClB;;;;OAIG;IACH,yBAAa,CAAA;IAEb;;;;;;OAMG;IACH,2BAAe,CAAA;IAEf;;;;;;OAMG;IACH,2BAAe,CAAA;AACjB,CAAC,EAzBW,QAAQ,KAAR,QAAQ,QAyBnB;AA2lBD;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAE7C;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC","sourcesContent":["import type {\n HttpOptions,\n PermissionState,\n PluginListenerHandle,\n} from '@capacitor/core';\n\nexport interface PermissionStatus {\n publicStorage: PermissionState;\n}\n\nexport enum Directory {\n /**\n * The Documents directory.\n * On iOS it's the app's documents directory.\n * Use this directory to store user-generated content.\n * On Android it's the Public Documents folder, so it's accessible from other apps.\n * It's not accesible on Android 10 unless the app enables legacy External Storage\n * by adding `android:requestLegacyExternalStorage=\"true\"` in the `application` tag\n * in the `AndroidManifest.xml`.\n * On Android 11 or newer the app can only access the files/folders the app created.\n *\n * @since 1.0.0\n */\n Documents = 'DOCUMENTS',\n\n /**\n * The Data directory.\n * On iOS it will use the Documents directory.\n * On Android it's the directory holding application files.\n * Files will be deleted when the application is uninstalled.\n *\n * @since 1.0.0\n */\n Data = 'DATA',\n\n /**\n * The Library directory.\n * On iOS it will use the Library directory.\n * On Android it's the directory holding application files.\n * Files will be deleted when the application is uninstalled.\n *\n * @since 1.1.0\n */\n Library = 'LIBRARY',\n\n /**\n * The Cache directory.\n * Can be deleted in cases of low memory, so use this directory to write app-specific files.\n * that your app can re-create easily.\n *\n * @since 1.0.0\n */\n Cache = 'CACHE',\n\n /**\n * The external directory.\n * On iOS it will use the Documents directory.\n * On Android it's the directory on the primary shared/external\n * storage device where the application can place persistent files it owns.\n * These files are internal to the applications, and not typically visible\n * to the user as media.\n * Files will be deleted when the application is uninstalled.\n *\n * @since 1.0.0\n */\n External = 'EXTERNAL',\n\n /**\n * The external storage directory.\n * On iOS it will use the Documents directory.\n * On Android it's the primary shared/external storage directory.\n * It's not accesible on Android 10 unless the app enables legacy External Storage\n * by adding `android:requestLegacyExternalStorage=\"true\"` in the `application` tag\n * in the `AndroidManifest.xml`.\n * It's not accesible on Android 11 or newer.\n *\n * @since 1.0.0\n */\n ExternalStorage = 'EXTERNAL_STORAGE',\n}\n\nexport enum Encoding {\n /**\n * Eight-bit UCS Transformation Format\n *\n * @since 1.0.0\n */\n UTF8 = 'utf8',\n\n /**\n * Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the\n * Unicode character set\n * This encoding is only supported on Android.\n *\n * @since 1.0.0\n */\n ASCII = 'ascii',\n\n /**\n * Sixteen-bit UCS Transformation Format, byte order identified by an\n * optional byte-order mark\n * This encoding is only supported on Android.\n *\n * @since 1.0.0\n */\n UTF16 = 'utf16',\n}\n\nexport interface WriteFileOptions {\n /**\n * The path of the file to write\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The data to write\n *\n * Note: Blob data is only supported on Web.\n *\n * @since 1.0.0\n */\n data: string | Blob;\n\n /**\n * The `Directory` to store the file in\n *\n * @since 1.0.0\n */\n directory?: Directory;\n\n /**\n * The encoding to write the file in. If not provided, data\n * is written as base64 encoded.\n *\n * Pass Encoding.UTF8 to write data as string\n *\n * @since 1.0.0\n */\n encoding?: Encoding;\n\n /**\n * Whether to create any missing parent directories.\n *\n * @default false\n * @since 1.0.0\n */\n recursive?: boolean;\n}\n\nexport interface AppendFileOptions {\n /**\n * The path of the file to append\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The data to write\n *\n * @since 1.0.0\n */\n data: string;\n\n /**\n * The `Directory` to store the file in\n *\n * @since 1.0.0\n */\n directory?: Directory;\n\n /**\n * The encoding to write the file in. If not provided, data\n * is written as base64 encoded.\n *\n * Pass Encoding.UTF8 to write data as string\n *\n * @since 1.0.0\n */\n encoding?: Encoding;\n}\n\nexport interface ReadFileOptions {\n /**\n * The path of the file to read\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The `Directory` to read the file from\n *\n * @since 1.0.0\n */\n directory?: Directory;\n\n /**\n * The encoding to read the file in, if not provided, data\n * is read as binary and returned as base64 encoded.\n *\n * Pass Encoding.UTF8 to read data as string\n *\n * @since 1.0.0\n */\n encoding?: Encoding;\n}\n\nexport interface DeleteFileOptions {\n /**\n * The path of the file to delete\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The `Directory` to delete the file from\n *\n * @since 1.0.0\n */\n directory?: Directory;\n}\n\nexport interface MkdirOptions {\n /**\n * The path of the new directory\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The `Directory` to make the new directory in\n *\n * @since 1.0.0\n */\n directory?: Directory;\n\n /**\n * Whether to create any missing parent directories as well.\n *\n * @default false\n * @since 1.0.0\n */\n recursive?: boolean;\n}\n\nexport interface RmdirOptions {\n /**\n * The path of the directory to remove\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The `Directory` to remove the directory from\n *\n * @since 1.0.0\n */\n directory?: Directory;\n\n /**\n * Whether to recursively remove the contents of the directory\n *\n * @default false\n * @since 1.0.0\n */\n recursive?: boolean;\n}\n\nexport interface ReaddirOptions {\n /**\n * The path of the directory to read\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The `Directory` to list files from\n *\n * @since 1.0.0\n */\n directory?: Directory;\n}\n\nexport interface GetUriOptions {\n /**\n * The path of the file to get the URI for\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The `Directory` to get the file under\n *\n * @since 1.0.0\n */\n directory: Directory;\n}\n\nexport interface StatOptions {\n /**\n * The path of the file to get data about\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The `Directory` to get the file under\n *\n * @since 1.0.0\n */\n directory?: Directory;\n}\n\nexport interface CopyOptions {\n /**\n * The existing file or directory\n *\n * @since 1.0.0\n */\n from: string;\n\n /**\n * The destination file or directory\n *\n * @since 1.0.0\n */\n to: string;\n\n /**\n * The `Directory` containing the existing file or directory\n *\n * @since 1.0.0\n */\n directory?: Directory;\n\n /**\n * The `Directory` containing the destination file or directory. If not supplied will use the 'directory'\n * parameter as the destination\n *\n * @since 1.0.0\n */\n toDirectory?: Directory;\n}\n\nexport type RenameOptions = CopyOptions;\n\nexport interface ReadFileResult {\n /**\n * The representation of the data contained in the file\n *\n * Note: Blob is only available on Web. On native, the data is returned as a string.\n *\n * @since 1.0.0\n */\n data: string | Blob;\n}\n\nexport interface WriteFileResult {\n /**\n * The uri where the file was written into\n *\n * @since 1.0.0\n */\n uri: string;\n}\n\nexport interface ReaddirResult {\n /**\n * List of files and directories inside the directory\n *\n * @since 1.0.0\n */\n files: FileInfo[];\n}\n\nexport interface FileInfo {\n /**\n * Name of the file or directory.\n */\n name: string;\n /**\n * Type of the file.\n *\n * @since 4.0.0\n */\n type: 'directory' | 'file';\n\n /**\n * Size of the file in bytes.\n *\n * @since 4.0.0\n */\n size: number;\n\n /**\n * Time of creation in milliseconds.\n *\n * It's not available on Android 7 and older devices.\n *\n * @since 4.0.0\n */\n ctime?: number;\n\n /**\n * Time of last modification in milliseconds.\n *\n * @since 4.0.0\n */\n mtime: number;\n\n /**\n * The uri of the file.\n *\n * @since 4.0.0\n */\n uri: string;\n}\n\nexport interface GetUriResult {\n /**\n * The uri of the file\n *\n * @since 1.0.0\n */\n uri: string;\n}\n\nexport interface StatResult {\n /**\n * Type of the file.\n *\n * @since 1.0.0\n */\n type: 'directory' | 'file';\n\n /**\n * Size of the file in bytes.\n *\n * @since 1.0.0\n */\n size: number;\n\n /**\n * Time of creation in milliseconds.\n *\n * It's not available on Android 7 and older devices.\n *\n * @since 1.0.0\n */\n ctime?: number;\n\n /**\n * Time of last modification in milliseconds.\n *\n * @since 1.0.0\n */\n mtime: number;\n\n /**\n * The uri of the file\n *\n * @since 1.0.0\n */\n uri: string;\n}\n\nexport interface CopyResult {\n /**\n * The uri where the file was copied into\n *\n * @since 4.0.0\n */\n uri: string;\n}\n\nexport interface DownloadFileOptions extends HttpOptions {\n /**\n * The path the downloaded file should be moved to.\n *\n * @since 5.1.0\n */\n path: string;\n /**\n * The directory to write the file to.\n * If this option is used, filePath can be a relative path rather than absolute.\n * The default is the `DATA` directory.\n *\n * @since 5.1.0\n */\n directory?: Directory;\n /**\n * An optional listener function to receive downloaded progress events.\n * If this option is used, progress event should be dispatched on every chunk received.\n * Chunks are throttled to every 100ms on Android/iOS to avoid slowdowns.\n *\n * @since 5.1.0\n */\n progress?: boolean;\n /**\n * Whether to create any missing parent directories.\n *\n * @default false\n * @since 5.1.2\n */\n recursive?: boolean;\n}\n\nexport interface DownloadFileResult {\n /**\n * The path the file was downloaded to.\n *\n * @since 5.1.0\n */\n path?: string;\n /**\n * The blob data of the downloaded file.\n * This is only available on web.\n *\n * @since 5.1.0\n */\n blob?: Blob;\n}\nexport interface ProgressStatus {\n /**\n * The url of the file being downloaded.\n *\n * @since 5.1.0\n */\n url: string;\n /**\n * The number of bytes downloaded so far.\n *\n * @since 5.1.0\n */\n bytes: number;\n /**\n * The total number of bytes to download for this file.\n *\n * @since 5.1.0\n */\n contentLength: number;\n}\n\n/**\n * A listener function that receives progress events.\n *\n * @since 5.1.0\n */\nexport type ProgressListener = (progress: ProgressStatus) => void;\n\nexport interface FilesystemPlugin {\n /**\n * Read a file from disk\n *\n * @since 1.0.0\n */\n readFile(options: ReadFileOptions): Promise<ReadFileResult>;\n\n /**\n * Write a file to disk in the specified location on device\n *\n * @since 1.0.0\n */\n writeFile(options: WriteFileOptions): Promise<WriteFileResult>;\n\n /**\n * Append to a file on disk in the specified location on device\n *\n * @since 1.0.0\n */\n appendFile(options: AppendFileOptions): Promise<void>;\n\n /**\n * Delete a file from disk\n *\n * @since 1.0.0\n */\n deleteFile(options: DeleteFileOptions): Promise<void>;\n\n /**\n * Create a directory.\n *\n * @since 1.0.0\n */\n mkdir(options: MkdirOptions): Promise<void>;\n\n /**\n * Remove a directory\n *\n * @since 1.0.0\n */\n rmdir(options: RmdirOptions): Promise<void>;\n\n /**\n * Return a list of files from the directory (not recursive)\n *\n * @since 1.0.0\n */\n readdir(options: ReaddirOptions): Promise<ReaddirResult>;\n\n /**\n * Return full File URI for a path and directory\n *\n * @since 1.0.0\n */\n getUri(options: GetUriOptions): Promise<GetUriResult>;\n\n /**\n * Return data about a file\n *\n * @since 1.0.0\n */\n stat(options: StatOptions): Promise<StatResult>;\n\n /**\n * Rename a file or directory\n *\n * @since 1.0.0\n */\n rename(options: RenameOptions): Promise<void>;\n\n /**\n * Copy a file or directory\n *\n * @since 1.0.0\n */\n copy(options: CopyOptions): Promise<CopyResult>;\n\n /**\n * Check read/write permissions.\n * Required on Android, only when using `Directory.Documents` or\n * `Directory.ExternalStorage`.\n *\n * @since 1.0.0\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request read/write permissions.\n * Required on Android, only when using `Directory.Documents` or\n * `Directory.ExternalStorage`.\n *\n * @since 1.0.0\n */\n requestPermissions(): Promise<PermissionStatus>;\n\n /**\n * Perform a http request to a server and download the file to the specified destination.\n *\n * @since 5.1.0\n */\n downloadFile(options: DownloadFileOptions): Promise<DownloadFileResult>;\n\n /**\n * Add a listener to file download progress events.\n *\n * @since 5.1.0\n */\n addListener(\n eventName: 'progress',\n listenerFunc: ProgressListener,\n ): Promise<PluginListenerHandle>;\n}\n\n/**\n * @deprecated Use `ReadFileOptions`.\n * @since 1.0.0\n */\nexport type FileReadOptions = ReadFileOptions;\n\n/**\n * @deprecated Use `ReadFileResult`.\n * @since 1.0.0\n */\nexport type FileReadResult = ReadFileResult;\n\n/**\n * @deprecated Use `WriteFileOptions`.\n * @since 1.0.0\n */\nexport type FileWriteOptions = WriteFileOptions;\n\n/**\n * @deprecated Use `WriteFileResult`.\n * @since 1.0.0\n */\nexport type FileWriteResult = WriteFileResult;\n\n/**\n * @deprecated Use `AppendFileOptions`.\n * @since 1.0.0\n */\nexport type FileAppendOptions = AppendFileOptions;\n\n/**\n * @deprecated Use `DeleteFileOptions`.\n * @since 1.0.0\n */\nexport type FileDeleteOptions = DeleteFileOptions;\n\n/**\n * @deprecated Use `Directory`.\n * @since 1.0.0\n */\nexport const FilesystemDirectory = Directory;\n\n/**\n * @deprecated Use `Encoding`.\n * @since 1.0.0\n */\nexport const FilesystemEncoding = Encoding;\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAUA,MAAM,CAAN,IAAY,SAqEX;AArED,WAAY,SAAS;IACnB;;;;;;;;;;;OAWG;IACH,oCAAuB,CAAA;IAEvB;;;;;;;OAOG;IACH,0BAAa,CAAA;IAEb;;;;;;;OAOG;IACH,gCAAmB,CAAA;IAEnB;;;;;;OAMG;IACH,4BAAe,CAAA;IAEf;;;;;;;;;;OAUG;IACH,kCAAqB,CAAA;IAErB;;;;;;;;;;OAUG;IACH,iDAAoC,CAAA;AACtC,CAAC,EArEW,SAAS,KAAT,SAAS,QAqEpB;AAED,MAAM,CAAN,IAAY,QAyBX;AAzBD,WAAY,QAAQ;IAClB;;;;OAIG;IACH,yBAAa,CAAA;IAEb;;;;;;OAMG;IACH,2BAAe,CAAA;IAEf;;;;;;OAMG;IACH,2BAAe,CAAA;AACjB,CAAC,EAzBW,QAAQ,KAAR,QAAQ,QAyBnB;AAimBD;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAE7C;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC","sourcesContent":["import type {\n HttpOptions,\n PermissionState,\n PluginListenerHandle,\n} from '@capacitor/core';\n\nexport interface PermissionStatus {\n publicStorage: PermissionState;\n}\n\nexport enum Directory {\n /**\n * The Documents directory.\n * On iOS it's the app's documents directory.\n * Use this directory to store user-generated content.\n * On Android it's the Public Documents folder, so it's accessible from other apps.\n * It's not accesible on Android 10 unless the app enables legacy External Storage\n * by adding `android:requestLegacyExternalStorage=\"true\"` in the `application` tag\n * in the `AndroidManifest.xml`.\n * On Android 11 or newer the app can only access the files/folders the app created.\n *\n * @since 1.0.0\n */\n Documents = 'DOCUMENTS',\n\n /**\n * The Data directory.\n * On iOS it will use the Documents directory.\n * On Android it's the directory holding application files.\n * Files will be deleted when the application is uninstalled.\n *\n * @since 1.0.0\n */\n Data = 'DATA',\n\n /**\n * The Library directory.\n * On iOS it will use the Library directory.\n * On Android it's the directory holding application files.\n * Files will be deleted when the application is uninstalled.\n *\n * @since 1.1.0\n */\n Library = 'LIBRARY',\n\n /**\n * The Cache directory.\n * Can be deleted in cases of low memory, so use this directory to write app-specific files.\n * that your app can re-create easily.\n *\n * @since 1.0.0\n */\n Cache = 'CACHE',\n\n /**\n * The external directory.\n * On iOS it will use the Documents directory.\n * On Android it's the directory on the primary shared/external\n * storage device where the application can place persistent files it owns.\n * These files are internal to the applications, and not typically visible\n * to the user as media.\n * Files will be deleted when the application is uninstalled.\n *\n * @since 1.0.0\n */\n External = 'EXTERNAL',\n\n /**\n * The external storage directory.\n * On iOS it will use the Documents directory.\n * On Android it's the primary shared/external storage directory.\n * It's not accesible on Android 10 unless the app enables legacy External Storage\n * by adding `android:requestLegacyExternalStorage=\"true\"` in the `application` tag\n * in the `AndroidManifest.xml`.\n * It's not accesible on Android 11 or newer.\n *\n * @since 1.0.0\n */\n ExternalStorage = 'EXTERNAL_STORAGE',\n}\n\nexport enum Encoding {\n /**\n * Eight-bit UCS Transformation Format\n *\n * @since 1.0.0\n */\n UTF8 = 'utf8',\n\n /**\n * Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the\n * Unicode character set\n * This encoding is only supported on Android.\n *\n * @since 1.0.0\n */\n ASCII = 'ascii',\n\n /**\n * Sixteen-bit UCS Transformation Format, byte order identified by an\n * optional byte-order mark\n * This encoding is only supported on Android.\n *\n * @since 1.0.0\n */\n UTF16 = 'utf16',\n}\n\nexport interface WriteFileOptions {\n /**\n * The path of the file to write\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The data to write\n *\n * Note: Blob data is only supported on Web.\n *\n * @since 1.0.0\n */\n data: string | Blob;\n\n /**\n * The `Directory` to store the file in\n *\n * @since 1.0.0\n */\n directory?: Directory;\n\n /**\n * The encoding to write the file in. If not provided, data\n * is written as base64 encoded.\n *\n * Pass Encoding.UTF8 to write data as string\n *\n * @since 1.0.0\n */\n encoding?: Encoding;\n\n /**\n * Whether to create any missing parent directories.\n *\n * @default false\n * @since 1.0.0\n */\n recursive?: boolean;\n}\n\nexport interface AppendFileOptions {\n /**\n * The path of the file to append\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The data to write\n *\n * @since 1.0.0\n */\n data: string;\n\n /**\n * The `Directory` to store the file in\n *\n * @since 1.0.0\n */\n directory?: Directory;\n\n /**\n * The encoding to write the file in. If not provided, data\n * is written as base64 encoded.\n *\n * Pass Encoding.UTF8 to write data as string\n *\n * @since 1.0.0\n */\n encoding?: Encoding;\n}\n\nexport interface ReadFileOptions {\n /**\n * The path of the file to read\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The `Directory` to read the file from\n *\n * @since 1.0.0\n */\n directory?: Directory;\n\n /**\n * The encoding to read the file in, if not provided, data\n * is read as binary and returned as base64 encoded.\n *\n * Pass Encoding.UTF8 to read data as string\n *\n * @since 1.0.0\n */\n encoding?: Encoding;\n}\n\nexport interface DeleteFileOptions {\n /**\n * The path of the file to delete\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The `Directory` to delete the file from\n *\n * @since 1.0.0\n */\n directory?: Directory;\n}\n\nexport interface MkdirOptions {\n /**\n * The path of the new directory\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The `Directory` to make the new directory in\n *\n * @since 1.0.0\n */\n directory?: Directory;\n\n /**\n * Whether to create any missing parent directories as well.\n *\n * @default false\n * @since 1.0.0\n */\n recursive?: boolean;\n}\n\nexport interface RmdirOptions {\n /**\n * The path of the directory to remove\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The `Directory` to remove the directory from\n *\n * @since 1.0.0\n */\n directory?: Directory;\n\n /**\n * Whether to recursively remove the contents of the directory\n *\n * @default false\n * @since 1.0.0\n */\n recursive?: boolean;\n}\n\nexport interface ReaddirOptions {\n /**\n * The path of the directory to read\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The `Directory` to list files from\n *\n * @since 1.0.0\n */\n directory?: Directory;\n}\n\nexport interface GetUriOptions {\n /**\n * The path of the file to get the URI for\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The `Directory` to get the file under\n *\n * @since 1.0.0\n */\n directory: Directory;\n}\n\nexport interface StatOptions {\n /**\n * The path of the file to get data about\n *\n * @since 1.0.0\n */\n path: string;\n\n /**\n * The `Directory` to get the file under\n *\n * @since 1.0.0\n */\n directory?: Directory;\n}\n\nexport interface CopyOptions {\n /**\n * The existing file or directory\n *\n * @since 1.0.0\n */\n from: string;\n\n /**\n * The destination file or directory\n *\n * @since 1.0.0\n */\n to: string;\n\n /**\n * The `Directory` containing the existing file or directory\n *\n * @since 1.0.0\n */\n directory?: Directory;\n\n /**\n * The `Directory` containing the destination file or directory. If not supplied will use the 'directory'\n * parameter as the destination\n *\n * @since 1.0.0\n */\n toDirectory?: Directory;\n}\n\nexport type RenameOptions = CopyOptions;\n\nexport interface ReadFileResult {\n /**\n * The representation of the data contained in the file\n *\n * Note: Blob is only available on Web. On native, the data is returned as a string.\n *\n * @since 1.0.0\n */\n data: string | Blob;\n}\n\nexport interface WriteFileResult {\n /**\n * The uri where the file was written into\n *\n * @since 1.0.0\n */\n uri: string;\n}\n\nexport interface ReaddirResult {\n /**\n * List of files and directories inside the directory\n *\n * @since 1.0.0\n */\n files: FileInfo[];\n}\n\nexport interface FileInfo {\n /**\n * Name of the file or directory.\n */\n name: string;\n /**\n * Type of the file.\n *\n * @since 4.0.0\n */\n type: 'directory' | 'file';\n\n /**\n * Size of the file in bytes.\n *\n * @since 4.0.0\n */\n size: number;\n\n /**\n * Time of creation in milliseconds.\n *\n * It's not available on Android 7 and older devices.\n *\n * @since 4.0.0\n */\n ctime?: number;\n\n /**\n * Time of last modification in milliseconds.\n *\n * @since 4.0.0\n */\n mtime: number;\n\n /**\n * The uri of the file.\n *\n * @since 4.0.0\n */\n uri: string;\n}\n\nexport interface GetUriResult {\n /**\n * The uri of the file\n *\n * @since 1.0.0\n */\n uri: string;\n}\n\nexport interface StatResult {\n /**\n * Type of the file.\n *\n * @since 1.0.0\n */\n type: 'directory' | 'file';\n\n /**\n * Size of the file in bytes.\n *\n * @since 1.0.0\n */\n size: number;\n\n /**\n * Time of creation in milliseconds.\n *\n * It's not available on Android 7 and older devices.\n *\n * @since 1.0.0\n */\n ctime?: number;\n\n /**\n * Time of last modification in milliseconds.\n *\n * @since 1.0.0\n */\n mtime: number;\n\n /**\n * The uri of the file\n *\n * @since 1.0.0\n */\n uri: string;\n}\n\nexport interface CopyResult {\n /**\n * The uri where the file was copied into\n *\n * @since 4.0.0\n */\n uri: string;\n}\n\nexport interface DownloadFileOptions extends HttpOptions {\n /**\n * The path the downloaded file should be moved to.\n *\n * @since 5.1.0\n */\n path: string;\n /**\n * The directory to write the file to.\n * If this option is used, filePath can be a relative path rather than absolute.\n * The default is the `DATA` directory.\n *\n * @since 5.1.0\n */\n directory?: Directory;\n /**\n * An optional listener function to receive downloaded progress events.\n * If this option is used, progress event should be dispatched on every chunk received.\n * Chunks are throttled to every 100ms on Android/iOS to avoid slowdowns.\n *\n * @since 5.1.0\n */\n progress?: boolean;\n /**\n * Whether to create any missing parent directories.\n *\n * @default false\n * @since 5.1.2\n */\n recursive?: boolean;\n}\n\nexport interface DownloadFileResult {\n /**\n * The path the file was downloaded to.\n *\n * @since 5.1.0\n */\n path?: string;\n /**\n * The blob data of the downloaded file.\n * This is only available on web.\n *\n * @since 5.1.0\n */\n blob?: Blob;\n}\nexport interface ProgressStatus {\n /**\n * The url of the file being downloaded.\n *\n * @since 5.1.0\n */\n url: string;\n /**\n * The number of bytes downloaded so far.\n *\n * @since 5.1.0\n */\n bytes: number;\n /**\n * The total number of bytes to download for this file.\n *\n * @since 5.1.0\n */\n contentLength: number;\n}\n\n/**\n * A listener function that receives progress events.\n *\n * @since 5.1.0\n */\nexport type ProgressListener = (progress: ProgressStatus) => void;\n\nexport interface FilesystemPlugin {\n /**\n * Read a file from disk\n *\n * @since 1.0.0\n */\n readFile(options: ReadFileOptions): Promise<ReadFileResult>;\n\n /**\n * Write a file to disk in the specified location on device\n *\n * @since 1.0.0\n */\n writeFile(options: WriteFileOptions): Promise<WriteFileResult>;\n\n /**\n * Append to a file on disk in the specified location on device\n *\n * @since 1.0.0\n */\n appendFile(options: AppendFileOptions): Promise<void>;\n\n /**\n * Delete a file from disk\n *\n * @since 1.0.0\n */\n deleteFile(options: DeleteFileOptions): Promise<void>;\n\n /**\n * Create a directory.\n *\n * @since 1.0.0\n */\n mkdir(options: MkdirOptions): Promise<void>;\n\n /**\n * Remove a directory\n *\n * @since 1.0.0\n */\n rmdir(options: RmdirOptions): Promise<void>;\n\n /**\n * Return a list of files from the directory (not recursive)\n *\n * @since 1.0.0\n */\n readdir(options: ReaddirOptions): Promise<ReaddirResult>;\n\n /**\n * Return full File URI for a path and directory\n *\n * @since 1.0.0\n */\n getUri(options: GetUriOptions): Promise<GetUriResult>;\n\n /**\n * Return data about a file\n *\n * @since 1.0.0\n */\n stat(options: StatOptions): Promise<StatResult>;\n\n /**\n * Rename a file or directory\n *\n * @since 1.0.0\n */\n rename(options: RenameOptions): Promise<void>;\n\n /**\n * Copy a file or directory\n *\n * @since 1.0.0\n */\n copy(options: CopyOptions): Promise<CopyResult>;\n\n /**\n * Check read/write permissions.\n * Required on Android, only when using `Directory.Documents` or\n * `Directory.ExternalStorage`.\n *\n * @since 1.0.0\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request read/write permissions.\n * Required on Android, only when using `Directory.Documents` or\n * `Directory.ExternalStorage`.\n *\n * @since 1.0.0\n */\n requestPermissions(): Promise<PermissionStatus>;\n\n /**\n * Perform a http request to a server and download the file to the specified destination.\n *\n * @since 5.1.0\n */\n downloadFile(options: DownloadFileOptions): Promise<DownloadFileResult>;\n\n /**\n * Add a listener to file download progress events.\n *\n * @since 5.1.0\n */\n addListener(\n eventName: 'progress',\n listenerFunc: ProgressListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Remove all listeners for this plugin.\n *\n * @since 5.2.0\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * @deprecated Use `ReadFileOptions`.\n * @since 1.0.0\n */\nexport type FileReadOptions = ReadFileOptions;\n\n/**\n * @deprecated Use `ReadFileResult`.\n * @since 1.0.0\n */\nexport type FileReadResult = ReadFileResult;\n\n/**\n * @deprecated Use `WriteFileOptions`.\n * @since 1.0.0\n */\nexport type FileWriteOptions = WriteFileOptions;\n\n/**\n * @deprecated Use `WriteFileResult`.\n * @since 1.0.0\n */\nexport type FileWriteResult = WriteFileResult;\n\n/**\n * @deprecated Use `AppendFileOptions`.\n * @since 1.0.0\n */\nexport type FileAppendOptions = AppendFileOptions;\n\n/**\n * @deprecated Use `DeleteFileOptions`.\n * @since 1.0.0\n */\nexport type FileDeleteOptions = DeleteFileOptions;\n\n/**\n * @deprecated Use `Directory`.\n * @since 1.0.0\n */\nexport const FilesystemDirectory = Directory;\n\n/**\n * @deprecated Use `Encoding`.\n * @since 1.0.0\n */\nexport const FilesystemEncoding = Encoding;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/filesystem",
|
|
3
|
-
"version": "5.1.5-nightly-
|
|
3
|
+
"version": "5.1.5-nightly-20231101T150452.0",
|
|
4
4
|
"description": "The Filesystem API provides a NodeJS-like API for working with files on the device.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "8cc0504762ba44a71b750aca9d0749b74107d273"
|
|
83
83
|
}
|