-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: improve typescript support for config file #465
Conversation
e985b58
to
9d5d366
Compare
export * from '../dist/node/index' | ||
export * from '../dist/client/index' | ||
export * from '../dist/client/theme-default/config' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this export since it does not exists: https://unpkg.com/browse/[email protected]/dist/client/
@@ -1,146 +1 @@ | |||
export namespace DefaultTheme { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this file to shared types since we need it between server and client.
9d5d366
to
712e8af
Compare
src/node/config.ts
Outdated
export function defineConfig(config: RawConfigExports) { | ||
export function defineConfig<T extends ThemeConfig = ThemeConfig>( | ||
config: UserConfig<T>, | ||
usingCustomTheme: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Motivation here: TypeScript cannot overload a function type inferring based on the number of generic type parameters, so I added an additional function parameters here.
@yyx990803 Could you help review this pull request? |
An extra argument to |
Close: #464