From 4a67cb2724c50cbeaf2e1c2e75f32cbeb19a29ac Mon Sep 17 00:00:00 2001 From: Robin Genz Date: Mon, 30 Oct 2023 09:21:25 +0100 Subject: [PATCH 1/4] feat(filesystem): add `removeAllListeners` method --- filesystem/ios/Plugin/FilesystemPlugin.m | 1 + filesystem/src/definitions.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/filesystem/ios/Plugin/FilesystemPlugin.m b/filesystem/ios/Plugin/FilesystemPlugin.m index d7c0adb60..f16e79556 100644 --- a/filesystem/ios/Plugin/FilesystemPlugin.m +++ b/filesystem/ios/Plugin/FilesystemPlugin.m @@ -18,4 +18,5 @@ CAP_PLUGIN_METHOD(checkPermissions, CAPPluginReturnPromise); CAP_PLUGIN_METHOD(requestPermissions, CAPPluginReturnPromise); CAP_PLUGIN_METHOD(downloadFile, CAPPluginReturnPromise); + CAP_PLUGIN_METHOD(removeAllListeners, CAPPluginReturnNone); ) diff --git a/filesystem/src/definitions.ts b/filesystem/src/definitions.ts index d13af5293..5da611ed6 100644 --- a/filesystem/src/definitions.ts +++ b/filesystem/src/definitions.ts @@ -669,6 +669,12 @@ export interface FilesystemPlugin { eventName: 'progress', listenerFunc: ProgressListener, ): Promise & PluginListenerHandle; + /** + * Remove all listeners for this plugin. + * + * @since 5.2.0 + */ + removeAllListeners(): Promise; } /** From a44f193ea742c6a11e348da44a88a161572cbd38 Mon Sep 17 00:00:00 2001 From: Robin Genz Date: Tue, 31 Oct 2023 13:31:07 +0100 Subject: [PATCH 2/4] style: format --- filesystem/src/definitions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesystem/src/definitions.ts b/filesystem/src/definitions.ts index 5da611ed6..ee20201c9 100644 --- a/filesystem/src/definitions.ts +++ b/filesystem/src/definitions.ts @@ -671,7 +671,7 @@ export interface FilesystemPlugin { ): Promise & PluginListenerHandle; /** * Remove all listeners for this plugin. - * + * * @since 5.2.0 */ removeAllListeners(): Promise; From 12f684670455a20cfd74c3cede9b85aabfe17bc0 Mon Sep 17 00:00:00 2001 From: Robin Genz Date: Tue, 31 Oct 2023 13:34:37 +0100 Subject: [PATCH 3/4] Update filesystem/ios/Plugin/FilesystemPlugin.m Co-authored-by: jcesarmobile --- filesystem/ios/Plugin/FilesystemPlugin.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesystem/ios/Plugin/FilesystemPlugin.m b/filesystem/ios/Plugin/FilesystemPlugin.m index f16e79556..bd6b9db17 100644 --- a/filesystem/ios/Plugin/FilesystemPlugin.m +++ b/filesystem/ios/Plugin/FilesystemPlugin.m @@ -18,5 +18,5 @@ CAP_PLUGIN_METHOD(checkPermissions, CAPPluginReturnPromise); CAP_PLUGIN_METHOD(requestPermissions, CAPPluginReturnPromise); CAP_PLUGIN_METHOD(downloadFile, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(removeAllListeners, CAPPluginReturnNone); + CAP_PLUGIN_METHOD(removeAllListeners, CAPPluginReturnPromise); ) From 5869f69f908137c5fe1a0b171a70cf64ede95446 Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Tue, 31 Oct 2023 19:36:28 +0100 Subject: [PATCH 4/4] docs --- filesystem/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/filesystem/README.md b/filesystem/README.md index 41aa452f0..cfa757077 100644 --- a/filesystem/README.md +++ b/filesystem/README.md @@ -101,6 +101,7 @@ const readFilePath = async () => { * [`requestPermissions()`](#requestpermissions) * [`downloadFile(...)`](#downloadfile) * [`addListener('progress', ...)`](#addlistenerprogress) +* [`removeAllListeners()`](#removealllisteners) * [Interfaces](#interfaces) * [Type Aliases](#type-aliases) * [Enums](#enums) @@ -382,6 +383,19 @@ Add a listener to file download progress events. -------------------- +### removeAllListeners() + +```typescript +removeAllListeners() => Promise +``` + +Remove all listeners for this plugin. + +**Since:** 5.2.0 + +-------------------- + + ### Interfaces