···236237This works across files too—just remember to `import` the file with the definition.
238239-### External Stubs
240241-If you don't have TypeSpec definitions for external Lexicons, you can stub them out:
242243```typescript
244import "@typelex/emitter";
···249 }
250}
251252-// Empty stub (like .d.ts in TypeScript)
0253namespace com.atproto.label.defs {
254 model SelfLabels { }
255}
256```
257258-You could collect stubs in one file and import them:
00259260```typescript
261import "@typelex/emitter";
···268}
269```
270271-You'll want to replace the stubbed lexicons in the output folder with their real JSON before running codegen.
00000000000000000272273### Inline Models
274
···236237This works across files too—just remember to `import` the file with the definition.
238239+### External References
240241+If you don't have TypeSpec definitions for external Lexicons, you can stub them out using the `@external` decorator:
242243```typescript
244import "@typelex/emitter";
···249 }
250}
251252+// External stub (like .d.ts in TypeScript)
253+@external
254namespace com.atproto.label.defs {
255 model SelfLabels { }
256}
257```
258259+The `@external` decorator tells the emitter to skip JSON output for that namespace. This is useful when referencing definitions from other Lexicons that you don't want to re-emit.
260+261+You could collect external stubs in one file and import them:
262263```typescript
264import "@typelex/emitter";
···271}
272```
273274+Then in `atproto-stubs.tsp`:
275+276+```typescript
277+import "@typelex/emitter";
278+279+@external
280+namespace com.atproto.label.defs {
281+ model SelfLabels { }
282+}
283+284+@external
285+namespace com.atproto.repo.defs {
286+ model StrongRef { }
287+}
288+// ... more stubs
289+```
290+291+You'll want to ensure the real JSON for external Lexicons is available before running codegen.
292293### Inline Models
294