@rdlabo/ionic-angular-kit 21.2.0 → 21.3.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rdlabo/ionic-angular-kit",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.3.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/rdlabo-team/ionic-angular-library.git"
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"@ionic/angular": "^8.0.0",
|
|
14
14
|
"@ionic/storage-angular": "^4.0.0",
|
|
15
15
|
"@capacitor/core": ">=6.0.0 <9.0.0",
|
|
16
|
+
"@capacitor/app": ">=6.0.0 <9.0.0",
|
|
16
17
|
"@capawesome/capacitor-live-update": ">=6.0.0 <9.0.0",
|
|
17
18
|
"@capacitor/haptics": ">=6.0.0 <9.0.0",
|
|
18
19
|
"@capacitor/keyboard": ">=6.0.0 <9.0.0",
|
|
@@ -1279,6 +1279,100 @@ declare const provideKitHttp: (configFactory: () => KitHttpConfig) => Environmen
|
|
|
1279
1279
|
*/
|
|
1280
1280
|
declare const kitAuthInterceptor: HttpInterceptorFn;
|
|
1281
1281
|
|
|
1282
|
+
/** One WebSocket endpoint and its ordered subprotocol list. */
|
|
1283
|
+
interface KitRealtimeSocketTarget {
|
|
1284
|
+
url: string;
|
|
1285
|
+
protocols: string[];
|
|
1286
|
+
}
|
|
1287
|
+
/** Realtime event shape required for self-echo identification. */
|
|
1288
|
+
interface KitRealtimeEvent {
|
|
1289
|
+
originId?: string;
|
|
1290
|
+
}
|
|
1291
|
+
/** An application event annotated with whether it originated from this client. */
|
|
1292
|
+
type KitClientRealtimeEvent<TEvent extends KitRealtimeEvent> = TEvent & {
|
|
1293
|
+
isSelf: boolean;
|
|
1294
|
+
};
|
|
1295
|
+
/** Timing and protocol options for {@link KitRealtimeConnection}. */
|
|
1296
|
+
interface KitRealtimeConnectionOptions {
|
|
1297
|
+
clientId?: string;
|
|
1298
|
+
ping?: string;
|
|
1299
|
+
pong?: string;
|
|
1300
|
+
maxBackoffMs?: number;
|
|
1301
|
+
openTimeoutMs?: number;
|
|
1302
|
+
pingIntervalMs?: number;
|
|
1303
|
+
livenessTimeoutMs?: number;
|
|
1304
|
+
}
|
|
1305
|
+
/** Stable per-tab/application-run ID shared by realtime connections and write headers. */
|
|
1306
|
+
declare const KIT_REALTIME_CLIENT_ID: `${string}-${string}-${string}-${string}-${string}`;
|
|
1307
|
+
/** Convert an HTTP(S) endpoint to its WebSocket equivalent. */
|
|
1308
|
+
declare function toKitWebSocketUrl(url: string): string;
|
|
1309
|
+
/** Build the standard application/auth/client WebSocket subprotocol list. */
|
|
1310
|
+
declare function kitRealtimeProtocols(protocol: string, options?: {
|
|
1311
|
+
clientId?: string;
|
|
1312
|
+
authToken?: string;
|
|
1313
|
+
authPrefix?: string;
|
|
1314
|
+
clientPrefix?: string;
|
|
1315
|
+
}): string[];
|
|
1316
|
+
/** Detect a half-open WebSocket when no pong or event arrives before the timeout. */
|
|
1317
|
+
declare class KitRealtimeLivenessWatchdog {
|
|
1318
|
+
#private;
|
|
1319
|
+
private readonly timeoutMs;
|
|
1320
|
+
private readonly onTimeout;
|
|
1321
|
+
constructor(timeoutMs: number, onTimeout: () => void);
|
|
1322
|
+
/** Restart the liveness deadline after receiving server activity. */
|
|
1323
|
+
reset(): void;
|
|
1324
|
+
/** Cancel the current liveness deadline. */
|
|
1325
|
+
clear(): void;
|
|
1326
|
+
}
|
|
1327
|
+
/**
|
|
1328
|
+
* Reconnecting Hibernation WebSocket client for Ionic/Capacitor applications.
|
|
1329
|
+
*
|
|
1330
|
+
* Subclasses provide connection intent and one or more targets. The base owns foreground/network
|
|
1331
|
+
* suspension, exponential backoff, open/liveness timeouts, runtime-friendly application pings,
|
|
1332
|
+
* all-target atomic reconnect, and a resync signal after connectivity is restored.
|
|
1333
|
+
*/
|
|
1334
|
+
declare abstract class KitRealtimeConnection<TEvent extends KitRealtimeEvent> {
|
|
1335
|
+
#private;
|
|
1336
|
+
/** Client ID used to classify self echoes. */
|
|
1337
|
+
readonly id: string;
|
|
1338
|
+
protected readonly listeners: PluginListenerHandle[];
|
|
1339
|
+
/** All parsed events received by this connection. */
|
|
1340
|
+
readonly events$: Observable<KitClientRealtimeEvent<TEvent>>;
|
|
1341
|
+
/** Emits once after every fully restored connection cycle, prompting consumers to resync via REST. */
|
|
1342
|
+
readonly reconnected$: Observable<void>;
|
|
1343
|
+
protected constructor(options?: KitRealtimeConnectionOptions);
|
|
1344
|
+
/** Whether every configured socket is currently open. */
|
|
1345
|
+
get isStreamOpen(): boolean;
|
|
1346
|
+
/** Whether every configured socket has produced recent server activity. */
|
|
1347
|
+
get isStreamHealthy(): boolean;
|
|
1348
|
+
protected abstract get shouldConnect(): boolean;
|
|
1349
|
+
protected abstract buildSocketTargets(): Promise<KitRealtimeSocketTarget[]>;
|
|
1350
|
+
/** Hook used by authenticated clients to invalidate a token after handshake failure. */
|
|
1351
|
+
protected handleConnectionFailure(): Promise<void>;
|
|
1352
|
+
/** Parse a text WebSocket message into one or more domain events. */
|
|
1353
|
+
protected parseMessage(data: string): TEvent[];
|
|
1354
|
+
/** Factory seam for platform-specific WebSocket implementations and unit tests. */
|
|
1355
|
+
protected createWebSocket(url: string, protocols: string[]): WebSocket;
|
|
1356
|
+
/** Factory seam for Capacitor app-state listeners. */
|
|
1357
|
+
protected addAppStateListener(listener: (state: {
|
|
1358
|
+
isActive: boolean;
|
|
1359
|
+
}) => void): Promise<PluginListenerHandle>;
|
|
1360
|
+
/** Factory seam for Capacitor network-status listeners. */
|
|
1361
|
+
protected addNetworkStatusListener(listener: (status: {
|
|
1362
|
+
connected: boolean;
|
|
1363
|
+
}) => void): Promise<PluginListenerHandle>;
|
|
1364
|
+
/** Register foreground/network listeners exactly once, cleaning up handles that resolve after disconnect. */
|
|
1365
|
+
protected registerLifecycleListeners(): Promise<void>;
|
|
1366
|
+
/** Remove all lifecycle listeners, including listeners whose async registration has not completed yet. */
|
|
1367
|
+
protected removeLifecycleListeners(): void;
|
|
1368
|
+
/** Suspend sockets without changing the subclass connection intent. */
|
|
1369
|
+
protected suspend(): void;
|
|
1370
|
+
/** Reset resync and backoff history when the owning session ends. */
|
|
1371
|
+
protected resetConnectionState(): void;
|
|
1372
|
+
/** Open every current target, or schedule an atomic reconnect if any target fails. */
|
|
1373
|
+
protected open(): Promise<void>;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1282
1376
|
/**
|
|
1283
1377
|
* Trigger native haptic impact feedback.
|
|
1284
1378
|
*
|
|
@@ -1477,5 +1571,5 @@ type ComponentPropsType<T> = {
|
|
|
1477
1571
|
[K in keyof T]: InputSignal<T[K]> | InputSignalWithTransform<T[K], any>;
|
|
1478
1572
|
};
|
|
1479
1573
|
|
|
1480
|
-
export { KIT_AUTH_CONFIG, KIT_HTTP_CONFIG, KIT_LAST_AUTH_EMAIL_KEY, KIT_OVERLAY_CONFIG, KIT_THEME_STORAGE_KEY, KitAuthInputDirective, KitLoadingController, KitMaintenanceController, KitOverlayController, KitReloadAlertController, KitStorageService, arrayConcatById, disableHandler, isMaintenanceError, kitAuthInterceptor, kitChangeEventDisabled, kitClearStoragePreservingKeys, kitCreateDidEnter, kitForgetEmail, kitImpact, kitIsValidEmail, kitKeyboardInit, kitPresentAuthFailedAlert, kitPresentLanguageActionSheet, kitRecallEmail, kitRememberEmail, kitRequireAuthorizedGuard, kitRequireConfirmingGuard, kitRequiredUnauthorizedGuard, mountViewModel, objectEqual, provideKitAuth, provideKitHttp, provideKitOverlay };
|
|
1481
|
-
export type { ComponentPropsType, KitAlertCloseOptions, KitAlertConfirmOptions, KitAuthConfig, KitAuthFailedAlertOptions, KitAuthInputMode, KitAuthRedirects, KitAuthState, KitClearableStore, KitEmailStore, KitHttpConfig, KitKeyboardAdjust, KitLabels, KitLanguageActionSheetOptions, KitLanguageOption, KitMaintenanceOptions, KitModalPresentOptions, KitOverlayConfig, KitReloadAlertOptions, ModalMetadata, ReactiveHost, ViewModelHost };
|
|
1574
|
+
export { KIT_AUTH_CONFIG, KIT_HTTP_CONFIG, KIT_LAST_AUTH_EMAIL_KEY, KIT_OVERLAY_CONFIG, KIT_REALTIME_CLIENT_ID, KIT_THEME_STORAGE_KEY, KitAuthInputDirective, KitLoadingController, KitMaintenanceController, KitOverlayController, KitRealtimeConnection, KitRealtimeLivenessWatchdog, KitReloadAlertController, KitStorageService, arrayConcatById, disableHandler, isMaintenanceError, kitAuthInterceptor, kitChangeEventDisabled, kitClearStoragePreservingKeys, kitCreateDidEnter, kitForgetEmail, kitImpact, kitIsValidEmail, kitKeyboardInit, kitPresentAuthFailedAlert, kitPresentLanguageActionSheet, kitRealtimeProtocols, kitRecallEmail, kitRememberEmail, kitRequireAuthorizedGuard, kitRequireConfirmingGuard, kitRequiredUnauthorizedGuard, mountViewModel, objectEqual, provideKitAuth, provideKitHttp, provideKitOverlay, toKitWebSocketUrl };
|
|
1575
|
+
export type { ComponentPropsType, KitAlertCloseOptions, KitAlertConfirmOptions, KitAuthConfig, KitAuthFailedAlertOptions, KitAuthInputMode, KitAuthRedirects, KitAuthState, KitClearableStore, KitClientRealtimeEvent, KitEmailStore, KitHttpConfig, KitKeyboardAdjust, KitLabels, KitLanguageActionSheetOptions, KitLanguageOption, KitMaintenanceOptions, KitModalPresentOptions, KitOverlayConfig, KitRealtimeConnectionOptions, KitRealtimeEvent, KitRealtimeSocketTarget, KitReloadAlertOptions, ModalMetadata, ReactiveHost, ViewModelHost };
|