diff --git a/layouts/partials/qmlparams.html b/layouts/partials/qmlparams.html
index 1135651..9445194 100644
--- a/layouts/partials/qmlparams.html
+++ b/layouts/partials/qmlparams.html
@@ -1,6 +1,6 @@
{{- $first := true -}}
-{{- range $param, $type := . -}}
+{{- range $param := . -}}
{{- if ne $first true -}}, {{ end -}}
{{- $first = false -}}
- {{ $param }}: {{ partial "qmltype.html" $type }}
-{{- end -}}
\ No newline at end of file
+ {{ $param.name }}: {{ partial "qmltype.html" $param.type }}
+{{- end -}}
diff --git a/typegen/src/outform.rs b/typegen/src/outform.rs
index a6012af..f893f56 100644
--- a/typegen/src/outform.rs
+++ b/typegen/src/outform.rs
@@ -52,14 +52,21 @@ pub struct Function {
pub name: String,
pub id: String,
pub details: Option,
- pub params: HashMap,
+ pub params: Vec,
}
#[derive(Debug, Serialize)]
pub struct Signal {
pub name: String,
pub details: Option,
- pub params: HashMap,
+ pub params: Vec,
+}
+
+#[derive(Debug, Serialize)]
+pub struct Parameter {
+ pub name: String,
+ #[serde(rename = "type")]
+ pub type_: Type,
}
#[derive(Debug, Serialize)]
diff --git a/typegen/src/resolver.rs b/typegen/src/resolver.rs
index f54de9f..7f7192f 100644
--- a/typegen/src/resolver.rs
+++ b/typegen/src/resolver.rs
@@ -1,7 +1,7 @@
use std::collections::HashMap;
use crate::{
- outform::{self, Flag, PropertyType},
+ outform::{self, Flag, Parameter, PropertyType},
typespec::{FnParam, Function, Property, Signal, TypeSpec},
};
@@ -147,7 +147,8 @@ pub fn resolve_types(
ret: qmlparamtype(&func.ret, typespec),
name: func.name.clone(),
id: {
- let params = func.params
+ let params = func
+ .params
.iter()
.map(|FnParam { type_, .. }| qmlparamtype(type_, typespec).name);
@@ -166,7 +167,10 @@ pub fn resolve_types(
params: func
.params
.iter()
- .map(|FnParam { type_, name }| (name.clone(), qmlparamtype(type_, typespec)))
+ .map(|FnParam { type_, name }| Parameter {
+ name: name.clone(),
+ type_: qmlparamtype(type_, typespec),
+ })
.collect(),
}
}
@@ -178,7 +182,10 @@ pub fn resolve_types(
params: func
.params
.iter()
- .map(|FnParam { type_, name }| (name.clone(), qmlparamtype(type_, typespec)))
+ .map(|FnParam { type_, name }| Parameter {
+ name: name.clone(),
+ type_: qmlparamtype(type_, typespec),
+ })
.collect(),
}
}