summaryrefslogtreecommitdiff
path: root/src/apps/source.ts
blob: 66e8f06552462033e0cd112eb2c8feef9cbe7fba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { JSX } from "preact/jsx-runtime"

export interface Source {
    type: string,
}

export interface Listen extends Source {
    type: "listen"
}

export interface Address extends Source {
    type: "video" | "image" | "link",
    link: URL,
    pixelated?: boolean
}

export interface VirtualFile extends Source {
    name: string,
    height?: string | number,
    width?: string | number
}

export interface VirtualTextFile extends VirtualFile {
    type: "text",
    content: JSX.Element
}

export type Sources = Address | VirtualTextFile | Listen
export type SourceTypes = Sources["type"]
export type GetSource = {
    [SourceType in Sources as SourceType["type"]]: SourceType
}