From 0b6cbfc0a512588db29f0d2da9757c0adea40c90 Mon Sep 17 00:00:00 2001 From: Steve Calvert Date: Mon, 12 Jul 2021 08:26:57 -0700 Subject: [PATCH 1/2] fix: Fixes TS issue with mismatched type for deprecate --- types/custom-ember-debug.d.ts | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 types/custom-ember-debug.d.ts diff --git a/types/custom-ember-debug.d.ts b/types/custom-ember-debug.d.ts new file mode 100644 index 00000000..cb2d7dde --- /dev/null +++ b/types/custom-ember-debug.d.ts @@ -0,0 +1,33 @@ +import '@ember/debug'; + +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: string; + /** + * An optional url to the transition guide on the emberjs.com website. + */ + url?: string | undefined; + } + ): void; +} From fc90ddec7de07873c9d514906a0218729f159dc2 Mon Sep 17 00:00:00 2001 From: Steve Calvert Date: Mon, 12 Jul 2021 12:34:38 -0700 Subject: [PATCH 2/2] Update types and call site to correctly reflect valid structure --- addon/ember-test-waiters/index.ts | 4 +++- types/custom-ember-debug.d.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/addon/ember-test-waiters/index.ts b/addon/ember-test-waiters/index.ts index b4f707b4..445d032b 100644 --- a/addon/ember-test-waiters/index.ts +++ b/addon/ember-test-waiters/index.ts @@ -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', + }, } ); diff --git a/types/custom-ember-debug.d.ts b/types/custom-ember-debug.d.ts index cb2d7dde..7b5b1ec1 100644 --- a/types/custom-ember-debug.d.ts +++ b/types/custom-ember-debug.d.ts @@ -1,5 +1,7 @@ import '@ember/debug'; +export type DeprecationStages = 'available' | 'enabled'; + declare module '@ember/debug' { export function deprecate( message: string, @@ -23,7 +25,7 @@ declare module '@ember/debug' { /** * Describes when the deprecation became available and enabled */ - since: string; + since: Partial>; /** * An optional url to the transition guide on the emberjs.com website. */