From ac7372029d575ed65ca7257c66b204abfc664d50 Mon Sep 17 00:00:00 2001 From: Kitteh Date: Fri, 7 May 2021 23:28:49 +0100 Subject: [PATCH] Add typing to allPages.ts. --- src/PageState.ts | 2 +- src/{allPages.js => allPages.ts} | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) rename src/{allPages.js => allPages.ts} (94%) diff --git a/src/PageState.ts b/src/PageState.ts index abe9b8e..54bcc03 100644 --- a/src/PageState.ts +++ b/src/PageState.ts @@ -1,5 +1,5 @@ import { Page } from "./types/Page.js"; -import { allPages } from "./allPages.js" +import { allPages } from "./allPages" import { getKeyByObjectPropertyValue, } from "./utils"; diff --git a/src/allPages.js b/src/allPages.ts similarity index 94% rename from src/allPages.js rename to src/allPages.ts index 1c9a893..ad1a87f 100644 --- a/src/allPages.js +++ b/src/allPages.ts @@ -17,8 +17,13 @@ import { TransitEncryptPage } from "./pages/Transit/TransitEncrypt.js"; import { TransitViewPage } from "./pages/Transit/TransitView.js"; import { TransitViewSecretPage } from "./pages/Transit/TransitViewSecret.js"; import { UnsealPage } from "./pages/Unseal.js"; +import { Page } from "./types/Page.js"; -export const allPages = { +type pagesList = { + [key: string]: Page +} + +export const allPages: pagesList = { HOME: new HomePage(), ME: new MePage(), TOTP: new TOTPViewPage(),