3 changed files with 31 additions and 1 deletions
@ -0,0 +1,5 @@ |
|||
--- |
|||
'@vben-core/preferences': patch |
|||
--- |
|||
|
|||
fix(@vben-core/preferences): type custom preference updates |
|||
@ -0,0 +1,21 @@ |
|||
import { describe, expectTypeOf, it } from 'vitest'; |
|||
|
|||
import type { DeepPartial } from '@vben-core/typings'; |
|||
|
|||
import { updateCustomPreferences } from '../src'; |
|||
|
|||
interface ProjectPreferences { |
|||
defaultTableSize: number; |
|||
tenantMode: 'multi' | 'single'; |
|||
} |
|||
|
|||
describe('custom preferences types', () => { |
|||
it('accepts a typed partial update', () => { |
|||
const updateProjectPreferences = |
|||
updateCustomPreferences<ProjectPreferences>; |
|||
|
|||
expectTypeOf(updateProjectPreferences) |
|||
.parameter(0) |
|||
.toEqualTypeOf<DeepPartial<ProjectPreferences>>(); |
|||
}); |
|||
}); |
|||
Loading…
Reference in new issue