mirror of
https://github.com/Wessel/pikmin.git
synced 2026-06-08 14:18:54 +02:00
Still gotta fix typings, temporary fix
This commit is contained in:
49
index.d.ts
vendored
49
index.d.ts
vendored
@@ -1,7 +1,6 @@
|
||||
import { WriteStream } from "fs";
|
||||
|
||||
declare namespace Pikmin
|
||||
{
|
||||
declare namespace Pikmin {
|
||||
export const loggers: Pikmin.Collection<Pikmin.instance>;
|
||||
export const version: string;
|
||||
export const colors: Pikmin.Colors;
|
||||
@@ -11,56 +10,30 @@ declare namespace Pikmin
|
||||
|
||||
export class instance {
|
||||
constructor(options?: Pikmin.InstanceOptions);
|
||||
|
||||
public log: {
|
||||
[x: string]: any;
|
||||
|
||||
__bound__: Console;
|
||||
}
|
||||
|
||||
/** The name of the instance */
|
||||
public name: string;
|
||||
|
||||
/** The base format */
|
||||
public baseFormat: string;
|
||||
|
||||
/** An array of transports */
|
||||
public transports: Pikmin.Transport[];
|
||||
|
||||
/**
|
||||
* Adds a transport
|
||||
* @param transport The transport to add
|
||||
* @param options Any options to bind
|
||||
*/
|
||||
public [x: string]: function(msg, ...args): void;
|
||||
public addTransport(transport: Pikmin.Transport, options?: { autogen: boolean }): void;
|
||||
}
|
||||
|
||||
export class Collection<T> extends Map<string | number, T>
|
||||
{
|
||||
export class Collection<T> extends Map<string | number, T> {
|
||||
public filter(i: (a: T) => boolean): T[];
|
||||
public map(i: (a: T) => any): T[];
|
||||
}
|
||||
|
||||
/**
|
||||
* The console transport that logs anything to the terminal
|
||||
*/
|
||||
export class ConsoleTransport implements Transport
|
||||
{
|
||||
export class ConsoleTransport implements Transport {
|
||||
constructor(options: Pikmin.InstanceOptions & { process: NodeJS.Process });
|
||||
|
||||
/** The type of the transport, implemented by the Transport interface */
|
||||
public type: 'CONSOLE' | 'WEBHOOK' | 'FILE';
|
||||
|
||||
/** The name of the transport, implemented by the Transport interface */
|
||||
public name: string;
|
||||
|
||||
/** The parent of the transport, implemented by the Transport interface; resolves by `undefined` */
|
||||
public parent: any | undefined;
|
||||
|
||||
/** The defaults of the transport, implemented by the Transport interface */
|
||||
public defaults: { inspect: boolean }
|
||||
public defaults: {
|
||||
inspect: boolean
|
||||
}
|
||||
|
||||
/** The NodeJS.Process tty, only to use Stdout#write */
|
||||
public process: NodeJS.Process;
|
||||
append(options: { inspect: boolean }, data: string): void;
|
||||
destroy(): this;
|
||||
@@ -70,19 +43,11 @@ declare namespace Pikmin
|
||||
{
|
||||
constructor(options: { file: string, flags?: '-a', format: string });
|
||||
|
||||
/** The type of the transport, implemented by the Transport interface */
|
||||
public type: 'CONSOLE' | 'WEBHOOK' | 'FILE';
|
||||
|
||||
/** The name of the transport, implemented by the Transport interface */
|
||||
public name: string;
|
||||
|
||||
/** The parent of the transport, implemented by the Transport interface; resolves by `undefined` */
|
||||
public parent: any | undefined;
|
||||
|
||||
/** The defaults of the transport, implemented by the Transport interface */
|
||||
public defaults: { inspect: boolean }
|
||||
|
||||
/** The write stream */
|
||||
public stream: WriteStream;
|
||||
append(options: { inspect: boolean }, data: string): void;
|
||||
destroy(): this;
|
||||
|
||||
Reference in New Issue
Block a user