Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes TS issue with mismatched type for deprecate #280

Merged
merged 2 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}