_id
stringlengths
21
254
text
stringlengths
1
93.7k
metadata
dict
TypeScript/tests/cases/conformance/jsdoc/jsdocAugmentsMissingType.ts_0_186
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: /a.js class A { constructor() { this.x = 0; } } /** @augments */ class B extends A { m() { this.x } }
{ "end_byte": 186, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocAugmentsMissingType.ts" }
TypeScript/tests/cases/conformance/jsdoc/exportedEnumTypeAndValue.ts_0_248
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: def.js /** @enum {number} */ const MyEnum = { a: 1, b: 2 }; export default MyEnum; // @Filename: use.js import MyEnum from "./def"; /** @type {MyEnum} */ const v = MyEnum.b;
{ "end_byte": 248, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/exportedEnumTypeAndValue.ts" }
TypeScript/tests/cases/conformance/jsdoc/checkObjectDefineProperty.ts_0_1634
// @allowJs: true // @noEmit: true // @strict: true // @checkJs: true // @filename: index.js const x = {}; Object.defineProperty(x, "name", { value: "Charles", writable: true }); Object.defineProperty(x, "middleInit", { value: "H" }); Object.defineProperty(x, "lastName", { value: "Smith", writable: false }); Object.def...
{ "end_byte": 1634, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkObjectDefineProperty.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocTemplateTag5.ts_0_1343
// @noEmit: true // @allowJs: true // @checkJs: true // @strict: true // @Filename: a.js /** * Should work for function declarations * @constructor * @template {string} K * @template V */ function Multimap() { /** @type {Object<string, V>} TODO: Remove the prototype from the fresh object */ this._map = {}...
{ "end_byte": 1343, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTemplateTag5.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocOuterTypeParameters3.ts_0_194
// @checkjs: true // @filename: jsdocOuterTypeParameters3.js /** @template {T} */ class Baz { m() { class Bar { static bar() { this.prototype.foo(); } } } }
{ "end_byte": 194, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocOuterTypeParameters3.ts" }
TypeScript/tests/cases/conformance/jsdoc/callbackTagNestedParameter.ts_0_449
// @emitDeclarationOnly: true // @declaration: true // @allowJs: true // @checkJs: true // @Filename: cb_nested.js /** * @callback WorksWithPeopleCallback * @param {Object} person * @param {string} person.name * @param {number} [person.age] * @returns {void} */ /** * For each person, calls your callback. * @pa...
{ "end_byte": 449, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/callbackTagNestedParameter.ts" }
TypeScript/tests/cases/conformance/jsdoc/callOfPropertylessConstructorFunction.ts_0_185
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: callOfPropertylessConstructorFunction.js /** * @constructor */ function Dependency(j) { return j } Dependency({})
{ "end_byte": 185, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/callOfPropertylessConstructorFunction.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocTypeTagRequiredParameters.ts_0_329
// @allowJs: true // @checkJs: true // @noEmit: true // @strict: true // @noImplicitAny: true // @Filename: a.js /** @type {function(string): void} */ const f = (value) => { }; /** @type {(s: string) => void} */ function g(s) { } /** @type {{(s: string): void}} */ function h(s) { } f() // should error g() // should e...
{ "end_byte": 329, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTypeTagRequiredParameters.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocVariadicType.ts_0_204
// @allowJS: true // @checkJs: true // @noEmit: true // @filename: a.js /** * @type {function(boolean, string, ...*):void} */ const foo = function (a, b, ...r) { }; // @filename: b.ts foo(false, '');
{ "end_byte": 204, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocVariadicType.ts" }
TypeScript/tests/cases/conformance/jsdoc/checkJsdocTypeTag2.ts_3_501
@allowJS: true // @suppressOutputPathCheck: true // @filename: 0.js // @ts-check /** @type {String} */ var S = true; /** @type {number} */ var n = "hello"; /** @type {function (number)} */ const x1 = (a) => a + 1; x1("string"); /** @type {function (number): number} */ const x2 = (a) => a + 1; /** @type {string} *...
{ "end_byte": 501, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocTypeTag2.ts" }
TypeScript/tests/cases/conformance/jsdoc/callbackCrossModule.ts_0_444
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: mod1.js /** @callback Con - some kind of continuation * @param {object | undefined} error * @return {any} I don't even know what this should return */ module.exports = C function C() { this.p = 1 } // @Filename: use.js /** @param {import('./mod1...
{ "end_byte": 444, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/callbackCrossModule.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocParseErrorsInTypescript.ts_0_84
// parse error (blocks grammar errors from checker) function parse1(n: number=) { }
{ "end_byte": 84, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocParseErrorsInTypescript.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocTypeTag.ts_0_1243
// @allowJS: true // @suppressOutputPathCheck: true // @strictNullChecks: true // @filename: a.js /** @type {String} */ var S; /** @type {string} */ var s; /** @type {Number} */ var N; /** @type {number} */ var n; /** @type {Boolean} */ var B; /** @type {boolean} */ var b; /** @type {Void} */ var V; /** @type {...
{ "end_byte": 1243, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTypeTag.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocVariableDeclarationWithTypeAnnotation.ts_0_198
// @allowJs: true // @checkJs: true // @target: esnext // @noImplicitAny: true // @outDir: out // @Filename: foo.js /** @type {boolean} */ var /** @type {string} */ x, /** @type {number} */ y;
{ "end_byte": 198, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocVariableDeclarationWithTypeAnnotation.ts" }
TypeScript/tests/cases/conformance/jsdoc/seeTag3.ts_0_157
// @outdir: out/ // @checkJs: true // @filename: seeTag3.js /** @see [The typescript web site](https://typescriptlang.org) */ function theWholeThing() { }
{ "end_byte": 157, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/seeTag3.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocPrivateName1.ts_0_241
// @allowJs: true // @checkJs: true // @noEmit: true // @lib: dom,esnext // @Filename: jsdocPrivateName1.js // @target: es2015 class A { /** @type {boolean} some number value */ #foo = 3 // Error because not assignable to boolean }
{ "end_byte": 241, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocPrivateName1.ts" }
TypeScript/tests/cases/conformance/jsdoc/typeTagWithGenericSignature.ts_0_208
// @checkJs: true // @allowJs: true // @noEmit: true // @strict: true // @Filename: bug25618.js /** @type {<T>(param?: T) => T | undefined} */ function typed(param) { return param; } var n = typed(1);
{ "end_byte": 208, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typeTagWithGenericSignature.ts" }
TypeScript/tests/cases/conformance/jsdoc/importTag8.ts_0_291
// @checkJs: true // @allowJs: true // @noEmit: true // @filename: /types.ts export interface A { a: number; } export interface B { a: number; } // @filename: /foo.js /** * @import * { A, B } * from "./types" */ /** * @param { A } a * @param { B } b */ function f(a, b) {}
{ "end_byte": 291, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag8.ts" }
TypeScript/tests/cases/conformance/jsdoc/callbackTag3.ts_0_197
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: cb.js /** @callback Miracle * @returns {string} What were you expecting */ /** @type {Miracle} smallId */ var sid = () => "!";
{ "end_byte": 197, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/callbackTag3.ts" }
TypeScript/tests/cases/conformance/jsdoc/checkJsdocTypeTag3.ts_0_113
// @Filename:test.js // @checkJs: true // @allowJs: true // @noEmit: true /** @type {Array<?number>} */ var nns;
{ "end_byte": 113, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocTypeTag3.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocTypeTagParameterType.ts_0_287
// @allowJs: true // @checkJs: true // @noEmit: true // @strict: true // @noImplicitAny: true // @Filename: a.js /** @type {function(string): void} */ const f = (value) => { value = 1 // should error }; /** @type {(s: string) => void} */ function g(s) { s = 1 // Should error }
{ "end_byte": 287, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTypeTagParameterType.ts" }
TypeScript/tests/cases/conformance/jsdoc/overloadTag1.ts_0_978
// @checkJs: true // @allowJs: true // @outdir: foo // @declaration: true // @filename: overloadTag1.js /** * @overload * @param {number} a * @param {number} b * @returns {number} * * @overload * @param {string} a * @param {boolean} b * @returns {string} * * @param {string | number} a * @param {string | n...
{ "end_byte": 978, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/overloadTag1.ts" }
TypeScript/tests/cases/conformance/jsdoc/checkJsdocReturnTag2.ts_0_294
// @allowJs: true // @outFile: dummy.js // @filename: returns.js // @ts-check /** * @returns {string} This comment is not currently exposed */ function f() { return 5; } /** * @returns {string | number} This comment is not currently exposed */ function f1() { return 5 || true; }
{ "end_byte": 294, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocReturnTag2.ts" }
TypeScript/tests/cases/conformance/jsdoc/enumTagCircularReference.ts_0_117
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: bug27142.js /** @enum {E} */ const E = { x: 0 };
{ "end_byte": 117, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/enumTagCircularReference.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocPrototypePropertyAccessWithType.ts_0_156
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: /a.js function C() { this.x = false; }; /** @type {number} */ C.prototype.x; new C().x;
{ "end_byte": 156, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocPrototypePropertyAccessWithType.ts" }
TypeScript/tests/cases/conformance/jsdoc/noAssertForUnparseableTypedefs.ts_0_144
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: bug26693.js /** @typedef {module:locale} hi */ import { nope } from 'nope';
{ "end_byte": 144, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/noAssertForUnparseableTypedefs.ts" }
TypeScript/tests/cases/conformance/jsdoc/seeTag2.ts_0_282
// @declaration: true /** @see {} empty*/ const a = "" /** @see {aaaaaa} unknown name*/ const b = "" /** @see {?????} invalid */ const c = "" /** @see c without brace */ const d = "" /** @see ?????? wowwwwww*/ const e = "" /** @see {}*/ const f = "" /** @see */ const g = ""
{ "end_byte": 282, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/seeTag2.ts" }
TypeScript/tests/cases/conformance/jsdoc/importTag9.ts_0_305
// @checkJs: true // @allowJs: true // @noEmit: true // @filename: /types.ts export interface A { a: number; } export interface B { a: number; } // @filename: /foo.js /** * @import * * as types * from "./types" */ /** * @param { types.A } a * @param { types.B } b */ function f(a, b) {}
{ "end_byte": 305, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag9.ts" }
TypeScript/tests/cases/conformance/jsdoc/callbackTag2.ts_0_806
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: cb.js /** @template T * @callback Id * @param {T} t * @returns {T} Maybe just return 120 and cast it? */ var x = 1 /** @type {Id<string>} I actually wanted to write `const "120"` */ var one_twenty = s => "120"; /** @template S * @callback Shared...
{ "end_byte": 806, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/callbackTag2.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocThisType.ts_0_760
// @allowJs: true // @checkJs: true // @noEmit: true // @filename: /types.d.ts export interface Foo { foo: () => void; } export type M = (this: Foo) => void; // @filename: /a.js /** @type {import('./types').M} */ export const f1 = function() { this.test(); } /** @type {import('./types').M} */ export functio...
{ "end_byte": 760, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocThisType.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocParamTag2.ts_0_1761
// @allowJS: true // @checkJS: true // @noEmit: true // @Filename: 0.js // Object literal syntax /** * @param {{a: string, b: string}} obj * @param {string} x */ function good1({a, b}, x) {} /** * @param {{a: string, b: string}} obj * @param {{c: number, d: number}} OBJECTION */ function good2({a, b}, {c, d}) {}...
{ "end_byte": 1761, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocParamTag2.ts" }
TypeScript/tests/cases/conformance/jsdoc/checkJsdocTypeTag7.ts_0_264
// @checkJs: true // @allowJs: true // @noEmit: true // @Filename: test.js /** * @typedef {(a: string, b: number) => void} Foo */ class C { /** @type {Foo} */ foo(a, b) {} /** @type {(optional?) => void} */ methodWithOptionalParameters() {} }
{ "end_byte": 264, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocTypeTag7.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocImplements_properties.ts_0_315
// @allowJs: true // @checkJs: true // @declaration: true // @emitDeclarationOnly: true // @outDir: ./out // @Filename: /a.js class A { constructor() { this.x = 0; } } /** @implements A*/ class B {} /** @implements A*/ class B2 { x = 10 } /** @implements {A}*/ class B3 { constructor() { this.x = 10 } }
{ "end_byte": 315, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocImplements_properties.ts" }
TypeScript/tests/cases/conformance/jsdoc/tsNoCheckForTypescriptComments2.ts_0_380
// @declaration: true // @filename: file.ts // @ts-nocheck: additional comments export const a = 1 + {}; // This is an error, ofc, `Operator '+' cannot be applied to types '1' and '{}'`, which will be suppressed by the `nocheck` comment export interface Aleph { q: number; } export class Bet implements Aleph { ...
{ "end_byte": 380, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/tsNoCheckForTypescriptComments2.ts" }
TypeScript/tests/cases/conformance/jsdoc/checkExportsObjectAssignProperty.ts_0_2003
// @allowJs: true // @noEmit: true // @strict: true // @checkJs: true // @filename: mod1.js Object.defineProperty(exports, "thing", { value: 42, writable: true }); Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }); Object.defineProperty(exports, "rwAccessors", { get() { return 98122 },...
{ "end_byte": 2003, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkExportsObjectAssignProperty.ts" }
TypeScript/tests/cases/conformance/jsdoc/typeTagCircularReferenceOnConstructorFunction.ts_0_153
// @allowJs: true // @noEmit: true // @checkJs: true // @Filename: bug27346.js /** * @type {MyClass} */ function MyClass() { } MyClass.prototype = {};
{ "end_byte": 153, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typeTagCircularReferenceOnConstructorFunction.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocParamTagTypeLiteral.ts_0_1918
// @allowJS: true // @checkJs: true // @noEmit: true // @strict: true // @suppressOutputPathCheck: true // @Filename: 0.js /** * @param {Object} notSpecial * @param {string} unrelated - not actually related because it's not notSpecial.unrelated */ function normal(notSpecial) { notSpecial; // should just be 'Obj...
{ "end_byte": 1918, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocParamTagTypeLiteral.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocTemplateTag4.ts_0_1266
// @noEmit: true // @allowJs: true // @checkJs: true // @strict: true // @Filename: a.js /** * Should work for function declarations * @constructor * @template {string} K * @template V */ function Multimap() { /** @type {Object<string, V>} TODO: Remove the prototype from the fresh object */ this._map = {}...
{ "end_byte": 1266, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTemplateTag4.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocTypeReferenceUseBeforeDef.ts_0_130
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: bug25097.js /** @type {C | null} */ const c = null class C { }
{ "end_byte": 130, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTypeReferenceUseBeforeDef.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocOuterTypeParameters2.ts_0_257
// @checkjs: true // @filename: jsdocOuterTypeParameters1.js /** @return {T} */ const dedupingMixin = function(mixin) {}; /** @template T */ const PropertyAccessors = dedupingMixin(() => { class Bar { static bar() { this.prototype.foo(); } } });
{ "end_byte": 257, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocOuterTypeParameters2.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocTemplateClass.ts_0_508
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: templateTagOnClasses.js /** * @template T * @typedef {(t: T) => T} Id */ /** @template T */ class Foo { /** @typedef {(t: T) => T} Id2 */ /** @param {T} x */ constructor (x) { this.a = x } /** * * @param {T} x ...
{ "end_byte": 508, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTemplateClass.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocParseMatchingBackticks.ts_0_597
// @noEmit: true // @allowJs: true // @checkJs: true // @strict: true // @Filename: jsdocParseMatchingBackticks.js /** * `@param` initial at-param is OK in title comment * @param {string} x hi there `@param` * @param {string} y hi there `@ * param * this is the margin * so we'l...
{ "end_byte": 597, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocParseMatchingBackticks.ts" }
TypeScript/tests/cases/conformance/jsdoc/enumTagOnExports2.ts_0_131
// @filename: enumTagOnExports.js // @allowjs: true // @checkjs: true // @noemit: true /** @enum {string} */ module.exports = {};
{ "end_byte": 131, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/enumTagOnExports2.ts" }
TypeScript/tests/cases/conformance/jsdoc/jsdocImportTypeReferenceToStringLiteral.ts_0_158
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: b.js export const FOO = "foo"; // @Filename: a.js /** @type {import('./b').FOO} */ let x;
{ "end_byte": 158, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocImportTypeReferenceToStringLiteral.ts" }
TypeScript/tests/cases/conformance/jsdoc/callbackTagVariadicType.ts_0_239
// @declaration: true // @outDir: bin/ // @checkJs: true // @Filename: callbackTagVariadicType.js /** * @callback Foo * @param {...string} args * @returns {number} */ /** @type {Foo} */ export const x = () => 1 var res = x('a', 'b')
{ "end_byte": 239, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/callbackTagVariadicType.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassStatic.ts_0_459
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js class Handler { static get OPTIONS() { return 1; } process() { } } Handler.statische = function() { } const Strings = { a: "A", b: "B" } module.exports = Handler; module.exports.Strings = ...
{ "end_byte": 459, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassStatic.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportSubAssignments.ts_0_225
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: cls.js const Strings = { a: "A", b: "B" }; class Foo {} module.exports = Foo; module.exports.Strings = Strings;
{ "end_byte": 225, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportSubAssignments.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassMethod.ts_0_1138
// @allowJs: true // @checkJs: true // @target: esnext // @noImplicitAny: true // @declaration: true // @outDir: out // @Filename: jsDeclarationsClassMethod.js function C1() { /** * A comment prop * @param {number} x * @param {number} y * @returns {number} */ this.prop = function (x, y...
{ "end_byte": 1138, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassMethod.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassStaticMethodAugmentation.ts_0_186
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js export class Clazz { static method() { } } Clazz.method.prop = 5;
{ "end_byte": 186, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassStaticMethodAugmentation.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsPrivateFields01.ts_0_446
// @target: esnext // @allowJS: true // @declaration: true // @emitDeclarationOnly: true // @filename: file.js export class C { #hello = "hello"; #world = 100; #calcHello() { return this.#hello; } get #screamingHello() { return this.#hello.toUpperCase(); } /** @param value...
{ "end_byte": 446, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsPrivateFields01.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedClassInstance2.ts_0_196
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js class Foo { static stat = 10; member = 10; } module.exports = new Foo();
{ "end_byte": 196, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedClassInstance2.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeReferences4.ts_0_578
// @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" /> export const Something = 2; /...
{ "end_byte": 578, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeReferences4.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionKeywordPropExhaustive.ts_0_1361
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js function foo() {} // properties foo.x = 1; foo.y = 1; // keywords foo.break = 1; foo.case = 1; foo.catch = 1; foo.class = 1; foo.const = 1; foo.continue = 1; foo.debugger = 1; foo.default = 1; foo.delete...
{ "end_byte": 1361, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionKeywordPropExhaustive.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsParameterTagReusesInputNodeInEmit2.ts_0_495
// @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 {typeof import('./base...
{ "end_byte": 495, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsParameterTagReusesInputNodeInEmit2.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsThisTypes.ts_0_307
// @allowJs: true // @checkJs: true // @outDir: /out // @lib: es6 // @declaration: true // @filename: index.js export class A { /** @returns {this} */ method() { return this; } } export default class Base extends A { // This method is required to reproduce #35932 verify() { } }
{ "end_byte": 307, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsThisTypes.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassLeadingOptional.ts_0_178
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: bar.js export class Z { f(x = 1, y) { return [x, y]; } }
{ "end_byte": 178, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassLeadingOptional.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypedefPropertyAndExportAssignment.ts_0_1179
// @allowJs: true // @checkJs: true // @outDir: ./out // @lib: es6 // @declaration: true // @filename: module.js /** @typedef {'parseHTML'|'styleLayout'} TaskGroupIds */ /** * @typedef TaskGroup * @property {TaskGroupIds} id * @property {string} label * @property {string[]} traceEventNames */ /** * @type {{[P ...
{ "end_byte": 1179, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypedefPropertyAndExportAssignment.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.ts_0_351
// @allowJs: true // @checkJs: true // @outDir: /out // @lib: es6 // @declaration: true // @filename: index.js export class Super { /** * @param {string} firstArg * @param {string} secondArg */ constructor(firstArg, secondArg) { } } export class Sub extends Super { constructor() { su...
{ "end_byte": 351, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionClassesCjsExportAssignment.ts_0_1265
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: timer.js /** * @param {number} timeout */ function Timer(timeout) { this.timeout = timeout; } module.exports = Timer; // @filename: hook.js /** * @typedef {(arg: import("./context")) => void} HookHandler */...
{ "end_byte": 1265, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionClassesCjsExportAssignment.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClasses.ts_0_2824
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js export class A {} export class B { static cat = "cat"; } export class C { static Cls = class {} } export class D { /** * @param {number} a * @param {number} b */ construct...
{ "end_byte": 2824, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClasses.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsEnums.ts_0_862
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js // Pretty much all of this should be an error, (since enums are forbidden in js), // but we should be able to synthesize declarations from the symbols regardless export enum A {} export enum B { Mem...
{ "end_byte": 862, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsEnums.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsOptionalTypeLiteralProps2.ts_0_355
// @allowJs: true // @checkJs: true // @strict: 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 }) { ...
{ "end_byte": 355, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsOptionalTypeLiteralProps2.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsMissingTypeParameters.ts_0_419
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: file.js /** * @param {Array=} y desc */ function x(y) { } // @ts-ignore /** @param {function (Array)} func Invoked */ function y(func) { return; } /** * @return {(Array.<> | null)} list of devices */ funct...
{ "end_byte": 419, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsMissingTypeParameters.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsReexportAliases.ts_0_274
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: cls.js export default class Foo {} // @filename: usage.js import {default as Fooa} from "./cls"; export const x = new Fooa(); export {default as Foob} from "./cls";
{ "end_byte": 274, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsReexportAliases.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypedefDescriptionsPreserved.ts_0_461
// @allowJs: true // @checkJs: true // @outDir: ./out // @declaration: true // @filename: index.js /** * Options for Foo <------------ * @typedef {Object} FooOptions * @property {boolean} bar - Marvin K Mooney * @property {string} baz - Sylvester McMonkey McBean */ /** * Multiline * Options * for Foo <-------...
{ "end_byte": 461, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypedefDescriptionsPreserved.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsReusesExistingTypeAnnotations.ts_0_1727
// @allowJs: true // @checkJs: true // @target: esnext // @strict: true // @declaration: true // @filename: index.js // @outDir: /out class С1 { /** @type {string=} */ p1 = undefined; /** @type {string | undefined} */ p2 = undefined; /** @type {?string} */ p3 = null; /** @type {string | ...
{ "end_byte": 1727, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsReusesExistingTypeAnnotations.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionLikeClasses.ts_0_472
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js /** * @param {number} x * @param {number} y */ export function Point(x, y) { if (!(this instanceof Point)) { return new Point(x, y); } this.x = x; this.y = y; } // @filename: ...
{ "end_byte": 472, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionLikeClasses.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsMultipleExportFromMerge.ts_0_495
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: items.js export const a = 1; export const b = 2; export const c = 3; // @filename: justone.js export { a, b, c } from "./items"; // @filename: two.js export { a } from "./items"; export { b, c } from "./items"; ...
{ "end_byte": 495, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsMultipleExportFromMerge.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedClassInstance3.ts_0_229
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js class Foo { static stat = 10; member = 10; } module.exports = new Foo(); module.exports.additional = 20;
{ "end_byte": 229, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedClassInstance3.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignmentExpressionPlusSecondary.ts_0_285
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js const Strings = { a: "A", b: "B" }; module.exports = { thing: "ok", also: "ok", desc: { item: "ok" } }; module.exports.Strings = Strings;
{ "end_byte": 285, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignmentExpressionPlusSecondary.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsComputedNames.ts_0_620
// @allowJs: true // @checkJs: true // @target: es5 // @lib: es6 // @outDir: ./out // @declaration: true // @filename: index.js const TopLevelSym = Symbol(); const InnerSym = Symbol(); module.exports = { [TopLevelSym](x = 12) { return x; }, items: { [InnerSym]: (arg = {x: 12}) => arg.x }...
{ "end_byte": 620, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsComputedNames.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsNestedParams.ts_0_1097
// @allowJs: true // @checkJs: true // @target: es6 // @outDir: ./out // @declaration: true // @filename: file.js class X { /** * Cancels the request, sending a cancellation to the other party * @param {Object} error __auto_generated__ * @param {string?} error.reason the error reason to send the c...
{ "end_byte": 1097, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsNestedParams.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionJSDoc.ts_0_647
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js /** * Foos a bar together using an `a` and a `b` * @param {number} a * @param {string} b */ export function foo(a, b) {} /** * Legacy - DO NOT USE */ export class Aleph { /** * Impossible ...
{ "end_byte": 647, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionJSDoc.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportFormsErr.ts_0_539
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: cls.js export class Foo {} // @filename: bar.js import ns = require("./cls"); export = ns; // TS Only // @filename: bin.js import * as ns from "./cls"; module.exports = ns; // We refuse to bind cjs module exports...
{ "end_byte": 539, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportFormsErr.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportedClassAliases.ts_0_392
// @allowJs: true // @checkJs: true // @outDir: ./out // @declaration: true // @filename: utils/errors.js class FancyError extends Error { constructor(status) { super(`error with status ${status}`); } } module.exports = { FancyError }; // @filename: utils/index.js // issue arises here on compilati...
{ "end_byte": 392, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportedClassAliases.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsMissingGenerics.ts_0_205
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: file.js /** * @param {Array} x */ function x(x) {} /** * @param {Promise} x */ function y(x) {}
{ "end_byte": 205, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsMissingGenerics.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsImportAliasExposedWithinNamespaceCjs.ts_0_1098
// @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": 1098, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsImportAliasExposedWithinNamespaceCjs.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsDefault.ts_0_791
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index1.js export default 12; // @filename: index2.js export default function foo() { return foo; } export const x = foo; export { foo as bar }; // @filename: index3.js export default class Foo { a = /** @...
{ "end_byte": 791, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsDefault.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypedefFunction.ts_0_388
// @allowJs: true // @checkJs: true // @target: esnext // @outDir: ./out // @declaration: true // @filename: foo.js /** * @typedef {{ * [id: string]: [Function, Function]; * }} ResolveRejectMap */ let id = 0 /** * @param {ResolveRejectMap} handlers * @returns {Promise<any>} */ const send = handlers => new Pr...
{ "end_byte": 388, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypedefFunction.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsJSDocRedirectedLookups.ts_0_1222
// @allowJs: true // @checkJs: true // @target: es6 // @outDir: ./out // @declaration: true // @strict: true // @noImplicitAny: false // @filename: index.js // these are recognized as TS concepts by the checker /** @type {String} */const a = ""; /** @type {Number} */const b = 0; /** @type {Boolean} */const c = true; /...
{ "end_byte": 1222, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsJSDocRedirectedLookups.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportDoubleAssignmentInClosure.ts_0_374
// @allowJs: true // @checkJs: true // @outDir: ./out // @declaration: true // @filename: index.js // @ts-nocheck function foo() { module.exports = exports = function (o) { return (o == null) ? create(base) : defineProperties(Object(o), descriptors); }; const m = function () { // I have no i...
{ "end_byte": 374, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportDoubleAssignmentInClosure.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsReexportedCjsAlias.ts_0_410
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: lib.js /** * @param {string} a */ function bar(a) { return a + a; } class SomeClass { a() { return 1; } } module.exports = { bar, SomeClass } // @filename: main.js const { SomeClass,...
{ "end_byte": 410, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsReexportedCjsAlias.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportDefinePropertyEmit.ts_0_1646
// @allowJs: true // @checkJs: true // @outDir: ./out // @declaration: true // @filename: index.js Object.defineProperty(module.exports, "a", { value: function a() {} }); Object.defineProperty(module.exports, "b", { value: function b() {} }); Object.defineProperty(module.exports.b, "cat", { value: "cat" }); /** * @p...
{ "end_byte": 1646, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportDefinePropertyEmit.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassLikeHeuristic.ts_0_205
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js // https://github.com/microsoft/TypeScript/issues/35801 let A; A = {}; A.prototype.b = {};
{ "end_byte": 205, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassLikeHeuristic.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsReexportAliasesEsModuleInterop.ts_0_307
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @esModuleInterop: true // @filename: cls.js class Foo {} module.exports = Foo; // @filename: usage.js import {default as Fooa} from "./cls"; export const x = new Fooa(); export {default as Foob} from "./cls";
{ "end_byte": 307, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsReexportAliasesEsModuleInterop.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedClassExpression.ts_0_240
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js module.exports = class Thing { /** * @param {number} p */ constructor(p) { this.t = 12 + p; } }
{ "end_byte": 240, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedClassExpression.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsInterfaces.ts_0_2096
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js // Pretty much all of this should be an error, (since interfaces are forbidden in js), // but we should be able to synthesize declarations from the symbols regardless export interface A {} export interf...
{ "end_byte": 2096, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsInterfaces.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsDefaultsErr.ts_0_634
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index1.js // merge type alias and alias (should error, see #32367) class Cls { x = 12; static y = "ok" } export default Cls; /** * @typedef {string | number} default */ // @filename: index2.js // merge t...
{ "end_byte": 634, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsDefaultsErr.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionKeywordProp.ts_0_264
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js function foo() {} foo.null = true; function bar() {} bar.async = true; bar.normal = false; function baz() {} baz.class = true; baz.normal = false;
{ "end_byte": 264, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsFunctionKeywordProp.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypedefAndLatebound.ts_0_542
// @lib: es2017 // @allowJs: true // @checkJs: true // @noEmit: true // from #53967, based on webpack/webpack#16957 // @filename: index.js const LazySet = require("./LazySet"); /** @type {LazySet} */ const stringSet = undefined; stringSet.addAll(stringSet); // @filename: LazySet.js // Comment out this JSDoc, and no...
{ "end_byte": 542, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypedefAndLatebound.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassExtendsVisibility.ts_0_323
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: bar.js class Bar {} module.exports = Bar; // @filename: cls.js const Bar = require("./bar"); const Strings = { a: "A", b: "B" }; class Foo extends Bar {} module.exports = Foo; module.exports.Strings = Strin...
{ "end_byte": 323, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsClassExtendsVisibility.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsModuleReferenceHasEmit.ts_0_235
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js /** * @module A */ class A {} /** * Target element * @type {module:A} */ export let el = null; export default A;
{ "end_byte": 235, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsModuleReferenceHasEmit.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsPackageJson.ts_0_807
// @allowJs: true // @checkJs: true // @target: es5 // @resolveJsonModule: true // @outDir: ./out // @declaration: true // @filename: index.js const j = require("./package.json"); module.exports = j; // @filename: package.json { "name": "pkg", "version": "0.1.0", "description": "A package", "main": "./d...
{ "end_byte": 807, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsPackageJson.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsCommonjsRelativePath.ts_0_277
// @checkJs: true // @declaration: true // @emitDeclarationOnly: true // @module: commonjs // @Filename: thing.js 'use strict'; class Thing {} module.exports = { Thing } // @Filename: reexport.js 'use strict'; const Thing = require('./thing').Thing module.exports = { Thing }
{ "end_byte": 277, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsCommonjsRelativePath.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsGetterSetter.ts_0_1894
// @allowJs: true // @checkJs: true // @outDir: ./out // @target: es6 // @declaration: true // @filename: index.js export class A { get x() { return 12; } } export class B { /** * @param {number} _arg */ set x(_arg) { } } export class C { get x() { return 12; } ...
{ "end_byte": 1894, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsGetterSetter.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsImportNamespacedType.ts_0_271
// @declaration: true // @emitDeclarationOnly: true // @checkJs: true // @filename: file.js import { dummy } from './mod1' /** @type {import('./mod1').Dotted.Name} - should work */ var dot2 // @filename: mod1.js /** @typedef {number} Dotted.Name */ export var dummy = 1
{ "end_byte": 271, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsImportNamespacedType.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeReassignmentFromDeclaration2.ts_0_293
// @allowJs: true // @checkJs: true // @outDir: ./out // @lib: es6 // @declaration: true // @filename: some-mod.d.ts interface Item { x: string; } declare function getItems(): Item[]; export = getItems; // @filename: index.js const items = require("./some-mod")(); module.exports = items;
{ "end_byte": 293, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeReassignmentFromDeclaration2.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsCrossfileMerge.ts_0_303
// @allowJs: true // @checkJs: true // @target: es5 // @lib: es6 // @outDir: ./out // @declaration: true // @filename: index.js const m = require("./exporter"); module.exports = m.default; module.exports.memberName = "thing"; // @filename: exporter.js function validate() {} export default validate;
{ "end_byte": 303, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsCrossfileMerge.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportSpecifierNonlocal.ts_0_245
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js export class Thing {} export class OtherThing {} // @filename: index.js export { Thing, OtherThing as default } from "./source";
{ "end_byte": 245, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportSpecifierNonlocal.ts" }
TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedConstructorFunctionWithSub.ts_0_363
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: jsDeclarationsExportAssignedConstructorFunctionWithSub.js /** * @param {number} p */ module.exports = function (p) { this.t = 12 + p; } module.exports.Sub = function() { this.instance = new module.exports...
{ "end_byte": 363, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/declarations/jsDeclarationsExportAssignedConstructorFunctionWithSub.ts" }