1
0
Fork 0

Add typing to Page.ts.

This commit is contained in:
Kitteh 2021-05-07 23:33:58 +01:00
parent ac7372029d
commit c1455c25a4
23 changed files with 27 additions and 27 deletions

View file

@ -1,4 +1,4 @@
import { Page } from "./types/Page.js"; import { Page } from "./types/Page";
import { allPages } from "./allPages" import { allPages } from "./allPages"
import { import {
getKeyByObjectPropertyValue, getKeyByObjectPropertyValue,

View file

@ -8,6 +8,7 @@ import { KeyValueViewPage } from "./pages/KeyValue/KeyValueView.js";
import { LoginPage } from "./pages/Login.js"; import { LoginPage } from "./pages/Login.js";
import { MePage } from "./pages/Me.js"; import { MePage } from "./pages/Me.js";
import { NewTOTPPage } from "./pages/TOTP/NewTOTP.js"; import { NewTOTPPage } from "./pages/TOTP/NewTOTP.js";
import { Page } from "./types/Page";
import { PwGenPage } from "./pages/PwGen.js"; import { PwGenPage } from "./pages/PwGen.js";
import { SetLanguagePage } from "./pages/SetLanguage.js"; import { SetLanguagePage } from "./pages/SetLanguage.js";
import { SetVaultURLPage } from "./pages/SetVaultURL.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 { TransitViewPage } from "./pages/Transit/TransitView.js";
import { TransitViewSecretPage } from "./pages/Transit/TransitViewSecret.js"; import { TransitViewSecretPage } from "./pages/Transit/TransitViewSecret.js";
import { UnsealPage } from "./pages/Unseal.js"; import { UnsealPage } from "./pages/Unseal.js";
import { Page } from "./types/Page.js";
type pagesList = { type pagesList = {
[key: string]: Page [key: string]: Page

View file

@ -1,4 +1,4 @@
import { Page } from "../types/Page.js"; import { Page } from "../types/Page";
import { changePage, prePageChecks, setErrorText } from "../pageUtils"; import { changePage, prePageChecks, setErrorText } from "../pageUtils";
import { getMounts } from "../api/getMounts"; import { getMounts } from "../api/getMounts";
import { lookupSelf } from "../api/lookupSelf"; import { lookupSelf } from "../api/lookupSelf";

View file

@ -1,4 +1,4 @@
import { Page } from "../../types/Page.js"; import { Page } from "../../types/Page";
import { changePage, setPageContent, setTitleElement } from "../../pageUtils"; import { changePage, setPageContent, setTitleElement } from "../../pageUtils";
import { deleteSecret } from "../../api/deleteSecret"; import { deleteSecret } from "../../api/deleteSecret";
import { makeElement } from "../../htmlUtils"; import { makeElement } from "../../htmlUtils";

View file

@ -1,4 +1,4 @@
import { Page } from "../../types/Page.js"; import { Page } from "../../types/Page";
import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils";
import { createOrUpdateSecret } from "../../api/createOrUpdateSecret"; import { createOrUpdateSecret } from "../../api/createOrUpdateSecret";
import { makeElement } from "../../htmlUtils"; import { makeElement } from "../../htmlUtils";

View file

@ -1,5 +1,5 @@
import { CopyableInputBox } from "../../elements/CopyableInputBox.js"; import { CopyableInputBox } from "../../elements/CopyableInputBox.js";
import { Page } from "../../types/Page.js"; import { Page } from "../../types/Page";
import { changePage, setPageContent, setTitleElement } from "../../pageUtils"; import { changePage, setPageContent, setTitleElement } from "../../pageUtils";
import { getCapabilities } from "../../api/getCapabilities"; import { getCapabilities } from "../../api/getCapabilities";
import { getSecret } from "../../api/getSecret"; import { getSecret } from "../../api/getSecret";

View file

@ -1,5 +1,5 @@
import { CodeJar } from "codejar"; import { CodeJar } from "codejar";
import { Page } from "../../types/Page.js"; import { Page } from "../../types/Page";
import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils";
import { createOrUpdateSecret } from "../../api/createOrUpdateSecret.js"; import { createOrUpdateSecret } from "../../api/createOrUpdateSecret.js";
import { getSecret } from "../../api/getSecret.js"; import { getSecret } from "../../api/getSecret.js";

View file

@ -1,4 +1,4 @@
import { Page } from "../../types/Page.js"; import { Page } from "../../types/Page";
import { changePage, setPageContent, setTitleElement } from "../../pageUtils"; import { changePage, setPageContent, setTitleElement } from "../../pageUtils";
import { getSecretMetadata } from "../../api/getSecretMetadata.js"; import { getSecretMetadata } from "../../api/getSecretMetadata.js";
import { makeElement } from "../../htmlUtils"; import { makeElement } from "../../htmlUtils";

View file

@ -1,5 +1,5 @@
import { DoesNotExistError } from "../../types/internalErrors.js"; import { DoesNotExistError } from "../../types/internalErrors.js";
import { Page } from "../../types/Page.js"; import { Page } from "../../types/Page";
import { changePage, setErrorText, setTitleElement } from "../../pageUtils"; import { changePage, setErrorText, setTitleElement } from "../../pageUtils";
import { getSecrets } from "../../api/getSecrets"; import { getSecrets } from "../../api/getSecrets";
import { makeElement } from "../../htmlUtils"; import { makeElement } from "../../htmlUtils";

View file

@ -1,6 +1,6 @@
import { Margin } from "../elements/Margin.js"; import { Margin } from "../elements/Margin.js";
import { MarginInline } from "../elements/MarginInline.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 { changePage, setErrorText, setPageContent } from "../pageUtils";
import { lookupSelf } from "../api/lookupSelf"; import { lookupSelf } from "../api/lookupSelf";
import { makeElement } from "../htmlUtils"; import { makeElement } from "../htmlUtils";

View file

@ -1,4 +1,4 @@
import { Page } from "../types/Page.js"; import { Page } from "../types/Page";
import { addClipboardNotifications, changePage, prePageChecks, setErrorText, setPageContent } from "../pageUtils"; import { addClipboardNotifications, changePage, prePageChecks, setErrorText, setPageContent } from "../pageUtils";
import { getCapabilitiesPath } from "../api/getCapabilities.js"; import { getCapabilitiesPath } from "../api/getCapabilities.js";
import { makeElement } from "../htmlUtils"; import { makeElement } from "../htmlUtils";

View file

@ -1,6 +1,6 @@
import { CopyableInputBox } from "../elements/CopyableInputBox.js"; import { CopyableInputBox } from "../elements/CopyableInputBox.js";
import { Margin } from "../elements/Margin.js"; import { Margin } from "../elements/Margin.js";
import { Page } from "../types/Page.js"; import { Page } from "../types/Page";
import { makeElement } from "../htmlUtils"; import { makeElement } from "../htmlUtils";
import { setPageContent } from "../pageUtils"; import { setPageContent } from "../pageUtils";
import i18next from 'i18next'; import i18next from 'i18next';

View file

@ -1,5 +1,5 @@
import { Margin } from "../elements/Margin.js"; import { Margin } from "../elements/Margin.js";
import { Page } from "../types/Page.js"; import { Page } from "../types/Page";
import { changePage, setPageContent } from "../pageUtils"; import { changePage, setPageContent } from "../pageUtils";
import { makeElement } from "../htmlUtils"; import { makeElement } from "../htmlUtils";
import { pageState } from "../globalPageState.ts"; import { pageState } from "../globalPageState.ts";

View file

@ -1,4 +1,4 @@
import { Page } from "../types/Page.js"; import { Page } from "../types/Page";
import { changePage, setPageContent } from "../pageUtils"; import { changePage, setPageContent } from "../pageUtils";
import { makeElement } from "../htmlUtils"; import { makeElement } from "../htmlUtils";
import { pageState } from "../globalPageState.ts"; import { pageState } from "../globalPageState.ts";

View file

@ -1,6 +1,6 @@
import { Margin } from "../../elements/Margin.js"; import { Margin } from "../../elements/Margin.js";
import { MarginInline } from "../../elements/MarginInline.js"; import { MarginInline } from "../../elements/MarginInline.js";
import { Page } from "../../types/Page.js"; import { Page } from "../../types/Page";
import { addNewTOTP } from "../../api/addNewTOTP"; import { addNewTOTP } from "../../api/addNewTOTP";
import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils";
import { makeElement } from "../../htmlUtils"; import { makeElement } from "../../htmlUtils";

View file

@ -1,6 +1,6 @@
import { CopyableInputBox } from "../../elements/CopyableInputBox.js"; import { CopyableInputBox } from "../../elements/CopyableInputBox.js";
import { DoesNotExistError } from "../../types/internalErrors.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 { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils";
import { getTOTPCode } from "../../api/getTOTPCode"; import { getTOTPCode } from "../../api/getTOTPCode";
import { getTOTPKeys } from "../../api/getTOTPKeys"; import { getTOTPKeys } from "../../api/getTOTPKeys";

View file

@ -1,4 +1,4 @@
import { Page } from "../types/Page.js"; import { Page } from "../types/Page";
import { changePage, setPageContent, setTitleElement } from "../pageUtils"; import { changePage, setPageContent, setTitleElement } from "../pageUtils";
import { makeElement } from "../htmlUtils"; import { makeElement } from "../htmlUtils";
import { pageState } from "../globalPageState.ts"; import { pageState } from "../globalPageState.ts";

View file

@ -1,6 +1,6 @@
import { CopyableModal } from "../../elements/CopyableModal.js"; import { CopyableModal } from "../../elements/CopyableModal.js";
import { Margin } from "../../elements/Margin.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 { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils";
import { makeElement } from "../../htmlUtils"; import { makeElement } from "../../htmlUtils";
import { pageState } from "../../globalPageState.ts"; import { pageState } from "../../globalPageState.ts";

View file

@ -1,6 +1,6 @@
import { CopyableModal } from "../../elements/CopyableModal.js"; import { CopyableModal } from "../../elements/CopyableModal.js";
import { Margin } from "../../elements/Margin.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 { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils";
import { makeElement } from "../../htmlUtils"; import { makeElement } from "../../htmlUtils";
import { pageState } from "../../globalPageState.ts"; import { pageState } from "../../globalPageState.ts";

View file

@ -1,5 +1,5 @@
import { DoesNotExistError } from "../../types/internalErrors.js"; import { DoesNotExistError } from "../../types/internalErrors.js";
import { Page } from "../../types/Page.js"; import { Page } from "../../types/Page";
import { changePage, setErrorText, setTitleElement } from "../../pageUtils"; import { changePage, setErrorText, setTitleElement } from "../../pageUtils";
import { getTransitKeys } from "../../api/getTransitKeys"; import { getTransitKeys } from "../../api/getTransitKeys";
import { makeElement } from "../../htmlUtils"; import { makeElement } from "../../htmlUtils";

View file

@ -1,4 +1,4 @@
import { Page } from "../../types/Page.js"; import { Page } from "../../types/Page";
import { changePage, setPageContent, setTitleElement } from "../../pageUtils"; import { changePage, setPageContent, setTitleElement } from "../../pageUtils";
import { makeElement } from "../../htmlUtils"; import { makeElement } from "../../htmlUtils";
import { pageState } from "../../globalPageState.ts"; import { pageState } from "../../globalPageState.ts";

View file

@ -1,5 +1,5 @@
import { MarginInline } from "../elements/MarginInline.js"; import { MarginInline } from "../elements/MarginInline.js";
import { Page } from "../types/Page.js"; import { Page } from "../types/Page";
import { QRScanner } from "../elements/QRScanner.js"; import { QRScanner } from "../elements/QRScanner.js";
import { changePage, setErrorText, setPageContent } from "../pageUtils"; import { changePage, setErrorText, setPageContent } from "../pageUtils";
import { getSealStatus } from "../api/getSealStatus.js"; import { getSealStatus } from "../api/getSealStatus.js";

View file

@ -4,19 +4,19 @@ export class Page {
constructor() { constructor() {
// Do Nothing // Do Nothing
} }
render() { render(): any {
// Do Nothing // Do Nothing
} }
get name() { get name(): string {
return "Page"; return "Page";
} }
get titleSuffix() { get titleSuffix(): string {
return ""; return "";
} }
goBack() { goBack(): void {
changePage("HOME"); changePage("HOME");
} }
cleanup() { cleanup(): void {
// Do Nothing // Do Nothing
} }
} }