diff options
Diffstat (limited to 'packages/frontend/src/scripts')
| -rw-r--r-- | packages/frontend/src/scripts/api.ts | 10 | ||||
| -rw-r--r-- | packages/frontend/src/scripts/array.ts | 3 | ||||
| -rw-r--r-- | packages/frontend/src/scripts/get-note-menu.ts | 6 |
3 files changed, 10 insertions, 9 deletions
diff --git a/packages/frontend/src/scripts/api.ts b/packages/frontend/src/scripts/api.ts index d73d60cf26..9259c88013 100644 --- a/packages/frontend/src/scripts/api.ts +++ b/packages/frontend/src/scripts/api.ts @@ -3,21 +3,21 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Endpoints } from 'misskey-js/built/api.types'; +import * as Misskey from 'misskey-js'; import { ref } from 'vue'; import { apiUrl } from '@/config.js'; import { $i } from '@/account.js'; export const pendingApiRequestsCount = ref(0); // Implements Misskey.api.ApiClient.request -export function api<E extends keyof Endpoints, P extends Endpoints[E]['req']>(endpoint: E, data: P = {} as any, token?: string | null | undefined, signal?: AbortSignal): Promise<Endpoints[E]['res']> { +export function api<E extends keyof Misskey.Endpoints, P extends Misskey.Endpoints[E]['req']>(endpoint: E, data: P = {} as any, token?: string | null | undefined, signal?: AbortSignal): Promise<Misskey.Endpoints[E]['res']> { pendingApiRequestsCount.value++; const onFinally = () => { pendingApiRequestsCount.value--; }; - const promise = new Promise<Endpoints[E]['res'] | void>((resolve, reject) => { + const promise = new Promise<Misskey.Endpoints[E]['res'] | void>((resolve, reject) => { // Append a credential if ($i) (data as any).i = $i.token; if (token !== undefined) (data as any).i = token; @@ -51,7 +51,7 @@ export function api<E extends keyof Endpoints, P extends Endpoints[E]['req']>(en } // Implements Misskey.api.ApiClient.request -export function apiGet <E extends keyof Endpoints, P extends Endpoints[E]['req']>(endpoint: E, data: P = {} as any): Promise<Endpoints[E]['res']> { +export function apiGet <E extends keyof Misskey.Endpoints, P extends Misskey.Endpoints[E]['req']>(endpoint: E, data: P = {} as any): Promise<Misskey.Endpoints[E]['res']> { pendingApiRequestsCount.value++; const onFinally = () => { @@ -60,7 +60,7 @@ export function apiGet <E extends keyof Endpoints, P extends Endpoints[E]['req'] const query = new URLSearchParams(data as any); - const promise = new Promise<Endpoints[E]['res'] | void>((resolve, reject) => { + const promise = new Promise<Misskey.Endpoints[E]['res'] | void>((resolve, reject) => { // Send request window.fetch(`${apiUrl}/${endpoint}?${query}`, { method: 'GET', diff --git a/packages/frontend/src/scripts/array.ts b/packages/frontend/src/scripts/array.ts index d83b001c87..082703a450 100644 --- a/packages/frontend/src/scripts/array.ts +++ b/packages/frontend/src/scripts/array.ts @@ -3,7 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { EndoRelation, Predicate } from './relation.js'; +type EndoRelation<T> = (a: T, b: T) => boolean; +type Predicate<T> = (x: T) => boolean; /** * Count the number of elements that satisfy the predicate diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index a0b8683be3..734a632039 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -5,7 +5,7 @@ import { defineAsyncComponent, Ref } from 'vue'; import * as Misskey from 'misskey-js'; -import { claimAchievement } from './achievements'; +import { claimAchievement } from './achievements.js'; import { $i } from '@/account.js'; import { i18n } from '@/i18n.js'; import { instance } from '@/instance.js'; @@ -15,8 +15,8 @@ import { url } from '@/config.js'; import { defaultStore, noteActions } from '@/store.js'; import { miLocalStorage } from '@/local-storage.js'; import { getUserMenu } from '@/scripts/get-user-menu.js'; -import { clipsCache } from '@/cache'; -import { MenuItem } from '@/types/menu'; +import { clipsCache } from '@/cache.js'; +import { MenuItem } from '@/types/menu.js'; export async function getNoteClipMenu(props: { note: Misskey.entities.Note; |