import { action } from '@ember/object' ; import { guidFor } from '@ember/object/internals' ; import Transition from '@ember/routing/-private/transition' ; import { tracked } from '@glimmer/tracking' ; import { Link } from 'ember-link' ; export default class TestLink extends Link { @ tracked isActive = false ; @ tracked isActiveWithoutQueryParams = false ; @ tracked isActiveWithoutModels = false ; @ tracked isEntering = false ; @ tracked isExiting = false ; @ tracked url = guidFor ( this ) ; onTransitionTo ? ( ) ; onReplaceWith ? ( ) ; get qualifiedRouteName ( ) { return this . routeName ; } @ action transitionTo ( event ? ) { this . _preventTransitionOut ( event ) ; this . _params . onTransitionTo ?. ( ) ; this . onTransitionTo ?. ( ) ; return this . _createDummyTransition ( ) ; } @ action replaceWith ( event ? ) { this . _preventTransitionOut ( event ) ; this . _params . onReplaceWith ?. ( ) ; this . onReplaceWith ?. ( ) ; return this . _createDummyTransition ( ) ; } private _preventTransitionOut ( event ? ) { event ?. preventDefault ( ) ; } private _createDummyTransition ( ) { return { from : null , to : { child : null , localName : 'dummy' , name : 'dummy' , paramNames : [ ] , params : { } , parent : null , queryParams : { } , find ( ) { return undefined ; } } , abort ( ) { return this ; } , retry ( ) { return this ; } } as any as Transition ; } }