typescriptify Popupbase

focus textfield on filterclick
This commit is contained in:
2021-01-22 21:05:21 +00:00
parent 66eb72d7fb
commit 6c7cc11038
29 changed files with 303 additions and 190 deletions

66
src/types/ApiTypes.ts Normal file
View File

@ -0,0 +1,66 @@
import {ActorType, TagType} from './VideoTypes';
export namespace VideoTypes{
export interface loadVideoType {
movie_url: string
thumbnail: string
movie_id: number
movie_name: string
likes: number
quality: number
length: number
tags: TagType[]
suggesttag: TagType[]
actors: ActorType[]
}
export interface startDataType{
total: number;
fullhd: number;
hd: number;
sd: number;
tags: number;
}
export interface VideoUnloadedType {
movie_id: number;
movie_name: string
}
}
export namespace SettingsTypes{
export interface initialApiCallData {
DarkMode: boolean;
passwordEnabled: boolean;
mediacenter_name: string;
}
export interface loadGeneralSettingsType{
video_path: string,
episode_path: string,
mediacenter_name: string,
password: string,
passwordEnabled: boolean,
TMDB_grabbing: boolean,
videonr: number,
dbsize: number,
difftagnr: number,
tagsadded: number
}
export interface getStatusMessageType{
contentAvailable: boolean;
message: string;
}
}
export namespace ActorTypes{
/**
* result of actor fetch
*/
export interface videofetchresult {
videos: VideoTypes.VideoUnloadedType[];
info: ActorType;
}
}

16
src/types/GeneralTypes.ts Normal file
View File

@ -0,0 +1,16 @@
import {TagType} from './VideoTypes';
export interface GeneralSuccess {
result: string
}
interface TagarrayType {
[_: string]: TagType
}
export const DefaultTags: TagarrayType = {
all: {tag_id: 1, tag_name: 'all'},
fullhd: {tag_id: 2, tag_name: 'fullhd'},
lowq: {tag_id: 3, tag_name: 'lowquality'},
hd: {tag_id: 4, tag_name: 'hd'}
};

15
src/types/VideoTypes.ts Normal file
View File

@ -0,0 +1,15 @@
/**
* type accepted by Tag component
*/
export interface TagType {
tag_name: string
tag_id: number
}
export interface ActorType {
thumbnail: string;
name: string;
actor_id: number;
}