1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fix eslint errors

This commit is contained in:
Bill Thornton 2024-08-21 02:54:09 -04:00
parent 018d8d3f83
commit 8a6f33fff8
18 changed files with 48 additions and 48 deletions

6
src/apiclient.d.ts vendored
View file

@ -182,7 +182,7 @@ declare module 'jellyfin-apiclient' {
getPluginConfiguration(id: string): Promise<any>; getPluginConfiguration(id: string): Promise<any>;
getPublicSystemInfo(): Promise<PublicSystemInfo>; getPublicSystemInfo(): Promise<PublicSystemInfo>;
getPublicUsers(): Promise<UserDto[]>; getPublicUsers(): Promise<UserDto[]>;
getQuickConnect(verb: string): Promise<void|boolean|number|QuickConnectResult|QuickConnectState>; getQuickConnect(verb: string): Promise<void | boolean | number | QuickConnectResult | QuickConnectState>;
getReadySyncItems(deviceId: string): Promise<any>; getReadySyncItems(deviceId: string): Promise<any>;
getRecordingFolders(userId: string): Promise<BaseItemDtoQueryResult>; getRecordingFolders(userId: string): Promise<BaseItemDtoQueryResult>;
getRegistrationInfo(feature: string): Promise<any>; getRegistrationInfo(feature: string): Promise<any>;
@ -308,7 +308,7 @@ declare module 'jellyfin-apiclient' {
class AppStore { class AppStore {
constructor(); constructor();
getItem(name: string): string|null; getItem(name: string): string | null;
removeItem(name: string): void; removeItem(name: string): void;
setItem(name: string, value: string): void; setItem(name: string, value: string): void;
} }
@ -329,7 +329,7 @@ declare module 'jellyfin-apiclient' {
connectToServer(server: any, options?: any): Promise<any>; connectToServer(server: any, options?: any): Promise<any>;
connectToServers(servers: any[], options?: any): Promise<any>; connectToServers(servers: any[], options?: any): Promise<any>;
deleteServer(serverId: string): Promise<void>; deleteServer(serverId: string): Promise<void>;
getApiClient(item: BaseItemDto|string): ApiClient; getApiClient(item: BaseItemDto | string): ApiClient;
getApiClients(): ApiClient[]; getApiClients(): ApiClient[];
getAvailableServers(): any[]; getAvailableServers(): any[];
getOrCreateApiClient(serverId: string): ApiClient; getOrCreateApiClient(serverId: string): ApiClient;

View file

@ -10,7 +10,7 @@ import { currentSettings, UserSettings } from 'scripts/settings/userSettings';
import { DisplaySettingsValues } from '../types'; import { DisplaySettingsValues } from '../types';
interface UseDisplaySettingsParams { interface UseDisplaySettingsParams {
userId?: string | null; userId?: string | null;
} }
export function useDisplaySettings({ userId }: UseDisplaySettingsParams) { export function useDisplaySettings({ userId }: UseDisplaySettingsParams) {

View file

@ -15,8 +15,8 @@ import type { ItemDto } from 'types/base/models/item-dto';
import type { CardOptions } from 'types/cardOptions'; import type { CardOptions } from 'types/cardOptions';
interface CardHoverMenuProps { interface CardHoverMenuProps {
item: ItemDto; item: ItemDto;
cardOptions: CardOptions; cardOptions: CardOptions;
} }
const CardHoverMenu: FC<CardHoverMenuProps> = ({ const CardHoverMenu: FC<CardHoverMenuProps> = ({

View file

@ -103,7 +103,7 @@ export const resolveCardCssClasses = (opts: CardCssClassOpts): string => {
* Resolves applicable Card Image container CSS classes * Resolves applicable Card Image container CSS classes
* @param opts options for determining which CSS classes are applicable * @param opts options for determining which CSS classes are applicable
*/ */
export const resolveCardImageContainerCssClasses = (opts: { itemType: string, hasCoverImage: boolean, itemName?: string, imgUrl?: string}): string => { export const resolveCardImageContainerCssClasses = (opts: { itemType: string, hasCoverImage: boolean, itemName?: string, imgUrl?: string }): string => {
return classNames({ return classNames({
'cardImageContainer': true, 'cardImageContainer': true,
'coveredImage': opts.hasCoverImage, 'coveredImage': opts.hasCoverImage,

View file

@ -3,7 +3,7 @@ import type { RouteObject } from 'react-router-dom';
export enum AsyncRouteType { export enum AsyncRouteType {
Stable, Stable,
Experimental, Experimental,
Dashboard, Dashboard
} }
export interface AsyncRoute { export interface AsyncRoute {

View file

@ -5,15 +5,15 @@ import './emby-button.scss';
enum IconPosition { enum IconPosition {
RIGHT = 'RIGHT', RIGHT = 'RIGHT',
LEFT = 'LEFT', LEFT = 'LEFT'
} }
interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>,
HTMLButtonElement HTMLButtonElement
> { > {
icon?: string; icon?: string;
iconClassName?: string; iconClassName?: string;
iconPos?: string; iconPos?: string;
} }
const Button: React.FC<ButtonProps> = ({ const Button: React.FC<ButtonProps> = ({

View file

@ -5,9 +5,9 @@ import './emby-button.scss';
interface IconButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, interface IconButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>,
HTMLButtonElement HTMLButtonElement
> { > {
icon?: string; icon?: string;
iconClassName?: string; iconClassName?: string;
} }
const IconButton: React.FC<IconButtonProps> = ({ const IconButton: React.FC<IconButtonProps> = ({

View file

@ -8,11 +8,11 @@ import './emby-button.scss';
interface LinkButtonProps extends DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, interface LinkButtonProps extends DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>,
HTMLAnchorElement HTMLAnchorElement
> { > {
className?: string; className?: string;
isAutoHideEnabled?: boolean; isAutoHideEnabled?: boolean;
href?: string; href?: string;
target?: string; target?: string;
} }
const LinkButton: React.FC<LinkButtonProps> = ({ const LinkButton: React.FC<LinkButtonProps> = ({

View file

@ -2,18 +2,18 @@ import ScrollerFactory from 'lib/scroller';
import globalize from 'lib/globalize'; import globalize from 'lib/globalize';
export enum ScrollDirection { export enum ScrollDirection {
RIGHT = 'right', RIGHT = 'right',
LEFT = 'left', LEFT = 'left'
} }
interface ScrollState { interface ScrollState {
scrollPos: number; scrollPos: number;
} }
interface ScrollerItemSlideIntoViewProps { interface ScrollerItemSlideIntoViewProps {
direction: ScrollDirection; direction: ScrollDirection;
scroller: ScrollerFactory | null; scroller: ScrollerFactory | null;
scrollState: ScrollState; scrollState: ScrollState;
} }
interface ScrollToWindowProps { interface ScrollToWindowProps {

View file

@ -2,12 +2,12 @@ import { MutableRefObject, useLayoutEffect, useRef, useState } from 'react';
import useResizeObserver from '@react-hook/resize-observer'; import useResizeObserver from '@react-hook/resize-observer';
interface Size { interface Size {
width: number; width: number;
height: number; height: number;
} }
export default function useElementSize< export default function useElementSize<
T extends HTMLElement = HTMLDivElement T extends HTMLElement = HTMLDivElement
>(): [MutableRefObject<T | null>, Size] { >(): [MutableRefObject<T | null>, Size] {
const target = useRef<T | null>(null); const target = useRef<T | null>(null);
const [size, setSize] = useState<Size>({ const [size, setSize] = useState<Size>({

4
src/index.d.ts vendored
View file

@ -1,4 +1,4 @@
declare module '*.png' { declare module '*.png' {
const value: any; const value: any;
export = value; export = value;
} }

View file

@ -8,13 +8,13 @@ import purplehaze from './purplehaze';
import wmc from './wmc'; import wmc from './wmc';
declare module '@mui/material/styles' { declare module '@mui/material/styles' {
interface Palette { interface Palette {
starIcon: Palette['primary']; starIcon: Palette['primary'];
} }
interface PaletteOptions { interface PaletteOptions {
starIcon?: PaletteOptions['primary']; starIcon?: PaletteOptions['primary'];
} }
} }
const ALL_THEMES = { const ALL_THEMES = {

View file

@ -3,7 +3,7 @@ import type { BaseItemDto, BaseItemKind, CollectionTypeOptions, RecordingStatus,
type BaseItem = Omit<BaseItemDto, 'ChannelId' | 'EndDate' | 'Id' | 'StartDate' | 'Status' | 'Type' | 'Artists' | 'MediaType' | 'Name' | 'CollectionType'>; type BaseItem = Omit<BaseItemDto, 'ChannelId' | 'EndDate' | 'Id' | 'StartDate' | 'Status' | 'Type' | 'Artists' | 'MediaType' | 'Name' | 'CollectionType'>;
type TimerInfo = Omit<TimerInfoDto, 'ChannelId' | 'EndDate' | 'Id' | 'StartDate' | 'Status' | 'Type' | 'Name'>; type TimerInfo = Omit<TimerInfoDto, 'ChannelId' | 'EndDate' | 'Id' | 'StartDate' | 'Status' | 'Type' | 'Name'>;
type SeriesTimerInfo = Omit<SeriesTimerInfoDto, 'ChannelId' | 'EndDate' | 'Id' | 'StartDate' | 'Type' | 'Name'>; type SeriesTimerInfo = Omit<SeriesTimerInfoDto, 'ChannelId' | 'EndDate' | 'Id' | 'StartDate' | 'Type' | 'Name'>;
type SearchHintItem = Omit<SearchHint, 'ItemId' |'Artists' | 'Id' | 'MediaType' | 'Name' | 'StartDate' | 'Type'>; type SearchHintItem = Omit<SearchHint, 'ItemId' | 'Artists' | 'Id' | 'MediaType' | 'Name' | 'StartDate' | 'Type'>;
type UserItem = Omit<UserItemDataDto, 'ItemId'>; type UserItem = Omit<UserItemDataDto, 'ItemId'>;
type VirtualFolder = Omit<VirtualFolderInfo, 'CollectionType'>; type VirtualFolder = Omit<VirtualFolderInfo, 'CollectionType'>;

View file

@ -16,20 +16,20 @@ export enum FeatureFilters {
HasTrailer = 'HasTrailer', HasTrailer = 'HasTrailer',
HasSpecialFeature = 'HasSpecialFeature', HasSpecialFeature = 'HasSpecialFeature',
HasThemeSong = 'HasThemeSong', HasThemeSong = 'HasThemeSong',
HasThemeVideo = 'HasThemeVideo', HasThemeVideo = 'HasThemeVideo'
} }
export enum EpisodeFilter { export enum EpisodeFilter {
ParentIndexNumber = 'ParentIndexNumber', ParentIndexNumber = 'ParentIndexNumber',
IsMissing = 'IsMissing', IsMissing = 'IsMissing',
IsUnaired = 'IsUnaired', IsUnaired = 'IsUnaired'
} }
export enum VideoBasicFilter { export enum VideoBasicFilter {
IsSD = 'IsSD', IsSD = 'IsSD',
IsHD = 'IsHD', IsHD = 'IsHD',
Is4K = 'Is4K', Is4K = 'Is4K',
Is3D = 'Is3D', Is3D = 'Is3D'
} }
export interface Filters { export interface Filters {
@ -49,7 +49,7 @@ export interface Filters {
export enum ViewMode { export enum ViewMode {
GridView = 'grid', GridView = 'grid',
ListView = 'list', ListView = 'list'
} }
export interface LibraryViewSettings { export interface LibraryViewSettings {

View file

@ -23,5 +23,5 @@ export enum LibraryTab {
PhotoAlbums = 'photoalbums', PhotoAlbums = 'photoalbums',
Photos = 'photos', Photos = 'photos',
Videos = 'videos', Videos = 'videos',
Books = 'books', Books = 'books'
} }

View file

@ -28,7 +28,7 @@ export enum SectionApiMethod {
RecommendedPrograms = 'RecommendedPrograms', RecommendedPrograms = 'RecommendedPrograms',
LiveTvPrograms = 'liveTvPrograms', LiveTvPrograms = 'liveTvPrograms',
Recordings = 'Recordings', Recordings = 'Recordings',
RecordingFolders = 'RecordingFolders', RecordingFolders = 'RecordingFolders'
} }
export enum SectionType { export enum SectionType {

View file

@ -13,7 +13,7 @@ export enum CardShape {
Mixed = 'mixed', Mixed = 'mixed',
MixedSquare = 'mixedSquare', MixedSquare = 'mixedSquare',
MixedBackdrop = 'mixedBackdrop', MixedBackdrop = 'mixedBackdrop',
MixedPortrait = 'mixedPortrait', MixedPortrait = 'mixedPortrait'
} }
export function getSquareShape(enableOverflow = true) { export function getSquareShape(enableOverflow = true) {

View file

@ -5,7 +5,7 @@ import type { MediaSourceInfo } from '@jellyfin/sdk/lib/generated-client';
* @param mediaSource The media source. * @param mediaSource The media source.
* @returns _true_ if the media source is an HLS stream, _false_ otherwise. * @returns _true_ if the media source is an HLS stream, _false_ otherwise.
*/ */
export function isHls(mediaSource: MediaSourceInfo|null|undefined): boolean { export function isHls(mediaSource: MediaSourceInfo | null | undefined): boolean {
return mediaSource?.TranscodingSubProtocol?.toUpperCase() === 'HLS' return mediaSource?.TranscodingSubProtocol?.toUpperCase() === 'HLS'
|| mediaSource?.Container?.toUpperCase() === 'HLS'; || mediaSource?.Container?.toUpperCase() === 'HLS';
} }