From add9109789582e8bc8ee0714d64969462c51738f Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Sat, 17 Jun 2023 14:02:44 +0800 Subject: [PATCH] fix type check --- src/modules/[chain]/ibc/connStore.ts | 18 +++++++++--------- tsconfig.json | 3 ++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/modules/[chain]/ibc/connStore.ts b/src/modules/[chain]/ibc/connStore.ts index 802dfd72..6d6bdf42 100644 --- a/src/modules/[chain]/ibc/connStore.ts +++ b/src/modules/[chain]/ibc/connStore.ts @@ -3,7 +3,7 @@ import { defineStore } from 'pinia'; import {useBlockchain} from '@/stores' import ChainRegistryClient from '@ping-pub/chain-registry-client'; -import type { IBCPath } from '@ping-pub/chain-registry-client/dist/types'; +import type { IBCPath, IBCInfo, } from '@ping-pub/chain-registry-client/dist/types'; import type { Channel } from '@/types'; import router from '@/router'; @@ -11,24 +11,24 @@ export const useIBCModule = defineStore('module-ibc', { state: () => { return { paths: [] as IBCPath[], - connectionId: "", - registryConf: {}, + connectionId: "" as string, + registryConf: {} as IBCInfo, }; }, getters: { chain() { return useBlockchain() }, - commonIBCs() { - return this.paths.filter(x => x.path.search(this.chain.current?.prettyName || this.chain.chainName) > -1) + commonIBCs(): any { + return this.paths.filter((x: IBCPath) => x.path.search(this.chain.current?.prettyName || this.chain.chainName) > -1) }, - sourceField() { + sourceField(): string { return this.registryConf?.chain_1?.chain_name === this.chain.current?.prettyName || this.chain.chainName ? 'chain_1': 'chain_2' }, - destField() { + destField() : string { return this.registryConf?.chain_1?.chain_name === this.chain.current?.prettyName || this.chain.chainName ? 'chain_2': 'chain_1' }, - registryChannels() { + registryChannels(): any { return this.registryConf.channels } }, @@ -50,7 +50,7 @@ export const useIBCModule = defineStore('module-ibc', { }, showConnection(connId?: string | number) { if(!connId) { - this.registryConf = {} + this.registryConf = {} as any } const path = `/${this.chain.chainName}/ibc/connection/${connId || `connection-${this.connectionId || 0}`}` router.push(path) diff --git a/tsconfig.json b/tsconfig.json index e8adae09..01d7fcc5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,8 @@ { - "extends": "@vue/tsconfig/tsconfig.web.json", + "extends": "@vue/tsconfig/tsconfig.json", "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], "compilerOptions": { + "ignoreDeprecations": "5.0", "lib": [ "es2022", "dom"