UNPKG

@throw-out-error/minecraft-mcfunction

Version:

A simple way to create your mcfunction files using Typescript syntax.

26 lines (25 loc) 945 B
/// <reference types="node" /> import { EventEmitter } from 'events'; import { Command } from '../commands'; import { McFunction } from '..'; interface TranspilerEvents { command: [Command]; 'function:start': []; 'function:end': Parameters<Transpiler['endFunction']>; } export interface Transpiler { on<K extends keyof TranspilerEvents>(type: K, listener: (...args: TranspilerEvents[K]) => void): this; emit<K extends keyof TranspilerEvents>(type: K, ...args: TranspilerEvents[K]): boolean; } export declare class Transpiler extends EventEmitter { #private; static running?: Transpiler; static emit<T extends keyof TranspilerEvents>(type: T, ...args: TranspilerEvents[T]): boolean | undefined; constructor(); private endFunction; transpile(source: () => void, name?: string): { rootFunction: McFunction; functions: Map<string, McFunction>; }; } export {};