Skip to main content

wp_mini_html/
lib.rs

1// Keep modules private to the crate
2mod auth;
3mod html;
4mod processor;
5mod error;
6mod types;
7mod lang_util;
8mod template;
9
10// Expose own items
11pub use auth::{login, logout};
12pub use error::AppError;
13pub use crate::types::StoryDownload;
14
15// Re-export the necessary types from the wp-mini crate
16pub use wp_mini::field::StoryField;
17pub use wp_mini::types::StoryResponse; // We return this, so re-export it too!
18
19// Be explicit with the processor module's public API
20#[cfg(not(target_arch = "wasm32"))]
21pub use processor::download_story_to_file; // Only expose `download_story_to_file` in non-WASM builds
22#[cfg(not(target_arch = "wasm32"))]
23pub use processor::download_story_to_folder; // Only expose `download_story_to_folder` in non-WASM builds
24
25pub use processor::download_story_to_memory;
26
27// Prelude would then also be explicit
28pub mod prelude {
29    pub use crate::auth::{login, logout};
30    pub use crate::error::AppError;
31    pub use crate::types::StoryDownload;
32
33    // Re-export from the prelude as well for convenience
34    pub use wp_mini::field::StoryField;
35    pub use wp_mini::types::StoryResponse;
36
37    // Only expose `download_story_to_file` in non-WASM builds
38    #[cfg(not(target_arch = "wasm32"))]
39    pub use crate::processor::download_story_to_file;
40
41    // Only expose `download_story_to_folder` in non-WASM builds
42    #[cfg(not(target_arch = "wasm32"))]
43    pub use crate::processor::download_story_to_folder;
44
45
46    pub use crate::processor::download_story_to_memory;
47}