swc/crates/swc_ecma_parser/tests/tsc/jsDeclarationsFunctions.ts

63 lines
904 B
TypeScript
Raw Normal View History

// @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 {*} */(null); }
/**
* @template T,U
* @param {T} a
* @param {U} b
* @return {T & U}
*/
export function e(a, b) { return /** @type {*} */(null); }
/**
* @template T
* @param {T} a
*/
export function f(a) {
return a;
}
f.self = f;
/**
* @param {{x: string}} a
* @param {{y: typeof b}} b
*/
function g(a, b) {
return a.x && b.y();
}
export { g };
/**
* @param {{x: string}} a
* @param {{y: typeof b}} b
*/
function hh(a, b) {
return a.x && b.y();
}
export { hh as h };
export function i() {}
export { i as ii };
export { j as jj };
export function j() {}