I would not treat the Typst function itself as the schema. Instead, separate the system into three contracts:
- Anytype schema — how information is stored.
- Render model schema — a normalized, versioned TypeScript/JSON representation.
- Typst template — how that render model is presented.
This avoids tightly coupling your Anytype property names, linked-object structure, and Typst layout.