export type DataEventCallback = (data: D) => void; export type ErrorEventCallback = (event: Error) => void; export interface PlatformEventEmitter extends NodeJS.EventEmitter { on(event: 'data', callback: DataEventCallback): this; on(event: 'end', callback: () => void): this; on(event: 'error', callback: ErrorEventCallback): this; once(event: 'data', callback: DataEventCallback): this; once(event: 'end', callback: () => void): this; once(event: 'error', callback: ErrorEventCallback): this; } export class PlatformApiError extends Error { constructor(message: string, readonly response: Response) { super(message); this.name = 'PlatformApiError'; } }