option-t
Version:
A toolkit of Nullable/Option/Result type implementation in ECMAScript. Their APIs are inspired by Rust's `Option<T>` and `Result<T, E>`.
30 lines (29 loc) • 1.22 kB
TypeScript
/**
* XXX:
* We should not expose this class constructor as a part of public API surface
* due to the same reason of why we should not expose {@link CausalCarrierError}.
*
* We need a breaking change if we want to change this value.
*/
declare const WRAPPER_NAME: "CausalCarrierError";
/**
* XXX:
* We should not expose this class constructor as a part of public API surface.
*
* If we expose this as so, user would try to use this class for `instanceof`
* but it's not reliable way for user to check a passed object
* is an instance of this class in npm (and other compat pkg managers)'s `node_modules/` design.
* if user project contains multiple versions of this package, `instanceof` is completely unreliable.
* We should not allow to it for user.
*
* Additionally, empirically, for the situation which this class instance is thrown in,
* the uscase of _unwrap_or_throw_ operation,
* the most important point is a throwing an something error object rather than
* what an object is an instance of a specified class.
* We should not expose this.
*/
export declare class CausalCarrierError<E> extends Error {
name: typeof WRAPPER_NAME;
constructor(cause: E);
}
export {};