refactor(types): use type instead of interface

This commit is contained in:
Tim 2023-04-12 18:40:22 +02:00
parent 2483583454
commit 9cc81ac4c9
8 changed files with 23 additions and 23 deletions

View file

@ -21,7 +21,7 @@ type MetaItemPreview = {
behaviorHints: BehaviorHints,
};
interface MetaItem extends MetaItemPreview {
type MetaItem = MetaItemPreview & {
videos: Video[],
}

View file

@ -2,7 +2,7 @@
type StreamDeepLinks = {
player: string | null,
externalPlayer: ExternalPlayerLinks,
}
};
type Stream = {
ytId?: string,

View file

@ -1,6 +1,6 @@
interface MetaItemPreviewCatalogsWithExtra extends MetaItemPreview {
type MetaItemPreviewCatalogsWithExtra = MetaItemPreview & {
deepLinks: MetaItemDeepLinks,
}
};
type CatalogsWithExtra = {
catalogs: Catalog<Loadable<MetaItemPreviewCatalogsWithExtra[]>, DiscoverDeepLinks>[] | null,

View file

@ -2,15 +2,15 @@ type DiscoverDeepLinks = {
discover: string,
};
interface MetaItemPreviewDiscover extends MetaItemPreview {
type MetaItemPreviewDiscover = MetaItemPreview & {
inLibrary: boolean,
deepLinks: MetaItemDeepLinks,
}
};
interface DiscoverCatalogOption<T> extends SelectableCatalog<T> {
type DiscoverCatalogOption<T> = SelectableCatalog<T> & {
id: string,
addon: Addon,
}
};
type Discover = {
catalog: Catalog<Loadable<MetaItemPreviewDiscover[]>> | null,

View file

@ -1,11 +1,11 @@
interface LibraryItemLibrary extends LibraryItem {
type LibraryItemLibrary = LibraryItem & {
progress: number,
deepLinks: LibraryItemDeepLinks,
}
};
type LibraryDeepLinks = {
library: string,
}
};
type LibraryPage = {
deepLinks: LibraryDeepLinks,

View file

@ -1,8 +1,8 @@
interface MetaItemMetaDetails extends MetaItem {
type MetaItemMetaDetails = MetaItem & {
inLibrary: boolean,
watched: boolean,
deepLinks: MetaItemDeepLinks,
}
};
type MetaDetails = {
metaExtensions: {

View file

@ -1,22 +1,22 @@
interface PlayerVideo extends Video {
type PlayerVideo = Video & {
upcomming: boolean,
watched: boolean,
progress: boolean | null,
scheduled: boolean,
deepLinks: VideoDeepLinks,
}
};
interface PlayerMetaItem extends Video {
type PlayerMetaItem = Video & {
videos: PlayerVideo[],
}
};
interface NextVideo extends Video {
type NextVideo = Video & {
deepLinks: VideoDeepLinks,
}
};
interface SelectedStream extends Stream {
type SelectedStream = Stream & {
deepLinks: StreamDeepLinks,
}
};
type Subtitle = {
id: string,

View file

@ -1,6 +1,6 @@
interface UrlParams extends Record<string, string> {
type UrlParams = Record<string, string> & {
path: string,
}
};
type LoadableError = string | {
type: string,