Skip to content

Commit cd2a02d

Browse files
chriskrychovlascik
andcommitted
Types: include a template registry and README notes
Co-authored-by: V. Lascik <vlascik@users.noreply.github.com>
1 parent ca3f722 commit cd2a02d

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,23 @@ Usage:
237237
</Root>
238238
```
239239

240+
## Glint usage
241+
If you are using [Glint](https://typed-ember.gitbook.io/glint/) and `environment-ember-loose`, you can add all the modifiers to your app at once by adding
242+
243+
```ts
244+
import type RenderModifiersRegistry from '@ember/render-modifiers/template-registry';
245+
```
246+
to your app's e.g. `types/glint.d.ts` file, and making sure your registry extends from RenderModifiersRegistry:
247+
248+
```ts
249+
declare module '@glint/environment-ember-loose/registry' {
250+
export default interface Registry
251+
extends RenderModifiersRegistry {
252+
// ...
253+
}
254+
}
255+
```
256+
240257
## Contributing
241258

242259
See the [Contributing](CONTRIBUTING.md) guide for details.

types/template-registry.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type didInsert from './modifiers/did-insert';
2+
import type didUpdate from './modifiers/did-update';
3+
import type willDestroy from './modifiers/will-destroy';
4+
5+
export default interface RenderModifiersRegistry {
6+
'did-insert': typeof didInsert;
7+
'did-update': typeof didUpdate;
8+
'will-destroy': typeof willDestroy;
9+
}

0 commit comments

Comments
 (0)