boxcast-playlist/types.d.ts
2022-04-26 10:39:25 -04:00

47 lines
1.2 KiB
TypeScript

namespace Boxcast
{
type Broadcast =
{
account_id:string
channel_id:string
description:string
id:string
name:string
poster:string
preview:string
starts_at:string
stops_at:string
tags:Array<string>
timeframe: "future" | "preroll" | "current" | "past"
start?: Date
stop?: Date
}
type Date =
{
Zone: string | RegExpMatchArray
Day: "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | string
Month: "January" | "February" | "March" | "April" | "May" | "June" | "July" | "August" | "September" | "October" | "November" | "December" | string
Date: number
Hours: number
Minutes: string | number
M?: "AM" | "PM",
Epoch: number
}
type StateBinding<T> = [T, (item:T)=>void];
}
namespace Store
{
type State =
{
Channel:string,
List:Array<Boxcast.Broadcast>,
Active:false | Boxcast.Broadcast
}
type Action = ["ping-out"] | ["ping-back", Array<Boxcast.Broadcast>] | ["select", Boxcast.Broadcast]
type Reducer = (inState:State, inAction:Action) => inState
}