Skip to content

Commit

Permalink
Types preview: remove private DT route types
Browse files Browse the repository at this point in the history
We continue to maintain support for these import locations in the types
on DefinitelyTyped, but remove them here so that users trying the
preview types do not accidentally depend on them.
  • Loading branch information
chriskrycho committed Sep 1, 2022
1 parent 06829aa commit 5d986a9
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 33 deletions.
25 changes: 1 addition & 24 deletions type-tests/preview/@ember/routing-test/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import type Array from '@ember/array';
import EmberObject from '@ember/object';
import Controller from '@ember/controller';
import type Transition from '@ember/routing/transition';
import type { RouteInfoWithAttributes } from '@ember/routing/route-info';
import type RouteInfo from '@ember/routing/route-info';
import { expectTypeOf } from 'expect-type';

class Post extends EmberObject {}

Expand Down Expand Up @@ -207,25 +206,3 @@ class WithImplicitParams extends Route {

type ImplicitParams = WithImplicitParams extends Route<any, infer T> ? T : never;
expectTypeOf<ImplicitParams>().toEqualTypeOf<RouteParams>();

// back-compat for existing users of these
// NOTE: we will *not* migrate the private import locations when moving to
// publish from Ember itself.
import type PrivateTransition from '@ember/routing/-private/transition';
declare let publicTransition: Transition;
declare let oldPrivateTransition: PrivateTransition;
publicTransition = oldPrivateTransition;
oldPrivateTransition = publicTransition;

import type PrivateRouteInfo from '@ember/routing/-private/route-info';
declare let publicRouteInfo: RouteInfo;
declare let privateRouteInfo: PrivateRouteInfo;
publicRouteInfo = privateRouteInfo;
privateRouteInfo = publicRouteInfo;

import type PrivateRouteInfoWithAttributes from '@ember/routing/-private/route-info-with-attributes';
import { expectTypeOf } from 'expect-type';
declare let publicRouteInfoWithAttributes: RouteInfoWithAttributes;
declare let privateRouteInfoWithAttributes: PrivateRouteInfoWithAttributes;
publicRouteInfoWithAttributes = privateRouteInfoWithAttributes;
privateRouteInfoWithAttributes = publicRouteInfoWithAttributes;

This file was deleted.

3 changes: 0 additions & 3 deletions types/preview/@ember/routing/-private/route-info.d.ts

This file was deleted.

3 changes: 0 additions & 3 deletions types/preview/@ember/routing/-private/transition.d.ts

This file was deleted.

0 comments on commit 5d986a9

Please sign in to comment.