Added the log function to help TypeScript Users

This commit is contained in:
dondish
2019-08-18 19:06:19 +03:00
parent 32d9087ad1
commit 5ef41e82e4
2 changed files with 5 additions and 1 deletions

2
index.d.ts vendored
View File

@@ -14,7 +14,7 @@ declare namespace Pikmin {
public baseFormat: string;
public transports: Pikmin.Transport[];
public [x: string]: function(msg, ...args): void;
public log(type: string, msg: string, ...options): void;
public addTransport(transport: Pikmin.Transport, options?: { autogen: boolean }): void;
}

View File

@@ -54,6 +54,10 @@ module.exports = class PikminInstance {
Pikmin.loggers.set(this.name, this.__log__);
}
log(transportName, msg, ...args) {
this[transportName](msg, ...args)
}
addTransport(transport, options = { autogen: false }) {
const now = this._formatDate();