nose-pluto/src/shared/types.ts

23 lines
578 B
TypeScript

export type Message = {
session?: string
id?: string
type: MessageType
data?: CommandResult | CommandOutput
}
export type MessageType = "error" | "input" | "output" | "commands" | "save-file"
| "game:start"
| "stream:start" | "stream:end" | "stream:append" | "stream:replace"
| "ui:mode"
export type CommandOutput = string | string[]
| { text: string, script?: string }
| { html: string, script?: string }
| { script: string }
| { game: string }
export type CommandResult = {
status: "ok" | "error"
output: CommandOutput
}