1use std::collections::HashMap;
4use std::sync::Arc;
5
6pub type LoaderInputFn = Arc<dyn Fn(&HashMap<String, String>) -> serde_json::Value + Send + Sync>;
7
8pub struct LoaderDef {
9 pub data_key: String,
10 pub procedure: String,
11 pub input_fn: LoaderInputFn,
12}
13
14pub struct LayoutChainEntry {
17 pub id: String,
18 pub loader_keys: Vec<String>,
19}
20
21pub struct PageDef {
22 pub route: String,
24 pub template: String,
25 pub locale_templates: Option<HashMap<String, String>>,
27 pub loaders: Vec<LoaderDef>,
28 pub data_id: String,
30 pub layout_chain: Vec<LayoutChainEntry>,
32 pub page_loader_keys: Vec<String>,
34 pub i18n_keys: Vec<String>,
36}
37
38#[derive(Clone)]
40pub struct I18nConfig {
41 pub locales: Vec<String>,
42 pub default: String,
43 pub mode: String,
44 pub cache: bool,
45 pub route_hashes: HashMap<String, String>,
47 pub content_hashes: HashMap<String, HashMap<String, String>>,
49 pub messages: HashMap<String, HashMap<String, serde_json::Value>>,
51 pub dist_dir: Option<std::path::PathBuf>,
53}