Skip to content

Commit 72c2177

Browse files
committed
feat: extend support for tab type in InitTabType
1 parent fb64cd3 commit 72c2177

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/Shared/types.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ interface CommonTabArgsType {
754754
isSelected: boolean
755755
title?: string
756756
isDeleted?: boolean
757-
position: number
757+
type: 'fixed' | 'dynamic'
758758
iconPath?: string
759759
dynamicTitle?: string
760760
showNameOnSelect?: boolean
@@ -782,9 +782,19 @@ interface CommonTabArgsType {
782782
shouldRemainMounted?: boolean
783783
}
784784

785-
export interface InitTabType extends CommonTabArgsType {
786-
idPrefix: string
787-
}
785+
export type InitTabType = Omit<CommonTabArgsType, 'type'> &
786+
(
787+
| {
788+
type: 'fixed'
789+
id: string
790+
idPrefix?: never
791+
}
792+
| {
793+
type: 'dynamic'
794+
id?: never
795+
idPrefix: string
796+
}
797+
)
788798

789799
export interface DynamicTabType extends CommonTabArgsType {
790800
id: string

0 commit comments

Comments
 (0)