refactor(sw): fix type errors (#14478)

* style(sw): lint fixes

* refactor(sw): fix type errors

* chore(sw): disable `noImplicitAny`

* ci(sw): enable typecheck ci

* ci(sw): build `misskey-js` before typecheck
This commit is contained in:
zyoshoka
2024-08-30 15:53:04 +09:00
committed by GitHub
parent 3fe7e37f10
commit 8be624aa44
7 changed files with 31 additions and 21 deletions

View File

@@ -4,9 +4,10 @@
*/
import { get } from 'idb-keyval';
import * as Misskey from 'misskey-js';
export async function getAccountFromId(id: string): Promise<{ token: string; id: string } | void> {
const accounts = await get<{ token: string; id: string }[]>('accounts');
export async function getAccountFromId(id: string): Promise<Pick<Misskey.entities.SignupResponse, 'id' | 'token'> | undefined> {
const accounts = await get<Pick<Misskey.entities.SignupResponse, 'id' | 'token'>[]>('accounts');
if (!accounts) {
console.log('Accounts are not recorded');
return;