From 312b34128ec1c6477eb417135c8d71521a977088 Mon Sep 17 00:00:00 2001 From: pamapa Date: Wed, 6 Oct 2021 09:25:50 +0200 Subject: [PATCH] feat: #4 reduce any types --- src/StateStore.ts | 6 +++--- src/User.ts | 2 +- src/navigators/IFrameWindow.ts | 4 ++-- src/navigators/PopupWindow.ts | 12 ++++++------ src/utils/JoseUtil.ts | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/StateStore.ts b/src/StateStore.ts index a622b6626..dbab296e4 100644 --- a/src/StateStore.ts +++ b/src/StateStore.ts @@ -1,6 +1,6 @@ export interface StateStore { - set(key: string, value: any): Promise; - get(key: string): Promise; - remove(key: string): Promise; + set(key: string, value: string): Promise; + get(key: string): Promise; + remove(key: string): Promise; getAllKeys(): Promise; } diff --git a/src/User.ts b/src/User.ts index 22eb02d80..485d7ff71 100644 --- a/src/User.ts +++ b/src/User.ts @@ -8,7 +8,7 @@ export interface UserProfile { sid?: string; azp?: string; at_hash?: string; - auth_time?: any; + auth_time?: number; } /** diff --git a/src/navigators/IFrameWindow.ts b/src/navigators/IFrameWindow.ts index 267f2e6d6..fe33dd904 100644 --- a/src/navigators/IFrameWindow.ts +++ b/src/navigators/IFrameWindow.ts @@ -56,7 +56,7 @@ export class IFrameWindow implements IWindow { return await this._promise; } - protected _success(data: any): void { + protected _success(data: NavigateResponse): void { this._cleanup(); Log.debug("IFrameWindow: Successful response from frame window"); @@ -92,7 +92,7 @@ export class IFrameWindow implements IWindow { this._error("Frame window timed out"); } - protected _message = (e: any): void => { + protected _message = (e: MessageEvent): void => { Log.debug("IFrameWindow.message"); const origin = location.protocol + "//" + location.host; diff --git a/src/navigators/PopupWindow.ts b/src/navigators/PopupWindow.ts index b9c21c24d..82673bb1e 100644 --- a/src/navigators/PopupWindow.ts +++ b/src/navigators/PopupWindow.ts @@ -60,9 +60,9 @@ export class PopupWindow implements IWindow { return await this._promise; } - _messageReceived = (event: MessageEvent): void => { + protected _messageReceived = (event: MessageEvent): void => { if (event.origin !== window.location.origin) { - Log.warn("PopupWindow:messageRecieved: Message not coming from same origin: " + event.origin); + Log.warn("PopupWindow:_messageReceived: Message not coming from same origin: " + event.origin); return; } @@ -73,19 +73,19 @@ export class PopupWindow implements IWindow { // @ts-ignore const callback = window["popupCallback_" + data.state]; if (callback) { - Log.debug("PopupWindow.notifyOpener: passing url message to opener"); + Log.debug("PopupWindow._messageReceived: passing url message to opener"); callback(url, keepOpen); } else { - Log.warn("PopupWindow.notifyOpener: no matching callback found on opener"); + Log.warn("PopupWindow._messageReceived: no matching callback found on opener"); } } else { - Log.warn("PopupWindow.notifyOpener: no state found in response url"); + Log.warn("PopupWindow._messageReceived: no state found in response url"); } } - protected _success(data: any): void { + protected _success(data: NavigateResponse): void { Log.debug("PopupWindow.callback: Successful response from popup window"); this._cleanup(); diff --git a/src/utils/JoseUtil.ts b/src/utils/JoseUtil.ts index f95575f45..3a3b8abe6 100644 --- a/src/utils/JoseUtil.ts +++ b/src/utils/JoseUtil.ts @@ -25,7 +25,7 @@ export interface JwtPayload { exp?: number; sub?: string; nonce?: string; - auth_time?: any; + auth_time?: number; } export class JoseUtil {