mirror of
https://github.com/fluencelabs/js-libp2p-interfaces
synced 2025-07-08 17:11:56 +00:00
Compare commits
23 Commits
v0.8.2
...
feat/add-t
Author | SHA1 | Date | |
---|---|---|---|
a24fafd570 | |||
a99b9582dc | |||
e73646c893 | |||
0b4b09ffee | |||
56e606ee86 | |||
7597875c32 | |||
ef86c87b40 | |||
5cfaf4128f | |||
5cb2025c2a | |||
0801fc3c0b | |||
8fdc05d37d | |||
6f090617aa | |||
67a5f51805 | |||
bac57b05dc | |||
6a95834570 | |||
7fd26cf6b9 | |||
b7f10727d6 | |||
3143efd7c1 | |||
f2d6a76dcf | |||
7ccaf27e24 | |||
4e25c6e51c | |||
cba63941b0 | |||
c1cb68e043 |
27
CHANGELOG.md
27
CHANGELOG.md
@ -1,30 +1,3 @@
|
||||
## [0.8.2](https://github.com/libp2p/js-interfaces/compare/v0.8.1...v0.8.2) (2021-01-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* event emitter types with local types ([#80](https://github.com/libp2p/js-interfaces/issues/80)) ([ca52077](https://github.com/libp2p/js-interfaces/commit/ca520775eb26f5ed501375fdb24ba698c9a8c8c8))
|
||||
|
||||
|
||||
|
||||
## [0.8.1](https://github.com/libp2p/js-interfaces/compare/v0.8.0...v0.8.1) (2020-12-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* pubsub publish message should be uint8array ([#77](https://github.com/libp2p/js-interfaces/issues/77)) ([5b99e6b](https://github.com/libp2p/js-interfaces/commit/5b99e6b56b10439a82ee88fb4e31fb95c182264f))
|
||||
|
||||
|
||||
|
||||
# [0.8.0](https://github.com/libp2p/js-interfaces/compare/v0.7.2...v0.8.0) (2020-12-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add types ([#74](https://github.com/libp2p/js-interfaces/issues/74)) ([e2419ea](https://github.com/libp2p/js-interfaces/commit/e2419ea308b5db38966850ba6349602c93ce3b0e))
|
||||
|
||||
|
||||
|
||||
<a name="0.7.2"></a>
|
||||
## [0.7.2](https://github.com/libp2p/js-interfaces/compare/v0.7.1...v0.7.2) (2020-11-11)
|
||||
|
||||
|
@ -4,8 +4,6 @@
|
||||
[](http://libp2p.io/)
|
||||
[](http://webchat.freenode.net/?channels=%23libp2p)
|
||||
[](https://discuss.libp2p.io)
|
||||
[](https://codecov.io/gh/libp2p/js-libp2p-interfaces)
|
||||
[](https://github.com/libp2p/js-libp2p-interfaces/actions?query=branch%3Amaster+workflow%3Aci+)
|
||||
|
||||
> Contains test suites and interfaces you can use to implement the various components of libp2p.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "libp2p-interfaces",
|
||||
"version": "0.8.2",
|
||||
"version": "0.7.2",
|
||||
"description": "Interfaces for JS Libp2p",
|
||||
"leadMaintainer": "Jacob Heun <jacobheun@gmail.com>",
|
||||
"main": "src/index.js",
|
||||
@ -27,6 +27,7 @@
|
||||
"test": "aegir test",
|
||||
"test:node": "aegir test --target node",
|
||||
"test:browser": "aegir test --target browser",
|
||||
"prepublishOnly": "npm run generate:types",
|
||||
"release": "aegir release -t node -t browser",
|
||||
"release-minor": "aegir release --type minor -t node -t browser",
|
||||
"release-major": "aegir release --type major -t node -t browser"
|
||||
|
@ -1,9 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
const debug = require('debug')
|
||||
/** @typedef {import('../types').EventEmitterFactory} Events */
|
||||
/** @type Events */
|
||||
const EventEmitter = require('events')
|
||||
const { EventEmitter } = require('events')
|
||||
const errcode = require('err-code')
|
||||
|
||||
const { pipe } = require('it-pipe')
|
||||
@ -646,7 +644,7 @@ class PubsubBaseProtocol extends EventEmitter {
|
||||
*
|
||||
* @override
|
||||
* @param {string} topic
|
||||
* @param {Uint8Array} message
|
||||
* @param {Buffer} message
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async publish (topic, message) {
|
||||
|
@ -1,8 +1,6 @@
|
||||
'use strict'
|
||||
|
||||
/** @typedef {import('../types').EventEmitterFactory} Events */
|
||||
/** @type Events */
|
||||
const EventEmitter = require('events')
|
||||
const { EventEmitter } = require('events')
|
||||
|
||||
const lp = require('it-length-prefixed')
|
||||
|
||||
|
18
src/types.ts
18
src/types.ts
@ -1,18 +0,0 @@
|
||||
export interface EventEmitterFactory {
|
||||
new(): EventEmitter;
|
||||
}
|
||||
|
||||
export interface EventEmitter {
|
||||
addListener(event: string | symbol, listener: (...args: any[]) => void);
|
||||
on(event: string | symbol, listener: (...args: any[]) => void);
|
||||
once(event: string | symbol, listener: (...args: any[]) => void);
|
||||
removeListener(event: string | symbol, listener: (...args: any[]) => void);
|
||||
off(event: string | symbol, listener: (...args: any[]) => void);
|
||||
removeAllListeners(event?: string | symbol);
|
||||
setMaxListeners(n: number);
|
||||
getMaxListeners(): number;
|
||||
listeners(event: string | symbol): Function[]; // eslint-disable-line @typescript-eslint/ban-types
|
||||
rawListeners(event: string | symbol): Function[]; // eslint-disable-line @typescript-eslint/ban-types
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
listenerCount(event: string | symbol): number;
|
||||
}
|
Reference in New Issue
Block a user