@elliemae/ssf-host 2.25.3 → 2.25.5

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.
@@ -143,3 +143,62 @@ export type AttachParam = {
143
143
  */
144
144
  searchParams?: Record<string, string | number | boolean>;
145
145
  };
146
+ /**
147
+ * Options for unloading a guest application with enhanced cleanup.
148
+ *
149
+ * When purgeOnDestroy is true, performs comprehensive memory leak prevention:
150
+ * - Calls guest cleanup function (React unmount, Redux teardown)
151
+ * - Closes contentWindow context
152
+ * - Navigates iframe to about:blank (Chrome GC recommendation)
153
+ * - Removes iframe from DOM (deferred)
154
+ * - Clears all window.emui and window.elli.script references
155
+ * - Disconnects FieldMutation observers
156
+ * - Removes from SSF tracking maps
157
+ */
158
+ export type UnloadOptions = {
159
+ /**
160
+ * When true, uses comprehensive cleanup sequence via unloadGuestWithFullCleanup.
161
+ * When false or omitted, uses standard guest disposal.
162
+ * @default false
163
+ */
164
+ purgeOnDestroy?: boolean;
165
+ /**
166
+ * Array of window reference paths to clear recursively.
167
+ * Each path is a dot-separated string (e.g., "window.IMT.focusFormTitle").
168
+ * The "window" prefix is optional and will be stripped automatically.
169
+ *
170
+ * All specified references will be set to null to break closure chains
171
+ * and allow garbage collection.
172
+ * @example
173
+ * ```typescript
174
+ * windowRefsToClear: [
175
+ * "window.IMT.focusFormTitle",
176
+ * "window.emui.customApp",
177
+ * "IMT.someOtherRef" // window prefix is optional
178
+ * ]
179
+ * ```
180
+ */
181
+ windowRefsToClear?: string[];
182
+ /**
183
+ * Optional appId for targeted window.emui[appId] cleanup.
184
+ * When provided, cleans up window.emui[appId] directly without scanning.
185
+ * @example
186
+ * ```typescript
187
+ * appId: "workflowtasks" // cleans window.emui.workflowtasks
188
+ * appId: "loanapp" // cleans window.emui.loanapp
189
+ * ```
190
+ */
191
+ appId?: string;
192
+ /**
193
+ * Name of the cleanup function on window.emui in the guest iframe.
194
+ * This function should handle guest-side cleanup like React unmounting
195
+ * and Redux store teardown.
196
+ * @default "unmount"
197
+ * @example
198
+ * ```typescript
199
+ * cleanupFunctionName: "rendererCleanup" // calls window.emui.rendererCleanup()
200
+ * cleanupFunctionName: "cleanup" // calls window.emui.cleanup()
201
+ * ```
202
+ */
203
+ cleanupFunctionName?: string;
204
+ };