@ama-mfe/ng-utils 15.3.0-prerelease.9 → 15.4.0-prerelease.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/README.md +4 -2
- package/fesm2022/ama-mfe-ng-utils.mjs +2334 -2429
- package/fesm2022/ama-mfe-ng-utils.mjs.map +1 -1
- package/package.json +6 -6
- package/schematics/ng-add/schema.json +0 -3
- package/types/ama-mfe-ng-utils.d.ts +1083 -1060
- package/types/ama-mfe-ng-utils.d.ts.map +1 -1
|
@@ -1,191 +1,187 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { Logger, LoggerService } from
|
|
5
|
-
import { MessagePeerConfig, MessagePeerServiceType } from
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { SafeResourceUrl } from "@angular/platform-browser";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { DestroyRef, EnvironmentProviders, InjectionToken, OnDestroy, PipeTransform, Signal } from "@angular/core";
|
|
4
|
+
import { Logger, LoggerService } from "@o3r/logger";
|
|
5
|
+
import { MessagePeerConfig as ConnectionConfig, MessagePeerService as ConnectionService, MessagePeerServiceType } from "@amadeus-it-group/microfrontends-angular";
|
|
6
|
+
import { HistoryMessage, HistoryV1_0, NAVIGATION_DECISION_MESSAGE_TYPE, NAVIGATION_REQUEST_MESSAGE_TYPE, NavigationBlockStateMessage, NavigationBlockStateV1_0, NavigationDecisionMessage, NavigationDecisionV1_0, NavigationMessage, NavigationRequestMessage, NavigationRequestV1_0, NavigationV1_0, NavigationV1_1, ResizeMessage, ResizeV1_0, ThemeMessage, ThemeStructure, ThemeV1_0, UserActivityEventType, UserActivityMessage, UserActivityMessageV1_0 } from "@ama-mfe/messages";
|
|
7
|
+
import { PeerConnectionOptions, RoutedMessage, VersionedMessage } from "@amadeus-it-group/microfrontends";
|
|
8
|
+
import { CanActivateChildFn, CanActivateFn, CanDeactivateFn } from "@angular/router";
|
|
9
|
+
export declare class ConnectDirective {
|
|
10
|
+
/**
|
|
11
|
+
* The connection ID required for the message peer service.
|
|
12
|
+
*/
|
|
13
|
+
readonly connect: import("@angular/core").InputSignal<string>;
|
|
14
|
+
/**
|
|
15
|
+
* The sanitized source URL for the iframe.
|
|
16
|
+
*/
|
|
17
|
+
readonly src: import("@angular/core").InputSignal<SafeResourceUrl | undefined>;
|
|
18
|
+
/**
|
|
19
|
+
* Binds the `src` attribute of the iframe to the sanitized source URL.
|
|
20
|
+
*/
|
|
21
|
+
get srcAttr(): SafeResourceUrl | undefined;
|
|
22
|
+
private readonly messageService;
|
|
23
|
+
private readonly domSanitizer;
|
|
24
|
+
private readonly iframeElement;
|
|
25
|
+
private readonly clientOrigin;
|
|
26
|
+
constructor();
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConnectDirective, never>;
|
|
28
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ConnectDirective, "iframe[connect]", never, {
|
|
29
|
+
"connect": {
|
|
30
|
+
"alias": "connect";
|
|
31
|
+
"required": true;
|
|
32
|
+
"isSignal": true;
|
|
33
|
+
};
|
|
34
|
+
"src": {
|
|
35
|
+
"alias": "src";
|
|
36
|
+
"required": false;
|
|
37
|
+
"isSignal": true;
|
|
38
|
+
};
|
|
39
|
+
}, {}, never, never, true, never>;
|
|
32
40
|
}
|
|
33
|
-
|
|
34
41
|
/** Options to configure the connection inside the communication protocol */
|
|
35
|
-
interface ConnectionConfigOptions extends Omit<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
export interface ConnectionConfigOptions extends Omit<ConnectionConfig, 'id'> {
|
|
43
|
+
/** @inheritdoc */
|
|
44
|
+
id?: string;
|
|
45
|
+
/** Logger used to gather information */
|
|
46
|
+
logger?: Logger;
|
|
40
47
|
}
|
|
41
48
|
/**
|
|
42
49
|
* Provide the communication protocol connection configuration
|
|
43
50
|
* @param connectionConfigOptions The identifier of the application in the communication protocol ecosystem plus the types of messages able to exchange and a logger object
|
|
44
51
|
*/
|
|
45
|
-
declare function provideConnection(connectionConfigOptions?: ConnectionConfigOptions):
|
|
46
|
-
|
|
52
|
+
export declare function provideConnection(connectionConfigOptions?: ConnectionConfigOptions): import("@angular/core").EnvironmentProviders;
|
|
47
53
|
/**
|
|
48
54
|
* Gets the available consumers and formats them into a {@link DeclareMessages} object.
|
|
49
55
|
* @param consumers - The list of registered message consumers.
|
|
50
56
|
* @returns The formatted DeclareMessages object.
|
|
51
57
|
*/
|
|
52
|
-
declare const getAvailableConsumers: (consumers: BasicMessageConsumer[]) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
export declare const getAvailableConsumers: (consumers: BasicMessageConsumer[]) => {
|
|
59
|
+
type: "declare_messages";
|
|
60
|
+
version: "1.0";
|
|
61
|
+
messages: {
|
|
62
|
+
type: string;
|
|
63
|
+
version: string;
|
|
64
|
+
}[];
|
|
59
65
|
};
|
|
60
|
-
|
|
61
66
|
/** the error message type */
|
|
62
|
-
declare const ERROR_MESSAGE_TYPE = "error";
|
|
67
|
+
export declare const ERROR_MESSAGE_TYPE = "error";
|
|
63
68
|
/**
|
|
64
69
|
* The possible reasons for an error.
|
|
65
70
|
*/
|
|
66
|
-
type ErrorReason = 'unknown_type' | 'version_mismatch' | 'internal_error';
|
|
71
|
+
export type ErrorReason = 'unknown_type' | 'version_mismatch' | 'internal_error';
|
|
67
72
|
/**
|
|
68
73
|
* The content of an error message.
|
|
69
74
|
* @template S - The type of the source message.
|
|
70
75
|
*/
|
|
71
|
-
interface ErrorContent<S extends VersionedMessage = VersionedMessage> {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
export interface ErrorContent<S extends VersionedMessage = VersionedMessage> {
|
|
77
|
+
/** The reason for the error */
|
|
78
|
+
reason: ErrorReason;
|
|
79
|
+
/** The source message that caused the error */
|
|
80
|
+
source: S;
|
|
76
81
|
}
|
|
77
|
-
|
|
78
82
|
/** An error message with the version 1.0 */
|
|
79
|
-
interface ErrorMessageV1_0<S extends VersionedMessage = VersionedMessage> extends VersionedMessage, ErrorContent<S> {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
export interface ErrorMessageV1_0<S extends VersionedMessage = VersionedMessage> extends VersionedMessage, ErrorContent<S> {
|
|
84
|
+
/** @inheritdoc */
|
|
85
|
+
type: 'error';
|
|
86
|
+
/** @inheritdoc */
|
|
87
|
+
version: '1.0';
|
|
84
88
|
}
|
|
85
|
-
|
|
86
89
|
/** The versions available for error messages */
|
|
87
|
-
type ErrorMessage = ErrorMessageV1_0;
|
|
88
|
-
|
|
90
|
+
export type ErrorMessage = ErrorMessageV1_0;
|
|
89
91
|
/**
|
|
90
92
|
* Helper function to send an error message by the given endpoint (peer)
|
|
91
93
|
* @param peer The endpoint sending the message
|
|
92
94
|
* @param content the content of the error message to be sent
|
|
93
95
|
*/
|
|
94
|
-
declare const sendError: (peer: MessagePeerServiceType<any>, content: ErrorContent) => void;
|
|
96
|
+
export declare const sendError: (peer: MessagePeerServiceType<any>, content: ErrorContent) => void;
|
|
95
97
|
/**
|
|
96
98
|
* Check if the given message is of type error and the error reson is present too
|
|
97
99
|
* @param message the message to be checked
|
|
98
100
|
*/
|
|
99
|
-
declare const isErrorMessage: (message: any) => message is VersionedMessage & {
|
|
100
|
-
|
|
101
|
+
export declare const isErrorMessage: (message: any) => message is VersionedMessage & {
|
|
102
|
+
type: typeof ERROR_MESSAGE_TYPE;
|
|
101
103
|
} & ErrorContent;
|
|
102
|
-
|
|
103
104
|
/**
|
|
104
105
|
* Type guard to check if a message is a user activity message
|
|
105
106
|
* @param message The message to check
|
|
106
107
|
*/
|
|
107
|
-
declare function isUserActivityMessage(message: unknown): message is UserActivityMessage;
|
|
108
|
-
|
|
108
|
+
export declare function isUserActivityMessage(message: unknown): message is UserActivityMessage;
|
|
109
109
|
/**
|
|
110
110
|
* Use the message payload to execute an action based on message type
|
|
111
111
|
* @param message message to consume
|
|
112
112
|
*/
|
|
113
|
-
type MessageCallback<T extends VersionedMessage> = (message: RoutedMessage<T>) => void | Promise<void>;
|
|
113
|
+
export type MessageCallback<T extends VersionedMessage> = (message: RoutedMessage<T>) => void | Promise<void>;
|
|
114
114
|
/**
|
|
115
115
|
* Description of the accepted messages versions and their callbacks for a given message type
|
|
116
116
|
*/
|
|
117
|
-
interface MessageVersions<T extends VersionedMessage> {
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
export interface MessageVersions<T extends VersionedMessage> {
|
|
118
|
+
/** The message callback coresponding to the version */
|
|
119
|
+
[version: string]: MessageCallback<T>;
|
|
120
120
|
}
|
|
121
121
|
/** Description for the base message consumer */
|
|
122
|
-
interface BasicMessageConsumer<T extends VersionedMessage = VersionedMessage> {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
export interface BasicMessageConsumer<T extends VersionedMessage = VersionedMessage> {
|
|
123
|
+
/** Contains the message type */
|
|
124
|
+
type: T['type'];
|
|
125
|
+
/** A map of messages versions and their callbacks */
|
|
126
|
+
supportedVersions: Record<string, MessageCallback<any>>;
|
|
127
127
|
}
|
|
128
128
|
/** The consumer of a given message type */
|
|
129
|
-
interface MessageConsumer<T extends VersionedMessage = VersionedMessage> extends BasicMessageConsumer {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
/** Unregister the consumer */
|
|
141
|
-
stop(): void | Promise<void>;
|
|
129
|
+
export interface MessageConsumer<T extends VersionedMessage = VersionedMessage> extends BasicMessageConsumer {
|
|
130
|
+
/** The message type which will be handled */
|
|
131
|
+
type: T['type'];
|
|
132
|
+
/** The map of functions which will be executed for each supported version */
|
|
133
|
+
supportedVersions: { [V in T['version']]: MessageCallback<T & {
|
|
134
|
+
version: V;
|
|
135
|
+
}>; };
|
|
136
|
+
/** Prepare the registration of the consumer */
|
|
137
|
+
start(): void | Promise<void>;
|
|
138
|
+
/** Unregister the consumer */
|
|
139
|
+
stop(): void | Promise<void>;
|
|
142
140
|
}
|
|
143
141
|
/**
|
|
144
142
|
* Definition of a message producer and which types of messages are produced
|
|
145
143
|
*/
|
|
146
|
-
interface MessageProducer<T extends VersionedMessage = VersionedMessage> {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
144
|
+
export interface MessageProducer<T extends VersionedMessage = VersionedMessage> {
|
|
145
|
+
/** The types of the produced message */
|
|
146
|
+
types: T['type'] | readonly T['type'][];
|
|
147
|
+
/**
|
|
148
|
+
* The producer should handle an error in case that it has produced a message which cannot be consumed by other peers
|
|
149
|
+
* @param message the error message received from a peer when the message sent previously has raised an error
|
|
150
|
+
*/
|
|
151
|
+
handleError(message: ErrorContent<T>): void | Promise<void>;
|
|
154
152
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
153
|
+
export declare class ConsumerManagerService {
|
|
154
|
+
private readonly messageService;
|
|
155
|
+
private readonly producerManagerService;
|
|
156
|
+
private readonly registeredConsumers;
|
|
157
|
+
private readonly logger;
|
|
158
|
+
/** The list of registered consumers */
|
|
159
|
+
readonly consumers: import("@angular/core").Signal<BasicMessageConsumer<VersionedMessage>[]>;
|
|
160
|
+
constructor();
|
|
161
|
+
/**
|
|
162
|
+
* Consume a received message
|
|
163
|
+
* @param message the received message body
|
|
164
|
+
*/
|
|
165
|
+
private consumeMessage;
|
|
166
|
+
/**
|
|
167
|
+
* Call the registered message callback(s) to consume the given message
|
|
168
|
+
* Handle error messages of internal communication protocol messages
|
|
169
|
+
* @param message message to consume
|
|
170
|
+
*/
|
|
171
|
+
private consumeAdditionalMessage;
|
|
172
|
+
/**
|
|
173
|
+
* Register a message consumer
|
|
174
|
+
* @param consumer an instance of message consumer
|
|
175
|
+
*/
|
|
176
|
+
register(consumer: BasicMessageConsumer): void;
|
|
177
|
+
/**
|
|
178
|
+
* Unregister a message consumer
|
|
179
|
+
* @param consumer an instance of message consumer
|
|
180
|
+
*/
|
|
181
|
+
unregister(consumer: BasicMessageConsumer): void;
|
|
182
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConsumerManagerService, never>;
|
|
183
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
187
184
|
}
|
|
188
|
-
|
|
189
185
|
/**
|
|
190
186
|
* An abstract base class for message consumers that provides common functionality for registering and unregistering with the ConsumerManagerService.
|
|
191
187
|
*
|
|
@@ -194,125 +190,120 @@ declare class ConsumerManagerService {
|
|
|
194
190
|
*
|
|
195
191
|
* To use this class, simply extend it and implement the required properties (type and supportedVersions) and any additional logic needed to consume messages.
|
|
196
192
|
*/
|
|
197
|
-
declare abstract class AbstractMessageConsumer<T extends VersionedMessage = VersionedMessage> implements MessageConsumer<T> {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
193
|
+
export declare abstract class AbstractMessageConsumer<T extends VersionedMessage = VersionedMessage> implements MessageConsumer<T> {
|
|
194
|
+
/** The service used to register the consumer */
|
|
195
|
+
protected readonly consumerManagerService: ConsumerManagerService;
|
|
196
|
+
/** The reference used to handle the destruction of the consumer */
|
|
197
|
+
protected readonly destroyRef: DestroyRef;
|
|
198
|
+
/** Logger shared with subclasses. */
|
|
199
|
+
protected readonly logger: LoggerService;
|
|
200
|
+
private unregisterCallback?;
|
|
201
|
+
/** @inheritdoc */
|
|
202
|
+
abstract readonly type: MessageConsumer<T>['type'];
|
|
203
|
+
/** @inheritdoc */
|
|
204
|
+
abstract readonly supportedVersions: MessageConsumer<T>['supportedVersions'];
|
|
205
|
+
/** @inheritdoc */
|
|
206
|
+
start(): void;
|
|
207
|
+
/** @inheritdoc */
|
|
208
|
+
stop(): void;
|
|
213
209
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
210
|
+
export declare class ProducerManagerService {
|
|
211
|
+
private readonly registeredProducers;
|
|
212
|
+
/** Get the list of registered producers of messages. The list will contain unique elements */
|
|
213
|
+
get producers(): MessageProducer<VersionedMessage>[];
|
|
214
|
+
/**
|
|
215
|
+
* Register a producer of a message
|
|
216
|
+
* @param producer The instance of the message producer
|
|
217
|
+
*/
|
|
218
|
+
register(producer: MessageProducer): void;
|
|
219
|
+
/**
|
|
220
|
+
* Unregister a producer of a message
|
|
221
|
+
* @param producer The instance of the message producer
|
|
222
|
+
*/
|
|
223
|
+
unregister(producer: MessageProducer): void;
|
|
224
|
+
/**
|
|
225
|
+
* Handles the received error message for the given message type by invoking the appropriate producer handlers.
|
|
226
|
+
* @template T - The type of the message, extending from Message.
|
|
227
|
+
* @param message - The error message to handle.
|
|
228
|
+
* @returns - A promise that resolves to true if the error was handled by at least one handler, false otherwise.
|
|
229
|
+
*/
|
|
230
|
+
dispatchError<T extends VersionedMessage = VersionedMessage>(message: ErrorContent<T>): Promise<boolean>;
|
|
231
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ProducerManagerService, never>;
|
|
232
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
238
233
|
}
|
|
239
|
-
|
|
240
234
|
/**
|
|
241
235
|
* Method to call in the constructor of a producer
|
|
242
236
|
* @note should be used in injection context
|
|
243
237
|
* @param producer
|
|
244
238
|
*/
|
|
245
|
-
declare const registerProducer: (producer: MessageProducer) => void;
|
|
239
|
+
export declare const registerProducer: (producer: MessageProducer) => void;
|
|
246
240
|
/**
|
|
247
241
|
* Method to call in the constructor of a consumer
|
|
248
242
|
* @note should be used in injection context
|
|
249
243
|
* @param consumer
|
|
250
244
|
*/
|
|
251
|
-
declare const registerConsumer: (consumer: MessageConsumer) => void;
|
|
252
|
-
|
|
245
|
+
export declare const registerConsumer: (consumer: MessageConsumer) => void;
|
|
253
246
|
/**
|
|
254
247
|
* A service that handles history messages.
|
|
255
248
|
*
|
|
256
249
|
* This service listens for history messages and navigates accordingly.
|
|
257
250
|
*/
|
|
258
|
-
declare class HistoryConsumerService extends AbstractMessageConsumer<HistoryMessage> {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
251
|
+
export declare class HistoryConsumerService extends AbstractMessageConsumer<HistoryMessage> {
|
|
252
|
+
/**
|
|
253
|
+
* The type of messages this service handles.
|
|
254
|
+
*/
|
|
255
|
+
readonly type = "history";
|
|
256
|
+
/**
|
|
257
|
+
* @inheritdoc
|
|
258
|
+
*/
|
|
259
|
+
readonly supportedVersions: {
|
|
260
|
+
/**
|
|
261
|
+
* Use the message payload to navigate in the history
|
|
262
|
+
* @param message message to consume
|
|
265
263
|
*/
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
*/
|
|
271
|
-
'1.0': (message: RoutedMessage<HistoryV1_0>) => void;
|
|
272
|
-
};
|
|
273
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<HistoryConsumerService, never>;
|
|
274
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
264
|
+
'1.0': (message: RoutedMessage<HistoryV1_0>) => void;
|
|
265
|
+
};
|
|
266
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HistoryConsumerService, never>;
|
|
267
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
275
268
|
}
|
|
276
|
-
|
|
277
269
|
/**
|
|
278
270
|
* Provides necessary overrides to make the module navigation in history work in an embedded context :
|
|
279
271
|
* - Prevent pushing states to history, replace state instead
|
|
280
272
|
* - Handle history navigation via History messages to let the host manage the states
|
|
281
273
|
*/
|
|
282
|
-
declare function provideHistoryOverrides():
|
|
283
|
-
|
|
274
|
+
export declare function provideHistoryOverrides(): import("@angular/core").EnvironmentProviders;
|
|
284
275
|
/**
|
|
285
276
|
* Search parameter to add to the URL when embedding an iframe containing the URL of the host.
|
|
286
277
|
* This is needed to support Firefox (on which {@link https://developer.mozilla.org/docs/Web/API/Location/ancestorOrigins | location.ancestorOrigins} is not currently supported)
|
|
287
278
|
* in case of redirection inside the iframe.
|
|
288
279
|
*/
|
|
289
|
-
declare const MFE_HOST_URL_PARAM = "ama-mfe-host-url";
|
|
280
|
+
export declare const MFE_HOST_URL_PARAM = "ama-mfe-host-url";
|
|
290
281
|
/**
|
|
291
282
|
* Search parameter to add to the URL to let a module know on which application it's embedded
|
|
292
283
|
*/
|
|
293
|
-
declare const MFE_HOST_APPLICATION_ID_PARAM = "ama-mfe-host-app-id";
|
|
284
|
+
export declare const MFE_HOST_APPLICATION_ID_PARAM = "ama-mfe-host-app-id";
|
|
294
285
|
/**
|
|
295
286
|
* Search parameter to add to the URL to identify the application in the network of peers in the communication protocol
|
|
296
287
|
*/
|
|
297
|
-
declare const MFE_MODULE_APPLICATION_ID_PARAM = "ama-mfe-module-app-id";
|
|
288
|
+
export declare const MFE_MODULE_APPLICATION_ID_PARAM = "ama-mfe-module-app-id";
|
|
298
289
|
/** The list of query parameters which can be set by the host */
|
|
299
|
-
declare const hostQueryParams: string[];
|
|
290
|
+
export declare const hostQueryParams: string[];
|
|
300
291
|
/**
|
|
301
292
|
* Information set up at host level to use in embedded context
|
|
302
293
|
*/
|
|
303
|
-
interface MFEHostInformation {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
294
|
+
export interface MFEHostInformation {
|
|
295
|
+
/**
|
|
296
|
+
* URL of the host application
|
|
297
|
+
*/
|
|
298
|
+
hostURL?: string;
|
|
299
|
+
/**
|
|
300
|
+
* ID of the host application
|
|
301
|
+
*/
|
|
302
|
+
hostApplicationId?: string;
|
|
303
|
+
/**
|
|
304
|
+
* ID of the module to embed defined at host level
|
|
305
|
+
*/
|
|
306
|
+
moduleApplicationId?: string;
|
|
316
307
|
}
|
|
317
308
|
/**
|
|
318
309
|
* Gather the host information from the url parameters
|
|
@@ -324,132 +315,160 @@ interface MFEHostInformation {
|
|
|
324
315
|
* The module application ID is taken from the search parameter {@link MFE_APPLICATION_ID_PARAM} in the URL of the iframe
|
|
325
316
|
* @param locationParam - A {@link Location} object with information about the current location of the document. Defaults to global {@link location}.
|
|
326
317
|
*/
|
|
327
|
-
declare function getHostInfo(locationParam?: Location): MFEHostInformation;
|
|
318
|
+
export declare function getHostInfo(locationParam?: Location): MFEHostInformation;
|
|
328
319
|
/**
|
|
329
320
|
* Gather the host information from the url parameters and handle the persistence in session storage.
|
|
330
321
|
*/
|
|
331
|
-
declare function persistHostInfo(): void;
|
|
332
|
-
|
|
322
|
+
export declare function persistHostInfo(): void;
|
|
333
323
|
/**
|
|
334
324
|
* A pipe that adds the host information in the URL of an iframe,
|
|
335
325
|
*/
|
|
336
|
-
declare class HostInfoPipe implements PipeTransform {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
326
|
+
export declare class HostInfoPipe implements PipeTransform {
|
|
327
|
+
private readonly domSanitizer;
|
|
328
|
+
/**
|
|
329
|
+
* Transforms the given URL or SafeResourceUrl by appending query parameters.
|
|
330
|
+
* @param url - The URL or SafeResourceUrl to be transformed.
|
|
331
|
+
* @param options - hostId and moduleId
|
|
332
|
+
* @returns - The transformed SafeResourceUrl or undefined if the input URL is invalid.
|
|
333
|
+
*/
|
|
334
|
+
transform(url: string, options: {
|
|
335
|
+
hostId: string;
|
|
336
|
+
moduleId?: string;
|
|
337
|
+
}): string;
|
|
338
|
+
transform(url: SafeResourceUrl, options: {
|
|
339
|
+
hostId: string;
|
|
340
|
+
moduleId?: string;
|
|
341
|
+
}): SafeResourceUrl;
|
|
342
|
+
transform(url: undefined, options: {
|
|
343
|
+
hostId: string;
|
|
344
|
+
moduleId?: string;
|
|
345
|
+
}): undefined;
|
|
346
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HostInfoPipe, never>;
|
|
347
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<HostInfoPipe, "hostInfo", true>;
|
|
358
348
|
}
|
|
359
|
-
|
|
360
349
|
/**
|
|
361
350
|
* Presentational component for rendering an iframe with MFE integration directives.
|
|
362
351
|
* Applies host info injection, theming and cross-iframe communication.
|
|
363
352
|
*/
|
|
364
|
-
declare class IframeEmbedComponent {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
353
|
+
export declare class IframeEmbedComponent {
|
|
354
|
+
private readonly domSanitizer;
|
|
355
|
+
/** The URL for the iframe source (plain string or pre-sanitized SafeResourceUrl). */
|
|
356
|
+
readonly src: import("@angular/core").InputSignal<string | SafeResourceUrl>;
|
|
357
|
+
/** The sanitized URL, auto-sanitized if a plain string is provided. */
|
|
358
|
+
readonly safeSrc: import("@angular/core").Signal<SafeResourceUrl>;
|
|
359
|
+
/** The unique identifier for the module, used for cross-iframe communication. */
|
|
360
|
+
readonly moduleId: import("@angular/core").InputSignal<string>;
|
|
361
|
+
/** The host application identifier sent to the embedded module. */
|
|
362
|
+
readonly hostApplicationId: import("@angular/core").InputSignal<string>;
|
|
363
|
+
/**
|
|
364
|
+
* The sandbox attribute for the iframe.
|
|
365
|
+
* Pass through to the SandboxDirective on the iframe element.
|
|
366
|
+
*/
|
|
367
|
+
readonly sandbox: import("@angular/core").InputSignal<string>;
|
|
368
|
+
/**
|
|
369
|
+
* The allow attribute (Permissions Policy) for the iframe, e.g. `'camera; microphone'`.
|
|
370
|
+
* Pass through to the AllowDirective on the iframe element.
|
|
371
|
+
* Defaults to empty string (attribute not set).
|
|
372
|
+
*/
|
|
373
|
+
readonly allow: import("@angular/core").InputSignal<string>;
|
|
374
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IframeEmbedComponent, never>;
|
|
375
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<IframeEmbedComponent, "mfe-iframe-embed", never, {
|
|
376
|
+
"src": {
|
|
377
|
+
"alias": "src";
|
|
378
|
+
"required": true;
|
|
379
|
+
"isSignal": true;
|
|
380
|
+
};
|
|
381
|
+
"moduleId": {
|
|
382
|
+
"alias": "moduleId";
|
|
383
|
+
"required": true;
|
|
384
|
+
"isSignal": true;
|
|
385
|
+
};
|
|
386
|
+
"hostApplicationId": {
|
|
387
|
+
"alias": "hostApplicationId";
|
|
388
|
+
"required": true;
|
|
389
|
+
"isSignal": true;
|
|
390
|
+
};
|
|
391
|
+
"sandbox": {
|
|
392
|
+
"alias": "sandbox";
|
|
393
|
+
"required": false;
|
|
394
|
+
"isSignal": true;
|
|
395
|
+
};
|
|
396
|
+
"allow": {
|
|
397
|
+
"alias": "allow";
|
|
398
|
+
"required": false;
|
|
399
|
+
"isSignal": true;
|
|
400
|
+
};
|
|
401
|
+
}, {}, never, never, true, never>;
|
|
381
402
|
}
|
|
382
|
-
|
|
383
403
|
/**
|
|
384
404
|
* A service that handles navigation messages and routing.
|
|
385
405
|
*
|
|
386
406
|
* This service listens for navigation messages and updates the router state accordingly.
|
|
387
407
|
*/
|
|
388
|
-
declare class NavigationConsumerService extends AbstractMessageConsumer<NavigationMessage> {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
*/
|
|
412
|
-
'1.0': (message: RoutedMessage<NavigationV1_0>) => void;
|
|
413
|
-
/**
|
|
414
|
-
* Same as 1.0 but applies the navigation extras (e.g. replaceUrl) forwarded by the producer
|
|
415
|
-
* so the host router reproduces the original history semantics.
|
|
416
|
-
* @param message message to consume
|
|
417
|
-
*/
|
|
418
|
-
'1.1': (message: RoutedMessage<NavigationV1_1>) => void;
|
|
419
|
-
};
|
|
420
|
-
/**
|
|
421
|
-
* Parses a URL and returns an object containing the paths and query parameters.
|
|
422
|
-
* @param url - The URL to parse.
|
|
423
|
-
* @returns An object containing the paths and query parameters.
|
|
408
|
+
export declare class NavigationConsumerService extends AbstractMessageConsumer<NavigationMessage> {
|
|
409
|
+
private readonly router;
|
|
410
|
+
private readonly activeRoute;
|
|
411
|
+
private readonly requestedUrl;
|
|
412
|
+
/**
|
|
413
|
+
* An observable that emits the requested URL and optional channel ID.
|
|
414
|
+
*/
|
|
415
|
+
readonly requestedUrl$: import("rxjs").Observable<{
|
|
416
|
+
url: string;
|
|
417
|
+
channelId?: string;
|
|
418
|
+
}>;
|
|
419
|
+
/**
|
|
420
|
+
* The type of messages this service handles.
|
|
421
|
+
*/
|
|
422
|
+
readonly type = "navigation";
|
|
423
|
+
/**
|
|
424
|
+
* @inheritdoc
|
|
425
|
+
*/
|
|
426
|
+
readonly supportedVersions: {
|
|
427
|
+
/**
|
|
428
|
+
* Use the message paylod to compute a new url and emit it via the public subject
|
|
429
|
+
* Additionally navigate to the new url
|
|
430
|
+
* @param message message to consume
|
|
424
431
|
*/
|
|
425
|
-
|
|
432
|
+
'1.0': (message: RoutedMessage<NavigationV1_0>) => void;
|
|
426
433
|
/**
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
* @param
|
|
434
|
+
* Same as 1.0 but applies the navigation extras (e.g. replaceUrl) forwarded by the producer
|
|
435
|
+
* so the host router reproduces the original history semantics.
|
|
436
|
+
* @param message message to consume
|
|
430
437
|
*/
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
438
|
+
'1.1': (message: RoutedMessage<NavigationV1_1>) => void;
|
|
439
|
+
};
|
|
440
|
+
/**
|
|
441
|
+
* Parses a URL and returns an object containing the paths and query parameters.
|
|
442
|
+
* @param url - The URL to parse.
|
|
443
|
+
* @returns An object containing the paths and query parameters.
|
|
444
|
+
*/
|
|
445
|
+
private parseUrl;
|
|
446
|
+
/**
|
|
447
|
+
* Navigates to the specified URL.
|
|
448
|
+
* @param url - The URL to navigate to.
|
|
449
|
+
* @param extras - Optional navigation extras forwarded from the embedded application.
|
|
450
|
+
*/
|
|
451
|
+
private navigate;
|
|
452
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavigationConsumerService, never>;
|
|
453
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
434
454
|
}
|
|
435
|
-
|
|
436
455
|
/**
|
|
437
456
|
* Options for restoring a route with optional query parameters and memory channel ID.
|
|
438
457
|
*/
|
|
439
|
-
interface RestoreRouteOptions {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
458
|
+
export interface RestoreRouteOptions {
|
|
459
|
+
/**
|
|
460
|
+
* Whether to propagate query parameters from the top window to the module URL.
|
|
461
|
+
*/
|
|
462
|
+
propagateQueryParams?: boolean;
|
|
463
|
+
/**
|
|
464
|
+
* Whether to override existing query parameters in the module URL with those from the top window.
|
|
465
|
+
*/
|
|
466
|
+
overrideQueryParams?: boolean;
|
|
467
|
+
/**
|
|
468
|
+
* The memory channel ID used to retrieve the memorized route.
|
|
469
|
+
* If provided, the memorized route associated with this ID will be used.
|
|
470
|
+
*/
|
|
471
|
+
memoryChannelId?: string;
|
|
453
472
|
}
|
|
454
473
|
/**
|
|
455
474
|
* A pipe that restores a route with optional query parameters and memory channel ID.
|
|
@@ -457,88 +476,111 @@ interface RestoreRouteOptions {
|
|
|
457
476
|
* This pipe is used to transform a URL or SafeResourceUrl by appending query parameters
|
|
458
477
|
* and adjusting the pathname based on the current active route and memorized route.
|
|
459
478
|
*/
|
|
460
|
-
declare class RestoreRoute implements PipeTransform {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
479
|
+
export declare class RestoreRoute implements PipeTransform {
|
|
480
|
+
private readonly activeRoute;
|
|
481
|
+
private readonly domSanitizer;
|
|
482
|
+
private readonly routeMemorizeService;
|
|
483
|
+
private readonly window;
|
|
484
|
+
/**
|
|
485
|
+
* Transforms the given URL or SafeResourceUrl by appending query parameters and adjusting the pathname.
|
|
486
|
+
* @param url - The URL or SafeResourceUrl to be transformed.
|
|
487
|
+
* @param options - Optional parameters to control the transformation. {@link RestoreRouteOptions}
|
|
488
|
+
* @returns - The transformed SafeResourceUrl or undefined if the input URL is invalid.
|
|
489
|
+
*/
|
|
490
|
+
transform(url: string, options?: Partial<RestoreRouteOptions>): string;
|
|
491
|
+
transform(url: SafeResourceUrl, options?: Partial<RestoreRouteOptions>): SafeResourceUrl;
|
|
492
|
+
transform(url: undefined, options?: Partial<RestoreRouteOptions>): undefined;
|
|
493
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RestoreRoute, never>;
|
|
494
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<RestoreRoute, "restoreRoute", true>;
|
|
476
495
|
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
496
|
+
export declare class RouteMemorizeDirective {
|
|
497
|
+
/**
|
|
498
|
+
* Whether to memorize the route.
|
|
499
|
+
* Default is true.
|
|
500
|
+
*/
|
|
501
|
+
readonly memorizeRoute: import("@angular/core").InputSignal<boolean | "" | undefined>;
|
|
502
|
+
/**
|
|
503
|
+
* The ID used to memorize the route.
|
|
504
|
+
*/
|
|
505
|
+
readonly memorizeRouteId: import("@angular/core").InputSignal<string | undefined>;
|
|
506
|
+
/**
|
|
507
|
+
* The maximum age for memorizing the route.
|
|
508
|
+
* Default is 0.
|
|
509
|
+
*/
|
|
510
|
+
readonly memorizeMaxAge: import("@angular/core").InputSignal<number>;
|
|
511
|
+
/**
|
|
512
|
+
* The maximum age for memorizing the route, used as a fallback.
|
|
513
|
+
* Default is 0.
|
|
514
|
+
*/
|
|
515
|
+
readonly memorizeRouteMaxAge: import("@angular/core").InputSignal<number>;
|
|
516
|
+
/**
|
|
517
|
+
* The connection ID for the iframe where the actual directive is applied.
|
|
518
|
+
*/
|
|
519
|
+
readonly connect: import("@angular/core").InputSignal<string | undefined>;
|
|
520
|
+
private readonly maxAge;
|
|
521
|
+
constructor();
|
|
522
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RouteMemorizeDirective, never>;
|
|
523
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RouteMemorizeDirective, "iframe[memorizeRoute]", never, {
|
|
524
|
+
"memorizeRoute": {
|
|
525
|
+
"alias": "memorizeRoute";
|
|
526
|
+
"required": false;
|
|
527
|
+
"isSignal": true;
|
|
528
|
+
};
|
|
529
|
+
"memorizeRouteId": {
|
|
530
|
+
"alias": "memorizeRouteId";
|
|
531
|
+
"required": false;
|
|
532
|
+
"isSignal": true;
|
|
533
|
+
};
|
|
534
|
+
"memorizeMaxAge": {
|
|
535
|
+
"alias": "memorizeMaxAge";
|
|
536
|
+
"required": false;
|
|
537
|
+
"isSignal": true;
|
|
538
|
+
};
|
|
539
|
+
"memorizeRouteMaxAge": {
|
|
540
|
+
"alias": "memorizeRouteMaxAge";
|
|
541
|
+
"required": false;
|
|
542
|
+
"isSignal": true;
|
|
543
|
+
};
|
|
544
|
+
"connect": {
|
|
545
|
+
"alias": "connect";
|
|
546
|
+
"required": false;
|
|
547
|
+
"isSignal": true;
|
|
548
|
+
};
|
|
549
|
+
}, {}, never, never, true, never>;
|
|
506
550
|
}
|
|
507
|
-
|
|
508
551
|
/**
|
|
509
552
|
* This service allows routes to be memorized with an optional lifetime and provides methods to retrieve and manage these routes.
|
|
510
553
|
*/
|
|
511
|
-
declare class RouteMemorizeService {
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
554
|
+
export declare class RouteMemorizeService {
|
|
555
|
+
private readonly routeTimers;
|
|
556
|
+
/** All memorized routes */
|
|
557
|
+
readonly routeStack: {
|
|
558
|
+
[x: string]: string;
|
|
559
|
+
};
|
|
560
|
+
/**
|
|
561
|
+
* Memorizes a route for a given channel ID with an optional lifetime.
|
|
562
|
+
* @param channelId - The ID of the channel to memorize the route for.
|
|
563
|
+
* @param url - The URL of the route to memorize.
|
|
564
|
+
* @param liveTime - The optional lifetime of the memorized route in milliseconds. If provided, the route will be removed after this time.
|
|
565
|
+
*/
|
|
566
|
+
memorizeRoute(channelId: string, url: string, liveTime?: number): void;
|
|
567
|
+
/**
|
|
568
|
+
* Retrieves the memorized route for a given channel ID.
|
|
569
|
+
* @param channelId - The ID of the channel to retrieve the memorized route for.
|
|
570
|
+
* @returns The memorized route URL or undefined if no route is memorized for the given channel ID.
|
|
571
|
+
*/
|
|
572
|
+
getRoute(channelId: string): string | undefined;
|
|
573
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RouteMemorizeService, never>;
|
|
574
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
532
575
|
}
|
|
533
|
-
|
|
534
576
|
/** Options for the routing handling in case of navigation producer message */
|
|
535
|
-
interface RoutingServiceOptions {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
577
|
+
export interface RoutingServiceOptions {
|
|
578
|
+
/**
|
|
579
|
+
* Whether to handle only sub-routes.
|
|
580
|
+
* If true, the routing service will handle only sub-routes.
|
|
581
|
+
* Default is false.
|
|
582
|
+
*/
|
|
583
|
+
subRouteOnly?: boolean;
|
|
542
584
|
}
|
|
543
585
|
/**
|
|
544
586
|
* A service that keeps in sync Router navigation and navigation messages.
|
|
@@ -546,60 +588,59 @@ interface RoutingServiceOptions {
|
|
|
546
588
|
* - listens to Router events and sends navigation messages
|
|
547
589
|
* - handles incoming navigation messages and triggers Router navigation
|
|
548
590
|
*/
|
|
549
|
-
declare class RoutingService implements MessageProducer<NavigationMessage>, MessageConsumer<NavigationMessage> {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
591
|
+
export declare class RoutingService implements MessageProducer<NavigationMessage>, MessageConsumer<NavigationMessage> {
|
|
592
|
+
private readonly router;
|
|
593
|
+
private readonly activatedRoute;
|
|
594
|
+
private readonly messageService;
|
|
595
|
+
private readonly logger;
|
|
596
|
+
private readonly window;
|
|
597
|
+
/**
|
|
598
|
+
* @inheritdoc
|
|
599
|
+
*/
|
|
600
|
+
readonly types = "navigation";
|
|
601
|
+
/**
|
|
602
|
+
* @inheritdoc
|
|
603
|
+
*/
|
|
604
|
+
readonly type = "navigation";
|
|
605
|
+
/**
|
|
606
|
+
* Use the message payload to navigate to the specified URL.
|
|
607
|
+
* @param message message to consume
|
|
608
|
+
*/
|
|
609
|
+
readonly supportedVersions: {
|
|
610
|
+
'1.0': (message: RoutedMessage<any>) => Promise<void>;
|
|
611
|
+
'1.1': (message: RoutedMessage<any>) => Promise<void>;
|
|
612
|
+
};
|
|
613
|
+
constructor();
|
|
614
|
+
/**
|
|
615
|
+
* @inheritdoc
|
|
616
|
+
*/
|
|
617
|
+
start(): void;
|
|
618
|
+
/**
|
|
619
|
+
* @inheritdoc
|
|
620
|
+
*/
|
|
621
|
+
stop(): void;
|
|
622
|
+
/**
|
|
623
|
+
* @inheritdoc
|
|
624
|
+
*/
|
|
625
|
+
handleError(message: ErrorContent<NavigationV1_0>): void;
|
|
626
|
+
/**
|
|
627
|
+
* Handles embedded routing by listening to router events and sending navigation messages to the connected endpoints.
|
|
628
|
+
* It can be a parent window or another iframe
|
|
629
|
+
* @note - This method has to be called in an injection context
|
|
630
|
+
* @param options - Optional parameters to control the routing behavior {@link RoutingServiceOptions}.
|
|
631
|
+
*/
|
|
632
|
+
handleEmbeddedRouting(options?: RoutingServiceOptions): void;
|
|
633
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RoutingService, never>;
|
|
634
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
593
635
|
}
|
|
594
|
-
|
|
595
636
|
/**
|
|
596
637
|
* Current navigation block state held by a module.
|
|
597
638
|
*/
|
|
598
|
-
interface NavigationBlockState {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
639
|
+
export interface NavigationBlockState {
|
|
640
|
+
/** `true` when the module holds unsaved work and navigation must be confirmed. */
|
|
641
|
+
blocked: boolean;
|
|
642
|
+
/** Optional reason displayed in the confirmation modal. */
|
|
643
|
+
reason?: string;
|
|
603
644
|
}
|
|
604
645
|
/**
|
|
605
646
|
* Module-side writable source of truth for the navigation block state.
|
|
@@ -608,52 +649,50 @@ interface NavigationBlockState {
|
|
|
608
649
|
* The {@link NavigationBlockStateProducerService} watches this signal and mirrors the state to the shell;
|
|
609
650
|
* the {@link navigationBlockModuleGuard} reads it to decide whether to intercept in-module navigation.
|
|
610
651
|
*/
|
|
611
|
-
declare class NavigationBlockService {
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
652
|
+
export declare class NavigationBlockService {
|
|
653
|
+
private readonly stateSignal;
|
|
654
|
+
/** Readonly view of the current navigation block state. */
|
|
655
|
+
readonly state: Signal<NavigationBlockState>;
|
|
656
|
+
/**
|
|
657
|
+
* Mark the module as blocked (unsaved changes present).
|
|
658
|
+
* @param reason Optional human-readable reason shown in the confirmation modal.
|
|
659
|
+
*/
|
|
660
|
+
block(reason?: string): void;
|
|
661
|
+
/** Mark the module as unblocked (no unsaved changes). */
|
|
662
|
+
unblock(): void;
|
|
663
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavigationBlockService, never>;
|
|
664
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
624
665
|
}
|
|
625
|
-
|
|
626
666
|
/**
|
|
627
667
|
* Module-side producer that mirrors {@link NavigationBlockService} to the shell via `navigation-block-state` messages.
|
|
628
668
|
* Every state change triggers a broadcast so the shell guard can decide without a round-trip.
|
|
629
669
|
*
|
|
630
670
|
* Runs module-side only (it watches the module's writable state). The shell never instantiates it.
|
|
631
671
|
*/
|
|
632
|
-
declare class NavigationBlockStateProducerService implements MessageProducer<NavigationBlockStateV1_0> {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
672
|
+
export declare class NavigationBlockStateProducerService implements MessageProducer<NavigationBlockStateV1_0> {
|
|
673
|
+
/**
|
|
674
|
+
* @inheritdoc
|
|
675
|
+
*/
|
|
676
|
+
readonly types = "navigation-block-state";
|
|
677
|
+
private readonly connectionService;
|
|
678
|
+
private readonly producerManagerService;
|
|
679
|
+
private readonly logger;
|
|
680
|
+
private readonly store;
|
|
681
|
+
constructor();
|
|
682
|
+
/**
|
|
683
|
+
* @inheritdoc
|
|
684
|
+
*/
|
|
685
|
+
handleError(message: ErrorContent<NavigationBlockStateV1_0>): void;
|
|
686
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavigationBlockStateProducerService, never>;
|
|
687
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
648
688
|
}
|
|
649
|
-
|
|
650
689
|
/**
|
|
651
690
|
* Navigation block state as observed by the shell, extended with the originating channel ID
|
|
652
691
|
* so the shell knows which module to notify when navigation is confirmed.
|
|
653
692
|
*/
|
|
654
|
-
interface ObservedNavigationBlockState extends NavigationBlockState {
|
|
655
|
-
|
|
656
|
-
|
|
693
|
+
export interface ObservedNavigationBlockState extends NavigationBlockState {
|
|
694
|
+
/** Id of the module (channel) that sent the last state message. */
|
|
695
|
+
channelId?: string;
|
|
657
696
|
}
|
|
658
697
|
/**
|
|
659
698
|
* Shell-side consumer for `navigation-block-state` messages sent by modules.
|
|
@@ -661,28 +700,27 @@ interface ObservedNavigationBlockState extends NavigationBlockState {
|
|
|
661
700
|
* Keeps the last received state in a signal that the shell guard reads to decide whether to intercept shell-initiated navigation.
|
|
662
701
|
* The state stays `undefined` until any module reports a value (interpreted as "no block known" which means navigation is allowed).
|
|
663
702
|
*/
|
|
664
|
-
declare class NavigationBlockStateConsumerService extends AbstractMessageConsumer<NavigationBlockStateMessage> {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
703
|
+
export declare class NavigationBlockStateConsumerService extends AbstractMessageConsumer<NavigationBlockStateMessage> {
|
|
704
|
+
/**
|
|
705
|
+
* @inheritdoc
|
|
706
|
+
*/
|
|
707
|
+
readonly type = "navigation-block-state";
|
|
708
|
+
/**
|
|
709
|
+
* @inheritdoc
|
|
710
|
+
*/
|
|
711
|
+
readonly supportedVersions: {
|
|
712
|
+
'1.0': (message: RoutedMessage<NavigationBlockStateV1_0>) => void;
|
|
713
|
+
};
|
|
714
|
+
private readonly blockStateSignal;
|
|
715
|
+
/** Last navigation block state reported by any module. */
|
|
716
|
+
readonly blockState: Signal<ObservedNavigationBlockState | undefined>;
|
|
717
|
+
/**
|
|
718
|
+
* Mark the state as unblocked after the shell has resolved a confirmation (e.g. the user confirmed a sidebar-initiated navigation).
|
|
719
|
+
*/
|
|
720
|
+
clear(): void;
|
|
721
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavigationBlockStateConsumerService, never>;
|
|
722
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
684
723
|
}
|
|
685
|
-
|
|
686
724
|
type ProducedMessage = NavigationRequestV1_0 | NavigationDecisionV1_0;
|
|
687
725
|
/**
|
|
688
726
|
* Manages navigation request/decision round-trip communication for **both** shell and module.
|
|
@@ -697,59 +735,58 @@ type ProducedMessage = NavigationRequestV1_0 | NavigationDecisionV1_0;
|
|
|
697
735
|
* If the peer never replies the returned promise stays pending and the navigation is held — callers rely on Angular
|
|
698
736
|
* tearing their context down (the producer's `ngOnDestroy` resolves pending promises to `false`).
|
|
699
737
|
*/
|
|
700
|
-
declare class NavigationRequestManagerService implements MessageProducer<ProducedMessage>, OnDestroy {
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
738
|
+
export declare class NavigationRequestManagerService implements MessageProducer<ProducedMessage>, OnDestroy {
|
|
739
|
+
/**
|
|
740
|
+
* @inheritdoc
|
|
741
|
+
*/
|
|
742
|
+
readonly types: [typeof NAVIGATION_REQUEST_MESSAGE_TYPE, typeof NAVIGATION_DECISION_MESSAGE_TYPE];
|
|
743
|
+
private readonly connectionService;
|
|
744
|
+
private readonly producerManagerService;
|
|
745
|
+
private readonly logger;
|
|
746
|
+
/**
|
|
747
|
+
* Single-flight slot for the in-progress negotiation. Only one request is ever pending: navigations are sequential
|
|
748
|
+
* (one active module, and a blocking shell modal prevents the user from starting another while it is open), so this
|
|
749
|
+
* is not about concurrent navigations. Its purpose is to de-duplicate the *re-entrant* guard calls a single navigation
|
|
750
|
+
* produces — `canActivate` + `canActivateChild` on the same route, or re-runs from `runGuardsAndResolvers: 'always'`.
|
|
751
|
+
* Those fire before any decision returns, and on the module side there is no local modal to serialize them, so without
|
|
752
|
+
* this slot one navigation would emit multiple `navigation-request` messages. Reusing the slot makes every re-entrant
|
|
753
|
+
* call await the same round-trip.
|
|
754
|
+
*/
|
|
755
|
+
private pendingRequest?;
|
|
756
|
+
constructor();
|
|
757
|
+
/**
|
|
758
|
+
* Ask the peer to handle the navigation. Resolves when the peer replies with a `navigation-decision`.
|
|
759
|
+
* If the peer never replies the promise stays pending.
|
|
760
|
+
*
|
|
761
|
+
* Re-entrant calls while a request is pending (e.g. the same navigation firing both `canActivate` and `canActivateChild`)
|
|
762
|
+
* return the same promise, so only one round-trip is sent.
|
|
763
|
+
* @param target Optional target peer id. Omit to broadcast (module → shell).
|
|
764
|
+
* @param reason Optional human-readable reason surfaced in the shell modal.
|
|
765
|
+
*/
|
|
766
|
+
requestNavigation(target?: string, reason?: string): Promise<boolean>;
|
|
767
|
+
/**
|
|
768
|
+
* Send a `navigation-decision` reply with the given `correlationId`.
|
|
769
|
+
* Called by {@link NavigationNegotiationConsumerService} after the side-specific handler has finished.
|
|
770
|
+
* @param correlationId id echoed from the request
|
|
771
|
+
* @param target peer id of the original sender
|
|
772
|
+
* @param proceed whether to allow navigation (default true)
|
|
773
|
+
*/
|
|
774
|
+
sendDecision(correlationId: string, target: string, proceed?: boolean): void;
|
|
775
|
+
/**
|
|
776
|
+
* Called by {@link NavigationDecisionConsumerService} when a decision arrives.
|
|
777
|
+
* Resolves the pending promise if the `correlationId` matches.
|
|
778
|
+
* @param correlationId
|
|
779
|
+
* @param proceed
|
|
780
|
+
*/
|
|
781
|
+
resolvePendingRequest(correlationId: string, proceed: boolean): void;
|
|
782
|
+
/**
|
|
783
|
+
* @inheritdoc
|
|
784
|
+
*/
|
|
785
|
+
handleError(message: ErrorContent<ProducedMessage>): void;
|
|
786
|
+
ngOnDestroy(): void;
|
|
787
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavigationRequestManagerService, never>;
|
|
788
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
751
789
|
}
|
|
752
|
-
|
|
753
790
|
/**
|
|
754
791
|
* Agnostic consumer for `navigation-request` messages.
|
|
755
792
|
*
|
|
@@ -760,30 +797,29 @@ declare class NavigationRequestManagerService implements MessageProducer<Produce
|
|
|
760
797
|
* - **Module side** — handler runs the unblock / future draft-persistence logic and resolves. Modules cannot refuse;
|
|
761
798
|
* a decision is always sent.
|
|
762
799
|
*/
|
|
763
|
-
declare class NavigationRequestConsumerService extends AbstractMessageConsumer<NavigationRequestMessage> {
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
800
|
+
export declare class NavigationRequestConsumerService extends AbstractMessageConsumer<NavigationRequestMessage> {
|
|
801
|
+
/**
|
|
802
|
+
* @inheritdoc
|
|
803
|
+
*/
|
|
804
|
+
readonly type = "navigation-request";
|
|
805
|
+
/**
|
|
806
|
+
* @inheritdoc
|
|
807
|
+
*/
|
|
808
|
+
readonly supportedVersions: {
|
|
809
|
+
'1.0': (message: RoutedMessage<NavigationRequestV1_0>) => Promise<void>;
|
|
810
|
+
};
|
|
811
|
+
private readonly producerService;
|
|
812
|
+
private readonly handler;
|
|
813
|
+
private handleRequest;
|
|
814
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavigationRequestConsumerService, never>;
|
|
815
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
779
816
|
}
|
|
780
|
-
|
|
781
817
|
/** Context passed to a {@link NavigationRequestHandler} for each incoming request. */
|
|
782
|
-
interface NavigationRequestContext {
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
818
|
+
export interface NavigationRequestContext {
|
|
819
|
+
/** Peer id that sent the request. */
|
|
820
|
+
from: string;
|
|
821
|
+
/** Optional human-readable reason attached to the request. */
|
|
822
|
+
reason?: string;
|
|
787
823
|
}
|
|
788
824
|
/**
|
|
789
825
|
* Side-specific handler invoked by {@link NavigationRequestConsumerService} whenever a `navigation-request` arrives from a peer.
|
|
@@ -797,8 +833,8 @@ interface NavigationRequestContext {
|
|
|
797
833
|
* Exposed as an interface so apps can supply either a function-style implementation (`{ handle: (ctx) => ... }`)
|
|
798
834
|
* or a class instance — useful when the handler needs its own dependencies.
|
|
799
835
|
*/
|
|
800
|
-
interface NavigationRequestHandler {
|
|
801
|
-
|
|
836
|
+
export interface NavigationRequestHandler {
|
|
837
|
+
handle: (context: NavigationRequestContext) => Promise<void> | void;
|
|
802
838
|
}
|
|
803
839
|
/**
|
|
804
840
|
* Default module-side `navigation-request` handler. Runs the module's local cleanup — at minimum clearing the block state — and resolves.
|
|
@@ -807,7 +843,7 @@ interface NavigationRequestHandler {
|
|
|
807
843
|
* Used as the default factory of {@link NAVIGATION_REQUEST_HANDLER}, so a module gets this behavior without any explicit provider.
|
|
808
844
|
* Apps that need to persist drafts before unblocking can override the token with their own handler.
|
|
809
845
|
*/
|
|
810
|
-
declare const createNavigationRequestHandler: () => NavigationRequestHandler;
|
|
846
|
+
export declare const createNavigationRequestHandler: () => NavigationRequestHandler;
|
|
811
847
|
/**
|
|
812
848
|
* Injection token for the per-side request handler.
|
|
813
849
|
*
|
|
@@ -817,51 +853,47 @@ declare const createNavigationRequestHandler: () => NavigationRequestHandler;
|
|
|
817
853
|
* The module handler is provided by default at root level. Only the shell application needs to override it
|
|
818
854
|
* with `provideNavigationRequestShellHandler()`.
|
|
819
855
|
*/
|
|
820
|
-
declare const NAVIGATION_REQUEST_HANDLER: InjectionToken<NavigationRequestHandler>;
|
|
821
|
-
|
|
856
|
+
export declare const NAVIGATION_REQUEST_HANDLER: InjectionToken<NavigationRequestHandler>;
|
|
822
857
|
/**
|
|
823
858
|
* Provider wiring {@link NAVIGATION_REQUEST_HANDLER} to the module handler.
|
|
824
859
|
* Not normally needed — the token already defaults to this handler — but
|
|
825
860
|
* available for apps that want to register it explicitly.
|
|
826
861
|
*/
|
|
827
|
-
declare const provideNavigationRequestModuleHandler: () => EnvironmentProviders;
|
|
828
|
-
|
|
862
|
+
export declare const provideNavigationRequestModuleHandler: () => EnvironmentProviders;
|
|
829
863
|
/**
|
|
830
864
|
* Shell application `navigation-request` handler used when a module initiates the navigation (in-iframe link click).
|
|
831
865
|
* Opens the shared confirmation modal, awaits the user's answer, and — on confirm — clears the shell's block mirror.
|
|
832
866
|
* On cancel the handler throws; the consumer catches it and replies with a `navigation-decision` carrying `proceed: false`,
|
|
833
867
|
* so the module's pending promise resolves to `false` and the iframe navigation is held until a fresh request is made.
|
|
834
868
|
*/
|
|
835
|
-
declare const createNavigationRequestShellHandler: () => NavigationRequestHandler;
|
|
869
|
+
export declare const createNavigationRequestShellHandler: () => NavigationRequestHandler;
|
|
836
870
|
/**
|
|
837
871
|
* Provider wiring {@link NAVIGATION_REQUEST_HANDLER} to the shell application
|
|
838
872
|
* handler. Register once in the shell app providers to override the default
|
|
839
873
|
* module handler.
|
|
840
874
|
*/
|
|
841
|
-
declare const provideNavigationRequestShellHandler: () => EnvironmentProviders;
|
|
842
|
-
|
|
875
|
+
export declare const provideNavigationRequestShellHandler: () => EnvironmentProviders;
|
|
843
876
|
/**
|
|
844
877
|
* Agnostic consumer for `navigation-decision` messages — the reply to a
|
|
845
878
|
* previously sent `navigation-request`. Forwards the decision to
|
|
846
879
|
* {@link NavigationRequestManagerService.resolvePendingRequest} so
|
|
847
880
|
* the awaiting caller's promise resolves.
|
|
848
881
|
*/
|
|
849
|
-
declare class NavigationDecisionConsumerService extends AbstractMessageConsumer<NavigationDecisionMessage> {
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
882
|
+
export declare class NavigationDecisionConsumerService extends AbstractMessageConsumer<NavigationDecisionMessage> {
|
|
883
|
+
/**
|
|
884
|
+
* @inheritdoc
|
|
885
|
+
*/
|
|
886
|
+
readonly type = "navigation-decision";
|
|
887
|
+
/**
|
|
888
|
+
* @inheritdoc
|
|
889
|
+
*/
|
|
890
|
+
readonly supportedVersions: {
|
|
891
|
+
'1.0': (message: RoutedMessage<NavigationDecisionV1_0>) => void;
|
|
892
|
+
};
|
|
893
|
+
private readonly producerService;
|
|
894
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavigationDecisionConsumerService, never>;
|
|
895
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
863
896
|
}
|
|
864
|
-
|
|
865
897
|
/**
|
|
866
898
|
* Shell application guard intercepting shell-initiated navigation (sidebar clicks, URL bar, programmatic `router.navigate`)
|
|
867
899
|
* when the last state received from a module is `blocked`.
|
|
@@ -876,8 +908,7 @@ declare class NavigationDecisionConsumerService extends AbstractMessageConsumer<
|
|
|
876
908
|
* - On confirm → clear the shell mirror, send a `navigation-request` to the originating module (so it can run its unblock /
|
|
877
909
|
* future draft-persistence logic), await its `navigation-decision`, then return `true`.
|
|
878
910
|
*/
|
|
879
|
-
declare const navigationBlockShellGuard: CanActivateFn & CanActivateChildFn;
|
|
880
|
-
|
|
911
|
+
export declare const navigationBlockShellGuard: CanActivateFn & CanActivateChildFn;
|
|
881
912
|
/**
|
|
882
913
|
* Module-side guard intercepting navigation away from a page that holds unsaved changes.
|
|
883
914
|
*
|
|
@@ -889,19 +920,18 @@ declare const navigationBlockShellGuard: CanActivateFn & CanActivateChildFn;
|
|
|
889
920
|
*
|
|
890
921
|
* Wire it as `canDeactivate` only on the routes that can actually hold unsaved work — modules opt in per page.
|
|
891
922
|
*/
|
|
892
|
-
declare const navigationBlockModuleGuard: CanDeactivateFn<boolean>;
|
|
893
|
-
|
|
923
|
+
export declare const navigationBlockModuleGuard: CanDeactivateFn<boolean>;
|
|
894
924
|
/**
|
|
895
925
|
* Strategy interface for confirming navigation when unsaved changes exist.
|
|
896
926
|
* Implementations provide different UI mechanisms (browser confirm, modal, etc.)
|
|
897
927
|
*/
|
|
898
|
-
interface NavigationBlockConfirmation {
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
928
|
+
export interface NavigationBlockConfirmation {
|
|
929
|
+
/**
|
|
930
|
+
* Show confirmation UI and await user's decision.
|
|
931
|
+
* @param reason Optional human-readable reason for the block (e.g., "Unsaved order changes")
|
|
932
|
+
* @returns Promise<true> if user confirms navigation, Promise<false> if cancelled
|
|
933
|
+
*/
|
|
934
|
+
confirm(reason?: string): Promise<boolean>;
|
|
905
935
|
}
|
|
906
936
|
/**
|
|
907
937
|
* Injection token for the navigation block confirmation strategy.
|
|
@@ -909,8 +939,7 @@ interface NavigationBlockConfirmation {
|
|
|
909
939
|
* Apps with a styled modal override the default by passing their own class via `provideNavigationConfig({ confirmationStrategy })`
|
|
910
940
|
* or by binding this token directly.
|
|
911
941
|
*/
|
|
912
|
-
declare const NAVIGATION_BLOCK_CONFIRMATION: InjectionToken<NavigationBlockConfirmation>;
|
|
913
|
-
|
|
942
|
+
export declare const NAVIGATION_BLOCK_CONFIRMATION: InjectionToken<NavigationBlockConfirmation>;
|
|
914
943
|
/**
|
|
915
944
|
* Orchestrates navigation block confirmation by delegating to a pluggable strategy.
|
|
916
945
|
* Handles concurrent call deduplication to prevent duplicate confirmations when guards run multiple times.
|
|
@@ -919,19 +948,18 @@ declare const NAVIGATION_BLOCK_CONFIRMATION: InjectionToken<NavigationBlockConfi
|
|
|
919
948
|
* (no setup required). Apps with a styled modal override the token via `provideNavigationConfig({ confirmationStrategy })`
|
|
920
949
|
* or by binding the token directly.
|
|
921
950
|
*/
|
|
922
|
-
declare class NavigationBlockConfirmationService {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
951
|
+
export declare class NavigationBlockConfirmationService {
|
|
952
|
+
private readonly strategy;
|
|
953
|
+
private pendingConfirmation?;
|
|
954
|
+
/**
|
|
955
|
+
* Show confirmation and await user decision. Concurrent calls return the same promise to prevent duplicate confirmations.
|
|
956
|
+
* @param reason Optional reason displayed in the confirmation UI
|
|
957
|
+
* @returns `true` when the user confirms, `false` when they cancel
|
|
958
|
+
*/
|
|
959
|
+
confirm(reason?: string): Promise<boolean>;
|
|
960
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavigationBlockConfirmationService, never>;
|
|
961
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
933
962
|
}
|
|
934
|
-
|
|
935
963
|
/**
|
|
936
964
|
* Default confirmation strategy using browser's native `window.confirm()`.
|
|
937
965
|
* Simple, no dependencies, works in any environment. Suitable for:
|
|
@@ -941,17 +969,16 @@ declare class NavigationBlockConfirmationService {
|
|
|
941
969
|
*
|
|
942
970
|
* Production apps typically override this with a modal-based strategy.
|
|
943
971
|
*/
|
|
944
|
-
declare class BrowserConfirmationStrategy implements NavigationBlockConfirmation {
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
972
|
+
export declare class BrowserConfirmationStrategy implements NavigationBlockConfirmation {
|
|
973
|
+
/**
|
|
974
|
+
* Show native browser confirmation dialog.
|
|
975
|
+
* @param reason Optional reason displayed in the message
|
|
976
|
+
* @returns Promise<true> if user clicks OK, Promise<false> if user clicks Cancel
|
|
977
|
+
*/
|
|
978
|
+
confirm(reason?: string): Promise<boolean>;
|
|
979
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BrowserConfirmationStrategy, never>;
|
|
980
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
953
981
|
}
|
|
954
|
-
|
|
955
982
|
/**
|
|
956
983
|
* Convenience helper that explicitly binds the {@link NAVIGATION_BLOCK_CONFIRMATION} token to {@link BrowserConfirmationStrategy}.
|
|
957
984
|
*
|
|
@@ -972,64 +999,61 @@ declare class BrowserConfirmationStrategy implements NavigationBlockConfirmation
|
|
|
972
999
|
* };
|
|
973
1000
|
* ```
|
|
974
1001
|
*/
|
|
975
|
-
declare function provideDefaultNavigationBlockConfirmation(): EnvironmentProviders;
|
|
976
|
-
|
|
1002
|
+
export declare function provideDefaultNavigationBlockConfirmation(): EnvironmentProviders;
|
|
977
1003
|
/**
|
|
978
1004
|
* This service listens for resize messages and updates the height of elements based on the received messages.
|
|
979
1005
|
*/
|
|
980
|
-
declare class ResizeConsumerService extends AbstractMessageConsumer<ResizeMessage> {
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1006
|
+
export declare class ResizeConsumerService extends AbstractMessageConsumer<ResizeMessage> {
|
|
1007
|
+
private readonly newHeight;
|
|
1008
|
+
/**
|
|
1009
|
+
* A readonly signal that provides the new height information from the channel.
|
|
1010
|
+
*/
|
|
1011
|
+
readonly newHeightFromChannel: import("@angular/core").Signal<{
|
|
1012
|
+
height: number;
|
|
1013
|
+
channelId: string;
|
|
1014
|
+
} | undefined>;
|
|
1015
|
+
/**
|
|
1016
|
+
* The type of messages this service handles ('resize').
|
|
1017
|
+
*/
|
|
1018
|
+
readonly type = "resize";
|
|
1019
|
+
/**
|
|
1020
|
+
* The supported versions of resize messages and their handlers.
|
|
1021
|
+
*/
|
|
1022
|
+
supportedVersions: {
|
|
1023
|
+
/**
|
|
1024
|
+
* Use the message paylod to compute a new height and emit it via the public signal
|
|
1025
|
+
* @param message message to consume
|
|
995
1026
|
*/
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
*/
|
|
1001
|
-
'1.0': (message: RoutedMessage<ResizeV1_0>) => void;
|
|
1002
|
-
};
|
|
1003
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ResizeConsumerService, never>;
|
|
1004
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1027
|
+
'1.0': (message: RoutedMessage<ResizeV1_0>) => void;
|
|
1028
|
+
};
|
|
1029
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ResizeConsumerService, never>;
|
|
1030
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1005
1031
|
}
|
|
1006
|
-
|
|
1007
1032
|
/**
|
|
1008
1033
|
* This service observe changes in the document's body height.
|
|
1009
1034
|
* When the height changes, it sends a resize message with the new height, to the connected peers
|
|
1010
1035
|
*/
|
|
1011
|
-
declare class ResizeService implements MessageProducer<ResizeMessage> {
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1036
|
+
export declare class ResizeService implements MessageProducer<ResizeMessage> {
|
|
1037
|
+
private actualHeight?;
|
|
1038
|
+
private readonly messageService;
|
|
1039
|
+
private resizeObserver?;
|
|
1040
|
+
/**
|
|
1041
|
+
* @inheritdoc
|
|
1042
|
+
*/
|
|
1043
|
+
readonly types = "resize";
|
|
1044
|
+
constructor();
|
|
1045
|
+
/**
|
|
1046
|
+
* @inheritdoc
|
|
1047
|
+
*/
|
|
1048
|
+
handleError(message: ErrorContent<ResizeMessage>): void;
|
|
1049
|
+
/**
|
|
1050
|
+
* This method sets up a `ResizeObserver` to observe changes in the document's body height.
|
|
1051
|
+
* When the height changes, it sends a resize message with the new height, to the connected peers
|
|
1052
|
+
*/
|
|
1053
|
+
startResizeObserver(): void;
|
|
1054
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ResizeService, never>;
|
|
1055
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1031
1056
|
}
|
|
1032
|
-
|
|
1033
1057
|
/**
|
|
1034
1058
|
* A directive that adjusts the min-height of an element based on resize messages from a specified channel.
|
|
1035
1059
|
*
|
|
@@ -1048,123 +1072,131 @@ declare class ResizeService implements MessageProducer<ResizeMessage> {
|
|
|
1048
1072
|
* - The window is resized
|
|
1049
1073
|
* - The parent container's size changes (detected via `ResizeObserver`)
|
|
1050
1074
|
*/
|
|
1051
|
-
declare class ScalableDirective {
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1075
|
+
export declare class ScalableDirective {
|
|
1076
|
+
/**
|
|
1077
|
+
* The connection ID for the element, used as channel id backup
|
|
1078
|
+
*/
|
|
1079
|
+
readonly connect: import("@angular/core").InputSignal<string | undefined>;
|
|
1080
|
+
/**
|
|
1081
|
+
* The channel id
|
|
1082
|
+
*/
|
|
1083
|
+
readonly scalable: import("@angular/core").InputSignal<string | undefined>;
|
|
1084
|
+
private readonly resizeHandler;
|
|
1085
|
+
private readonly destroyRef;
|
|
1086
|
+
private readonly elem;
|
|
1087
|
+
private readonly renderer;
|
|
1088
|
+
/** Signal holding the current available container height */
|
|
1089
|
+
private readonly availableHeight;
|
|
1090
|
+
/** Tracks the last applied min-height to avoid redundant style updates */
|
|
1091
|
+
private lastAppliedMinHeight;
|
|
1092
|
+
/** ResizeObserver for watching parent container size changes */
|
|
1093
|
+
private resizeObserver?;
|
|
1094
|
+
/** Cached container element */
|
|
1095
|
+
private container;
|
|
1096
|
+
/**
|
|
1097
|
+
* This signal checks if the current channel requesting the resize matches the channel ID from the resize handler.
|
|
1098
|
+
* If they match, it returns the new height information; otherwise, it returns undefined.
|
|
1099
|
+
*/
|
|
1100
|
+
private readonly newHeightFromChannel;
|
|
1101
|
+
constructor();
|
|
1102
|
+
/**
|
|
1103
|
+
* Get the viewport height without the rounding applied by `window.innerHeight`.
|
|
1104
|
+
*
|
|
1105
|
+
* `window.innerHeight` is an integer, rounded from the actual viewport height (e.g. `677.6px` is reported as `678`),
|
|
1106
|
+
* which would lead to a min-height slightly bigger than the available space and therefore to an unwanted scrollbar.
|
|
1107
|
+
* `visualViewport.height` exposes the sub-pixel value; it is scaled back by `visualViewport.scale` to stay on the
|
|
1108
|
+
* layout viewport scale when the page is pinch-zoomed.
|
|
1109
|
+
*/
|
|
1110
|
+
private getViewportHeight;
|
|
1111
|
+
/**
|
|
1112
|
+
* Calculate the available height from the scrollable container.
|
|
1113
|
+
*/
|
|
1114
|
+
private calculateAvailableHeight;
|
|
1115
|
+
/**
|
|
1116
|
+
* Find the nearest scrollable parent element.
|
|
1117
|
+
* @param element
|
|
1118
|
+
*/
|
|
1119
|
+
private findScrollableParent;
|
|
1120
|
+
/**
|
|
1121
|
+
* Start observing size changes.
|
|
1122
|
+
*/
|
|
1123
|
+
private startHeightObserver;
|
|
1124
|
+
/**
|
|
1125
|
+
* Subscribe to window resize events and update the available height.
|
|
1126
|
+
*/
|
|
1127
|
+
private observeWindowResize;
|
|
1128
|
+
/**
|
|
1129
|
+
* Update the available height signal with the current container height.
|
|
1130
|
+
*/
|
|
1131
|
+
private updateAvailableHeight;
|
|
1132
|
+
/**
|
|
1133
|
+
* Apply min-height style only if defined and changed.
|
|
1134
|
+
* @param height
|
|
1135
|
+
*/
|
|
1136
|
+
private applyMinHeight;
|
|
1137
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ScalableDirective, never>;
|
|
1138
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ScalableDirective, "[scalable]", never, {
|
|
1139
|
+
"connect": {
|
|
1140
|
+
"alias": "connect";
|
|
1141
|
+
"required": false;
|
|
1142
|
+
"isSignal": true;
|
|
1143
|
+
};
|
|
1144
|
+
"scalable": {
|
|
1145
|
+
"alias": "scalable";
|
|
1146
|
+
"required": false;
|
|
1147
|
+
"isSignal": true;
|
|
1148
|
+
};
|
|
1149
|
+
}, {}, never, never, true, never>;
|
|
1115
1150
|
}
|
|
1116
|
-
|
|
1117
1151
|
/**
|
|
1118
1152
|
* A pipe that applies the current theme from a theme manager service, to a given URL or SafeResourceUrl, as query param
|
|
1119
1153
|
*/
|
|
1120
|
-
declare class ApplyTheme implements PipeTransform {
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1154
|
+
export declare class ApplyTheme implements PipeTransform {
|
|
1155
|
+
private readonly themeManagerService;
|
|
1156
|
+
private readonly domSanitizer;
|
|
1157
|
+
/**
|
|
1158
|
+
* Transforms the given URL or SafeResourceUrl by appending the current theme value as a query parameter.
|
|
1159
|
+
* @param url - The URL or SafeResourceUrl to be transformed.
|
|
1160
|
+
* @returns The transformed SafeResourceUrl or undefined if the input URL is invalid.
|
|
1161
|
+
*/
|
|
1162
|
+
transform(url: string): string;
|
|
1163
|
+
transform(url: SafeResourceUrl): SafeResourceUrl;
|
|
1164
|
+
transform(url: undefined): undefined;
|
|
1165
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApplyTheme, never>;
|
|
1166
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<ApplyTheme, "applyTheme", true>;
|
|
1133
1167
|
}
|
|
1134
|
-
|
|
1135
1168
|
/**
|
|
1136
1169
|
* A service that handles theme messages and applies the received theme.
|
|
1137
1170
|
*/
|
|
1138
|
-
declare class ThemeConsumerService extends AbstractMessageConsumer<ThemeMessage> {
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1171
|
+
export declare class ThemeConsumerService extends AbstractMessageConsumer<ThemeMessage> {
|
|
1172
|
+
private readonly domSanitizer;
|
|
1173
|
+
/**
|
|
1174
|
+
* The type of messages this service handles ('theme').
|
|
1175
|
+
*/
|
|
1176
|
+
readonly type = "theme";
|
|
1177
|
+
/**
|
|
1178
|
+
* The supported versions of theme messages and their handlers.
|
|
1179
|
+
*/
|
|
1180
|
+
readonly supportedVersions: {
|
|
1181
|
+
/**
|
|
1182
|
+
* Use the message paylod to get the theme and apply it
|
|
1183
|
+
* @param message message to consume
|
|
1146
1184
|
*/
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
*/
|
|
1152
|
-
'1.0': (message: RoutedMessage<ThemeV1_0>) => Promise<void>;
|
|
1153
|
-
};
|
|
1154
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ThemeConsumerService, never>;
|
|
1155
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1185
|
+
'1.0': (message: RoutedMessage<ThemeV1_0>) => Promise<void>;
|
|
1186
|
+
};
|
|
1187
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ThemeConsumerService, never>;
|
|
1188
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1156
1189
|
}
|
|
1157
|
-
|
|
1158
1190
|
/** Default suffix for an url containing a theme css file */
|
|
1159
|
-
declare const THEME_URL_SUFFIX = "-theme.css";
|
|
1191
|
+
export declare const THEME_URL_SUFFIX = "-theme.css";
|
|
1160
1192
|
/** Default name for the query parameter containing the theme name */
|
|
1161
|
-
declare const THEME_QUERY_PARAM_NAME = "theme";
|
|
1193
|
+
export declare const THEME_QUERY_PARAM_NAME = "theme";
|
|
1162
1194
|
/** Options and context for Style helpers */
|
|
1163
|
-
interface StyleHelperOptions {
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1195
|
+
export interface StyleHelperOptions {
|
|
1196
|
+
/**
|
|
1197
|
+
* Logger to reporter the logs
|
|
1198
|
+
*/
|
|
1199
|
+
logger?: Logger;
|
|
1168
1200
|
}
|
|
1169
1201
|
/**
|
|
1170
1202
|
* Fetches a CSS document and returns the content as a string.
|
|
@@ -1172,19 +1204,19 @@ interface StyleHelperOptions {
|
|
|
1172
1204
|
* @param options Options and context for Style helpers
|
|
1173
1205
|
* @returns The content of the CSS document as a string, empty string if the fetch fails.
|
|
1174
1206
|
*/
|
|
1175
|
-
declare function getStyle(cssPath: string, options?: StyleHelperOptions): Promise<string>;
|
|
1207
|
+
export declare function getStyle(cssPath: string, options?: StyleHelperOptions): Promise<string>;
|
|
1176
1208
|
/**
|
|
1177
1209
|
* Applies the given CSS theme as a stylesheet.
|
|
1178
1210
|
* @param themeValue - CSS as text containing a theme definition.
|
|
1179
1211
|
* @param cleanPrevious - Whether to remove previously applied stylesheets if no themeValue provided. Default is true.
|
|
1180
1212
|
*/
|
|
1181
|
-
declare function applyTheme(themeValue?: string, cleanPrevious?: boolean): void;
|
|
1213
|
+
export declare function applyTheme(themeValue?: string, cleanPrevious?: boolean): void;
|
|
1182
1214
|
/**
|
|
1183
1215
|
* Download the application additional theme
|
|
1184
1216
|
* @param theme Name of the theme to download from the current application
|
|
1185
1217
|
* @param options Options and context for Style helpers
|
|
1186
1218
|
*/
|
|
1187
|
-
declare function downloadApplicationThemeCss(theme: string, options?: StyleHelperOptions): Promise<string>;
|
|
1219
|
+
export declare function downloadApplicationThemeCss(theme: string, options?: StyleHelperOptions): Promise<string>;
|
|
1188
1220
|
/**
|
|
1189
1221
|
* Applies the initial theme based on the URL query parameters.
|
|
1190
1222
|
*
|
|
@@ -1192,253 +1224,247 @@ declare function downloadApplicationThemeCss(theme: string, options?: StyleHelpe
|
|
|
1192
1224
|
* If a referrer is present, it also attempts to fetch and apply the theme from the referrer's URL.
|
|
1193
1225
|
* @param options Options and context for Style helpers
|
|
1194
1226
|
*/
|
|
1195
|
-
declare function applyInitialTheme(options?: StyleHelperOptions): Promise<PromiseSettledResult<void>[] | undefined>;
|
|
1196
|
-
|
|
1227
|
+
export declare function applyInitialTheme(options?: StyleHelperOptions): Promise<PromiseSettledResult<void>[] | undefined>;
|
|
1197
1228
|
/**
|
|
1198
1229
|
* This service exposing the current theme signal
|
|
1199
1230
|
*/
|
|
1200
|
-
declare class ThemeProducerService implements MessageProducer<ThemeMessage> {
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1231
|
+
export declare class ThemeProducerService implements MessageProducer<ThemeMessage> {
|
|
1232
|
+
private readonly messageService;
|
|
1233
|
+
private readonly logger;
|
|
1234
|
+
private previousTheme;
|
|
1235
|
+
private readonly window;
|
|
1236
|
+
private readonly currentThemeSelection;
|
|
1237
|
+
/** Current selected theme signal */
|
|
1238
|
+
readonly currentTheme: import("@angular/core").Signal<ThemeStructure | undefined>;
|
|
1239
|
+
/**
|
|
1240
|
+
* The type of messages this service handles ('theme').
|
|
1241
|
+
*/
|
|
1242
|
+
readonly types = "theme";
|
|
1243
|
+
constructor();
|
|
1244
|
+
/**
|
|
1245
|
+
* Changes the current theme to the specified theme name.
|
|
1246
|
+
* @param themeName - The name of the theme to change to.
|
|
1247
|
+
*/
|
|
1248
|
+
changeTheme(themeName?: string): Promise<void>;
|
|
1249
|
+
/**
|
|
1250
|
+
* Reverts to the previous theme.
|
|
1251
|
+
*/
|
|
1252
|
+
revertToPreviousTheme(): void;
|
|
1253
|
+
/**
|
|
1254
|
+
* @inheritdoc
|
|
1255
|
+
*/
|
|
1256
|
+
handleError(message: ErrorContent<ThemeV1_0>): void;
|
|
1257
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ThemeProducerService, never>;
|
|
1258
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1228
1259
|
}
|
|
1229
|
-
|
|
1230
1260
|
/**
|
|
1231
1261
|
* Information about user activity received from another context
|
|
1232
1262
|
*/
|
|
1233
|
-
interface ActivityInfo {
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1263
|
+
export interface ActivityInfo {
|
|
1264
|
+
/** The channel ID (source ID) that sent the activity */
|
|
1265
|
+
channelId: string;
|
|
1266
|
+
/** The type of activity event */
|
|
1267
|
+
eventType: string;
|
|
1268
|
+
/** Timestamp when the activity occurred */
|
|
1269
|
+
timestamp: number;
|
|
1240
1270
|
}
|
|
1241
1271
|
/**
|
|
1242
1272
|
* Configuration options for the activity producer service
|
|
1243
1273
|
*/
|
|
1244
|
-
interface ActivityProducerConfig {
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1274
|
+
export interface ActivityProducerConfig {
|
|
1275
|
+
/**
|
|
1276
|
+
* Minimum interval in milliseconds between activity messages sent to the consumer.
|
|
1277
|
+
* When multiple events occur within this interval, only the first one triggers a message.
|
|
1278
|
+
* This prevents flooding the communication channel with too many messages.
|
|
1279
|
+
*/
|
|
1280
|
+
throttleMs: number;
|
|
1281
|
+
/**
|
|
1282
|
+
* Optional filter function to determine if an event should be broadcast to the host(shell) app.
|
|
1283
|
+
* Return true to broadcast the event, false to ignore it.
|
|
1284
|
+
* Useful for filtering out events that occur on specific elements (e.g., iframes handled separately).
|
|
1285
|
+
* @param event The DOM event that triggered the activity
|
|
1286
|
+
* @returns Whether the event should be broadcast
|
|
1287
|
+
*/
|
|
1288
|
+
shouldBroadcast?: (event: Event) => boolean;
|
|
1289
|
+
/**
|
|
1290
|
+
* Enable tracking of nested iframes. When enabled, the service will detect when focus
|
|
1291
|
+
* moves to an iframe within the document and send periodic activity signals while
|
|
1292
|
+
* the iframe has focus. This is useful for modules that contain iframes whose content
|
|
1293
|
+
* cannot be modified to include activity tracking.
|
|
1294
|
+
*/
|
|
1295
|
+
trackNestedIframes?: boolean;
|
|
1296
|
+
/**
|
|
1297
|
+
* Interval in milliseconds for polling document.activeElement to detect iframe focus.
|
|
1298
|
+
* Only used when trackNestedIframes is true.
|
|
1299
|
+
* @default 1000
|
|
1300
|
+
*/
|
|
1301
|
+
nestedIframePollIntervalMs?: number;
|
|
1302
|
+
/**
|
|
1303
|
+
* Interval in milliseconds for sending activity signals to the host(shell) app while a nested iframe has focus.
|
|
1304
|
+
* Only used when trackNestedIframes is true.
|
|
1305
|
+
* @default 30000
|
|
1306
|
+
*/
|
|
1307
|
+
nestedIframeActivityEmitIntervalMs?: number;
|
|
1308
|
+
/**
|
|
1309
|
+
* Throttle time in milliseconds for high-frequency events (scroll, mousemove).
|
|
1310
|
+
* These events are throttled to avoid performance issues.
|
|
1311
|
+
* @default 300
|
|
1312
|
+
*/
|
|
1313
|
+
highFrequencyThrottleMs?: number;
|
|
1284
1314
|
}
|
|
1285
1315
|
/**
|
|
1286
1316
|
* Configuration for the iframe activity tracker
|
|
1287
1317
|
*/
|
|
1288
|
-
interface IframeActivityTrackerConfig {
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1318
|
+
export interface IframeActivityTrackerConfig {
|
|
1319
|
+
/**
|
|
1320
|
+
* Interval in milliseconds for polling document.activeElement to detect iframe focus.
|
|
1321
|
+
* @default 1000
|
|
1322
|
+
*/
|
|
1323
|
+
pollIntervalMs?: number;
|
|
1324
|
+
/**
|
|
1325
|
+
* Interval in milliseconds for sending activity signals to the host(shell) app while an iframe has focus.
|
|
1326
|
+
* @default 30000
|
|
1327
|
+
*/
|
|
1328
|
+
activityIntervalMs?: number;
|
|
1329
|
+
/**
|
|
1330
|
+
* Callback to invoke when activity is detected
|
|
1331
|
+
*/
|
|
1332
|
+
onActivity: () => void;
|
|
1303
1333
|
}
|
|
1304
|
-
|
|
1305
1334
|
/**
|
|
1306
1335
|
* DOM events that indicate user activity
|
|
1307
1336
|
*/
|
|
1308
|
-
declare const ACTIVITY_EVENTS: readonly Exclude<UserActivityEventType, 'visibilitychange'>[];
|
|
1337
|
+
export declare const ACTIVITY_EVENTS: readonly Exclude<UserActivityEventType, 'visibilitychange'>[];
|
|
1309
1338
|
/**
|
|
1310
1339
|
* Custom activity event type for iframe interactions.
|
|
1311
1340
|
* Emitted programmatically when an iframe gains focus, not from a DOM event listener.
|
|
1312
1341
|
*/
|
|
1313
|
-
declare const IFRAME_INTERACTION_EVENT: UserActivityEventType;
|
|
1342
|
+
export declare const IFRAME_INTERACTION_EVENT: UserActivityEventType;
|
|
1314
1343
|
/**
|
|
1315
1344
|
* Custom activity event type for visibility changes.
|
|
1316
1345
|
* Emitted programmatically when the document becomes visible, not from a DOM event listener.
|
|
1317
1346
|
*/
|
|
1318
|
-
declare const VISIBILITY_CHANGE_EVENT: UserActivityEventType;
|
|
1347
|
+
export declare const VISIBILITY_CHANGE_EVENT: UserActivityEventType;
|
|
1319
1348
|
/**
|
|
1320
1349
|
* High-frequency events that require throttling to avoid performance issues
|
|
1321
1350
|
*/
|
|
1322
|
-
declare const HIGH_FREQUENCY_EVENTS: readonly UserActivityEventType[];
|
|
1351
|
+
export declare const HIGH_FREQUENCY_EVENTS: readonly UserActivityEventType[];
|
|
1323
1352
|
/**
|
|
1324
1353
|
* Default configuration values for the ActivityProducerService
|
|
1325
1354
|
*/
|
|
1326
|
-
declare const DEFAULT_ACTIVITY_PRODUCER_CONFIG: Readonly<ActivityProducerConfig>;
|
|
1327
|
-
|
|
1355
|
+
export declare const DEFAULT_ACTIVITY_PRODUCER_CONFIG: Readonly<ActivityProducerConfig>;
|
|
1328
1356
|
/**
|
|
1329
1357
|
* Generic service that tracks user activity and sends messages.
|
|
1330
1358
|
* Can be configured for different contexts (cockpit or modules) via start() method parameter.
|
|
1331
1359
|
*/
|
|
1332
|
-
declare class ActivityProducerService implements MessageProducer<UserActivityMessage> {
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1360
|
+
export declare class ActivityProducerService implements MessageProducer<UserActivityMessage> {
|
|
1361
|
+
private readonly messageService;
|
|
1362
|
+
private readonly destroyRef;
|
|
1363
|
+
private readonly iframeActivityTracker;
|
|
1364
|
+
private readonly logger;
|
|
1365
|
+
/**
|
|
1366
|
+
* Timestamp of the last sent activity message
|
|
1367
|
+
*/
|
|
1368
|
+
private lastSentTimestamp;
|
|
1369
|
+
/**
|
|
1370
|
+
* Bound event listeners for cleanup
|
|
1371
|
+
*/
|
|
1372
|
+
private readonly boundListeners;
|
|
1373
|
+
/**
|
|
1374
|
+
* Last emission timestamps for throttled high-frequency events
|
|
1375
|
+
*/
|
|
1376
|
+
private readonly lastEmitTimestamps;
|
|
1377
|
+
/**
|
|
1378
|
+
* Whether the service has been started
|
|
1379
|
+
*/
|
|
1380
|
+
private started;
|
|
1381
|
+
/**
|
|
1382
|
+
* Signal that emits local activity information.
|
|
1383
|
+
* This allows consumers to react to activity detected by this producer.
|
|
1384
|
+
*/
|
|
1385
|
+
private readonly localActivityWritable;
|
|
1386
|
+
/**
|
|
1387
|
+
* Read-only signal containing the latest local activity info.
|
|
1388
|
+
* Use this signal to react to locally detected activity.
|
|
1389
|
+
*/
|
|
1390
|
+
readonly localActivity: import("@angular/core").Signal<ActivityInfo | undefined>;
|
|
1391
|
+
/**
|
|
1392
|
+
* @inheritdoc
|
|
1393
|
+
*/
|
|
1394
|
+
readonly types = "user_activity";
|
|
1395
|
+
constructor();
|
|
1396
|
+
/**
|
|
1397
|
+
* Checks if a high-frequency event should be processed based on throttle timing.
|
|
1398
|
+
* This is called before shouldBroadcast to avoid expensive filter operations on every event.
|
|
1399
|
+
* @param eventType The type of activity event
|
|
1400
|
+
* @param throttleMs The throttle interval in milliseconds
|
|
1401
|
+
* @returns true if the event should be processed, false if it should be skipped
|
|
1402
|
+
*/
|
|
1403
|
+
private shouldProcessHighFrequencyEvent;
|
|
1404
|
+
/**
|
|
1405
|
+
* Handles activity by sending a throttled message and emitting to local signal.
|
|
1406
|
+
* @param eventType The type of activity event that occurred
|
|
1407
|
+
* @param configObject
|
|
1408
|
+
*/
|
|
1409
|
+
private onActivity;
|
|
1410
|
+
/**
|
|
1411
|
+
* Sends an activity message.
|
|
1412
|
+
* @param eventType The type of activity event
|
|
1413
|
+
* @param timestamp The timestamp of the event
|
|
1414
|
+
*/
|
|
1415
|
+
private sendActivityMessage;
|
|
1416
|
+
/**
|
|
1417
|
+
* @inheritdoc
|
|
1418
|
+
*/
|
|
1419
|
+
handleError(message: ErrorContent<UserActivityMessage>): void;
|
|
1420
|
+
/**
|
|
1421
|
+
* Starts observing user activity events.
|
|
1422
|
+
* When activity is detected, it sends a throttled message.
|
|
1423
|
+
* Event listeners are attached after the next render to ensure DOM is ready.
|
|
1424
|
+
* @param config Configuration for the activity producer
|
|
1425
|
+
*/
|
|
1426
|
+
start(config?: Partial<ActivityProducerConfig>): void;
|
|
1427
|
+
/**
|
|
1428
|
+
* Stops observing user activity events.
|
|
1429
|
+
*/
|
|
1430
|
+
stop(): void;
|
|
1431
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ActivityProducerService, never>;
|
|
1432
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1405
1433
|
}
|
|
1406
|
-
|
|
1407
1434
|
/**
|
|
1408
1435
|
* Generic service that consumes user activity messages.
|
|
1409
1436
|
* Can be used in both shell (to receive from modules) and modules (to receive from shell).
|
|
1410
1437
|
*/
|
|
1411
|
-
declare class ActivityConsumerService implements BasicMessageConsumer<UserActivityMessageV1_0> {
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1438
|
+
export declare class ActivityConsumerService implements BasicMessageConsumer<UserActivityMessageV1_0> {
|
|
1439
|
+
private readonly consumerManagerService;
|
|
1440
|
+
/**
|
|
1441
|
+
* Signal containing the latest activity info
|
|
1442
|
+
*/
|
|
1443
|
+
private readonly latestReceivedActivityWritable;
|
|
1444
|
+
/**
|
|
1445
|
+
* Read-only signal containing the latest activity info received from other peers via the message protocol.
|
|
1446
|
+
* Access the timestamp via latestReceivedActivity()?.timestamp
|
|
1447
|
+
*/
|
|
1448
|
+
readonly latestReceivedActivity: import("@angular/core").Signal<ActivityInfo | undefined>;
|
|
1449
|
+
/**
|
|
1450
|
+
* @inheritdoc
|
|
1451
|
+
*/
|
|
1452
|
+
readonly type = "user_activity";
|
|
1453
|
+
/**
|
|
1454
|
+
* @inheritdoc
|
|
1455
|
+
*/
|
|
1456
|
+
readonly supportedVersions: Record<string, (message: RoutedMessage<UserActivityMessageV1_0>) => void>;
|
|
1457
|
+
/**
|
|
1458
|
+
* Starts the activity consumer service by registering it with the consumer manager.
|
|
1459
|
+
*/
|
|
1460
|
+
start(): void;
|
|
1461
|
+
/**
|
|
1462
|
+
* Stops the activity consumer service by unregistering it from the consumer manager.
|
|
1463
|
+
*/
|
|
1464
|
+
stop(): void;
|
|
1465
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ActivityConsumerService, never>;
|
|
1466
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1440
1467
|
}
|
|
1441
|
-
|
|
1442
1468
|
/**
|
|
1443
1469
|
* Service that tracks user activity within nested iframes.
|
|
1444
1470
|
*
|
|
@@ -1450,94 +1476,91 @@ declare class ActivityConsumerService implements BasicMessageConsumer<UserActivi
|
|
|
1450
1476
|
* that bubble to the parent, and the regular activity tracker can't detect
|
|
1451
1477
|
* user interactions inside iframes.
|
|
1452
1478
|
*/
|
|
1453
|
-
declare class IframeActivityTrackerService {
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1479
|
+
export declare class IframeActivityTrackerService {
|
|
1480
|
+
/**
|
|
1481
|
+
* Interval ID for polling activeElement
|
|
1482
|
+
*/
|
|
1483
|
+
private pollIntervalId?;
|
|
1484
|
+
/**
|
|
1485
|
+
* Interval ID for emitting activity at configured interval
|
|
1486
|
+
*/
|
|
1487
|
+
private activityIntervalId?;
|
|
1488
|
+
/**
|
|
1489
|
+
* Current configuration
|
|
1490
|
+
*/
|
|
1491
|
+
private config?;
|
|
1492
|
+
/**
|
|
1493
|
+
* Bound visibility change handler for cleanup
|
|
1494
|
+
*/
|
|
1495
|
+
private readonly visibilityChangeHandler;
|
|
1496
|
+
/**
|
|
1497
|
+
* Whether the service has been started
|
|
1498
|
+
*/
|
|
1499
|
+
private get started();
|
|
1500
|
+
/**
|
|
1501
|
+
* Whether we are currently tracking iframe activity (iframe had focus on last poll)
|
|
1502
|
+
*/
|
|
1503
|
+
private get isTrackingIframeActivity();
|
|
1504
|
+
/**
|
|
1505
|
+
* Polls document.activeElement to detect iframe focus changes.
|
|
1506
|
+
* When iframe gains focus: emit immediately and start activity interval.
|
|
1507
|
+
* When iframe loses focus: stop activity interval.
|
|
1508
|
+
*/
|
|
1509
|
+
private checkActiveElement;
|
|
1510
|
+
/**
|
|
1511
|
+
* Handles visibility change events to pause/resume polling when tab visibility changes.
|
|
1512
|
+
*/
|
|
1513
|
+
private handleVisibilityChange;
|
|
1514
|
+
/**
|
|
1515
|
+
* Starts polling for active element changes.
|
|
1516
|
+
*/
|
|
1517
|
+
private startPolling;
|
|
1518
|
+
/**
|
|
1519
|
+
* Stops polling for active element changes.
|
|
1520
|
+
*/
|
|
1521
|
+
private stopPolling;
|
|
1522
|
+
/**
|
|
1523
|
+
* Starts the activity emission interval.
|
|
1524
|
+
*/
|
|
1525
|
+
private startActivityInterval;
|
|
1526
|
+
/**
|
|
1527
|
+
* Stops the activity emission interval.
|
|
1528
|
+
*/
|
|
1529
|
+
private stopActivityInterval;
|
|
1530
|
+
/**
|
|
1531
|
+
* Starts tracking nested iframes within the document.
|
|
1532
|
+
* @param config Configuration for the tracker
|
|
1533
|
+
*/
|
|
1534
|
+
start(config: IframeActivityTrackerConfig): void;
|
|
1535
|
+
/**
|
|
1536
|
+
* Stops tracking nested iframes and cleans up resources.
|
|
1537
|
+
*/
|
|
1538
|
+
stop(): void;
|
|
1539
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IframeActivityTrackerService, never>;
|
|
1540
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1515
1541
|
}
|
|
1516
|
-
|
|
1517
1542
|
/**
|
|
1518
1543
|
* A constant array of known message types and their versions.
|
|
1519
1544
|
*/
|
|
1520
|
-
declare const KNOWN_MESSAGES: [{
|
|
1521
|
-
|
|
1522
|
-
|
|
1545
|
+
export declare const KNOWN_MESSAGES: [{
|
|
1546
|
+
readonly type: "error";
|
|
1547
|
+
readonly version: "1.0";
|
|
1523
1548
|
}];
|
|
1524
1549
|
/**
|
|
1525
1550
|
* Returns the default options for starting a client endpoint peer connection.
|
|
1526
1551
|
* As `origin`, it will take the hostURL from {@link getHostInfo} and the `window` will be the parent window.
|
|
1527
1552
|
*/
|
|
1528
|
-
declare function getDefaultClientEndpointStartOptions(): PeerConnectionOptions;
|
|
1553
|
+
export declare function getDefaultClientEndpointStartOptions(): PeerConnectionOptions;
|
|
1529
1554
|
/**
|
|
1530
1555
|
* Return `true` if embedded inside an iframe, `false` otherwise
|
|
1531
1556
|
* @param windowParam - A {@link window} object with information about the current window of the document. Defaults to global {@link window}.
|
|
1532
1557
|
*/
|
|
1533
|
-
declare function isEmbedded(windowParam?: Window): boolean;
|
|
1558
|
+
export declare function isEmbedded(windowParam?: Window): boolean;
|
|
1534
1559
|
/**
|
|
1535
1560
|
* Generate a string id suitable for correlating asynchronous request/reply messages across the micro-frontend bus.
|
|
1536
1561
|
* Uses `crypto.randomUUID` when the runtime supports it, otherwise falls back to a timestamp + random suffix.
|
|
1537
1562
|
* @param prefix Optional prefix used by the fallback path to make ids easier to identify in logs (ignored when `crypto.randomUUID` is available).
|
|
1538
1563
|
*/
|
|
1539
|
-
declare function generateCorrelationId(prefix?: string): string;
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
export type { ActivityInfo, ActivityProducerConfig, BasicMessageConsumer, ConnectionConfigOptions, ErrorContent, ErrorMessage, ErrorMessageV1_0, ErrorReason, IframeActivityTrackerConfig, MFEHostInformation, MessageCallback, MessageConsumer, MessageProducer, MessageVersions, NavigationBlockConfirmation, NavigationBlockState, NavigationRequestContext, NavigationRequestHandler, ObservedNavigationBlockState, RestoreRouteOptions, RoutingServiceOptions, StyleHelperOptions };
|
|
1543
|
-
//# sourceMappingURL=ama-mfe-ng-utils.d.ts.map
|
|
1564
|
+
export declare function generateCorrelationId(prefix?: string): string;
|
|
1565
|
+
export { type ConnectionConfig, ConnectionService };
|
|
1566
|
+
//# sourceMappingURL=ama-mfe-ng-utils.d.ts.map
|