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

fix: typedefs for MulticodecTopology #73

Closed
wants to merge 9 commits into from
11 changes: 5 additions & 6 deletions src/topology/multicodec-topology.d.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
declare const _exports: MulticodecTopology;
export = _exports;
export = MulticodecTopology;
declare class MulticodecTopology {
/**
* @param {Object} props
* @param {number} props.min minimum needed connections (default: 0)
* @param {number} props.max maximum needed connections (default: Infinity)
* @param {number} [props.min] minimum needed connections (default: 0)
* @param {number} [props.max] maximum needed connections (default: Infinity)
* @param {Array<string>} props.multicodecs protocol multicodecs
* @param {Object} props.handlers
* @param {function} props.handlers.onConnect protocol "onConnect" handler
* @param {function} props.handlers.onDisconnect protocol "onDisconnect" handler
* @constructor
*/
constructor({ min, max, multicodecs, handlers }: {
min: number;
max: number;
min?: number;
max?: number;
multicodecs: string[];
handlers: {
onConnect: Function;
Expand Down