1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-24 03:24:18 +02:00

refactor8frontend9: anyを除去 (#16778)

This commit is contained in:
かっこかり
2025-11-10 15:33:54 +09:00
committed by GitHub
parent 73bcd330f7
commit fd2fe34270
16 changed files with 42 additions and 110 deletions

View File

@@ -5,7 +5,7 @@
import { ref, shallowRef, triggerRef } from 'vue';
import * as Misskey from 'misskey-js';
import type { ComputedRef, Ref, ShallowRef } from 'vue';
import type { ComputedRef, Ref, ShallowRef, UnwrapRef } from 'vue';
import { misskeyApi } from '@/utility/misskey-api.js';
const MAX_ITEMS = 30;
@@ -19,7 +19,12 @@ export type MisskeyEntity = {
_shouldInsertAd_?: boolean;
};
type FilterByEpRes<E extends Record<string, any>> = {
type AbsEndpointType = {
req: unknown;
res: unknown;
};
type FilterByEpRes<E extends Record<string, AbsEndpointType>> = {
[K in keyof E]: E[K]['res'] extends Array<{ id: string }> ? K : never
}[keyof E];
export type PaginatorCompatibleEndpointPaths = FilterByEpRes<Misskey.Endpoints>;
@@ -27,6 +32,8 @@ export type PaginatorCompatibleEndpoints = {
[K in PaginatorCompatibleEndpointPaths]: Misskey.Endpoints[K];
};
export type ExtractorFunction<P extends IPaginator, T> = (item: UnwrapRef<P['items']>[number]) => T;
export interface IPaginator<T = unknown, _T = T & MisskeyEntity> {
/**
* 外部から直接操作しないでください