1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
//// [tests/cases/conformance/importAssertion/importAssertion1.ts] ////
//// [0.ts]
export const a = 1;
export const b = 2;
//// [1.ts]
import './0' assert { type: "json" }
import { a, b } from './0' assert { "type": "json" }
import * as foo from './0' assert { type: "json" }
a;
b;
foo.a;
foo.b;
//// [2.ts]
import { a, b } from './0' assert {}
import { a as c, b as d } from './0' assert { a: "a", b: "b", c: "c" }
a;
b;
c;
d;
//// [3.ts]
const a = import('./0')
const b = import('./0', { assert: { type: "json" } })
const c = import('./0', { assert: { type: "json", ttype: "typo" } })
const d = import('./0', { assert: {} })
const dd = import('./0', {})
declare function foo(): any;
const e = import('./0', foo())
const f = import()
const g = import('./0', {}, {})
const h = import('./0', { assert: { type: "json" }},)
//// [0.js]
export const a = 1;
export const b = 2;
//// [1.js]
import './0' assert { type: "json" };
import { a, b } from './0' assert { "type": "json" };
import * as foo from './0' assert { type: "json" };
a;
b;
foo.a;
foo.b;
//// [2.js]
import { a, b } from './0' assert {};
import { a as c, b as d } from './0' assert { a: "a", b: "b", c: "c" };
a;
b;
c;
d;
//// [3.js]
const a = import('./0');
const b = import('./0', { assert: { type: "json" } });
const c = import('./0', { assert: { type: "json", ttype: "typo" } });
const d = import('./0', { assert: {} });
const dd = import('./0', {});
const e = import('./0', foo());
const f = import();
const g = import('./0', {}, {});
const h = import('./0', { assert: { type: "json" } });
//// [0.d.ts]
export declare const a = 1;
export declare const b = 2;
//// [1.d.ts]
import './0';
//// [2.d.ts]
export {};
//// [3.d.ts]
declare const a: Promise<typeof import("./0")>;
declare const b: Promise<typeof import("./0")>;
declare const c: Promise<typeof import("./0")>;
declare const d: Promise<typeof import("./0")>;
declare const dd: Promise<typeof import("./0")>;
declare function foo(): any;
declare const e: Promise<typeof import("./0")>;
declare const f: Promise<any>;
declare const g: Promise<typeof import("./0")>;
declare const h: Promise<typeof import("./0")>;
|