Fix eventsource DOM shim for TS 5.0 beta (#64013)

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
This commit is contained in:
Nathan Shively-Sanders
2023-01-23 07:54:22 -08:00
committed by GitHub
parent d4ee2164bb
commit 07ec31c6a9
2 changed files with 5 additions and 4 deletions

View File

@@ -39,10 +39,10 @@ interface Event {
* "submit".
*/
readonly type: string;
readonly AT_TARGET: number;
readonly BUBBLING_PHASE: number;
readonly CAPTURING_PHASE: number;
readonly NONE: number;
readonly AT_TARGET: 2;
readonly BUBBLING_PHASE: 3;
readonly CAPTURING_PHASE: 1;
readonly NONE: 0;
composedPath(): any[];
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
preventDefault(): void;

View File

@@ -5,6 +5,7 @@
// Pedro Gámez <https://github.com/snakedrak>
// Akuukis <https://github.com/Akuukis>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 5.0
// eventsource uses DOM dependencies which are absent in a browserless environment like node.js.
// to avoid compiler errors this monkey patch is used. See more details in: