peertube-plugin-livechat/shared/lib/types.ts

36 lines
724 B
TypeScript

type ChatType = 'disabled' | 'builtin-prosody' | 'builtin-converse' | 'external-uri'
type ConverseJSTheme = 'peertube' | 'default' | 'concord'
interface ProsodyListRoomsResultError {
ok: false
error: string
}
interface ProsodyListRoomsResultRoom {
jid: string
localpart: string
name: string
lang: string
description: string
lasttimestamp?: number
channel?: {
id: number
name: string
displayName: string
}
}
interface ProsodyListRoomsResultSuccess {
ok: true
rooms: ProsodyListRoomsResultRoom[]
}
type ProsodyListRoomsResult = ProsodyListRoomsResultError | ProsodyListRoomsResultSuccess
export {
ChatType,
ConverseJSTheme,
ProsodyListRoomsResult,
ProsodyListRoomsResultRoom
}