Skip to content

Commit dbc128a

Browse files
committed
Fix eventsource DOM shim for TS 5.0 beta
The types that the DOM monkeypatch shims are now the precise literals instead of number. The new code won't succeed until tomorrow. See microsoft/TypeScript#52328
1 parent a6b57ed commit dbc128a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

types/eventsource/dom-monkeypatch.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ interface Event {
3939
* "submit".
4040
*/
4141
readonly type: string;
42-
readonly AT_TARGET: number;
43-
readonly BUBBLING_PHASE: number;
44-
readonly CAPTURING_PHASE: number;
45-
readonly NONE: number;
42+
readonly AT_TARGET: 2;
43+
readonly BUBBLING_PHASE: 3;
44+
readonly CAPTURING_PHASE: 1;
45+
readonly NONE: 0;
4646
composedPath(): any[];
4747
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
4848
preventDefault(): void;

types/eventsource/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// Pedro Gámez <https://github.com/snakedrak>
66
// Akuukis <https://github.com/Akuukis>
77
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
8+
// Minimum TypeScript Version: 5.0
89

910
// eventsource uses DOM dependencies which are absent in a browserless environment like node.js.
1011
// to avoid compiler errors this monkey patch is used. See more details in:

0 commit comments

Comments
 (0)