_id stringlengths 21 254 | text stringlengths 1 93.7k | metadata dict |
|---|---|---|
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeAliases.ts_0_791 | // @allowJs: true
// @checkJs: true
// @outDir: ./out
// @declaration: true
// @filename: index.js
export {}; // flag file as module
/**
* @typedef {string | number | symbol} PropName
*/
/**
* Callback
*
* @callback NumberToStringCb
* @param {number} a
* @returns {string}
*/
/**
* @template T
* @typedef {... | {
"end_byte": 791,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeAliases.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsRestArgsWithThisTypeInJSDocFunction.ts_0_250 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: bug38550.js
export class Clazz {
/**
* @param {function(this:Object, ...*):*} functionDeclaration
*/
method(functionDeclaration) {}
}
| {
"end_byte": 250,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsRestArgsWithThisTypeInJSDocFunction.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedClassExpressionAnonymous.ts_0_234 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: index.js
module.exports = class {
/**
* @param {number} p
*/
constructor(p) {
this.t = 12 + p;
}
} | {
"end_byte": 234,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedClassExpressionAnonymous.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsJson.ts_0_350 | // @allowJs: true
// @checkJs: true
// @target: es5
// @resolveJsonModule: true
// @outDir: ./out
// @declaration: true
// @filename: index.js
const j = require("./obj.json");
module.exports = j;
// @filename: obj.json
{
"x": 12,
"y": 12,
"obj": {
"items": [{"x": 12}, {"x": 12, "y": 12}, {"x": 0}, {... | {
"end_byte": 350,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsJson.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsEnumTag.ts_0_1095 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: index.js
/** @enum {string} */
export const Target = {
START: "start",
MIDDLE: "middle",
END: "end",
/** @type {number} */
OK_I_GUESS: 2
}
/** @enum number */
export const Second = {
OK: 1,
... | {
"end_byte": 1095,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsEnumTag.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsReactComponents.ts_0_1958 | // @allowJs: true
// @checkJs: true
// @target: es5
// @jsx: react
// @esModuleInterop: true
// @outDir: ./out
// @strict: true
// @noImplicitAny: false
// @declaration: true
// @filename: jsDeclarationsReactComponents1.jsx
/// <reference path="/.lib/react16.d.ts" preserve="true" />
import React from "react";
import Pr... | {
"end_byte": 1958,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsReactComponents.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsConstsAsNamespacesWithReferences.ts_0_230 | // @allowJs: true
// @checkJs: true
// @outDir: ./out
// @target: es6
// @declaration: true
// @filename: index.js
export const colors = {
royalBlue: "#6400e4",
};
export const brandColors = {
purple: colors.royalBlue,
}; | {
"end_byte": 230,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsConstsAsNamespacesWithReferences.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedConstructorFunction.ts_0_297 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: jsDeclarationsExportAssignedConstructorFunction.js
/** @constructor */
module.exports.MyClass = function() {
this.x = 1
}
module.exports.MyClass.prototype = {
a: function() {
}
}
| {
"end_byte": 297,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedConstructorFunction.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionsCjs.ts_0_1234 | // @allowJs: true
// @checkJs: true
// @outDir: ./out
// @declaration: true
// @filename: index.js
module.exports.a = function a() {}
module.exports.b = function b() {}
module.exports.b.cat = "cat";
module.exports.c = function c() {}
module.exports.c.Cls = class {}
/**
* @param {number} a
* @param {number} b
* @r... | {
"end_byte": 1234,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionsCjs.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionPrototypeStatic.ts_0_427 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: source.js
module.exports = MyClass;
function MyClass() {}
MyClass.staticMethod = function() {}
MyClass.prototype.method = function() {}
MyClass.staticProperty = 123;
/**
* Callback to be invoked when test execut... | {
"end_byte": 427,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionPrototypeStatic.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassesErr.ts_0_1296 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: index.js
// Pretty much all of this should be an error, (since index signatures and generics are forbidden in js),
// but we should be able to synthesize declarations from the symbols regardless
export class M<T>... | {
"end_byte": 1296,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassesErr.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypedefAndImportTypes.ts_0_528 | // @allowJs: true
// @checkJs: true
// @outDir: ./out
// @declaration: true
// @filename: conn.js
/**
* @typedef {string | number} Whatever
*/
class Conn {
constructor() {}
item = 3;
method() {}
}
module.exports = Conn;
// @filename: usage.js
/**
* @typedef {import("./conn")} Conn
*/
class Wrap {
... | {
"end_byte": 528,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypedefAndImportTypes.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassAccessor.ts_0_749 | // @allowJs: true
// @checkJs: true
// @target: es2019
// @outDir: ./out
// @declaration: true
// @filename: supplement.d.ts
export { };
declare module "./argument.js" {
interface Argument {
idlType: any;
default: null;
}
}
// @filename: base.js
export class Base {
constructor() { }
toJ... | {
"end_byte": 749,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassAccessor.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsUniqueSymbolUsage.ts_0_377 | // @allowJs: true
// @checkJs: true
// @declaration: true
// @emitDeclarationOnly: true
// @lib: es2017
// @filename: a.js
export const kSymbol = Symbol("my-symbol");
/**
* @typedef {{[kSymbol]: true}} WithSymbol
*/
// @filename: b.js
/**
* @returns {import('./a').WithSymbol}
* @param {import('./a').WithSymbol} v... | {
"end_byte": 377,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsUniqueSymbolUsage.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassImplementsGenericsSerialization.ts_0_462 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: interface.ts
export interface Encoder<T> {
encode(value: T): Uint8Array
}
// @filename: lib.js
/**
* @template T
* @implements {IEncoder<T>}
*/
export class Encoder {
/**
* @param {T} value
*/... | {
"end_byte": 462,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassImplementsGenericsSerialization.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsReusesExistingNodesMappingJSDocTypes.ts_0_546 | // @allowJs: true
// @checkJs: true
// @outDir: /out
// @lib: es6
// @declaration: true
// @filename: index.js
/** @type {?} */
export const a = null;
/** @type {*} */
export const b = null;
/** @type {string?} */
export const c = null;
/** @type {string=} */
export const d = null;
/** @type {string!} */
export co... | {
"end_byte": 546,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsReusesExistingNodesMappingJSDocTypes.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsNonIdentifierInferredNames.ts_0_394 | // @allowJs: true
// @checkJs: true
// @target: es6
// @outDir: ./out
// @declaration: true
// @jsx: react
// @filename: jsDeclarationsNonIdentifierInferredNames.jsx
/// <reference path="/.lib/react16.d.ts" />
import * as React from "react";
const dynPropName = "data-dyn";
export const ExampleFunctionalComponent = ({ "... | {
"end_byte": 394,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsNonIdentifierInferredNames.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportForms.ts_0_1075 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: cls.js
export class Foo {}
// @filename: func.js
export function func() {}
// @filename: bar.js
export * from "./cls";
// @filename: bar2.js
export * from "./func";
export * from "./cls";
// @filename: baz.js
i... | {
"end_byte": 1075,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportForms.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedClassExpressionShadowing.ts_0_282 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: index.js
class A {
member = new Q();
}
class Q {
x = 42;
}
module.exports = class Q {
constructor() {
this.x = new A();
}
}
module.exports.Another = Q;
| {
"end_byte": 282,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedClassExpressionShadowing.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionLikeClasses2.ts_0_1599 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: source.js
/**
* @param {number} len
*/
export function Vec(len) {
/**
* @type {number[]}
*/
this.storage = new Array(len);
}
Vec.prototype = {
/**
* @param {Vec} other
*/
dot... | {
"end_byte": 1599,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionLikeClasses2.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsOptionalTypeLiteralProps1.ts_0_324 | // @allowJs: true
// @checkJs: true
// @target: esnext
// @outDir: ./out
// @declaration: true
// @filename: foo.js
/**
* foo
*
* @public
* @param {object} opts
* @param {number} opts.a
* @param {number} [opts.b]
* @param {number} [opts.c]
* @returns {number}
*/
function foo({ a, b, c }) {
return a + b + c... | {
"end_byte": 324,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsOptionalTypeLiteralProps1.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeReferences2.ts_0_321 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: tests/cases/conformance/jsdoc/declarations/out
// @declaration: true
// @filename: something.ts
export const o = {
a: 1,
m: 1
}
// @filename: index.js
const{ a, m } = require("./something").o;
const thing = a + m
module.exports = {
thing
};... | {
"end_byte": 321,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeReferences2.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassStatic2.ts_0_309 | // @allowJs: true
// @checkJs: true
// @declaration: true
// @emitDeclarationOnly: true
// @outDir: ./out/
// @filename: Foo.js
class Base {
static foo = "";
}
export class Foo extends Base {}
Foo.foo = "foo";
// @filename: Bar.ts
import { Foo } from "./Foo.js";
class Bar extends Foo {}
Bar.foo = "foo";
| {
"end_byte": 309,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassStatic2.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignmentWithKeywordName.ts_0_219 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: index.js
var x = 12;
module.exports = {
extends: 'base',
more: {
others: ['strs']
},
x
}; | {
"end_byte": 219,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignmentWithKeywordName.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctions.ts_0_904 | // @allowJs: true
// @checkJs: true
// @outDir: ./out
// @declaration: true
// @filename: index.js
export function a() {}
export function b() {}
b.cat = "cat";
export function c() {}
c.Cls = class {}
/**
* @param {number} a
* @param {number} b
* @return {string}
*/
export function d(a, b) { return /** @type {*}... | {
"end_byte": 904,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctions.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsImportAliasExposedWithinNamespace.ts_0_1074 | // @declaration: true
// @emitDeclarationOnly: true
// @allowJs: true
// @checkJs: true
// @module: commonjs
// @target: es6
// @filename: file.js
/**
* @namespace myTypes
* @global
* @type {Object<string,*>}
*/
const myTypes = {
// SOME PROPS HERE
};
/** @typedef {string|RegExp|Array<string|RegExp>} myTypes.t... | {
"end_byte": 1074,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsImportAliasExposedWithinNamespace.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsImportTypeBundled.ts_0_348 | // @allowJs: true
// @checkJs: true
// @outFile: out.js
// @module: amd
// @declaration: true
// @filename: folder/mod1.js
/**
* @typedef {{x: number}} Item
*/
/**
* @type {Item};
*/
const x = {x: 12};
module.exports = x;
// @filename: index.js
/** @type {(typeof import("./folder/mod1"))[]} */
const items = [{x: 1... | {
"end_byte": 348,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsImportTypeBundled.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedVisibility.ts_0_351 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: obj.js
module.exports = class Obj {
constructor() {
this.x = 12;
}
}
// @filename: index.js
const Obj = require("./obj");
class Container {
constructor() {
this.usage = new Obj();
}... | {
"end_byte": 351,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedVisibility.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeReassignmentFromDeclaration.ts_0_303 | // @allowJs: true
// @checkJs: true
// @outDir: /out
// @lib: es6
// @declaration: true
// @filename: /some-mod.d.ts
interface Item {
x: string;
}
declare const items: Item[];
export = items;
// @filename: index.js
/** @type {typeof import("/some-mod")} */
const items = [];
module.exports = items; | {
"end_byte": 303,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeReassignmentFromDeclaration.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsReferenceToClassInstanceCrossFile.ts_0_858 | // @allowJs: true
// @checkJs: true
// @moduleResolution: node
// @declaration: true
// @emitDeclarationOnly: true
// @filename: rectangle.js
class Rectangle {
constructor() {
console.log("I'm a rectangle!");
}
}
module.exports = { Rectangle };
// @filename: index.js
const {Rectangle} = require('./rect... | {
"end_byte": 858,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsReferenceToClassInstanceCrossFile.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedClassInstance1.ts_0_156 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: index.js
class Foo {}
module.exports = new Foo(); | {
"end_byte": 156,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedClassInstance1.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.ts_0_340 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: index.js
module.exports = class {
/**
* @param {number} p
*/
constructor(p) {
this.t = 12 + p;
}
}
module.exports.Sub = class {
constructor() {
this.instance = new module.e... | {
"end_byte": 340,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsParameterTagReusesInputNodeInEmit1.ts_0_626 | // @allowJs: true
// @checkJs: true
// @target: es6
// @outDir: ./out
// @declaration: true
// @filename: base.js
class Base {
constructor() {}
}
const BaseFactory = () => {
return new Base();
};
BaseFactory.Base = Base;
module.exports = BaseFactory;
// @filename: file.js
/** @typedef {import('./base')} Bas... | {
"end_byte": 626,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsParameterTagReusesInputNodeInEmit1.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeReferences.ts_0_400 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: tests/cases/conformance/jsdoc/declarations/out
// @declaration: true
// @filename: node_modules/@types/node/index.d.ts
declare module "fs" {
export class Something {}
}
// @filename: index.js
/// <reference types="node" />
const Something = require("f... | {
"end_byte": 400,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeReferences.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsDocCommentsOnConsts.ts_0_270 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: index1.js
/**
* const doc comment
*/
const x = (a) => {
return '';
};
/**
* function doc comment
*/
function b() {
return 0;
}
module.exports = {x, b} | {
"end_byte": 270,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsDocCommentsOnConsts.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionWithDefaultAssignedMember.ts_0_173 | // @allowJs: true
// @checkJs: true
// @outDir: ./out
// @declaration: true
// @filename: index.js
function foo() {}
foo.foo = foo;
foo.default = foo;
module.exports = foo; | {
"end_byte": 173,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionWithDefaultAssignedMember.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeReferences3.ts_0_409 | // @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: tests/cases/conformance/jsdoc/declarations/out
// @declaration: true
// @filename: node_modules/@types/node/index.d.ts
declare module "fs" {
export class Something {}
}
// @filename: index.js
/// <reference types="node" />
const Something = require("f... | {
"end_byte": 409,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeReferences3.ts"
} |
TypeScript/tests/cases/conformance/externalModules/topLevelAwait.3.ts_0_202 | // @target: esnext
// @module: es2022,esnext
// @filename: index.d.ts
// await keyword allowed as identifier in a declaration file
export {};
declare const await: any;
declare class C extends await {}
| {
"end_byte": 202,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwait.3.ts"
} |
TypeScript/tests/cases/conformance/externalModules/importsImplicitlyReadonly.ts_0_322 | // @module: commonjs
// @filename: a.ts
export var x = 1;
var y = 1;
export { y };
// @filename: b.ts
import { x, y } from "./a";
import * as a1 from "./a";
import a2 = require("./a");
const a3 = a1;
x = 1; // Error
y = 1; // Error
a1.x = 1; // Error
a1.y = 1; // Error
a2.x = 1;
a2.y = 1;
a3.x = 1;
a3.y = ... | {
"end_byte": 322,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/importsImplicitlyReadonly.ts"
} |
TypeScript/tests/cases/conformance/externalModules/topLevelAwaitErrors.12.ts_0_185 | // @target: esnext
// @module: es2022,esnext
export {};
declare namespace foo { const await: any; }
// await disallowed in import=namespace when in a module
import await = foo.await;
| {
"end_byte": 185,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwaitErrors.12.ts"
} |
TypeScript/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension2.ts_0_211 | // @moduleResolution: node16
// @module: node16
// @filename: /src/buzz.mts
// Extensionless relative path cjs import in an ES module
import foo = require("./foo"); // should error, should not ask for extension | {
"end_byte": 211,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension2.ts"
} |
TypeScript/tests/cases/conformance/externalModules/umd5.ts_0_318 | // @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 Bar from './foo';
Bar.fn();
let x: Bar.Thing;
let y: number = x.n;
// should error
let z = Foo;
| {
"end_byte": 318,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/umd5.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportAssignmentGenericType.ts_0_191 | // @module: commonjs
// @Filename: foo_0.ts
class Foo<T>{
test: T;
}
export = Foo;
// @Filename: foo_1.ts
import foo = require("./foo_0");
var x = new foo<number>();
var y:number = x.test;
| {
"end_byte": 191,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignmentGenericType.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportAssignDottedName.ts_0_138 | // @Filename: foo1.ts
export function x(){
return true;
}
// @Filename: foo2.ts
import foo1 = require('./foo1');
export = foo1.x; // Ok
| {
"end_byte": 138,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignDottedName.ts"
} |
TypeScript/tests/cases/conformance/externalModules/verbatimModuleSyntaxConstEnumUsage.ts_0_230 | // @module: esnext
// @verbatimModuleSyntax: true
// @filename: foo.ts
export enum Foo {
a = 1,
b,
c,
}
// @filename: bar.ts
import {Foo} from './foo.js';
export enum Bar {
a = Foo.a,
c = Foo.c,
e = 5,
} | {
"end_byte": 230,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/verbatimModuleSyntaxConstEnumUsage.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportAssignmentTopLevelEnumdule.ts_0_245 | // @module: amd
// @Filename: foo_0.ts
enum foo {
red, green, blue
}
module foo {
export var answer = 42;
}
export = foo;
// @Filename: foo_1.ts
import foo = require("./foo_0");
var color: foo;
if(color === foo.green){
color = foo.answer;
}
| {
"end_byte": 245,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignmentTopLevelEnumdule.ts"
} |
TypeScript/tests/cases/conformance/externalModules/topLevelAwaitErrors.6.ts_0_121 | // @target: esnext
// @module: es2022,esnext
// await in exported function name should fail
export function await() {
}
| {
"end_byte": 121,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwaitErrors.6.ts"
} |
TypeScript/tests/cases/conformance/externalModules/topLevelAwaitNonModule.ts_0_131 | // @target: esnext
// @module: es2022,esnext
await x;
const arr = [Promise.resolve()];
for await (const item of arr) {
item;
}
| {
"end_byte": 131,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwaitNonModule.ts"
} |
TypeScript/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension6.ts_0_325 | // @moduleResolution: node16
// @module: node16
// @filename: /src/bar.cts
// Extensionless relative path import statement in a cjs module
// Import statements are not allowed in cjs files,
// but other errors should not assume that they are allowed
import { foo } from "./foo"; // should error, should not ask for exte... | {
"end_byte": 325,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension6.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportAssignmentTopLevelClodule.ts_0_225 | // @module: amd
// @Filename: foo_0.ts
class Foo {
test = "test";
}
module Foo {
export var answer = 42;
}
export = Foo;
// @Filename: foo_1.ts
import foo = require("./foo_0");
if(foo.answer === 42){
var x = new foo();
}
| {
"end_byte": 225,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignmentTopLevelClodule.ts"
} |
TypeScript/tests/cases/conformance/externalModules/verbatimModuleSyntaxCompat2.ts_0_285 | // @noTypesAndSymbols: true
// @noEmit: true
// @Filename: /tsconfig.json
{
"compilerOptions": {
"verbatimModuleSyntax": true,
"isolatedModules": true,
"preserveValueImports": true,
"importsNotUsedAsValues": "error",
}
}
// @Filename: /index.ts | {
"end_byte": 285,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/verbatimModuleSyntaxCompat2.ts"
} |
TypeScript/tests/cases/conformance/externalModules/nameWithRelativePaths.ts_0_401 | // @module: commonjs
// @Filename: foo_0.ts
export var foo = 42;
// @Filename: test/test/foo_1.ts
export function f(){
return 42;
}
// @Filename: test/foo_2.ts
export module M2 {
export var x = true;
}
// @Filename: test/foo_3.ts
import foo0 = require('../foo_0');
import foo1 = require('./test/foo_1');
import foo2... | {
"end_byte": 401,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/nameWithRelativePaths.ts"
} |
TypeScript/tests/cases/conformance/externalModules/umd1.ts_0_293 | // @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
/// <reference path="foo.d.ts" />
Foo.fn();
let x: Foo.Thing;
let y: number = x.n;
| {
"end_byte": 293,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/umd1.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportNonInitializedVariablesUMD.ts_0_523 | //@module: umd
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 filtered
... | {
"end_byte": 523,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportNonInitializedVariablesUMD.ts"
} |
TypeScript/tests/cases/conformance/externalModules/verbatimModuleSyntaxAmbientConstEnum.ts_0_478 | // @verbatimModuleSyntax: true
// @target: esnext
// @module: preserve
// @noEmit: true
// @noTypesAndSymbols: true
// @Filename: /node_modules/pkg/index.d.ts
export declare const enum E { A, B, C }
declare global {
const enum F { A, B, C }
}
// @Filename: /a.ts
import { E } from "pkg"; // Error
import type { E as ... | {
"end_byte": 478,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/verbatimModuleSyntaxAmbientConstEnum.ts"
} |
TypeScript/tests/cases/conformance/externalModules/topLevelAwaitErrors.2.ts_0_119 | // @target: esnext
// @module: es2022,esnext
export {};
// reparse variable name as await should fail
var await = 1;
| {
"end_byte": 119,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwaitErrors.2.ts"
} |
TypeScript/tests/cases/conformance/externalModules/verbatimModuleSyntaxRestrictionsESM.ts_0_652 | // @verbatimModuleSyntax: true
// @target: esnext
// @module: esnext
// @moduleResolution: node
// @esModuleInterop: true, false
// @Filename: /decl.d.ts
declare class CJSy {}
export = CJSy;
// @Filename: /ambient.d.ts
declare module "ambient" {
const _export: number;
export = _export;
}
// @Filename: /types... | {
"end_byte": 652,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/verbatimModuleSyntaxRestrictionsESM.ts"
} |
TypeScript/tests/cases/conformance/externalModules/relativePathToDeclarationFile.ts_0_491 | // @ModuleResolution: classic
// @Filename: test/foo.d.ts
export declare module M2 {
export var x: boolean;
}
// @Filename: test/other.d.ts
export declare module M2 {
export var x: string;
}
// @Filename: test/sub/relMod.d.ts
declare class Test {
constructor(x: number);
}
export = Test;
// @Filename: test/file1.t... | {
"end_byte": 491,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/relativePathToDeclarationFile.ts"
} |
TypeScript/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension7.ts_0_210 | // @moduleResolution: node16
// @module: node16
// @filename: /src/bar.cts
// Extensionless relative path cjs import in a cjs module
import foo = require("./foo"); // should error, should not ask for extension | {
"end_byte": 210,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension7.ts"
} |
TypeScript/tests/cases/conformance/externalModules/verbatimModuleSyntaxCompat3.ts_0_392 | // @noTypesAndSymbols: true
// @noEmit: true
// @Filename: /tsconfig.base.json
{
"compilerOptions": {
"isolatedModules": true,
"preserveValueImports": true,
"importsNotUsedAsValues": "error",
}
}
// @Filename: /tsconfig.json
{
"extends": "./tsconfig.base.json",
"compilerOptions"... | {
"end_byte": 392,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/verbatimModuleSyntaxCompat3.ts"
} |
TypeScript/tests/cases/conformance/externalModules/topLevelFileModule.ts_0_243 | // @module: commonjs
// @Filename: vs/foo_0.ts
export var x: number;
// @Filename: vs/fum.d.ts
export declare var y: number;
// @Filename: foo_1.ts
import foo = require("./vs/foo_0");
import fum = require("./vs/fum");
var z = foo.x + fum.y;
| {
"end_byte": 243,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelFileModule.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts_0_523 | //@module: amd
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 filtered
... | {
"end_byte": 523,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts"
} |
TypeScript/tests/cases/conformance/externalModules/topLevelAwaitErrors.3.ts_0_131 | // @target: esnext
// @module: es2022,esnext
export {};
// reparse binding pattern as await should fail
var {await} = {await:1};
| {
"end_byte": 131,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwaitErrors.3.ts"
} |
TypeScript/tests/cases/conformance/externalModules/verbatimModuleSyntaxCompat.ts_0_197 | // @verbatimModuleSyntax: true
// @isolatedModules: true
// @preserveValueImports: true
// @importsNotUsedAsValues: error
// @module: system
// @noEmit: true
// @noTypesAndSymbols: true
export {}; | {
"end_byte": 197,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/verbatimModuleSyntaxCompat.ts"
} |
TypeScript/tests/cases/conformance/externalModules/topLevelAwait.2.ts_0_172 | // @target: esnext
// @module: es2022,esnext
declare namespace foo { const await: any; }
// await allowed in import=namespace when not a module
import await = foo.await;
| {
"end_byte": 172,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwait.2.ts"
} |
TypeScript/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts_0_292 | // @moduleResolution: nodenext
// @module: nodenext
// @jsx: preserve
// @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 ".jsx"
| {
"end_byte": 292,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension3.ts"
} |
TypeScript/tests/cases/conformance/externalModules/umd4.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 Bar from './foo';
Bar.fn();
let x: Bar.Thing;
let y: number = x.n;
| {
"end_byte": 289,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/umd4.ts"
} |
TypeScript/tests/cases/conformance/externalModules/commonJsImportBindingElementNarrowType.ts_0_250 | // Regresion test for GH#41957
// @allowJs: true
// @checkJs: true
// @strictNullChecks: true
// @noEmit: true
// @Filename: /foo.d.ts
export const a: number | null;
// @Filename: /bar.js
const { a } = require("./foo");
if (a) {
var x = a + 1;
} | {
"end_byte": 250,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/commonJsImportBindingElementNarrowType.ts"
} |
TypeScript/tests/cases/conformance/externalModules/moduleScoping.ts_0_501 | // @Filename: file1.ts
var v1 = "sausages"; // Global scope
// @Filename: file2.ts
var v2 = 42; // Global scope
var v4 = () => 5;
// @Filename: file3.ts
export var v3 = true;
var v2 = [1,2,3]; // Module scope. Should not appear in global scope
// @Filename: file4.ts
import file3 = require('./file3');
var t1 = v1;
va... | {
"end_byte": 501,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/moduleScoping.ts"
} |
TypeScript/tests/cases/conformance/externalModules/topLevelAwaitErrors.7.ts_0_222 | // @target: esnext
// @module: es2022,esnext
// @filename: index.ts
// await disallowed in namespace import
import * as await from "./other";
// @filename: other.ts
declare const _await: any;
export { _await as await };
| {
"end_byte": 222,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwaitErrors.7.ts"
} |
TypeScript/tests/cases/conformance/externalModules/reexportClassDefinition.ts_0_230 | // @module: commonjs
// @Filename: foo1.ts
class x{}
export = x;
// @Filename: foo2.ts
import foo1 = require('./foo1');
export = {
x: foo1
}
// @Filename: foo3.ts
import foo2 = require('./foo2')
class x extends foo2.x {}
| {
"end_byte": 230,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/reexportClassDefinition.ts"
} |
TypeScript/tests/cases/conformance/externalModules/typeOnlyMerge2.ts_0_246 | // @Filename: a.ts
const A = {}
export { A };
// @Filename: b.ts
import { A } from "./a";
type A = any;
export type { A };
// @Filename: c.ts
import { A } from "./b";
namespace A {}
export { A };
// @Filename: d.ts
import { A } from "./c";
A;
| {
"end_byte": 246,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnlyMerge2.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportAssignNonIdentifier.ts_0_516 | // @Filename: foo1.ts
var x = 10;
export = typeof x; // Ok
// @Filename: foo2.ts
export = "sausages"; // Ok
// @Filename: foo3.ts
export = class Foo3 {}; // Error, not an expression
// @Filename: foo4.ts
export = true; // Ok
// @Filename: foo5.ts
export = undefined; // Valid. undefined is an identifier in JavaScri... | {
"end_byte": 516,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignNonIdentifier.ts"
} |
TypeScript/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension8.ts_0_202 | // @moduleResolution: node16
// @module: node16
// @filename: /src/bar.cts
// Extensionless relative path dynamic import in a cjs module
import("./foo").then(x => x); // should error, ask for extension | {
"end_byte": 202,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension8.ts"
} |
TypeScript/tests/cases/conformance/externalModules/importImportOnlyModule.ts_0_308 | // @module: amd
// @Filename: foo_0.ts
export class C1 {
m1 = 42;
static s1 = true;
}
// @Filename: foo_1.ts
import c1 = require('./foo_0'); // Makes this an external module
var answer = 42; // No exports
// @Filename: foo_2.ts
import foo = require("./foo_1");
var x = foo; // Cause a runtime dependency
| {
"end_byte": 308,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/importImportOnlyModule.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportDefaultClassNameWithObject.ts_0_47 | // @target: ES5
export default class Object {}
| {
"end_byte": 47,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportDefaultClassNameWithObject.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportAssignmentTopLevelIdentifier.ts_0_176 | // @module: amd
// @Filename: foo_0.ts
module Foo {
export var answer = 42;
}
export = Foo;
// @Filename: foo_1.ts
import foo = require("./foo_0");
if(foo.answer === 42){
}
| {
"end_byte": 176,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignmentTopLevelIdentifier.ts"
} |
TypeScript/tests/cases/conformance/externalModules/verbatimModuleSyntaxDeclarationFile.ts_0_256 | // @verbatimModuleSyntax: true
// @Filename: type1.d.ts
declare namespace NS {
type A = object;
}
export = NS;
export as namespace MyTypes;
// @Filename: type2.d.ts
import type * as NS from './type1';
export = NS;
export as namespace ModuleATypes;
| {
"end_byte": 256,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/verbatimModuleSyntaxDeclarationFile.ts"
} |
TypeScript/tests/cases/conformance/externalModules/umd-augmentation-1.ts_0_791 | // @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": 791,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/umd-augmentation-1.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportAssignmentAndDeclaration.ts_0_145 | // @module: amd
// @Filename: foo_0.ts
export enum E1 {
A,B,C
}
class C1 {
}
// Invalid, as there is already an exported member.
export = C1; | {
"end_byte": 145,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignmentAndDeclaration.ts"
} |
TypeScript/tests/cases/conformance/externalModules/importNonStringLiteral.ts_0_103 | // @module: commonjs
// @Filename: vs/foo_0.ts
var x = "filename";
import foo = require(x); // invalid
| {
"end_byte": 103,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/importNonStringLiteral.ts"
} |
TypeScript/tests/cases/conformance/externalModules/topLevelAwaitErrors.8.ts_0_210 | // @target: esnext
// @module: es2022,esnext
// @filename: index.ts
// await disallowed in default import
import await from "./other";
// @filename: other.ts
declare const _await: any;
export default _await;
| {
"end_byte": 210,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwaitErrors.8.ts"
} |
TypeScript/tests/cases/conformance/externalModules/typeAndNamespaceExportMerge.ts_0_330 | // @strict
// @Filename: constants.ts
export const COFFEE = 0;
export const TEA = 1;
// @Filename: drink.ts
export type Drink = 0 | 1;
export * as Drink from "./constants";
// @Filename: index.ts
import { Drink } from "./drink";
// 'Drink' only refers to a type, but is being used as a value here
const x: Drink = D... | {
"end_byte": 330,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeAndNamespaceExportMerge.ts"
} |
TypeScript/tests/cases/conformance/externalModules/multipleExportDefault4.ts_3_79 | port default class C { }
export default {
uhoh: "another default",
}; | {
"end_byte": 79,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/multipleExportDefault4.ts"
} |
TypeScript/tests/cases/conformance/externalModules/asiPreventsParsingAsAmbientExternalModule02.ts_1_291 | var declare: number;
var module: string;
module container {
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": 291,
"start_byte": 1,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/asiPreventsParsingAsAmbientExternalModule02.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportNonInitializedVariablesSystem.ts_0_526 | //@module: system
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 filter... | {
"end_byte": 526,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportNonInitializedVariablesSystem.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportClassNameWithObjectAMD.ts_0_55 | // @target: ES5
// @module: amd
export class Object {}
| {
"end_byte": 55,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportClassNameWithObjectAMD.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportNonInitializedVariablesES6.ts_0_523 | //@target: ES6
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 filtered
... | {
"end_byte": 523,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportNonInitializedVariablesES6.ts"
} |
TypeScript/tests/cases/conformance/externalModules/importNonExternalModule.ts_0_215 | // @module: amd
// @Filename: foo_0.ts
module foo {
export var answer = 42;
}
// @Filename: foo_1.ts
import foo = require("./foo_0");
// Import should fail. foo_0 not an external module
if(foo.answer === 42){
}
| {
"end_byte": 215,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/importNonExternalModule.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportClassNameWithObjectSystem.ts_0_58 | // @target: ES5
// @module: system
export class Object {}
| {
"end_byte": 58,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportClassNameWithObjectSystem.ts"
} |
TypeScript/tests/cases/conformance/externalModules/circularReference.ts_0_543 | // @Filename: foo1.ts
import foo2 = require('./foo2');
export module M1 {
export class C1 {
m1: foo2.M1.C1;
x: number;
constructor(){
this.m1 = new foo2.M1.C1();
this.m1.y = 10; // OK
this.m1.x = 20; // Error
}
}
}
// @Filename: foo2.ts
import foo1 = require('./foo1');
export module M1 {
export cla... | {
"end_byte": 543,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/circularReference.ts"
} |
TypeScript/tests/cases/conformance/externalModules/topLevelAwaitErrors.9.ts_0_227 | // @target: esnext
// @module: es2022,esnext
// @filename: index.ts
// await disallowed in un-alised named import
import { await } from "./other";
// @filename: other.ts
declare const _await: any;
export { _await as await };
| {
"end_byte": 227,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/topLevelAwaitErrors.9.ts"
} |
TypeScript/tests/cases/conformance/externalModules/multipleExportDefault5.ts_3_62 | port default function bar() { }
export default class C {} | {
"end_byte": 62,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/multipleExportDefault5.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportAssignmentCircularModules.ts_0_348 | // @module: amd
// @Filename: foo_0.ts
import foo1 = require('./foo_1');
module Foo {
export var x = foo1.x;
}
export = Foo;
// @Filename: foo_1.ts
import foo2 = require("./foo_2");
module Foo {
export var x = foo2.x;
}
export = Foo;
// @Filename: foo_2.ts
import foo0 = require("./foo_0");
module Foo {
export var ... | {
"end_byte": 348,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportAssignmentCircularModules.ts"
} |
TypeScript/tests/cases/conformance/externalModules/exportClassNameWithObjectUMD.ts_0_55 | // @target: ES5
// @module: umd
export class Object {}
| {
"end_byte": 55,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/exportClassNameWithObjectUMD.ts"
} |
TypeScript/tests/cases/conformance/externalModules/verbatimModuleSyntaxRestrictionsCJS.ts_0_1354 | // @verbatimModuleSyntax: true
// @target: esnext
// @module: commonjs
// @moduleResolution: node
// @esModuleInterop: true
// @Filename: /decl.d.ts
declare function esmy(): void;
export default esmy;
export declare function funciton(): void;
// @Filename: /ambient.d.ts
declare module "ambient" {
const _default: ... | {
"end_byte": 1354,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/verbatimModuleSyntaxRestrictionsCJS.ts"
} |
TypeScript/tests/cases/conformance/externalModules/commonJSImportAsPrimaryExpression.ts_0_199 | // @module: commonjs
// @Filename: foo_0.ts
export class C1 {
m1 = 42;
static s1 = true;
}
// @Filename: foo_1.ts
import foo = require("./foo_0");
if(foo.C1.s1){
// Should cause runtime import
}
| {
"end_byte": 199,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/commonJSImportAsPrimaryExpression.ts"
} |
TypeScript/tests/cases/conformance/externalModules/typeOnlyMerge3.ts_0_231 | // @Filename: a.ts
function A() {}
export type { A };
// @Filename: b.ts
import { A } from "./a";
namespace A {
export const displayName = "A";
}
export { A };
// @Filename: c.ts
import { A } from "./b";
A;
A.displayName;
A();
| {
"end_byte": 231,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/typeOnlyMerge3.ts"
} |
TypeScript/tests/cases/conformance/externalModules/invalidSyntaxNamespaceImportWithSystem.ts_3_109 | @module: system
// @filename: 0.ts
export class C { }
// @filename: 1.ts
import * from Zero from "./0" | {
"end_byte": 109,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/invalidSyntaxNamespaceImportWithSystem.ts"
} |
TypeScript/tests/cases/conformance/externalModules/umd-augmentation-4.ts_0_866 | // @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": 866,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/externalModules/umd-augmentation-4.ts"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.