neko/src/types/state.ts
Miroslav Šedivý 869b27161b fullscreen.
2020-11-08 22:16:47 +01:00

72 lines
1.3 KiB
TypeScript

export default interface State {
connection: Connection
video: Video
control: Control
screen: Screen
member: Member
members: Member[]
}
/////////////////////////////
// Connection
/////////////////////////////
export interface Connection {
websocket: 'disconnected' | 'connecting' | 'connected'
webrtc: 'disconnected' | 'connecting' | 'connected'
type: 'webrtc' | 'fallback' | 'none'
can_watch: boolean
can_control: boolean
clipboard_access: boolean
}
/////////////////////////////
// Video
/////////////////////////////
export interface Video {
playable: boolean
playing: boolean
volume: number
}
/////////////////////////////
// Control
/////////////////////////////
export interface Control {
scroll: Scroll
host: Member | null
}
export interface Scroll {
inverse: boolean
sensitivity: number
}
/////////////////////////////
// Screen
/////////////////////////////
export interface Screen {
size: ScreenSize
configurations: ScreenSize[]
fullscreen: boolean
}
export interface ScreenSize {
width: number
height: number
rate: number
}
/////////////////////////////
// Member
/////////////////////////////
export interface Member {
id: string | null
name: string | null
is_admin: boolean
is_watching: boolean
is_controlling: boolean
can_watch: boolean
can_control: boolean
clipboard_access: boolean
}