fix: Use ElementOf<T> instead of array indexing (#23132)

This commit is contained in:
Chiciuc Nicușor 2020-04-11 15:46:09 +03:00 committed by GitHub
parent deafd3fcce
commit eb90c5b0a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>;