mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 Merge PR #53690 [@types/bootstrap] v5 components getInstance() can return null by @pbrn46
This commit is contained in:
2
types/bootstrap/js/dist/carousel.d.ts
vendored
2
types/bootstrap/js/dist/carousel.d.ts
vendored
@@ -43,7 +43,7 @@ declare class Carousel extends BaseComponent {
|
||||
* Static method which allows you to get the carousel instance associated
|
||||
* with a DOM element.
|
||||
*/
|
||||
static getInstance(element: Element, options?: Partial<Carousel.Options>): Carousel;
|
||||
static getInstance(element: Element, options?: Partial<Carousel.Options>): Carousel | null;
|
||||
|
||||
static jQueryInterface: Carousel.jQueryInterface;
|
||||
|
||||
|
||||
2
types/bootstrap/js/dist/collapse.d.ts
vendored
2
types/bootstrap/js/dist/collapse.d.ts
vendored
@@ -30,7 +30,7 @@ declare class Collapse extends BaseComponent {
|
||||
* Static method which allows you to get the collapse instance associated
|
||||
* with a DOM element.
|
||||
*/
|
||||
static getInstance(element: Element, options?: Partial<Collapse.Options>): Collapse;
|
||||
static getInstance(element: Element, options?: Partial<Collapse.Options>): Collapse | null;
|
||||
|
||||
static jQueryInterface: Collapse.jQueryInterface;
|
||||
|
||||
|
||||
2
types/bootstrap/js/dist/dropdown.d.ts
vendored
2
types/bootstrap/js/dist/dropdown.d.ts
vendored
@@ -28,7 +28,7 @@ declare class Dropdown extends BaseComponent {
|
||||
* Static method which allows you to get the dropdown instance associated
|
||||
* with a DOM element.
|
||||
*/
|
||||
static getInstance(element: Element, options?: Partial<Dropdown.Options>): Dropdown;
|
||||
static getInstance(element: Element, options?: Partial<Dropdown.Options>): Dropdown | null;
|
||||
|
||||
static jQueryInterface: Dropdown.jQueryInterface;
|
||||
|
||||
|
||||
2
types/bootstrap/js/dist/modal.d.ts
vendored
2
types/bootstrap/js/dist/modal.d.ts
vendored
@@ -32,7 +32,7 @@ declare class Modal extends BaseComponent {
|
||||
* Static method which allows you to get the modal instance associated with
|
||||
* a DOM element
|
||||
*/
|
||||
static getInstance(element: Element, options?: Partial<Modal.Options>): Modal;
|
||||
static getInstance(element: Element, options?: Partial<Modal.Options>): Modal | null;
|
||||
|
||||
static jQueryInterface: Modal.jQueryInterface;
|
||||
|
||||
|
||||
2
types/bootstrap/js/dist/offcanvas.d.ts
vendored
2
types/bootstrap/js/dist/offcanvas.d.ts
vendored
@@ -11,7 +11,7 @@ declare class Offcanvas extends BaseComponent {
|
||||
* Static method which allows you to get the offcanvas instance associated to a
|
||||
* DOM element, you can use it like this: getInstance(offcanvas)
|
||||
*/
|
||||
static getInstance(element: Element): Offcanvas;
|
||||
static getInstance(element: Element): Offcanvas | null;
|
||||
|
||||
static jQueryInterface: Offcanvas.jQueryInterface;
|
||||
|
||||
|
||||
2
types/bootstrap/js/dist/popover.d.ts
vendored
2
types/bootstrap/js/dist/popover.d.ts
vendored
@@ -55,7 +55,7 @@ declare class Popover extends BaseComponent {
|
||||
* Static method which allows you to get the popover instance associated
|
||||
* with a DOM element
|
||||
*/
|
||||
static getInstance(element: Element, options?: Partial<Popover.Options>): Popover;
|
||||
static getInstance(element: Element, options?: Partial<Popover.Options>): Popover | null;
|
||||
|
||||
static jQueryInterface: Popover.jQueryInterface;
|
||||
|
||||
|
||||
2
types/bootstrap/js/dist/scrollspy.d.ts
vendored
2
types/bootstrap/js/dist/scrollspy.d.ts
vendored
@@ -14,7 +14,7 @@ declare class ScrollSpy extends BaseComponent {
|
||||
* Static method which allows you to get the scrollspy instance associated
|
||||
* with a DOM element
|
||||
*/
|
||||
static getInstance(element: Element, options?: Partial<ScrollSpy.Options>): ScrollSpy;
|
||||
static getInstance(element: Element, options?: Partial<ScrollSpy.Options>): ScrollSpy | null;
|
||||
|
||||
static jQueryInterface: ScrollSpy.jQueryInterface;
|
||||
|
||||
|
||||
2
types/bootstrap/js/dist/tab.d.ts
vendored
2
types/bootstrap/js/dist/tab.d.ts
vendored
@@ -14,7 +14,7 @@ declare class Tab extends BaseComponent {
|
||||
* Static method which allows you to get the tab instance associated with a
|
||||
* DOM element
|
||||
*/
|
||||
static getInstance(element: Element): Tab;
|
||||
static getInstance(element: Element): Tab | null;
|
||||
|
||||
static jQueryInterface: Tab.jQueryInterface;
|
||||
|
||||
|
||||
2
types/bootstrap/js/dist/toast.d.ts
vendored
2
types/bootstrap/js/dist/toast.d.ts
vendored
@@ -21,7 +21,7 @@ declare class Toast extends BaseComponent {
|
||||
* Static method which allows you to get the toast instance associated
|
||||
* with a DOM element
|
||||
*/
|
||||
static getInstance(element: Element, options?: Partial<Toast.Options>): Toast;
|
||||
static getInstance(element: Element, options?: Partial<Toast.Options>): Toast | null;
|
||||
|
||||
static jQueryInterface: Toast.jQueryInterface;
|
||||
|
||||
|
||||
2
types/bootstrap/js/dist/tooltip.d.ts
vendored
2
types/bootstrap/js/dist/tooltip.d.ts
vendored
@@ -53,7 +53,7 @@ declare class Tooltip extends BaseComponent {
|
||||
* Static method which allows you to get the tooltip instance associated
|
||||
* with a DOM element
|
||||
*/
|
||||
static getInstance(element: Element): Tooltip;
|
||||
static getInstance(element: Element): Tooltip | null;
|
||||
|
||||
static jQueryInterface: Tooltip.jQueryInterface;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ const element = new Element();
|
||||
// $ExpectType Carousel
|
||||
new Carousel(element, { interval: 1000 });
|
||||
|
||||
// $ExpectType Carousel
|
||||
// $ExpectType Carousel | null
|
||||
Carousel.getInstance(element);
|
||||
|
||||
// $ExpectType string
|
||||
|
||||
@@ -6,7 +6,7 @@ const element = new Element();
|
||||
// $ExpectType Collapse
|
||||
new Collapse(element, { parent: '.parent' });
|
||||
|
||||
// $ExpectType Collapse
|
||||
// $ExpectType Collapse | null
|
||||
Collapse.getInstance(element);
|
||||
|
||||
// $ExpectType string
|
||||
|
||||
@@ -6,7 +6,7 @@ const element = new Element();
|
||||
new Dropdown(element, { flip: true }); // $ExpectError
|
||||
new Dropdown(element, { offset: [0, 2] }); // $ExpectType Dropdown
|
||||
|
||||
// $ExpectType Dropdown
|
||||
// $ExpectType Dropdown | null
|
||||
Dropdown.getInstance(element);
|
||||
|
||||
// $ExpectType string
|
||||
|
||||
@@ -6,7 +6,7 @@ const element = new Element();
|
||||
// $ExpectType Modal
|
||||
new Modal(element, { backdrop: 'static' });
|
||||
|
||||
// $ExpectType Modal
|
||||
// $ExpectType Modal | null
|
||||
Modal.getInstance(element);
|
||||
|
||||
// $ExpectType string
|
||||
|
||||
@@ -6,7 +6,7 @@ const element = new Element();
|
||||
// $ExpectType Offcanvas
|
||||
new Offcanvas(element);
|
||||
|
||||
// $ExpectType Offcanvas
|
||||
// $ExpectType Offcanvas | null
|
||||
Offcanvas.getInstance(element);
|
||||
|
||||
// $ExpectType string
|
||||
|
||||
@@ -6,7 +6,7 @@ const element = new Element();
|
||||
// $ExpectType Popover
|
||||
new Popover(element, { delay: 0.5, animation: true });
|
||||
|
||||
// $ExpectType Popover
|
||||
// $ExpectType Popover | null
|
||||
Popover.getInstance(element);
|
||||
|
||||
// $ExpectType string
|
||||
|
||||
@@ -6,7 +6,7 @@ const element = new Element();
|
||||
// $ExpectType ScrollSpy
|
||||
new ScrollSpy(element, { offset: 10 });
|
||||
|
||||
// $ExpectType ScrollSpy
|
||||
// $ExpectType ScrollSpy | null
|
||||
ScrollSpy.getInstance(element);
|
||||
|
||||
// $ExpectType string
|
||||
|
||||
@@ -6,7 +6,7 @@ const element = new Element();
|
||||
// $ExpectType Tab
|
||||
new Tab(element);
|
||||
|
||||
// $ExpectType Tab
|
||||
// $ExpectType Tab | null
|
||||
Tab.getInstance(element);
|
||||
|
||||
element.addEventListener(Tab.Events.hidden, event => {
|
||||
|
||||
@@ -6,7 +6,7 @@ const element = new Element();
|
||||
// $ExpectType Toast
|
||||
new Toast(element, { animation: false });
|
||||
|
||||
// $ExpectType Toast
|
||||
// $ExpectType Toast | null
|
||||
Toast.getInstance(element);
|
||||
|
||||
// $ExpectType string
|
||||
|
||||
@@ -6,7 +6,7 @@ const element = new Element();
|
||||
// $ExpectType Tooltip
|
||||
new Tooltip(element, { delay: 0.5, title: () => "foo", customClass: () => "custom-class" });
|
||||
|
||||
// $ExpectType Tooltip
|
||||
// $ExpectType Tooltip | null
|
||||
Tooltip.getInstance(element);
|
||||
|
||||
// $ExpectType string
|
||||
|
||||
Reference in New Issue
Block a user