Skip to content

Commit 7728de1

Browse files
committed
add handshake to EndOfEarlyData
1 parent 77d3aaf commit 7728de1

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tls/enum",
3-
"version": "0.5.1",
3+
"version": "0.5.2",
44
"exports": "./src/mod.ts",
55
"publish": {
66
"exclude": ["dist/"]

src/handshaketype.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ export class EndOfEarlyData extends Uint8Array {
143143
constructor(){
144144
super()
145145
}
146+
handshake(){ return HandshakeType.handshake(this)}
146147
}
147148

148149
// npx -p typescript tsc ./src/handshaketype.js --declaration --allowJs --emitDeclarationOnly --lib ESNext --outDir ./dist

type/handshaketype.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,24 @@ export declare class Handshake extends Uint8Array {
137137
*/
138138
tlsInnerPlaintext(numZeros: number): Uint8Array;
139139
}
140+
141+
declare class EndOfEarlyData extends Uint8Array {
142+
/**
143+
* Creates an `EndOfEarlyData` instance from a handshake array.
144+
* @param array - The array containing handshake data.
145+
* @returns An `EndOfEarlyData` instance if the type matches,
146+
* otherwise throws a `TypeError` with the expected type.
147+
*/
148+
static fromHandshake(array: Uint8Array): EndOfEarlyData | TypeError;
149+
150+
/**
151+
* Constructs an empty `EndOfEarlyData` instance.
152+
*/
153+
constructor();
154+
155+
/**
156+
* Processes and retrieves handshake information for the `EndOfEarlyData` instance.
157+
* @returns The result of the handshake process.
158+
*/
159+
handshake(): Handshake;
160+
}

0 commit comments

Comments
 (0)