chore: fix latest comments

This commit is contained in:
Vasco Santos 2020-12-02 21:19:46 +01:00
parent 5cfaf4128f
commit ef86c87b40
4 changed files with 14 additions and 40 deletions

View File

@ -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
- run: npx aegir test -t browser -t webworker --bail -- --browsers FirefoxHeadless

View File

@ -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

View File

@ -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.
*

View File

@ -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 <DialOptions extends { signal?: AbortSignal }> {
new (upgrader: Upgrader, ...others: any): Transport<DialOptions>; // eslint-disable-line
prototype: Transport <DialOptions>;
/**
* Dial a given multiaddr.
*/
dial(ma: Multiaddr, options?: any): Promise<Connection>;
dial(ma: Multiaddr, options?: DialOptions): Promise<Connection>;
/**
* Create transport listeners.
*/