Skip to content
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

Type '{} & Dict' is not assignable to type 'Config' #57

Open
idranme opened this issue Apr 26, 2024 · 0 comments
Open

Type '{} & Dict' is not assignable to type 'Config' #57

idranme opened this issue Apr 26, 2024 · 0 comments
Labels
bug Something isn't working types

Comments

@idranme
Copy link

idranme commented Apr 26, 2024

export interface Config {
  autoLogin: boolean
  loginUsername: string
  loginPassword: string
}

export const Config: Schema<Config> = Schema.intersect([
  Schema.object({
    autoLogin: Schema.boolean().description('是否在 auth 开启时自动登录').default(false),
  }),
  Schema.union([
    Schema.object({
      autoLogin: Schema.const(true).required(),
      loginUsername: Schema.string().description('登录用户名').default('admin'),
      loginPassword: Schema.string().role('secret').description('登录密码').default(''),
    }),
    Schema.object({})
  ])
])

2b12f2e8f6938ea07b46868185fd4923

@shigma shigma added types bug Something isn't working labels Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working types
Projects
None yet
Development

No branches or pull requests

2 participants