@minecraft/creator-tools
Version:
Minecraft Creator Tools command line and libraries.
52 lines (51 loc) • 2.26 kB
TypeScript
import { EventDispatcher } from "ste-events";
export declare enum LogItemLevel {
debug = 0,
verbose = 1,
message = 2,
error = 3,
important = 4,
operationStarted = 10,
operationEnded = 11
}
export declare class LogItem {
level: LogItemLevel;
message: string;
created: Date;
operId?: number;
category?: string;
context?: string;
static alertFunction: ((message: string) => void) | undefined;
constructor(message: string, level: LogItemLevel, context?: string, category?: string);
}
export default class Log {
static _suppressedLogs: {
[id: string]: boolean;
};
static _log: LogItem[];
static _onItemAdded: EventDispatcher<Log, LogItem>;
static get items(): LogItem[];
static get onItemAdded(): import("ste-events").IEvent<Log, LogItem>;
static message(message: string, context?: string, category?: string): void;
static important(message: string, context?: string, category?: string): void;
static verbose(message: string, context?: string, category?: string): void;
static error(message: string, context?: string, category?: string): void;
static unexpectedUndefined(token?: string): void;
static unexpectedIsDisposed(token?: string): void;
static throwIsDisposed(token?: string): void;
static throwUnexpectedUndefined(token?: string): void;
static unexpectedNull(token?: string): void;
static unexpectedContentState(token?: string): void;
static unexpectedState(token?: string): void;
static unexpectedArguments(token?: string): void;
static log(message: string | object, level: LogItemLevel, context?: string, category?: string): number;
static debug(message: string, context?: string): void;
static assertIsInt(number: number, message?: string): void;
static getStack(): string;
static assert(condition: boolean, message?: string, context?: string): asserts condition;
static assertDefined(obj: any, message?: string): boolean;
static fail(message: string, context?: string): void;
static unsupportedToken(token: string, context?: string): void;
static unexpectedError(errorMessage: string, context?: string): void;
static debugAlert(message: string, context?: string): void;
}