diff --git a/docs/ember/template-only-components.md b/docs/ember/template-only-components.md index 6df41ee59..c344b695a 100644 --- a/docs/ember/template-only-components.md +++ b/docs/ember/template-only-components.md @@ -26,6 +26,27 @@ declare module '@glint/environment-ember-loose/registry' { Note that the runtime content of this module (effectively `export default templateOnlyComponent();`) is exactly what Ember generates at build time when creating a backing module for a template-only component. +Additionally, you can create a backing module using the `TOC` type, which is a convenience alias for `templateOnlyComponent`. + +{% code title="app/components/shout.ts" %} + +```typescript +import type { TOC } From '@ember/component/template-only'; + +interface ShoutSignature { + Element: HTMLDivElement; + Args: { message: string }; + Blocks: { + default: [shoutedMessage: string]; + }; +} + +declare const Shout: TOC; +export default Shout; +``` + +{% endcode %} + Due to the way TypeScript works, it's not possible to have a generic signature for template-only components: ```typescript