|
1 | 1 | import { privateKeyToProtobuf } from '@libp2p/crypto/keys' |
2 | | -import { AbortError, transportSymbol } from '@libp2p/interface' |
| 2 | +import { AbortError, serviceCapabilities, transportSymbol } from '@libp2p/interface' |
3 | 3 | import { QuicConnection } from './connection.js' |
4 | 4 | import { dialFilter, listenFilter } from './filter.js' |
5 | 5 | import { QuicListener, type QuicCreateListenerOptions } from './listener.js' |
6 | 6 | import * as napi from './napi.js' |
7 | 7 | import { QuicStreamMuxerFactory } from './stream-muxer.js' |
8 | | -import type { ComponentLogger, Connection, CounterGroup, DialTransportOptions, Listener, Logger, Metrics, MultiaddrFilter, PrivateKey, Transport } from '@libp2p/interface' |
| 8 | +import type { Connection, CounterGroup, Listener, Logger, MultiaddrFilter, Transport } from '@libp2p/interface' |
9 | 9 | import type { Multiaddr } from '@multiformats/multiaddr' |
| 10 | +import type { QuicComponents, QuicDialOptions, QuicOptions } from './index.js' |
10 | 11 |
|
11 | | -export type QuicOptions = Omit<napi.Config, 'privateKeyProto'> |
12 | | - |
13 | | -export interface QuicComponents { |
14 | | - metrics?: Metrics |
15 | | - logger: ComponentLogger |
16 | | - privateKey: PrivateKey |
17 | | -} |
18 | | - |
19 | | -export type QuicDialOptions = DialTransportOptions |
20 | | - |
21 | | -export interface QuicTransportMetrics { |
| 12 | +interface QuicTransportMetrics { |
22 | 13 | events: CounterGroup |
23 | 14 | } |
24 | 15 |
|
25 | 16 | export class QuicTransport implements Transport { |
26 | 17 | readonly [Symbol.toStringTag]: string = 'quic' |
27 | 18 | readonly [transportSymbol] = true |
| 19 | + readonly [serviceCapabilities]: string[] = [ |
| 20 | + '@libp2p/transport' |
| 21 | + ] |
28 | 22 |
|
29 | 23 | readonly log: Logger |
30 | 24 | readonly components: QuicComponents |
|
0 commit comments