Microsoft/TypeScript

[DTS] Object literal method with bigint is omitted in generated `.d.ts`, but class method works correctly

Open

#61,769 创建于 2025年5月27日

在 GitHub 查看
 (0 评论) (0 反应) (1 负责人)TypeScript (6,726 fork)batch import
BugDomain: Declaration EmitHelp Wanted

仓库指标

Star
 (48,455 star)
PR 合并指标
 (平均合并 6天 17小时) (30 天内合并 9 个 PR)

描述

🔎 Search Terms

  • dts
  • bigint key
  • object
  • class

🕗 Version & Regression Information

  • This changed between versions ______ and _______
  • This changed in commit or PR _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

https://www.typescriptlang.org/play/?#code/KYDwDg9gTgLgBAYwgOwM7wGYQnAvHAbwCg5S4BGZACgEpCSzGpgYBXKZCgbgdIF8ANLzgAmWvUZMW7TiJ6M+RRUVCRYiADYBDVKjgAxbBLKVxxSWWZsO3YYsZi65i3CszR8sor5A

💻 Code

export const foo = {
    1n() {
        return 1;
    },
    2() {
        return 2;
    }
}

export class Foo {
    1n() {
        return 1;
    }
    2() {
        return 2;
    }
}

🙁 Actual behavior

export declare const foo: {
    2(): number;
};
export declare class Foo {
    1n(): number;
    2(): number;
}

🙂 Expected behavior

export declare const foo: {
    1n(): number;
    2(): number;
};
export declare class Foo {
    1n(): number;
    2(): number;
}

Additional information about the issue

No response

贡献者指南