@experteam-mx/ngx-services 20.8.8 → 20.8.10
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/index.d.ts
CHANGED
|
@@ -9424,6 +9424,8 @@ declare class WebSocketsService {
|
|
|
9424
9424
|
private appKey;
|
|
9425
9425
|
private connectPromise;
|
|
9426
9426
|
private environments;
|
|
9427
|
+
private getAuthToken;
|
|
9428
|
+
private readonly channelAuthHeaders;
|
|
9427
9429
|
/**
|
|
9428
9430
|
* Stores the Pusher/Soketi application key without opening a connection.
|
|
9429
9431
|
* The first `channelSub` / `eventBind` opens Pusher via `ensureConnected`.
|
|
@@ -9431,6 +9433,13 @@ declare class WebSocketsService {
|
|
|
9431
9433
|
* @param {string} appKey - The Pusher/Soketi application key.
|
|
9432
9434
|
*/
|
|
9433
9435
|
setAppKey(appKey: string): void;
|
|
9436
|
+
/**
|
|
9437
|
+
* Registers a live token provider used when authorizing private/presence channels.
|
|
9438
|
+
* The provider is called at subscribe/authorize time; the token is not snapshotted here.
|
|
9439
|
+
*
|
|
9440
|
+
* @param {() => string | null} getToken - Returns the current session token, or null.
|
|
9441
|
+
*/
|
|
9442
|
+
setAuthTokenProvider(getToken: () => string | null): void;
|
|
9434
9443
|
/**
|
|
9435
9444
|
* Connects to Pusher using the given app key and env `sockets` url/port/debug.
|
|
9436
9445
|
* No-ops if already connected with the same key; reconnects if the key changed.
|
|
@@ -9452,11 +9461,11 @@ declare class WebSocketsService {
|
|
|
9452
9461
|
*/
|
|
9453
9462
|
pub<T>(channel: Channel, eventName: string, data: T): Promise<boolean>;
|
|
9454
9463
|
/**
|
|
9455
|
-
* Subscribes to a specified channel
|
|
9464
|
+
* Subscribes to a specified channel and resolves when Pusher reports success.
|
|
9456
9465
|
*
|
|
9457
9466
|
* @param {string} channelName - The name of the channel to be subscribed to.
|
|
9458
9467
|
* @return {Promise<Channel>} A promise that resolves to the subscribed channel object if successful.
|
|
9459
|
-
* @throws {Error} If the subscription fails
|
|
9468
|
+
* @throws {Error} If the subscription fails.
|
|
9460
9469
|
*/
|
|
9461
9470
|
channelSub(channelName: string): Promise<Channel>;
|
|
9462
9471
|
/**
|
|
@@ -9477,8 +9486,14 @@ declare class WebSocketsService {
|
|
|
9477
9486
|
* @return {Observable<T>} An observable that emits data from the unbound event callback.
|
|
9478
9487
|
*/
|
|
9479
9488
|
eventUnbind<T>(channel: Channel, event: string): Observable<unknown>;
|
|
9489
|
+
/**
|
|
9490
|
+
* Unsubscribes from a channel by name.
|
|
9491
|
+
*
|
|
9492
|
+
* @param {string} channelName - The channel name previously passed to subscribe.
|
|
9493
|
+
*/
|
|
9494
|
+
unsubscribe(channelName: string): void;
|
|
9480
9495
|
private ensureConnected;
|
|
9481
|
-
private
|
|
9496
|
+
private refreshChannelAuthHeader;
|
|
9482
9497
|
static ɵfac: i0.ɵɵFactoryDeclaration<WebSocketsService, never>;
|
|
9483
9498
|
static ɵprov: i0.ɵɵInjectableDeclaration<WebSocketsService>;
|
|
9484
9499
|
}
|