Skip to content

Commit 563e0b4

Browse files
committed
types: add type declaration for untyped express-logging
1 parent 10b297c commit 563e0b4

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/lib/functions/server.ts

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { IncomingHttpHeaders } from 'http'
44
import path from 'path'
55

66
import express, { type Request, type RequestHandler } from 'express'
7-
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'expr... Remove this comment to see the full error message
87
import expressLogging from 'express-logging'
98
import { jwtDecode } from 'jwt-decode'
109

types/express-logging/index.d.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
declare module 'express-logging' {
2+
import { RequestHandler } from 'express';
3+
4+
interface LoggerOptions {blacklist?: string[]}
5+
6+
interface Logger {
7+
info(...args: unknown[]): void;
8+
error(...args: unknown[]): void;
9+
warn(...args: unknown[]): void;
10+
debug?(...args: unknown[]): void;
11+
log(...args: unknown[]): void;
12+
}
13+
14+
function expressLogging(logger?: Logger, options?: LoggerOptions): RequestHandler;
15+
16+
export default expressLogging;
17+
}

0 commit comments

Comments
 (0)