Skip to content

Commit

Permalink
Merge pull request #20319 from emberjs/service-di
Browse files Browse the repository at this point in the history
Types: resolve services with `Owner.lookup`
  • Loading branch information
chriskrycho authored Dec 9, 2022
2 parents 19d66a8 + 5070508 commit a1c41ea
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/@ember/service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,16 @@ export function service(
export default class Service extends FrameworkObject {
static isServiceFactory = true;
}

/**
A type registry for Ember `Service`s. Meant to be declaration-merged so string
lookups resolve to the correct type.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Registry extends Record<string, Service> {}

declare module '@ember/owner' {
export interface DIRegistry {
service: Registry;
}
}

0 comments on commit a1c41ea

Please sign in to comment.