// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ClassDeclaration22.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
class C {
    "foo"();
    "bar"() { }
}

=====================================output=====================================
class C {
  foo();
  bar() {}
}

================================================================================
`;

exports[`anyIsAssignableToObject.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
interface P {
    p: {};
}

interface Q extends P { // Check assignability here. Any is assignable to {}
    p: any;
}

=====================================output=====================================
interface P {
  p: {};
}

interface Q extends P {
  // Check assignability here. Any is assignable to {}
  p: any;
}

================================================================================
`;

exports[`castOfAwait.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
// @target: es6
async function f() {
    <number> await 0;
    typeof await 0;
    void await 0;
    await void <string> typeof <number> void await 0;
    await await 0;
}

=====================================output=====================================
// @target: es6
async function f() {
  <number>await 0;
  typeof (await 0);
  void (await 0);
  await void (<string>typeof (<number>void (await 0)));
  await await 0;
}

================================================================================
`;

exports[`castParentheses.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
﻿class a {
    static b: any;
}

var b = (<any>a);
var b = (<any>a).b;
var b = (<any>a.b).c;
var b = (<any>a.b()).c;
var b = (<any>new a);
var b = (<any>new a.b);
var b = (<any>new a).b

=====================================output=====================================
﻿class a {
  static b: any;
}

var b = <any>a;
var b = (<any>a).b;
var b = (<any>a.b).c;
var b = (<any>a.b()).c;
var b = <any>new a();
var b = <any>new a.b();
var b = (<any>new a()).b;

================================================================================
`;

exports[`castTest.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================

var x : any = 0;
var z = <number> x;
var y = x + z;

var a = <any>0;
var b = <boolean>true;
var s = <string>"";

var ar = <any[]>null;

var f = <(res : number) => void>null;

declare class Point
{
    x: number;
    y: number;
    add(dx: number, dy: number): Point;
    mult(p: Point): Point;
    constructor(x: number, y: number);
}

var p_cast = <Point> ({
    x: 0,
    y: 0,
    add: function(dx, dy) {
        return new Point(this.x + dx, this.y + dy);
    },
    mult: function(p) { return p; }
})

=====================================output=====================================
var x: any = 0;
var z = <number>x;
var y = x + z;

var a = <any>0;
var b = <boolean>true;
var s = <string>"";

var ar = <any[]>null;

var f = <(res: number) => void>null;

declare class Point {
  x: number;
  y: number;
  add(dx: number, dy: number): Point;
  mult(p: Point): Point;
  constructor(x: number, y: number);
}

var p_cast = <Point>{
  x: 0,
  y: 0,
  add: function(dx, dy) {
    return new Point(this.x + dx, this.y + dy);
  },
  mult: function(p) {
    return p;
  }
};

================================================================================
`;

exports[`checkInfiniteExpansionTermination.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
// Regression test for #1002
// Before fix this code would cause infinite loop

interface IObservable<T> {
    n: IObservable<T[]>; // Needed, must be T[]
}

// Needed
interface ISubject<T> extends IObservable<T> { }

interface Foo { x }
interface Bar { y }

var values: IObservable<Foo>;
var values2: ISubject<Bar>;
values = values2;

=====================================output=====================================
// Regression test for #1002
// Before fix this code would cause infinite loop

interface IObservable<T> {
  n: IObservable<T[]>; // Needed, must be T[]
}

// Needed
interface ISubject<T> extends IObservable<T> {}

interface Foo {
  x;
}
interface Bar {
  y;
}

var values: IObservable<Foo>;
var values2: ISubject<Bar>;
values = values2;

================================================================================
`;

exports[`commentInNamespaceDeclarationWithIdentifierPathName.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
﻿namespace hello.hi.world
{
    function foo() {}
}

=====================================output=====================================
﻿namespace hello.hi.world {
  function foo() {}
}

================================================================================
`;

exports[`commentsInterface.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
interface i2 {
    foo: (/**param help*/b: number) => string;
}

=====================================output=====================================
interface i2 {
  foo: (/**param help*/ b: number) => string;
}

================================================================================
`;

exports[`contextualSignatureInstantiation2.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
// dot f g x = f(g(x))
var dot: <T, S>(f: (_: T) => S) => <U>(g: (_: U) => T) => (_: U) => S;
dot = <T, S>(f: (_: T) => S) => <U>(g: (_: U) => T): (r:U) => S => (x) => f(g(x));
var id: <T>(x:T) => T;
var r23 = dot(id)(id);
=====================================output=====================================
// dot f g x = f(g(x))
var dot: <T, S>(f: (_: T) => S) => <U>(g: (_: U) => T) => (_: U) => S;
dot = <T, S>(f: (_: T) => S) => <U>(g: (_: U) => T): ((r: U) => S) => x =>
  f(g(x));
var id: <T>(x: T) => T;
var r23 = dot(id)(id);

================================================================================
`;

exports[`declareDottedModuleName.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
// @declaration: true
module M {
    module P.Q { } // This shouldnt be emitted
}

module M {
    export module R.S { }  //This should be emitted
}

module T.U { // This needs to be emitted
}
=====================================output=====================================
// @declaration: true
module M {
  module P.Q {} // This shouldnt be emitted
}

module M {
  export module R.S {} //This should be emitted
}

module T.U {
  // This needs to be emitted
}

================================================================================
`;

exports[`decrementAndIncrementOperators.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
var x = 0;

// errors
1 ++;

(1)++;
(1)--;

++(1);
--(1);

(1 + 2)++;
(1 + 2)--;

++(1 + 2);
--(1 + 2);

(x + x)++;
(x + x)--;

++(x + x);
--(x + x);

//OK
x++;
x--;

++x;
--x;

(x)++;
--(x);

((x))++;
((x))--;

x[x++]++;

=====================================output=====================================
var x = 0;

// errors
1++;

1++;
1--;

++1;
--1;

(1 + 2)++;
(1 + 2)--;

++(1 + 2);
--(1 + 2);

(x + x)++;
(x + x)--;

++(x + x);
--(x + x);

//OK
x++;
x--;

++x;
--x;

x++;
--x;

x++;
x--;

x[x++]++;

================================================================================
`;

exports[`downlevelLetConst1.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
const
=====================================output=====================================
const;

================================================================================
`;

exports[`errorOnInitializerInInterfaceProperty.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
interface Foo {
    bar: number = 5;
}

=====================================output=====================================
interface Foo {
  bar: number = 5;
}

================================================================================
`;

exports[`es5ExportDefaultClassDeclaration4.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
// @target: es5
// @module: commonjs
// @declaration: true

declare module "foo" {
    export var before: C;

    export default class C {
        method(): C;
    }

    export var after: C;

    export var t: typeof C;
}


=====================================output=====================================
// @target: es5
// @module: commonjs
// @declaration: true

declare module "foo" {
  export var before: C;

  export default class C {
    method(): C;
  }

  export var after: C;

  export var t: typeof C;
}

================================================================================
`;

exports[`functionOverloadsOnGenericArity1.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
// overloading on arity not allowed
interface C {
   f<T>(): string;
   f<T, U>(): string; 
 
   <T>(): string;
   <T, U>(): string; 
 
  new <T>(): string;
  new <T, U>(): string; 
}

=====================================output=====================================
// overloading on arity not allowed
interface C {
  f<T>(): string;
  f<T, U>(): string;

  <T>(): string;
  <T, U>(): string;

  new <T>(): string;
  new <T, U>(): string;
}

================================================================================
`;

exports[`globalIsContextualKeyword.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
function a() {
    let global = 1;
}
function b() {
    class global {}
}

namespace global {
}

function foo(global: number) {
}

let obj = {
    global: "123"
}
=====================================output=====================================
function a() {
  let global = 1;
}
function b() {
  class global {}
}

namespace global {}

function foo(global: number) {}

let obj = {
  global: "123"
};

================================================================================
`;

exports[`indexSignatureWithInitializer.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
// These used to be indexers, now they are computed properties
interface I {
    [x = '']: string;
}

class C {
    [x = 0]: string
}
=====================================output=====================================
// These used to be indexers, now they are computed properties
interface I {
  [x = ""]: string;
}

class C {
  [x = 0]: string;
}

================================================================================
`;

exports[`mappedTypeWithCombinedTypeMappers.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
// Repro from #13351

type Meta<T, A> = {
    [P in keyof T]: {
        value: T[P];
        also: A;
        readonly children: Meta<T[P], A>;
    };
}

interface Input {
    x: string;
    y: number;
}

declare const output: Meta<Input, boolean>;

const shouldFail: { important: boolean } = output.x.children;

=====================================output=====================================
// Repro from #13351

type Meta<T, A> = {
  [P in keyof T]: {
    value: T[P];
    also: A;
    readonly children: Meta<T[P], A>;
  };
};

interface Input {
  x: string;
  y: number;
}

declare const output: Meta<Input, boolean>;

const shouldFail: { important: boolean } = output.x.children;

================================================================================
`;

exports[`modifiersOnInterfaceIndexSignature1.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
interface I {
  public [a: string]: number;
}
=====================================output=====================================
interface I {
  public [a: string]: number;
}

================================================================================
`;

exports[`privacyGloImport.ts 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
                                                                                | printWidth
=====================================input======================================
//@declaration: true
module m1 {
    export module m1_M1_public {
        export class c1 {
        }
        export function f1() {
            return new c1;
        }
        export var v1 = c1;
        export var v2: c1;
    }

    module m1_M2_private {
        export class c1 {
        }
        export function f1() {
            return new c1;
        }
        export var v1 = c1;
        export var v2: c1;
    }

    //export declare module "m1_M3_public" {
    //    export function f1();
    //    export class c1 {
    //    }
    //    export var v1: { new (): c1; };
    //    export var v2: c1;
    //}

    //declare module "m1_M4_private" {
    //    export function f1();
    //    export class c1 {
    //    }
    //    export var v1: { new (): c1; };
    //    export var v2: c1;
    //}

    import m1_im1_private = m1_M1_public;
    export var m1_im1_private_v1_public = m1_im1_private.c1;
    export var m1_im1_private_v2_public = new m1_im1_private.c1();
    export var m1_im1_private_v3_public = m1_im1_private.f1;
    export var m1_im1_private_v4_public = m1_im1_private.f1();
    var m1_im1_private_v1_private = m1_im1_private.c1;
    var m1_im1_private_v2_private = new m1_im1_private.c1();
    var m1_im1_private_v3_private = m1_im1_private.f1;
    var m1_im1_private_v4_private = m1_im1_private.f1();


    import m1_im2_private = m1_M2_private;
    export var m1_im2_private_v1_public = m1_im2_private.c1;
    export var m1_im2_private_v2_public = new m1_im2_private.c1();
    export var m1_im2_private_v3_public = m1_im2_private.f1;
    export var m1_im2_private_v4_public = m1_im2_private.f1();
    var m1_im2_private_v1_private = m1_im2_private.c1;
    var m1_im2_private_v2_private = new m1_im2_private.c1();
    var m1_im2_private_v3_private = m1_im2_private.f1;
    var m1_im2_private_v4_private = m1_im2_private.f1();

    //import m1_im3_private = require("m1_M3_public");
    //export var m1_im3_private_v1_public = m1_im3_private.c1;
    //export var m1_im3_private_v2_public = new m1_im3_private.c1();
    //export var m1_im3_private_v3_public = m1_im3_private.f1;
    //export var m1_im3_private_v4_public = m1_im3_private.f1();
    //var m1_im3_private_v1_private = m1_im3_private.c1;
    //var m1_im3_private_v2_private = new m1_im3_private.c1();
    //var m1_im3_private_v3_private = m1_im3_private.f1;
    //var m1_im3_private_v4_private = m1_im3_private.f1();

    //import m1_im4_private = require("m1_M4_private");
    //export var m1_im4_private_v1_public = m1_im4_private.c1;
    //export var m1_im4_private_v2_public = new m1_im4_private.c1();
    //export var m1_im4_private_v3_public = m1_im4_private.f1;
    //export var m1_im4_private_v4_public = m1_im4_private.f1();
    //var m1_im4_private_v1_private = m1_im4_private.c1;
    //var m1_im4_private_v2_private = new m1_im4_private.c1();
    //var m1_im4_private_v3_private = m1_im4_private.f1;
    //var m1_im4_private_v4_private = m1_im4_private.f1();

    export import m1_im1_public = m1_M1_public;
    export import m1_im2_public = m1_M2_private;
    //export import m1_im3_public = require("m1_M3_public");
    //export import m1_im4_public = require("m1_M4_private");
}

module glo_M1_public {
    export class c1 {
    }
    export function f1() {
        return new c1;
    }
    export var v1 = c1;
    export var v2: c1;
}

declare module "glo_M2_public" {
    export function f1();
    export class c1 {
    }
    export var v1: { new (): c1; };
    export var v2: c1;
}

declare module "use_glo_M1_public" {
    import use_glo_M1_public = glo_M1_public;
    export var use_glo_M1_public_v1_public: { new (): use_glo_M1_public.c1; };
    export var use_glo_M1_public_v2_public: typeof use_glo_M1_public;
    export var use_glo_M1_public_v3_public: ()=> use_glo_M1_public.c1;
    var use_glo_M1_public_v1_private: { new (): use_glo_M1_public.c1; };
    var use_glo_M1_public_v2_private: typeof use_glo_M1_public;
    var use_glo_M1_public_v3_private: () => use_glo_M1_public.c1;

    import use_glo_M2_public = require("glo_M2_public");
    export var use_glo_M2_public_v1_public: { new (): use_glo_M2_public.c1; };
    export var use_glo_M2_public_v2_public: typeof use_glo_M2_public;
    export var use_glo_M2_public_v3_public: () => use_glo_M2_public.c1;
    var use_glo_M2_public_v1_private: { new (): use_glo_M2_public.c1; };
    var use_glo_M2_public_v2_private: typeof use_glo_M2_public;
    var use_glo_M2_public_v3_private: () => use_glo_M2_public.c1;

    module m2 {
        //import errorImport = require("glo_M2_public");
        import nonerrorImport = glo_M1_public;

        module m5 {
            //import m5_errorImport = require("glo_M2_public");
            import m5_nonerrorImport = glo_M1_public;
        }
    }
}

declare module "anotherParseError" {
    module m2 {
        //declare module "abc" {
        //}
    }

    module m2 {
        //module "abc2" {
        //}
    }
    //module "abc3" {
    //}
}

module m2 {
    //import m3 = require("use_glo_M1_public");
    module m4 {
        var a = 10;
        //import m2 = require("use_glo_M1_public");
    }

}
=====================================output=====================================
//@declaration: true
module m1 {
  export module m1_M1_public {
    export class c1 {}
    export function f1() {
      return new c1();
    }
    export var v1 = c1;
    export var v2: c1;
  }

  module m1_M2_private {
    export class c1 {}
    export function f1() {
      return new c1();
    }
    export var v1 = c1;
    export var v2: c1;
  }

  //export declare module "m1_M3_public" {
  //    export function f1();
  //    export class c1 {
  //    }
  //    export var v1: { new (): c1; };
  //    export var v2: c1;
  //}

  //declare module "m1_M4_private" {
  //    export function f1();
  //    export class c1 {
  //    }
  //    export var v1: { new (): c1; };
  //    export var v2: c1;
  //}

  import m1_im1_private = m1_M1_public;
  export var m1_im1_private_v1_public = m1_im1_private.c1;
  export var m1_im1_private_v2_public = new m1_im1_private.c1();
  export var m1_im1_private_v3_public = m1_im1_private.f1;
  export var m1_im1_private_v4_public = m1_im1_private.f1();
  var m1_im1_private_v1_private = m1_im1_private.c1;
  var m1_im1_private_v2_private = new m1_im1_private.c1();
  var m1_im1_private_v3_private = m1_im1_private.f1;
  var m1_im1_private_v4_private = m1_im1_private.f1();

  import m1_im2_private = m1_M2_private;
  export var m1_im2_private_v1_public = m1_im2_private.c1;
  export var m1_im2_private_v2_public = new m1_im2_private.c1();
  export var m1_im2_private_v3_public = m1_im2_private.f1;
  export var m1_im2_private_v4_public = m1_im2_private.f1();
  var m1_im2_private_v1_private = m1_im2_private.c1;
  var m1_im2_private_v2_private = new m1_im2_private.c1();
  var m1_im2_private_v3_private = m1_im2_private.f1;
  var m1_im2_private_v4_private = m1_im2_private.f1();

  //import m1_im3_private = require("m1_M3_public");
  //export var m1_im3_private_v1_public = m1_im3_private.c1;
  //export var m1_im3_private_v2_public = new m1_im3_private.c1();
  //export var m1_im3_private_v3_public = m1_im3_private.f1;
  //export var m1_im3_private_v4_public = m1_im3_private.f1();
  //var m1_im3_private_v1_private = m1_im3_private.c1;
  //var m1_im3_private_v2_private = new m1_im3_private.c1();
  //var m1_im3_private_v3_private = m1_im3_private.f1;
  //var m1_im3_private_v4_private = m1_im3_private.f1();

  //import m1_im4_private = require("m1_M4_private");
  //export var m1_im4_private_v1_public = m1_im4_private.c1;
  //export var m1_im4_private_v2_public = new m1_im4_private.c1();
  //export var m1_im4_private_v3_public = m1_im4_private.f1;
  //export var m1_im4_private_v4_public = m1_im4_private.f1();
  //var m1_im4_private_v1_private = m1_im4_private.c1;
  //var m1_im4_private_v2_private = new m1_im4_private.c1();
  //var m1_im4_private_v3_private = m1_im4_private.f1;
  //var m1_im4_private_v4_private = m1_im4_private.f1();

  export import m1_im1_public = m1_M1_public;
  export import m1_im2_public = m1_M2_private;
  //export import m1_im3_public = require("m1_M3_public");
  //export import m1_im4_public = require("m1_M4_private");
}

module glo_M1_public {
  export class c1 {}
  export function f1() {
    return new c1();
  }
  export var v1 = c1;
  export var v2: c1;
}

declare module "glo_M2_public" {
  export function f1();
  export class c1 {}
  export var v1: { new (): c1 };
  export var v2: c1;
}

declare module "use_glo_M1_public" {
  import use_glo_M1_public = glo_M1_public;
  export var use_glo_M1_public_v1_public: { new (): use_glo_M1_public.c1 };
  export var use_glo_M1_public_v2_public: typeof use_glo_M1_public;
  export var use_glo_M1_public_v3_public: () => use_glo_M1_public.c1;
  var use_glo_M1_public_v1_private: { new (): use_glo_M1_public.c1 };
  var use_glo_M1_public_v2_private: typeof use_glo_M1_public;
  var use_glo_M1_public_v3_private: () => use_glo_M1_public.c1;

  import use_glo_M2_public = require("glo_M2_public");
  export var use_glo_M2_public_v1_public: { new (): use_glo_M2_public.c1 };
  export var use_glo_M2_public_v2_public: typeof use_glo_M2_public;
  export var use_glo_M2_public_v3_public: () => use_glo_M2_public.c1;
  var use_glo_M2_public_v1_private: { new (): use_glo_M2_public.c1 };
  var use_glo_M2_public_v2_private: typeof use_glo_M2_public;
  var use_glo_M2_public_v3_private: () => use_glo_M2_public.c1;

  module m2 {
    //import errorImport = require("glo_M2_public");
    import nonerrorImport = glo_M1_public;

    module m5 {
      //import m5_errorImport = require("glo_M2_public");
      import m5_nonerrorImport = glo_M1_public;
    }
  }
}

declare module "anotherParseError" {
  module m2 {
    //declare module "abc" {
    //}
  }

  module m2 {
    //module "abc2" {
    //}
  }
  //module "abc3" {
  //}
}

module m2 {
  //import m3 = require("use_glo_M1_public");
  module m4 {
    var a = 10;
    //import m2 = require("use_glo_M1_public");
  }
}

================================================================================
`;
