use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize)] pub struct TypeSpec { pub typemap: Vec, pub classes: Vec, pub gadgets: Vec, pub enums: Vec, } impl Default for TypeSpec { fn default() -> Self { Self { typemap: Vec::new(), classes: Vec::new(), gadgets: Vec::new(), enums: Vec::new(), } } } #[derive(Debug, Serialize, Deserialize)] pub struct QmlTypeMapping { pub name: String, pub cname: String, pub module: Option, } #[derive(Debug, Serialize, Deserialize)] pub struct Class { pub name: String, pub module: String, pub description: Option, pub details: Option, pub superclass: String, pub singleton: bool, pub uncreatable: bool, pub properties: Vec, pub functions: Vec, } #[derive(Debug, Serialize, Deserialize)] pub struct Gadget { pub cname: String, pub properties: Vec, } #[derive(Debug, Serialize, Deserialize)] pub struct Property { #[serde(rename = "type")] pub type_: String, pub name: String, pub details: Option, pub readable: bool, pub writable: bool, pub default: bool, } #[derive(Debug, Serialize, Deserialize)] pub struct Function { pub ret: String, pub name: String, pub details: Option, pub params: Vec } #[derive(Debug, Serialize, Deserialize)] pub struct FnParam { #[serde(rename = "type")] pub type_: String, pub name: String, } #[derive(Debug, Serialize, Deserialize)] pub struct Enum { pub name: String, pub cname: Option, pub module: Option, pub description: Option, pub details: Option, pub varaints: Vec, } #[derive(Debug, Serialize, Deserialize)] pub struct Variant { pub name: String, pub details: Option, }