_id
stringlengths
21
254
text
stringlengths
1
93.7k
metadata
dict
TypeScript/tests/cases/conformance/externalModules/invalidSyntaxNamespaceImportWithAMD.ts_3_106
@module: amd // @filename: 0.ts export class C { } // @filename: 1.ts import * from Zero from "./0"
{ "end_byte": 106, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/invalidSyntaxNamespaceImportWithAMD.ts" }
TypeScript/tests/cases/conformance/externalModules/multipleExportDefault1.ts_3_92
port default function Foo (){ } export default { uhoh: "another default", };
{ "end_byte": 92, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/multipleExportDefault1.ts" }
TypeScript/tests/cases/conformance/externalModules/topLevelFileModuleMissing.ts_0_145
// @module: commonjs // @Filename: vs/foo_0.ts export var x: number; // @Filename: foo_1.ts import foo = require("vs/foo"); var z = foo.x + 10;
{ "end_byte": 145, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelFileModuleMissing.ts" }
TypeScript/tests/cases/conformance/externalModules/exportAssignmentOfExportNamespaceWithDefault.ts_0_430
// @esModuleInterop: true // @target: esnext // @filename: main.ts // @module: commonjs // https://github.com/microsoft/TypeScript/issues/39149 import a from "a"; a(); // @filename: external.d.ts declare module "b" { export function a(): void; export namespace a { var _a: typeof a; export { _a ...
{ "end_byte": 430, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignmentOfExportNamespaceWithDefault.ts" }
TypeScript/tests/cases/conformance/externalModules/amdImportAsPrimaryExpression.ts_0_238
// @module: amd // @Filename: foo_0.ts export enum E1 { A,B,C } // @Filename: foo_1.ts import foo = require("./foo_0"); if(foo.E1.A === 0){ // Should cause runtime import - interesting optimization possibility, as gets inlined to 0. }
{ "end_byte": 238, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/amdImportAsPrimaryExpression.ts" }
TypeScript/tests/cases/conformance/externalModules/commonJSImportNotAsPrimaryExpression.ts_0_501
// @module: commonjs // @Filename: foo_0.ts export class C1 { m1 = 42; static s1 = true; } export interface I1 { name: string; age: number; } export module M1 { export interface I2 { foo: string; } } export enum E1 { A,B,C } // @Filename: foo_1.ts import foo = require("./foo_0"); // None of the below shoul...
{ "end_byte": 501, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/commonJSImportNotAsPrimaryExpression.ts" }
TypeScript/tests/cases/conformance/externalModules/umd9.ts_0_324
// @module: commonjs // @noImplicitReferences: true // @allowUmdGlobalAccess: true // @filename: foo.d.ts declare class Thing { foo(): number; } export = Thing; export as namespace Foo; // @filename: a.ts /// <reference path="foo.d.ts" /> export const x = Foo; // OK in value position because allowUmdGlobalAccess: t...
{ "end_byte": 324, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/umd9.ts" }
TypeScript/tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts_0_528
//@module: commonjs var; let; const; export var a; export let b; export var c: string; export let d: number; class A {} export var e: A; export let f: A; namespace B { export let a = 1, b, c = 2; export let x, y, z; } module C { export var a = 1, b, c = 2; export var x, y, z; } // Shouldn't be filt...
{ "end_byte": 528, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts" }
TypeScript/tests/cases/conformance/externalModules/exportClassNameWithObjectCommonJS.ts_0_60
// @target: ES5 // @module: commonjs export class Object {}
{ "end_byte": 60, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportClassNameWithObjectCommonJS.ts" }
TypeScript/tests/cases/conformance/externalModules/umd-augmentation-3.ts_0_824
// @module: commonjs // @noImplicitReferences: true // @filename: node_modules/math2d/index.d.ts export as namespace Math2d; export = M2D; declare namespace M2D { interface Point { x: number; y: number; } class Vector implements Point { x: number; y: number; constructor(x: number, y: number); transl...
{ "end_byte": 824, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/umd-augmentation-3.ts" }
TypeScript/tests/cases/conformance/externalModules/typeValueMerge1.ts_0_228
// @noEmit: true // @Filename: other.ts export type A = string; function A() {} export { A }; export type B = string; var B = 10; export { B }; // @Filename: main.ts import { A, B } from "./other"; A(); export const C = B;
{ "end_byte": 228, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeValueMerge1.ts" }
TypeScript/tests/cases/conformance/externalModules/multipleExportDefault6.ts_3_63
port default { lol: 1 } export default { lol: 2 }
{ "end_byte": 63, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/multipleExportDefault6.ts" }
TypeScript/tests/cases/conformance/externalModules/exportNonLocalDeclarations.ts_0_43
export { string }; export type { number };
{ "end_byte": 43, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportNonLocalDeclarations.ts" }
TypeScript/tests/cases/conformance/externalModules/invalidSyntaxNamespaceImportWithCommonjs.ts_3_111
@module: commonjs // @filename: 0.ts export class C { } // @filename: 1.ts import * from Zero from "./0"
{ "end_byte": 111, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/invalidSyntaxNamespaceImportWithCommonjs.ts" }
TypeScript/tests/cases/conformance/externalModules/multipleExportDefault2.ts_3_88
port default { uhoh: "another default", }; export default function Foo() { }
{ "end_byte": 88, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/multipleExportDefault2.ts" }
TypeScript/tests/cases/conformance/externalModules/exportTypeMergedWithExportStarAsNamespace.ts_0_472
// @Filename: usage.ts import { Something } from "./prelude" export const myValue: Something<string> = Something.of("abc") export type MyType = Something.SubType<string> // @Filename: Something.ts export type Something<A> = { value: A } export type SubType<A> = { value: A } export declare function of<A>(value: A): Som...
{ "end_byte": 472, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportTypeMergedWithExportStarAsNamespace.ts" }
TypeScript/tests/cases/conformance/externalModules/exportNonVisibleType.ts_0_498
// @Filename: foo1.ts interface I1 { a: string; b: number; } var x: I1 = {a: "test", b: 42}; export = x; // Should fail, I1 not exported. // @Filename: foo2.ts interface I1 { a: string; b: number; } class C1 { m1: I1; } export = C1; // Should fail, type I1 of visible member C1.m1 not exported. // @Filename: ...
{ "end_byte": 498, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportNonVisibleType.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnlyMerge1.ts_0_173
// @Filename: a.ts interface A {} export type { A }; // @Filename: b.ts import { A } from "./a"; const A = 0; export { A }; // @Filename: c.ts import { A } from "./b"; A;
{ "end_byte": 173, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnlyMerge1.ts" }
TypeScript/tests/cases/conformance/externalModules/multipleExportDefault3.ts_3_81
port default { uhoh: "another default", }; export default class C { }
{ "end_byte": 81, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/multipleExportDefault3.ts" }
TypeScript/tests/cases/conformance/externalModules/verbatimModuleSyntaxConstEnum.ts_0_86
// @verbatimModuleSyntax: true // @module: esnext export const enum E { A = 1, }
{ "end_byte": 86, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/verbatimModuleSyntaxConstEnum.ts" }
TypeScript/tests/cases/conformance/externalModules/nameDelimitedBySlashes.ts_0_154
// @module: commonjs // @Filename: test/foo_0.ts export var foo = 42; // @Filename: foo_1.ts import foo = require('./test/foo_0'); var x = foo.foo + 42;
{ "end_byte": 154, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/nameDelimitedBySlashes.ts" }
TypeScript/tests/cases/conformance/externalModules/exportDeclaredModule.ts_0_193
// @Filename: foo1.ts declare module M1 { export var a: string; export function b(): number; } export = M1; // @Filename: foo2.ts import foo1 = require('./foo1'); var x: number = foo1.b();
{ "end_byte": 193, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportDeclaredModule.ts" }
TypeScript/tests/cases/conformance/externalModules/typesOnlyExternalModuleStillHasInstance.ts_0_350
// @module: commonjs // @Filename: foo_0.ts export interface Person { name: string; age: number; } export module M2 { export interface I2 { x: Person; } } // @Filename: foo_1.ts import foo0 = require('./foo_0'); // Per 11.2.3, foo_0 should still be "instantiated", albeit with no members var x: typeof foo0 = {}...
{ "end_byte": 350, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typesOnlyExternalModuleStillHasInstance.ts" }
TypeScript/tests/cases/conformance/externalModules/umd8.ts_0_425
// @module: commonjs // @noImplicitReferences: true // @filename: foo.d.ts declare class Thing { foo(): number; } declare namespace Thing { interface SubThing { } } export = Thing; export as namespace Foo; // @filename: a.ts /// <reference path="foo.d.ts" /> import * as ff from './foo'; let y: Foo; // OK in type p...
{ "end_byte": 425, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/umd8.ts" }
TypeScript/tests/cases/conformance/externalModules/valuesMergingAcrossModules.ts_0_236
// @Filename: a.ts function A() {} export { A }; // @Filename: b.ts import { A } from "./a"; type A = 0; export { A }; // @Filename: c.ts import { A } from "./b"; namespace A { export const displayName = "A"; } A(); A.displayName;
{ "end_byte": 236, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/valuesMergingAcrossModules.ts" }
TypeScript/tests/cases/conformance/externalModules/exportAssignmentTopLevelFundule.ts_0_226
// @module: amd // @Filename: foo_0.ts function foo() { return "test"; } module foo { export var answer = 42; } export = foo; // @Filename: foo_1.ts import foo = require("./foo_0"); if(foo.answer === 42){ var x = foo(); }
{ "end_byte": 226, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignmentTopLevelFundule.ts" }
TypeScript/tests/cases/conformance/externalModules/umd-augmentation-2.ts_0_833
// @module: commonjs // @noImplicitReferences: true // @filename: node_modules/math2d/index.d.ts export as namespace Math2d; export interface Point { x: number; y: number; } export class Vector implements Point { x: number; y: number; constructor(x: number, y: number); translate(dx: number, dy: number): Vecto...
{ "end_byte": 833, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/umd-augmentation-2.ts" }
TypeScript/tests/cases/conformance/externalModules/umd-errors.ts_0_650
// @module: commonjs // @filename: err1.d.ts // Illegal, can't be in script file export as namespace Foo; // @filename: err2.d.ts // Illegal, can't be in external ambient module declare module "Foo" { export as namespace Bar; } // @filename: err3.d.ts // Illegal, can't have modifiers export var p; static export as ...
{ "end_byte": 650, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/umd-errors.ts" }
TypeScript/tests/cases/conformance/externalModules/exportAssignmentMergedInterface.ts_0_335
// @module: amd // @Filename: foo_0.ts interface Foo { (a: string): void; b: string; } interface Foo { (a: number): number; c: boolean; d: {x: number; y: number}; } export = Foo; // @Filename: foo_1.ts import foo = require("./foo_0"); var x: foo; x("test"); x(42); var y: string = x.b; if(!!x.c){ } var z = {x: 1, ...
{ "end_byte": 335, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignmentMergedInterface.ts" }
TypeScript/tests/cases/conformance/externalModules/amdImportNotAsPrimaryExpression.ts_0_496
// @module: amd // @Filename: foo_0.ts export class C1 { m1 = 42; static s1 = true; } export interface I1 { name: string; age: number; } export module M1 { export interface I2 { foo: string; } } export enum E1 { A,B,C } // @Filename: foo_1.ts import foo = require("./foo_0"); // None of the below should cau...
{ "end_byte": 496, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/amdImportNotAsPrimaryExpression.ts" }
TypeScript/tests/cases/conformance/externalModules/asiPreventsParsingAsAmbientExternalModule01.ts_1_254
var declare: number; var module: string; declare // this is the identifier 'declare' module // this is the identifier 'module' "my external module" // this is just a string { } // this is a block body
{ "end_byte": 254, "start_byte": 1, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/asiPreventsParsingAsAmbientExternalModule01.ts" }
TypeScript/tests/cases/conformance/externalModules/exportAmbientClassNameWithObject.ts_0_47
// @target: ES5 export declare class Object {}
{ "end_byte": 47, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAmbientClassNameWithObject.ts" }
TypeScript/tests/cases/conformance/externalModules/verbatimModuleSyntaxNoElisionCJS.ts_0_587
// @verbatimModuleSyntax: true // @target: esnext // @module: commonjs // @moduleResolution: node // @Filename: /a.ts interface I {} export = I; // @Filename: /b.ts import I = require("./a"); // @Filename: /c.ts interface I {} namespace I { export const x = 1; } export = I; // @Filename: /d.ts import I = requir...
{ "end_byte": 587, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/verbatimModuleSyntaxNoElisionCJS.ts" }
TypeScript/tests/cases/conformance/externalModules/relativePathMustResolve.ts_0_143
// @module: commonjs // @Filename: foo_0.ts export var x = 42; // @Filename: foo_1.ts import foo = require('./test/foo'); var z = foo.x + 10;
{ "end_byte": 143, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/relativePathMustResolve.ts" }
TypeScript/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts_0_288
// @moduleResolution: nodenext // @module: nodenext // @jsx: react // @filename: /src/foo.tsx export function foo() { return ""; } // @filename: /src/bar.mts // Extensionless relative path ES import in an ES module import { foo } from "./foo"; // should error, suggest adding ".js"
{ "end_byte": 288, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension4.ts" }
TypeScript/tests/cases/conformance/externalModules/verbatimModuleSyntaxInternalImportEquals.ts_0_198
// @verbatimModuleSyntax: true // @module: esnext export {}; import f1 = NonExistent; namespace Foo { export const foo = 1; export type T = any; } import f2 = Foo.foo; import f3 = Foo.T;
{ "end_byte": 198, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/verbatimModuleSyntaxInternalImportEquals.ts" }
TypeScript/tests/cases/conformance/externalModules/moduleResolutionWithExtensions.ts_0_533
// @traceResolution: true // @Filename: /src/a.ts export default 0; // No extension: '.ts' added // @Filename: /src/b.ts import a from './a'; // '.js' extension: stripped and replaced with '.ts' // @Filename: /src/d.ts import a from './a.js'; // @Filename: /src/jquery.d.ts declare var x: number; export default x; ...
{ "end_byte": 533, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/moduleResolutionWithExtensions.ts" }
TypeScript/tests/cases/conformance/externalModules/umd3.ts_0_289
// @module: commonjs // @noImplicitReferences: true // @filename: foo.d.ts export var x: number; export function fn(): void; export interface Thing { n: typeof x } export as namespace Foo; // @filename: a.ts import * as Foo from './foo'; Foo.fn(); let x: Foo.Thing; let y: number = x.n;
{ "end_byte": 289, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/umd3.ts" }
TypeScript/tests/cases/conformance/externalModules/nameWithFileExtension.ts_0_147
// @module: commonjs // @Filename: foo_0.ts export var foo = 42; // @Filename: foo_1.ts import foo = require('./foo_0.js'); var x = foo.foo + 42;
{ "end_byte": 147, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/nameWithFileExtension.ts" }
TypeScript/tests/cases/conformance/externalModules/exportAssignImportedIdentifier.ts_0_235
// @Filename: foo1.ts export function x(){ return true; } // @Filename: foo2.ts import foo1 = require('./foo1'); var x = foo1.x; export = x; // @Filename: foo3.ts import foo2 = require('./foo2'); var x = foo2(); // should be boolean
{ "end_byte": 235, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignImportedIdentifier.ts" }
TypeScript/tests/cases/conformance/externalModules/verbatimModuleSyntaxNoElisionESM.ts_0_775
// @verbatimModuleSyntax: true // @module: esnext // @moduleResolution: node // @Filename: /a.ts export const a = 0; export type A = typeof a; export class AClass {} // @Filename: /b.ts import { a, A, AClass } from "./a"; import type { a as aValue, A as AType } from "./a"; import { type A as AType2 } from "./a"; exp...
{ "end_byte": 775, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/verbatimModuleSyntaxNoElisionESM.ts" }
TypeScript/tests/cases/conformance/externalModules/topLevelAwait.1.ts_0_1224
// @target: es2015,es2017 // @module: es2022,esnext,system // @experimentalDecorators: true // @noEmitHelpers: true // @filename: index.ts export const x = 1; await x; // reparse element access as await await [x]; await [x, x]; // reparse call as await declare function f(): number; await (x); await (f(), x); await <n...
{ "end_byte": 1224, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwait.1.ts" }
TypeScript/tests/cases/conformance/externalModules/globalAugmentationModuleResolution.ts_3_97
@traceResolution: true // @fileName: a.ts export { }; declare global { var x: number; }
{ "end_byte": 97, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/globalAugmentationModuleResolution.ts" }
TypeScript/tests/cases/conformance/externalModules/importTsBeforeDTs.ts_0_289
// @module: commonjs // @Filename: foo_0.d.ts export var x: number = 42; // @Filename: foo_0.ts export var y: number = 42; // @Filename: foo_1.ts import foo = require("./foo_0"); var z1 = foo.x + 10; // Should error, as .ts preferred over .d.ts var z2 = foo.y + 10; // Should resolve
{ "end_byte": 289, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/importTsBeforeDTs.ts" }
TypeScript/tests/cases/conformance/externalModules/topLevelAwaitErrors.10.ts_0_235
// @target: esnext // @module: es2022,esnext // @filename: index.ts // await disallowed in alias of named import import { await as await } from "./other"; // @filename: other.ts declare const _await: any; export { _await as await };
{ "end_byte": 235, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwaitErrors.10.ts" }
TypeScript/tests/cases/conformance/externalModules/exportNonInitializedVariablesInIfThenStatementNoCrash1.ts_0_186
// @strict: true // @module: esnext, commonjs, system // https://github.com/microsoft/TypeScript/issues/59373 if (true) export const cssExports: CssExports; export default cssExports;
{ "end_byte": 186, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportNonInitializedVariablesInIfThenStatementNoCrash1.ts" }
TypeScript/tests/cases/conformance/externalModules/umd7.ts_0_228
// @module: commonjs // @noImplicitReferences: true // @filename: foo.d.ts declare function Thing(): number; export = Thing; export as namespace Foo; // @filename: a.ts /// <reference path="foo.d.ts" /> let y: number = Foo();
{ "end_byte": 228, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/umd7.ts" }
TypeScript/tests/cases/conformance/externalModules/verbatimModuleSyntaxCompat4.ts_0_392
// @noTypesAndSymbols: true // @noEmit: true // @Filename: /tsconfig.base.json { "compilerOptions": { "verbatimModuleSyntax": true } } // @Filename: /tsconfig.json { "extends": "./tsconfig.base.json", "compilerOptions": { "isolatedModules": true, "preserveValueImports": true, ...
{ "end_byte": 392, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/verbatimModuleSyntaxCompat4.ts" }
TypeScript/tests/cases/conformance/externalModules/duplicateExportAssignments.ts_0_446
// @Filename: foo1.ts var x = 10; var y = 20; export = x; export = y; // @Filename: foo2.ts var x = 10; class y {}; export = x; export = y; // @Filename: foo3.ts module x { export var x = 10; } class y { y: number; } export = x; export = y; // @Filename: foo4.ts export = x; function x(){ return 42; } function y()...
{ "end_byte": 446, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/duplicateExportAssignments.ts" }
TypeScript/tests/cases/conformance/externalModules/exportAssignmentConstrainedGenericType.ts_0_311
// @module: commonjs // @Filename: foo_0.ts class Foo<T extends {a: string; b:number;}>{ test: T; constructor(x: T){} } export = Foo; // @Filename: foo_1.ts import foo = require("./foo_0"); var x = new foo(true); // Should error var y = new foo({a: "test", b: 42}); // Should be OK var z: number = y.test.b;
{ "end_byte": 311, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignmentConstrainedGenericType.ts" }
TypeScript/tests/cases/conformance/externalModules/topLevelAwaitErrors.4.ts_0_125
// @target: esnext // @module: es2022,esnext export {}; // reparse binding pattern as await should fail var [await] = [1];
{ "end_byte": 125, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwaitErrors.4.ts" }
TypeScript/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension1.ts_0_359
// @moduleResolution: node16 // @module: node16 // @filename: /src/foo.mts export function foo() { return ""; } // @filename: /src/bar.mts // Extensionless relative path ES import in an ES module import { foo } from "./foo"; // should error, suggest adding ".mjs" import { baz } from "./baz"; // should error, ask ...
{ "end_byte": 359, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension1.ts" }
TypeScript/tests/cases/conformance/externalModules/exportAssignTypes.ts_0_915
// @Filename: expString.ts var x = "test"; export = x; // @Filename: expNumber.ts var x = 42; export = x; // @Filename: expBoolean.ts var x = true; export = x; // @Filename: expArray.ts var x = [1,2]; export = x; // @Filename: expObject.ts var x = { answer: 42, when: 1776}; export = x; // @Filename: expAny.ts var ...
{ "end_byte": 915, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignTypes.ts" }
TypeScript/tests/cases/conformance/externalModules/topLevelAwaitErrors.11.ts_0_233
// @target: esnext // @module: system // @filename: index.ts // await disallowed in import= declare var require: any; import await = require("./other"); // @filename: other.ts declare const _await: any; export { _await as await };
{ "end_byte": 233, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwaitErrors.11.ts" }
TypeScript/tests/cases/conformance/externalModules/umd6.ts_0_256
// @module: commonjs // @noImplicitReferences: true // @filename: foo.d.ts declare namespace Thing { export function fn(): number; } export = Thing; export as namespace Foo; // @filename: a.ts /// <reference path="foo.d.ts" /> let y: number = Foo.fn();
{ "end_byte": 256, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/umd6.ts" }
TypeScript/tests/cases/conformance/externalModules/initializersInDeclarations.ts_0_285
// @Filename: file1.d.ts // Errors: Initializers & statements in declaration file declare class Foo { name = "test"; "some prop" = 42; fn(): boolean { return false; } } declare var x = []; declare var y = {}; declare module M1 { while(true); export var v1 = () => false; }
{ "end_byte": 285, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/initializersInDeclarations.ts" }
TypeScript/tests/cases/conformance/externalModules/topLevelAwaitErrors.5.ts_0_113
// @target: esnext // @module: es2022,esnext // await in exported class name should fail export class await { }
{ "end_byte": 113, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwaitErrors.5.ts" }
TypeScript/tests/cases/conformance/externalModules/topLevelModuleDeclarationAndFile.ts_0_362
// @module: commonjs // @Filename: vs/foo_0/index.ts export var x: number = 42; // @Filename: foo_1.ts declare module "vs/foo_0" { export var y: () => number; } // @Filename: foo_2.ts /// <reference path="foo_1.ts"/> import foo = require("vs/foo_0"); var z1 = foo.x + 10; // Should error, as declaration should win...
{ "end_byte": 362, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelModuleDeclarationAndFile.ts" }
TypeScript/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension5.ts_0_203
// @moduleResolution: node16 // @module: node16 // @filename: /src/buzz.mts // Extensionless relative path dynamic import in an ES module import("./foo").then(x => x); // should error, ask for extension
{ "end_byte": 203, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension5.ts" }
TypeScript/tests/cases/conformance/externalModules/exportAssignmentMergedModule.ts_0_370
// @module: commonjs // @Filename: foo_0.ts module Foo { export function a(){ return 5; } export var b = true; } module Foo { export function c(a: number){ return a; } export module Test { export var answer = 42; } } export = Foo; // @Filename: foo_1.ts import foo = require("./foo_0"); var a: number = foo...
{ "end_byte": 370, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignmentMergedModule.ts" }
TypeScript/tests/cases/conformance/externalModules/umd2.ts_0_220
// @module: commonjs // @noImplicitReferences: true // @filename: foo.d.ts export var x: number; export function fn(): void; export as namespace Foo; // @filename: a.ts Foo.fn(); let x: Foo.Thing; let y: number = x.n;
{ "end_byte": 220, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/umd2.ts" }
TypeScript/tests/cases/conformance/externalModules/topLevelAmbientModule.ts_0_198
// @module: commonjs // @Filename: foo_0.ts declare module "foo" { export var x: number; } // @Filename: foo_1.ts /// <reference path="foo_0.ts"/> import foo = require("foo"); var z = foo.x + 10;
{ "end_byte": 198, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAmbientModule.ts" }
TypeScript/tests/cases/conformance/externalModules/topLevelAwaitErrors.1.ts_0_786
// @target: esnext // @module: es2022,esnext // @experimentalDecorators: true // @noEmitHelpers: true export {}; // reparse call as invalid await should error await (1,); await <number, string>(1); // reparse tagged template as invalid await should error await <number, string> ``; // reparse class extends clause sh...
{ "end_byte": 786, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwaitErrors.1.ts" }
TypeScript/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/cjsErrors.ts_0_279
// @module: nodenext // @rewriteRelativeImportExtensions: true // @noTypesAndSymbols: true // @verbatimModuleSyntax: true // @Filename: foo.ts/index.ts export = {}; // @Filename: index.ts import foo = require("./foo.ts"); // Error import type _foo = require("./foo.ts"); // Ok
{ "end_byte": 279, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/cjsErrors.ts" }
TypeScript/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/emit.ts_0_1482
// @target: esnext // @module: preserve // @verbatimModuleSyntax: true // @allowJs: true // @outDir: dist // @rewriteRelativeImportExtensions: true // @noTypesAndSymbols: true // @jsx: react,preserve // @Filename: globals.d.ts declare function require(module: string): any; // @Filename: main.ts // Rewrite import {} f...
{ "end_byte": 1482, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/emit.ts" }
TypeScript/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/emitModuleCommonJS.ts_0_351
// @checkJs: true // @outDir: dist // @target: esnext // @module: commonjs,nodenext // @rewriteRelativeImportExtensions: true // @noTypesAndSymbols: true // @Filename: a.js { require("" + "./foo.ts"); import("" + "./foo.ts"); require("./foo.ts"); import("./foo.ts"); } // @Filename: b.ts { import("" + "./foo...
{ "end_byte": 351, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/emitModuleCommonJS.ts" }
TypeScript/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/packageJsonImportsErrors.ts_0_578
// @module: nodenext // @rewriteRelativeImportExtensions: true // @noTypesAndSymbols: true // @verbatimModuleSyntax: true // @Filename: /package.json { "name": "pkg", "type": "module", "imports": { "#foo.ts": "./foo.ts", "#internal/*": "./internal/*" }, "exports": { "./*.ts": { "source": "....
{ "end_byte": 578, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/packageJsonImportsErrors.ts" }
TypeScript/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/nodeModulesTsFiles.ts_0_320
// @module: nodenext // @rewriteRelativeImportExtensions: true // @noTypesAndSymbols: true // @noEmit: true // @noImplicitReferences: true // @Filename: /node_modules/lodash-ts/add.ts export function add(a: number, b: number) { return a + b; } // @Filename: /index.ts import { add } from "lodash-ts/add.ts"; // Ok
{ "end_byte": 320, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/nodeModulesTsFiles.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target.ts_0_313
// @target: es5 // @module: es2015 // @experimentalDecorators: true export class C { static s = 0; p = 1; method() { } } export { C as C2 }; declare function foo(...args: any[]): any; @foo export class D { static s = 0; p = 1; method() { } } export { D as D2 }; class E { } export {E};
{ "end_byte": 313, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target9.ts_0_211
// @target: es5 // @module: es2015 import d from "mod"; import {a} from "mod"; import * as M from "mod"; export {a}; export {M}; export {d}; export * from "mod"; export {b} from "mod" export default d;
{ "end_byte": 211, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target9.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target8.ts_0_73
// @target: es5 // @module: es2015 export const c = 0; export let l = 1;
{ "end_byte": 73, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target8.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindWithES2015Target.ts_0_185
// @target: es2015 // @sourcemap: false // @declaration: false // @module: es6 export default class A { constructor () { } public B() { return 42; } }
{ "end_byte": 185, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekindWithES2015Target.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target7.ts_0_126
// @target: es5 // @module: es2015 export namespace N { var x = 0; } export namespace N2 { export interface I { } }
{ "end_byte": 126, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target7.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target3.ts_0_190
// @target: es5 // @module: es2015 // @experimentalDecorators: true declare function foo(...args: any[]): any; @foo export default class D { static s = 0; p = 1; method() { } }
{ "end_byte": 190, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target3.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target2.ts_0_109
// @target: es5 // @module: es2015 export default class C { static s = 0; p = 1; method() { } }
{ "end_byte": 109, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target2.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target12.ts_0_401
// @target: es5 // @module: es2015 export class C { } export namespace C { export const x = 1; } export enum E { w = 1 } export enum E { x = 2 } export namespace E { export const y = 1; } export namespace E { export const z = 1; } export namespace N { } export namespace N { export const ...
{ "end_byte": 401, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target12.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target6.ts_0_137
// @target: es5 // @module: es2015 export function f1(d = 0) { } export function f2(...arg) { } export default function f3(d = 0) { }
{ "end_byte": 137, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target6.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target11.ts_0_219
// @target: es5 // @module: es2015 // @experimentalDecorators: true declare function foo(...args: any[]): any; @foo export default class C { static x() { return C.y; } static y = 1 p = 1; method() { } }
{ "end_byte": 219, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target11.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target5.ts_0_131
// @target: es5 // @module: es2015 // @preserveConstEnums: true export enum E1 { value1 } export const enum E2 { value1 }
{ "end_byte": 131, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target5.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target10.ts_0_111
// @target: es5 // @module: es2015 import i = require("mod"); // Error; namespace N { } export = N; // Error
{ "end_byte": 111, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target10.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target4.ts_0_65
// @target: es5 // @module: es2015 class E { } export default E;
{ "end_byte": 65, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target4.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindExportClassNameWithObject.ts_0_58
// @target: ES5 // @module: es2015 export class Object {}
{ "end_byte": 58, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekindExportClassNameWithObject.ts" }
TypeScript/tests/cases/conformance/externalModules/es6/es6modulekind.ts_0_182
// @target: ES6 // @sourcemap: false // @declaration: false // @module: es6 export default class A { constructor () { } public B() { return 42; } }
{ "end_byte": 182, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/es6/es6modulekind.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/exportNamespace9.ts_0_454
// @Filename: /a.ts export type A = number; // @Filename: /b.ts export type * from "./a"; // @Filename: /c.ts import { A } from "./b"; const A = 1; export { A }; // @Filename: /d.ts import { A } from "./c"; A; // Ok type _ = A; // @Filename: /e.ts export const A = 1; // @Filename: /f.ts export * from "./e"; export...
{ "end_byte": 454, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/exportNamespace9.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/namespaceImportTypeQuery2.ts_0_275
// @Filename: /z.ts interface A {} export type { A }; // @Filename: /a.ts import { A } from './z'; const A = 0; export { A }; export class B {}; // @Filename: /b.ts import * as types from './a'; let t: typeof types = { A: undefined as any, // ok B: undefined as any, }
{ "end_byte": 275, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/namespaceImportTypeQuery2.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/exportDeclaration_value.ts_0_127
// @Filename: /a.ts const A = {}; export type { A }; export const AA = {}; // @Filename: /b.ts export type { AA } from './a';
{ "end_byte": 127, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/exportDeclaration_value.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/exportDeclaration_missingBraces.ts_0_276
// @noEmit: true // @noTypesAndSymbols: true enum Numbers { One, Two } class Box<T> {} interface Circle {} namespace ns { export type T; // Normal parse error because there is no other 'T' } export type Numbers; export type Box; export type Circle; export type ns;
{ "end_byte": 276, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/exportDeclaration_missingBraces.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/importEquals3.ts_0_304
// @Filename: a.ts export class A {} // @Filename: b.ts import type * as a from './a'; import A = a.A; // Error import aa = a; // Error const x = 0; export { a, A, x }; // @Filename: c.ts import * as b from './b'; import A = b.a.A; // Error import AA = b.A; // Error import x = b.x; console.log(x);
{ "end_byte": 304, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/importEquals3.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/importEquals2.ts_0_203
// @esModuleInterop: true // @Filename: /a.ts class A {} export type { A } // @Filename: /b.ts import * as a from './a'; export = a; // @Filename: /c.ts import a = require('./b'); new a.A(); // Error
{ "end_byte": 203, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/importEquals2.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/exportNamespace8.ts_0_339
// @Filename: /a.ts export class A {} export class B {} // @Filename: /b.ts export class B {} export class C {} // @Filename: /c.ts export type * from "./a"; export * from "./b"; // Collision error // @Filename: /d.ts import { A, B, C } from "./c"; let _: A = new A(); // Error let __: B = new B(); // Ok let ___: ...
{ "end_byte": 339, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/exportNamespace8.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/namespaceImportTypeQuery3.ts_0_239
// @Filename: /a.ts import type { A } from './z'; // unresolved const A = 0; export { A }; export class B {}; // @Filename: /b.ts import * as types from './a'; let t: typeof types = { A: undefined as any, // ok B: undefined as any, }
{ "end_byte": 239, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/namespaceImportTypeQuery3.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/exportSpecifiers.ts_0_560
// @module: esnext // @declaration: true // @Filename: /imports.ts import { type, as, something, foo, bar } from "./exports.js"; type; as; // Error (used in emitting position) something; // Error (used in emitting position) foo; // Error (used in emitting position) bar; // Error (used in emitting position) // @Filena...
{ "end_byte": 560, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/exportSpecifiers.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/importClause_default.ts_0_151
// @Filename: /a.ts export default class A { a!: string } // @Filename: /b.ts import type A from './a'; new A(); let a: A = { a: '' }; let b = { A };
{ "end_byte": 151, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/importClause_default.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/implementsClause.ts_0_328
// @Filename: types.ts export interface Component {} // @Filename: ns.ts import type * as types from './types'; export { types }; // @Filename: index.ts import type * as types from './types'; import * as nestedNamespace from './ns'; class C implements types.Component {} class D implements nestedNamespace.types.Compo...
{ "end_byte": 328, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/implementsClause.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/chained.ts_0_309
// @Filename: /a.ts class A { a!: string } export type { A as B }; export type Z = A; // @Filename: /b.ts import { Z as Y } from './a'; export { B as C } from './a'; // @Filename: /c.ts import type { C } from './b'; export { C as D }; // @Filename: /d.ts import { D } from './c'; new D(); const d: D = {};
{ "end_byte": 309, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/chained.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/exportNamespace3.ts_0_198
// @Filename: a.ts export class A {} // @Filename: b.ts export type { A } from './a'; // @Filename: c.ts export * as a from './b'; // @Filename: d.ts import { a } from './c'; new a.A(); // Error
{ "end_byte": 198, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/exportNamespace3.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/importClause_namedImports.ts_0_219
// @Filename: /abc.ts export class A {} export type B = { b: string }; export const C = ""; // @Filename: /d.ts import type { A, B, C } from './abc'; new A(); declare let a: A; declare let b: B; b.b; const c = { A };
{ "end_byte": 219, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/importClause_namedImports.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/exportNamespace7.ts_0_471
// @Filename: /a.ts export class A {} export class B {} export class C {} // @Filename: /b.ts export type * from "./a"; export class C {} // @Filename: /c.ts import { A, B, C } from "./b"; let _: A = new A(); // Error let __: B = new B(); // Error let ___: C = new C(); // Ok // @Filename: /d.ts export type * from "...
{ "end_byte": 471, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/exportNamespace7.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/mergedWithLocalValue.ts_0_125
// @Filename: a.ts export type A = "a"; // @Filename: b.ts import type { A } from "./a"; const A: A = "a"; A.toUpperCase();
{ "end_byte": 125, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/mergedWithLocalValue.ts" }
TypeScript/tests/cases/conformance/externalModules/typeOnly/importSpecifiers_js.ts_0_149
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: ./a.ts export interface A {} // @Filename: ./a.js import { type A } from "./a";
{ "end_byte": 149, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnly/importSpecifiers_js.ts" }