flicker-alerts 1.0.43 → 1.0.45

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.
Files changed (3) hide show
  1. package/index.d.ts +10 -8
  2. package/index.js +3 -5
  3. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -1,21 +1,23 @@
1
1
  declare module 'flicker-alerts' {
2
- export interface AlertOptions {
2
+ // Definição das opções para os alertas
3
+ interface AlertOptions {
3
4
  type: 'success' | 'info' | 'warning' | 'danger';
4
5
  title: string;
5
6
  message: string;
6
- timer?: number;
7
- position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'center' | 'top-center' | 'bottom-center';
7
+ duration?: number; // Duração opcional do alerta
8
+ position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'center' | 'top-center' | 'bottom-center'; // Posições possíveis do alerta
8
9
  }
9
10
 
10
- export interface ModalOptions {
11
- type: 'warning' | 'delete';
11
+ // Definição das opções para os modais
12
+ interface ModalOptions {
13
+ type: 'warning' | 'danger' | 'info' | 'success'; // Tipos de modais disponíveis
12
14
  title: string;
13
15
  message: string;
14
- onConfirm?: () => void;
15
- onCancel?: () => void;
16
- timer?: number;
16
+ onConfirm?: () => void; // Função executada no botão de confirmação
17
+ onCancel?: () => void; // Função executada no botão de cancelamento
17
18
  }
18
19
 
20
+ // Exportação do objeto com os métodos
19
21
  export const FlickerAlerts: {
20
22
  showAlert(options: AlertOptions): void;
21
23
  };
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
 
3
3
 
4
- export const FlickerAlerts = {
4
+ const FlickerAlerts = {
5
5
  showAlert: function ({ type, title, message, timer = 3000, position = 'top-right' }) {
6
6
  if (typeof window !== 'undefined' && typeof document !== 'undefined') {
7
7
  let container = document.getElementById('alerts-container');
@@ -101,7 +101,7 @@ if (typeof document !== 'undefined') {
101
101
 
102
102
 
103
103
 
104
- export const FlickerModals= {
104
+ const FlickerModals = {
105
105
  showModal: function ({ type, title, message, onConfirm, onCancel }) {
106
106
  if (typeof window !== 'undefined' && typeof document !== 'undefined') {
107
107
  let container = document.getElementById('modals-container');
@@ -231,6 +231,4 @@ if (typeof document !== 'undefined') {
231
231
  }
232
232
 
233
233
 
234
-
235
-
236
- export { FlickerAlerts, FlickerModals };
234
+ export { FlickerAlerts, FlickerModals };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flicker-alerts",
3
- "version": "1.0.43",
3
+ "version": "1.0.45",
4
4
  "description": "Biblioteca para alertas animados",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -16,6 +16,6 @@
16
16
  "author": "https://www.linkedin.com/in/bruno-carneiro-9a51aa190/",
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
- "flicker-alerts": "^1.0.43"
19
+ "flicker-alerts": "^1.0.45"
20
20
  }
21
21
  }