- {/* @ts-expect-error ts-migrate(2741) FIXME: Property 'style' is missing in type '{ children: E... Remove this comment to see the full error message */}
- {/* @ts-expect-error ts-migrate(2741) FIXME: Property 'style' is missing in type '{ children: E... Remove this comment to see the full error message */}
- {/* @ts-expect-error ts-migrate(2741) FIXME: Property 'style' is missing in type '{ children: E... Remove this comment to see the full error message */}
- {/* @ts-expect-error ts-migrate(2741) FIXME: Property 'style' is missing in type '{ children: E... Remove this comment to see the full error message */}
} />
} isLoading />
diff --git a/src/components/TrafficChart.tsx b/src/components/TrafficChart.tsx
index c6bf8ff..0198ab2 100644
--- a/src/components/TrafficChart.tsx
+++ b/src/components/TrafficChart.tsx
@@ -11,7 +11,7 @@ import { connect } from './StateProvider';
const { useMemo } = React;
-const chartWrapperStyle = {
+const chartWrapperStyle: React.CSSProperties = {
// make chartjs chart responsive
position: 'relative',
maxWidth: 1000,
@@ -52,7 +52,6 @@ function TrafficChart({ apiConfig, selectedChartStyleIndex }) {
useLineChart(ChartMod.Chart, 'trafficChart', data, traffic);
return (
- // @ts-expect-error ts-migrate(2322) FIXME: Type '{ position: string; maxWidth: number; }' is ... Remove this comment to see the full error message
diff --git a/src/components/proxies/ProxyProvider.tsx b/src/components/proxies/ProxyProvider.tsx
index af5be18..a20521c 100644
--- a/src/components/proxies/ProxyProvider.tsx
+++ b/src/components/proxies/ProxyProvider.tsx
@@ -14,7 +14,7 @@ import {
getProxySortBy,
} from 'src/store/app';
import { getDelay, healthcheckProviderByName } from 'src/store/proxies';
-import { DelayMapping } from 'src/store/types';
+import { DelayMapping, State } from 'src/store/types';
import { useFilteredAndSorted } from './hooks';
import { ProxyList, ProxyListSummaryView } from './ProxyList';
@@ -24,7 +24,7 @@ const { useState, useCallback } = React;
type Props = {
name: string;
- proxies: Array;
+ proxies: string[];
delay: DelayMapping;
hideUnavailableProxies: boolean;
proxySortBy: string;
@@ -77,10 +77,7 @@ function ProxyProviderImpl({
isOpen={isOpen}
qty={proxies.length}
/>
-
- Updated {timeAgo} ago
-
- {/* @ts-expect-error ts-migrate(2322) FIXME: Type '{ children: Element[]; isOpen: boolean; }' i... Remove this comment to see the full error message */}
+
Updated {timeAgo} ago
@@ -93,7 +90,6 @@ function ProxyProviderImpl({
/>
- {/* @ts-expect-error ts-migrate(2322) FIXME: Type '{ children: Element; isOpen: boolean; }' is ... Remove this comment to see the full error message */}
@@ -127,7 +123,7 @@ function Refresh() {
);
}
-const mapState = (s, { proxies, name }) => {
+const mapState = (s: State, { proxies, name }) => {
const hideUnavailableProxies = getHideUnavailableProxies(s);
const delay = getDelay(s);
const collapsibleIsOpen = getCollapsibleIsOpen(s);
diff --git a/src/hooks/basic.ts b/src/hooks/basic.ts
index 587d92d..5b0c082 100644
--- a/src/hooks/basic.ts
+++ b/src/hooks/basic.ts
@@ -2,7 +2,7 @@ import React from 'react';
const { useState, useCallback } = React;
-export function useToggle(initialValue = false) {
+export function useToggle(initialValue = false): [boolean, () => void] {
const [isOn, setState] = useState(initialValue);
const toggle = useCallback(() => setState((x) => !x), []);
return [isOn, toggle];
diff --git a/src/types.ts b/src/types.ts
index 8446dfc..0f89dfe 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -4,3 +4,5 @@ export type ClashAPIConfig = {
};
export type LogsAPIConfig = ClashAPIConfig & { logLevel: string };
+
+export type RuleType = { id?: number; type?: string; payload?: string; proxy?: string; }