From b6202b646a0d5ecced301d9bac8bfcaf977d7ee4 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 15 Dec 2022 22:51:55 +0100 Subject: Reflection for castables --- src/model/content.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/model/content.rs') diff --git a/src/model/content.rs b/src/model/content.rs index e73fa4a8..df910a58 100644 --- a/src/model/content.rs +++ b/src/model/content.rs @@ -11,7 +11,8 @@ use thin_vec::ThinVec; use typst_macros::node; use super::{ - capability, capable, Args, Guard, Key, Property, Recipe, Style, StyleMap, Value, Vm, + capability, capable, Args, Guard, Key, ParamInfo, Property, Recipe, Style, StyleMap, + Value, Vm, }; use crate::diag::{SourceResult, StrResult}; use crate::syntax::Span; @@ -426,6 +427,11 @@ pub trait Node: 'static + Capable { where Self: Sized; + /// List the settable properties. + fn properties() -> Vec + where + Self: Sized; + /// Access a field on this node. fn field(&self, name: &str) -> Option; } -- cgit v1.2.3