@@ -143,7 +143,6 @@ pub async fn list_from_forest(
143143/// This is critical for large files (1GB+) where passing `Vec<u8>` through
144144/// FFI would cause out-of-memory errors.
145145#[ cfg( not( target_arch = "wasm32" ) ) ]
146- #[ flutter_rust_bridge:: frb( ignore) ]
147146pub async fn put_flat_from_path (
148147 client : & EncryptedClientHandle ,
149148 bucket : String ,
@@ -163,11 +162,21 @@ pub async fn put_flat_from_path(
163162 Ok ( result. into ( ) )
164163}
165164
165+ #[ cfg( target_arch = "wasm32" ) ]
166+ pub async fn put_flat_from_path (
167+ _client : & EncryptedClientHandle ,
168+ _bucket : String ,
169+ _path : String ,
170+ _file_path : String ,
171+ _content_type : Option < String > ,
172+ ) -> anyhow:: Result < PutResult > {
173+ anyhow:: bail!( "put_flat_from_path is not supported on WASM; read the file in Dart and call put_flat" )
174+ }
175+
166176/// Upload a file from a local path without immediate forest save (deferred)
167177///
168178/// Same as `put_flat_from_path` but defers the forest save for batch efficiency.
169179#[ cfg( not( target_arch = "wasm32" ) ) ]
170- #[ flutter_rust_bridge:: frb( ignore) ]
171180pub async fn put_flat_from_path_deferred (
172181 client : & EncryptedClientHandle ,
173182 bucket : String ,
@@ -187,15 +196,30 @@ pub async fn put_flat_from_path_deferred(
187196 Ok ( result. into ( ) )
188197}
189198
199+ #[ cfg( target_arch = "wasm32" ) ]
200+ pub async fn put_flat_from_path_deferred (
201+ _client : & EncryptedClientHandle ,
202+ _bucket : String ,
203+ _path : String ,
204+ _file_path : String ,
205+ _content_type : Option < String > ,
206+ ) -> anyhow:: Result < PutResult > {
207+ anyhow:: bail!( "put_flat_from_path_deferred is not supported on WASM; read the file in Dart and call put_flat_deferred" )
208+ }
209+
190210/// Get the size of a file without reading it into memory
191211#[ cfg( not( target_arch = "wasm32" ) ) ]
192- #[ flutter_rust_bridge:: frb( ignore) ]
193212pub async fn get_file_size ( file_path : String ) -> anyhow:: Result < u64 > {
194213 let metadata = tokio:: fs:: metadata ( & file_path) . await
195214 . with_context ( || format ! ( "Failed to get file metadata: {}" , file_path) ) ?;
196215 Ok ( metadata. len ( ) )
197216}
198217
218+ #[ cfg( target_arch = "wasm32" ) ]
219+ pub async fn get_file_size ( _file_path : String ) -> anyhow:: Result < u64 > {
220+ anyhow:: bail!( "get_file_size is not supported on WASM; use the browser File API in Dart" )
221+ }
222+
199223// ============================================================================
200224// Subtree Operations (for Sharing)
201225// ============================================================================
0 commit comments