Add url property to deprecation options

See 56d60eac53/packages/%40ember/debug/lib/deprecate.ts (L16)
This commit is contained in:
simonihmig 2019-01-27 20:42:18 +01:00 committed by Mike North
parent 112076b653
commit e065fec390
2 changed files with 19 additions and 5 deletions

View File

@ -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<any>;
/**
* @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<DeprecationOptions>
): ComputedProperty<any>;
/**
* 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<DeprecationOptions>
): any;
/**
* Define an assertion that will throw an exception if the condition is not met.
@ -3012,7 +3018,7 @@ declare module 'ember' {
*/
function deprecateFunc<Func extends ((...args: any[]) => any)>(
message: string,
options: { id: string; until: string },
options: DeprecationOptions,
func: Func
): Func;
/**

View File

@ -50,6 +50,14 @@ function testDeprecateFunc() {
assertType<string>(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 = {};