UNPKG

@isaac-platform/isaac-integration-sdk

Version:

A Typescript SDK for integrating with ISAAC

54 lines 1.64 kB
import { IsaacInstantPlayableType } from "./schedule/playables/types.js"; export interface HeartbeatResponse { queryTime: number; messages: HeartbeatMessage[]; } export type HeartbeatState = "uninitialized" | "starting" | "connected" | "disconnected" | "error"; export interface HeartbeatMessage { /** * The type of the message. One of "forcePlay", "forceStop", "previewPlay", "previewStop", or "identify" */ type: "forcePlay" | "forceStop" | "previewPlay" | "previewStop" | "identify"; /** * Unique ID of the message. */ uuid: string; /** * The contents of the message, this varies by type. */ payload: any; /** * ISO Date of message creation. */ createdAt: string; } export interface IdentifyMessage extends HeartbeatMessage { type: "identify"; payload: { topic: string; }; } export interface InstantPlayMessage extends HeartbeatMessage { type: "forcePlay"; zone: string; zoneId: number; playType: "once" | "infinite"; payload: { playable: IsaacInstantPlayableType; }; } export interface InstantStopMessage extends HeartbeatMessage { type: "forceStop"; zone: string; zoneId: number; payload: {}; } export interface HeartbeatEvents { forcePlay: (message: InstantPlayMessage) => void; forceStop: (message: InstantStopMessage) => void; previewPlay: (message: HeartbeatMessage) => void; previewStop: (message: HeartbeatMessage) => void; identify: (message: IdentifyMessage) => void; statusChange: (state: string) => void; } //# sourceMappingURL=heartbeatTypes.d.ts.map