Skip to content

Commit

Permalink
fix(types): export correct class type
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Dec 24, 2021
1 parent b703c55 commit 1261267
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
import * as http from "http";
import * as net from "net";

export default class Mitm {
disable(): void;
enable(): void;
on(event: Event, callback: Callback): void;
on(event: "connect", callback: SocketConnectCallback): void;
on(event: "connection", callback: SocketConnectionCallback): void;
on(event: "request", callback: HttpCallback): void;
}

interface SocketOptions {
port: number;
host?: string | undefined;
Expand Down Expand Up @@ -38,11 +47,3 @@ type HttpCallback = (
type Event = "connect" | "connection" | "request";

type Callback = SocketConnectCallback | SocketConnectionCallback | HttpCallback;

export default interface Mitm {
disable(): void;
on(event: Event, callback: Callback): void;
on(event: "connect", callback: SocketConnectCallback): void;
on(event: "connection", callback: SocketConnectionCallback): void;
on(event: "request", callback: HttpCallback): void;
}

0 comments on commit 1261267

Please sign in to comment.