Core type definitions for ComputerCraft TypeScript events and interactions

This module provides TypeScript type definitions for ComputerCraft's event system, peripheral interactions, and common data structures. It enables type-safe handling of ComputerCraft events and peripherals in TypeScript projects.

import { Events } from './types';

// Type-safe event handling
os.pullEvent<Events["mouse_click"]>("mouse_click").then(([button, x, y]) => {
console.log(`Mouse clicked at (${x}, ${y}) with button ${button}`);
});
import { Side } from './types';

function attachMonitor(side: Side) {
const monitor = peripheral.wrap<Monitor>(side);
monitor.clear();
monitor.write("Hello World!");
}

Interfaces

Events

Type Aliases

MouseButton
Side
TransferredFile
TransferredFiles