diff --git a/types/ember/v2/index.d.ts b/types/ember/v2/index.d.ts index 54b6d2e4a9..bdea9c24f8 100755 --- a/types/ember/v2/index.d.ts +++ b/types/ember/v2/index.d.ts @@ -274,6 +274,12 @@ declare module 'ember' { triggerAction(opts: TriggerActionOptions): boolean; } + interface DeprecationOptions { + id: string; + until: string; + url?: string; + } + export namespace Ember { interface FunctionPrototypeExtensions { /** @@ -2574,14 +2580,14 @@ declare module 'ember' { */ deprecatingAlias( dependentKey: string, - options: { id: string; until: string } + options: DeprecationOptions ): ComputedProperty; /** * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options */ deprecatingAlias( dependentKey: string, - options?: { id?: string; until?: string } + options?: Partial ): ComputedProperty; /** * A computed property that returns the sum of the values @@ -2977,7 +2983,7 @@ declare module 'ember' { function deprecate( message: string, test: boolean, - options: { id: string; until: string } + options: DeprecationOptions ): any; /** * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options @@ -2985,7 +2991,7 @@ declare module 'ember' { function deprecate( message: string, test: boolean, - options?: { id?: string; until?: string } + options?: Partial ): any; /** * Define an assertion that will throw an exception if the condition is not met. @@ -3012,7 +3018,7 @@ declare module 'ember' { */ function deprecateFunc any)>( message: string, - options: { id: string; until: string }, + options: DeprecationOptions, func: Func ): Func; /** diff --git a/types/ember/v2/test/utils.ts b/types/ember/v2/test/utils.ts index d729d472b8..72d55184ab 100755 --- a/types/ember/v2/test/utils.ts +++ b/types/ember/v2/test/utils.ts @@ -50,6 +50,14 @@ function testDeprecateFunc() { assertType(oldMethod('first', 123)); } +function testDeprecate() { + Ember.deprecate('This has been deprecated', false, { + id: 'some.id', + until: '1.0.0', + url: 'http://www.emberjs.com' + }); +} + function testDefineProperty() { const contact = {};