How can I have global configuration parameters for a module/package?

For the record, my favorite option for now is to expose all the package content through a dictionary, rather than through toplevel definitions. If we later want to add parameters, we expose a function that builds a dictionary instead. (I sketched a concrete example in this post: Importing with parameters, or switchable templates - #8 by gasche )

I think that better language support for this in Typst might take the form of blurring the notion between package/module and dictionary:

  • package authors write something that looks more like toplevel declarations, but it in fact is interpreted as dictionary (and not a separate notion of “module”)
  • on the user side, the #import support for selecting certain names, using quantified or non-quantified names, etc., also becomes available for packages that export a dictionary or a function returning a dictionary