Skip to content

Commit

Permalink
Merge pull request #280 from emberjs/fix-deprecate-type
Browse files Browse the repository at this point in the history
Fixes TS issue with mismatched type for deprecate
  • Loading branch information
rwjblue committed Jul 13, 2021
2 parents 1f4ed4d + fc90dde commit 103eb95
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addon/ember-test-waiters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ deprecate(
id: 'ember-test-waiters-legacy-module-name',
until: '3.0.0',
for: 'ember-test-waiters',
since: '2.2.0',
since: {
enabled: '2.2.0',
},
}
);

Expand Down
35 changes: 35 additions & 0 deletions types/custom-ember-debug.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import '@ember/debug';

export type DeprecationStages = 'available' | 'enabled';

declare module '@ember/debug' {
export function deprecate(
message: string,
test: boolean,
options: {
/**
* A unique id for this deprecation. The id can be used by Ember debugging
* tools to change the behavior (raise, log or silence) for that specific
* deprecation. The id should be namespaced by dots, e.g.
* `"view.helper.select"`.
*/
id: string;
/**
* The version of Ember when this deprecation warning will be removed.
*/
until: string;
/**
* A namespace for the deprecation, usually the package name
*/
for: string;
/**
* Describes when the deprecation became available and enabled
*/
since: Partial<Record<DeprecationStages, string>>;
/**
* An optional url to the transition guide on the emberjs.com website.
*/
url?: string | undefined;
}
): void;
}

0 comments on commit 103eb95

Please sign in to comment.