Files
v10/dist/dev/core/errors.d.ts
T

21 lines
706 B
TypeScript

//#region src/core/errors.d.ts
type StoreErrorCode =
/** Store was destroyed. */
'DESTROYED' |
/** No target is attached to the store. */
'NO_TARGET';
interface StoreErrorOptions {
cause?: unknown;
message?: string;
}
declare class StoreError extends Error {
readonly code: StoreErrorCode;
cause?: unknown;
constructor(code: StoreErrorCode, options?: StoreErrorOptions);
}
declare function isStoreError(error: unknown): error is StoreError;
declare function throwNoTargetError(): never;
declare function throwDestroyedError(): never;
//#endregion
export { StoreError, StoreErrorCode, StoreErrorOptions, isStoreError, throwDestroyedError, throwNoTargetError };
//# sourceMappingURL=errors.d.ts.map