Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
fix: move errors (#132)
Browse files Browse the repository at this point in the history
Moves `AbortError` to root and exposes it for importing. Also dedupes `AbortOptions`.
  • Loading branch information
achingbrain authored Jan 2, 2022
1 parent befb411 commit 21d282a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import goodbye from 'it-goodbye'
import { collect } from 'streaming-iterables'
import { pipe } from 'it-pipe'
import AbortController from 'abort-controller'
import { AbortError } from 'libp2p-interfaces/transport/errors'
import { AbortError } from 'libp2p-interfaces/errors'
import sinon from 'sinon'
import type { TestSetup } from '../index.js'
import type { Transport, Listener } from 'libp2p-interfaces/transport'
Expand Down
4 changes: 4 additions & 0 deletions packages/libp2p-interfaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
"import": "./dist/src/dht/index.js",
"types": "./dist/src/dht/index.d.ts"
},
"./errors": {
"import": "./dist/src/errors/index.js",
"types": "./dist/src/errors/index.d.ts"
},
"./keys": {
"import": "./dist/src/keys/index.js",
"types": "./dist/src/keys/index.d.ts"
Expand Down
5 changes: 1 addition & 4 deletions packages/libp2p-interfaces/src/transport/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import type events from 'events'
import type { Multiaddr } from 'multiaddr'
import type { Connection } from '../connection'

export interface AbortOptions {
signal?: AbortSignal
}
import type { AbortOptions } from '../index.js'

export interface TransportFactory<DialOptions extends { signal?: AbortSignal }, ListenerOptions> {
new(upgrader: Upgrader): Transport<DialOptions, ListenerOptions>
Expand Down

0 comments on commit 21d282a

Please sign in to comment.