chore(knip): trim dead exports and tool noise

This commit is contained in:
plebeius
2026-03-08 16:37:34 +08:00
parent b2137c7f91
commit 90a01057f2
30 changed files with 106 additions and 383 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ import type { ProviderAttempt } from './types';
export type { ProviderAttempt } from './types';
export type TranslateFn = (key: string) => string;
type TranslateFn = (key: string) => string;
function formatSingleAttempt(a: ProviderAttempt): string {
const base = `${a.provider}: ${a.error ?? 'unknown'}`;
+1 -4
View File
@@ -1,6 +1,6 @@
import type { MediaHostingRuntime, ProviderId } from './types';
export interface ProviderDefinition {
interface ProviderDefinition {
id: ProviderId;
label: string;
homepageUrl: string;
@@ -23,6 +23,3 @@ export const MEDIA_HOSTING_PROVIDERS: readonly ProviderDefinition[] = [
supportedRuntimes: ['electron', 'android'],
},
] as const;
/** Provider IDs for ordering */
export const PROVIDER_IDS: readonly ProviderId[] = MEDIA_HOSTING_PROVIDERS.map((p) => p.id);
+1 -1
View File
@@ -13,7 +13,7 @@ export interface CatalogPost {
}
/** Sort types supported by the catalog feed */
export type CatalogSortType = 'active' | 'new' | 'replyCount';
type CatalogSortType = 'active' | 'new' | 'replyCount';
/**
* Sort catalog feed for display.
+2 -2
View File
@@ -276,11 +276,11 @@ export const getMediaDimensions = memoize(
const thumbnailUrlsDb = localForageLru.createInstance({ name: '5chanThumbnailUrls', size: 500 });
export const getCachedThumbnail = async (url: string): Promise<string | null> => {
const getCachedThumbnail = async (url: string): Promise<string | null> => {
return await thumbnailUrlsDb.getItem(url);
};
export const setCachedThumbnail = async (url: string, thumbnail: string): Promise<void> => {
const setCachedThumbnail = async (url: string, thumbnail: string): Promise<void> => {
await thumbnailUrlsDb.setItem(url, thumbnail);
};
+3 -3
View File
@@ -1,6 +1,6 @@
import { BOARD_REPLIES_PREVIEW_VISIBLE_COUNT } from '../constants';
export interface CommentLike {
interface CommentLike {
cid?: string | null;
index?: number;
pendingApproval?: boolean;
@@ -35,7 +35,7 @@ export function getPreviewDisplayReplies<T extends CommentLike>(replies: T[], vi
.map((t) => t.reply);
}
export interface ComputeOmittedParams {
interface ComputeOmittedParams {
totalReplyCount: number;
visibleCount: number;
}
@@ -49,7 +49,7 @@ export function computeOmittedCount({ totalReplyCount, visibleCount }: ComputeOm
return Math.max(0, totalReplyCount - visibleCount);
}
export interface GetTotalReplyCountParams {
interface GetTotalReplyCountParams {
replyCount: number | undefined;
fullLoadedCount: number;
previewLoadedCount: number;
+1 -1
View File
@@ -1,6 +1,6 @@
import { isBoardModRoute, isModQueueRoute } from './route-utils';
export type ParamsType = {
type ParamsType = {
accountCommentIndex?: string;
boardIdentifier?: string;
commentCid?: string;