mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
ab14d131a7
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jakebailey <[email protected]>
30 lines
691 B
TypeScript
30 lines
691 B
TypeScript
//// [tests/cases/compiler/declarationEmitConstObjectLiteralGenericMethod1.ts] ////
|
|
|
|
//// [declarationEmitConstObjectLiteralGenericMethod1.ts]
|
|
export const obj1 = {
|
|
id<T>(value: T) {
|
|
return value;
|
|
},
|
|
pair<T>(left: T, right: T) {
|
|
return [left, right];
|
|
},
|
|
} as const;
|
|
|
|
|
|
//// [declarationEmitConstObjectLiteralGenericMethod1.js]
|
|
export const obj1 = {
|
|
id(value) {
|
|
return value;
|
|
},
|
|
pair(left, right) {
|
|
return [left, right];
|
|
},
|
|
};
|
|
|
|
|
|
//// [declarationEmitConstObjectLiteralGenericMethod1.d.ts]
|
|
export declare const obj1: {
|
|
readonly id: <T>(value: T) => T;
|
|
readonly pair: <T>(left: T, right: T) => T[];
|
|
};
|