Hey everyone. I am trying to create types for my settings.json values.
I’ve been able to extend it (and add types to it as necessary), but I can’t seem to figure out how to modify the type for Meteor.settings.public. Meteor already provides a type for that of { [id: string]: any; }.
Any recommendations or patterns, generally speaking, for adding types to Meteor.settings, and specifically to override Meteor.settings.public?
Since you don’t really have control over what gets sent into Meteor.settings (so easy to make mistakes eg when passing in from an env var) I would recommend a zod schema validation wrapping your access to Meteor.settings
This makes sense to me. I was planning to use zod to parse them ala Matt Pocock’s video here: https://www.youtube.com/watch?v=q1im-hMlKhM. So, in light of the fact that I can’t directly change the type of Meteor.settings.public, the wrapper seems like it should work.