defineTransition() {
    let arg1 = arguments[0];
    let arg2 = arguments[1];
    let arg3 = arguments[2];
    let arg4 = arguments[3];
    let fromPath = '/*';
    let toPath = '/*';
    let handler = null;

    // Sanity checks.
    if (arg1 !== 'in' && arg1 !== 'out') throw new Error(`First argument to defineTransition() must be either 'in' or 'out'`);

    switch (arguments.length) {
      case 2:
        if (typeof arg2 !== 'function') throw new Error(`Second argument to defineTransition() must be a function`);
        handler = arg2;
        break;
      case 3:
        if (typeof arg2 === 'string' && typeof arg3 === 'string') {
          fromPath = arg2;
          toPath = arg3;
        }
        else if (typeof arg2=== 'string' && typeof arg3 === 'function') {
          if (arg1 === 'in')
            toPath = arg2;
          else
            fromPath = arg2;

          handler = arg3;
        }
        else {
          throw new Error(`Expecting second argument to be a path and third argument to be either a path/function`);
        }
        break;
      case 4:
        if (typeof arg2 !== 'string') throw new Error(`Second argument to defineTransition() must be a path`);
        if (typeof arg3 !== 'string') throw new Error(`Third argument to defineTransition() must be a path`);
        if (typeof arg4 !== 'function') throw new Error(`Forth argument to defineTransition() must be a function`);
        fromPath = arg2;
        toPath = arg3;
        handler = arg4;
        break;
      default:
        throw new Error(`Invalid arguments passed to defineTransition(), expecting at least 2 and maximum 4 arguments`);
    }

    toPath = PageManager.normalizePath(toPath, true);
    fromPath = PageManager.normalizePath(fromPath, true);

    if (arg1 === 'in') {
      if (!this.transitions.in[toPath]) this.transitions.in[toPath] = {};
      this.transitions.in[toPath][fromPath] = handler;
    }
    else {
      if (!this.transitions.out[fromPath]) this.transitions.out[fromPath] = {};
      this.transitions.out[fromPath][toPath] = handler;
    }
  }
/**
   * Defines a transition (in/out).
   *
   * @param {string} - The direction of the transition, either 'in' or 'out'.
   * @param {string|Function} - The meaning of this value depends on the number
   *                            of arguments passed into this method.
   *                            2: This will be the handler for all transitions
   *                               of the specified direction.
   *                            3: This will be the from path if the direction
   *                               is 'out' or the to path if the direction is
   *                               'in'.
   *                            4: This will be the from path.
   * @param {string|Function} - The meaning of this value depends on the number
   *                            of arguments passed into this method.
   *                            3: This will be the handler for all transitions
   *                               of the specified direction.
   *                            4: This will be the to path.
   * @param {function} - The handler for transitions defined in this direction
   *                     for the specific from/to path combos.
   */
Defines a transition (in/out).
@param {string} - The direction of the transition, either 'in' or 'out'.
@param {string|Function} - The meaning of this value depends on the number
of arguments passed into this method.
2: This will be the handler for all transitions
of the specified direction.
3: This will be the from path if the direction
is 'out' or the to path if the direction is
'in'.
4: This will be the from path.
@param {string|Function} - The meaning of this value depends on the number
of arguments passed into this method.
3: This will be the handler for all transitions
of the specified direction.
4: This will be the to path.
@param {function} - The handler for transitions defined in this direction
for the specific from/to path combos.
Defines a transition ( in / out ) . @param { string } - The direction of the transition either ' in ' or ' out ' . @param { string|Function } - The meaning of this value depends on the number of arguments passed into this method . 2 : This will be the handler for all transitions of the specified direction . 3 : This will be the from path if the direction is ' out ' or the to path if the direction is ' in ' . 4 : This will be the from path . @param { string|Function } - The meaning of this value depends on the number of arguments passed into this method . 3 : This will be the handler for all transitions of the specified direction . 4 : This will be the to path . @param { function } - The handler for transitions defined in this direction for the specific from / to path combos .
defineTransition() {
    let arg1 = arguments[0];
    let arg2 = arguments[1];
    let arg3 = arguments[2];
    let arg4 = arguments[3];
    let fromPath = '/*';
    let toPath = '/*';
    let handler = null;
    if (arg1 !== 'in' && arg1 !== 'out') throw new Error(`First argument to defineTransition() must be either 'in' or 'out'`);
    switch (arguments.length) {
      case 2:
        if (typeof arg2 !== 'function') throw new Error(`Second argument to defineTransition() must be a function`);
        handler = arg2;
        break;
      case 3:
        if (typeof arg2 === 'string' && typeof arg3 === 'string') {
          fromPath = arg2;
          toPath = arg3;
        }
        else if (typeof arg2=== 'string' && typeof arg3 === 'function') {
          if (arg1 === 'in')
            toPath = arg2;
          else
            fromPath = arg2;
          handler = arg3;
        }
        else {
          throw new Error(`Expecting second argument to be a path and third argument to be either a path/function`);
        }
        break;
      case 4:
        if (typeof arg2 !== 'string') throw new Error(`Second argument to defineTransition() must be a path`);
        if (typeof arg3 !== 'string') throw new Error(`Third argument to defineTransition() must be a path`);
        if (typeof arg4 !== 'function') throw new Error(`Forth argument to defineTransition() must be a function`);
        fromPath = arg2;
        toPath = arg3;
        handler = arg4;
        break;
      default:
        throw new Error(`Invalid arguments passed to defineTransition(), expecting at least 2 and maximum 4 arguments`);
    }
    toPath = PageManager.normalizePath(toPath, true);
    fromPath = PageManager.normalizePath(fromPath, true);
    if (arg1 === 'in') {
      if (!this.transitions.in[toPath]) this.transitions.in[toPath] = {};
      this.transitions.in[toPath][fromPath] = handler;
    }
    else {
      if (!this.transitions.out[fromPath]) this.transitions.out[fromPath] = {};
      this.transitions.out[fromPath][toPath] = handler;
    }
  }
defineTransition ( ) { let arg1 = arguments [ 0 ] ; let arg2 = arguments [ 1 ] ; let arg3 = arguments [ 2 ] ; let arg4 = arguments [ 3 ] ; let fromPath = '/*' ; let toPath = '/*' ; let handler = null ; if ( arg1 !== 'in' && arg1 !== 'out' ) throw new Error ( ` ` ) ; switch ( arguments . length ) { case 2 : if ( typeof arg2 !== 'function' ) throw new Error ( ` ` ) ; handler = arg2 ; break ; case 3 : if ( typeof arg2 === 'string' && typeof arg3 === 'string' ) { fromPath = arg2 ; toPath = arg3 ; } else if ( typeof arg2 === 'string' && typeof arg3 === 'function' ) { if ( arg1 === 'in' ) toPath = arg2 ; else fromPath = arg2 ; handler = arg3 ; } else { throw new Error ( ` ` ) ; } break ; case 4 : if ( typeof arg2 !== 'string' ) throw new Error ( ` ` ) ; if ( typeof arg3 !== 'string' ) throw new Error ( ` ` ) ; if ( typeof arg4 !== 'function' ) throw new Error ( ` ` ) ; fromPath = arg2 ; toPath = arg3 ; handler = arg4 ; break ; default : throw new Error ( ` ` ) ; } toPath = PageManager . normalizePath ( toPath , true ) ; fromPath = PageManager . normalizePath ( fromPath , true ) ; if ( arg1 === 'in' ) { if ( ! this . transitions . in [ toPath ] ) this . transitions . in [ toPath ] = { } ; this . transitions . in [ toPath ] [ fromPath ] = handler ; } else { if ( ! this . transitions . out [ fromPath ] ) this . transitions . out [ fromPath ] = { } ; this . transitions . out [ fromPath ] [ toPath ] = handler ; } }
Defines a transition (in/out).
Defines a transition ( in / out ) .
// Sanity checks.