@isaac-platform/isaac-integration-sdk
Version:
A Typescript SDK for integrating with ISAAC
50 lines • 1.99 kB
TypeScript
import * as isaacBlocks from "./blocks/index.js";
import * as isaacPlaylists from "./playlists/index.js";
import * as isaacEvents from "./events/index.js";
import * as isaacPlayables from "./playables/index.js";
import { EventEmitter } from "events";
import { IsaacScheduleEntryType, IsaacScheduleType, ScheduleEvents } from "./types.js";
export declare class ScheduleController extends EventEmitter {
private pollingInterval;
private windowInterval;
private updateCount;
private beforeCount;
private afterCount;
private timeWindow;
blocks: isaacBlocks.blockController;
playlists: isaacPlaylists.playlistController;
events: isaacEvents.EventController;
playables: isaacPlayables.PlayableController;
scheduleData: IsaacScheduleType | null;
private pollScheduleInterval;
private scheduleWindowUpdateInterval;
running: boolean;
upNext: IsaacScheduleEntryType[];
timeoutStack: Map<string, NodeJS.Timeout>;
constructor();
/**
* Starts automatic scheduleData updates and ticks
*/
start: () => void;
/**
* Stops automatic scheduleData updates and ticks
*/
stop: () => void;
/**
* Retrieves the latest scheduleData from ISAAC, caches it in this.scheduleData, and emits the scheduleData
*/
getSchedule: () => Promise<IsaacScheduleType>;
/**
* Updates the scheduleData if there has been any change since the last retrieval.
*/
updateSchedule: () => Promise<IsaacScheduleType>;
/**
* Processes the currently loaded scheduleData
*/
updateWindow: () => Promise<void>;
handleEntryStart: (entry: IsaacScheduleEntryType) => Promise<void>;
emit<K extends keyof ScheduleEvents>(event: K, ...args: Parameters<ScheduleEvents[K]>): boolean;
on<K extends keyof ScheduleEvents>(event: K, listener: ScheduleEvents[K]): this;
off<K extends keyof ScheduleEvents>(event: K, listener: ScheduleEvents[K]): this;
}
//# sourceMappingURL=index.d.ts.map