Skip to content

Commit 1eb3017

Browse files
committed
fix: restore Eid.preconditions and Eid.exceptions for backward compat
Attach preconditions and exceptions as static properties on Eid class. Legacy consumers using Eid.preconditions.checkNotNull() still work. Assisted-by: 🤖 claude-opus-4-6@default
1 parent 6ff6dfb commit 1eb3017

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

src/index.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,31 @@ import {
3535
} from "./exceptions";
3636
import { EidPreconditions } from "./preconditions";
3737

38+
interface EidExceptions {
39+
EidRuntimeException: typeof EidRuntimeException;
40+
EidNullPointerException: typeof EidNullPointerException;
41+
EidIllegalArgumentException: typeof EidIllegalArgumentException;
42+
EidIllegalStateException: typeof EidIllegalStateException;
43+
EidIndexOutOfBoundsException: typeof EidIndexOutOfBoundsException;
44+
}
45+
46+
declare module "./eid" {
47+
interface Eid {
48+
constructor: typeof Eid;
49+
}
50+
namespace Eid {
51+
let preconditions: typeof EidPreconditions;
52+
let exceptions: EidExceptions;
53+
}
54+
}
55+
56+
Eid.preconditions = EidPreconditions;
57+
Eid.exceptions = {
58+
EidRuntimeException,
59+
EidNullPointerException,
60+
EidIllegalArgumentException,
61+
EidIllegalStateException,
62+
EidIndexOutOfBoundsException,
63+
};
64+
3865
export default Eid;

0 commit comments

Comments
 (0)