detect-shells
Version:
Detect shells installed on a system
24 lines (23 loc) • 964 B
TypeScript
/** Throw an error. */
export declare function fatalError(msg: string): never;
/**
* Utility function used to achieve exhaustive type checks at compile time.
*
* If the type system is bypassed or this method will throw an exception
* using the second parameter as the message.
*
* @param x Placeholder parameter in order to leverage the type
* system. Pass the variable which has been type narrowed
* in an exhaustive check.
*
* @param message The message to be used in the runtime exception.
*
*/
export declare function assertNever(x: never, message: string): never;
/**
* Unwrap a value that, according to the type system, could be null or
* undefined, but which we know is not. If the value _is_ null or undefined,
* this will throw. The message should contain the rationale for knowing the
* value is defined.
*/
export declare function forceUnwrap<T>(message: string, x: T | null | undefined): T;