Skip to content

Commit aeb59e0

Browse files
authored
refactor: Move most interfaces out of the JSX namespace (#4878)
* refactor: Move most interfaces out of the JSX namespace * refactor: Move typings back out & into new dom.d.ts file * fix: Correct global/inaccessible type access * refactor: Switch to import * * refactor: Export all types
1 parent 9a54be8 commit aeb59e0

File tree

7 files changed

+3327
-3323
lines changed

7 files changed

+3327
-3323
lines changed

compat/src/index.d.ts

Lines changed: 93 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -166,114 +166,114 @@ declare namespace React {
166166

167167
// HTML
168168
export interface HTMLAttributes<T extends EventTarget>
169-
extends JSXInternal.HTMLAttributes<T> {}
169+
extends preact1.HTMLAttributes<T> {}
170170
export interface HTMLProps<T extends EventTarget>
171-
extends JSXInternal.AllHTMLAttributes<T>,
171+
extends preact1.AllHTMLAttributes<T>,
172172
preact1.ClassAttributes<T> {}
173173
export interface AllHTMLAttributes<T extends EventTarget>
174-
extends JSXInternal.AllHTMLAttributes<T> {}
175-
export import DetailedHTMLProps = JSXInternal.DetailedHTMLProps;
176-
export import CSSProperties = JSXInternal.CSSProperties;
174+
extends preact1.AllHTMLAttributes<T> {}
175+
export import DetailedHTMLProps = preact1.DetailedHTMLProps;
176+
export import CSSProperties = preact1.CSSProperties;
177177

178178
export interface SVGProps<T extends EventTarget>
179-
extends JSXInternal.SVGAttributes<T>,
179+
extends preact1.SVGAttributes<T>,
180180
preact1.ClassAttributes<T> {}
181181

182182
interface SVGAttributes<T extends EventTarget = SVGElement>
183-
extends JSXInternal.SVGAttributes<T> {}
183+
extends preact1.SVGAttributes<T> {}
184184

185185
interface ReactSVG extends JSXInternal.IntrinsicSVGElements {}
186186

187-
export import AriaAttributes = JSXInternal.AriaAttributes;
188-
189-
export import HTMLAttributeReferrerPolicy = JSXInternal.HTMLAttributeReferrerPolicy;
190-
export import HTMLAttributeAnchorTarget = JSXInternal.HTMLAttributeAnchorTarget;
191-
export import HTMLInputTypeAttribute = JSXInternal.HTMLInputTypeAttribute;
192-
export import HTMLAttributeCrossOrigin = JSXInternal.HTMLAttributeCrossOrigin;
193-
194-
export import AnchorHTMLAttributes = JSXInternal.AnchorHTMLAttributes;
195-
export import AudioHTMLAttributes = JSXInternal.AudioHTMLAttributes;
196-
export import AreaHTMLAttributes = JSXInternal.AreaHTMLAttributes;
197-
export import BaseHTMLAttributes = JSXInternal.BaseHTMLAttributes;
198-
export import BlockquoteHTMLAttributes = JSXInternal.BlockquoteHTMLAttributes;
199-
export import ButtonHTMLAttributes = JSXInternal.ButtonHTMLAttributes;
200-
export import CanvasHTMLAttributes = JSXInternal.CanvasHTMLAttributes;
201-
export import ColHTMLAttributes = JSXInternal.ColHTMLAttributes;
202-
export import ColgroupHTMLAttributes = JSXInternal.ColgroupHTMLAttributes;
203-
export import DataHTMLAttributes = JSXInternal.DataHTMLAttributes;
204-
export import DetailsHTMLAttributes = JSXInternal.DetailsHTMLAttributes;
205-
export import DelHTMLAttributes = JSXInternal.DelHTMLAttributes;
206-
export import DialogHTMLAttributes = JSXInternal.DialogHTMLAttributes;
207-
export import EmbedHTMLAttributes = JSXInternal.EmbedHTMLAttributes;
208-
export import FieldsetHTMLAttributes = JSXInternal.FieldsetHTMLAttributes;
209-
export import FormHTMLAttributes = JSXInternal.FormHTMLAttributes;
210-
export import IframeHTMLAttributes = JSXInternal.IframeHTMLAttributes;
211-
export import ImgHTMLAttributes = JSXInternal.ImgHTMLAttributes;
212-
export import InsHTMLAttributes = JSXInternal.InsHTMLAttributes;
213-
export import InputHTMLAttributes = JSXInternal.InputHTMLAttributes;
214-
export import KeygenHTMLAttributes = JSXInternal.KeygenHTMLAttributes;
215-
export import LabelHTMLAttributes = JSXInternal.LabelHTMLAttributes;
216-
export import LiHTMLAttributes = JSXInternal.LiHTMLAttributes;
217-
export import LinkHTMLAttributes = JSXInternal.LinkHTMLAttributes;
218-
export import MapHTMLAttributes = JSXInternal.MapHTMLAttributes;
219-
export import MenuHTMLAttributes = JSXInternal.MenuHTMLAttributes;
220-
export import MediaHTMLAttributes = JSXInternal.MediaHTMLAttributes;
221-
export import MetaHTMLAttributes = JSXInternal.MetaHTMLAttributes;
222-
export import MeterHTMLAttributes = JSXInternal.MeterHTMLAttributes;
223-
export import QuoteHTMLAttributes = JSXInternal.QuoteHTMLAttributes;
224-
export import ObjectHTMLAttributes = JSXInternal.ObjectHTMLAttributes;
225-
export import OlHTMLAttributes = JSXInternal.OlHTMLAttributes;
226-
export import OptgroupHTMLAttributes = JSXInternal.OptgroupHTMLAttributes;
227-
export import OptionHTMLAttributes = JSXInternal.OptionHTMLAttributes;
228-
export import OutputHTMLAttributes = JSXInternal.OutputHTMLAttributes;
229-
export import ParamHTMLAttributes = JSXInternal.ParamHTMLAttributes;
230-
export import ProgressHTMLAttributes = JSXInternal.ProgressHTMLAttributes;
231-
export import SlotHTMLAttributes = JSXInternal.SlotHTMLAttributes;
232-
export import ScriptHTMLAttributes = JSXInternal.ScriptHTMLAttributes;
233-
export import SelectHTMLAttributes = JSXInternal.SelectHTMLAttributes;
234-
export import SourceHTMLAttributes = JSXInternal.SourceHTMLAttributes;
235-
export import StyleHTMLAttributes = JSXInternal.StyleHTMLAttributes;
236-
export import TableHTMLAttributes = JSXInternal.TableHTMLAttributes;
237-
export import TextareaHTMLAttributes = JSXInternal.TextareaHTMLAttributes;
238-
export import TdHTMLAttributes = JSXInternal.TdHTMLAttributes;
239-
export import ThHTMLAttributes = JSXInternal.ThHTMLAttributes;
240-
export import TimeHTMLAttributes = JSXInternal.TimeHTMLAttributes;
241-
export import TrackHTMLAttributes = JSXInternal.TrackHTMLAttributes;
242-
export import VideoHTMLAttributes = JSXInternal.VideoHTMLAttributes;
187+
export import AriaAttributes = preact1.AriaAttributes;
188+
189+
export import HTMLAttributeReferrerPolicy = preact1.HTMLAttributeReferrerPolicy;
190+
export import HTMLAttributeAnchorTarget = preact1.HTMLAttributeAnchorTarget;
191+
export import HTMLInputTypeAttribute = preact1.HTMLInputTypeAttribute;
192+
export import HTMLAttributeCrossOrigin = preact1.HTMLAttributeCrossOrigin;
193+
194+
export import AnchorHTMLAttributes = preact1.AnchorHTMLAttributes;
195+
export import AudioHTMLAttributes = preact1.AudioHTMLAttributes;
196+
export import AreaHTMLAttributes = preact1.AreaHTMLAttributes;
197+
export import BaseHTMLAttributes = preact1.BaseHTMLAttributes;
198+
export import BlockquoteHTMLAttributes = preact1.BlockquoteHTMLAttributes;
199+
export import ButtonHTMLAttributes = preact1.ButtonHTMLAttributes;
200+
export import CanvasHTMLAttributes = preact1.CanvasHTMLAttributes;
201+
export import ColHTMLAttributes = preact1.ColHTMLAttributes;
202+
export import ColgroupHTMLAttributes = preact1.ColgroupHTMLAttributes;
203+
export import DataHTMLAttributes = preact1.DataHTMLAttributes;
204+
export import DetailsHTMLAttributes = preact1.DetailsHTMLAttributes;
205+
export import DelHTMLAttributes = preact1.DelHTMLAttributes;
206+
export import DialogHTMLAttributes = preact1.DialogHTMLAttributes;
207+
export import EmbedHTMLAttributes = preact1.EmbedHTMLAttributes;
208+
export import FieldsetHTMLAttributes = preact1.FieldsetHTMLAttributes;
209+
export import FormHTMLAttributes = preact1.FormHTMLAttributes;
210+
export import IframeHTMLAttributes = preact1.IframeHTMLAttributes;
211+
export import ImgHTMLAttributes = preact1.ImgHTMLAttributes;
212+
export import InsHTMLAttributes = preact1.InsHTMLAttributes;
213+
export import InputHTMLAttributes = preact1.InputHTMLAttributes;
214+
export import KeygenHTMLAttributes = preact1.KeygenHTMLAttributes;
215+
export import LabelHTMLAttributes = preact1.LabelHTMLAttributes;
216+
export import LiHTMLAttributes = preact1.LiHTMLAttributes;
217+
export import LinkHTMLAttributes = preact1.LinkHTMLAttributes;
218+
export import MapHTMLAttributes = preact1.MapHTMLAttributes;
219+
export import MenuHTMLAttributes = preact1.MenuHTMLAttributes;
220+
export import MediaHTMLAttributes = preact1.MediaHTMLAttributes;
221+
export import MetaHTMLAttributes = preact1.MetaHTMLAttributes;
222+
export import MeterHTMLAttributes = preact1.MeterHTMLAttributes;
223+
export import QuoteHTMLAttributes = preact1.QuoteHTMLAttributes;
224+
export import ObjectHTMLAttributes = preact1.ObjectHTMLAttributes;
225+
export import OlHTMLAttributes = preact1.OlHTMLAttributes;
226+
export import OptgroupHTMLAttributes = preact1.OptgroupHTMLAttributes;
227+
export import OptionHTMLAttributes = preact1.OptionHTMLAttributes;
228+
export import OutputHTMLAttributes = preact1.OutputHTMLAttributes;
229+
export import ParamHTMLAttributes = preact1.ParamHTMLAttributes;
230+
export import ProgressHTMLAttributes = preact1.ProgressHTMLAttributes;
231+
export import SlotHTMLAttributes = preact1.SlotHTMLAttributes;
232+
export import ScriptHTMLAttributes = preact1.ScriptHTMLAttributes;
233+
export import SelectHTMLAttributes = preact1.SelectHTMLAttributes;
234+
export import SourceHTMLAttributes = preact1.SourceHTMLAttributes;
235+
export import StyleHTMLAttributes = preact1.StyleHTMLAttributes;
236+
export import TableHTMLAttributes = preact1.TableHTMLAttributes;
237+
export import TextareaHTMLAttributes = preact1.TextareaHTMLAttributes;
238+
export import TdHTMLAttributes = preact1.TdHTMLAttributes;
239+
export import ThHTMLAttributes = preact1.ThHTMLAttributes;
240+
export import TimeHTMLAttributes = preact1.TimeHTMLAttributes;
241+
export import TrackHTMLAttributes = preact1.TrackHTMLAttributes;
242+
export import VideoHTMLAttributes = preact1.VideoHTMLAttributes;
243243

244244
// Events
245-
export import TargetedEvent = JSXInternal.TargetedEvent;
246-
export import ChangeEvent = JSXInternal.TargetedEvent;
247-
export import ClipboardEvent = JSXInternal.TargetedClipboardEvent;
248-
export import CompositionEvent = JSXInternal.TargetedCompositionEvent;
249-
export import DragEvent = JSXInternal.TargetedDragEvent;
250-
export import PointerEvent = JSXInternal.TargetedPointerEvent;
251-
export import FocusEvent = JSXInternal.TargetedFocusEvent;
252-
export import FormEvent = JSXInternal.TargetedEvent;
253-
export import InvalidEvent = JSXInternal.TargetedEvent;
254-
export import KeyboardEvent = JSXInternal.TargetedKeyboardEvent;
255-
export import MouseEvent = JSXInternal.TargetedMouseEvent;
256-
export import TouchEvent = JSXInternal.TargetedTouchEvent;
257-
export import UIEvent = JSXInternal.TargetedUIEvent;
258-
export import AnimationEvent = JSXInternal.TargetedAnimationEvent;
259-
export import TransitionEvent = JSXInternal.TargetedTransitionEvent;
245+
export import TargetedEvent = preact1.TargetedEvent;
246+
export import ChangeEvent = preact1.TargetedEvent;
247+
export import ClipboardEvent = preact1.TargetedClipboardEvent;
248+
export import CompositionEvent = preact1.TargetedCompositionEvent;
249+
export import DragEvent = preact1.TargetedDragEvent;
250+
export import PointerEvent = preact1.TargetedPointerEvent;
251+
export import FocusEvent = preact1.TargetedFocusEvent;
252+
export import FormEvent = preact1.TargetedEvent;
253+
export import InvalidEvent = preact1.TargetedEvent;
254+
export import KeyboardEvent = preact1.TargetedKeyboardEvent;
255+
export import MouseEvent = preact1.TargetedMouseEvent;
256+
export import TouchEvent = preact1.TargetedTouchEvent;
257+
export import UIEvent = preact1.TargetedUIEvent;
258+
export import AnimationEvent = preact1.TargetedAnimationEvent;
259+
export import TransitionEvent = preact1.TargetedTransitionEvent;
260260

261261
// Event Handler Types
262-
export import EventHandler = JSXInternal.EventHandler;
263-
export import ChangeEventHandler = JSXInternal.GenericEventHandler;
264-
export import ClipboardEventHandler = JSXInternal.ClipboardEventHandler;
265-
export import CompositionEventHandler = JSXInternal.CompositionEventHandler;
266-
export import DragEventHandler = JSXInternal.DragEventHandler;
267-
export import PointerEventHandler = JSXInternal.PointerEventHandler;
268-
export import FocusEventHandler = JSXInternal.FocusEventHandler;
269-
export import FormEventHandler = JSXInternal.GenericEventHandler;
270-
export import InvalidEventHandler = JSXInternal.GenericEventHandler;
271-
export import KeyboardEventHandler = JSXInternal.KeyboardEventHandler;
272-
export import MouseEventHandler = JSXInternal.MouseEventHandler;
273-
export import TouchEventHandler = JSXInternal.TouchEventHandler;
274-
export import UIEventHandler = JSXInternal.UIEventHandler;
275-
export import AnimationEventHandler = JSXInternal.AnimationEventHandler;
276-
export import TransitionEventHandler = JSXInternal.TransitionEventHandler;
262+
export import EventHandler = preact1.EventHandler;
263+
export import ChangeEventHandler = preact1.GenericEventHandler;
264+
export import ClipboardEventHandler = preact1.ClipboardEventHandler;
265+
export import CompositionEventHandler = preact1.CompositionEventHandler;
266+
export import DragEventHandler = preact1.DragEventHandler;
267+
export import PointerEventHandler = preact1.PointerEventHandler;
268+
export import FocusEventHandler = preact1.FocusEventHandler;
269+
export import FormEventHandler = preact1.GenericEventHandler;
270+
export import InvalidEventHandler = preact1.GenericEventHandler;
271+
export import KeyboardEventHandler = preact1.KeyboardEventHandler;
272+
export import MouseEventHandler = preact1.MouseEventHandler;
273+
export import TouchEventHandler = preact1.TouchEventHandler;
274+
export import UIEventHandler = preact1.UIEventHandler;
275+
export import AnimationEventHandler = preact1.AnimationEventHandler;
276+
export import TransitionEventHandler = preact1.TransitionEventHandler;
277277

278278
export function createPortal(
279279
vnode: preact1.ComponentChildren,

0 commit comments

Comments
 (0)