mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
21 lines
706 B
TypeScript
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
|