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:
@@ -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> {
|
||||
/**
|
||||
* 外部から直接操作しないでください
|
||||
|
||||
Reference in New Issue
Block a user