Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions types/bootstrap/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
6 changes: 6 additions & 0 deletions types/bootstrap/js/dist/alert.d.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
6 changes: 6 additions & 0 deletions types/bootstrap/js/dist/button.d.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
14 changes: 14 additions & 0 deletions types/bootstrap/js/dist/carousel.d.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 6 additions & 0 deletions types/bootstrap/js/dist/collapse.d.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 6 additions & 0 deletions types/bootstrap/js/dist/dropdown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions types/bootstrap/js/dist/modal.d.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 6 additions & 0 deletions types/bootstrap/js/dist/offcanvas.d.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 6 additions & 0 deletions types/bootstrap/js/dist/popover.d.ts
Original file line number Diff line number Diff line change
@@ -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<Popover>;

Expand Down
6 changes: 6 additions & 0 deletions types/bootstrap/js/dist/scrollspy.d.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 6 additions & 0 deletions types/bootstrap/js/dist/tab.d.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 6 additions & 0 deletions types/bootstrap/js/dist/toast.d.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 6 additions & 0 deletions types/bootstrap/js/dist/tooltip.d.ts
Original file line number Diff line number Diff line change
@@ -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<Tooltip>;

Expand Down
14 changes: 14 additions & 0 deletions types/bootstrap/test/global-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
12 changes: 0 additions & 12 deletions types/react-blessed/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
}
}
1 change: 0 additions & 1 deletion types/react/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 1 addition & 13 deletions types/react/jsx-dev-runtime.d.ts
Original file line number Diff line number Diff line change
@@ -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<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
}
export { Fragment, JSX } from "./";

export interface JSXSource {
/**
Expand Down
14 changes: 1 addition & 13 deletions types/react/jsx-runtime.d.ts
Original file line number Diff line number Diff line change
@@ -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<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
}
export { Fragment, JSX } from "./";

/**
* Create a React element.
Expand Down
1 change: 0 additions & 1 deletion types/react/ts5.0/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any, any> {}
interface ElementClass extends React.Component<any> {
Expand Down
13 changes: 1 addition & 12 deletions types/react/ts5.0/jsx-dev-runtime.d.ts
Original file line number Diff line number Diff line change
@@ -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<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
}
export { Fragment, JSX } from "./";

export interface JSXSource {
/**
Expand Down
13 changes: 1 addition & 12 deletions types/react/ts5.0/jsx-runtime.d.ts
Original file line number Diff line number Diff line change
@@ -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<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
}
export { Fragment, JSX } from "./";

/**
* Create a React element.
Expand Down
13 changes: 1 addition & 12 deletions types/react/v17/jsx-dev-runtime.d.ts
Original file line number Diff line number Diff line change
@@ -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<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
}
export { Fragment, JSX } from "./";

export interface JSXSource {
/**
Expand Down
13 changes: 1 addition & 12 deletions types/react/v17/jsx-runtime.d.ts
Original file line number Diff line number Diff line change
@@ -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<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
}
export { Fragment, JSX } from "./";

/**
* Create a React element.
Expand Down
1 change: 0 additions & 1 deletion types/react/v18/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down
Loading