diff --git a/client.d.ts b/client.d.ts index fc37f49..c2fbb50 100644 --- a/client.d.ts +++ b/client.d.ts @@ -65,6 +65,7 @@ export declare namespace callback { export declare namespace cloud { export function isEnabledForAccount(): boolean export function isEnabledForApp(): boolean + export function setEnabledForApp(enabled: boolean): void export function readFile(name: string): string export function writeFile(name: string, content: string): boolean export function deleteFile(name: string): boolean diff --git a/src/api/cloud.rs b/src/api/cloud.rs index fed3165..fa2b537 100644 --- a/src/api/cloud.rs +++ b/src/api/cloud.rs @@ -24,6 +24,12 @@ pub mod cloud { client.remote_storage().is_cloud_enabled_for_app() } + #[napi] + pub fn set_enabled_for_app(enabled: bool) { + let client = crate::client::get_client(); + client.remote_storage().set_cloud_enabled_for_app(enabled) + } + #[napi] pub fn read_file(name: String) -> Result { let client = crate::client::get_client();