From a84ca647dd347f91e89fdf16ae86eaf9207b33a0 Mon Sep 17 00:00:00 2001 From: Daniel M Date: Fri, 1 Jul 2022 12:30:39 +0200 Subject: [PATCH] Restrict Fixed #3021 - Toast/Message SeverityType to the only four valid values (#2911) * Restrict ToastSeverityType to the only four valid values * Restrict MessageSeverityType to the only four valid values * Restrict MessagesSeverityType to the only four valid values * Restrict BadgeSeverityType to the only four valid values * Restrict TagSeverityType to the only four valid values --- components/lib/badge/Badge.d.ts | 2 +- components/lib/message/Message.d.ts | 2 +- components/lib/messages/Messages.d.ts | 2 +- components/lib/tag/Tag.d.ts | 2 +- components/lib/toast/Toast.d.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/lib/badge/Badge.d.ts b/components/lib/badge/Badge.d.ts index 4277194d34..f3476d6d56 100644 --- a/components/lib/badge/Badge.d.ts +++ b/components/lib/badge/Badge.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; -type BadgeSeverityType = 'success' | 'info' | 'warn' | 'error' | (string & {}); +type BadgeSeverityType = 'success' | 'info' | 'warn' | 'error'; type BadgeSizeType = 'normal' | 'large' | 'xlarge'; diff --git a/components/lib/message/Message.d.ts b/components/lib/message/Message.d.ts index 21851ebe8c..b6591f8ae0 100644 --- a/components/lib/message/Message.d.ts +++ b/components/lib/message/Message.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; -type MessageSeverityType = 'success' | 'info' | 'warn' | 'error' | (string & {}); +type MessageSeverityType = 'success' | 'info' | 'warn' | 'error'; type MessageContentType = React.ReactNode | ((props: MessageProps) => React.ReactNode); diff --git a/components/lib/messages/Messages.d.ts b/components/lib/messages/Messages.d.ts index 212caa844a..47700070d1 100644 --- a/components/lib/messages/Messages.d.ts +++ b/components/lib/messages/Messages.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { CSSTransitionProps } from '../csstransition'; -type MessagesSeverityType = 'success' | 'info' | 'warn' | 'error' | (string & {}); +type MessagesSeverityType = 'success' | 'info' | 'warn' | 'error'; type MessagesMessageType = MessagesMessage | MessagesMessage[]; diff --git a/components/lib/tag/Tag.d.ts b/components/lib/tag/Tag.d.ts index 349b9e42cf..0d2494d2ef 100644 --- a/components/lib/tag/Tag.d.ts +++ b/components/lib/tag/Tag.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { IconType } from '../utils'; -type TagSeverityType = 'success' | 'info' | 'warn' | 'error' | (string & {}); +type TagSeverityType = 'success' | 'info' | 'warn' | 'error'; export interface TagProps { value?: React.ReactNode; diff --git a/components/lib/toast/Toast.d.ts b/components/lib/toast/Toast.d.ts index 0e241354eb..0b106e3791 100644 --- a/components/lib/toast/Toast.d.ts +++ b/components/lib/toast/Toast.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { CSSTransitionProps } from '../csstransition'; -type ToastSeverityType = 'success' | 'info' | 'warn' | 'error' | (string & {}); +type ToastSeverityType = 'success' | 'info' | 'warn' | 'error'; type ToastMessageType = ToastMessage | ToastMessage[];