stimulus-store
Version:
Lightweight state management for Stimulus.js
14 lines (13 loc) • 649 B
TypeScript
/**
* Checks if the value is of the specified type.
* @param {unknown} value - The value to check.
* @param {new (...args: unknown[]) => unknown} type - The type constructor for the expected type.
* @throws {Error} If the value is not of the expected type.
*/
export declare function checkValue(value: unknown, type: new (...args: unknown[]) => unknown): void;
/**
* Handles errors that occur when a promise fails to resolve.
* @param {unknown} error - The error that occurred.
* @throws {Error} A new error with a message indicating that the promise failed to resolve.
*/
export declare function handlePromiseError(error: unknown): never;