Skip to main content

ik_mini_epub/
lib.rs

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