uni-manager 0.0.78 → 0.1.0
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.
- package/fesm2022/uni-manager-error.mjs +69 -0
- package/fesm2022/uni-manager-error.mjs.map +1 -0
- package/fesm2022/uni-manager-file.mjs +82 -0
- package/fesm2022/uni-manager-file.mjs.map +1 -0
- package/fesm2022/uni-manager-http.mjs +678 -0
- package/fesm2022/uni-manager-http.mjs.map +1 -0
- package/fesm2022/uni-manager-locale.mjs +168 -0
- package/fesm2022/uni-manager-locale.mjs.map +1 -0
- package/fesm2022/uni-manager-toast.mjs +57 -0
- package/fesm2022/uni-manager-toast.mjs.map +1 -0
- package/fesm2022/uni-manager-type.mjs +149 -0
- package/fesm2022/uni-manager-type.mjs.map +1 -0
- package/fesm2022/uni-manager.mjs +646 -621
- package/fesm2022/uni-manager.mjs.map +1 -1
- package/package.json +26 -2
- package/types/uni-manager-error.d.ts +27 -0
- package/types/uni-manager-file.d.ts +25 -0
- package/types/uni-manager-http.d.ts +131 -0
- package/types/uni-manager-locale.d.ts +63 -0
- package/types/uni-manager-toast.d.ts +41 -0
- package/types/uni-manager-type.d.ts +40 -0
- package/types/uni-manager.d.ts +29 -29
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
|
2
|
+
import { Observable } from 'rxjs/internal/Observable';
|
|
3
|
+
import { FileDatasource } from 'uni-manager/file';
|
|
4
|
+
import { ToastConfig, ToastHttpConfig } from 'uni-manager/toast';
|
|
5
|
+
|
|
6
|
+
declare enum MapOperator {
|
|
7
|
+
/** Cancella la precedente richiesta, mantiene solo l’ultima */
|
|
8
|
+
SWITCH_MAP = 0,
|
|
9
|
+
/** Ignora nuovi valori finché la corrente non finisce */
|
|
10
|
+
EXHAUST_MAP = 1,
|
|
11
|
+
/** Mette le richieste in coda, le esegue una alla volta */
|
|
12
|
+
CONCAT_MAP = 2,
|
|
13
|
+
/** Esegue tutte le richieste in parallelo, ordine non garantito */
|
|
14
|
+
MERGE_MAP = 3
|
|
15
|
+
}
|
|
16
|
+
declare enum PollingErrorMode {
|
|
17
|
+
/** Salta questa iterazione emettendo un undefined. Il polling continua al tick successivo. */
|
|
18
|
+
IGNORE = 0,
|
|
19
|
+
/** Salta questa iterazione senza emettere valori. Il polling continua al tick successivo. */
|
|
20
|
+
SKIP = 1,
|
|
21
|
+
/** Interrompe il polling propagando l'errore. */
|
|
22
|
+
STOP = 2,
|
|
23
|
+
/** Ignora l'errore, lo salva (es. per UI), e continua il polling. Emette `undefined`. */
|
|
24
|
+
IGNORE_WITH_ERROR = 3
|
|
25
|
+
}
|
|
26
|
+
declare enum EmitValueMode {
|
|
27
|
+
/** Aggiorna lo stato solo se arrivano dati nuovi (distinct) */
|
|
28
|
+
ON_NEW_DATA = 0,
|
|
29
|
+
/** Aggiorna lo stato ad ogni chiamata, anche se i dati sono uguali */
|
|
30
|
+
EVERY_TIME = 1
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface HttpRef {
|
|
34
|
+
type: 'one' | 'polling' | 'image' | 'file';
|
|
35
|
+
lineId: number | null | undefined;
|
|
36
|
+
url: URL;
|
|
37
|
+
hasError: boolean;
|
|
38
|
+
pendingCount: number;
|
|
39
|
+
}
|
|
40
|
+
interface HttpConfig<T> {
|
|
41
|
+
ref: string;
|
|
42
|
+
path: string;
|
|
43
|
+
params?: Record<string, any>;
|
|
44
|
+
init?: RequestInit;
|
|
45
|
+
toast?: (ToastConfig & ToastHttpConfig<T>) | null;
|
|
46
|
+
hasLoader?: boolean;
|
|
47
|
+
hasApiPrefix?: boolean;
|
|
48
|
+
}
|
|
49
|
+
interface HttpConfigPolling<T> {
|
|
50
|
+
ref: string;
|
|
51
|
+
interval: number;
|
|
52
|
+
path: string;
|
|
53
|
+
params?: Record<string, any>;
|
|
54
|
+
init?: RequestInit;
|
|
55
|
+
operator?: MapOperator;
|
|
56
|
+
errorMode?: PollingErrorMode;
|
|
57
|
+
emitValueMode?: EmitValueMode;
|
|
58
|
+
firstIteration?: {
|
|
59
|
+
toast: NonNullable<HttpConfig<T>['toast']>;
|
|
60
|
+
hasLoader?: boolean;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
type HttpBody = Record<string, any> | any[] | string | number | boolean | Date;
|
|
64
|
+
|
|
65
|
+
declare class UniHttpManager {
|
|
66
|
+
/** Hostname del server (es. 'api.example.com' o 'localhost') */
|
|
67
|
+
private static hostname;
|
|
68
|
+
/** Porta del server su cui effettuare le chiamate (es. 80, 443 o 3000) */
|
|
69
|
+
private static port;
|
|
70
|
+
/** Restituisce se lo store ha chiamate in attesa di risposta o meno */
|
|
71
|
+
static get hasWaitingRequests$(): Observable<boolean>;
|
|
72
|
+
/** Store privato (Subject) */
|
|
73
|
+
static store: BehaviorSubject<Map<string, HttpRef>>;
|
|
74
|
+
/** Store pubblico (Observable) */
|
|
75
|
+
static store$: Observable<Map<string, HttpRef>>;
|
|
76
|
+
/** Ottiene lo stato attuale della Map senza dover sottoscrivere l'observable */
|
|
77
|
+
static get currentValue(): Map<string, HttpRef>;
|
|
78
|
+
/**
|
|
79
|
+
* Inizializza la configurazione di rete del manager.
|
|
80
|
+
* Deve essere chiamato prima di effettuare qualsiasi richiesta HTTP.
|
|
81
|
+
*/
|
|
82
|
+
static setup(hostname: string, port: number): void;
|
|
83
|
+
static read$<T>(config: HttpConfig<T>): Observable<T | undefined>;
|
|
84
|
+
/**
|
|
85
|
+
* Esegue una richiesta HTTP POST inviando un payload JSON nel corpo della richiesta.
|
|
86
|
+
* Imposta automaticamente l'header 'Content-Type' come 'application/json'.
|
|
87
|
+
*/
|
|
88
|
+
static create$<T>(config: HttpConfig<T>, body: HttpBody): Observable<T | undefined>;
|
|
89
|
+
/**
|
|
90
|
+
* Esegue una singola richiesta HTTP PUT per aggiornare una risorsa esistente.
|
|
91
|
+
*/
|
|
92
|
+
static update$<T>(config: HttpConfig<T>, body?: HttpBody): Observable<T | undefined>;
|
|
93
|
+
/**
|
|
94
|
+
* Esegue una richiesta HTTP DELETE per rimuovere una risorsa.
|
|
95
|
+
* Utilizza il path configurato per costruire l'URL completo e restituisce un Observable del risultato.
|
|
96
|
+
*/
|
|
97
|
+
static delete$<T>(config: HttpConfig<T>): Observable<T | undefined>;
|
|
98
|
+
/**
|
|
99
|
+
* Recupera un'immagine tramite una richiesta GET e la trasforma in un formato gestibile (es. Blob o Base64).
|
|
100
|
+
* Delega la logica di conversione alla funzione executeImage.
|
|
101
|
+
*/
|
|
102
|
+
static readImage$(config: HttpConfig<{
|
|
103
|
+
url: string;
|
|
104
|
+
name: string;
|
|
105
|
+
}>): Observable<{
|
|
106
|
+
url: string;
|
|
107
|
+
name: string;
|
|
108
|
+
} | undefined>;
|
|
109
|
+
/**
|
|
110
|
+
* Recupera un file (es. PDF) tramite una richiesta GET e restituisce un Object URL temporaneo.
|
|
111
|
+
* Delega la logica di conversione alla funzione executeFile.
|
|
112
|
+
*/
|
|
113
|
+
static readFile$(config: HttpConfig<FileDatasource>): Observable<FileDatasource | undefined>;
|
|
114
|
+
/**
|
|
115
|
+
* Avvia un ciclo di polling basato su richieste GET.
|
|
116
|
+
* Continua a emettere valori in base alla configurazione di intervallo definita in HttpConfigPolling.
|
|
117
|
+
*/
|
|
118
|
+
static readPolling$<T>(config: HttpConfigPolling<T>): Observable<T | undefined>;
|
|
119
|
+
/**
|
|
120
|
+
* Avvia un ciclo di polling basato su richieste POST.
|
|
121
|
+
* Invia il body specificato a ogni iterazione del ciclo.
|
|
122
|
+
*/
|
|
123
|
+
static createPolling$<T>(config: HttpConfigPolling<T>, body: HttpBody): Observable<T | undefined>;
|
|
124
|
+
/**
|
|
125
|
+
* Avvia un ciclo di polling basato su richieste PUT.
|
|
126
|
+
*/
|
|
127
|
+
static updatePolling$<T>(config: HttpConfigPolling<T>, body?: HttpBody): Observable<T | undefined>;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export { EmitValueMode, MapOperator, PollingErrorMode, UniHttpManager };
|
|
131
|
+
export type { HttpBody, HttpConfig, HttpConfigPolling, HttpRef };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as rxjs_internal_Observable from 'rxjs/internal/Observable';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
|
3
|
+
|
|
4
|
+
declare class UniLocaleManager {
|
|
5
|
+
/** Codice lingua corrente (es. 'it-IT', 'en-US') usato per formattare date e numeri */
|
|
6
|
+
private static _locale;
|
|
7
|
+
/** Elenco dei codici lingua supportati dall'applicazione (es. ['it-IT', 'en-US']) */
|
|
8
|
+
private static _localesSupported;
|
|
9
|
+
/** Prefisso globale applicato a tutte le chiavi di traduzione (es. 'APP_') */
|
|
10
|
+
private static _prefix;
|
|
11
|
+
/** Restituisce il codice lingua corrente */
|
|
12
|
+
static get locale(): string;
|
|
13
|
+
/** Restituisce l'array contenente tutti i codici locale supportati.*/
|
|
14
|
+
static get localesSupported(): string[];
|
|
15
|
+
/** Restituisce solo la lingua (es. 'it') */
|
|
16
|
+
static get language(): string;
|
|
17
|
+
/** Restituisce solo il paese (es. 'IT') */
|
|
18
|
+
static get region(): string;
|
|
19
|
+
/** Store privato (Subject) */
|
|
20
|
+
static store: BehaviorSubject<Record<string, string>>;
|
|
21
|
+
/** Store pubblico (Observable) */
|
|
22
|
+
static store$: rxjs_internal_Observable.Observable<Record<string, string>>;
|
|
23
|
+
/** Ottiene il dizionario attuale senza sottoscrizione */
|
|
24
|
+
static get currentValue(): Record<string, string>;
|
|
25
|
+
/**
|
|
26
|
+
* Inizializza la configurazione di rete del manager.
|
|
27
|
+
* Deve essere chiamato prima di effettuare qualsiasi richiesta HTTP.
|
|
28
|
+
*/
|
|
29
|
+
static setup(locale: string | null | undefined, prefix?: string): void;
|
|
30
|
+
/** Imposta l'elenco dei codici lingua supportati dall'applicazione */
|
|
31
|
+
static setLocalesSupported(locales: string[] | undefined): void;
|
|
32
|
+
/**
|
|
33
|
+
* Aggiorna lo store locale con il dizionario delle traduzioni fornito.
|
|
34
|
+
* Se viene passato undefined, lo store viene inizializzato come oggetto vuoto.
|
|
35
|
+
*/
|
|
36
|
+
static setTranslations(translations: Record<string, string> | undefined): void;
|
|
37
|
+
/**
|
|
38
|
+
* Traduce una label in base al dizionario caricato.
|
|
39
|
+
* Gestisce la composizione della chiave, i parametri dinamici (interpolazione) e il fallback.
|
|
40
|
+
*/
|
|
41
|
+
static translate(key: string, prefix?: string, interpolationParams?: Record<string, string | number | Date>): string;
|
|
42
|
+
/**
|
|
43
|
+
* Traduce una stringa che contiene parametri separati da un carattere specifico.
|
|
44
|
+
* Supporta ora un numero arbitrario di parametri in formato "label/param1/param2"
|
|
45
|
+
* o semplicemente "label".
|
|
46
|
+
*/
|
|
47
|
+
static translateInlineParams(keyWithParams: string, splitChar: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* Converte un valore numerico in una stringa formattata secondo il locale impostato.
|
|
50
|
+
* Disabilita i separatori delle migliaia e forza un numero fisso di decimali.
|
|
51
|
+
*/
|
|
52
|
+
static toStringNumber(value: number, decimal: number): string;
|
|
53
|
+
/**
|
|
54
|
+
* Formatta una data o una stringa in base al locale corrente.
|
|
55
|
+
* Gestisce tre modalità predefinite (date, time, full) e accetta opzioni personalizzate Intl.
|
|
56
|
+
*/
|
|
57
|
+
static toDate(date: string | Date, mode?: 'date' | 'time' | 'full', force?: {
|
|
58
|
+
oldLang: string;
|
|
59
|
+
newLocale: string;
|
|
60
|
+
}): string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { UniLocaleManager };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
interface IToastManager {
|
|
2
|
+
success: (message: string, config?: ToastConfig) => void;
|
|
3
|
+
info: (message: string, config?: ToastConfig) => void;
|
|
4
|
+
warning: (message: string, config?: ToastConfig) => void;
|
|
5
|
+
error: (message: string, config?: ToastConfig) => void;
|
|
6
|
+
}
|
|
7
|
+
interface ToastConfig {
|
|
8
|
+
label: string;
|
|
9
|
+
interpolationParams?: Record<string, string | number | Date>;
|
|
10
|
+
type?: keyof IToastManager;
|
|
11
|
+
duration?: number;
|
|
12
|
+
}
|
|
13
|
+
interface ToastHttpConfig<T> {
|
|
14
|
+
resParams?: (keyof T & string)[];
|
|
15
|
+
resLengthParam?: string;
|
|
16
|
+
formatters?: Partial<Record<keyof T & string, (val: any) => any>>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare class UniToastManager {
|
|
20
|
+
/** Riferimento interno all'istanza */
|
|
21
|
+
private static manager;
|
|
22
|
+
/**
|
|
23
|
+
* Inizializza il manager con una serie di operazioni
|
|
24
|
+
*/
|
|
25
|
+
static setup(operations: IToastManager): void;
|
|
26
|
+
/**
|
|
27
|
+
* Mostra un toast di successo basato su una risposta HTTP e una label di traduzione.
|
|
28
|
+
*/
|
|
29
|
+
static show(config: Omit<ToastConfig, 'interpolationParams'> & {
|
|
30
|
+
params?: Record<string, any>;
|
|
31
|
+
prefix?: string;
|
|
32
|
+
suffix?: string;
|
|
33
|
+
}): void;
|
|
34
|
+
/**
|
|
35
|
+
* Mostra un toast di successo basato su una risposta HTTP e una label di traduzione.
|
|
36
|
+
*/
|
|
37
|
+
static showHttp<T>(config: ToastConfig & ToastHttpConfig<T>, res: T | undefined): void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { UniToastManager };
|
|
41
|
+
export type { IToastManager, ToastConfig, ToastHttpConfig };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Classe di utilità per la gestione e formattazione delle date.
|
|
3
|
+
* Fornisce metodi per convertire in modo sicuro valori di tipo Date, stringa o null in formati standardizzati.
|
|
4
|
+
*/
|
|
5
|
+
declare class UniTypeDateManager {
|
|
6
|
+
static toYYYYMMDD(date: Date | string | null | undefined): string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Utility per la gestione e formattazione di valori numerici.
|
|
11
|
+
*/
|
|
12
|
+
declare class UniTypeNumberManager {
|
|
13
|
+
/** Applica il padding a un numero o una stringa */
|
|
14
|
+
static toPad(value: number | string | null | undefined, count: number, character?: string): string;
|
|
15
|
+
/** Formatta un numero in una versione leggibile (es: 1000 -> 1K, 1000000 -> 1M) */
|
|
16
|
+
static toTruncateAndAdUdm(value: number, decimalDigits?: number, maxIntegerDigits?: number): string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Utility per la manipolazione di stringhe
|
|
21
|
+
*/
|
|
22
|
+
declare class UniTypeStringManager {
|
|
23
|
+
/** Converte una stringa in formato lblPascalCase (es. "user_id" -> "lblUserId") */
|
|
24
|
+
static toLabelize(key: string | null | undefined, prefix?: string): string;
|
|
25
|
+
/** Converte una stringa in PascalCase (es. "user_id" -> "UserId") */
|
|
26
|
+
static toPascalCase(key: string | null | undefined): string;
|
|
27
|
+
/** Converte una stringa in camelCase (es. "user_id" -> "userId") */
|
|
28
|
+
static toCamelCase(key: string | null | undefined): string;
|
|
29
|
+
/** Capitalizza solo la prima lettera della stringa */
|
|
30
|
+
static toCapitalize(key: string | null | undefined): string;
|
|
31
|
+
/** Sostituisce sotto-stringhe all'interno della stringa */
|
|
32
|
+
static toReplace(key: string | null | undefined, values: {
|
|
33
|
+
searchValue: string;
|
|
34
|
+
replaceValue: string;
|
|
35
|
+
}[]): string;
|
|
36
|
+
private static splitString;
|
|
37
|
+
private static toPascalCaseParts;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { UniTypeDateManager, UniTypeNumberManager, UniTypeStringManager };
|
package/types/uni-manager.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Observable
|
|
3
|
-
import { IUniFeError
|
|
1
|
+
import * as rxjs_internal_Observable from 'rxjs/internal/Observable';
|
|
2
|
+
import { Observable } from 'rxjs/internal/Observable';
|
|
3
|
+
import { IUniFeError } from 'uni-error/fe';
|
|
4
|
+
import { IUniHttpError } from 'uni-error/http';
|
|
5
|
+
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
|
6
|
+
import { FileDatasource as FileDatasource$1 } from 'uni-manager/file';
|
|
7
|
+
import { ToastConfig as ToastConfig$1, ToastHttpConfig as ToastHttpConfig$1 } from 'uni-manager/toast';
|
|
4
8
|
|
|
5
9
|
declare class UniErrorManager {
|
|
6
10
|
/** Store privato (Subject) */
|
|
@@ -74,24 +78,6 @@ declare enum EmitValueMode {
|
|
|
74
78
|
EVERY_TIME = 1
|
|
75
79
|
}
|
|
76
80
|
|
|
77
|
-
interface IToastManager {
|
|
78
|
-
success: (message: string, config?: ToastConfig) => void;
|
|
79
|
-
info: (message: string, config?: ToastConfig) => void;
|
|
80
|
-
warning: (message: string, config?: ToastConfig) => void;
|
|
81
|
-
error: (message: string, config?: ToastConfig) => void;
|
|
82
|
-
}
|
|
83
|
-
interface ToastConfig {
|
|
84
|
-
label: string;
|
|
85
|
-
interpolationParams?: Record<string, string | number | Date>;
|
|
86
|
-
type?: keyof IToastManager;
|
|
87
|
-
duration?: number;
|
|
88
|
-
}
|
|
89
|
-
interface ToastHttpConfig<T> {
|
|
90
|
-
resParams?: (keyof T & string)[];
|
|
91
|
-
resLengthParam?: string;
|
|
92
|
-
formatters?: Partial<Record<keyof T & string, (val: any) => any>>;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
81
|
interface HttpRef {
|
|
96
82
|
type: 'one' | 'polling' | 'image' | 'file';
|
|
97
83
|
lineId: number | null | undefined;
|
|
@@ -104,7 +90,7 @@ interface HttpConfig<T> {
|
|
|
104
90
|
path: string;
|
|
105
91
|
params?: Record<string, any>;
|
|
106
92
|
init?: RequestInit;
|
|
107
|
-
toast?: (ToastConfig & ToastHttpConfig<T>) | null;
|
|
93
|
+
toast?: (ToastConfig$1 & ToastHttpConfig$1<T>) | null;
|
|
108
94
|
hasLoader?: boolean;
|
|
109
95
|
hasApiPrefix?: boolean;
|
|
110
96
|
}
|
|
@@ -142,10 +128,6 @@ declare class UniHttpManager {
|
|
|
142
128
|
* Deve essere chiamato prima di effettuare qualsiasi richiesta HTTP.
|
|
143
129
|
*/
|
|
144
130
|
static setup(hostname: string, port: number): void;
|
|
145
|
-
/**
|
|
146
|
-
* Imposta o resetta lo stato di errore per una specifica reference.
|
|
147
|
-
*/
|
|
148
|
-
static updateHasError(id: string, hasError: boolean): void;
|
|
149
131
|
static read$<T>(config: HttpConfig<T>): Observable<T | undefined>;
|
|
150
132
|
/**
|
|
151
133
|
* Esegue una richiesta HTTP POST inviando un payload JSON nel corpo della richiesta.
|
|
@@ -176,7 +158,7 @@ declare class UniHttpManager {
|
|
|
176
158
|
* Recupera un file (es. PDF) tramite una richiesta GET e restituisce un Object URL temporaneo.
|
|
177
159
|
* Delega la logica di conversione alla funzione executeFile.
|
|
178
160
|
*/
|
|
179
|
-
static readFile$(config: HttpConfig<FileDatasource>): Observable<FileDatasource | undefined>;
|
|
161
|
+
static readFile$(config: HttpConfig<FileDatasource$1>): Observable<FileDatasource$1 | undefined>;
|
|
180
162
|
/**
|
|
181
163
|
* Avvia un ciclo di polling basato su richieste GET.
|
|
182
164
|
* Continua a emettere valori in base alla configurazione di intervallo definita in HttpConfigPolling.
|
|
@@ -211,7 +193,7 @@ declare class UniLocaleManager {
|
|
|
211
193
|
/** Store privato (Subject) */
|
|
212
194
|
static store: BehaviorSubject<Record<string, string>>;
|
|
213
195
|
/** Store pubblico (Observable) */
|
|
214
|
-
static store$:
|
|
196
|
+
static store$: rxjs_internal_Observable.Observable<Record<string, string>>;
|
|
215
197
|
/** Ottiene il dizionario attuale senza sottoscrizione */
|
|
216
198
|
static get currentValue(): Record<string, string>;
|
|
217
199
|
/**
|
|
@@ -252,6 +234,24 @@ declare class UniLocaleManager {
|
|
|
252
234
|
}): string;
|
|
253
235
|
}
|
|
254
236
|
|
|
237
|
+
interface IToastManager {
|
|
238
|
+
success: (message: string, config?: ToastConfig) => void;
|
|
239
|
+
info: (message: string, config?: ToastConfig) => void;
|
|
240
|
+
warning: (message: string, config?: ToastConfig) => void;
|
|
241
|
+
error: (message: string, config?: ToastConfig) => void;
|
|
242
|
+
}
|
|
243
|
+
interface ToastConfig {
|
|
244
|
+
label: string;
|
|
245
|
+
interpolationParams?: Record<string, string | number | Date>;
|
|
246
|
+
type?: keyof IToastManager;
|
|
247
|
+
duration?: number;
|
|
248
|
+
}
|
|
249
|
+
interface ToastHttpConfig<T> {
|
|
250
|
+
resParams?: (keyof T & string)[];
|
|
251
|
+
resLengthParam?: string;
|
|
252
|
+
formatters?: Partial<Record<keyof T & string, (val: any) => any>>;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
255
|
declare class UniToastManager {
|
|
256
256
|
/** Riferimento interno all'istanza */
|
|
257
257
|
private static manager;
|
|
@@ -313,4 +313,4 @@ declare class UniTypeStringManager {
|
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
export { EmitValueMode, MapOperator, PollingErrorMode, UniErrorManager, UniFileManager, UniHttpManager, UniLocaleManager, UniToastManager, UniTypeDateManager, UniTypeNumberManager, UniTypeStringManager };
|
|
316
|
-
export type { FileDatasource, HttpBody, HttpConfig, HttpConfigPolling, HttpRef, IToastManager, ToastConfig };
|
|
316
|
+
export type { FileDatasource, HttpBody, HttpConfig, HttpConfigPolling, HttpRef, IToastManager, ToastConfig, ToastHttpConfig };
|