diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e5d28c9..f16fde5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,9 +14,9 @@ jobs: - uses: actions/checkout@v2 - run: yarn - run: yarn lint + # - uses: gozala/typescript-error-reporter-action@v1.0.4 - run: yarn build - - uses: gozala/typescript-error-reporter-action@v1.0.4 - - run: yarn aegir dep-check -- -i aegir + - run: yarn aegir dep-check - uses: ipfs/aegir/actions/bundle-size@master name: size with: @@ -35,7 +35,7 @@ jobs: with: node-version: ${{ matrix.node }} - run: yarn - - run: npx nyc --reporter=lcov npm run test:node -- --bail + - run: npx nyc --reporter=lcov aegir test -t node -- --bail - uses: codecov/codecov-action@v1 test-chrome: needs: check @@ -43,11 +43,11 @@ jobs: steps: - uses: actions/checkout@v2 - run: yarn - - run: yarn aegir test -t browser -t webworker + - run: npx aegir test -t browser -t webworker --bail test-firefox: needs: check runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - run: yarn - - run: yarn aegir test -t browser -t webworker -- --browsers FirefoxHeadless \ No newline at end of file + - run: npx aegir test -t browser -t webworker --bail -- --browsers FirefoxHeadless \ No newline at end of file diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml deleted file mode 100644 index 6146374..0000000 --- a/.github/workflows/typecheck.yml +++ /dev/null @@ -1,27 +0,0 @@ -on: - push: - branches: - - master - - main - - default - pull_request: - branches: - - '**' - -name: Typecheck -jobs: - check: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [12.x] - steps: - - uses: actions/checkout@v1 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Install dependencies - run: npm install - - name: Typecheck - uses: gozala/typescript-error-reporter-action@v1.0.8 diff --git a/src/connection/connection.js b/src/connection/connection.js index c429624..9ce6dca 100644 --- a/src/connection/connection.js +++ b/src/connection/connection.js @@ -20,10 +20,7 @@ const connectionSymbol = Symbol.for('@libp2p/interface-connection/connection') * * @typedef {Object} ConectionStat * @property {string} direction - connection establishment direction ("inbound" or "outbound"). - * @property {object} timeline - connection relevant events timestamp. - * @property {number} timeline.open - connection opening timestamp. - * @property {number} [timeline.upgraded] - connection upgraded timestamp. - * @property {number} [timeline.close] - connection upgraded timestamp. + * @property {Timeline} timeline - connection relevant events timestamp. * @property {string} [multiplexer] - connection multiplexing identifier. * @property {string} [encryption] - connection encryption method identifier. * diff --git a/src/transport/types.ts b/src/transport/types.ts index 9365c40..088fb7c 100644 --- a/src/transport/types.ts +++ b/src/transport/types.ts @@ -3,16 +3,20 @@ import Multiaddr from 'multiaddr' import Connection from '../connection/connection' import { Sink } from '../stream-muxer/types' +export type DialOptions = { + signal?: AbortSignal +} + /** * A libp2p transport is understood as something that offers a dial and listen interface to establish connections. */ -export interface Transport { - new (upgrader: Upgrader, ...others: any): Transport; // eslint-disable-line - prototype: Transport; +export interface Transport { + new (upgrader: Upgrader, ...others: any): Transport; // eslint-disable-line + prototype: Transport ; /** * Dial a given multiaddr. */ - dial(ma: Multiaddr, options?: any): Promise; + dial(ma: Multiaddr, options?: DialOptions): Promise; /** * Create transport listeners. */