1 | import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from "./base-component";
|
2 | import Tooltip from "./tooltip";
|
3 |
|
4 | declare class Popover extends BaseComponent {
|
5 | static getInstance: GetInstanceFactory<Popover>;
|
6 |
|
7 | |
8 |
|
9 |
|
10 |
|
11 | static getOrCreateInstance: GetOrCreateInstanceFactory<Popover, Partial<Popover.Options>>;
|
12 |
|
13 | static jQueryInterface: Popover.jQueryInterface;
|
14 |
|
15 | static NAME: "popover";
|
16 |
|
17 | |
18 |
|
19 |
|
20 |
|
21 |
|
22 | static Default: Popover.Options;
|
23 |
|
24 | static DefaultType: Record<keyof Popover.Options, string>;
|
25 |
|
26 | static Event: Record<
|
27 | | "CLICK"
|
28 | | "FOCUSIN"
|
29 | | "FOCUSOUT"
|
30 | | "HIDDEN"
|
31 | | "HIDE"
|
32 | | "INSERTED"
|
33 | | "MOUSEENTER"
|
34 | | "MOUSELEAVE"
|
35 | | "SHOW"
|
36 | | "SHOWN",
|
37 | string
|
38 | >;
|
39 | constructor(element: string | Element, options?: Partial<Popover.Options>);
|
40 |
|
41 | /**
|
42 | * Reveals an element’s popover. Returns to the caller before the
|
43 | * popover has actually been shown (i.e. before the shown.bs.popover
|
44 | * event occurs). This is considered a “manual” triggering of the
|
45 | * popover. Popovers whose title and content are both zero-length are
|
46 | * never displayed.
|
47 | */
|
48 | show(): void;
|
49 |
|
50 | /**
|
51 | * Hides an element’s popover. Returns to the caller before the popover
|
52 | * has actually been hidden (i.e. before the hidden.bs.popover event
|
53 | * occurs). This is considered a “manual” triggering of the popover.
|
54 | */
|
55 | hide(): void;
|
56 |
|
57 | /**
|
58 | * Toggles an element’s popover. Returns to the caller before the
|
59 | * popover has actually been shown or hidden (i.e. before the
|
60 | * shown.bs.popover or hidden.bs.popover event occurs). This is
|
61 | * considered a “manual” triggering of the popover.
|
62 | */
|
63 | toggle(): void;
|
64 |
|
65 | /**
|
66 | * Gives an element’s popover the ability to be shown. Popovers are
|
67 | * enabled by default.
|
68 | */
|
69 | enable(): void;
|
70 |
|
71 | /**
|
72 | * Removes the ability for an element’s popover to be shown. The popover
|
73 | * will only be able to be shown if it is re-enabled.
|
74 | */
|
75 | disable(): void;
|
76 |
|
77 | /**
|
78 | * Toggles the ability for an element’s popover to be shown or hidden.
|
79 | */
|
80 | toggleEnabled(): void;
|
81 |
|
82 | /**
|
83 | * Updates the position of an element’s popover.
|
84 | */
|
85 | update(): void;
|
86 |
|
87 | /**
|
88 | * Gives a way to change the popover’s content after its initialization.
|
89 | */
|
90 | setContent(content?: Record<string, string | Element | Tooltip.SetContentFunction | null>): void;
|
91 | }
|
92 |
|
93 | declare namespace Popover {
|
94 | enum Events {
|
95 | |
96 |
|
97 |
|
98 | show = "show.bs.popover",
|
99 |
|
100 | |
101 |
|
102 |
|
103 |
|
104 | shown = "shown.bs.popover",
|
105 |
|
106 | |
107 |
|
108 |
|
109 |
|
110 | hide = "hide.bs.popover",
|
111 |
|
112 | |
113 |
|
114 |
|
115 |
|
116 | hidden = "hidden.bs.popover",
|
117 |
|
118 | |
119 |
|
120 |
|
121 |
|
122 | inserted = "inserted.bs.popover",
|
123 | }
|
124 |
|
125 | interface Options extends Tooltip.Options {
|
126 | |
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 | content: string | Element | JQuery | ((this: HTMLElement) => string | Element | JQuery);
|
135 | }
|
136 |
|
137 | type jQueryInterface = (
|
138 | config?:
|
139 | | Partial<Options>
|
140 | | "show"
|
141 | | "hide"
|
142 | | "toggle"
|
143 | | "enable"
|
144 | | "disable"
|
145 | | "toggleEnabled"
|
146 | | "update"
|
147 | | "setContent"
|
148 | | "dispose",
|
149 | ) => JQuery;
|
150 | }
|
151 |
|
152 | export default Popover;
|