Skip to content

Conversation

@zxbodya
Copy link
Contributor

@zxbodya zxbodya commented Dec 3, 2025

  • more type improvements
  • fix for namespace exports, to correctly include types
  • enable type output for package publishing

Comment on lines +5 to +8
export type Alert = _Alert;
export const Alert = _Alert;
export type Condition = _Condition;
export const Condition = _Condition;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an idiom in typescript that I'm familiar with. This works to export both the type and the var under the same name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit of a weird feature - as long as it does not conflict, TypeScript allows that
https://www.typescriptlang.org/docs/handbook/declaration-merging.html

In this case, the re-exported class is both a type (for instances of it) and a variable (a constructor function), and this is a workaround to have both (having just export const does not export the type)

@albertyw albertyw merged commit 054cbbb into uber:master Dec 4, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants