chore: adjust type

This commit is contained in:
GyDi
2022-11-19 17:22:29 +08:00
parent e19fe5ce1c
commit 6eafb15cf9
26 changed files with 274 additions and 283 deletions

View File

@@ -89,7 +89,7 @@ const SysproxyViewer = ({ handler }: Props) => {
return;
}
const patch: Partial<CmdType.VergeConfig> = {};
const patch: Partial<IVergeConfig> = {};
if (value.guard !== enable_proxy_guard) {
patch.enable_proxy_guard = value.guard;

View File

@@ -1,7 +1,7 @@
import { useTranslation } from "react-i18next";
import { Button, ButtonGroup } from "@mui/material";
type ThemeValue = CmdType.VergeConfig["theme_mode"];
type ThemeValue = IVergeConfig["theme_mode"];
interface Props {
value?: ThemeValue;

View File

@@ -46,10 +46,10 @@ const SettingClash = ({ onError }: Props) => {
const controllerHandler = useModalHandler();
const onSwitchFormat = (_e: any, value: boolean) => value;
const onChangeData = (patch: Partial<ApiType.ConfigData>) => {
const onChangeData = (patch: Partial<IConfigData>) => {
mutateClash((old) => ({ ...(old! || {}), ...patch }), false);
};
const onUpdateData = async (patch: Partial<ApiType.ConfigData>) => {
const onUpdateData = async (patch: Partial<IConfigData>) => {
await updateConfigs(patch);
await patchClashConfig(patch);
};

View File

@@ -46,7 +46,7 @@ const SettingSystem = ({ onError }: Props) => {
} = vergeConfig ?? {};
const onSwitchFormat = (_e: any, value: boolean) => value;
const onChangeData = (patch: Partial<CmdType.VergeConfig>) => {
const onChangeData = (patch: Partial<IVergeConfig>) => {
mutateVerge({ ...vergeConfig, ...patch }, false);
};

View File

@@ -42,7 +42,7 @@ const SettingVerge = ({ onError }: Props) => {
const [configOpen, setConfigOpen] = useState(false);
const onSwitchFormat = (_e: any, value: boolean) => value;
const onChangeData = (patch: Partial<CmdType.VergeConfig>) => {
const onChangeData = (patch: Partial<IVergeConfig>) => {
mutateVerge({ ...vergeConfig, ...patch }, false);
};