Migrated more common components to TS

This commit is contained in:
Alejandro Celaya
2020-08-28 20:05:01 +02:00
parent dcf72e6818
commit a96539129d
10 changed files with 105 additions and 86 deletions

View File

@@ -27,3 +27,6 @@ export type SelectedServer = RegularServer | NotFoundServer | null;
export const hasServerData = (server: ServerData | NotFoundServer | null): server is ServerData =>
!!(server as ServerData)?.url && !!(server as ServerData)?.apiKey;
export const isReachableServer = (server: SelectedServer): server is ReachableServer =>
!!server?.hasOwnProperty('printableVersion');