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 pub projections: Option<HashMap<String, Vec<String>>>,
38}
39
40#[derive(Clone)]
42pub struct I18nConfig {
43 pub locales: Vec<String>,
44 pub default: String,
45 pub mode: String,
46 pub cache: bool,
47 pub route_hashes: HashMap<String, String>,
49 pub content_hashes: HashMap<String, HashMap<String, String>>,
51 pub messages: HashMap<String, HashMap<String, serde_json::Value>>,
53 pub dist_dir: Option<std::path::PathBuf>,
55}