plossy 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1210 @@
1
+ // Plossy — deklaracje typów publicznego API.
2
+ // Opisują to, co udokumentowane: opcje, metody i zdarzenia komponentów oraz obiekt `Plossy`.
3
+ // Plik jest utrzymywany ręcznie — po zmianie opcji lub metod komponentu popraw go tutaj.
4
+
5
+ /** Element albo selektor CSS. */
6
+ export type Target = string | Element;
7
+
8
+ /** Położenie elementów pływających (drop, tooltip, popover…). */
9
+ export type Placement =
10
+ | 'top'
11
+ | 'top-start'
12
+ | 'top-end'
13
+ | 'bottom'
14
+ | 'bottom-start'
15
+ | 'bottom-end'
16
+ | 'left'
17
+ | 'left-start'
18
+ | 'left-end'
19
+ | 'right'
20
+ | 'right-start'
21
+ | 'right-end';
22
+
23
+ /** Zdarzenie `pl:*`. W `detail` zawsze jest instancja komponentu, który je wysłał. */
24
+ export type PlossyEvent<D = Record<string, any>> = CustomEvent<D & { component: Component<any> }>;
25
+
26
+ // ── Komponent bazowy ──────────────────────────────────────────────────────
27
+
28
+ export class Component<O = Record<string, any>> {
29
+ /** Domyślne opcje komponentu. */
30
+ static defaults: Record<string, any>;
31
+ /** Nazwa opcji, do której trafia „goła" wartość atrybutu (np. `data-pl-toggle="#cel"`). */
32
+ static primary: string | null;
33
+ /** Nazwa nadana przy rejestracji (`data-pl-{nazwa}`). */
34
+ static componentName: string;
35
+
36
+ constructor(el: Element, options?: Partial<O>);
37
+
38
+ readonly el: HTMLElement;
39
+ options: O;
40
+
41
+ /** Punkt wejścia komponentu — nadpisywany w klasach potomnych. */
42
+ init(): void;
43
+ /** `addEventListener` z automatycznym sprzątaniem w `destroy()`. Zwraca funkcję odpinającą. */
44
+ on(target: EventTarget | null | undefined, type: string, handler: (event: any) => void, options?: boolean | AddEventListenerOptions): () => void;
45
+ /** Rejestruje funkcję sprzątającą wywoływaną w `destroy()`. */
46
+ onDestroy(fn: () => void): void;
47
+ /** Wysyła zdarzenie `pl:{type}` na elemencie. Zwraca `false`, gdy anulowano je przez `preventDefault()`. */
48
+ emit(type: string, detail?: Record<string, any>, cancelable?: boolean): boolean;
49
+ /** Odpina zdarzenia i usuwa instancję z elementu. */
50
+ destroy(): void;
51
+ }
52
+
53
+ // ── Opcje komponentów ─────────────────────────────────────────────────────
54
+
55
+ export interface ComboboxItem {
56
+ value: string;
57
+ label?: string;
58
+ disabled?: boolean;
59
+ [key: string]: any;
60
+ }
61
+
62
+ export type NotificationStatus = '' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info';
63
+ export type NotificationPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-left' | 'bottom-center' | 'bottom-right';
64
+
65
+ export interface AccordionOptions {
66
+ /** Pozwala otworzyć wiele pozycji naraz. */
67
+ multiple?: boolean;
68
+ /** Pozwala zamknąć wszystkie pozycje. */
69
+ collapsible?: boolean;
70
+ /** Indeks pozycji otwartej na starcie. */
71
+ active?: number | null;
72
+ duration?: number;
73
+ }
74
+
75
+ export interface AlertOptions {
76
+ /** Czas animacji zamykania (ms) */
77
+ duration?: number;
78
+ /** Automatyczne zamknięcie po czasie (ms); 0 = wyłączone. */
79
+ timeout?: number;
80
+ /** Usuwa element z DOM po zamknięciu (false = tylko `hidden`) */
81
+ remove?: boolean;
82
+ selClose?: string;
83
+ }
84
+
85
+ export interface ComboboxOptions {
86
+ placeholder?: string;
87
+ /** Przycisk czyszczenia. */
88
+ clearable?: boolean;
89
+ /** Pozwala dodać własną pozycję. */
90
+ creatable?: boolean;
91
+ /** Filtrowanie przez wpisywanie. */
92
+ search?: boolean;
93
+ /** Wyróżnia dopasowany fragment. */
94
+ highlight?: boolean;
95
+ /** Domyślnie: true dla pojedynczego wyboru. */
96
+ closeOnSelect?: boolean | null;
97
+ /** Lista pozycji (JS) */
98
+ options?: Array<string | ComboboxItem> | string | null;
99
+ /** Funkcja async (q) => [...] lub adres URL (doklejane ?q) */
100
+ source?: string | ((query: string) => ComboboxItem[] | string[] | Promise<ComboboxItem[] | string[]>) | null;
101
+ /** Minimalna długość zapytania dla `source`. */
102
+ minLength?: number;
103
+ /** Opóźnienie zapytań `source` (ms) */
104
+ delay?: number;
105
+ placement?: Placement;
106
+ offset?: number;
107
+ emptyText?: string;
108
+ loadingText?: string;
109
+ createText?: string;
110
+ }
111
+
112
+ export interface CountdownOptions {
113
+ /** Data docelowa (ISO 8601 lub znacznik czasu w ms) */
114
+ date?: number | string;
115
+ /** Alternatywnie: odliczanie względne w sekundach. */
116
+ seconds?: number;
117
+ autostart?: boolean;
118
+ /** Minimalna liczba cyfr w komórce. */
119
+ pad?: number;
120
+ /** Po zakończeniu odliczanie względne zaczyna się od nowa. */
121
+ reload?: boolean;
122
+ }
123
+
124
+ export interface CounterOptions {
125
+ /** Wartość końcowa; domyślnie liczba z treści elementu. */
126
+ to?: number | null;
127
+ from?: number;
128
+ duration?: number;
129
+ delay?: number;
130
+ decimals?: number;
131
+ /** Separator tysięcy; domyślnie wg locale (pl-PL: spacja niełamiąca) */
132
+ separator?: string | null;
133
+ /** Separator dziesiętny; domyślnie wg locale (pl-PL: przecinek) */
134
+ decimal?: string | null;
135
+ prefix?: string;
136
+ suffix?: string;
137
+ locale?: string;
138
+ /** Linear | ease-out | ease-in-out. */
139
+ easing?: 'linear' | 'ease-out' | 'ease-in-out';
140
+ /** Animuj tylko przy pierwszym wejściu w widok. */
141
+ once?: boolean;
142
+ /** Start po wejściu w widok. */
143
+ autostart?: boolean;
144
+ }
145
+
146
+ export interface DatepickerOptions {
147
+ inline?: boolean;
148
+ /** Wybór zakresu dat. */
149
+ range?: boolean;
150
+ /** Wartość początkowa (ISO; zakres: "od/do") */
151
+ value?: string;
152
+ /** 'YYYY-MM-DD', 'today' lub przesunięcie w dniach: '+7', '-30'. */
153
+ min?: string | null;
154
+ max?: string | null;
155
+ /** Dni tygodnia: 0 = niedziela … 6 = sobota, np. "0,6". */
156
+ disabledDays?: string;
157
+ /** Konkretne daty ISO rozdzielone przecinkami. */
158
+ disabledDates?: string;
159
+ locale?: string;
160
+ format?: string;
161
+ /** Łącznik dat zakresu. */
162
+ separator?: string;
163
+ /** 1 = poniedziałek. */
164
+ weekStart?: number;
165
+ /** Nazwa ukrytego pola z wartością ISO. */
166
+ name?: string;
167
+ /** Przyciski „Dziś" i „Wyczyść". */
168
+ footer?: boolean;
169
+ closeOnSelect?: boolean;
170
+ placement?: Placement;
171
+ offset?: number;
172
+ /** Nadpisanie tekstów interfejsu. */
173
+ labels?: Record<string, string> | null;
174
+ }
175
+
176
+ export interface DropOptions {
177
+ /** Selektor przełącznika (domyślnie poprzedni element) */
178
+ toggle?: string | null;
179
+ /** Click | hover (domyślnie click; hover dla podmenu) */
180
+ mode?: 'click' | 'hover' | null;
181
+ /** Np. bottom-start (domyślnie; right-start dla podmenu) */
182
+ pos?: Placement | null;
183
+ /** Odstęp od przełącznika w px (domyślnie 8; 4 dla podmenu) */
184
+ offset?: number | null;
185
+ /** Opóźnienie otwarcia w trybie hover (ms) */
186
+ delayShow?: number;
187
+ /** Opóźnienie zamknięcia w trybie hover (ms) */
188
+ delayHide?: number;
189
+ /** Auto | true | false. */
190
+ closeOnClick?: 'auto' | boolean;
191
+ /** Szerokość co najmniej taka jak przełącznika. */
192
+ matchWidth?: boolean;
193
+ flip?: boolean;
194
+ shift?: boolean;
195
+ }
196
+
197
+ export interface FilterOptions {
198
+ /** Selektor kontenera z elementami. */
199
+ target?: string;
200
+ /** Selektor kontrolek aktywnych na starcie. */
201
+ selActive?: string | false;
202
+ /** Slide | fade | delayed-fade | false. */
203
+ animation?: 'slide' | 'fade' | 'delayed-fade' | false;
204
+ duration?: number;
205
+ }
206
+
207
+ export interface AutosizeOptions {
208
+ /** Minimalna liczba wierszy (0 = z atrybutu rows / CSS) */
209
+ minRows?: number;
210
+ /** Po przekroczeniu pojawia się przewijanie (0 = bez limitu) */
211
+ maxRows?: number;
212
+ }
213
+
214
+ export interface PasswordToggleOptions {
215
+ /** Selektor pola; domyślnie pole hasła w tym samym opakowaniu. */
216
+ target?: string;
217
+ iconShow?: string;
218
+ iconHide?: string;
219
+ labelShow?: string;
220
+ labelHide?: string;
221
+ }
222
+
223
+ export interface CharCountOptions {
224
+ /** Limit; domyślnie z atrybutu maxlength (0 = sam licznik) */
225
+ max?: number;
226
+ /** Selektor elementu licznika; domyślnie .pl-form-count w polu lub nowy element. */
227
+ target?: string;
228
+ /** Od jakiej części limitu licznik ostrzega. */
229
+ warn?: number;
230
+ template?: string;
231
+ }
232
+
233
+ export interface FormClearOptions {
234
+ }
235
+
236
+ export interface FormValidateOptions {
237
+ /** Sprawdza pole po opuszczeniu (blur) i poprawia na bieżąco. */
238
+ live?: boolean;
239
+ /** Oznacza poprawne pola klasą .pl-form-success. */
240
+ success?: boolean;
241
+ /** Potrząsa błędnymi polami przy próbie wysłania. */
242
+ shake?: boolean;
243
+ /** Przenosi fokus do pierwszego błędnego pola. */
244
+ focus?: boolean;
245
+ }
246
+
247
+ export interface HeightMatchOptions {
248
+ /** Wyrównywane elementy. */
249
+ target?: string;
250
+ /** Wyrównuj osobno w każdym wizualnym rzędzie. */
251
+ row?: boolean;
252
+ }
253
+
254
+ export interface HeightViewportOptions {
255
+ /** True → odejmij odległość elementu od góry strony; liczba → px. */
256
+ offsetTop?: boolean | number;
257
+ /** True → odejmij wysokość następnego elementu; 1–100 → % okna; >100 → px; '80px', '10vh' lub selektor. */
258
+ offsetBottom?: boolean | number | string;
259
+ /** Rozciągnij element tak, by strona wypełniła całe okno. */
260
+ expand?: boolean;
261
+ /** Dolna granica w px. */
262
+ min?: number;
263
+ }
264
+
265
+ export interface IconOptions {
266
+ name?: string;
267
+ stroke?: number;
268
+ }
269
+
270
+ export interface LightboxOptions {
271
+ /** Slide | fade. */
272
+ animation?: string;
273
+ /** Po ostatniej pozycji wraca do pierwszej. */
274
+ loop?: boolean;
275
+ /** Pasek miniatur. */
276
+ thumbs?: boolean;
277
+ /** Licznik „3 / 8". */
278
+ counter?: boolean;
279
+ }
280
+
281
+ export interface ModalOptions {
282
+ /** Kliknięcie tła zamyka. */
283
+ backdropClose?: boolean;
284
+ /** Klawisz Esc zamyka. */
285
+ escClose?: boolean;
286
+ /** Kliknięcie tła nie zamyka — okno „potrząsa głową". */
287
+ static?: boolean;
288
+ /** Pozwala otworzyć nakładkę nad inną. */
289
+ stack?: boolean;
290
+ }
291
+
292
+ export interface NavbarOptions {
293
+ /** Po ilu px przewinięcia pasek dostaje klasę `cls`. */
294
+ offset?: number;
295
+ cls?: string;
296
+ /** Chowaj przy przewijaniu w dół. */
297
+ hide?: boolean;
298
+ /** Od ilu px przewinięcia wolno chować. */
299
+ hideOffset?: number;
300
+ /** Minimalny ruch (px), który zmienia stan. */
301
+ tolerance?: number;
302
+ /** Selektor przewijanego kontenera (domyślnie okno) */
303
+ container?: string | null;
304
+ }
305
+
306
+ export interface NavOptions {
307
+ /** Pozwala otworzyć wiele podmenu naraz. */
308
+ multiple?: boolean;
309
+ /** Pozwala zamknąć wszystkie. */
310
+ collapsible?: boolean;
311
+ duration?: number;
312
+ }
313
+
314
+ export interface NotificationOptions {
315
+ message?: string;
316
+ title?: string;
317
+ status?: NotificationStatus;
318
+ pos?: NotificationPosition;
319
+ timeout?: number;
320
+ icon?: string | boolean | null;
321
+ close?: boolean;
322
+ group?: string;
323
+ cls?: string;
324
+ progress?: boolean;
325
+ }
326
+
327
+ export interface OffcanvasOptions {
328
+ /** Kliknięcie tła zamyka. */
329
+ backdropClose?: boolean;
330
+ /** Klawisz Esc zamyka. */
331
+ escClose?: boolean;
332
+ /** Kliknięcie tła nie zamyka — okno „potrząsa głową". */
333
+ static?: boolean;
334
+ /** Pozwala otworzyć nakładkę nad inną. */
335
+ stack?: boolean;
336
+ /** Left | right | top | bottom. */
337
+ side?: 'left' | 'right' | 'top' | 'bottom';
338
+ /** False = bez przyciemnienia tła. */
339
+ overlay?: boolean;
340
+ /** Zamykanie gestem przesunięcia (panele boczne, dotyk) */
341
+ swipe?: boolean;
342
+ /** Kliknięcie odnośnika do kotwicy (#sekcja) zamyka panel. */
343
+ anchorClose?: boolean;
344
+ }
345
+
346
+ export interface OtpOptions {
347
+ length?: number;
348
+ /** Numeric | alphanumeric. */
349
+ type?: string;
350
+ /** Kreska co N znaków (0 = brak) */
351
+ separator?: number;
352
+ /** Ukrywa znaki jak w polu hasła. */
353
+ masked?: boolean;
354
+ /** Nazwa tworzonego pola ukrytego (gdy brak własnego <input>) */
355
+ name?: string;
356
+ autofocus?: boolean;
357
+ /** Po wpisaniu całego kodu wysyła formularz. */
358
+ submit?: boolean;
359
+ label?: string;
360
+ }
361
+
362
+ export interface ParallaxOptions {
363
+ x?: number | string | null;
364
+ y?: number | string | null;
365
+ scale?: number | string | null;
366
+ rotate?: number | string | null;
367
+ opacity?: number | string | null;
368
+ blur?: number | string | null;
369
+ grayscale?: number | string | null;
370
+ saturate?: number | string | null;
371
+ brightness?: number | string | null;
372
+ hue?: number | string | null;
373
+ bgx?: number | string | null;
374
+ bgy?: number | string | null;
375
+ /** Wykładnik krzywej: 1 liniowo, >1 wolny start, <1 szybki start. */
376
+ easing?: number;
377
+ /** Przesunięcie początku (px, vh, % wysokości celu) */
378
+ start?: number | string;
379
+ /** Przesunięcie końca. */
380
+ end?: number | string;
381
+ /** Aktywny od podanej szerokości. */
382
+ media?: number | string | false;
383
+ /** Element, którego przejście przez okno wyznacza postęp ('!.x' → najbliższy przodek) */
384
+ target?: string | false | null;
385
+ }
386
+
387
+ export interface PopoverOptions {
388
+ title?: string;
389
+ content?: string;
390
+ /** Selektor elementu, który staje się treścią popovera. */
391
+ target?: string | null;
392
+ pos?: Placement;
393
+ /** Click | hover | focus. */
394
+ mode?: string;
395
+ offset?: number;
396
+ /** Przycisk zamykania. */
397
+ close?: boolean;
398
+ /** Zamykanie kliknięciem poza popoverem. */
399
+ dismiss?: boolean;
400
+ /** Traktuj title / content jako HTML. */
401
+ html?: boolean;
402
+ /** Dodatkowe klasy, np. pl-popover-large. */
403
+ cls?: string;
404
+ delayShow?: number;
405
+ delayHide?: number;
406
+ /** Przenieś fokus do popovera, jeśli ma elementy interaktywne. */
407
+ focus?: boolean;
408
+ }
409
+
410
+ export interface QuantityOptions {
411
+ min?: number | null;
412
+ max?: number | null;
413
+ step?: number | null;
414
+ /** Przytrzymanie przycisku powtarza zmianę. */
415
+ repeat?: boolean;
416
+ minusLabel?: string;
417
+ plusLabel?: string;
418
+ }
419
+
420
+ export interface RangeOptions {
421
+ /** Dwa kciuki (element to opakowanie z dwoma polami) */
422
+ dual?: boolean;
423
+ /** Dymek z wartością: true (przy hoverze / fokusie) albo 'always'. */
424
+ tooltip?: boolean | 'always';
425
+ /** Liczba znaczników podziałki generowanych pod suwakiem. */
426
+ ticks?: number;
427
+ /** Minimalny odstęp między kciukami (dual) */
428
+ gap?: number;
429
+ prefix?: string;
430
+ suffix?: string;
431
+ /** Selektor elementu, do którego trafia sformatowana wartość. */
432
+ output?: string;
433
+ }
434
+
435
+ export interface RatingOptions {
436
+ value?: number;
437
+ max?: number;
438
+ /** Nazwa pól radio (wartość trafia do formularza) */
439
+ name?: string;
440
+ readonly?: boolean;
441
+ /** Ponowne kliknięcie wybranej gwiazdki zeruje ocenę. */
442
+ clearable?: boolean;
443
+ label?: string;
444
+ /** Odmiana do etykiet ARIA. */
445
+ star?: string;
446
+ }
447
+
448
+ export interface ScrollOptions {
449
+ /** Odstęp od górnej krawędzi (np. wysokość przyklejonego nagłówka) */
450
+ offset?: number;
451
+ /** Ms albo 'auto' (zależnie od dystansu) */
452
+ duration?: number | 'auto';
453
+ /** Linear | ease-in | ease-out | ease-in-out | spring. */
454
+ easing?: string;
455
+ /** Aktualizuj adres. */
456
+ hash?: boolean;
457
+ /** Przenieś fokus na cel. */
458
+ focus?: boolean;
459
+ }
460
+
461
+ export interface ScrollspyOptions {
462
+ /** Klasa (klasy) dodawana po wejściu w widok. */
463
+ cls?: string;
464
+ /** Elementy obserwowane; domyślnie sam element. */
465
+ target?: string | null;
466
+ /** Ukryj (.pl-invisible) do czasu wejścia w widok. */
467
+ hidden?: boolean;
468
+ /** Powiększa (+) lub pomniejsza (−) obszar widoku w pionie, px. */
469
+ offsetTop?: number;
470
+ /** Jw. w poziomie. */
471
+ offsetLeft?: number;
472
+ /** Powtarzaj przy każdym wejściu. */
473
+ repeat?: boolean;
474
+ /** Opóźnienie między kolejnymi elementami, ms. */
475
+ delay?: number;
476
+ }
477
+
478
+ export interface ScrollspyNavOptions {
479
+ /** Klasa aktywnej pozycji. */
480
+ cls?: string;
481
+ /** Przodek linku, który dostaje klasę (false → sam link) */
482
+ closest?: string | boolean;
483
+ /** Płynne przewijanie po kliknięciu. */
484
+ scroll?: boolean;
485
+ /** Odstęp od górnej krawędzi, px. */
486
+ offset?: number;
487
+ /** Pierwsza pozycja aktywna także przed pierwszą sekcją. */
488
+ overflow?: boolean;
489
+ duration?: number | 'auto';
490
+ }
491
+
492
+ export interface SliderOptions {
493
+ /** Wyśrodkowuje aktywny element. */
494
+ center?: boolean;
495
+ /** Bez zapętlenia. */
496
+ finite?: boolean;
497
+ /** Przewija o cały zestaw widocznych elementów. */
498
+ sets?: boolean;
499
+ autoplay?: boolean;
500
+ autoplayInterval?: number;
501
+ pauseOnHover?: boolean;
502
+ draggable?: boolean;
503
+ index?: number;
504
+ /** Mnożnik szybkości animacji. */
505
+ velocity?: number;
506
+ }
507
+
508
+ export interface SlideshowOptions {
509
+ /** Slide | fade | scale | push | pull | zoom. */
510
+ animation?: string;
511
+ autoplay?: boolean;
512
+ autoplayInterval?: number;
513
+ pauseOnHover?: boolean;
514
+ /** False = wysokość tylko z min-height. */
515
+ ratio?: string | false;
516
+ minHeight?: string;
517
+ maxHeight?: string;
518
+ finite?: boolean;
519
+ draggable?: boolean;
520
+ kenburns?: boolean;
521
+ /** Pasek postępu autoodtwarzania. */
522
+ progress?: boolean;
523
+ index?: number;
524
+ velocity?: number;
525
+ }
526
+
527
+ export interface SortableOptions {
528
+ /** Sortable o tej samej grupie wymieniają się elementami. */
529
+ group?: string;
530
+ /** Selektor uchwytu; puste = cały element. */
531
+ handle?: string;
532
+ animation?: number;
533
+ clsDrag?: string;
534
+ clsPlaceholder?: string;
535
+ clsEmpty?: string;
536
+ threshold?: number;
537
+ }
538
+
539
+ export interface SpotlightOptions {
540
+ /** Selektor elementów podświetlanych (domyślnie sam element) */
541
+ target?: string | null;
542
+ }
543
+
544
+ export interface StickyOptions {
545
+ /** Odstęp od górnej krawędzi okna po przyklejeniu (px, vh) */
546
+ offset?: number | string;
547
+ /** Dodatkowy dystans przewijania, po którym element się przykleja (px, vh, % lub selektor) */
548
+ top?: number | string;
549
+ /** Alias `end` (true → rodzic) */
550
+ bottom?: boolean | string;
551
+ /** Granica: 'parent' / true, '!.selektor' (najbliższy przodek) albo selektor. */
552
+ end?: boolean | string;
553
+ clsActive?: string;
554
+ clsInactive?: string;
555
+ /** Klasa animacji przy przyklejeniu (i odwrócona przy odklejeniu) */
556
+ animation?: string | false;
557
+ /** Chowaj przy przewijaniu w dół, pokazuj przy przewijaniu w górę. */
558
+ showOnUp?: boolean;
559
+ /** Aktywny od podanej szerokości (px, '@m', zapytanie media) */
560
+ media?: number | string | false;
561
+ zIndex?: number | null;
562
+ }
563
+
564
+ export interface StrengthOptions {
565
+ minLength?: number;
566
+ /** Lista wymagań odhaczanych na żywo. */
567
+ rules?: boolean;
568
+ /** Etykieta słowna. */
569
+ label?: boolean;
570
+ labels?: string | string[];
571
+ /** Selektor pola, gdy leży poza komponentem. */
572
+ input?: string;
573
+ emptyLabel?: string;
574
+ }
575
+
576
+ export interface SwitcherOptions {
577
+ /** Selektor kontenera paneli; domyślnie następne rodzeństwo .pl-switcher. */
578
+ connect?: string | null;
579
+ /** Selektor pozycji, np. '> *'; domyślnie '> li' lub bezpośrednie dzieci. */
580
+ toggle?: string | null;
581
+ /** Indeks pozycji aktywnej na starcie. */
582
+ active?: number | null;
583
+ /** True → delikatne wejście; false → brak; klasa lub „klasa-naprzód, klasa-wstecz". */
584
+ animation?: boolean | string;
585
+ /** Przesunięcie palcem zmienia panel. */
586
+ swiping?: boolean;
587
+ /** Synchronizacja z adresem (#id panelu lub href pozycji) */
588
+ followHash?: boolean;
589
+ }
590
+
591
+ export interface ToggleOptions {
592
+ /** Selektor, 'next', 'prev', 'parent', '> .x'; domyślnie href lub następny element. */
593
+ target?: string | null;
594
+ /** Klasa przełączana na celu; bez niej przełączany jest atrybut hidden. */
595
+ cls?: string;
596
+ /** True → płynna wysokość; nazwa klasy animacji (opcjonalnie „wejście, wyjście") */
597
+ animation?: boolean | string;
598
+ /** Click | hover (można łączyć: "click, hover") */
599
+ mode?: string;
600
+ /** Wiele celów pokazywanych po kolei. */
601
+ queued?: boolean;
602
+ /** Aktywny dopiero od podanej szerokości (px, '@m' lub zapytanie media) */
603
+ media?: number | string | false;
604
+ duration?: number;
605
+ }
606
+
607
+ export interface TooltipOptions {
608
+ title?: string;
609
+ pos?: Placement;
610
+ offset?: number;
611
+ /** Opóźnienie pokazania (ms) */
612
+ delay?: number;
613
+ /** Dodatkowe klasy dymka, np. pl-tooltip-light. */
614
+ cls?: string;
615
+ /** Traktuj tytuł jako HTML. */
616
+ html?: boolean;
617
+ }
618
+
619
+ export interface TotopOptions {
620
+ /** Po ilu pikselach przewinięcia przycisk staje się aktywny. */
621
+ offset?: number;
622
+ /** Selektor elementu, do którego wracamy (domyślnie: góra strony / cel z href) */
623
+ target?: string;
624
+ /** Po przewinięciu przenieś fokus na cel (dostępność) */
625
+ focus?: boolean;
626
+ cls?: string;
627
+ }
628
+
629
+ export interface UploadOptions {
630
+ /** Domyślnie wg atrybutu `multiple` pola. */
631
+ multiple?: boolean | null;
632
+ /** Np. "image/*, .pdf" (domyślnie wg atrybutu `accept` pola) */
633
+ accept?: string;
634
+ /** MB, 0 = bez limitu. */
635
+ maxSize?: number;
636
+ /** 0 = bez limitu. */
637
+ maxFiles?: number;
638
+ /** Adres, pod który wysyłane są pliki (XHR) */
639
+ url?: string;
640
+ /** Nazwa pola w FormData. */
641
+ name?: string;
642
+ method?: string;
643
+ /** Wysyłaj od razu po wybraniu. */
644
+ auto?: boolean;
645
+ /** Miniatury obrazów. */
646
+ thumbnails?: boolean;
647
+ /** Selektor własnej listy plików. */
648
+ list?: string;
649
+ /** Pokazuj komunikaty błędów pod strefą. */
650
+ messages?: boolean;
651
+ }
652
+
653
+ export interface VideoOptions {
654
+ /** True | false | inview | hover. */
655
+ autoplay?: boolean | string;
656
+ /** Wycisz przed automatycznym odtwarzaniem (wymóg przeglądarek) */
657
+ automute?: boolean;
658
+ /** Element reagujący na kursor ('!.x' → najbliższy przodek); domyślnie samo wideo. */
659
+ hoverTarget?: boolean;
660
+ /** Po zatrzymaniu wróć do początku. */
661
+ rewind?: boolean;
662
+ /** Część wideo, która musi być widoczna (tryb inview) */
663
+ threshold?: number;
664
+ }
665
+
666
+ // ── Komponenty ────────────────────────────────────────────────────────────
667
+
668
+ /** Pozycja akordeonu lub rozwijanej nawigacji: indeks albo element. */
669
+ export type ItemRef = number | Element;
670
+
671
+ export class Accordion extends Component<AccordionOptions> {
672
+ readonly items: HTMLElement[];
673
+ toggle(item: ItemRef): void;
674
+ show(item: ItemRef): Promise<void>;
675
+ hide(item: ItemRef): Promise<void>;
676
+ }
677
+
678
+ export class Alert extends Component<AlertOptions> {
679
+ /** Zamyka alert z animacją. */
680
+ close(): Promise<void>;
681
+ hide(): void;
682
+ }
683
+
684
+ export class Combobox extends Component<ComboboxOptions> {
685
+ /** Wybrana wartość; przy wyborze wielokrotnym — tablica wartości. */
686
+ readonly value: string | string[];
687
+ open(): void;
688
+ close(): Promise<void>;
689
+ toggle(): void;
690
+ setValue(value: string | string[] | null, silent?: boolean): void;
691
+ clear(): void;
692
+ setOptions(list: Array<string | ComboboxItem>, silent?: boolean): void;
693
+ refresh(): void;
694
+ }
695
+
696
+ export class Countdown extends Component<CountdownOptions> {
697
+ readonly running: boolean;
698
+ start(): void;
699
+ stop(): void;
700
+ reset(options?: Partial<CountdownOptions>): void;
701
+ }
702
+
703
+ export class Counter extends Component<CounterOptions> {
704
+ start(to?: number): void;
705
+ stop(): void;
706
+ reset(): void;
707
+ }
708
+
709
+ export class Datepicker extends Component<DatepickerOptions> {
710
+ /** Wartość w formacie ISO (`YYYY-MM-DD`); dla zakresu `od/do`. */
711
+ readonly value: string;
712
+ open(): void;
713
+ close(): Promise<void>;
714
+ toggle(): void;
715
+ setDate(value: string | Date | Array<string | Date> | null, silent?: boolean): void;
716
+ getDate(): Date | [Date | null, Date | null] | null;
717
+ clear(): void;
718
+ update(options?: Partial<DatepickerOptions>): void;
719
+ }
720
+
721
+ export class Drop extends Component<DropOptions> {
722
+ show(): void;
723
+ hide(): Promise<void>;
724
+ toggle(): void;
725
+ }
726
+
727
+ export interface FilterState {
728
+ filter?: Record<string, string>;
729
+ sort?: [attribute: string, order: 'asc' | 'desc'] | [];
730
+ }
731
+
732
+ export class Filter extends Component<FilterOptions> {
733
+ apply(control: Element): void;
734
+ setState(state: FilterState, animate?: boolean): void;
735
+ getState(): FilterState;
736
+ reset(): void;
737
+ }
738
+
739
+ export class Autosize extends Component<AutosizeOptions> {
740
+ update(): void;
741
+ }
742
+
743
+ export class PasswordToggle extends Component<PasswordToggleOptions> {
744
+ show(): void;
745
+ hide(): void;
746
+ toggle(): void;
747
+ }
748
+
749
+ export class CharCount extends Component<CharCountOptions> {
750
+ update(): void;
751
+ }
752
+
753
+ export class FormClear extends Component<FormClearOptions> {
754
+ clear(): void;
755
+ }
756
+
757
+ export class FormValidate extends Component<FormValidateOptions> {
758
+ /** Sprawdza cały formularz; `true`, gdy wszystkie pola są poprawne. */
759
+ validate(): boolean;
760
+ validateField(field: Element): boolean;
761
+ reset(): void;
762
+ }
763
+
764
+ export class HeightMatch extends Component<HeightMatchOptions> {}
765
+ export class HeightViewport extends Component<HeightViewportOptions> {}
766
+
767
+ export class Icon extends Component<IconOptions> {
768
+ render(name?: string): void;
769
+ }
770
+
771
+ export interface LightboxItem {
772
+ source: string;
773
+ type?: string;
774
+ caption?: string;
775
+ thumb?: string;
776
+ alt?: string;
777
+ poster?: string;
778
+ }
779
+
780
+ export interface LightboxPanelOptions extends LightboxOptions {
781
+ items: LightboxItem[];
782
+ index?: number;
783
+ }
784
+
785
+ export interface LightboxPanel {
786
+ show(index?: number): Promise<void>;
787
+ hide(): void;
788
+ next(): void;
789
+ prev(): void;
790
+ destroy(): void;
791
+ }
792
+
793
+ export class Lightbox extends Component<LightboxOptions> {
794
+ show(index?: number): void;
795
+ hide(): void;
796
+ next(): void;
797
+ prev(): void;
798
+ }
799
+
800
+ export class Modal extends Component<ModalOptions> {
801
+ show(opener?: Element): Promise<void>;
802
+ hide(): void;
803
+ toggle(opener?: Element): void;
804
+ }
805
+
806
+ export class Offcanvas extends Component<OffcanvasOptions> {
807
+ show(opener?: Element): Promise<void>;
808
+ hide(): void;
809
+ toggle(opener?: Element): void;
810
+ }
811
+
812
+ export class Navbar extends Component<NavbarOptions> {
813
+ show(): void;
814
+ hide(): void;
815
+ update(): void;
816
+ }
817
+
818
+ export class Nav extends Component<NavOptions> {
819
+ toggle(item: ItemRef): void;
820
+ show(item: ItemRef): Promise<void>;
821
+ hide(item: ItemRef): Promise<void>;
822
+ }
823
+
824
+ /** Opcje `Plossy.notification({...})` — szersze niż atrybutu `data-pl-notification`. */
825
+ export interface NotificationConfig extends NotificationOptions {
826
+ /** Przycisk akcji w powiadomieniu. */
827
+ action?: { label: string; onClick?: (notification: NotificationHandle) => void } | null;
828
+ /** Traktuje `message` jako HTML. */
829
+ html?: boolean;
830
+ onClose?: ((notification: NotificationHandle) => void) | null;
831
+ }
832
+
833
+ export interface NotificationHandle {
834
+ readonly el: HTMLElement;
835
+ readonly options: NotificationConfig;
836
+ close(): void;
837
+ update(message: string): void;
838
+ }
839
+
840
+ export class Notification extends Component<NotificationOptions> {
841
+ /** Pokazuje powiadomienie; `null`, gdy anulowano `pl:beforeshow`. */
842
+ show(): NotificationHandle | null;
843
+ }
844
+
845
+ export class Otp extends Component<OtpOptions> {
846
+ value: string;
847
+ readonly complete: boolean;
848
+ setValue(code: string): void;
849
+ clear(focus?: boolean): void;
850
+ focus(): void;
851
+ error(options?: { clear?: boolean }): void;
852
+ success(): void;
853
+ reset(): void;
854
+ disable(state?: boolean): void;
855
+ }
856
+
857
+ export class Parallax extends Component<ParallaxOptions> {}
858
+
859
+ export class Popover extends Component<PopoverOptions> {
860
+ show(): void;
861
+ hide(): Promise<void>;
862
+ toggle(): void;
863
+ update(options?: Partial<PopoverOptions>): void;
864
+ }
865
+
866
+ export class Quantity extends Component<QuantityOptions> {
867
+ value: number;
868
+ set(value: number | string): void;
869
+ /** Zmienia wartość o krok: `1` w górę, `-1` w dół. */
870
+ step(direction?: number): void;
871
+ disable(state?: boolean): void;
872
+ }
873
+
874
+ export class Range extends Component<RangeOptions> {
875
+ /** Wartość; dla dwóch uchwytów — para `[od, do]`. */
876
+ readonly value: number | [number, number];
877
+ set(value: number | [number, number]): void;
878
+ update(): void;
879
+ }
880
+
881
+ export class Rating extends Component<RatingOptions> {
882
+ value: number;
883
+ set(value: number): void;
884
+ clear(): void;
885
+ disable(state?: boolean): void;
886
+ }
887
+
888
+ export class Scroll extends Component<ScrollOptions> {}
889
+ export class Scrollspy extends Component<ScrollspyOptions> {}
890
+ export class ScrollspyNav extends Component<ScrollspyNavOptions> {}
891
+
892
+ /** Cel pokazu slajdu: indeks albo kierunek. */
893
+ export type SlideTarget = number | 'next' | 'previous';
894
+
895
+ export class Slider extends Component<SliderOptions> {
896
+ show(target: SlideTarget): void;
897
+ startAutoplay(): void;
898
+ stopAutoplay(): void;
899
+ update(): void;
900
+ }
901
+
902
+ export class Slideshow extends Component<SlideshowOptions> {
903
+ show(target: SlideTarget): void;
904
+ startAutoplay(): void;
905
+ stopAutoplay(): void;
906
+ update(): void;
907
+ }
908
+
909
+ export class Sortable extends Component<SortableOptions> {
910
+ /** Kolejność elementów jako lista wartości atrybutu (domyślnie `id`). */
911
+ toArray(attribute?: string): string[];
912
+ refresh(): void;
913
+ }
914
+
915
+ export class Spotlight extends Component<SpotlightOptions> {}
916
+ export class Sticky extends Component<StickyOptions> {}
917
+
918
+ export interface StrengthResult {
919
+ score: number;
920
+ label: string;
921
+ rules: Record<string, boolean>;
922
+ }
923
+
924
+ export class Strength extends Component<StrengthOptions> {
925
+ readonly score: number;
926
+ readonly rules: Record<string, boolean>;
927
+ check(value?: string): StrengthResult;
928
+ update(): void;
929
+ }
930
+
931
+ export class Switcher extends Component<SwitcherOptions> {
932
+ readonly index: number;
933
+ show(index: number): void;
934
+ }
935
+
936
+ export class Toggle extends Component<ToggleOptions> {
937
+ toggle(): Promise<void>;
938
+ isToggled(): boolean;
939
+ }
940
+
941
+ export class Tooltip extends Component<TooltipOptions> {
942
+ show(): void;
943
+ hide(): Promise<void>;
944
+ setTitle(title: string): void;
945
+ }
946
+
947
+ export class Totop extends Component<TotopOptions> {
948
+ scroll(): void;
949
+ refresh(): void;
950
+ }
951
+
952
+ export class Upload extends Component<UploadOptions> {
953
+ readonly files: File[];
954
+ add(files: FileList | File[]): void;
955
+ remove(file: File): void;
956
+ clear(): void;
957
+ /** Otwiera systemowe okno wyboru plików. */
958
+ browse(): void;
959
+ upload(): void;
960
+ setProgress(file: File, percent: number): void;
961
+ complete(file: File, response?: any): void;
962
+ fail(file: File, message?: string): void;
963
+ }
964
+
965
+ export class Video extends Component<VideoOptions> {
966
+ play(): void;
967
+ pause(): void;
968
+ }
969
+
970
+ // ── Obiekt Plossy ─────────────────────────────────────────────────────────
971
+
972
+ /** `Plossy.nazwa(element, opcje)` — tworzy komponent albo zwraca istniejącą instancję; `null`, gdy brak elementu. */
973
+ export type Factory<C, O> = (target: Target, options?: Partial<O>) => C | null;
974
+
975
+ export interface DialogOptions extends ModalOptions {
976
+ /** Dodatkowe klasy elementu `<dialog>`. */
977
+ cls?: string;
978
+ [key: string]: any;
979
+ }
980
+
981
+ export interface ModalFactory extends Factory<Modal, ModalOptions> {
982
+ /** Otwiera modal z podaną treścią (HTML lub węzeł) i usuwa go po zamknięciu. */
983
+ dialog(content: string | Node, options?: DialogOptions): Modal;
984
+ alert(message: string, options?: DialogOptions): Promise<void>;
985
+ confirm(message: string, options?: DialogOptions): Promise<boolean>;
986
+ prompt(message: string, value?: string, options?: DialogOptions): Promise<string | null>;
987
+ /** Domyślne etykiety przycisków — można nadpisać globalnie. */
988
+ labels: Record<string, string>;
989
+ }
990
+
991
+ export interface ScrollToOptions {
992
+ offset?: number;
993
+ duration?: number | 'auto';
994
+ easing?: string;
995
+ container?: Target;
996
+ [key: string]: any;
997
+ }
998
+
999
+ export interface ScrollFactory extends Factory<Scroll, ScrollOptions> {
1000
+ /** Płynnie przewija do elementu lub pozycji. `true` po dotarciu, `false`, gdy ruch przerwano. */
1001
+ to(target: Target | number, options?: ScrollToOptions): Promise<boolean>;
1002
+ }
1003
+
1004
+ export interface NotificationFunction {
1005
+ (message: string, options?: NotificationConfig): NotificationHandle;
1006
+ (options: NotificationConfig): NotificationHandle;
1007
+ /** Zamyka wszystkie powiadomienia (albo tylko z podanej grupy). */
1008
+ closeAll(group?: string): void;
1009
+ defaults: NotificationConfig;
1010
+ }
1011
+
1012
+ export interface PlaceOptions {
1013
+ placement?: Placement;
1014
+ offset?: number;
1015
+ flip?: boolean;
1016
+ shift?: boolean;
1017
+ padding?: number;
1018
+ matchWidth?: boolean;
1019
+ }
1020
+
1021
+ export interface PlossyUtil {
1022
+ $(selector: Target | null | undefined, context?: ParentNode): HTMLElement | null;
1023
+ $$(selector: string | Element | Iterable<Element> | null | undefined, context?: ParentNode): HTMLElement[];
1024
+ uid(prefix?: string): string;
1025
+ clamp(value: number, min: number, max: number): number;
1026
+ parseOptions(value: string | null, defaults?: Record<string, any>, primary?: string | null): Record<string, any>;
1027
+ queryTargets(el: Element, target: Target | null | undefined): Element[];
1028
+ focusables(el: Element): HTMLElement[];
1029
+ animationsDone(el: Element): Promise<unknown>;
1030
+ animateClass(el: Element, className: string): Promise<void>;
1031
+ toggleHeight(el: HTMLElement, show: boolean, options?: { duration?: number; easing?: string }): Promise<unknown>;
1032
+ showLayer(el: HTMLElement): void;
1033
+ hideLayer(el: HTMLElement): void;
1034
+ place(floating: HTMLElement, reference: Element | DOMRect, options?: PlaceOptions): unknown;
1035
+ /** Utrzymuje położenie przy przewijaniu i zmianie rozmiaru. Zwraca funkcję zatrzymującą. */
1036
+ autoPlace(floating: HTMLElement, reference: Element, options?: PlaceOptions): () => void;
1037
+ lockScroll(): void;
1038
+ unlockScroll(): void;
1039
+ rafThrottle<F extends (...args: any[]) => void>(fn: F): F;
1040
+ debounce<F extends (...args: any[]) => void>(fn: F, wait?: number): F;
1041
+ prefersReducedMotion(): boolean;
1042
+ }
1043
+
1044
+ export interface PlossyApi {
1045
+ accordion: Factory<Accordion, AccordionOptions>;
1046
+ alert: Factory<Alert, AlertOptions>;
1047
+ autosize: Factory<Autosize, AutosizeOptions>;
1048
+ charCount: Factory<CharCount, CharCountOptions>;
1049
+ combobox: Factory<Combobox, ComboboxOptions>;
1050
+ countdown: Factory<Countdown, CountdownOptions>;
1051
+ counter: Factory<Counter, CounterOptions>;
1052
+ datepicker: Factory<Datepicker, DatepickerOptions>;
1053
+ drop: Factory<Drop, DropOptions>;
1054
+ filter: Factory<Filter, FilterOptions>;
1055
+ formClear: Factory<FormClear, FormClearOptions>;
1056
+ formValidate: Factory<FormValidate, FormValidateOptions>;
1057
+ heightMatch: Factory<HeightMatch, HeightMatchOptions>;
1058
+ heightViewport: Factory<HeightViewport, HeightViewportOptions>;
1059
+ icon: Factory<Icon, IconOptions>;
1060
+ lightbox: Factory<Lightbox, LightboxOptions>;
1061
+ modal: ModalFactory;
1062
+ nav: Factory<Nav, NavOptions>;
1063
+ navbar: Factory<Navbar, NavbarOptions>;
1064
+ offcanvas: Factory<Offcanvas, OffcanvasOptions>;
1065
+ otp: Factory<Otp, OtpOptions>;
1066
+ parallax: Factory<Parallax, ParallaxOptions>;
1067
+ passwordToggle: Factory<PasswordToggle, PasswordToggleOptions>;
1068
+ popover: Factory<Popover, PopoverOptions>;
1069
+ quantity: Factory<Quantity, QuantityOptions>;
1070
+ range: Factory<Range, RangeOptions>;
1071
+ rating: Factory<Rating, RatingOptions>;
1072
+ scroll: ScrollFactory;
1073
+ scrollspy: Factory<Scrollspy, ScrollspyOptions>;
1074
+ scrollspyNav: Factory<ScrollspyNav, ScrollspyNavOptions>;
1075
+ slider: Factory<Slider, SliderOptions>;
1076
+ slideshow: Factory<Slideshow, SlideshowOptions>;
1077
+ sortable: Factory<Sortable, SortableOptions>;
1078
+ spotlight: Factory<Spotlight, SpotlightOptions>;
1079
+ sticky: Factory<Sticky, StickyOptions>;
1080
+ strength: Factory<Strength, StrengthOptions>;
1081
+ switcher: Factory<Switcher, SwitcherOptions>;
1082
+ toggle: Factory<Toggle, ToggleOptions>;
1083
+ tooltip: Factory<Tooltip, TooltipOptions>;
1084
+ totop: Factory<Totop, TotopOptions>;
1085
+ upload: Factory<Upload, UploadOptions>;
1086
+ video: Factory<Video, VideoOptions>;
1087
+
1088
+ /** Powiadomienie z kodu: `Plossy.notification('Zapisano')`. */
1089
+ notification: NotificationFunction;
1090
+ /** Galeria bez znaczników w HTML. */
1091
+ lightboxPanel(options: LightboxPanelOptions): LightboxPanel;
1092
+ /** Rejestr ikon dla `data-pl-icon`. */
1093
+ icons: {
1094
+ add(icons: Record<string, string>): void;
1095
+ names(): string[];
1096
+ get(name: string): string | null;
1097
+ };
1098
+
1099
+ /** Rejestruje własny komponent pod `data-pl-{name}` i `Plossy.{name}()`. */
1100
+ register<T extends typeof Component<any>>(name: string, Class: T): T;
1101
+ /** Inicjalizuje komponenty w podanym fragmencie (zwykle dzieje się to samo). */
1102
+ scan(root?: ParentNode): void;
1103
+ getInstance<C = Component<any>>(el: Element, name: string): C | null;
1104
+ Component: typeof Component;
1105
+ util: PlossyUtil;
1106
+
1107
+ /** Komponenty zarejestrowane przez `register()`. */
1108
+ [name: string]: any;
1109
+ }
1110
+
1111
+ declare const Plossy: PlossyApi;
1112
+ export default Plossy;
1113
+
1114
+ /** Ten sam obiekt co eksport domyślny. */
1115
+ export const api: PlossyApi;
1116
+
1117
+ export const register: PlossyApi['register'];
1118
+ export const scan: PlossyApi['scan'];
1119
+ export const getInstance: PlossyApi['getInstance'];
1120
+ /** Uruchamia automatyczną inicjalizację (przy imporcie w przeglądarce dzieje się to samo). */
1121
+ export function start(): void;
1122
+
1123
+ export const $: PlossyUtil['$'];
1124
+ export const $$: PlossyUtil['$$'];
1125
+ export const uid: PlossyUtil['uid'];
1126
+ export const clamp: PlossyUtil['clamp'];
1127
+ export function camel(value: string): string;
1128
+ export const parseOptions: PlossyUtil['parseOptions'];
1129
+ export const queryTargets: PlossyUtil['queryTargets'];
1130
+ export const focusables: PlossyUtil['focusables'];
1131
+ export const animationsDone: PlossyUtil['animationsDone'];
1132
+ export const animateClass: PlossyUtil['animateClass'];
1133
+ export const toggleHeight: PlossyUtil['toggleHeight'];
1134
+ export const showLayer: PlossyUtil['showLayer'];
1135
+ export const hideLayer: PlossyUtil['hideLayer'];
1136
+ export const place: PlossyUtil['place'];
1137
+ export const autoPlace: PlossyUtil['autoPlace'];
1138
+ export const lockScroll: PlossyUtil['lockScroll'];
1139
+ export const unlockScroll: PlossyUtil['unlockScroll'];
1140
+ export const rafThrottle: PlossyUtil['rafThrottle'];
1141
+ export const debounce: PlossyUtil['debounce'];
1142
+ export const prefersReducedMotion: PlossyUtil['prefersReducedMotion'];
1143
+
1144
+ // ── Zdarzenia i obiekt globalny ───────────────────────────────────────────
1145
+
1146
+ /** Nazwy zdarzeń wysyłanych przez komponenty. Zawartość `detail` opisują tabele „Zdarzenia" w dokumentacji. */
1147
+ export type PlossyEventName =
1148
+ | 'active'
1149
+ | 'added'
1150
+ | 'afterfilter'
1151
+ | 'beforefilter'
1152
+ | 'beforehide'
1153
+ | 'beforeitemshow'
1154
+ | 'beforeopen'
1155
+ | 'beforescroll'
1156
+ | 'beforesend'
1157
+ | 'beforeshow'
1158
+ | 'change'
1159
+ | 'clear'
1160
+ | 'close'
1161
+ | 'complete'
1162
+ | 'completeall'
1163
+ | 'create'
1164
+ | 'end'
1165
+ | 'error'
1166
+ | 'exceed'
1167
+ | 'hidden'
1168
+ | 'hide'
1169
+ | 'inactive'
1170
+ | 'input'
1171
+ | 'invalid'
1172
+ | 'inview'
1173
+ | 'itemhide'
1174
+ | 'itemshow'
1175
+ | 'itemshown'
1176
+ | 'match'
1177
+ | 'moved'
1178
+ | 'notificationclose'
1179
+ | 'open'
1180
+ | 'outview'
1181
+ | 'pause'
1182
+ | 'play'
1183
+ | 'progress'
1184
+ | 'remove'
1185
+ | 'removed'
1186
+ | 'resize'
1187
+ | 'scroll'
1188
+ | 'scrolled'
1189
+ | 'select'
1190
+ | 'show'
1191
+ | 'shown'
1192
+ | 'start'
1193
+ | 'stop'
1194
+ | 'tick'
1195
+ | 'valid'
1196
+ | 'within';
1197
+
1198
+ type PlossyEventMap = { [K in PlossyEventName as `pl:${K}`]: PlossyEvent };
1199
+
1200
+ declare global {
1201
+ interface GlobalEventHandlersEventMap extends PlossyEventMap {}
1202
+
1203
+ interface Window {
1204
+ Plossy: PlossyApi;
1205
+ }
1206
+
1207
+ /** Obiekt globalny dostępny po dołączeniu `plossy.min.js` tagiem `<script>`. */
1208
+ // eslint-disable-next-line no-var
1209
+ var Plossy: PlossyApi;
1210
+ }