fix many, many more type errors

This commit is contained in:
2023-09-03 10:02:17 -06:00
parent b8aaffbf8d
commit b05b602acd
15 changed files with 170 additions and 97 deletions

View File

@@ -290,6 +290,7 @@
</template>
<script lang="ts">
import { AxiosError } from "axios/index";
import "dexie-export-import";
import { Component, Vue } from "vue-facing-decorator";
import { useClipboard } from "@vueuse/core";
@@ -298,9 +299,9 @@ import { AppString } from "@/constants/app";
import { db, accountsDB } from "@/db";
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
import { accessToken } from "@/libs/crypto";
import { AxiosError } from "axios/index";
import QuickNav from "@/components/QuickNav";
import { IIdentifier } from "@veramo/core";
import { ErrorResponse, RateLimits } from "@/libs/endorserServer";
// eslint-disable-next-line @typescript-eslint/no-var-requires
const Buffer = require("buffer/").Buffer;
@@ -341,7 +342,7 @@ export default class AccountViewView extends Vue {
alertMessage = "";
alertTitle = "";
public async getIdentity(activeDid) {
public async getIdentity(activeDid: string) {
await accountsDB.open();
const account = await accountsDB.accounts
.where("did")
@@ -351,7 +352,7 @@ export default class AccountViewView extends Vue {
return identity;
}
public async getHeaders(identity) {
public async getHeaders(identity: IIdentifier) {
const token = await accessToken(identity);
const headers = {
"Content-Type": "application/json",
@@ -361,7 +362,7 @@ export default class AccountViewView extends Vue {
}
// call fn, copy text to the clipboard, then redo fn after 2 seconds
doCopyTwoSecRedo(text, fn) {
doCopyTwoSecRedo(text: string, fn: () => void) {
fn();
useClipboard()
.copy(text)
@@ -413,7 +414,7 @@ export default class AccountViewView extends Vue {
});
this.checkLimitsFor(identity);
}
} catch (err) {
} catch (err: any) {
if (
err.message ===
"Attempted to load account records with no identity available."
@@ -583,7 +584,7 @@ export default class AccountViewView extends Vue {
this.apiServer = this.apiServerInput;
}
setApiServerInput(value) {
setApiServerInput(value: string) {
this.apiServerInput = value;
}
}