From 6383470ec689a976330ec8ffc84ca0820e90eeb2 Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Tue, 8 Nov 2022 17:29:04 -0700 Subject: [PATCH] Introduce new `@ember/routing` sub-modules Add the `@ember/routing/transition` and `@ember/routing/route-info`, per RFC 0821. These match the existing public preview types. --- packages/@ember/routing/route-info.ts | 8 ++++++++ packages/@ember/routing/transition.ts | 8 ++++++++ types/preview/@ember/routing/route-info.d.ts | 1 - 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 packages/@ember/routing/route-info.ts create mode 100644 packages/@ember/routing/transition.ts diff --git a/packages/@ember/routing/route-info.ts b/packages/@ember/routing/route-info.ts new file mode 100644 index 00000000000..cd31e47ceda --- /dev/null +++ b/packages/@ember/routing/route-info.ts @@ -0,0 +1,8 @@ +/** + * Provides the `RouteInfo` and `RouteInfoWithMetadata` types which appear as + * the target and source routes for `Transition`s. + * + * @module @ember/routing/route-info + */ + +export type { RouteInfo as default, RouteInfoWithAttributes } from './lib/route-info'; diff --git a/packages/@ember/routing/transition.ts b/packages/@ember/routing/transition.ts new file mode 100644 index 00000000000..62138e1964a --- /dev/null +++ b/packages/@ember/routing/transition.ts @@ -0,0 +1,8 @@ +/** + * Provides the `Transition` type which are used in Ember's routing transitions, + * e.g. `RouterService.on('routeDidChange', (transition) => { ... })`. + * + * @module @ember/routing/transition + */ + +export type { Transition as default } from 'router_js'; diff --git a/types/preview/@ember/routing/route-info.d.ts b/types/preview/@ember/routing/route-info.d.ts index ead7d39900b..42e6bc98801 100644 --- a/types/preview/@ember/routing/route-info.d.ts +++ b/types/preview/@ember/routing/route-info.d.ts @@ -1,5 +1,4 @@ declare module '@ember/routing/route-info' { - // https://api.emberjs.com/ember/4.0/classes/RouteInfo /** * A `RouteInfo` is an object that contains metadata about a specific route within a `Transition`. * It is read-only and internally immutable.