-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a22c34
commit 43625f2
Showing
4 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Duplex, DuplexEvents } from 'bare-stream' | ||
import constants from './lib/constants' | ||
import TLSError from './lib/errors' | ||
|
||
export { constants, TLSError as errors } | ||
|
||
export interface TLSSocketEvents extends DuplexEvents { | ||
connect: [] | ||
} | ||
|
||
export interface TLSSocketOptions { | ||
allowHalfOpen?: boolean | ||
cert?: ArrayBufferView | ||
eagerOpen?: boolean | ||
host?: string | ||
isServer?: boolean | ||
key?: ArrayBufferView | ||
} | ||
|
||
export interface TLSSocket<M extends TLSSocketEvents> extends Duplex<M> { | ||
readonly socket: Duplex | ||
readonly encrypted: true | ||
} | ||
|
||
export class TLSSocket<M extends TLSSocketEvents> extends Duplex<M> { | ||
constructor(socket: Duplex, opts?: TLSSocketOptions) | ||
} | ||
|
||
export { TLSSocket as Socket } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
declare const constants: { state: { HANDSHAKE: number } } | ||
|
||
export = constants |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare class TLSError extends Error { | ||
static from(err: Error): TLSError | ||
} | ||
|
||
export = TLSError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters