From 9c2be5caa12fc8315ede46d8b8508c5baf3025db Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 30 Jul 2023 15:34:37 +0200 Subject: [PATCH] client: Fix return type --- client/js/sharers.tsx | 2 +- client/js/templates/App.tsx | 10 +++++----- client/js/templates/Navigation.tsx | 2 +- client/js/templates/OpmlImport.tsx | 4 ++-- client/js/templates/SourceParam.tsx | 2 +- client/js/templates/SourcesPage.tsx | 2 +- client/js/templates/Spinner.tsx | 4 ++-- client/selfoss-sw-offline.ts | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/client/js/sharers.tsx b/client/js/sharers.tsx index a1c7c71ac3..c952a72acc 100644 --- a/client/js/sharers.tsx +++ b/client/js/sharers.tsx @@ -7,7 +7,7 @@ import { Configuration } from './model/Configuration'; type Sharer = { label: string, - icon: string | JSX.Element, + icon: string | React.JSX.Element, action: (params: { url: string, title: string }) => void, available?: boolean, }; diff --git a/client/js/templates/App.tsx b/client/js/templates/App.tsx index d700531c46..0332cbb6c4 100644 --- a/client/js/templates/App.tsx +++ b/client/js/templates/App.tsx @@ -76,7 +76,7 @@ type MessageProps = { */ function Message( props: MessageProps, -): JSX.Element | null { +): React.JSX.Element | null { const { message, } = props; @@ -109,7 +109,7 @@ function Message( ); } -function NotFound(): JSX.Element { +function NotFound(): React.JSX.Element { const location = useLocation(); const _ = useContext(LocalizationContext); return ( @@ -174,7 +174,7 @@ type PureAppProps = { function PureApp( props: PureAppProps, -): JSX.Element { +): React.JSX.Element { const { navSourcesExpanded, setNavSourcesExpanded, @@ -777,7 +777,7 @@ export class App extends React.Component { } - render(): JSX.Element { + render(): React.JSX.Element { return ( @@ -815,7 +815,7 @@ export function createApp( appRef: React.RefObject, configuration: Configuration, }, -): JSX.Element { +): React.JSX.Element { const { basePath, appRef, diff --git a/client/js/templates/Navigation.tsx b/client/js/templates/Navigation.tsx index ba735f3207..42cb648f88 100644 --- a/client/js/templates/Navigation.tsx +++ b/client/js/templates/Navigation.tsx @@ -36,7 +36,7 @@ type NavigationProps = { export default function Navigation( props: NavigationProps, -): JSX.Element { +): React.JSX.Element { const { entriesPage, setNavExpanded, diff --git a/client/js/templates/OpmlImport.tsx b/client/js/templates/OpmlImport.tsx index 642aea1ac8..5467a2f289 100644 --- a/client/js/templates/OpmlImport.tsx +++ b/client/js/templates/OpmlImport.tsx @@ -16,13 +16,13 @@ type OpmlImportProps = { export default function OpmlImport( props: OpmlImportProps, -): JSX.Element { +): React.JSX.Element { const { setTitle, } = props; const [state, setState] = useState(LoadingState.INITIAL); - const [message, setMessage] = useState(null); + const [message, setMessage] = useState(null); const fileEntry = useRef(null); const history = useHistory(); diff --git a/client/js/templates/SourceParam.tsx b/client/js/templates/SourceParam.tsx index b5d0c41b89..27a1f82017 100644 --- a/client/js/templates/SourceParam.tsx +++ b/client/js/templates/SourceParam.tsx @@ -16,7 +16,7 @@ type SourceParamProps = { export default function SourceParam( props: SourceParamProps, -): JSX.Element { +): React.JSX.Element { const { spoutParamName, spoutParam, diff --git a/client/js/templates/SourcesPage.tsx b/client/js/templates/SourcesPage.tsx index ce111048fc..38e349af15 100644 --- a/client/js/templates/SourcesPage.tsx +++ b/client/js/templates/SourcesPage.tsx @@ -95,7 +95,7 @@ function loadSources({ abortController, location, setSpouts, setSources, setLoad }); } -export default function SourcesPage(): JSX.Element { +export default function SourcesPage(): React.JSX.Element { const [spouts, setSpouts] = useState([]); const [sources, setSources] = useState([]); diff --git a/client/js/templates/Spinner.tsx b/client/js/templates/Spinner.tsx index 7e19988e47..6aefcec3ed 100644 --- a/client/js/templates/Spinner.tsx +++ b/client/js/templates/Spinner.tsx @@ -9,7 +9,7 @@ type SpinnerProps = { export function Spinner( props: SpinnerProps, -): JSX.Element { +): React.JSX.Element { const { label, size, } = props; @@ -34,7 +34,7 @@ type SpinnerBigProps = { export function SpinnerBig( props: SpinnerBigProps, -): JSX.Element { +): React.JSX.Element { const { label, } = props; diff --git a/client/selfoss-sw-offline.ts b/client/selfoss-sw-offline.ts index 78b2dad7d9..1c97b7ea6f 100644 --- a/client/selfoss-sw-offline.ts +++ b/client/selfoss-sw-offline.ts @@ -7,7 +7,7 @@ import { manifest, version } from '@parcel/service-worker'; // https://github.com/microsoft/TypeScript/issues/14877 declare const self: ServiceWorkerGlobalScope; -async function install(): Promise { +async function install(): Promise { const cache = await caches.open(version); const entriesToCache: string[] = @@ -20,7 +20,7 @@ async function install(): Promise { self.addEventListener('install', (event: ExtendableEvent) => event.waitUntil(install())); -async function activate(): Promise> { +async function activate(): Promise { const keys = await caches.keys(); await Promise.all( keys