mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[logstub] Add types (#45642)
This commit is contained in:
parent
46bfa5ff65
commit
85f74adbae
44
types/logstub/index.d.ts
vendored
Normal file
44
types/logstub/index.d.ts
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
// Type definitions for logstub 1.3
|
||||
// Project: https://github.com/OutOfSyncStudios/logstub#readme
|
||||
// Definitions by: Emily M Klassen <https://github.com/forivall>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = LogStub;
|
||||
|
||||
declare class LogStub {
|
||||
constructor(...args: any[]);
|
||||
|
||||
log(...args: any[]): void;
|
||||
|
||||
silly(...args: any[]): void;
|
||||
debug(...args: any[]): void;
|
||||
verbose(...args: any[]): void;
|
||||
info(...args: any[]): void;
|
||||
warn(...args: any[]): void;
|
||||
error(...args: any[]): void;
|
||||
|
||||
assert(...args: any[]): void;
|
||||
clear(...args: any[]): void;
|
||||
count(...args: any[]): void;
|
||||
countReset(...args: any[]): void;
|
||||
dir(...args: any[]): void;
|
||||
dirxml(...args: any[]): void;
|
||||
group(...args: any[]): void;
|
||||
groupCollapsed(...args: any[]): void;
|
||||
groupEnd(...args: any[]): void;
|
||||
table(...args: any[]): void;
|
||||
time(...args: any[]): void;
|
||||
timeEnd(...args: any[]): void;
|
||||
timeLog(...args: any[]): void;
|
||||
|
||||
fatal(...args: any[]): void;
|
||||
trace(...args: any[]): void;
|
||||
all(...args: any[]): void;
|
||||
|
||||
critical(...args: any[]): void;
|
||||
|
||||
child(
|
||||
...args: any[]
|
||||
): Pick<this, 'debug'| 'info' | 'warn' | 'error' | 'child' | 'level'>;
|
||||
level(...args: any[]): number;
|
||||
}
|
||||
8
types/logstub/logstub-tests.ts
Normal file
8
types/logstub/logstub-tests.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import LogStub = require('logstub');
|
||||
|
||||
// Ensure type compatability with bunyan
|
||||
// tslint:disable-next-line: no-object-literal-type-assertion
|
||||
const bunyanStub: Pick<LogStub, Extract<keyof import('bunyan'), keyof LogStub>> = {} as import('bunyan');
|
||||
|
||||
// Ensure type compatability with console
|
||||
const consoleStub: Pick<Console, Extract<keyof Console, keyof LogStub>> = console;
|
||||
23
types/logstub/tsconfig.json
Normal file
23
types/logstub/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"logstub-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/logstub/tslint.json
Normal file
1
types/logstub/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user