Skip to content

Commit

Permalink
Types: include a template registry and README notes
Browse files Browse the repository at this point in the history
Co-authored-by: V. Lascik <vlascik@users.noreply.github.com>
  • Loading branch information
chriskrycho and vlascik committed May 31, 2023
1 parent 9d75bf3 commit 917da97
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,23 @@ Usage:
</Root>
```

## Glint usage
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

```ts
import type RenderModifiersRegistry from '@ember/render-modifiers/template-registry';
```
to your app's e.g. `types/glint.d.ts` file, and making sure your registry extends from RenderModifiersRegistry:

```ts
declare module '@glint/environment-ember-loose/registry' {
export default interface Registry
extends RenderModifiersRegistry {
// ...
}
}
```

## Contributing

See the [Contributing](CONTRIBUTING.md) guide for details.
Expand Down
9 changes: 9 additions & 0 deletions types/template-registry.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type didInsert from './modifiers/did-insert';
import type didUpdate from './modifiers/did-update';
import type willDestroy from './modifiers/will-destroy';

export default interface RenderModifiersRegistry {
'did-insert': typeof didInsert;
'did-update': typeof didUpdate;
'will-destroy': typeof willDestroy;
}

0 comments on commit 917da97

Please sign in to comment.