mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +08:00
fix: Use ElementOf<T> instead of array indexing (#23132)
This commit is contained in:
parent
deafd3fcce
commit
eb90c5b0a0
@ -1,4 +1,4 @@
|
||||
import { tuple } from './type';
|
||||
import { ElementOf, tuple } from './type';
|
||||
|
||||
export const PresetStatusColorTypes = tuple('success', 'processing', 'error', 'default', 'warning');
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
@ -18,5 +18,5 @@ export const PresetColorTypes = tuple(
|
||||
'lime',
|
||||
);
|
||||
|
||||
export type PresetColorType = typeof PresetColorTypes[number];
|
||||
export type PresetStatusColorType = typeof PresetStatusColorTypes[number];
|
||||
export type PresetColorType = ElementOf<typeof PresetColorTypes>;
|
||||
export type PresetStatusColorType = ElementOf<typeof PresetStatusColorTypes>;
|
||||
|
Loading…
Reference in New Issue
Block a user