2022-10-24 18:29:15 -04:00
|
|
|
import { Message as OctoprintMessage } from './octoprint.js';
|
2019-09-20 15:46:05 -04:00
|
|
|
|
2021-11-04 23:28:21 -04:00
|
|
|
interface BaseMessage {
|
2019-09-20 15:46:05 -04:00
|
|
|
printer: string;
|
2021-11-04 23:28:21 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface StatusMessage extends BaseMessage {
|
|
|
|
kind: 'status';
|
|
|
|
msg: OctoprintMessage;
|
|
|
|
}
|
|
|
|
|
2022-10-24 18:06:15 -04:00
|
|
|
export type OctoprintColor =
|
|
|
|
| 'red'
|
|
|
|
| 'orange'
|
|
|
|
| 'yellow'
|
|
|
|
| 'green'
|
|
|
|
| 'blue'
|
|
|
|
| 'violet'
|
|
|
|
| 'black'
|
|
|
|
| 'white'
|
|
|
|
| 'default';
|
2021-11-04 23:28:21 -04:00
|
|
|
|
|
|
|
export interface SettingsMessage extends BaseMessage {
|
|
|
|
kind: 'settings';
|
|
|
|
name: string;
|
|
|
|
color: OctoprintColor;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type Message = StatusMessage | SettingsMessage;
|