TypeScript/tests/baselines/reference/callbackTag2.types
Andy 13bc46d970
getTokenAtPosition: default includeJsDocComment to true (#25015)
* getTokenAtPosition: default includeJsDocComment to true

* Update API (#24966)

* Flip meaning of parameter

* Update API (#24966)

* Remove all `ignoreJsDocComment` uses (fixes #25162)
2018-06-26 16:20:44 -07:00

61 lines
1.4 KiB
Plaintext

=== tests/cases/conformance/jsdoc/cb.js ===
/** @template T
* @callback Id
* @param {T} t
* @returns {T} Maybe just return 120 and cast it?
*/
var x = 1
>x : number
>1 : 1
/** @type {Id<string>} I actually wanted to write `const "120"` */
var one_twenty = s => "120";
>one_twenty : Id<string>
>s => "120" : (s: string) => string
>s : string
>"120" : "120"
/** @template S
* @callback SharedId
* @param {S} ego
* @return {S}
*/
class SharedClass {
>SharedClass : SharedClass
constructor() {
/** @type {SharedId<S>} */
this.id;
>this.id : SharedId<any>
>this : this
>id : SharedId<any>
}
}
/** @type {SharedId<number>} */
var outside = n => n + 1;
>outside : SharedId<number>
>n => n + 1 : (n: number) => number
>n : number
>n + 1 : number
>n : number
>1 : 1
/** @type {Final<{ fantasy }, { heroes }>} */
var noreturn = (barts, tidus, noctis) => "cecil"
>noreturn : Final<{ fantasy: any; }, { heroes: any; }>
>(barts, tidus, noctis) => "cecil" : (barts: { fantasy: any; }, tidus: { heroes: any; }, noctis: { heroes: any; } & { fantasy: any; }) => "cecil"
>barts : { fantasy: any; }
>tidus : { heroes: any; }
>noctis : { heroes: any; } & { fantasy: any; }
>"cecil" : "cecil"
/**
* @template V,X
* @callback Final
* @param {V} barts - "Barts"
* @param {X} tidus - Titus
* @param {X & V} noctis - "Prince Noctis Lucius Caelum"
* @return {"cecil" | "zidane"}
*/