@libp2p/interface 2.1.3 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import type { RoutingOptions } from '../index.js';
1
+ import type { AbortOptions, RoutingOptions } from '../index.js';
2
2
  import type { PeerInfo } from '../peer-info/index.js';
3
3
  import type { CID } from 'multiformats/cid';
4
4
  /**
@@ -41,6 +41,12 @@ export interface ContentRouting {
41
41
  * ```
42
42
  */
43
43
  provide(cid: CID, options?: RoutingOptions): Promise<void>;
44
+ /**
45
+ * If network peers need to be periodically reminded that the caller can
46
+ * provide content corresponding to the passed CID, call this function to no
47
+ * longer remind them.
48
+ */
49
+ cancelReprovide(key: CID, options?: AbortOptions): Promise<void>;
44
50
  /**
45
51
  * Find the providers of the passed CID.
46
52
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/content-routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAE3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,oBAAoB,eAAwC,CAAA;AAEzE;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,CAAC,oBAAoB,CAAC,EAAE,cAAc,CAAA;CACvC;AAED,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE1D;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;IAE1E;;;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CAAC,CAAA;IAEhF;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CACpE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/interface",
3
- "version": "2.1.3",
3
+ "version": "2.2.0",
4
4
  "description": "The interface implemented by a libp2p node",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface#readme",
@@ -1,4 +1,4 @@
1
- import type { RoutingOptions } from '../index.js'
1
+ import type { AbortOptions, RoutingOptions } from '../index.js'
2
2
  import type { PeerInfo } from '../peer-info/index.js'
3
3
  import type { CID } from 'multiformats/cid'
4
4
 
@@ -45,6 +45,13 @@ export interface ContentRouting {
45
45
  */
46
46
  provide(cid: CID, options?: RoutingOptions): Promise<void>
47
47
 
48
+ /**
49
+ * If network peers need to be periodically reminded that the caller can
50
+ * provide content corresponding to the passed CID, call this function to no
51
+ * longer remind them.
52
+ */
53
+ cancelReprovide (key: CID, options?: AbortOptions): Promise<void>
54
+
48
55
  /**
49
56
  * Find the providers of the passed CID.
50
57
  *