Migrated ShlinkApiClientBuilder to TS

This commit is contained in:
Alejandro Celaya
2020-08-27 22:09:16 +02:00
parent eb3775859a
commit 54290d4c9a
16 changed files with 70 additions and 51 deletions

View File

@@ -4,7 +4,7 @@ export interface ServerData {
apiKey: string;
}
export interface ServerWithId {
export interface ServerWithId extends ServerData {
id: string;
}
@@ -24,3 +24,6 @@ export interface NotFoundServer {
export type RegularServer = ReachableServer | NonReachableServer;
export type SelectedServer = RegularServer | NotFoundServer | null;
export const hasServerData = (server: ServerData | NotFoundServer | null): server is ServerData =>
!!(server as ServerData)?.url && !!(server as ServerData)?.apiKey;