@fails-components/webtransport 0.0.9 → 0.1.0-macarmbuild.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CMakeLists.txt +110 -73
  2. package/build.js +32 -8
  3. package/dist/lib/client.d.ts +74 -0
  4. package/dist/lib/client.d.ts.map +1 -0
  5. package/dist/lib/dom.d.ts +70 -0
  6. package/dist/lib/dom.d.ts.map +1 -0
  7. package/dist/lib/event-loop.d.ts +26 -0
  8. package/dist/lib/event-loop.d.ts.map +1 -0
  9. package/dist/lib/index.d.ts +79 -0
  10. package/dist/lib/index.d.ts.map +1 -0
  11. package/dist/lib/native.d.ts +2 -0
  12. package/dist/lib/native.d.ts.map +1 -0
  13. package/dist/lib/server.d.ts +75 -0
  14. package/dist/lib/server.d.ts.map +1 -0
  15. package/dist/lib/session.d.ts +221 -0
  16. package/dist/lib/session.d.ts.map +1 -0
  17. package/dist/lib/stream.d.ts +116 -0
  18. package/dist/lib/stream.d.ts.map +1 -0
  19. package/dist/lib/transport.d.ts +25 -0
  20. package/dist/lib/transport.d.ts.map +1 -0
  21. package/dist/lib/types.d.ts +157 -0
  22. package/dist/lib/types.d.ts.map +1 -0
  23. package/dist/lib/utils.d.ts +6 -0
  24. package/dist/lib/utils.d.ts.map +1 -0
  25. package/dist/lib/webtransport.d.ts +35 -0
  26. package/dist/lib/webtransport.d.ts.map +1 -0
  27. package/dist/test/bidirectional-streams.spec.d.ts +5 -0
  28. package/dist/test/bidirectional-streams.spec.d.ts.map +1 -0
  29. package/dist/test/datagrams.spec.d.ts +5 -0
  30. package/dist/test/datagrams.spec.d.ts.map +1 -0
  31. package/dist/test/echoclient.d.ts +2 -0
  32. package/dist/test/echoclient.d.ts.map +1 -0
  33. package/dist/test/echoserver.d.ts +2 -0
  34. package/dist/test/echoserver.d.ts.map +1 -0
  35. package/dist/test/event-loop.spec.d.ts +2 -0
  36. package/dist/test/event-loop.spec.d.ts.map +1 -0
  37. package/dist/test/fixtures/certificate.d.ts +21 -0
  38. package/dist/test/fixtures/certificate.d.ts.map +1 -0
  39. package/dist/test/fixtures/chai.d.ts +2 -0
  40. package/dist/test/fixtures/chai.d.ts.map +1 -0
  41. package/dist/test/fixtures/read-stream.d.ts +10 -0
  42. package/dist/test/fixtures/read-stream.d.ts.map +1 -0
  43. package/dist/test/fixtures/reader-value.d.ts +7 -0
  44. package/dist/test/fixtures/reader-value.d.ts.map +1 -0
  45. package/dist/test/fixtures/server.d.ts +10 -0
  46. package/dist/test/fixtures/server.d.ts.map +1 -0
  47. package/dist/test/fixtures/write-stream.d.ts +10 -0
  48. package/dist/test/fixtures/write-stream.d.ts.map +1 -0
  49. package/dist/test/test.d.ts +2 -0
  50. package/dist/test/test.d.ts.map +1 -0
  51. package/dist/test/testsuite.d.ts +25 -0
  52. package/dist/test/testsuite.d.ts.map +1 -0
  53. package/dist/test/unidirectional-streams.spec.d.ts +5 -0
  54. package/dist/test/unidirectional-streams.spec.d.ts.map +1 -0
  55. package/lib/client.js +163 -0
  56. package/lib/dom.ts +95 -0
  57. package/lib/event-loop.js +79 -0
  58. package/lib/index.js +33 -0
  59. package/lib/native.js +25 -0
  60. package/lib/server.js +165 -0
  61. package/lib/session.js +422 -0
  62. package/lib/stream.js +325 -0
  63. package/lib/transport.js +42 -0
  64. package/lib/types.ts +181 -0
  65. package/lib/utils.js +22 -0
  66. package/lib/webtransport.js +114 -0
  67. package/package.json +18 -6
  68. package/readme.md +28 -5
  69. package/src/http3client.h +0 -1
  70. package/src/http3eventloop.cc +52 -0
  71. package/src/http3eventloop.h +22 -1
  72. package/src/http3server.cc +4 -1
  73. package/src/http3server.h +8 -0
  74. package/src/http3serversession.h +1 -1
  75. package/test/bidirectional-streams.spec.js +138 -0
  76. package/test/datagrams.spec.js +132 -0
  77. package/test/echoclient.js +10 -6
  78. package/test/echoserver.js +6 -8
  79. package/test/event-loop.spec.js +24 -0
  80. package/test/{certificate.js → fixtures/certificate.js} +31 -15
  81. package/test/fixtures/chai.js +6 -0
  82. package/test/fixtures/read-stream.js +36 -0
  83. package/test/fixtures/reader-value.js +24 -0
  84. package/test/fixtures/server.js +58 -0
  85. package/test/fixtures/write-stream.js +17 -0
  86. package/test/test.js +29 -3
  87. package/test/testsuite.js +22 -0
  88. package/test/unidirectional-streams.spec.js +128 -0
  89. package/tsconfig.json +40 -0
  90. package/src/webtransport.js +0 -870
package/CMakeLists.txt CHANGED
@@ -18,6 +18,27 @@ set(BUILD_TESTING OFF)
18
18
 
19
19
  set(protobuf_BUILD_PROTOC_BINARIES ON)
20
20
 
21
+
22
+ IF( NOT WIN32)
23
+ IF(APPLE)
24
+ IF(DEFINED ENV{LOCALHOMEWBREWICU})
25
+ MESSAGE(STATUS "Local homebrew icu detected")
26
+ MESSAGE(STATUS $ENV{LOCALHOMEWBREWICU})
27
+ SET(ICU_ROOT $ENV{LOCALHOMEWBREWICU})
28
+ ELSE()
29
+ IF(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
30
+ MESSAGE(STATUS "set icu root local")
31
+ SET(ICU_ROOT "/usr/local/opt/icu4c")
32
+ ELSE()
33
+ MESSAGE(STATUS "set icu root homebrew")
34
+ SET(ICU_ROOT "/opt/homebrew/icu4c")
35
+ ENDIF()
36
+ ENDIF()
37
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
38
+ ENDIF(APPLE)
39
+ find_package(ICU COMPONENTS uc i18n REQUIRED)
40
+ ENDIF(NOT WIN32)
41
+
21
42
  IF (WIN32)
22
43
  add_compile_definitions(NOMINMAX)
23
44
  ENDIF(WIN32)
@@ -35,6 +56,9 @@ add_subdirectory(third_party/libevent EXCLUDE_FROM_ALL)
35
56
  SET(protobuf_WITH_ZLIB OFF CACHE BOOL "Build with zlib support")
36
57
  SET(protobuf_BUILD_TESTS OFF CACHE BOOL "Build tests")
37
58
  add_subdirectory(third_party/protobuf EXCLUDE_FROM_ALL)
59
+ IF(APPLE)
60
+ set_target_properties(protoc libprotoc libprotobuf PROPERTIES OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "Build architectures for Mac OS X" FORCE )
61
+ ENDIF(APPLE)
38
62
 
39
63
  IF (WIN32)
40
64
  add_compile_definitions(WIN32_LEAN_AND_MEAN NOGDI)
@@ -68,74 +92,78 @@ endif(COMMAND cmake_policy)
68
92
 
69
93
  add_compile_definitions(QUICHE_ENABLE_LIBEVENT)
70
94
 
95
+
96
+ IF (WIN32)
97
+
71
98
  add_library(icu STATIC
72
99
  #icu
73
- third_party/icu/icu4c/source/common/appendable.cpp
74
- third_party/icu/icu4c/source/common/bytestream.cpp
75
- third_party/icu/icu4c/source/common/bytesinkutil.cpp
76
- third_party/icu/icu4c/source/common/bytestrie.cpp
77
- third_party/icu/icu4c/source/common/bmpset.cpp
78
- third_party/icu/icu4c/source/common/charstr.cpp
79
- third_party/icu/icu4c/source/common/cmemory.cpp
80
- third_party/icu/icu4c/source/common/cstring.cpp
81
- third_party/icu/icu4c/source/common/edits.cpp
82
- third_party/icu/icu4c/source/common/locavailable.cpp
83
- third_party/icu/icu4c/source/common/localebuilder.cpp
84
- third_party/icu/icu4c/source/common/locid.cpp
85
- third_party/icu/icu4c/source/common/locmap.cpp
86
- third_party/icu/icu4c/source/common/loclikely.cpp
87
- third_party/icu/icu4c/source/common/loadednormalizer2impl.cpp
88
- third_party/icu/icu4c/source/common/normalizer2.cpp
89
- third_party/icu/icu4c/source/common/normalizer2impl.cpp
90
- third_party/icu/icu4c/source/common/patternprops.cpp
91
- third_party/icu/icu4c/source/common/propname.cpp
92
- third_party/icu/icu4c/source/common/punycode.cpp
93
- third_party/icu/icu4c/source/common/resource.cpp
94
- third_party/icu/icu4c/source/common/stringpiece.cpp
95
- third_party/icu/icu4c/source/common/uarrsort.cpp
96
- third_party/icu/icu4c/source/common/ubidi_props.cpp
97
- third_party/icu/icu4c/source/common/uchar.cpp
98
- third_party/icu/icu4c/source/common/ucmndata.cpp
99
- third_party/icu/icu4c/source/common/ucln_cmn.cpp
100
- third_party/icu/icu4c/source/common/ucptrie.cpp
101
- third_party/icu/icu4c/source/common/ucol_swp.cpp
102
- third_party/icu/icu4c/source/common/udata.cpp
103
- third_party/icu/icu4c/source/common/udatamem.cpp
104
- third_party/icu/icu4c/source/common/udataswp.cpp
105
- third_party/icu/icu4c/source/common/uenum.cpp
106
- third_party/icu/icu4c/source/common/uhash.cpp
107
- third_party/icu/icu4c/source/common/uloc.cpp
108
- third_party/icu/icu4c/source/common/uloc_tag.cpp
109
- third_party/icu/icu4c/source/common/uloc_keytype.cpp
110
- third_party/icu/icu4c/source/common/umapfile.cpp
111
- third_party/icu/icu4c/source/common/umath.cpp
112
- third_party/icu/icu4c/source/common/umutablecptrie.cpp
113
- third_party/icu/icu4c/source/common/umutex.cpp
114
- third_party/icu/icu4c/source/common/unistr.cpp
115
- third_party/icu/icu4c/source/common/unifilt.cpp
116
- third_party/icu/icu4c/source/common/unifunct.cpp
117
- third_party/icu/icu4c/source/common/unisetspan.cpp
118
- third_party/icu/icu4c/source/common/ustring.cpp
119
- third_party/icu/icu4c/source/common/ustrtrns.cpp
120
- third_party/icu/icu4c/source/common/ustrenum.cpp
121
- third_party/icu/icu4c/source/common/uscript_props.cpp
122
- third_party/icu/icu4c/source/common/util.cpp
123
- third_party/icu/icu4c/source/common/uts46.cpp
124
- third_party/icu/icu4c/source/common/uobject.cpp
125
- third_party/icu/icu4c/source/common/uinvchar.cpp
126
- third_party/icu/icu4c/source/common/uresbund.cpp
127
- third_party/icu/icu4c/source/common/uresdata.cpp
128
- third_party/icu/icu4c/source/common/uniset.cpp
129
- third_party/icu/icu4c/source/common/utf_impl.cpp
130
- third_party/icu/icu4c/source/common/utrace.cpp
131
- third_party/icu/icu4c/source/common/utrie2.cpp
132
- third_party/icu/icu4c/source/common/utrie_swap.cpp
133
- third_party/icu/icu4c/source/common/utypes.cpp
134
- third_party/icu/icu4c/source/common/uvector.cpp
135
- third_party/icu/icu4c/source/common/putil.cpp
136
- )
137
- target_include_directories(icu PUBLIC third_party/icu/icu4c/source/common)
138
- IF (WIN32)
100
+ third_party/icu/icu4c/source/common/appendable.cpp
101
+ third_party/icu/icu4c/source/common/bytestream.cpp
102
+ third_party/icu/icu4c/source/common/bytesinkutil.cpp
103
+ third_party/icu/icu4c/source/common/bytestrie.cpp
104
+ third_party/icu/icu4c/source/common/bmpset.cpp
105
+ third_party/icu/icu4c/source/common/charstr.cpp
106
+ third_party/icu/icu4c/source/common/cmemory.cpp
107
+ third_party/icu/icu4c/source/common/cstring.cpp
108
+ third_party/icu/icu4c/source/common/edits.cpp
109
+ third_party/icu/icu4c/source/common/locavailable.cpp
110
+ third_party/icu/icu4c/source/common/localebuilder.cpp
111
+ third_party/icu/icu4c/source/common/locid.cpp
112
+ third_party/icu/icu4c/source/common/locmap.cpp
113
+ third_party/icu/icu4c/source/common/loclikely.cpp
114
+ third_party/icu/icu4c/source/common/loadednormalizer2impl.cpp
115
+ third_party/icu/icu4c/source/common/normalizer2.cpp
116
+ third_party/icu/icu4c/source/common/normalizer2impl.cpp
117
+ third_party/icu/icu4c/source/common/patternprops.cpp
118
+ third_party/icu/icu4c/source/common/propname.cpp
119
+ third_party/icu/icu4c/source/common/punycode.cpp
120
+ third_party/icu/icu4c/source/common/resource.cpp
121
+ third_party/icu/icu4c/source/common/stringpiece.cpp
122
+ third_party/icu/icu4c/source/common/uarrsort.cpp
123
+ third_party/icu/icu4c/source/common/ubidi_props.cpp
124
+ third_party/icu/icu4c/source/common/uchar.cpp
125
+ third_party/icu/icu4c/source/common/ucmndata.cpp
126
+ third_party/icu/icu4c/source/common/ucln_cmn.cpp
127
+ third_party/icu/icu4c/source/common/ucptrie.cpp
128
+ third_party/icu/icu4c/source/common/ucol_swp.cpp
129
+ third_party/icu/icu4c/source/common/udata.cpp
130
+ third_party/icu/icu4c/source/common/udatamem.cpp
131
+ third_party/icu/icu4c/source/common/udataswp.cpp
132
+ third_party/icu/icu4c/source/common/uenum.cpp
133
+ third_party/icu/icu4c/source/common/uhash.cpp
134
+ third_party/icu/icu4c/source/common/uloc.cpp
135
+ third_party/icu/icu4c/source/common/uloc_tag.cpp
136
+ third_party/icu/icu4c/source/common/uloc_keytype.cpp
137
+ third_party/icu/icu4c/source/common/umapfile.cpp
138
+ third_party/icu/icu4c/source/common/umath.cpp
139
+ third_party/icu/icu4c/source/common/umutablecptrie.cpp
140
+ third_party/icu/icu4c/source/common/umutex.cpp
141
+ third_party/icu/icu4c/source/common/unistr.cpp
142
+ third_party/icu/icu4c/source/common/unifilt.cpp
143
+ third_party/icu/icu4c/source/common/unifunct.cpp
144
+ third_party/icu/icu4c/source/common/unisetspan.cpp
145
+ third_party/icu/icu4c/source/common/ustring.cpp
146
+ third_party/icu/icu4c/source/common/ustrtrns.cpp
147
+ third_party/icu/icu4c/source/common/ustrenum.cpp
148
+ third_party/icu/icu4c/source/common/uscript_props.cpp
149
+ third_party/icu/icu4c/source/common/util.cpp
150
+ third_party/icu/icu4c/source/common/uts46.cpp
151
+ third_party/icu/icu4c/source/common/uobject.cpp
152
+ third_party/icu/icu4c/source/common/uinvchar.cpp
153
+ third_party/icu/icu4c/source/common/uresbund.cpp
154
+ third_party/icu/icu4c/source/common/uresdata.cpp
155
+ third_party/icu/icu4c/source/common/uniset.cpp
156
+ third_party/icu/icu4c/source/common/utf_impl.cpp
157
+ third_party/icu/icu4c/source/common/utrace.cpp
158
+ third_party/icu/icu4c/source/common/utrie2.cpp
159
+ third_party/icu/icu4c/source/common/utrie_swap.cpp
160
+ third_party/icu/icu4c/source/common/utypes.cpp
161
+ third_party/icu/icu4c/source/common/uvector.cpp
162
+ third_party/icu/icu4c/source/common/putil.cpp
163
+ )
164
+ target_include_directories(icu
165
+ PUBLIC third_party/icu/icu4c/source/common
166
+ )
139
167
  target_sources(icu PRIVATE
140
168
  third_party/icu/icu4c/source/common/wintz.cpp
141
169
  )
@@ -143,13 +171,14 @@ IF (WIN32)
143
171
  #hack since this function is not currently used
144
172
  ICU_DATA_DIR_WINDOWS=""
145
173
  )
146
- ENDIF(WIN32)
147
174
 
148
- target_compile_definitions(icu
149
- PRIVATE U_DEFINE_FALSE_AND_TRUE=1
150
- U_STATIC_IMPLEMENTATION
151
- U_COMMON_IMPLEMENTATION
152
- )
175
+ target_compile_definitions(icu
176
+ PRIVATE U_DEFINE_FALSE_AND_TRUE=1
177
+ U_STATIC_IMPLEMENTATION
178
+ U_COMMON_IMPLEMENTATION
179
+ )
180
+
181
+ ENDIF(WIN32)
153
182
 
154
183
  add_library(gquiche STATIC
155
184
  #plattform impl
@@ -896,6 +925,7 @@ ELSE(WIN32)
896
925
  )
897
926
  ENDIF(WIN32)
898
927
 
928
+
899
929
  add_custom_command(
900
930
  OUTPUT
901
931
  ${CMAKE_CURRENT_SOURCE_DIR}/third_party/quiche/quiche/quic/core/proto/cached_network_parameters.pb.h
@@ -952,13 +982,20 @@ PUBLIC third_party/boringssl/src/include
952
982
  PUBLIC third_party/abseil-cpp
953
983
  PUBLIC third_party/googleurl
954
984
  PUBLIC third_party/libevent/include
955
- PUBLIC third_party/icu/icu4c/source/common
956
985
  PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/third_party/libevent/include
957
986
  PUBLIC .
958
987
  PUBLIC ${Protobuf_INCLUDE_DIRS}
959
988
  PUBLIC ${CMAKE_CURRENT_BINARY_DIR}
960
989
  PUBLIC ${CMAKE_JS_INC}
961
990
  )
991
+
992
+ IF (WIN32)
993
+ target_include_directories(gquiche PUBLIC third_party/icu/icu4c/source/common)
994
+ ELSE(WIN32)
995
+ include_directories(gquiche PUBLIC ${ICU_INCLUDE_DIRS})
996
+ target_link_libraries(gquiche ICU::uc ICU::i18n)
997
+ ENDIF(WIN32)
998
+
962
999
  target_link_libraries(gquiche
963
1000
  absl::base
964
1001
  absl::int128
package/build.js CHANGED
@@ -157,6 +157,23 @@ const prebuildInstall = async (args) => {
157
157
  })
158
158
  }
159
159
 
160
+ const buildTypes = async () => {
161
+ return new Promise((resolve, reject) => {
162
+ const tsc = 'tsc'
163
+ const proc = spawn(tsc, {
164
+ cwd: process.cwd(),
165
+ stdio: [null, 'inherit', 'inherit'],
166
+ shell: true
167
+ })
168
+
169
+ proc.on('close', (code) => {
170
+ if (code === 0) resolve(code)
171
+ else reject(code)
172
+ console.log(`child process exited with code ${code}`)
173
+ })
174
+ })
175
+ }
176
+
160
177
  const execbuild = async (args) => {
161
178
  return new Promise((resolve, reject) => {
162
179
  const cmakejs = 'cmake-js'
@@ -184,14 +201,18 @@ if (argv.length > 2) {
184
201
  ]
185
202
  if (platform === 'win32') platformargs.push('-t', 'ClangCL')
186
203
  const pbargs = []
187
- if (platform === 'win32') pbargs.push('-t', 'ClangCL')
188
204
  const pbargspre = []
189
- if (env.BUILDARCH) pbargspre.push('--arch', env.BUILDARCH)
205
+ if (platform === 'win32') pbargs.push('-t', 'ClangCL')
206
+ if (env.BUILDARCH) {
207
+ pbargspre.push('--arch', env.BUILDARCH)
208
+ platformargs.push('--arch', env.BUILDARCH)
209
+ }
190
210
  if (env.GH_TOKEN) pbargspre.push('--u', env.GH_TOKEN)
211
+
191
212
  switch (argv[2]) {
192
213
  case 'prebuild':
193
214
  try {
194
- prebuild([
215
+ await prebuild([
195
216
  '-t',
196
217
  '6',
197
218
  '-r',
@@ -229,13 +250,13 @@ if (argv.length > 2) {
229
250
  await extractthirdparty()
230
251
  } catch (error) {
231
252
  console.error('Building binary failed: ', error)
232
-
233
253
  }
234
254
  }
235
255
  // eslint-disable-next-line no-fallthrough
236
256
  case 'build':
237
257
  try {
238
- execbuild(['build', ...platformargs])
258
+ await execbuild(['build', ...platformargs])
259
+ await buildTypes()
239
260
  } catch (error) {
240
261
  console.error('Building binary failed: ', error)
241
262
  process.exit(1)
@@ -243,7 +264,8 @@ if (argv.length > 2) {
243
264
  break
244
265
  case 'rebuild':
245
266
  try {
246
- execbuild(['rebuild', ...platformargs])
267
+ await execbuild(['rebuild', ...platformargs])
268
+ await buildTypes()
247
269
  } catch (error) {
248
270
  console.error('ReBuilding binary failed: ', error)
249
271
  process.exit(1)
@@ -251,7 +273,8 @@ if (argv.length > 2) {
251
273
  break
252
274
  case 'build-debug':
253
275
  try {
254
- execbuild(['build', '-D', ...platformargs])
276
+ await execbuild(['build', '-D', ...platformargs])
277
+ await buildTypes()
255
278
  } catch (error) {
256
279
  console.error('Building binary failed: ', error)
257
280
  process.exit(1)
@@ -259,7 +282,8 @@ if (argv.length > 2) {
259
282
  break
260
283
  case 'rebuild-debug':
261
284
  try {
262
- execbuild(['rebuild', '-D', ...platformargs])
285
+ await execbuild(['rebuild', '-D', ...platformargs])
286
+ await buildTypes()
263
287
  } catch (error) {
264
288
  console.error('ReBuilding binary failed: ', error)
265
289
  process.exit(1)
@@ -0,0 +1,74 @@
1
+ /**
2
+ * @typedef {import('./session').Http3WTSession} Http3WTSession
3
+ *
4
+ * Http3Client events
5
+ * @typedef {import('./types').Http3ClientEventHandler} Http3ClientEventHandler
6
+ * @typedef {import('./types').ClientConnectedEvent} ClientConnectedEvent
7
+ * @typedef {import('./types').ClientWebtransportSupportEvent} ClientWebtransportSupportEvent
8
+ * @typedef {import('./types').Http3WTSessionVisitorEvent} Http3WTSessionVisitorEvent
9
+ */
10
+ /**
11
+ * @implements {Http3ClientEventHandler}
12
+ */
13
+ export class Http3Client extends Http3WebTransport implements Http3ClientEventHandler {
14
+ /**
15
+ * @param {*} args
16
+ */
17
+ constructor(args: any);
18
+ /** @type {{ resolve: (value?: any) => void, reject: (err?: Error) => void} | null | undefined} */
19
+ sessionProm: {
20
+ resolve: (value?: any) => void;
21
+ reject: (err?: Error) => void;
22
+ } | null | undefined;
23
+ /** @type {Promise<void> | undefined} */
24
+ sessionobj: Promise<void> | undefined;
25
+ /** @type {Http3WTSession | null | undefined} */
26
+ sessionobjint: Http3WTSession | null | undefined;
27
+ closeHookSession(): void;
28
+ /** @type {{ resolve: (value?: any) => void, reject: (err?: Error) => void} | null | undefined} */
29
+ webtransportProm: {
30
+ resolve: (value?: any) => void;
31
+ reject: (err?: Error) => void;
32
+ } | null | undefined;
33
+ /** @type {{ resolve: (value?: any) => void, reject: (err?: Error) => void} | null | undefined} */
34
+ quicconnectedProm: {
35
+ resolve: (value?: any) => void;
36
+ reject: (err?: Error) => void;
37
+ } | null | undefined;
38
+ handleConnection(): Promise<void>;
39
+ quicconnected: Promise<any> | undefined;
40
+ webtransport: Promise<any> | undefined;
41
+ /**
42
+ * @param {Http3WTSession} sessionobj
43
+ * @param {string} path
44
+ * @returns
45
+ */
46
+ createWTSession(sessionobj: Http3WTSession, path: string): Promise<void | undefined>;
47
+ stopped: boolean | undefined;
48
+ /**
49
+ * @param {ClientConnectedEvent} args
50
+ */
51
+ onClientConnected(args: ClientConnectedEvent): void;
52
+ /**
53
+ * @param {ClientWebtransportSupportEvent} args
54
+ */
55
+ onClientWebTransportSupport(args: ClientWebtransportSupportEvent): void;
56
+ /**
57
+ * @param {Http3WTSessionVisitorEvent} args
58
+ */
59
+ onHttp3WTSessionVisitor(args: Http3WTSessionVisitorEvent): void;
60
+ /**
61
+ * @param {ClientConnectedEvent | ClientWebtransportSupportEvent | Http3WTSessionVisitorEvent} args
62
+ */
63
+ customCallback(args: ClientConnectedEvent | ClientWebtransportSupportEvent | Http3WTSessionVisitorEvent): void;
64
+ }
65
+ /**
66
+ * Http3Client events
67
+ */
68
+ export type Http3WTSession = import('./session').Http3WTSession;
69
+ export type Http3ClientEventHandler = import('./types').Http3ClientEventHandler;
70
+ export type ClientConnectedEvent = import('./types').ClientConnectedEvent;
71
+ export type ClientWebtransportSupportEvent = import('./types').ClientWebtransportSupportEvent;
72
+ export type Http3WTSessionVisitorEvent = import('./types').Http3WTSessionVisitorEvent;
73
+ import { Http3WebTransport } from "./transport.js";
74
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../lib/client.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH;;GAEG;AACH;IACE;;OAEG;IACH,uBAkBC;IAfC,kGAAkG;IAClG;0BAD+B,GAAG,KAAK,IAAI;uBAAiB,KAAK,KAAK,IAAI;yBACnD;IAEvB,wCAAwC;IACxC,YADW,QAAQ,IAAI,CAAC,GAAG,SAAS,CAGlB;IAClB,gDAAgD;IAChD,eADW,cAAc,GAAG,IAAI,GAAG,SAAS,CACnB;IA+D3B,yBAGC;IA/DC,kGAAkG;IAClG;0BAD+B,GAAG,KAAK,IAAI;uBAAiB,KAAK,KAAK,IAAI;yBAC9C;IAC5B,kGAAkG;IAClG;0BAD+B,GAAG,KAAK,IAAI;uBAAiB,KAAK,KAAK,IAAI;yBAC7C;IAG/B,kCA4BC;IA3BC,wCAEE;IACF,uCAEE;IAwBJ;;;;OAIG;IACH,4BAJW,cAAc,QACd,MAAM,6BAoBhB;IAIC,6BAAmB;IAGrB;;OAEG;IACH,wBAFW,oBAAoB,QAW9B;IAED;;OAEG;IACH,kCAFW,8BAA8B,QAOxC;IAED;;OAEG;IACH,8BAFW,0BAA0B,QAepC;IAED;;OAEG;IACH,qBAFW,oBAAoB,GAAG,8BAA8B,GAAG,0BAA0B,QAoB5F;CACF;;;;6BA/JY,OAAO,WAAW,EAAE,cAAc;sCAGlC,OAAO,SAAS,EAAE,uBAAuB;mCACzC,OAAO,SAAS,EAAE,oBAAoB;6CACtC,OAAO,SAAS,EAAE,8BAA8B;yCAChD,OAAO,SAAS,EAAE,0BAA0B"}
@@ -0,0 +1,70 @@
1
+ export interface WebTransportDatagramStats {
2
+ timestamp: number;
3
+ expiredOutgoing: bigint;
4
+ droppedIncoming: bigint;
5
+ lostOutgoing: bigint;
6
+ }
7
+ export interface WebTransportStats {
8
+ timestamp: number;
9
+ bytesSent: bigint;
10
+ packetsSent: bigint;
11
+ packetsLost: bigint;
12
+ numOutgoingStreamsCreated: number;
13
+ numIncomingStreamsCreated: number;
14
+ bytesReceived: bigint;
15
+ packetsReceived: bigint;
16
+ smoothedRtt: number;
17
+ rttVariation: number;
18
+ minRtt: number;
19
+ datagrams: WebTransportDatagramStats;
20
+ }
21
+ export interface WebTransportCloseInfo {
22
+ closeCode: number;
23
+ reason: string;
24
+ }
25
+ export interface WebTransportDatagramDuplexStream {
26
+ readable: ReadableStream<Uint8Array>;
27
+ writable: WritableStream<Uint8Array>;
28
+ }
29
+ export interface WebTransportBidirectionalStream {
30
+ readonly readable: ReadableStream<Uint8Array>;
31
+ readonly writable: WritableStream<Uint8Array>;
32
+ }
33
+ export interface WebTransportSendStreamStats {
34
+ timestamp: number;
35
+ bytesWritten: bigint;
36
+ bytesSent: bigint;
37
+ bytesAcknowledged: bigint;
38
+ }
39
+ export interface WebTransportSendStream extends WritableStream<Uint8Array> {
40
+ getStats: () => Promise<WebTransportSendStreamStats>;
41
+ }
42
+ export interface WebTransportReceiveStreamStats {
43
+ timestamp: number;
44
+ bytesReceived: bigint;
45
+ bytesRead: bigint;
46
+ }
47
+ export interface WebTransportReceiveStream extends ReadableStream<Uint8Array> {
48
+ getStats: () => Promise<WebTransportReceiveStreamStats>;
49
+ }
50
+ export interface WebTransportHash {
51
+ algorithm: string;
52
+ value: BufferSource;
53
+ }
54
+ export interface WebTransportOptions {
55
+ allowPooling?: boolean;
56
+ requireUnreliable?: boolean;
57
+ serverCertificateHashes?: WebTransportHash[];
58
+ }
59
+ export interface WebTransport {
60
+ readonly ready: Promise<void>;
61
+ readonly closed: Promise<WebTransportCloseInfo>;
62
+ close: (closeInfo?: WebTransportCloseInfo) => void;
63
+ readonly datagrams: WebTransportDatagramDuplexStream;
64
+ createBidirectionalStream: () => Promise<WebTransportBidirectionalStream>;
65
+ readonly incomingBidirectionalStreams: ReadableStream<WebTransportBidirectionalStream>;
66
+ createUnidirectionalStream: () => Promise<WebTransportSendStream>;
67
+ readonly incomingUnidirectionalStreams: ReadableStream<WebTransportReceiveStream>;
68
+ }
69
+ export declare type WebTransportReliabilityMode = 'pending' | 'reliable-only' | 'supports-unreliable';
70
+ //# sourceMappingURL=dom.d.ts.map
@@ -0,0 +1 @@
1
+ {"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;
5
+ /**
6
+ * @returns {Http3EventLoop}
7
+ */
8
+ static createGlobalEventLoop(): Http3EventLoop;
9
+ /**
10
+ * @param {any} object
11
+ * @returns {Http3EventLoop}
12
+ */
13
+ static getGlobalEventLoop(object: any): Http3EventLoop;
14
+ /**
15
+ * @param {*} [args]
16
+ */
17
+ constructor(args?: any);
18
+ eventloopInt: any;
19
+ refObjects: Set<any>;
20
+ loopGuardian(): void;
21
+ startEventLoop(): void;
22
+ loopGuardianTimer: NodeJS.Timer | undefined;
23
+ shutdownEventLoop(): void;
24
+ refObjectsEmptyTime: number | undefined;
25
+ }
26
+ //# sourceMappingURL=event-loop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-loop.d.ts","sourceRoot":"","sources":["../../lib/event-loop.js"],"names":[],"mappings":"AAKA;IACE,oCAAoC;IACpC,mBADW,cAAc,GAAG,IAAI,CACR;IA4CxB,wBAEC;IAED;;OAEG;IACH,gCAFa,cAAc,CAS1B;IAED;;;OAGG;IACH,kCAHW,GAAG,GACD,cAAc,CAQ1B;IApED;;OAEG;IACH,wBAWC;IAVC,kBAKE;IAGF,qBAA2B;IAiB7B,qBAWC;IAxBD,uBAIC;IADC,4CAA6D;IAG/D,0BAKC;IASkC,wCAA8B;CAiClE"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * // Spec
3
+ * @typedef {import('./dom').WebTransportDatagramStats} WebTransportDatagramStats
4
+ * @typedef {import('./dom').WebTransportStats} WebTransportStats
5
+ * @typedef {import('./dom').WebTransportCloseInfo} WebTransportCloseInfo
6
+ * @typedef {import('./dom').WebTransportDatagramDuplexStream} WebTransportDatagramDuplexStream
7
+ * @typedef {import('./dom').WebTransportBidirectionalStream} WebTransportBidirectionalStream
8
+ * @typedef {import('./dom').WebTransportSendStreamStats} WebTransportSendStreamStats
9
+ * @typedef {import('./dom').WebTransportSendStream} WebTransportSendStream
10
+ * @typedef {import('./dom').WebTransportReceiveStreamStats} WebTransportReceiveStreamStats
11
+ * @typedef {import('./dom').WebTransportReceiveStream} WebTransportReceiveStream
12
+ * @typedef {import('./dom').WebTransportHash} WebTransportHash
13
+ * @typedef {import('./dom').WebTransportOptions} WebTransportOptions
14
+ * @typedef {import('./dom').WebTransportReliabilityMode} WebTransportReliabilityMode
15
+ *
16
+ * Public API
17
+ * @typedef {import('./types').WebTransportSession} WebTransportSession
18
+ * @typedef {import('./types').Http3ServerInit} Http3ServerInit
19
+ */
20
+ export function testcheck(): boolean;
21
+ export { Http3Server } from "./server.js";
22
+ export { WebTransport } from "./webtransport.js";
23
+ /**
24
+ * // Spec
25
+ */
26
+ export type WebTransportDatagramStats = import('./dom').WebTransportDatagramStats;
27
+ /**
28
+ * // Spec
29
+ */
30
+ export type WebTransportStats = import('./dom').WebTransportStats;
31
+ /**
32
+ * // Spec
33
+ */
34
+ export type WebTransportCloseInfo = import('./dom').WebTransportCloseInfo;
35
+ /**
36
+ * // Spec
37
+ */
38
+ export type WebTransportDatagramDuplexStream = import('./dom').WebTransportDatagramDuplexStream;
39
+ /**
40
+ * // Spec
41
+ */
42
+ export type WebTransportBidirectionalStream = import('./dom').WebTransportBidirectionalStream;
43
+ /**
44
+ * // Spec
45
+ */
46
+ export type WebTransportSendStreamStats = import('./dom').WebTransportSendStreamStats;
47
+ /**
48
+ * // Spec
49
+ */
50
+ export type WebTransportSendStream = import('./dom').WebTransportSendStream;
51
+ /**
52
+ * // Spec
53
+ */
54
+ export type WebTransportReceiveStreamStats = import('./dom').WebTransportReceiveStreamStats;
55
+ /**
56
+ * // Spec
57
+ */
58
+ export type WebTransportReceiveStream = import('./dom').WebTransportReceiveStream;
59
+ /**
60
+ * // Spec
61
+ */
62
+ export type WebTransportHash = import('./dom').WebTransportHash;
63
+ /**
64
+ * // Spec
65
+ */
66
+ export type WebTransportOptions = import('./dom').WebTransportOptions;
67
+ /**
68
+ * Public API
69
+ */
70
+ export type WebTransportReliabilityMode = import('./dom').WebTransportReliabilityMode;
71
+ /**
72
+ * // Spec
73
+ */
74
+ export type WebTransportSession = import('./types').WebTransportSession;
75
+ /**
76
+ * // Spec
77
+ */
78
+ export type Http3ServerInit = import('./types').Http3ServerInit;
79
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,qCAEC;;;;;;wCApBY,OAAO,OAAO,EAAE,yBAAyB;;;;gCACzC,OAAO,OAAO,EAAE,iBAAiB;;;;oCACjC,OAAO,OAAO,EAAE,qBAAqB;;;;+CACrC,OAAO,OAAO,EAAE,gCAAgC;;;;8CAChD,OAAO,OAAO,EAAE,+BAA+B;;;;0CAC/C,OAAO,OAAO,EAAE,2BAA2B;;;;qCAC3C,OAAO,OAAO,EAAE,sBAAsB;;;;6CACtC,OAAO,OAAO,EAAE,8BAA8B;;;;wCAC9C,OAAO,OAAO,EAAE,yBAAyB;;;;+BACzC,OAAO,OAAO,EAAE,gBAAgB;;;;kCAChC,OAAO,OAAO,EAAE,mBAAmB;;;;0CACnC,OAAO,OAAO,EAAE,2BAA2B;;;;kCAG3C,OAAO,SAAS,EAAE,mBAAmB;;;;8BACrC,OAAO,SAAS,EAAE,eAAe"}
@@ -0,0 +1,2 @@
1
+ export const wtrouter: any;
2
+ //# sourceMappingURL=native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../lib/native.js"],"names":[],"mappings":"AAwBA,2BAAuC"}