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 derives: Option<serde_json::Value>,
30 pub data_id: String,
32 pub layout_chain: Vec<LayoutChainEntry>,
34 pub page_loader_keys: Vec<String>,
36 pub i18n_keys: Vec<String>,
38 pub projections: Option<HashMap<String, Vec<String>>>,
40 pub prerender: bool,
42 pub static_dir: Option<std::path::PathBuf>,
44}
45
46#[derive(Clone)]
48pub struct I18nConfig {
49 pub locales: Vec<String>,
50 pub default: String,
51 pub mode: String,
52 pub cache: bool,
53 pub route_hashes: HashMap<String, String>,
55 pub content_hashes: HashMap<String, HashMap<String, String>>,
57 pub messages: HashMap<String, HashMap<String, serde_json::Value>>,
59 pub dist_dir: Option<std::path::PathBuf>,
61}