refactor(ipc): generate bindings with Specta

This commit is contained in:
Tunglies
2026-10-08 01:57:25 +08:00
parent 1c2817023e
commit 2e439b5e1a
71 changed files with 2091 additions and 1087 deletions
@@ -5,11 +5,11 @@ export type ProxyEmptyStateReason =
| 'no-proxy-info'
type ProfileSummary = {
current?: string
current?: string | null
items?: Array<{
uid?: string
type?: string
}>
uid?: string | null
type?: string | null
}> | null
}
interface ProxyListStateInput {
@@ -20,7 +20,7 @@ interface ProxyListStateInput {
isRunningModePending: boolean
}
const isSubscriptionProfile = (item: { type?: string }): boolean =>
const isSubscriptionProfile = (item: { type?: string | null }): boolean =>
item.type === 'remote' || item.type === 'local'
/** Decides only pre-render states; the built list owns whether it has renderable content. */
+2 -2
View File
@@ -198,7 +198,7 @@ export const ProxyRender = memo(function ProxyRender(props: RenderProps) {
{toolsOnLeft && proxyCount}
<ProxyGroupTools
side={toolsOnLeft ? 'left' : 'right'}
url={group.testUrl}
url={group.testUrl!}
groupName={group.name}
headState={headState!}
onLocation={() => onLocation(group)}
@@ -247,7 +247,7 @@ export const ProxyRender = memo(function ProxyRender(props: RenderProps) {
return (
<ProxyHead
sx={{ pl: 2, pr: 3, mt: 0.5, mb: 1 }}
url={group.testUrl}
url={group.testUrl!}
groupName={group.name}
headState={headState!}
onLocation={() => onLocation(group)}
+6 -6
View File
@@ -237,7 +237,7 @@ export const useRenderList = (
selected?.name ?? CHAIN_DELAY_GROUP,
'',
0,
latencyTimeout,
latencyTimeout!,
)
if (col > 1) {
return groupOccurrences(occurrences, col).map((memberCol) => ({
@@ -289,8 +289,8 @@ export const useRenderList = (
key: group.name,
group,
headState,
icon: group.icon,
testUrl: group.testUrl,
icon: group.icon!,
testUrl: group.testUrl!,
},
]
@@ -300,7 +300,7 @@ export const useRenderList = (
group.name,
headState.filterText,
headState.sortType,
latencyTimeout,
latencyTimeout!,
{
matchCase: headState.filterMatchCase,
matchWholeWord: headState.filterMatchWholeWord,
@@ -337,11 +337,11 @@ export const useRenderList = (
}
cache.set(group.name, {
now: group.now,
now: group.now!,
members: group.members,
headState,
col,
latencyTimeout,
latencyTimeout: latencyTimeout!,
delays: groupDelays.get(group.name),
items: ret,
})