Skip to content

Commit

Permalink
Remove patched DOM types (#3533)
Browse files Browse the repository at this point in the history
  • Loading branch information
eXhumer authored Sep 2, 2024
1 parent c926a43 commit ce1ef21
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 47 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"@fastify/busboy": "3.0.0",
"@matteo.collina/tspl": "^0.1.1",
"@sinonjs/fake-timers": "^11.1.0",
"@types/node": "^18.0.3",
"@types/node": "~18.17.19",
"abort-controller": "^3.0.0",
"borp": "^0.17.0",
"c8": "^10.0.0",
Expand Down
2 changes: 0 additions & 2 deletions types/eventsource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { MessageEvent, ErrorEvent } from './websocket'
import Dispatcher from './dispatcher'

import {
EventTarget,
Event,
EventListenerOptions,
AddEventListenerOptions,
EventListenerOrEventListenerObject
Expand Down
42 changes: 0 additions & 42 deletions types/patch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,6 @@

// See https://github.com/nodejs/undici/issues/1740

export type DOMException = typeof globalThis extends { DOMException: infer T }
? T
: any

export type EventTarget = typeof globalThis extends { EventTarget: infer T }
? T
: {
addEventListener(
type: string,
listener: any,
options?: any,
): void
dispatchEvent(event: Event): boolean
removeEventListener(
type: string,
listener: any,
options?: any | boolean,
): void
}

export type Event = typeof globalThis extends { Event: infer T }
? T
: {
readonly bubbles: boolean
cancelBubble: () => void
readonly cancelable: boolean
readonly composed: boolean
composedPath(): [EventTarget?]
readonly currentTarget: EventTarget | null
readonly defaultPrevented: boolean
readonly eventPhase: 0 | 2
readonly isTrusted: boolean
preventDefault(): void
returnValue: boolean
readonly srcElement: EventTarget | null
stopImmediatePropagation(): void
stopPropagation(): void
readonly target: EventTarget | null
readonly timeStamp: number
readonly type: string
}

export interface EventInit {
bubbles?: boolean
cancelable?: boolean
Expand Down
2 changes: 0 additions & 2 deletions types/websocket.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import type { Blob } from 'buffer'
import type { MessagePort } from 'worker_threads'
import {
EventTarget,
Event,
EventInit,
EventListenerOptions,
AddEventListenerOptions,
Expand Down

0 comments on commit ce1ef21

Please sign in to comment.