@elderbyte/ngx-starter 17.7.1 → 17.7.3
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.
|
@@ -6,12 +6,14 @@ export declare enum ReactiveEventSourceState {
|
|
|
6
6
|
CLOSED = "CLOSED",
|
|
7
7
|
ERROR = "ERROR"
|
|
8
8
|
}
|
|
9
|
-
export declare class ReactiveSSeMessage<T =
|
|
9
|
+
export declare class ReactiveSSeMessage<T = any> {
|
|
10
10
|
readonly id: string;
|
|
11
11
|
readonly event: string;
|
|
12
|
-
readonly
|
|
12
|
+
readonly dataRaw: string;
|
|
13
13
|
readonly retry?: number;
|
|
14
|
-
constructor(id: string, event: string,
|
|
14
|
+
constructor(id: string, event: string, dataRaw: string, retry?: number);
|
|
15
|
+
json(): T;
|
|
16
|
+
jsonAs<TCustom>(): TCustom;
|
|
15
17
|
}
|
|
16
18
|
export interface EventSourceRequestInit {
|
|
17
19
|
request: RequestInfo;
|
|
@@ -25,12 +27,14 @@ export declare class ReactiveFetchEventSource<T = any> {
|
|
|
25
27
|
* Fields *
|
|
26
28
|
* *
|
|
27
29
|
**************************************************************************/
|
|
30
|
+
private readonly EVENT_TYPE_DEFAULT;
|
|
31
|
+
private readonly RECONNECT_DELAY_MS;
|
|
28
32
|
private readonly log;
|
|
29
33
|
private _closed;
|
|
30
|
-
private
|
|
34
|
+
private abortController;
|
|
31
35
|
private readonly state$;
|
|
32
36
|
private _unsubscribeSub;
|
|
33
|
-
private readonly
|
|
37
|
+
private readonly eventRelay;
|
|
34
38
|
/***************************************************************************
|
|
35
39
|
* *
|
|
36
40
|
* Static Builder *
|
|
@@ -67,14 +71,11 @@ export declare class ReactiveFetchEventSource<T = any> {
|
|
|
67
71
|
* Get an event stream for the given event type.
|
|
68
72
|
* @param eventTypeRaw The event type. Defaults to 'message'.
|
|
69
73
|
*/
|
|
70
|
-
|
|
74
|
+
streamEventsOfType(eventTypeRaw?: string): Observable<ReactiveSSeMessage<T>>;
|
|
71
75
|
/**
|
|
72
|
-
* Get an event stream
|
|
73
|
-
* (event.data must be in json format)
|
|
74
|
-
*
|
|
75
|
-
* @param eventType The event type. Defaults to 'message'.
|
|
76
|
+
* Get an event stream for all events no matter their type.
|
|
76
77
|
*/
|
|
77
|
-
|
|
78
|
+
streamEvents(): Observable<ReactiveSSeMessage<T>>;
|
|
78
79
|
/**
|
|
79
80
|
* Close this event source. It won't reconnect.
|
|
80
81
|
*/
|