|
| 1 | +=== tests/cases/conformance/jsdoc/declarations/index.js === |
| 2 | +// these are recognized as TS concepts by the checker |
| 3 | +/** @type {String} */const a = ""; |
| 4 | +>a : Symbol(a, Decl(index.js, 1, 26)) |
| 5 | + |
| 6 | +/** @type {Number} */const b = 0; |
| 7 | +>b : Symbol(b, Decl(index.js, 2, 26)) |
| 8 | + |
| 9 | +/** @type {Boolean} */const c = true; |
| 10 | +>c : Symbol(c, Decl(index.js, 3, 27)) |
| 11 | + |
| 12 | +/** @type {Void} */const d = undefined; |
| 13 | +>d : Symbol(d, Decl(index.js, 4, 24)) |
| 14 | +>undefined : Symbol(undefined) |
| 15 | + |
| 16 | +/** @type {Undefined} */const e = undefined; |
| 17 | +>e : Symbol(e, Decl(index.js, 5, 29)) |
| 18 | +>undefined : Symbol(undefined) |
| 19 | + |
| 20 | +/** @type {Null} */const f = null; |
| 21 | +>f : Symbol(f, Decl(index.js, 6, 24)) |
| 22 | + |
| 23 | +/** @type {Function} */const g = () => void 0; |
| 24 | +>g : Symbol(g, Decl(index.js, 8, 28)) |
| 25 | + |
| 26 | +/** @type {function} */const h = () => void 0; |
| 27 | +>h : Symbol(h, Decl(index.js, 9, 28)) |
| 28 | + |
| 29 | +/** @type {array} */const i = []; |
| 30 | +>i : Symbol(i, Decl(index.js, 10, 25)) |
| 31 | + |
| 32 | +/** @type {promise} */const j = Promise.resolve(0); |
| 33 | +>j : Symbol(j, Decl(index.js, 11, 27)) |
| 34 | +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) |
| 35 | +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) |
| 36 | +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) |
| 37 | + |
| 38 | +/** @type {Object<string, string>} */const k = {x: "x"}; |
| 39 | +>k : Symbol(k, Decl(index.js, 12, 42)) |
| 40 | +>x : Symbol(x, Decl(index.js, 12, 48)) |
| 41 | + |
| 42 | + |
| 43 | +// these are not recognized as anything and should just be lookup failures |
| 44 | +// ignore the errors to try to ensure they're emitted as `any` in declaration emit |
| 45 | +// @ts-ignore |
| 46 | +/** @type {class} */const l = true; |
| 47 | +>l : Symbol(l, Decl(index.js, 18, 25)) |
| 48 | + |
| 49 | +// @ts-ignore |
| 50 | +/** @type {bool} */const m = true; |
| 51 | +>m : Symbol(m, Decl(index.js, 20, 24)) |
| 52 | + |
| 53 | +// @ts-ignore |
| 54 | +/** @type {int} */const n = true; |
| 55 | +>n : Symbol(n, Decl(index.js, 22, 23)) |
| 56 | + |
| 57 | +// @ts-ignore |
| 58 | +/** @type {float} */const o = true; |
| 59 | +>o : Symbol(o, Decl(index.js, 24, 25)) |
| 60 | + |
| 61 | +// @ts-ignore |
| 62 | +/** @type {integer} */const p = true; |
| 63 | +>p : Symbol(p, Decl(index.js, 26, 27)) |
| 64 | + |
| 65 | +// or, in the case of `event` likely erroneously refers to the type of the global Event object |
| 66 | +/** @type {event} */const q = undefined; |
| 67 | +>q : Symbol(q, Decl(index.js, 29, 25)) |
| 68 | +>undefined : Symbol(undefined) |
| 69 | + |
0 commit comments