diff --git a/DOCS.md b/DOCS.md index 57dcbc8..285a581 100644 --- a/DOCS.md +++ b/DOCS.md @@ -51,7 +51,25 @@ namespace app.bsky.feed.post.`record` { The first namespace in the file will be turned into JSON. However, you can put more of them in the same file (if you want to reference them) or `import` other `.tsp` files from it. -(Currently, we're assuming you write everything in typelex. You can grab common Lexicons from the [Playground](https://playground.typelex.org/)). It should not be hard to also stub out dependencies with namespaces + empty defs, or to add special syntax for a ref (which isn't availeble to resolve). For now, I haven't done that. This needs more thought.) +## Dependencies + +You can `import` other `.tsp` files. + +For now, we're assuming you write everything in typelex. You can grab common Lexicons from the [Playground](https://playground.typelex.org/). However, if you just want a ref, you could stub out any external Lexicon, like this: + +``` +/** Some docstring */ +namespace com.example.defs { + subject: com.atproto.repo.strongRef.Main; // OK to use here +} + +// This is a stub +namespace com.atproto.repo.strongRef { + model Main { } +} +``` + +Maybe this should be more ergonomic. I haven't tried this in a real project so I don't know what workflows are good. ## Top-Level Lexicon Types