-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
101 lines (87 loc) · 2.46 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/**
* Good Logs
* Copyright(c) 2024 Bally Lomibao
* MIT Licensed
*/
import { Request, Response, NextFunction } from 'express'
interface RequestExtended extends Request {
body: { [key: string]: string | undefined }
}
interface Env {
PRODUCTION: 'production'
DEVELOPMENT: 'development'
TEST: 'test'
}
declare namespace Goodlog {
/**
* Custom color for logging
* @param message
* @param color - @see - https://www.npmjs.com/package/colors
*/
function custom(color: any, ...message: string[]): void
/**
* log message to console
* @param message - message to log : default
*/
function log(...message: string[]): void
/**
* log message in type info
* @param message - message to log : type info
*/
function info(...message: string[]): void
/**
* log message in type warn
* @param message - message to log : type warn
*/
function warn(...message: string[]): void
/**
* log message in type array in a table
* @param message - message to log : type array/object
*/
function tbl(...message: any[]): void
/**
* log message in type error
* @param error - error message to log : type error
* @param tag - tag of the error
* @param target - target of the error
* @param args - additional arguments
* @return void
*/
function error(error: any, tag: string, target: string, ...args: any[]): void
/**
* log message in type debug
* @param message - message to log : type debug
*/
function debug(...message: string[]): void
/**
*
* @param port - server port
* @param apiRoot - api version
* @param env - status of the server environment
* @param isConnected - send the status of the server connection
* @return void
*/
// declare function server(
// port: number,
// apiRoot: string,
// isProd: boolean,
// isConnected: boolean
// ): void
function server(port: any, apiRoot: string, env: string, isConnected: boolean): void
/**
*
* @param req - request {IRequestExtended}
* @param res - response {Response}
* @param next - next {NextFunction}
* @return void
*/
function req(req: RequestExtended, res: Response, next: NextFunction): void
/**
* Preset log type for connection status update in the console
* @param db - connection call
* @param isConnected - send the status of the db connection
*/
function db(host: any, dbName: any, isConnected: boolean): void
}
declare const goodlog: typeof Goodlog
export = goodlog