import Service from '@ember/service'; interface ITheme { primary: string secondary: string error: string warning: string info: string success: string } /** Theme service @class ThemeService @public */ export default class ThemeService extends Service implements ITheme { public primary: string public secondary: string public error: string public warning: string public info: string public success: string constructor() { super(...arguments); this.primary = 'purple'; this.secondary = 'teal'; this.error = 'red'; this.warning = 'orange'; this.info = 'indigo'; this.success = 'green'; } getColor(color: string | undefined): string { if (color) { return this[ color]; } else { return this.primary; } } } // DO NOT DELETE: this is how TypeScript knows how to look up your services. declare module '@ember/service' { interface Registry { 'theme': ThemeService; } }