@libp2p/interfaces
Advanced tools
Comparing version 3.0.6 to 3.1.0
@@ -0,1 +1,6 @@ | ||
/** | ||
* When this error is thrown it means an operation was aborted, | ||
* usually in response to the `abort` event being emitted by an | ||
* AbortSignal. | ||
*/ | ||
export declare class AbortError extends Error { | ||
@@ -2,0 +7,0 @@ readonly code: string; |
@@ -0,1 +1,6 @@ | ||
/** | ||
* When this error is thrown it means an operation was aborted, | ||
* usually in response to the `abort` event being emitted by an | ||
* AbortSignal. | ||
*/ | ||
export class AbortError extends Error { | ||
@@ -2,0 +7,0 @@ constructor(message = 'The operation was aborted') { |
@@ -0,4 +1,26 @@ | ||
/** | ||
* An object that contains an AbortSignal as | ||
* the optional `signal` property. | ||
* | ||
* @example | ||
* | ||
* ```js | ||
* const controller = new AbortController() | ||
* | ||
* aLongRunningOperation({ | ||
* signal: controller.signal | ||
* }) | ||
* | ||
* // later | ||
* | ||
* controller.abort() | ||
*/ | ||
export interface AbortOptions { | ||
signal?: AbortSignal; | ||
} | ||
/** | ||
* Returns a new type with all fields marked optional. | ||
* | ||
* Borrowed from the tsdef module. | ||
*/ | ||
export type RecursivePartial<T> = { | ||
@@ -5,0 +27,0 @@ [P in keyof T]?: T[P] extends Array<infer I> ? Array<RecursivePartial<I>> : T[P] extends (...args: any[]) => any ? T[P] : RecursivePartial<T[P]>; |
{ | ||
"EventEmitter": "https://libp2p.github.io/js-libp2p-interfaces/classes/_libp2p_interface_transport_compliance_tests._internal_.EventEmitter.html", | ||
"EventCallback": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_transport_compliance_tests._internal_.EventCallback.html", | ||
"EventObject": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_transport_compliance_tests._internal_.EventObject.html", | ||
"EventHandler": "https://libp2p.github.io/js-libp2p-interfaces/types/_libp2p_interface_transport_compliance_tests._internal_.EventHandler.html", | ||
"AbortOptions": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interfaces.AbortOptions.html", | ||
"Startable": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_mocks._internal_.Startable.html", | ||
"RecursivePartial": "https://libp2p.github.io/js-libp2p-interfaces/types/_libp2p_interfaces.RecursivePartial.html" | ||
} |
{ | ||
"name": "@libp2p/interfaces", | ||
"version": "3.0.6", | ||
"version": "3.1.0", | ||
"description": "Common code shared by the various libp2p interfaces", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0 OR MIT", |
/** | ||
* When this error is thrown it means an operation was aborted, | ||
* usually in response to the `abort` event being emitted by an | ||
* AbortSignal. | ||
*/ | ||
export class AbortError extends Error { | ||
@@ -3,0 +8,0 @@ public readonly code: string |
/** | ||
* An object that contains an AbortSignal as | ||
* the optional `signal` property. | ||
* | ||
* @example | ||
* | ||
* ```js | ||
* const controller = new AbortController() | ||
* | ||
* aLongRunningOperation({ | ||
* signal: controller.signal | ||
* }) | ||
* | ||
* // later | ||
* | ||
* controller.abort() | ||
*/ | ||
export interface AbortOptions { | ||
@@ -6,5 +23,9 @@ signal?: AbortSignal | ||
// Borrowed from the tsdef module | ||
/** | ||
* Returns a new type with all fields marked optional. | ||
* | ||
* Borrowed from the tsdef module. | ||
*/ | ||
export type RecursivePartial<T> = { | ||
[P in keyof T]?: T[P] extends Array<infer I> ? Array<RecursivePartial<I>> : T[P] extends (...args: any[]) => any ? T[P] : RecursivePartial<T[P]> | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30238
485