(type: string, dataId?: string)
| 41 | |
| 42 | // 尝试恢复已关闭的 tab |
| 43 | export function tryRestoreTab(type: string, dataId?: string): Tab | null { |
| 44 | const config = tabTypeRegistry.get(type) |
| 45 | if (!config?.restoreTab || !dataId) { |
| 46 | return null |
| 47 | } |
| 48 | return config.restoreTab(dataId) |
| 49 | } |
| 50 | |
| 51 | // 清理无效的 tabs(返回有效的 tabs) |
| 52 | export function filterValidTabs(tabs: Tab[]): Tab[] { |
no test coverage detected