Move type "NullAndUndefined" to util types

This commit is contained in:
schroda
2025-08-16 17:10:48 +02:00
parent e1058200c0
commit f13fcc0e8c
7 changed files with 4 additions and 7 deletions

2
src/UtilTypes.d.ts vendored
View File

@@ -20,6 +20,8 @@ type RecursivePartial<T> = {
: T[P];
};
type NullAndUndefined<T> = T | null | undefined;
type NonNullableProperties<T> = { [P in keyof T]-?: NonNullable<T[P]> };
type OptionalProperty<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;

View File

@@ -20,8 +20,6 @@ export enum DirectionOffset {
NEXT = 1,
}
export type NullAndUndefined<T> = T | null | undefined;
export type TranslationKey = ParseKeys;
interface DisplayDataTranslationKey {

View File

@@ -11,7 +11,6 @@ import {
ChapterType,
DownloadStatusFieldsFragment,
} from '@/lib/graphql/generated/graphql.ts';
import { NullAndUndefined } from '@/base/Base.types.ts';
export type ChapterSortMode = 'fetchedAt' | 'source' | 'chapterNumber' | 'uploadedAt';

View File

@@ -19,7 +19,6 @@ import { MangaIdInfo } from '@/features/manga/Manga.types.ts';
import { GqlMetaHolder } from '@/features/metadata/Metadata.types.ts';
import { createUpdateMangaMetadata, useGetMangaMetadata } from '@/features/manga/services/MangaMetadata.ts';
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
import { NullAndUndefined } from '@/base/Base.types.ts';
export function unreadFilter(unread: NullAndUndefined<boolean>, { isRead: isChapterRead }: ChapterReadInfo) {
switch (unread) {

View File

@@ -7,7 +7,7 @@
*/
import { MangaStatus, MangaType, TrackerType } from '@/lib/graphql/generated/graphql.ts';
import { GridLayout, NullAndUndefined } from '@/base/Base.types.ts';
import { GridLayout } from '@/base/Base.types.ts';
export type MetadataLibrarySettings = {
showAddToLibraryCategorySelectDialog: boolean;

View File

@@ -22,7 +22,7 @@ import {
MangaUnreadInfo,
} from '@/features/manga/Manga.types.ts';
import { SourceDisplayNameInfo } from '@/features/source/Source.types.ts';
import { NullAndUndefined, SearchParam } from '@/base/Base.types.ts';
import { SearchParam } from '@/base/Base.types.ts';
const triStateFilter = (
triState: NullAndUndefined<boolean>,

View File

@@ -33,7 +33,6 @@ import { ISourceMetadata } from '@/features/source/Source.types.ts';
import { LibraryOptions } from '@/features/library/Library.types.ts';
import { MetadataThemeSettings } from '@/features/theme/AppTheme.types.ts';
import { TapZoneInvertMode } from '@/features/reader/tap-zones/TapZoneLayout.types.ts';
import { NullAndUndefined } from '@/base/Base.types.ts';
export const APP_METADATA_KEY_PREFIX = 'webUI';