microsoft / microsoft/TypeScript

[API] Expose globals declared by a source file

Đang mở
#63,871 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

@andrewbranch đang làm issue này rồi.

Từ ngày 3/8/2026.

Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

With TypeScript 6.x, TypeDoc supports documenting global files by documenting the globals defined in that file.

This was done somewhat hackily with:

```ts
result = checker.getSymbolsInScope(node, ts.SymbolFlags.ModuleMember)
.filter((s) =>
s
.getDeclarations()
?.some((d) => d.getSourceFile() === sourceFile)
);
```

@jakebailey told me on Discord that there is `SourceFile.Locals`, which would be a better way to get this information, but this isn't exposed in the JS API, so I'd like to request that!

Ref: https://github.com/TypeStrong/typedoc/issues/3098

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.