Skip to content

Commit

Permalink
refactor: add typings for native-duplexpair (tediousjs#1459)
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurschreiber authored Jul 7, 2022
1 parent 20eedf6 commit 7d88b96
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/message-io.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const DuplexPair = require('native-duplexpair');
import DuplexPair from 'native-duplexpair';

import { Duplex } from 'stream';
import * as tls from 'tls';
Expand Down
12 changes: 12 additions & 0 deletions types/native-duplexpair.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
declare module 'native-duplexpair' {
import { Duplex } from 'stream';

class DuplexSocket extends Duplex { }

class DuplexPair {
socket1: DuplexSocket;
socket2: DuplexSocket;
}

export = DuplexPair;
}

0 comments on commit 7d88b96

Please sign in to comment.