diff options
Diffstat (limited to 'gui/src/renderer/lib')
| -rw-r--r-- | gui/src/renderer/lib/transition-rule.ts | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/gui/src/renderer/lib/transition-rule.ts b/gui/src/renderer/lib/transition-rule.ts deleted file mode 100644 index 91d5cd6d4c..0000000000 --- a/gui/src/renderer/lib/transition-rule.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Action } from 'history'; - -export interface ITransitionDescriptor { - name: string; - duration: number; -} - -export interface ITransitionFork { - forward: ITransitionDescriptor; - backward: ITransitionDescriptor; -} - -export interface ITransitionMatch { - direction: 'forward' | 'backward'; - descriptor: ITransitionDescriptor; -} - -export default class TransitionRule { - constructor(private from: string | null, private to: string, private fork: ITransitionFork) {} - - public match( - fromRoute: string | null, - toRoute: string, - action?: Action, - ): ITransitionMatch | null { - if (action !== 'POP' && (!this.from || this.from === fromRoute) && this.to === toRoute) { - return { - direction: 'forward', - descriptor: this.fork.forward, - }; - } - - if (action !== 'PUSH' && (!this.from || this.from === toRoute) && this.to === fromRoute) { - return { - direction: 'backward', - descriptor: this.fork.backward, - }; - } - - return null; - } -} |
