diff --git a/src/PageState.ts b/src/PageState.ts index 54bcc03..36be881 100644 --- a/src/PageState.ts +++ b/src/PageState.ts @@ -1,4 +1,4 @@ -import { Page } from "./types/Page.js"; +import { Page } from "./types/Page"; import { allPages } from "./allPages" import { getKeyByObjectPropertyValue, diff --git a/src/allPages.ts b/src/allPages.ts index ad1a87f..1b6c234 100644 --- a/src/allPages.ts +++ b/src/allPages.ts @@ -8,6 +8,7 @@ import { KeyValueViewPage } from "./pages/KeyValue/KeyValueView.js"; import { LoginPage } from "./pages/Login.js"; import { MePage } from "./pages/Me.js"; import { NewTOTPPage } from "./pages/TOTP/NewTOTP.js"; +import { Page } from "./types/Page"; import { PwGenPage } from "./pages/PwGen.js"; import { SetLanguagePage } from "./pages/SetLanguage.js"; import { SetVaultURLPage } from "./pages/SetVaultURL.js"; @@ -17,7 +18,6 @@ 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"; type pagesList = { [key: string]: Page diff --git a/src/pages/Home.js b/src/pages/Home.js index 4a1d923..a64aeea 100644 --- a/src/pages/Home.js +++ b/src/pages/Home.js @@ -1,4 +1,4 @@ -import { Page } from "../types/Page.js"; +import { Page } from "../types/Page"; import { changePage, prePageChecks, setErrorText } from "../pageUtils"; import { getMounts } from "../api/getMounts"; import { lookupSelf } from "../api/lookupSelf"; diff --git a/src/pages/KeyValue/KeyValueDelete.js b/src/pages/KeyValue/KeyValueDelete.js index a0fdc69..e48706c 100644 --- a/src/pages/KeyValue/KeyValueDelete.js +++ b/src/pages/KeyValue/KeyValueDelete.js @@ -1,4 +1,4 @@ -import { Page } from "../../types/Page.js"; +import { Page } from "../../types/Page"; import { changePage, setPageContent, setTitleElement } from "../../pageUtils"; import { deleteSecret } from "../../api/deleteSecret"; import { makeElement } from "../../htmlUtils"; diff --git a/src/pages/KeyValue/KeyValueNew.js b/src/pages/KeyValue/KeyValueNew.js index f64508d..dc5ca10 100644 --- a/src/pages/KeyValue/KeyValueNew.js +++ b/src/pages/KeyValue/KeyValueNew.js @@ -1,4 +1,4 @@ -import { Page } from "../../types/Page.js"; +import { Page } from "../../types/Page"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; import { createOrUpdateSecret } from "../../api/createOrUpdateSecret"; import { makeElement } from "../../htmlUtils"; diff --git a/src/pages/KeyValue/KeyValueSecret.js b/src/pages/KeyValue/KeyValueSecret.js index 3a30449..3176f8f 100644 --- a/src/pages/KeyValue/KeyValueSecret.js +++ b/src/pages/KeyValue/KeyValueSecret.js @@ -1,5 +1,5 @@ import { CopyableInputBox } from "../../elements/CopyableInputBox.js"; -import { Page } from "../../types/Page.js"; +import { Page } from "../../types/Page"; import { changePage, setPageContent, setTitleElement } from "../../pageUtils"; import { getCapabilities } from "../../api/getCapabilities"; import { getSecret } from "../../api/getSecret"; diff --git a/src/pages/KeyValue/KeyValueSecretsEdit.js b/src/pages/KeyValue/KeyValueSecretsEdit.js index 258146a..1b5154e 100644 --- a/src/pages/KeyValue/KeyValueSecretsEdit.js +++ b/src/pages/KeyValue/KeyValueSecretsEdit.js @@ -1,5 +1,5 @@ import { CodeJar } from "codejar"; -import { Page } from "../../types/Page.js"; +import { Page } from "../../types/Page"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; import { createOrUpdateSecret } from "../../api/createOrUpdateSecret.js"; import { getSecret } from "../../api/getSecret.js"; diff --git a/src/pages/KeyValue/KeyValueVersions.js b/src/pages/KeyValue/KeyValueVersions.js index c534807..e6f8beb 100644 --- a/src/pages/KeyValue/KeyValueVersions.js +++ b/src/pages/KeyValue/KeyValueVersions.js @@ -1,4 +1,4 @@ -import { Page } from "../../types/Page.js"; +import { Page } from "../../types/Page"; import { changePage, setPageContent, setTitleElement } from "../../pageUtils"; import { getSecretMetadata } from "../../api/getSecretMetadata.js"; import { makeElement } from "../../htmlUtils"; diff --git a/src/pages/KeyValue/KeyValueView.js b/src/pages/KeyValue/KeyValueView.js index 87f9a56..a943575 100644 --- a/src/pages/KeyValue/KeyValueView.js +++ b/src/pages/KeyValue/KeyValueView.js @@ -1,5 +1,5 @@ import { DoesNotExistError } from "../../types/internalErrors.js"; -import { Page } from "../../types/Page.js"; +import { Page } from "../../types/Page"; import { changePage, setErrorText, setTitleElement } from "../../pageUtils"; import { getSecrets } from "../../api/getSecrets"; import { makeElement } from "../../htmlUtils"; diff --git a/src/pages/Login.js b/src/pages/Login.js index 2cb80c3..a4da780 100644 --- a/src/pages/Login.js +++ b/src/pages/Login.js @@ -1,6 +1,6 @@ import { Margin } from "../elements/Margin.js"; import { MarginInline } from "../elements/MarginInline.js"; -import { Page } from "../types/Page.js"; +import { Page } from "../types/Page"; import { changePage, setErrorText, setPageContent } from "../pageUtils"; import { lookupSelf } from "../api/lookupSelf"; import { makeElement } from "../htmlUtils"; diff --git a/src/pages/Me.js b/src/pages/Me.js index 24f33ac..b668a84 100644 --- a/src/pages/Me.js +++ b/src/pages/Me.js @@ -1,4 +1,4 @@ -import { Page } from "../types/Page.js"; +import { Page } from "../types/Page"; import { addClipboardNotifications, changePage, prePageChecks, setErrorText, setPageContent } from "../pageUtils"; import { getCapabilitiesPath } from "../api/getCapabilities.js"; import { makeElement } from "../htmlUtils"; diff --git a/src/pages/PwGen.js b/src/pages/PwGen.js index f052a74..7df70a3 100644 --- a/src/pages/PwGen.js +++ b/src/pages/PwGen.js @@ -1,6 +1,6 @@ import { CopyableInputBox } from "../elements/CopyableInputBox.js"; import { Margin } from "../elements/Margin.js"; -import { Page } from "../types/Page.js"; +import { Page } from "../types/Page"; import { makeElement } from "../htmlUtils"; import { setPageContent } from "../pageUtils"; import i18next from 'i18next'; diff --git a/src/pages/SetLanguage.js b/src/pages/SetLanguage.js index 0a269ad..edc0a66 100644 --- a/src/pages/SetLanguage.js +++ b/src/pages/SetLanguage.js @@ -1,5 +1,5 @@ import { Margin } from "../elements/Margin.js"; -import { Page } from "../types/Page.js"; +import { Page } from "../types/Page"; import { changePage, setPageContent } from "../pageUtils"; import { makeElement } from "../htmlUtils"; import { pageState } from "../globalPageState.ts"; diff --git a/src/pages/SetVaultURL.js b/src/pages/SetVaultURL.js index 1295d0b..4ed1b94 100644 --- a/src/pages/SetVaultURL.js +++ b/src/pages/SetVaultURL.js @@ -1,4 +1,4 @@ -import { Page } from "../types/Page.js"; +import { Page } from "../types/Page"; import { changePage, setPageContent } from "../pageUtils"; import { makeElement } from "../htmlUtils"; import { pageState } from "../globalPageState.ts"; diff --git a/src/pages/TOTP/NewTOTP.js b/src/pages/TOTP/NewTOTP.js index 180c66e..5220520 100644 --- a/src/pages/TOTP/NewTOTP.js +++ b/src/pages/TOTP/NewTOTP.js @@ -1,6 +1,6 @@ import { Margin } from "../../elements/Margin.js"; import { MarginInline } from "../../elements/MarginInline.js"; -import { Page } from "../../types/Page.js"; +import { Page } from "../../types/Page"; import { addNewTOTP } from "../../api/addNewTOTP"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; import { makeElement } from "../../htmlUtils"; diff --git a/src/pages/TOTP/TOTPView.js b/src/pages/TOTP/TOTPView.js index adc40dc..df43f15 100644 --- a/src/pages/TOTP/TOTPView.js +++ b/src/pages/TOTP/TOTPView.js @@ -1,6 +1,6 @@ import { CopyableInputBox } from "../../elements/CopyableInputBox.js"; import { DoesNotExistError } from "../../types/internalErrors.js"; -import { Page } from "../../types/Page.js"; +import { Page } from "../../types/Page"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; import { getTOTPCode } from "../../api/getTOTPCode"; import { getTOTPKeys } from "../../api/getTOTPKeys"; diff --git a/src/pages/Template.js b/src/pages/Template.js index 5dff8fb..5acf055 100644 --- a/src/pages/Template.js +++ b/src/pages/Template.js @@ -1,4 +1,4 @@ -import { Page } from "../types/Page.js"; +import { Page } from "../types/Page"; import { changePage, setPageContent, setTitleElement } from "../pageUtils"; import { makeElement } from "../htmlUtils"; import { pageState } from "../globalPageState.ts"; diff --git a/src/pages/Transit/TransitDecrypt.js b/src/pages/Transit/TransitDecrypt.js index 3b168b9..c4f8e50 100644 --- a/src/pages/Transit/TransitDecrypt.js +++ b/src/pages/Transit/TransitDecrypt.js @@ -1,6 +1,6 @@ import { CopyableModal } from "../../elements/CopyableModal.js"; import { Margin } from "../../elements/Margin.js"; -import { Page } from "../../types/Page.js"; +import { Page } from "../../types/Page"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; import { makeElement } from "../../htmlUtils"; import { pageState } from "../../globalPageState.ts"; diff --git a/src/pages/Transit/TransitEncrypt.js b/src/pages/Transit/TransitEncrypt.js index 464816c..b148136 100644 --- a/src/pages/Transit/TransitEncrypt.js +++ b/src/pages/Transit/TransitEncrypt.js @@ -1,6 +1,6 @@ import { CopyableModal } from "../../elements/CopyableModal.js"; import { Margin } from "../../elements/Margin.js"; -import { Page } from "../../types/Page.js"; +import { Page } from "../../types/Page"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; import { makeElement } from "../../htmlUtils"; import { pageState } from "../../globalPageState.ts"; diff --git a/src/pages/Transit/TransitView.js b/src/pages/Transit/TransitView.js index cf11053..4219e8e 100644 --- a/src/pages/Transit/TransitView.js +++ b/src/pages/Transit/TransitView.js @@ -1,5 +1,5 @@ import { DoesNotExistError } from "../../types/internalErrors.js"; -import { Page } from "../../types/Page.js"; +import { Page } from "../../types/Page"; import { changePage, setErrorText, setTitleElement } from "../../pageUtils"; import { getTransitKeys } from "../../api/getTransitKeys"; import { makeElement } from "../../htmlUtils"; diff --git a/src/pages/Transit/TransitViewSecret.js b/src/pages/Transit/TransitViewSecret.js index 6583fce..33b3b9b 100644 --- a/src/pages/Transit/TransitViewSecret.js +++ b/src/pages/Transit/TransitViewSecret.js @@ -1,4 +1,4 @@ -import { Page } from "../../types/Page.js"; +import { Page } from "../../types/Page"; import { changePage, setPageContent, setTitleElement } from "../../pageUtils"; import { makeElement } from "../../htmlUtils"; import { pageState } from "../../globalPageState.ts"; diff --git a/src/pages/Unseal.js b/src/pages/Unseal.js index fb4b110..eb9f8a9 100644 --- a/src/pages/Unseal.js +++ b/src/pages/Unseal.js @@ -1,5 +1,5 @@ import { MarginInline } from "../elements/MarginInline.js"; -import { Page } from "../types/Page.js"; +import { Page } from "../types/Page"; import { QRScanner } from "../elements/QRScanner.js"; import { changePage, setErrorText, setPageContent } from "../pageUtils"; import { getSealStatus } from "../api/getSealStatus.js"; diff --git a/src/types/Page.js b/src/types/Page.ts similarity index 66% rename from src/types/Page.js rename to src/types/Page.ts index 23b0e3a..2e60583 100644 --- a/src/types/Page.js +++ b/src/types/Page.ts @@ -4,19 +4,19 @@ export class Page { constructor() { // Do Nothing } - render() { + render(): any { // Do Nothing } - get name() { + get name(): string { return "Page"; } - get titleSuffix() { + get titleSuffix(): string { return ""; } - goBack() { + goBack(): void { changePage("HOME"); } - cleanup() { + cleanup(): void { // Do Nothing } } \ No newline at end of file