From 6f9d2a29cc3e22db02970a6aeace2fe66521ead0 Mon Sep 17 00:00:00 2001 From: Gareth Jones <3151613+G-Rath@users.noreply.github.com> Date: Tue, 2 Jun 2026 03:30:26 +1200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75062=20feat(b?= =?UTF-8?q?ootstrap):=20define=20globals=20as=20part=20of=20each=20compone?= =?UTF-8?q?nt=20by=20@G-Rath?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/bootstrap/index.d.ts | 37 -------------------------- types/bootstrap/js/dist/alert.d.ts | 6 +++++ types/bootstrap/js/dist/button.d.ts | 6 +++++ types/bootstrap/js/dist/carousel.d.ts | 14 ++++++++++ types/bootstrap/js/dist/collapse.d.ts | 6 +++++ types/bootstrap/js/dist/dropdown.d.ts | 6 +++++ types/bootstrap/js/dist/modal.d.ts | 20 ++++++++++++++ types/bootstrap/js/dist/offcanvas.d.ts | 6 +++++ types/bootstrap/js/dist/popover.d.ts | 6 +++++ types/bootstrap/js/dist/scrollspy.d.ts | 6 +++++ types/bootstrap/js/dist/tab.d.ts | 6 +++++ types/bootstrap/js/dist/toast.d.ts | 6 +++++ types/bootstrap/js/dist/tooltip.d.ts | 6 +++++ types/bootstrap/test/global-script.ts | 14 ++++++++++ 14 files changed, 108 insertions(+), 37 deletions(-) diff --git a/types/bootstrap/index.d.ts b/types/bootstrap/index.d.ts index f0e5d9f7d1196f..03aac42bc4b283 100644 --- a/types/bootstrap/index.d.ts +++ b/types/bootstrap/index.d.ts @@ -13,41 +13,4 @@ import Tab from "./js/dist/tab"; import Toast from "./js/dist/toast"; import Tooltip from "./js/dist/tooltip"; -declare global { - interface JQuery { - alert: Alert.jQueryInterface; - button: Button.jQueryInterface; - carousel: Carousel.jQueryInterface; - collapse: Collapse.jQueryInterface; - dropdown: Dropdown.jQueryInterface; - tab: Tab.jQueryInterface; - modal: Modal.jQueryInterface; - offcanvas: Offcanvas.jQueryInterface; - [Popover.NAME]: Popover.jQueryInterface; - scrollspy: ScrollSpy.jQueryInterface; - toast: Toast.jQueryInterface; - [Tooltip.NAME]: Tooltip.jQueryInterface; - } - - interface Element { - addEventListener( - type: Carousel.Events | "slide.bs.carousel" | "slid.bs.carousel", - listener: (this: Element, ev: Carousel.Event) => any, - options?: boolean | AddEventListenerOptions, - ): void; - - addEventListener( - type: - | Modal.Events - | "show.bs.modal" - | "shown.bs.modal" - | "hide.bs.modal" - | "hidden.bs.modal" - | "hidePrevented.bs.modal", - listener: (this: Element, ev: Modal.Event) => any, - options?: boolean | AddEventListenerOptions, - ): void; - } -} - export { Alert, Button, Carousel, Collapse, Dropdown, Modal, Offcanvas, Popover, ScrollSpy, Tab, Toast, Tooltip }; diff --git a/types/bootstrap/js/dist/alert.d.ts b/types/bootstrap/js/dist/alert.d.ts index 94c022e17a1757..41e17385b3d815 100644 --- a/types/bootstrap/js/dist/alert.d.ts +++ b/types/bootstrap/js/dist/alert.d.ts @@ -1,5 +1,11 @@ import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from "./base-component"; +declare global { + interface JQuery { + alert: Alert.jQueryInterface; + } +} + declare class Alert extends BaseComponent { static NAME: "alert"; static jQueryInterface: Alert.jQueryInterface; diff --git a/types/bootstrap/js/dist/button.d.ts b/types/bootstrap/js/dist/button.d.ts index 8afc37e6dc47a2..67b07878f56c70 100644 --- a/types/bootstrap/js/dist/button.d.ts +++ b/types/bootstrap/js/dist/button.d.ts @@ -1,5 +1,11 @@ import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from "./base-component"; +declare global { + interface JQuery { + button: Button.jQueryInterface; + } +} + declare class Button extends BaseComponent { /** * Toggles push state. Gives the button the appearance that it has been activated. diff --git a/types/bootstrap/js/dist/carousel.d.ts b/types/bootstrap/js/dist/carousel.d.ts index 8bffb232fc2c04..15937d7a646281 100644 --- a/types/bootstrap/js/dist/carousel.d.ts +++ b/types/bootstrap/js/dist/carousel.d.ts @@ -1,5 +1,19 @@ import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from "./base-component"; +declare global { + interface JQuery { + carousel: Carousel.jQueryInterface; + } + + interface Element { + addEventListener( + type: Carousel.Events | "slide.bs.carousel" | "slid.bs.carousel", + listener: (this: Element, ev: Carousel.Event) => any, + options?: boolean | AddEventListenerOptions, + ): void; + } +} + declare class Carousel extends BaseComponent { /** * Default settings of this plugin diff --git a/types/bootstrap/js/dist/collapse.d.ts b/types/bootstrap/js/dist/collapse.d.ts index 7b07ad69dbe48b..5ba2005c9f2a5b 100644 --- a/types/bootstrap/js/dist/collapse.d.ts +++ b/types/bootstrap/js/dist/collapse.d.ts @@ -1,5 +1,11 @@ import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from "./base-component"; +declare global { + interface JQuery { + collapse: Collapse.jQueryInterface; + } +} + declare class Collapse extends BaseComponent { /** * Static method which allows you to get the collapse instance associated diff --git a/types/bootstrap/js/dist/dropdown.d.ts b/types/bootstrap/js/dist/dropdown.d.ts index f4131a1b94e98d..f13891c0ded2fe 100644 --- a/types/bootstrap/js/dist/dropdown.d.ts +++ b/types/bootstrap/js/dist/dropdown.d.ts @@ -2,6 +2,12 @@ import * as Popper from "@popperjs/core"; import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from "./base-component"; import Tooltip from "./tooltip"; +declare global { + interface JQuery { + dropdown: Dropdown.jQueryInterface; + } +} + declare class Dropdown extends BaseComponent { /** * Static method which allows you to get the dropdown instance associated diff --git a/types/bootstrap/js/dist/modal.d.ts b/types/bootstrap/js/dist/modal.d.ts index 5c6e935500c4b9..ed7098a0b24e7c 100644 --- a/types/bootstrap/js/dist/modal.d.ts +++ b/types/bootstrap/js/dist/modal.d.ts @@ -1,5 +1,25 @@ import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from "./base-component"; +declare global { + interface JQuery { + modal: Modal.jQueryInterface; + } + + interface Element { + addEventListener( + type: + | Modal.Events + | "show.bs.modal" + | "shown.bs.modal" + | "hide.bs.modal" + | "hidden.bs.modal" + | "hidePrevented.bs.modal", + listener: (this: Element, ev: Modal.Event) => any, + options?: boolean | AddEventListenerOptions, + ): void; + } +} + declare class Modal extends BaseComponent { /** * Static method which allows you to get the modal instance associated with diff --git a/types/bootstrap/js/dist/offcanvas.d.ts b/types/bootstrap/js/dist/offcanvas.d.ts index 9279a0f12da12d..ab33586507271b 100644 --- a/types/bootstrap/js/dist/offcanvas.d.ts +++ b/types/bootstrap/js/dist/offcanvas.d.ts @@ -1,5 +1,11 @@ import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from "./base-component"; +declare global { + interface JQuery { + offcanvas: Offcanvas.jQueryInterface; + } +} + declare class Offcanvas extends BaseComponent { /** * Static method which allows you to get the offcanvas instance associated with a DOM element diff --git a/types/bootstrap/js/dist/popover.d.ts b/types/bootstrap/js/dist/popover.d.ts index f7a10be0c70abf..d3a2cd7bcf2348 100644 --- a/types/bootstrap/js/dist/popover.d.ts +++ b/types/bootstrap/js/dist/popover.d.ts @@ -1,6 +1,12 @@ import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from "./base-component"; import Tooltip from "./tooltip"; +declare global { + interface JQuery { + [Popover.NAME]: Popover.jQueryInterface; + } +} + declare class Popover extends BaseComponent { static getInstance: GetInstanceFactory; diff --git a/types/bootstrap/js/dist/scrollspy.d.ts b/types/bootstrap/js/dist/scrollspy.d.ts index f47e93614ae0c7..6f8568fefb7c45 100644 --- a/types/bootstrap/js/dist/scrollspy.d.ts +++ b/types/bootstrap/js/dist/scrollspy.d.ts @@ -1,5 +1,11 @@ import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from "./base-component"; +declare global { + interface JQuery { + scrollspy: ScrollSpy.jQueryInterface; + } +} + declare class ScrollSpy extends BaseComponent { /** * Static method which allows you to get the scrollspy instance associated diff --git a/types/bootstrap/js/dist/tab.d.ts b/types/bootstrap/js/dist/tab.d.ts index 0937cca4ba1bed..9bcc2f4db1bd66 100644 --- a/types/bootstrap/js/dist/tab.d.ts +++ b/types/bootstrap/js/dist/tab.d.ts @@ -1,6 +1,12 @@ import BaseComponent, { GetOrCreateInstanceFactory } from "./base-component"; import { GetInstanceFactory } from "./base-component.d"; +declare global { + interface JQuery { + tab: Tab.jQueryInterface; + } +} + declare class Tab extends BaseComponent { /** * Static method which allows you to get the tab instance associated with a diff --git a/types/bootstrap/js/dist/toast.d.ts b/types/bootstrap/js/dist/toast.d.ts index 071a8176f5790f..5be3c13fb35a39 100644 --- a/types/bootstrap/js/dist/toast.d.ts +++ b/types/bootstrap/js/dist/toast.d.ts @@ -1,5 +1,11 @@ import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from "./base-component"; +declare global { + interface JQuery { + toast: Toast.jQueryInterface; + } +} + declare class Toast extends BaseComponent { /** * Static method which allows you to get the toast instance associated diff --git a/types/bootstrap/js/dist/tooltip.d.ts b/types/bootstrap/js/dist/tooltip.d.ts index 2430dfa51c8859..7db4c7cc76572d 100644 --- a/types/bootstrap/js/dist/tooltip.d.ts +++ b/types/bootstrap/js/dist/tooltip.d.ts @@ -1,6 +1,12 @@ import * as Popper from "@popperjs/core"; import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from "./base-component"; +declare global { + interface JQuery { + [Tooltip.NAME]: Tooltip.jQueryInterface; + } +} + declare class Tooltip extends BaseComponent { static getInstance: GetInstanceFactory; diff --git a/types/bootstrap/test/global-script.ts b/types/bootstrap/test/global-script.ts index 1b288a8ccbb9d9..68f2e9eac0c942 100644 --- a/types/bootstrap/test/global-script.ts +++ b/types/bootstrap/test/global-script.ts @@ -8,3 +8,17 @@ new bootstrap.Alert("#alert"); new bootstrap.Alert(document.querySelector("#alert")!); new bootstrap.Modal("#myModal", {}); new bootstrap.Modal(document.querySelector("#myModal")!, {}); + +const element = new Element(); + +element.addEventListener("show.bs.modal", event => { + event.target; // $ExpectType HTMLElement + event.relatedTarget; // $ExpectType HTMLElement | undefined +}); + +element.addEventListener("slid.bs.carousel", event => { + event.direction; // $ExpectType Direction + event.relatedTarget; // $ExpectType Element + event.from; // $ExpectType number + event.to; // $ExpectType number +}); From 49ed2e3d3a1d88c397f0d40ea84f47f768823bf0 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Mon, 1 Jun 2026 18:52:15 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75029=20Re-exp?= =?UTF-8?q?ort=20the=20React=20JSX=20namespace=20by=20@remcohaszing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/react-blessed/index.d.ts | 12 ------------ types/react/index.d.ts | 1 - types/react/jsx-dev-runtime.d.ts | 14 +------------- types/react/jsx-runtime.d.ts | 14 +------------- types/react/ts5.0/index.d.ts | 1 - types/react/ts5.0/jsx-dev-runtime.d.ts | 13 +------------ types/react/ts5.0/jsx-runtime.d.ts | 13 +------------ types/react/v17/jsx-dev-runtime.d.ts | 13 +------------ types/react/v17/jsx-runtime.d.ts | 13 +------------ types/react/v18/index.d.ts | 1 - types/react/v18/jsx-dev-runtime.d.ts | 14 +------------- types/react/v18/jsx-runtime.d.ts | 14 +------------- types/react/v18/ts5.0/index.d.ts | 1 - types/react/v18/ts5.0/jsx-dev-runtime.d.ts | 13 +------------ types/react/v18/ts5.0/jsx-runtime.d.ts | 13 +------------ 15 files changed, 10 insertions(+), 140 deletions(-) diff --git a/types/react-blessed/index.d.ts b/types/react-blessed/index.d.ts index dea61b91d6b2b0..607e7807a1e0dc 100644 --- a/types/react-blessed/index.d.ts +++ b/types/react-blessed/index.d.ts @@ -288,15 +288,3 @@ declare module "react" { interface IntrinsicElements extends BlessedIntrinsicElementsPrefixed, BlessedIntrinsicElements {} } } - -// augment react/jsx-runtime JSX when new JSX transform is used -declare module "react/jsx-runtime" { - namespace JSX { - interface IntrinsicElements extends BlessedIntrinsicElementsPrefixed, BlessedIntrinsicElements {} - } -} -declare module "react/jsx-dev-runtime" { - namespace JSX { - interface IntrinsicElements extends BlessedIntrinsicElementsPrefixed, BlessedIntrinsicElements {} - } -} diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 681f8928f9bf8d..4dd970bf5b1c17 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -4129,7 +4129,6 @@ declare namespace React { componentStack?: string | null; } - // Keep in sync with JSX namespace in ./jsx-runtime.d.ts and ./jsx-dev-runtime.d.ts namespace JSX { // We don't just alias React.ElementType because React.ElementType // historically does more than we need it to. diff --git a/types/react/jsx-dev-runtime.d.ts b/types/react/jsx-dev-runtime.d.ts index d28644c6cefa45..39c573f911b431 100644 --- a/types/react/jsx-dev-runtime.d.ts +++ b/types/react/jsx-dev-runtime.d.ts @@ -1,17 +1,5 @@ import * as React from "./"; -export { Fragment } from "./"; - -export namespace JSX { - type ElementType = React.JSX.ElementType; - interface Element extends React.JSX.Element {} - interface ElementClass extends React.JSX.ElementClass {} - interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {} - interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {} - type LibraryManagedAttributes = React.JSX.LibraryManagedAttributes; - interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {} - interface IntrinsicClassAttributes extends React.JSX.IntrinsicClassAttributes {} - interface IntrinsicElements extends React.JSX.IntrinsicElements {} -} +export { Fragment, JSX } from "./"; export interface JSXSource { /** diff --git a/types/react/jsx-runtime.d.ts b/types/react/jsx-runtime.d.ts index e9fea27d741f52..8a54c127462a94 100644 --- a/types/react/jsx-runtime.d.ts +++ b/types/react/jsx-runtime.d.ts @@ -1,17 +1,5 @@ import * as React from "./"; -export { Fragment } from "./"; - -export namespace JSX { - type ElementType = React.JSX.ElementType; - interface Element extends React.JSX.Element {} - interface ElementClass extends React.JSX.ElementClass {} - interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {} - interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {} - type LibraryManagedAttributes = React.JSX.LibraryManagedAttributes; - interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {} - interface IntrinsicClassAttributes extends React.JSX.IntrinsicClassAttributes {} - interface IntrinsicElements extends React.JSX.IntrinsicElements {} -} +export { Fragment, JSX } from "./"; /** * Create a React element. diff --git a/types/react/ts5.0/index.d.ts b/types/react/ts5.0/index.d.ts index f3c6be2c82be1b..73b1e875694f18 100644 --- a/types/react/ts5.0/index.d.ts +++ b/types/react/ts5.0/index.d.ts @@ -4128,7 +4128,6 @@ declare namespace React { componentStack?: string | null; } - // Keep in sync with JSX namespace in ./jsx-runtime.d.ts and ./jsx-dev-runtime.d.ts namespace JSX { interface Element extends React.ReactElement {} interface ElementClass extends React.Component { diff --git a/types/react/ts5.0/jsx-dev-runtime.d.ts b/types/react/ts5.0/jsx-dev-runtime.d.ts index 87d1dfe383eb10..39c573f911b431 100644 --- a/types/react/ts5.0/jsx-dev-runtime.d.ts +++ b/types/react/ts5.0/jsx-dev-runtime.d.ts @@ -1,16 +1,5 @@ import * as React from "./"; -export { Fragment } from "./"; - -export namespace JSX { - interface Element extends React.JSX.Element {} - interface ElementClass extends React.JSX.ElementClass {} - interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {} - interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {} - type LibraryManagedAttributes = React.JSX.LibraryManagedAttributes; - interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {} - interface IntrinsicClassAttributes extends React.JSX.IntrinsicClassAttributes {} - interface IntrinsicElements extends React.JSX.IntrinsicElements {} -} +export { Fragment, JSX } from "./"; export interface JSXSource { /** diff --git a/types/react/ts5.0/jsx-runtime.d.ts b/types/react/ts5.0/jsx-runtime.d.ts index 8cc3b974528719..8a54c127462a94 100644 --- a/types/react/ts5.0/jsx-runtime.d.ts +++ b/types/react/ts5.0/jsx-runtime.d.ts @@ -1,16 +1,5 @@ import * as React from "./"; -export { Fragment } from "./"; - -export namespace JSX { - interface Element extends React.JSX.Element {} - interface ElementClass extends React.JSX.ElementClass {} - interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {} - interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {} - type LibraryManagedAttributes = React.JSX.LibraryManagedAttributes; - interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {} - interface IntrinsicClassAttributes extends React.JSX.IntrinsicClassAttributes {} - interface IntrinsicElements extends React.JSX.IntrinsicElements {} -} +export { Fragment, JSX } from "./"; /** * Create a React element. diff --git a/types/react/v17/jsx-dev-runtime.d.ts b/types/react/v17/jsx-dev-runtime.d.ts index 927ae7e7b18860..7e46b5dd29964d 100644 --- a/types/react/v17/jsx-dev-runtime.d.ts +++ b/types/react/v17/jsx-dev-runtime.d.ts @@ -1,17 +1,6 @@ // Expose `JSX` namespace in `global` namespace import * as React from "./"; -export { Fragment } from "./"; - -export namespace JSX { - interface Element extends React.JSX.Element {} - interface ElementClass extends React.JSX.ElementClass {} - interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {} - interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {} - type LibraryManagedAttributes = React.JSX.LibraryManagedAttributes; - interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {} - interface IntrinsicClassAttributes extends React.JSX.IntrinsicClassAttributes {} - interface IntrinsicElements extends React.JSX.IntrinsicElements {} -} +export { Fragment, JSX } from "./"; export interface JSXSource { /** diff --git a/types/react/v17/jsx-runtime.d.ts b/types/react/v17/jsx-runtime.d.ts index a60cb5bb084bb6..7b3692e35bf5e0 100644 --- a/types/react/v17/jsx-runtime.d.ts +++ b/types/react/v17/jsx-runtime.d.ts @@ -1,17 +1,6 @@ // Expose `JSX` namespace in `global` namespace import * as React from "./"; -export { Fragment } from "./"; - -export namespace JSX { - interface Element extends React.JSX.Element {} - interface ElementClass extends React.JSX.ElementClass {} - interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {} - interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {} - type LibraryManagedAttributes = React.JSX.LibraryManagedAttributes; - interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {} - interface IntrinsicClassAttributes extends React.JSX.IntrinsicClassAttributes {} - interface IntrinsicElements extends React.JSX.IntrinsicElements {} -} +export { Fragment, JSX } from "./"; /** * Create a React element. diff --git a/types/react/v18/index.d.ts b/types/react/v18/index.d.ts index e393c4ab8f13a7..a88c8481e57497 100644 --- a/types/react/v18/index.d.ts +++ b/types/react/v18/index.d.ts @@ -4284,7 +4284,6 @@ declare namespace React { digest?: string | null; } - // Keep in sync with JSX namespace in ./jsx-runtime.d.ts and ./jsx-dev-runtime.d.ts namespace JSX { type ElementType = GlobalJSXElementType; interface Element extends GlobalJSXElement {} diff --git a/types/react/v18/jsx-dev-runtime.d.ts b/types/react/v18/jsx-dev-runtime.d.ts index d28644c6cefa45..39c573f911b431 100644 --- a/types/react/v18/jsx-dev-runtime.d.ts +++ b/types/react/v18/jsx-dev-runtime.d.ts @@ -1,17 +1,5 @@ import * as React from "./"; -export { Fragment } from "./"; - -export namespace JSX { - type ElementType = React.JSX.ElementType; - interface Element extends React.JSX.Element {} - interface ElementClass extends React.JSX.ElementClass {} - interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {} - interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {} - type LibraryManagedAttributes = React.JSX.LibraryManagedAttributes; - interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {} - interface IntrinsicClassAttributes extends React.JSX.IntrinsicClassAttributes {} - interface IntrinsicElements extends React.JSX.IntrinsicElements {} -} +export { Fragment, JSX } from "./"; export interface JSXSource { /** diff --git a/types/react/v18/jsx-runtime.d.ts b/types/react/v18/jsx-runtime.d.ts index e9fea27d741f52..8a54c127462a94 100644 --- a/types/react/v18/jsx-runtime.d.ts +++ b/types/react/v18/jsx-runtime.d.ts @@ -1,17 +1,5 @@ import * as React from "./"; -export { Fragment } from "./"; - -export namespace JSX { - type ElementType = React.JSX.ElementType; - interface Element extends React.JSX.Element {} - interface ElementClass extends React.JSX.ElementClass {} - interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {} - interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {} - type LibraryManagedAttributes = React.JSX.LibraryManagedAttributes; - interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {} - interface IntrinsicClassAttributes extends React.JSX.IntrinsicClassAttributes {} - interface IntrinsicElements extends React.JSX.IntrinsicElements {} -} +export { Fragment, JSX } from "./"; /** * Create a React element. diff --git a/types/react/v18/ts5.0/index.d.ts b/types/react/v18/ts5.0/index.d.ts index ac1396c7b97bcd..6bb9083f9de5f1 100644 --- a/types/react/v18/ts5.0/index.d.ts +++ b/types/react/v18/ts5.0/index.d.ts @@ -4284,7 +4284,6 @@ declare namespace React { digest?: string | null; } - // Keep in sync with JSX namespace in ./jsx-runtime.d.ts and ./jsx-dev-runtime.d.ts namespace JSX { interface Element extends GlobalJSXElement {} interface ElementClass extends GlobalJSXElementClass {} diff --git a/types/react/v18/ts5.0/jsx-dev-runtime.d.ts b/types/react/v18/ts5.0/jsx-dev-runtime.d.ts index 87d1dfe383eb10..39c573f911b431 100644 --- a/types/react/v18/ts5.0/jsx-dev-runtime.d.ts +++ b/types/react/v18/ts5.0/jsx-dev-runtime.d.ts @@ -1,16 +1,5 @@ import * as React from "./"; -export { Fragment } from "./"; - -export namespace JSX { - interface Element extends React.JSX.Element {} - interface ElementClass extends React.JSX.ElementClass {} - interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {} - interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {} - type LibraryManagedAttributes = React.JSX.LibraryManagedAttributes; - interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {} - interface IntrinsicClassAttributes extends React.JSX.IntrinsicClassAttributes {} - interface IntrinsicElements extends React.JSX.IntrinsicElements {} -} +export { Fragment, JSX } from "./"; export interface JSXSource { /** diff --git a/types/react/v18/ts5.0/jsx-runtime.d.ts b/types/react/v18/ts5.0/jsx-runtime.d.ts index 8cc3b974528719..8a54c127462a94 100644 --- a/types/react/v18/ts5.0/jsx-runtime.d.ts +++ b/types/react/v18/ts5.0/jsx-runtime.d.ts @@ -1,16 +1,5 @@ import * as React from "./"; -export { Fragment } from "./"; - -export namespace JSX { - interface Element extends React.JSX.Element {} - interface ElementClass extends React.JSX.ElementClass {} - interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {} - interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {} - type LibraryManagedAttributes = React.JSX.LibraryManagedAttributes; - interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {} - interface IntrinsicClassAttributes extends React.JSX.IntrinsicClassAttributes {} - interface IntrinsicElements extends React.JSX.IntrinsicElements {} -} +export { Fragment, JSX } from "./"; /** * Create a React element.