mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
654d05ca29
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jakebailey <[email protected]>
125 lines
2.0 KiB
TypeScript
125 lines
2.0 KiB
TypeScript
//// [tests/cases/compiler/declarationEmitRetainsJsdocyComments.ts] ////
|
|
|
|
//// [declarationEmitRetainsJsdocyComments.ts]
|
|
/**
|
|
* comment1
|
|
* @param p
|
|
*/
|
|
export const foo = (p: string) => {
|
|
return {
|
|
/**
|
|
* comment2
|
|
* @param s
|
|
*/
|
|
bar: (s: number) => {},
|
|
/**
|
|
* comment3
|
|
* @param s
|
|
*/
|
|
bar2(s: number) {},
|
|
}
|
|
}
|
|
|
|
export class Foo {
|
|
/**
|
|
* comment4
|
|
* @param s
|
|
*/
|
|
bar(s: number) {
|
|
}
|
|
}
|
|
|
|
export let {
|
|
/**
|
|
* comment5
|
|
*/
|
|
someMethod
|
|
} = null as any;
|
|
|
|
declare global {
|
|
interface ExtFunc {
|
|
/**
|
|
* comment6
|
|
*/
|
|
someMethod(collection: any[]): boolean;
|
|
}
|
|
}
|
|
|
|
|
|
//// [declarationEmitRetainsJsdocyComments.js]
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.someMethod = exports.Foo = exports.foo = void 0;
|
|
/**
|
|
* comment1
|
|
* @param p
|
|
*/
|
|
const foo = (p) => {
|
|
return {
|
|
/**
|
|
* comment2
|
|
* @param s
|
|
*/
|
|
bar: (s) => { },
|
|
/**
|
|
* comment3
|
|
* @param s
|
|
*/
|
|
bar2(s) { },
|
|
};
|
|
};
|
|
exports.foo = foo;
|
|
class Foo {
|
|
/**
|
|
* comment4
|
|
* @param s
|
|
*/
|
|
bar(s) {
|
|
}
|
|
}
|
|
exports.Foo = Foo;
|
|
({
|
|
/**
|
|
* comment5
|
|
*/
|
|
someMethod: exports.someMethod } = null);
|
|
|
|
|
|
//// [declarationEmitRetainsJsdocyComments.d.ts]
|
|
/**
|
|
* comment1
|
|
* @param p
|
|
*/
|
|
export declare const foo: (p: string) => {
|
|
/**
|
|
* comment2
|
|
* @param s
|
|
*/
|
|
bar: (s: number) => void;
|
|
/**
|
|
* comment3
|
|
* @param s
|
|
*/
|
|
bar2(s: number): void;
|
|
};
|
|
export declare class Foo {
|
|
/**
|
|
* comment4
|
|
* @param s
|
|
*/
|
|
bar(s: number): void;
|
|
}
|
|
export declare let
|
|
/**
|
|
* comment5
|
|
*/
|
|
someMethod: any;
|
|
declare global {
|
|
interface ExtFunc {
|
|
/**
|
|
* comment6
|
|
*/
|
|
someMethod(collection: any[]): boolean;
|
|
}
|
|
}
|