-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #348 from Stremio/typings
Core Typings
- Loading branch information
Showing
38 changed files
with
551 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const useProfile: () => Profile; | ||
export = useProfile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const useStreamingServer: () => StreamingServer; | ||
export = useStreamingServer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare module '*'; | ||
declare module 'classnames'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const useInstalledAddons: (urlParams: UrlParams) => InstalledAddons; | ||
export = useInstalledAddons; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const useRemoteAddons: (urlParams: UrlParams) => RemoteAddons; | ||
export = useRemoteAddons; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const useBoard: () => [Board, ({ start, end }: { start: number, end: number }) => void]; | ||
export = useBoard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const useDiscover: (urlParams: UrlParams, searchParams: URLSearchParams) => [Discover, () => void]; | ||
export = useDiscover; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const useLibrary: (model: string, urlParams: UrlParams, searchParams: URLSearchParams) => Library; | ||
export = useLibrary; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const useMetaDetails: (urlParams: UrlParams) => MetaDetails; | ||
export = useMetaDetails; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const usePlayer: (urlParams: UrlParams, videoParams: any) => [Player, (time: number, duration: number, device: string) => void, (paused: boolean) => void, () => void, () => void]; | ||
export = usePlayer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const useSettings: () => [Settings, (settings: any) => void]; | ||
export = useSettings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const useSearch: (searchParams: URLSearchParams) => [Search, (range: number) => void]; | ||
export = useSearch; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare function Core(): Core; | ||
export = Core; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare function CoreTransport(): CoreTransport; | ||
export = CoreTransport; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
type CoreEvent = { | ||
name: string, | ||
args: any[], | ||
}; | ||
|
||
declare global { | ||
interface Window { | ||
onCoreEvent: (event: CoreEvent) => void; | ||
} | ||
} | ||
|
||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
type Action = { | ||
action: string, | ||
args?: { | ||
model?: string, | ||
action?: string, | ||
args?: any, | ||
} | ||
}; | ||
|
||
type AnalyticsEvent = { | ||
event: string, | ||
args: object, | ||
}; | ||
|
||
interface CoreTransport { | ||
start: (args: object) => Promise<void>, | ||
getState: (model: string) => Promise<object>, | ||
dispatch: (action: Action, model?: string) => Promise<void>, | ||
decodeStream: (stream: string) => Promise<Stream>, | ||
analytics: (event: AnalyticsEvent) => Promise<void>, | ||
on: (name: string, listener: () => void) => void, | ||
off: (name: string, listener: () => void) => void, | ||
} | ||
|
||
interface Core { | ||
active: boolean, | ||
transport: CoreTransport, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
type ServicesContext = { | ||
core: Core, | ||
shell: any, | ||
chromecast: any, | ||
keyboardShortcuts: any, | ||
dragAndDrop: any, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const useService: () => ServicesContext; | ||
export = useService; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
type AddonManifest = { | ||
id: string, | ||
version: string, | ||
name: string, | ||
description: string, | ||
contactEmail: string, | ||
logo: string, | ||
background: string, | ||
types: string[], | ||
}; | ||
|
||
type Addon = { | ||
installed: boolean, | ||
manifest: AddonManifest, | ||
transportUrl: string, | ||
}; | ||
|
||
type AddonsDeepLinks = { | ||
addons: string, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
type LibraryItemState = { | ||
lastWatched: string, | ||
timeWatched: number, | ||
timesWatched: number, | ||
flaggedWatched: number, | ||
overallTimeWatched: number, | ||
timeOffset: number, | ||
duration: number, | ||
video_id: string, | ||
watched: string, | ||
lastVidReleased: string, | ||
noNotif: boolean, | ||
}; | ||
|
||
type LibraryItem = { | ||
_id: string, | ||
name: string, | ||
type: string, | ||
poster: string, | ||
posterShape: PosterShape, | ||
removed: number, | ||
temp: number, | ||
_ctime: string, | ||
_mtime: number, | ||
state: LibraryItemState, | ||
behaviorHints: BehaviorHints, | ||
}; | ||
|
||
type LibraryItemDeepLinks = { | ||
metaDetailsVideos: string | null, | ||
metaDetailsStreams: string | null, | ||
player: string | null, | ||
externalPlayer: ExternalPlayerLinks | null, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
type Link = { | ||
name: string, | ||
category: string, | ||
url: string, | ||
}; | ||
|
||
type MetaItemPreview = { | ||
id: string, | ||
type: string, | ||
name: string, | ||
description: string | null, | ||
logo: string | null, | ||
background: string | null, | ||
poster: string | null, | ||
posterShape: PosterShape, | ||
releaseInfo: string | null, | ||
runtime: string | null, | ||
released: string | null, | ||
trailerStreams: TrailerStream[], | ||
links: Link[], | ||
behaviorHints: BehaviorHints, | ||
}; | ||
|
||
type MetaItem = MetaItemPreview & { | ||
videos: Video[], | ||
} | ||
|
||
type MetaItemDeepLinks = { | ||
metaDetailsVideos: string | null, | ||
metaDetailsStreams: string | null, | ||
player: string | null, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
type SelectableType<T> = { | ||
type: string, | ||
selected: boolean, | ||
deepLinks: T | ||
}; | ||
|
||
type SelectableSort<T> = { | ||
sort: string, | ||
selected: boolean, | ||
deepLinks: T | ||
}; | ||
|
||
type SelectableExtra<T> = { | ||
isRequired: boolean, | ||
name: string, | ||
options: { | ||
deepLinks: T, | ||
selected: boolean, | ||
value: string | null, | ||
} | ||
}; | ||
|
||
type SelectableCatalog<T> = { | ||
name: string, | ||
selected: boolean, | ||
deepLinks: T, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
type StreamDeepLinks = { | ||
player: string | null, | ||
externalPlayer: ExternalPlayerLinks, | ||
}; | ||
|
||
type Stream = { | ||
ytId?: string, | ||
name: string, | ||
description: string, | ||
infoHash?: string, | ||
fileIdx?: string, | ||
externalUrl?: string, | ||
deepLinks: { | ||
player: string, | ||
externalPlayer: ExternalPlayerLinks, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
type VideoDeepLinks = { | ||
metaDetailsStreams: string, | ||
player: string | null, | ||
externalPlayer: ExternalPlayerLinks | null, | ||
}; | ||
|
||
type Video = { | ||
id: string, | ||
title: string, | ||
overview: string | null, | ||
released: string | null, | ||
thumbnail: string | null, | ||
season?: number, | ||
episode?: number, | ||
streams: Stream[], | ||
trailerStreams: TrailerStream[], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
type Board = CatalogsWithExtra; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
type MetaItemPreviewCatalogsWithExtra = MetaItemPreview & { | ||
deepLinks: MetaItemDeepLinks, | ||
}; | ||
|
||
type CatalogsWithExtra = { | ||
catalogs: Catalog<Loadable<MetaItemPreviewCatalogsWithExtra[]>, DiscoverDeepLinks>[] | null, | ||
selected: { | ||
type: string | null, | ||
extra: [string, string][] | ||
} | null, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
type Auth = { | ||
key: string, | ||
user: { | ||
_id: string, | ||
avatar: string, | ||
email: string, | ||
trakt: { | ||
access_token: string, | ||
created_at: number, | ||
expires_in: number, | ||
}, | ||
}, | ||
}; | ||
|
||
type Settings = { | ||
audioLanguage: string, | ||
audioPassthrough: boolean, | ||
autoFrameRateMatching: boolean, | ||
bingeWatching: boolean, | ||
hardwareDecoding: boolean, | ||
interfaceLanguage: string, | ||
nextVideoNotificationDuration: number, | ||
playInBackground: boolean, | ||
playerType: string | null, | ||
secondaryAudioLanguage: string | null, | ||
secondarySubtitlesLanguage: string | null, | ||
seekTimeDuration: number, | ||
streamingServerUrl: string, | ||
streamingServerWarningDismissed: Date | null, | ||
subtitlesBackgroundColor: string, | ||
subtitlesBold: boolean, | ||
subtitlesFont: string, | ||
subtitlesLanguage: string, | ||
subtitlesOffset: number, | ||
subtitlesOutlineColor: string, | ||
subtitlesSize: number, | ||
subtitlesTextColor: string, | ||
}; | ||
|
||
type Profile = { | ||
auth: Auth | null, | ||
settings: Settings, | ||
}; | ||
|
||
type Ctx = { | ||
profile: Profile, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
type DiscoverDeepLinks = { | ||
discover: string, | ||
}; | ||
|
||
type MetaItemPreviewDiscover = MetaItemPreview & { | ||
inLibrary: boolean, | ||
deepLinks: MetaItemDeepLinks, | ||
}; | ||
|
||
type DiscoverCatalogOption<T> = SelectableCatalog<T> & { | ||
id: string, | ||
addon: Addon, | ||
}; | ||
|
||
type Discover = { | ||
catalog: Catalog<Loadable<MetaItemPreviewDiscover[]>> | null, | ||
selectable: { | ||
catalogs: DiscoverCatalogOption<DiscoverDeepLinks>, | ||
extra: SelectableExtra<DiscoverDeepLinks>[], | ||
types: SelectableType<DiscoverDeepLinks>[], | ||
nextPage: boolean, | ||
}, | ||
selected: { | ||
request: ResourceRequest, | ||
} | null, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
type InstalledAddons = { | ||
catalog: Addon[], | ||
selectable: { | ||
catalogs: SelectableCatalog<AddonsDeepLinks>[], | ||
types: SelectableType<AddonsDeepLinks>[], | ||
}, | ||
selected: { | ||
request: { | ||
type: string, | ||
} | ||
} | null, | ||
}; |
Oops, something went wrong.